1 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3 * nsterm.m (hold_event_q): New static variable.
4 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
6 (hold_event): New function.
7 (ns_read_socket): If hold_event_q have events, store them and
9 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
12 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
14 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
16 2012-10-12 Eli Zaretskii <eliz@gnu.org>
18 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
20 * fileio.c (check_existing): New function.
21 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
22 instead of calling 'stat', when what's needed is to check whether
23 a file exists. This avoids expensive system calls on MS-Windows.
26 * w32.c (init_environment): Call 'check_existing' instead of
29 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
30 determine whether a file exists and is not a directory.
32 * lisp.h (check_existing): Add prototype.
34 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
36 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
38 2012-10-12 Glenn Morris <rgm@gnu.org>
40 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
42 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
44 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
46 * eval.c (Fautoload): Remember previous autoload status in load-history.
48 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
50 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
51 * lread.c (load_each_byte, new_backquote_flag, readchar)
52 (read_filtered_event, lisp_file_lexically_bound_p)
53 (safe_to_load_version, Fload, complete_filename_p, openp)
54 (build_load_history, readevalloop, read_escape, read1)
55 (string_to_number, read_vector, read_list):
56 * macros.c (Fstart_kbd_macro):
57 * marker.c (CONSIDER):
58 * menu.c (parse_single_submenu, digest_single_submenu)
59 (find_and_return_menu_selection, Fx_popup_menu):
60 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
62 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
64 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
65 (xmenu_show, xdialog_show):
66 Use bool for booleans.
67 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
68 as it's not a predicate. All uses changed. Omit unnecessary
71 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
73 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
74 (save_excursion_restore): Do not restore mark if it was not saved.
76 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
78 * marker.c (cached_modiff): EMACS_INT, not int.
80 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
81 instead of having a wrong decl.
82 * nsmenu.m (waiting_for_input): Remove wrong decl.
84 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
86 keyboard.c, keymap.c: Use bool for booleans.
87 * dispnew.c (sit_for): Distinguish between 3-way display_option
88 and boolean do_display.
89 * keyboard.c (single_kboard, this_command_key_count_reset)
90 (waiting_for_input, echoing, immediate_quit, input_pending)
91 (interrupt_input, interrupts_deferred, pop_kboard)
92 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
93 (command_loop_1, adjust_point_for_property)
94 (safe_run_hooks_error, input_polling_used, read_char):
95 (help_char_p, readable_events, kbd_buffer_events_waiting)
96 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
97 (lucid_event_type_list_p, get_input_pending):
98 (gobble_input, menu_separator_name_p, menu_bar_item)
99 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
100 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
101 (keyremap_step, test_undefined, read_key_sequence)
102 (detect_input_pending, detect_input_pending_ignore_squeezables)
103 (detect_input_pending_run_timers, requeued_events_pending_p)
104 (quit_throw_to_read_char, Fset_input_interrupt_mode):
105 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
106 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
107 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
108 (accessible_keymaps_1, Fkey_description, push_key_description):
109 (shadow_lookup, struct where_is_internal_data)
110 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
111 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
112 (describe_map, describe_vector):
113 * menu.c (single_menu_item):
114 * nsmenu.m (ns_update_menubar):
115 * process.c (wait_reading_process_output):
116 * search.c (scan_buffer, scan_newline):
117 Use bool for boolean.
118 * keyboard.c (timers_run, swallow_events)
119 (detect_input_pending_run_timers):
120 * process.c (wait_reading_process_output):
121 Use unsigned for counter where wraparound-on-overflow is desired,
122 since unsigned is guaranteed to have that behavior and signed is not.
123 (read_char): Use ptrdiff_t for string length.
124 (get_input_pending): Remove first argument, since it was always
125 the same pointer-to-int (now pointer-to-boolean) &input_pending,
126 and behave as if it had that value. Return new value of
127 input_pending. All callers changed.
128 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
129 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
131 * keymap.c (push_key_description): Omit last arg, which was always 1.
134 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
136 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
138 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
139 ($(BLD)/term.$(O)): Update dependencies.
141 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
143 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
144 * lisp.h (enum pvec_type): Adjust comments and omit explicit
145 initializer for PVEC_NORMAL_VECTOR.
147 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
149 Clean out old termopts cruft.
150 * termopts.h (flow_control, meta_key): Remove unused decls.
151 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
152 Don't include termopts.h.
154 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
156 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
158 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
160 * commands.h (immediate_quit): Remove duplicate decl.
162 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
164 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
166 (nsfont_open): Remove setting of Vfonts_in_cache.
167 (syms_of_nsfont): Remove initialization of Vfonts_in_cache
169 2012-10-09 Eli Zaretskii <eliz@gnu.org>
171 * w32fns.c (w32_last_error): Change the return value to DWORD, to
172 match what GetLastError returns. Explain why the function is
175 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
176 'is_tooltip_frame', to avoid confusion with its global namesake.
178 2012-10-08 Daniel Colascione <dancol@dancol.org>
180 * xdisp.c (start_hourglass): Call w32_note_current_window when
181 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
182 build that caused Emacs to display the hourglass cursor forever.
184 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
185 which is broken under remote desktop, calculate the number of
186 colors available for a display based on the display's number of
187 planes and number of bits per pixel per plane. (bug#10397).
189 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
191 * nsfont.m (Vfonts_in_cache): New variable.
192 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
193 are used. Add cached fonts to Vfonts_in_cache.
194 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
196 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
198 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
200 (FONT_H): Define after FRAME_H.
201 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
204 * w32term.c: Remove leftover declaration of keyboard_codepage.
206 2012-10-08 Eli Zaretskii <eliz@gnu.org>
208 * makefile.w32-in (FONT_H): Add $(FRAME_H).
209 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
210 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
211 (GLOBAL_SOURCES): Add cygw32.c.
212 ($(BLD)/unexw32.$(O)):
214 ($(BLD)/w32console.$(O)):
215 ($(BLD)/w32fns.$(O)):
216 ($(BLD)/w32heap.$(O)):
217 ($(BLD)/w32menu.$(O)):
218 ($(BLD)/w32proc.$(O)): Add w32common.h.
220 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
222 (x_to_w32_color): Don't modify the argument, modify a copy instead.
224 2012-10-08 Daniel Colascione <dancol@dancol.org>
226 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
227 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
228 accidental message numbering hole. Change other messages to
231 * w32select.h (HAVE_W32SELECT): Remove.
233 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
234 w32common.h instead of w32heap.h
236 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
237 (get_allocation_unit, get_processor_type, get_w32_major_version)
238 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
239 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
240 (OS_NT, os_subtype, cache_system_info): Move declarations to
243 * w32heap.c: Include w32common.h.
244 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
245 (w32_minor_version, w32_build_number, w32_subtype): Remove
246 duplicate definitions.
248 * w32fns.c: Include w32common.h; include w32heap.h only in
251 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
252 Use `report_file_error' instead of `error' in order to better
253 inform users of what went wrong. Increase NTGUI_UNICODE file
254 dialog box file name length to 32k, the maximum allowed by the NT
257 * w32common.h: New file.
258 (ROUND_UP, ROUND_DOWN, get_page_size)
259 (get_allocation_unit, get_processor_type, get_w32_major_version)
260 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
261 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
262 (OS_NT, os_subtype, cache_system_info): Move here.
264 * unexw32.c, unexcw.c: Include w32common.h.
266 * emacs.c (main): Use (defined (WINDOWSNT) || defined
267 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
268 to call syms_of_w32select.
270 * cygw32.h: Remove obsolete EXFUN declarations.
272 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
274 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
275 of w32inevt.o from SOME_MACHINE_OBJECTS.
277 2012-10-08 Daniel Colascione <dancol@dancol.org>
279 * image.c: Permanent fix for JPEG compilation issue --- limit
280 jpeglib `boolean' redefinition to Cygwin builds.
282 2012-10-08 Eli Zaretskii <eliz@gnu.org>
284 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
286 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
289 2012-10-08 Daniel Colascione <dancol@dancol.org>
291 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
292 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
293 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
294 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
295 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
296 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
297 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
298 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
299 now a supported configuration.
301 * Makefile.in: consolidate image variables into LIBIMAGE; add
302 W32_OBJ and W32_LIBS. Compile new files.
305 (_DebPrint) declare tracing facility for W32 debugging. We need
306 to unify tracing later.
308 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
309 unconditional use of W32 Unicode functions. Cygwin runs only on
310 100% Unicode operating systems.
312 * cygw32.c: New file. Define Cygwin-specific facilities.
313 (Fcygwin_convert_path_to_windows)
314 (Fcygwin_convert_path_from_windows): New user functions for
315 accessing Cygwin path-munging routines.
317 * cygw32.h: New file.
318 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
319 UTF-16LE strings temporarily inside non-Lisp-visible string
322 (w32_strerror): Just what it says on the tin.
324 * emacs.c: Make the NS fork-then-exec code for daemon-launching
325 also run for Cygwin; both systems have the same problem with using
326 GUI facilities in a forked child. Also call syms_of_cygw32,
327 syms_of_w32select in correct places.
329 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
330 needs fork-then-exec for daemon launching.
332 * font.h: Include frame.h.
334 * image.c: Use the image library cache machinery only when we're
335 compiling for native WINDOWSNT; Cygwin can use shared libraries
336 like any other Unixlike system.
338 * keyboard.c: Clarify a comment regarding the input loop.
340 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
341 functions directly instead of trying to detect at runtime that our
342 host operating system supports them. We make this change for two
343 reasons: Cygwin lacks support for the multibyte character
344 conversion functions used by the legacy menu code, and Cygwin
345 never needs to rely on non-Unicode APIs.
347 * unexw32.c (hinst): Declare extern.
349 * w32.c: Change header order;
350 (w32_strerror): Move to w32fns.c because we need it for
351 non-WINDOWSNT builds.
353 * w32.h: Add #error macro to make sure we don't include w32.h for
354 Cygwin builds. Remove w32select declarations.
356 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
357 w32fns.c. w32console.c is WINDOWSNT-only.
359 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
360 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
362 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
363 (w32_major_version, w32_minor_version, w32_build_number)
364 (os_subtype, sound_type): Define here
365 (w32_defined_color): Make color parameter const for consistency
366 with other _defined_color functions.
367 (w32_createwindow): Unconditionally call w32_init_class instead of
368 doing so only when hprevinst is non-NULL. Plumbing hprevinst
369 through the code is complex and unnecessary because class
370 registration is practically free.
371 (w32_name_of_message): New EMACSDEBUG-only function.
372 (Fset_message_beep): Move here
373 (Fx_open_connection): Require that the display name for Windows be
374 "w32" for consistency, emacsclient disambiguation, and maybe, one
375 day, multi-window-system support.
376 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
377 Cygwin files for W32 GUI facilities, since these clearly don't
380 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
381 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
382 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
383 (w32_last_error): Remove.
385 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
387 * w32heap.c (syspage_mask): Declare here.
388 (cache_system_info): Remove.
390 * w32inevt.c (faked_key): Define globally, not statically.
391 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
392 (w32_console_toggle_lock_key): Move to w32fns.c.
394 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
396 * w32proc.c (_DebPrint): Move to w32fns.c.
397 * w32select.c: Include string.h, stdio.h for Cygwin.
398 * w32select.h: New File.
400 * w32term.c: Include io.h for non-CYGWIN builds; needed for
402 (w32_message_fd): New variable. Under Cygwin, holds the file
403 descriptor the system used to tell us about pending thread
406 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
407 that prevented compilation under non-WINDOWSNT systems.
409 (w32_initialize): Open /dev/windows and assign it to
410 w32_message_fd. Provide w32 feature.
412 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
413 (WM_EMACS_INPUT_READY): add.
414 (prepend_msg, w32_message_fd): Declare globally.
417 (keyboard_handle): Use only when WINDOWSNT.
418 (notify_msg_ready): New function. Posts a message to the main
419 thread's message queue under CYGWIN, which wakes up the main
420 thread from select(2) by making the /dev/windows file descriptor
421 ready. Under WINDOWSNT, it sets an event the same way the old
424 (post, prepend_msg): Actually call notify_msg_ready instead of
425 setting the input event directly.
427 2012-10-07 Eli Zaretskii <eliz@gnu.org>
429 * ralloc.c (relinquish): If a heap is ready to be relinquished,
430 but it still has blocs in it, don't return it to the system,
431 instead of aborting. (Bug#12402)
433 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
435 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
437 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
438 MAC_OS_X_VERSION_10_6.
439 (syms_of_nsterm): Remove comment about Panther and above for
441 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
442 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
443 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
445 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
446 MAC_OS_X_VERSION_10_4.
448 * nsmenu.m (fillWithWidgetValue:): Remove code for <
449 MAC_OS_X_VERSION_10_2.
451 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
453 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
454 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
456 * nsterm.m (ns_in_resize): Remove (Bug#12479).
457 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
458 (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove
460 (ns_clear_frame_area): Remove resize handle code.
462 * nsfns.m (ns_in_resize): Remove.
463 (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
466 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
468 Improve sys_siglist detection.
469 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
470 defined as a macro, as is done in Solaris.
471 (sys_siglist_entries): New macro.
472 (save_strsignal): Use it.
473 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
474 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
476 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
478 * nsfns.m (Fx_create_frame): Call x_default_parameter with
479 fullscreen/Fullscreen.
481 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
484 * nsterm.m (x_make_frame_visible): Check for fullscreen.
485 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
486 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
487 (windowDidResize:): Check for correct window if old style fullscreen.
488 Capitalize word in comment. Remove incorrect comment.
489 (initFrameFromEmacs:): tbar_height renamed tibar_height.
490 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
491 error in drawing background.
492 (toggleFullScreen:): Remove comment. Rearrange calls.
493 Set toolbar values to zero, save old height in tobar_height.
494 Restore tool bar height when leaving fullscreen.
495 (canBecomeMainWindow): New function.
497 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
499 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
501 2012-10-05 Eli Zaretskii <eliz@gnu.org>
503 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
505 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
506 that time stamps of directories could also be changed. Don't
507 request the too broad GENERIC_WRITE, only the more restrictive
508 FILE_WRITE_ATTRIBUTES access rights.
510 * fileio.c (Fset_file_times): Special-case ignoring errors for
511 directories only on MSDOS, not on MS-Windows.
513 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
515 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
517 2012-10-04 Eli Zaretskii <eliz@gnu.org>
519 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
520 see whether CreateFile failed.
522 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
524 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
525 to avoid similar races.
526 * keyboard.c (pending_signals): Now bool, not int.
528 Port timers to OpenBSD, plus check for timer failures.
529 OpenBSD problem reported by Han Boetes.
530 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
532 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
533 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
534 like OpenBSD, which has timer_settime but does not declare it.
535 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
536 whether to use itimerspec-related primitives. All uses of
537 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
539 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
541 * profiler.c (handle_profiler_signal): Fix a malloc race
542 that caused Emacs to hang on Fedora 17 when profiling Lisp.
544 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
546 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
548 2012-10-02 Eli Zaretskii <eliz@gnu.org>
550 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
551 consistent with the change in return value of 'safe_strsignal'.
553 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
555 Prefer plain 'static' to 'static inline' (Bug#12541).
556 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
557 (bidi_set_sor_type, bidi_push_embedding_level)
558 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
559 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
560 (bidi_cache_search, bidi_cache_ensure_space)
561 (bidi_cache_iterator_state, bidi_cache_find)
562 (bidi_peek_at_next_level, bidi_set_paragraph_end)
563 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
564 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
565 Now 'static', not 'static inline'.
567 Count overruns when profiling; change units to ns.
568 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
569 Give extra weight to samples after overruns, to attempt to count
570 the time more accurately.
571 (setup_cpu_timer): Change sampling interval units from ms to ns, since
572 the underlying primitives nominally do ns.
573 (Fprofiler_cpu_start): Document the change. Mention that
574 the sampling intervals are only approximate.
576 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
578 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
580 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
581 case for the special 0 coding-system.
583 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
584 (Fmake_overlay): Remove redundant tests.
585 (fix_start_end_in_overlays): Remove redundant recentering.
587 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
589 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
592 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
594 Fix a malloc race condition involving strsignal.
595 A signal can arrive in the middle of a malloc, and Emacs's signal
596 handler can invoke strsignal, which can invoke malloc, which is
597 not portable. This race condition bug makes Emacs hang on GNU/Linux.
598 Fix it by altering the signal handler so that it does not invoke
600 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
601 * process.c (status_message): Use const pointer, in case strsignal
602 is #defined to safe_strsignal.
603 * sysdep.c (sys_siglist, init_signals): Always define and
604 initialize a substitute sys_siglist if the system does not define
605 one, even if HAVE_STRSIGNAL.
606 (safe_strsignal): Rename from strsignal. Always define,
607 using sys_siglist. Return a const pointer.
608 * syssignal.h (safe_strsignal): New decl.
609 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
611 2012-10-01 Eli Zaretskii <eliz@gnu.org>
613 * w32proc.c (timer_loop): Fix code that waits for timer
614 expiration, to avoid high CPU usage.
616 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
618 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
619 (sweep_weak_table): Remove redundant prototypes.
621 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
623 * emacs.c: Move the inclusion of TERM_HEADER after including
624 windows.h on WINDOWSNT. This avoids compilation problems with
627 2012-10-01 Eli Zaretskii <eliz@gnu.org>
629 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
630 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
631 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
632 as the previous version used 'void *'.
634 * ralloc.c (ROUNDUP): Fix last change.
635 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
638 * w32proc.c <disable_itimers>: New static flag.
639 (init_timers): Initialize it to zero, after creating the critical
640 sections used by the timer threads.
641 (term_timers): Set to 1 before deleting the critical sections.
642 (getitimer, setitimer): If disable_itimers is non-zero, return an
643 error indication without doing anything. Reported by Fabrice
644 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
645 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
647 [!HAVE_SETITIMER]: Behave as the previous version that didn't
650 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
651 term_ntproc after all the other bookkeeping, to get timers working
654 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
656 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
657 Suggested by Juri Linkov in
658 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
660 Prefer plain 'static' to 'static inline' (Bug#12541).
661 With static functions, modern compilers inline pretty well by
662 themselves; advice from programmers often hurts as much as it helps.
663 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
664 this change shrinks the text size of the Emacs executable by 1.1%
665 without affecting CPU significantly in my benchmark.
666 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
667 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
668 (mark_maybe_object, mark_maybe_pointer, bounded_number):
669 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
670 (bset_auto_fill_function, bset_auto_save_file_format)
671 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
672 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
673 (bset_cache_long_line_scans, bset_case_fold_search)
674 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
675 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
676 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
677 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
678 (bset_header_line_format, bset_indicate_buffer_boundaries)
679 (bset_indicate_empty_lines, bset_invisibility_spec)
680 (bset_left_fringe_width, bset_major_mode, bset_mark)
681 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
682 (bset_name, bset_overwrite_mode, bset_pt_marker)
683 (bset_right_fringe_width, bset_save_length)
684 (bset_scroll_bar_width, bset_scroll_down_aggressively)
685 (bset_scroll_up_aggressively, bset_selective_display)
686 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
687 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
688 (set_buffer_overlays_after):
689 * category.c (bset_category_table):
690 * charset.c (read_hex):
691 * coding.c (produce_composition, produce_charset)
692 (handle_composition_annotation, handle_charset_annotation)
694 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
695 (assign_row, set_frame_matrix_frame, make_current)
697 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
698 * fns.c (maybe_resize_hash_table):
699 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
700 * gmalloc.c (register_heapinfo):
701 * image.c (lookup_image_type):
702 * intervals.c (set_interval_object, set_interval_left)
703 (set_interval_right, copy_interval_parent, rotate_right)
704 (rotate_left, balance_possible_root_interval):
705 * keyboard.c (kset_echo_string, kset_kbd_queue)
706 (kset_keyboard_translate_table, kset_last_prefix_arg)
707 (kset_last_repeatable_command, kset_local_function_key_map)
708 (kset_overriding_terminal_local_map, kset_real_last_command)
709 (kset_system_key_syms, clear_event, set_prop):
710 * lread.c (digit_to_number):
711 * marker.c (attach_marker, live_buffer, set_marker_internal):
712 * nsterm.m (ns_compute_glyph_string_overhangs):
713 * process.c (pset_buffer, pset_command)
714 (pset_decode_coding_system, pset_decoding_buf)
715 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
716 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
717 (pset_status, pset_tty_name, pset_type, pset_write_queue):
718 * syntax.c (bset_syntax_table, dec_bytepos):
719 * terminal.c (tset_param_alist):
720 * textprop.c (interval_has_some_properties)
721 (interval_has_some_properties_list):
722 * window.c (wset_combination_limit, wset_dedicated)
723 (wset_display_table, wset_hchild, wset_left_fringe_width)
724 (wset_left_margin_cols, wset_new_normal, wset_new_total)
725 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
726 (wset_right_fringe_width, wset_right_margin_cols)
727 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
728 (wset_vertical_scroll_bar_type, wset_window_parameters):
729 * xdisp.c (wset_base_line_number, wset_base_line_pos)
730 (wset_column_number_displayed, wset_region_showing)
731 (window_box_edges, run_window_scroll_functions)
732 (append_glyph_string_lists, prepend_glyph_string_lists)
733 (append_glyph_string, set_glyph_string_background_width)
734 (append_glyph, append_composite_glyph)
735 (take_vertical_position_into_account):
736 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
737 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
738 (lface_hash, lface_same_font_attributes_p, lookup_face):
739 * xml.c (libxml2_loaded_p):
740 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
741 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
742 Now 'static', not 'static inline'.
745 (bidi_copy_it): Do the whole copy with a single memcpy.
746 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
748 Revert the FOLLOW-SYMLINKS change for file-attributes.
749 Doing it right would require several changes to Tramp, and there's
750 not enough time to get that tested before the freeze today.
751 * dired.c (directory_files_internal, Ffile_attributes):
754 * frame.c (x_report_frame_params): Port better to wider ints.
755 Do not assume that EMACS_UINT is the same width as uprintmax_t,
756 or that pointers can be printed in 15 decimal digits.
757 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
759 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
761 Support x64 build on MS-Windows.
762 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
763 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
764 compatibility with x64.
765 (x_get_focus_frame): Add prototype.
767 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
768 defining an XRectangle structure.
770 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
771 arithmetics for compatibility with x64.
773 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
774 compatibility with x64.
776 * w32heap.h: Adjust prototypes and declarations.
778 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
779 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
780 DWORD, long, and unsigned long, for compatibility with x64.
781 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
782 (sbrk): Argument is now of type ptrdiff_t.
784 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
786 (w32_msg_pump): Use WPARAM type for 'result'.
788 * w32.c (init_environment, get_emacs_configuration): Support AMD64
790 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
791 compatibility with x64.
793 * vm-limit.c (lim_data): Now size_t.
794 (check_memory_limits): Adjust prototypes of real_morecore and
795 __morecore to receive argument of type ptrdiff_t. Use size_t for
796 five_percent and data_size.
798 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
799 variables, for compatibility with x64.
800 (rva_to_section, offset_to_section, relocate_offset)
801 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
802 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
803 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
804 for compatibility with x64.
806 * sysdep.c (STDERR_FILENO): Define if not already defined.
808 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
809 (__morecore): Argument type is now ptrdiff_t.
810 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
811 (relinquish): Use ptrdiff_t type for 'excess'.
812 (r_alloc_sbrk): Argument type is now ptrdiff_t.
814 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
815 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
816 instead of a literal number.
818 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
819 (min): Define only if not already defined.
821 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
822 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
825 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
826 'bitmaps' is a pointer.
828 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
830 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
832 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
834 file-attributes has a new optional arg FOLLOW-SYMLINKS.
835 * dired.c (directory_files_internal, Ffile_attributes):
836 New arg follow_symlinks. All uses changed.
838 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
840 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
842 2012-09-30 Eli Zaretskii <eliz@gnu.org>
844 Support atimers and CPU profiler via profile.c on MS-Windows.
845 * w32proc.c (sig_mask, crit_sig): New static variables.
846 (sys_signal): Support SIGALRM and SIGPROF.
847 (sigemptyset, sigaddset, sigfillset, sigprocmask)
848 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
849 sigfillset, and sigprocmask are no longer no-ops.
850 (sigismember): New function.
851 (struct itimer_data): New definition.
852 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
853 (crit_prof): New static variables.
854 (MAX_SINGLE_SLEEP): New definition.
855 (timer_loop, stop_timer_thread, term_timers, init_timers)
856 (start_timer_thread, getitimer, setitimer): New functions.
857 (alarm): No longer a no-op, calls setitimer.
859 * w32.c (term_ntproc): Call term_timers.
860 (init_ntproc): Make sure all signals are unblocked at startup, to
861 erase any traces of dumping. Call init_timers.
863 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
864 Windows-specific code to display the hourglass mouse pointer is no
866 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
867 to hourglass timer expiration.
868 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
869 Remove, no longer used.
870 (w32_note_current_window, show_hourglass, hide_hourglass):
871 New functions, in support of hourglass cursor display similar to other
873 (syms_of_w32fns): Don't initialize hourglass_timer.
875 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
877 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
879 * w32.h (init_timers, term_timers): Add prototypes.
881 2012-09-30 Kenichi Handa <handa@gnu.org>
883 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
884 to the buffer relocation which may be caused by ccl_driver.
886 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
888 * xfns.c (Fx_file_dialog): Update comment.
890 * w32fns.c (Fx_file_dialog): Update comment.
892 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
893 Initialize panel name field if OSX >= 10.6.
895 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
897 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
899 * nsterm.m (NEW_STYLE_FS): New define.
900 (ns_fullscreen_hook, windowWillEnterFullScreen)
901 (windowDidEnterFullScreen, windowWillExitFullScreen)
902 (windowDidExitFullScreen, toggleFullScreen, handleFS)
903 (setFSValue): New functions.
904 (EmacsFSWindow): New implementation.
905 (canBecomeKeyWindow): New function for EmacsFSWindow.
906 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
907 (dealloc): Release nonfs_window if in fullscreen.
908 (updateFrameSize:): Call windowDidMove to update top/left.
909 (windowWillResize:toSize:): Check if frame is still maximized.
910 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
911 next_maximized, maximized_width, maximized_height and nonfs_window.
912 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
914 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
915 fullscreen. Set maximized_width/height. Act on next_maximized.
917 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
918 (EmacsView): Add variables for fullscreen.
919 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
920 (EmacsFSWindow): New interface for fullscreen.
922 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
924 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
926 2012-09-30 Chong Yidong <cyd@gnu.org>
928 * fns.c (Frandom): Doc fix.
930 2012-09-30 Martin Rudalics <rudalics@gmx.at>
932 * window.c (Vwindow_combination_limit): New default value.
933 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
935 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
937 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
938 Suggested by Eli Zaretskii in
939 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
941 2012-09-30 Eli Zaretskii <eliz@gnu.org>
943 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
944 HAVE_TIMER_SETTIME is defined.
946 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
948 Profiler improvements: more-accurate timers, overflow checks.
949 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
950 signal.h, setjmp.h. Include systime.h instead.
951 (saturated_add): New function.
952 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
953 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
954 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
956 (enum profiler_cpu_running): New enum.
957 (profiler_cpu_running): Now of that enum type, not bool.
958 All uses changed to store the new value.
959 (handle_profiler_signal): Rename from sigprof_handler_1,
960 for consistency with other handlers. Do not check whether
961 cpu_log is a hash-table if garbage collecting, since it
962 doesn't matter in that case.
963 (deliver_profiler_signal): Rename from sigprof_handler,
964 for consistency with other handlers.
965 (setup_cpu_timer): New function, with much of what used to be in
966 Fprofiler_cpu_start. Check for out-of-range argument.
967 Prefer timer_settime if available, and prefer
968 thread cputime clocks, then process cputime clocks, then
969 monotonic clocks, to the old realtime clock. Use make_timeval
970 to round more-correctly when falling back to setitimer.
971 (Fprofiler_cpu_start): Use it.
972 (Fprofiler_cpu_stop): Prefer timer_settime if available.
973 Don't assume that passing NULL as the 2nd argument of setitimer
974 is the same as passing a pointer to all-zero storage.
975 Ignore SIGPROF afterwards.
976 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
977 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
978 non-fatal signal handlers. Ignore SIGPROF on startup.
979 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
980 in profiler.c, since sysdep.c now uses it.
982 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
983 Suggested by Eli Zaretskii in
984 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
986 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
988 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
990 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
992 * lisp.h (struct backtrace): Remove indirection for `function' field.
993 * xdisp.c (redisplay_internal):
994 * profiler.c (record_backtrace, sigprof_handler_1):
995 * alloc.c (Fgarbage_collect):
996 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
997 (Fbacktrace_frame): Adjust accordingly.
999 2012-09-28 Glenn Morris <rgm@gnu.org>
1001 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1002 (Frun_hook_with_args_until_failure): Doc fixes.
1004 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1006 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1007 Qautomatic_redisplay and change the symbol name. All users changed.
1009 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1011 * profiler.c (sigprof_handler): Fix race condition.
1013 2012-09-28 Glenn Morris <rgm@gnu.org>
1015 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1017 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1019 Check more robustly for timer_settime.
1020 * Makefile.in (LIB_TIMER_TIME): New macro.
1022 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1023 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1026 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1028 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1030 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1032 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1034 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1036 * character.h (MAYBE_UNIFY_CHAR): Remove.
1037 * charset.c, charset.h (maybe_unify_char): Now static.
1038 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1039 Since this stuff is now private to charset.c, there's no need for
1040 a public macro and no need to inline by hand.
1042 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1043 Stefan Monnier <monnier@iro.umontreal.ca>
1044 Juanma Barranquero <lekktu@gmail.com>
1046 * profiler.c: New file.
1047 * Makefile.in (base_obj): Add profiler.o.
1048 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1049 ($(BLD)/profiler.$(O)): New target.
1050 * emacs.c (main): Call syms_of_profiler.
1051 * alloc.c (Qautomatic_gc): New constant.
1052 (MALLOC_PROBE): New macro.
1053 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1054 (total_bytes_of_live_objects): New function.
1055 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1056 Call malloc_probe for the memory profiler.
1057 (syms_of_alloc): Define Qautomatic_gc.
1058 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1060 (struct backtrace): Move definition...
1061 * lisp.h (struct backtrace): ..here.
1062 (Qautomatic_gc, profiler_memory_running): Declare vars.
1063 (malloc_probe, syms_of_profiler): Declare functions.
1064 * xdisp.c (Qautomatic_redisplay): New constant.
1065 (redisplay_internal): Record itself in backtrace_list.
1066 (syms_of_xdisp): Define Qautomatic_redisplay.
1068 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1069 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1071 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1073 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1075 Prefer POSIX timers if available.
1076 They avoid a race if the timer is too close to the current time.
1077 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1078 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1079 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1081 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1083 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1084 CHAR_STRING_ADVANCE.
1085 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1086 STRING_CHAR_ADVANCE.
1088 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1090 Move Vlibrary_cache to emacs.c and reset before dumping.
1092 * lisp.h (reset_image_types): Declare.
1093 [WINDOWSNT] (Vlibrary_cache): Declare.
1095 * image.c (reset_image_types): New function.
1097 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1098 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1099 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1101 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1102 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1104 * w32.h (Vlibrary_cache): Do not declare.
1106 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1108 * w32proc.c (sys_signal): Handle all signals defined by the
1109 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1110 handlers for signals supported by Windows. Don't override
1111 term_ntproc as the handler for SIGABRT.
1112 (sigaction): Rewrite to call sys_signal instead of duplicating its
1114 (sys_kill): Improve commentary.
1116 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1117 consistency with a signature of a signal handler. All callers
1119 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1120 install term_ntproc as a signal handler for SIGABRT, as that
1121 should be done by the dumped Emacs.
1123 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1125 * w32select.c (term_w32select): Protect against repeated
1126 invocation by setting clipboard_owner to NULL after calling
1129 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1130 and term_ntproc to their modified signatures.
1132 * character.c (char_string, string_char): Remove calls to
1133 MAYBE_UNIFY_CHAR. See the discussion starting at
1134 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1137 2012-09-25 Chong Yidong <cyd@gnu.org>
1139 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1141 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1143 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1144 when encountering an unknown bytecode.
1146 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1148 image.c, indent.c: Use bool for booleans.
1149 * dispextern.h (struct image_type): Members valid_p, load, init
1150 now return bool, not int. All uses changed.
1151 * image.c: Omit unnecessary static decls.
1152 (x_create_bitmap_mask, x_build_heuristic_mask):
1153 Return void, not int, since callers don't care about the return value.
1154 (x_create_bitmap_mask, define_image_type, valid_image_p)
1155 (struct image_keyword, parse_image_spec, image_spec_value)
1156 (check_image_size, image_background)
1157 (image_background_transparent, x_clear_image_1)
1158 (postprocess_image, lookup_image, x_check_image_size)
1159 (x_create_x_image_and_pixmap, xbm_image_p)
1160 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1161 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1162 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1163 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1164 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1165 (png_image_p, init_png_functions, png_load_body, png_load)
1166 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1167 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1168 (init_gif_functions, gif_load, imagemagick_image_p)
1169 (imagemagick_load_image, imagemagick_load, svg_image_p)
1170 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1172 * nsimage.m (ns_load_image):
1173 * nsterm.m (ns_defined_color):
1174 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1175 * xfns.c (x_defined_color):
1176 * xterm.c (x_alloc_lighter_color_for_widget)
1177 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1178 (x_alloc_lighter_color):
1179 * indent.c (disptab_matches_widthtab, current_column)
1180 (scan_for_column, string_display_width, indented_beyond_p)
1181 (compute_motion, vmotion, Fvertical_motion):
1182 Use bool for booleans.
1184 2012-09-24 Chong Yidong <cyd@gnu.org>
1186 * chartab.c (Fset_char_table_default): Obsolete function removed.
1188 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1190 Move pid_t related decls out of lisp.h.
1191 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1192 (interruptible_wait_for_termination):
1193 Move these decls from lisp.h to syswait.h, since they use pid_t.
1194 Needed on FreeBSD; see Herbert J. Skuhra in
1195 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1196 * callproc.c: Include syswait.h.
1198 gnutls.c, gtkutil.c: Use bool for boolean.
1199 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1200 (emacs_gnutls_handle_error):
1201 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1202 (xg_hide_tooltip, xg_create_frame_widgets)
1203 (create_dialog, xg_uses_old_file_dialog)
1204 (xg_get_file_with_chooser, xg_get_file_with_selection)
1205 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1206 (xg_item_label_same_p, xg_update_menubar)
1207 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1208 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1209 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1210 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1211 (update_frame_tool_bar, free_frame_tool_bar):
1212 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1213 * nsmenu.m (ns_update_menubar):
1214 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1215 * xfns.c (Fx_show_tip) [USE_GTK]:
1216 Use bool for boolean.
1217 * gtkutil.c (xg_update_frame_menubar):
1218 * xmenu.c (update_frame_menubar):
1219 Return void, not int, since caller ignores return value.
1220 * gtkutil.c (xg_change_toolbar_position):
1223 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1225 * makefile.w32-in (BLOCKINPUT_H): Remove.
1226 (SYSSIGNAL_H): New macro.
1227 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1228 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1229 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1230 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1231 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1232 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1233 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1234 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1235 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1236 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1237 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1238 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1239 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1240 ($(BLD)/w32xfns.$(O)): Update dependencies.
1242 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1244 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1245 fatal_error_backtrace.
1247 * w32proc.c (sys_kill): Undo last change: don't do anything when
1248 invoked to deliver SIGABRT to our own process. This is now
1249 handled by emacs_raise.
1251 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1253 * w32term.c (w32_read_socket): Remove leftover reference to
1254 interrupt_input_pending.
1256 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1258 Do not use SA_NODEFER.
1259 Problem reported by Dani Moncayo in
1260 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1262 * sysdep.c (emacs_abort): Do not reset signal handler.
1263 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1264 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1265 wanted even on POSIXish hosts, and it doesn't work on Windows.
1267 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1269 * xterm.c (x_term_init): Call fixup_locale before and after calling
1270 gtk_init (Bug#12392).
1272 2012-09-23 Chong Yidong <cyd@gnu.org>
1274 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1275 Vdynamic_library_alist.
1277 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1278 (Fgnutls_available_p): Caller changed.
1280 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1281 (Flibxml_parse_xml_region): Likewise.
1283 * dispextern.h (struct image_type): Remove arg from init function.
1285 * image.c (Finit_image_library, lookup_image_type)
1286 (define_image_type): Remove now-unneeded second arg.
1287 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1288 (init_tiff_functions, init_gif_functions, init_svg_functions):
1289 Arglist and w32_delayed_load calling convention changed.
1290 (gs_type): Remove init_gs_functions; there is no such function.
1291 (valid_image_p, make_image): Fix caller to lookup_image_type.
1293 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1295 Simplify and avoid signal-handling races (Bug#12471).
1297 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1298 Avoid recursive loop if there's a fatal error in the function itself.
1299 * atimer.c (pending_atimers):
1300 * blockinput.h: Don't include "atimer.h"; no longer needed.
1301 (interrupt_input_pending): Remove. All uses removed.
1302 pending_signals now counts both atimers and ordinary interrupts.
1303 This is less racy than having three separate pending-signal flags.
1304 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1306 Rename from their upper-case counterparts BLOCK_INPUT,
1307 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1308 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1309 This makes it easier to access volatile variables more accurately.
1310 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1311 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1312 that's more reliable if the code is buggy and sets
1313 interrupt_input_blocked to a negative value. All uses changed.
1314 * atimer.c (deliver_alarm_signal):
1315 Remove. No need to deliver this to the parent; any thread can
1316 handle this signal now. All uses replaced by underlying handler.
1317 * atimer.c (turn_on_atimers):
1318 * dispnew.c (handle_window_change_signal):
1319 * emacs.c (handle_danger_signal):
1320 * keyboard.c (kbd_buffer_get_event):
1321 Don't reestablish signal handler; not needed with sigaction.
1322 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1324 Rework to avoid unnecessary accesses to volatile variables.
1325 (UNBLOCK_INPUT_TO): Now a function.
1326 (totally_unblock_input, unblock_input): New decls.
1327 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1328 (init_data): Remove. Necessary stuff now done in init_signal.
1329 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1330 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1331 (fatal_error_code): Remove; no longer needed.
1332 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1333 it doesn't always backtrace. All uses changed. No need to reset
1334 signal to default, since sigaction and/or die does that for us now.
1335 Use emacs_raise (FOO), not kill (getpid (), FOO).
1336 (main): Check more-accurately whether we're dumping.
1337 Move fatal-error setup to sysdep.c
1338 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1339 * gtkutil.c (xg_get_file_name, xg_get_font):
1340 Remove no-longer-needed signal-mask manipulation.
1341 * keyboard.c, process.c (POLL_FOR_INPUT):
1342 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1343 * keyboard.c (read_avail_input): Remove.
1344 All uses replaced by gobble_input.
1345 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1346 (kbd_buffer_store_event_hold, gobble_input):
1347 (record_asynch_buffer_change) [USABLE_SIGIO]:
1348 (store_user_signal_events):
1349 No need to mess with signal mask.
1350 (gobble_input): If blocking input and there are terminals, simply
1351 set pending_signals to 1 and return. All hooks changed to not
1352 worry about whether input is blocked.
1353 (process_pending_signals): Clear pending_signals before processing
1354 them, in case a signal comes in while we're processing.
1355 By convention callers now test pending_signals before calling us.
1356 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1357 New functions, to support changes to blockinput.h.
1358 (handle_input_available_signal): Now extern.
1359 (reinvoke_input_signal): Remove. All uses replaced by
1361 (quit_count): Now volatile, since a signal handler uses it.
1362 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1363 All callers changed. Block SIGINT only if not already blocked.
1364 Clear sigmask reliably, even if Fsignal returns, which it can.
1365 Omit unnecessary accesses to volatile var.
1366 (quit_throw_to_read_char): No need to restore sigmask.
1367 * keyboard.c (gobble_input, handle_user_signal):
1368 * process.c (wait_reading_process_output):
1369 Call signal-handling code rather than killing ourselves.
1370 * lisp.h: Include <float.h>, for...
1371 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1372 (pending_signals): Now volatile.
1373 (syms_of_data): Now const if IEEE floating point.
1374 (handle_input_available_signal) [USABLE_SIGIO]:
1375 (terminate_due_to_signal, record_child_status_change): New decls.
1376 * process.c (create_process): Avoid disaster if memory is exhausted
1377 while we're processing a vfork, by tightening the critical section
1379 (send_process_frame, process_sent_to, handle_pipe_signal)
1380 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1382 (send_process): No need for setjmp/longjmp any more, since the
1383 SIGPIPE stuff is now gone. Instead, report an error if errno
1385 (record_child_status_change): Now extern. PID and W are now args.
1386 Return void, not bool. All callers changed.
1387 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1388 Remove. All uses removed. This bug should be fixed now in a
1390 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1391 and record the child status change directly. This avoids the
1392 need to futz with the signal mask.
1393 (process_fatal_action): Move here from emacs.c.
1394 (emacs_sigaction_flags): New function, containing
1395 much of what used to be in emacs_sigaction_init.
1396 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1397 caught by emacs, to make races less likely.
1398 (deliver_process_signal): Rename from handle_on_main_thread.
1400 (BACKTRACE_LIMIT_MAX): Now at top level.
1401 (thread_backtrace_buffer, threadback_backtrace_pointers):
1403 (deliver_thread_signal, deliver_fatal_thread_signal):
1404 New functions, for more-accurate delivery of thread-specific signals.
1405 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1406 (deliver_arith_signal): Handle in this thread, not
1407 in the main thread, since it's triggered by this thread.
1408 (maybe_fatal_sig): New function.
1409 (init_signals): New arg DUMPING so that we can be more accurate
1410 about whether we're dumping. Caller changed.
1411 Treat thread-specific signals differently from process-general signals.
1412 Block all signals while handling fatal error; that's safer.
1413 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1415 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1416 Ignore SIGPIPE unless batch.
1417 (emacs_backtrace): Output backtrace for the appropriate thread,
1418 which is not necessarily the main thread.
1419 * syssignal.h: Include <stdbool.h>.
1420 (emacs_raise): New macro.
1421 * xterm.c (x_connection_signal): Remove; no longer needed
1422 now that we use sigaction.
1423 (x_connection_closed): No need to mess with sigmask now.
1424 (x_initialize): No need to reset SIGPIPE handler here, since
1425 init_signals does this for us now.
1427 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1429 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1430 background rect may be larger (Bug#12245).
1432 2012-09-23 Chong Yidong <cyd@gnu.org>
1434 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1436 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1438 * .gdbinit: Just stop at fatal_error_backtrace.
1439 See Stefan Monnier's request in
1440 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1441 Remove no-longer-used query of system type.
1443 2012-09-22 Chong Yidong <cyd@gnu.org>
1445 * search.c (Freplace_match): Doc fix (Bug#12325).
1447 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1449 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1450 (Fline_end_position): Doc fix.
1452 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1454 2012-09-22 Chong Yidong <cyd@gnu.org>
1456 * dispextern.h (struct image_type): Add new slot, storing a type
1457 initialization function.
1459 * image.c (define_image_type): Call the image initializer function
1460 if it is defined. Arguments and return value changed.
1461 (valid_image_p, make_image): Callers changed.
1462 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1463 (gif_type, imagemagick_type, svg_type, gs_type):
1464 Add initialization functions.
1465 (Finit_image_library): Call lookup_image_type.
1466 (CHECK_LIB_AVAILABLE): Macro deleted.
1467 (lookup_image_type): Call define_image_type here, rather than via
1468 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1469 (syms_of_image): Move define_image_type calls for xbm_type and
1470 pbm_type to lookup_image_type.
1472 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1474 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1475 'idle_timers' from here ...
1476 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1477 lists, to avoid infloops when the timer does something stupid,
1478 like reinvoke itself with the same or smaller time-out.
1481 2012-09-22 Martin Rudalics <rudalics@gmx.at>
1483 * window.c (Fsplit_window_internal): Handle only Qt value of
1484 Vwindow_combination_limit separately.
1485 (Qtemp_buffer_resize): New symbol.
1486 (Vwindow_combination_limit): New default value.
1489 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1491 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1492 the new overlay string. (Bug#10159)
1494 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1496 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1497 or that fprintf is async-signal-safe. POSIX doesn't require
1500 2012-09-22 Chong Yidong <cyd@gnu.org>
1502 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1505 2012-09-22 Kenichi Handa <handa@gnu.org>
1507 * composite.c (composition_reseat_it): Handle the case that a
1508 grapheme cluster is not covered by a single font (Bug#12352).
1510 2012-09-21 Chong Yidong <cyd@gnu.org>
1512 * image.c (define_image_type): Avoid adding duplicate types to
1513 image_types (Bug#12463). Suggested by Jörg Walter.
1515 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1517 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1518 (print_load_command_name): Add case LC_DATA_IN_CODE.
1519 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1521 2012-09-21 Glenn Morris <rgm@gnu.org>
1523 * eval.c (Frun_hook_with_args_until_success)
1524 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1526 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1528 * fileio.c (Ffile_selinux_context): Only call freecon when
1529 lgetfilecon succeeded.
1530 (Fset_file_selinux_context): Likewise. (Bug#12444)
1532 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1534 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1535 reordering, locate the cursor by calling set_cursor_from_row; if
1536 that fails, clear the desired glyph matrix before returning a
1537 failure indication to the caller. Fixes leaving garbled display
1538 when fast scrolling with a down-key. (Bug#12403)
1539 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1540 scrolling through multibyte text.
1542 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1544 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1545 calling mark_vectorlike since that's the one that marks the window.
1546 (mark_discard_killed_buffers): Mark the final cdr.
1547 * window.h (struct window): Move prev/next_buffers to the
1548 non-standard fields.
1549 * window.c (make_window): Initialize prev/next_buffers manually.
1551 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1553 Omit unused arg EXPECTED from socket hooks.
1554 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1555 * nsterm.m (ns_term_init):
1556 * termhooks.h (struct terminal.read_socket_hook):
1557 * w32inevt.c (w32_console_read_socket):
1558 * w32term.c (w32_read_socket):
1559 * xterm.c (XTread_socket):
1560 Omit unused arg EXPECTED. All callers changed.
1561 (store_user_signal_events): Return void, not int, since callers no
1562 longer care about the return value. All uses changed.
1564 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
1566 * w32gui.h (XParseGeometry): Do not declare.
1568 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1570 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1571 Ignore 'expected'. See Eli Zaretskii in
1572 <http://bugs.gnu.org/12471#8> (last line).
1574 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1575 (XParseGeometry): Now static. Substitute extremal values for
1576 values that are out of range.
1578 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1580 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1582 * nsfns.m (XParseGeometry): Remove.
1583 (Fx_create_frame): Call x_set_offset to correctly interpret
1584 top_pos in geometry.
1586 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1587 (Fx_parse_geometry): If there is a space in string, call
1588 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1590 2012-09-17 Eli Zaretskii <eliz@gnu.org>
1592 * search.c (scan_buffer): Use character positions in calls to
1593 region_cache_forward and region_cache_backward, not byte
1594 positions. (Bug#12196)
1596 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1597 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1599 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1600 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1601 emacs_blocked_malloc, now deleted.
1603 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1605 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1606 The workaround was for improving performance on Solaris 2.4, but
1607 is getting in the way now. Emacs will still work if someone is
1608 still running Solaris 2.4 in a museum somewhere; Sun dropped
1609 support for Solaris 2.4 in 2003.
1610 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1611 * process.c (create_process) [HAVE_WORKING_VFORK]:
1612 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1613 since Emacs no longer uses vfork on that platform.
1615 2012-09-17 Glenn Morris <rgm@gnu.org>
1617 * emacs.c: Use COPYRIGHT.
1619 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1621 Remove configure's --without-sync-input option (Bug#12450).
1622 When auditing signal-handling in preparation for cleaning it up,
1623 I found that SYNC_INPUT has race conditions and would be a real
1624 pain to fix. Since it's an undocumented and deprecated
1625 configure-time option, now seems like a good time to remove it.
1626 Also see <http://bugs.gnu.org/11080#16>.
1627 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1628 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1629 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1630 (malloc_hysteresis):
1631 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1632 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1633 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1634 (dont_register_blocks, bytes_used_when_reconsidered)
1635 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1636 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1637 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1638 Remove. All uses removed.
1639 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1640 implementation, one that depends on whether the new macro
1641 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1643 * atimer.c (run_timers, handle_alarm_signal):
1644 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1645 (handle_async_input, process_pending_signals)
1646 (handle_input_available_signal, init_keyboard):
1647 * nsterm.m (ns_read_socket):
1648 * process.c (wait_reading_process_output):
1649 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1650 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1652 * xterm.c (XTread_socket):
1654 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1655 * eval.c (handling_signal): Remove. All uses removed.
1656 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1657 All uses replaced with the SYNC_INPUT version.
1658 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1660 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1663 * font.c (Ffont_shape_gstring): Remove unused local.
1665 2012-09-16 Glenn Morris <rgm@gnu.org>
1667 * Makefile.in (clean): No longer run nextstep's clean.
1669 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1671 (ns-app): Move here from ns.mk, and simplify.
1672 (clean): Simplify nextstep entry.
1673 * ns.mk: Remove file.
1675 2012-09-17 Kenichi Handa <handa@gnu.org>
1677 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1678 not covert the last few charactes.
1680 2012-09-16 Kenichi Handa <handa@gnu.org>
1682 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1683 here, but just check the validity of glyphs in the glyph-string.
1685 2012-09-16 Martin Rudalics <rudalics@gmx.at>
1687 * window.c (Fwindow_parameter, Fset_window_parameter):
1688 Accept any window as argument (Bug#12452).
1690 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1692 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1693 to ns_term_init to avoid memory leak.
1695 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1696 explicit retain/release.
1697 (ns_term_init): Only allow one display. Initialize outerpool and
1700 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1702 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1703 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1704 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1705 the Microsoft problem in a different way, by altering ../nt/config.nt.
1707 2012-09-15 Eli Zaretskii <eliz@gnu.org>
1722 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1723 by lisp.h. This completes removal of setjmp.h inclusion
1724 erroneously announced in the previous commit. (Bug#12446)
1726 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1729 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1730 not defined as a macro. The latter happens on MS-Windows.
1733 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1735 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1736 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1737 Some instances of '#include <setjmp.h>' removed, if the
1738 only reason for the instance was because "lisp.h" was included.
1739 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1740 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1741 and _longjmp with the new symbols. Emacs already uses _setjmp if
1742 available, so this change affects only POSIXish hosts that have
1743 sigsetjmp but not _setjmp, such as some versions of Solaris and
1744 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1745 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1746 (png_load_body) [HAVE_PNG]:
1747 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1748 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1749 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1750 since PNG requires jmp_buf. This is the only exception to the
1751 general rule that we now use sys_setjmp and sys_longjmp.
1752 This exception is OK since this code does not change the signal
1753 mask or longjmp out of a signal handler.
1755 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1757 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1758 Include "syssignal.h", for 'main_thread'.
1760 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1762 Avoid out-of-range marker position (Bug#12426).
1763 * insdel.c (replace_range, replace_range_2):
1764 Adjust markers before overlays, as suggested by comments.
1765 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1766 Remove redundant check before calling offset_intervals.
1768 2012-09-14 Martin Rudalics <rudalics@gmx.at>
1770 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1771 current buffer (Bug#12387).
1773 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
1775 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1777 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1779 Use a more backwards-compatible timer format (Bug#12430).
1780 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1781 vector element, not from the 4th, since PSECS is now at the end.
1782 (Fcurrent_idle_time): Doc fix.
1784 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1786 Function to mark objects and remove killed buffers at once.
1787 * alloc.c (discard_killed_buffers): Rename to ...
1788 (mark_discard_killed buffers) ... new name. Add marking
1789 of remaining objects. Fix comment. Adjust users.
1790 (mark_object): Do not touch frame buffer lists here.
1791 * frame.c (delete_frame): Reset frame buffer lists here.
1793 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1795 Better workaround for GNOME bug when --enable-gcc-warnings.
1796 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1797 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1798 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1800 Simplify SIGIO usage (Bug#12408).
1801 The code that dealt with SIGIO was crufty and confusing, e.g., it
1802 played tricks like "#undef SIGIO" but these tricks were not used
1803 consistently. Simplify mostly by not #undeffing standard symbols,
1804 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1805 or not as we please) rather than "defined SIGIO" (standard symbol
1806 that we probably shouldn't #undef).
1807 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1808 Modules that need it can include it.
1809 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1810 * dispextern.h (ignore_sigio): New decl.
1811 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1812 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1813 * emacs.c (shut_down_emacs):
1814 * keyboard.c (kbd_buffer_store_event_hold):
1815 Use ignore_sigio rather than invoking 'signal' directly.
1816 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1818 (FIONREAD, SIGIO): Do not #undef.
1819 (tty_read_avail_input): Use #error rather than a syntax error.
1820 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1821 for I_PIPE, used by SETUP_SLAVE_PTY.
1822 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1823 * sysdep.c (croak): Remove; no longer needed. This bit of
1824 temporary code, with Fred N. Fish's comment that it's temporary,
1825 has been in Emacs since at least 1992!
1826 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1827 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1828 * syssignal.h (croak): Remove decl.
1829 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1830 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1831 now that we're termios-only.
1832 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1833 * term.c (dissociate_if_controlling_tty): Use #error rather than
1836 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1837 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1838 to work around GNOME bug 683906.
1839 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1840 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1841 This works around GCC bug 54561.
1843 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1845 More fixes for 'volatile' and setjmp/longjmp.
1846 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1847 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1848 (png_load_body) [HAVE_PNG]:
1849 (jpeg_load_body) [HAVE_JPEG]:
1850 New function, with most of the old parent function's body.
1851 (png_load) [HAVE_PNG]:
1852 (jpeg_load) [HAVE_JPEG]:
1853 Invoke the new function, to avoid longjmp munging our locals.
1854 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1855 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1856 longjmp is passed 2, as the C standard doesn't guarantee this.
1857 Instead, store the failure code into mgr->failure_code.
1859 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1861 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1862 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1863 (syms_of_keyboard): Remove support for unread-command-char.
1865 2012-09-12 Eli Zaretskii <eliz@gnu.org>
1867 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1868 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1869 violation. (Bug#12426)
1871 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1873 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1875 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1877 * eval.c: Add `inhibit-debugger'.
1878 (Qinhibit_debugger): New symbol.
1879 (call_debugger): Bind it instead of Qdebug_on_error.
1880 (maybe_call_debugger): Test Vinhibit_debugger.
1881 (syms_of_eval): Define inhibit-debugger.
1882 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1883 (syms_of_xdisp): Remove inhibit-debug-on-message.
1885 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1887 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1888 If a nonvolatile local variable is written before a _longjmp to
1889 the frame containing the variable, and is read after the _longjmp,
1890 the value read is indeterminate. Some local variables of type
1891 'struct handler' and 'struct catchtag' are used in this way, so
1892 mark each of their slots as volatile if the slot can be set before
1893 _longjmp and read afterwards.
1894 * lisp.h (struct handler): var and chosen_clause are now volatile.
1895 (struct catchtag): val, next, and pdlcount are now volatile.
1897 * bidi.c (bidi_push_it, bidi_pop_it):
1898 * fns.c (copy_hash_table):
1899 * image.c (define_image_type):
1900 * keyboard.c (kbd_buffer_store_event_hold):
1901 * process.c (Fprocess_send_eof):
1902 * xfaces.c (x_create_gc) [HAVE_NS]:
1903 * xgselect.c (xg_select):
1904 Prefer assignment to memcpy when either will do.
1906 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1907 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1908 time an item is removed. No need to mark this function 'inline';
1909 the compiler knows better than we do.
1911 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1913 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1914 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1915 to change_frame_size (Bug#12388).
1916 (windowDidResize:): Pass YES to updateFrameSize.
1918 * nsterm.h: Add delay parameter to updateFrameSize.
1920 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1922 Discard killed buffers from deleted window and frame objects.
1923 This reduces an amount of references to killed buffers and
1924 helps GC to reclaim them faster.
1925 * alloc.c (discard_killed_buffers): New function.
1926 (mark_object): Use it for deleted windows and frames.
1927 (mark_object): If symbol's value is set up for a killed buffer
1928 or deleted frame, restore it's global binding.
1929 * data.c (swap_in_global_binding): Add GC notice.
1930 (swap_in_symval_forwarding): Use convenient set_blv_where.
1931 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1932 * window.h: ... to here.
1934 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1936 Convenient macro to check whether the buffer is live.
1937 * buffer.h (BUFFER_LIVE_P): New macro.
1938 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1939 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1941 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1943 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1944 composition cases (Bug#12364).
1946 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1947 overhang of succeeding glyphs overlapping box cursor.
1949 * w32term.c (x_draw_glyph_string): Likewise.
1951 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1953 Simplify, document, and port floating-point (Bug#12381).
1954 The porting part of this patch fixes bugs on non-IEEE platforms
1955 with frexp, ldexp, logb.
1956 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1958 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1959 support, by removing commented-out code and briefly listing the
1960 C89 functions excluded. The commented-out stuff was confusing
1961 maintenance, e.g., we thought we needed cbrt but it was commented out.
1962 (logb): Remove decl; no longer needed.
1963 (isfinite): New macro, if not already supplied.
1964 (isnan): Don't replace any existing macro.
1965 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1966 are present on all C89 platforms.
1967 (Ffrexp): Do not special-case zero, as frexp does the right thing
1969 (Flogb): Do not use logb, as it doesn't have the desired meaning
1970 on hosts that use non-base-2 floating point. Instead, stick with
1971 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1972 frexp, to avoid getting an unspecified result.
1974 * xdisp.c (Qinhibit_debug_on_message): Now static.
1976 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1978 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1979 NSBezierPath (Bug#12131).
1981 2012-09-10 Chong Yidong <cyd@gnu.org>
1983 * fns.c (Fdelq, Fdelete): Doc fix.
1985 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1987 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1988 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1990 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1992 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1993 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1996 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1998 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1999 left fringe if the window has a left margin. This avoids leaving
2000 traces of the cursor because its leftmost pixel is not drawn over.
2002 * dispnew.c (update_window_line): When the left margin area of a
2003 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2004 that screen line. (Bug#12277)
2006 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2008 Assume C89 or later for math functions (Bug#12381).
2009 This simplifies the code, and makes it a bit smaller and faster,
2010 and (most important) makes it easier to clean up signal handling
2011 since we can stop worring about floating-point exceptions in
2012 library code. That was a problem before C89, but the problem
2013 went away many years ago on all practical Emacs targets.
2014 * data.c, image.c, lread.c, print.c:
2015 Don't include <math.h>; no longer needed.
2016 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2017 might be autoconfigured, as that never happens.
2019 * doprnt.c (DBL_MAX_10_EXP):
2020 * print.c (DBL_DIG):
2021 Remove. C89 or later always defines these.
2022 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2023 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2024 (arith_error, domain_error, domain_error2):
2025 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2026 no longer needed -- we simply return what C returns. All uses removed.
2027 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2029 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2030 Remove. All uses expanded, as these macros are no longer used
2031 more than once and are now more trouble than they're worth.
2032 (Ftan): Use tan, not sin / cos.
2033 (Flogb): Assume C89 frexp.
2034 (fmod_float): Assume C89 fmod.
2035 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2036 (init_floatfns): Remove. All uses removed.
2038 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2040 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2041 compositeToPoint for OSX < 10.6 (Bug#12390).
2043 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2045 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2046 This produces more-accurate results.
2048 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2050 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2051 changes (Bug#12088).
2053 2012-09-08 Chong Yidong <cyd@gnu.org>
2055 * syntax.c (Fstring_to_syntax): Doc fix.
2057 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2059 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2060 in the internal border.
2061 (x_set_window_size): Remove static variables and their usage.
2062 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2063 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2064 Remove fringe/internal border adjustment (Bug#11052).
2065 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2066 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2067 (ns_fix_rect_ibw): Remove.
2068 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2069 (ns_dumpglyphs_box_or_relief): Ditto.
2070 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2072 (ns_dumpglyphs_image): Ditto.
2073 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2075 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2076 their usage. Add fringe_extended_p and its use as in other terms.
2077 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2078 scroll bar was removed.
2079 (updateFrameSize): New function.
2080 (windowDidResize): Move code to updateFrameSize and call it.
2082 * nsterm.h (EmacsView): Add updateFrameSize.
2084 2012-09-07 Chong Yidong <cyd@gnu.org>
2086 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2088 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2090 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2092 More signal-handler cleanup (Bug#12327).
2093 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2094 Problem introduced when merging patches. Noted by Eli Zaretskii in
2095 <http://bugs.gnu.org/12327#67>.
2096 * floatfns.c: Comment fix.
2097 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2098 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2099 and anyway the declaration is harmless even if SIGDANGER is not defined.
2100 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2101 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2102 source files not surprisingly expected syssignal.h to define, or
2103 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2104 Include <sys/ioctl.h>, for FIONREAD.
2105 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2106 This eliminates a problem whereby other files mysteriously had
2107 to include "syssignal.h" before including "systty.h" if they
2108 wanted to use "#ifdef SIGIO".
2110 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2112 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2114 * w32.c (sigemptyset): Empty the set.
2115 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2117 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2119 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2121 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2122 (mark_object): Likewise for frame objects.
2124 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2126 * syssignal.h (handle_on_main_thread): Always declare,
2127 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2128 This ports to platforms without HAVE_PTHREAD.
2130 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2132 Signal-handler cleanup (Bug#12327).
2133 Emacs's signal handlers were written in the old 4.2BSD style with
2134 sigblock and sigmask and so forth, and this led to some
2135 inefficiencies and confusion. Rewrite these to use
2136 pthread_sigmask etc. without copying signal sets around. Also,
2137 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2138 'signal', and instead use functions that do not attempt to take
2139 over the system name space. This patch causes Emacs's text
2140 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2141 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2142 Do not include <signal.h> or "syssignal.h", as these
2143 modules do not use signals.
2144 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2145 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2146 Do not include <signal.h>, as "syssignal.h" does that for us now.
2147 * atimer.c (sigmask_atimers): New function.
2148 (block_atimers, unblock_atimers): New functions,
2149 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2151 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2152 no longer needed here.
2153 * emacs.c (main): Inspect existing signal handler with sigaction,
2154 so that there's no need to block and unblock SIGHUP.
2155 * sysdep.c (struct save_signal): New member 'action', replacing
2156 old member 'handler'.
2157 (save_signal_handlers, restore_signal_handlers):
2158 Use sigaction instead of 'signal' to save and restore.
2159 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2160 New function. All users of 'signal' modified to use set_sighandler
2161 if they're writeonly, and to use sys_signal if they're read+write.
2162 (emacs_sigaction_init, forwarded_signal): New functions.
2163 (sys_signal): Remove. All uses replaced by calls to sigaction
2164 and emacs_sigaction_init, or by direct calls to 'signal'.
2165 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2166 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2167 all uses replaced by pthread_sigmask etc. calls.
2168 * syssignal.h: Include <signal.h>.
2169 (emacs_sigaction_init, forwarded_signal): New decls.
2170 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2171 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2172 (sigmask, sys_sigmask): Remove; no longer needed.
2173 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2174 (sigblock, sigunblock, sigfree):
2175 (sigsetmask) [!defined sigsetmask]:
2176 Remove. All uses replaced by pthread_sigmask.
2177 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2178 no longer need to be replaced, and its typical old uses
2179 are now done via emacs_sigaction_init and sigaction.
2180 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2181 (sys_sigdel): Remove; unused.
2182 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2184 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2186 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2187 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2189 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2191 Explicitly mark buffer_defaults and buffer_local_symbols.
2192 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2193 mark_local_symbols here.
2194 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2195 since special buffers aren't marked here any more.
2196 (allocate_buffer): Chain new buffer with all_buffers here...
2197 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2199 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2200 (syms_of_buffer): Remove staticpro of the above.
2201 (init_buffer_once): Set names for buffer_defaults and
2202 buffer_local_symbols.
2204 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2206 Use bool for booleans in font-related modules.
2207 * font.c (font_intern_prop, font_style_to_value)
2208 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2209 (generate_otf_features, font_check_otf_features, font_check_otf)
2210 (font_match_p, font_list_entities, font_at):
2211 * fontset.c (fontset_id_valid_p, reorder_font_vector
2212 (fontset_find_font, Fset_fontset_font)
2213 (face_suitable_for_char_p) [0]:
2214 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2215 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2216 (m17n_flt_initialized, ftfont_shape_by_flt):
2217 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2218 * nsfont.m (nsfont_draw):
2219 * w32font.c (w32font_draw):
2220 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2221 Use bool for booleans.
2222 * font.h: Adjust to above API changes.
2223 (struct font, struct font_driver, struct font_driver_list):
2224 Use bool for booleans.
2225 (struct font): Remove useless member encoding_type.
2227 * fontset.c, xftfont.c: Omit unnecessary static decls.
2229 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2231 * alloc.c (mark_object): Revert window marking code
2232 since it's unsafe for the Fset_window_configuration.
2234 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2236 Fix race conditions with signal handlers and errno (Bug#12327).
2237 Be more systematic about preserving errno whenever a signal
2238 handler returns, even if it's not in the main thread. Do this by
2239 renaming signal handlers to distinguish between signal delivery
2240 and signal handling. All uses changed.
2241 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2242 * data.c (deliver_arith_signal): Rename from arith_error.
2243 * dispnew.c (deliver_window_change_signal): Rename from
2244 window_change_signal.
2245 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2246 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2247 * keyboard.c (deliver_input_available_signal): Rename from
2248 input_available_signal.
2249 (deliver_user_signal): Rename from handle_user_signal.
2250 (deliver_interrupt_signal): Rename from interrupt_signal.
2251 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2252 (deliver_child_signal): Rename from sigchld_handler.
2253 * atimer.c (handle_alarm_signal):
2254 * data.c (handle_arith_signal):
2255 * dispnew.c (handle_window_change_signal):
2256 * emacs.c (handle_fatal_signal, handle_danger_signal):
2257 * keyboard.c (handle_input_available_signal):
2258 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2259 * process.c (handle_pipe_signal, handle_child_signal):
2260 New functions, with the actual signal-handling code taken from the
2261 original respective signal handlers, sans the sporadic attempts to
2262 preserve errno, since that's now done by handle_on_main_thread.
2263 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2264 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2265 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2267 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2268 Move initialization of main_thread to sysdep.c's init_signals.
2269 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2270 our usage, and simplifies the mainline code.
2271 (record_child_status_change): New static function, as a helper
2272 for handle_child_signal, and with most of the old child handler's
2274 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2275 (handle_child_signal): Use the above.
2276 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2277 Moved here from emacs.c.
2278 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2279 code moved here from emacs.c's main function.
2280 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2281 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2282 This lets callers save and restore errno properly.
2284 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2286 Remove redundant or unused things here and there.
2287 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2288 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2289 * editfns.c (Fcompare_buffer_substrings): Likewise.
2290 * frame.h (struct terminal, struct font_driver_list):
2291 Remove redundant declarations.
2292 * window.h (Qleft, Qright): Likewise.
2294 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2296 Do not mark objects from deleted buffers, windows and frames.
2297 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2298 (mark_object): Likewise for windows and frames.
2300 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2302 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2303 buffer_defaults and buffer_local_symbols as valid objects.
2304 Return special value to denote them.
2306 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2308 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2309 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2310 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2311 (file_name_absolute_p, Fsubstitute_in_file_name):
2312 (check_executable, check_writable, Ffile_accessible_directory_p)
2313 (Fset_file_selinux_context, Fdefault_file_modes)
2314 (Finsert_file_contents, choose_write_coding_system)
2315 (Fwrite_region, build_annotations, a_write, e_write)
2317 * filelock.c (boot_time_initialized, get_boot_time)
2318 (get_boot_time_1, lock_file_1, within_one_second):
2319 * floatfns.c (in_float):
2320 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2321 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2322 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2323 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2324 * window.c (compare_window_configurations):
2325 Use bool for booleans.
2326 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2327 (Fdefault_file_modes): Now mode_t, not int, for modes.
2328 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2329 (internal_delete_file): Now returns void, not a (boolean) int,
2330 since nobody was looking at the return value.
2331 * lisp.h, window.h: Adjust to above API changes.
2333 * xdisp.c (set_message): Simplify and reindent last change.
2335 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2337 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2339 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2341 * eval.c (call_debugger): Make the function non-static so that we
2342 can call it from set_message.
2344 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2345 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2347 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2349 Give more-useful info on a fatal error (Bug#12328).
2350 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2351 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2352 of doing the work ourselves.
2353 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2354 do most of the work.
2355 (fatal_error_backtrace): New function, taken from the guts
2356 of the old fatal_error_signal, but with a new option to output
2358 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2359 info about the signal than just its number.
2360 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2361 * sysdep.c: Include <execinfo.h>
2362 (emacs_backtrace): New function, taken partly from the previous
2363 code of the 'die' function.
2364 (emacs_abort): Call fatal_error_backtrace rather than abort.
2366 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2368 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2369 eager (load-time) macro-expansion.
2370 * lisp.mk (lisp): Add macroexp.
2372 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2374 Simplify redefinition of 'abort' (Bug#12316).
2375 Do not try to redefine the 'abort' function. Instead, redo
2376 the code so that it calls 'emacs_abort' rather than 'abort'.
2377 This removes the need for the NO_ABORT configure-time macro
2378 and makes it easier to change the abort code to do a backtrace.
2379 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2380 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2381 Remove; sysdep.c's emacs_abort now takes its place.
2382 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2383 'abort' changed to use 'emacs_abort'.
2384 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2385 (abort) [!defined abort]: Rename to ...
2386 (emacs_abort): ... new name.
2387 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2388 the place of the old 'abort' in emacs.c.
2389 * w32.c, w32fns.c (abort): Do not #undef.
2390 * w32.c (emacs_abort): Rename from w32_abort.
2392 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2394 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2395 offsets[j].dv, since the y axis of the screen coordinates points
2396 down, while the y axis of the font definition coordinates points
2397 up. This fixes display of Arabic diacritics such as KASRA and
2398 KASRATAN. (Bug#11860)
2400 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2402 Be more systematic about _setjmp vs setjmp.
2403 * alloc.c (test_setjmp, mark_stack):
2404 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2405 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2406 (png_load, my_error_exit, jpeg_load):
2407 * process.c (send_process_trap, send_process):
2408 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2409 The underscored versions are up to 30x faster on some hosts.
2410 Formerly, the code used setjmp+longjmp sometimes and
2411 _setjmp+_longjmp at other times, with no particular reason to
2412 prefer setjmp+longjmp.
2414 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2416 Fix minor problem found by static checking.
2417 * buffer.c (Fdelete_all_overlays): Return nil.
2419 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2421 * buffer.c (Fdelete_all_overlays): New function.
2423 2012-09-03 Chong Yidong <cyd@gnu.org>
2425 * gtkutil.c: Add extern decl for Qxft.
2427 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2429 * emacs.c, eval.c: Use bool for boolean.
2430 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2431 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2432 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2433 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2434 (main, decode_env_path, Fdaemon_initialized):
2435 * eval.c (call_debugger, Finteractive_p, interactive_p):
2436 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2437 (maybe_call_debugger, Fbacktrace):
2438 * process.c (read_process_output, exec_sentinel):
2439 Use bool for booleans.
2440 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2441 All callers changed.
2442 * eval.c (interactive_p): Omit always-true boolean argument
2443 EXCLUDE_SUBRS_P. All callers changed.
2444 * dispextern.h, lisp.h: Reflect above API changes.
2445 * firstfile.c (dummy): Use the address of 'main', whose signature
2446 won't change, instead of the address of 'initialize', whose
2447 signature just changed from int to bool.
2448 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2449 * msdos.c (fatal_error_in_progress): ... from here.
2450 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2452 (redisplay_internal, unwind_redisplay): Simply clear
2453 REDISPLAYING_P when unwinding, instead of saving its previous,
2454 always-false value and then restoring it.
2456 Clean up some extern decls.
2457 Mostly, this hoists extern decls out of .c files and into .h files.
2458 That way, we're more likely to catch errors if the interfaces change.
2459 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2460 declare xg_mark_data.
2461 * dispextern.h (x_frame_parm_handlers):
2463 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2464 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2465 (Qultra_bold, Qoblique, Qitalic):
2466 Move extern decl here from .c file.
2467 * alloc.c (xg_mark_data) [USE_GTK]:
2469 * eval.c (Qlexical_binding):
2470 * fns.c (time) [!HAVE_UNISTD_H]:
2471 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2472 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2473 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2474 * lread.c (Qinternal_interpreter_environment):
2475 * minibuf.c (Qbuffer):
2476 * process.c (QCfamily, QCfilter):
2477 * widget.c (free_frame_faces):
2478 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2479 * xfont.c (x_clear_errors):
2480 * xterm.c (x_frame_parm_handlers):
2481 Remove now-redundant extern decls.
2482 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2483 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2485 * xfaces.c: Remove unnecessary static decls.
2486 * xterm.c (updating_frame): Remove decl of nonexistent object.
2488 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2489 when building globals.h, as the objects that are not built on
2490 this host are not needed to compile C files on this host.
2492 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2494 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2496 * frame.h: Add missing prototype for x_wm_set_size_hint.
2498 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2500 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2501 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2502 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2503 (Fsubstitute_command_keys):
2504 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2505 (save_excursion_save, save_excursion_restore)
2506 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2507 (format_time_string, general_insert_function)
2508 (make_buffer_string, make_buffer_string_both)
2509 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2510 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2511 (copy_text, insert_1, insert_1_both, insert_from_string)
2512 (insert_from_string_before_markers, insert_from_string_1)
2513 (insert_from_buffer, insert_from_buffer_1, replace_range)
2514 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2515 (del_range_2, modify_region):
2516 * intervals.c (intervals_equal, balance_possible_root_interval)
2517 (adjust_intervals_for_insertion, merge_properties_sticky)
2518 (graft_intervals_into_buffer, lookup_char_property)
2519 (adjust_for_invis_intang, set_point_both)
2520 (get_property_and_range, compare_string_intervals)
2521 (set_intervals_multibyte_1, set_intervals_multibyte):
2522 * keyboard.c (decode_timer):
2523 Use bool for boolean.
2524 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2525 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2527 2012-09-02 Chong Yidong <cyd@gnu.org>
2529 * keymap.c (push_key_description): Print M-TAB as C-M-i
2532 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2534 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2535 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2536 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2537 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2538 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2539 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2540 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2542 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2544 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2545 more than one grapheme cluster passed to the shaper: compute the
2546 offset adjustment values separately for each cluster. (Bug#11860)
2548 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2549 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2550 about implicit conversions from integer to pointer.
2552 2012-09-01 Daniel Colascione <dancol@dancol.org>
2554 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2555 system used too early.
2557 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2559 Better seed support for (random).
2560 * emacs.c (main): Call init_random.
2561 * fns.c (Frandom): Set the seed from a string argument, if given.
2562 Remove long-obsolete Gentzel cruft.
2563 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2564 (init_random): New function.
2566 2012-09-01 Daniel Colascione <dancol@dancol.org>
2568 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2569 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2570 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2571 x_wm_set_size_hint, x_query_colors, x_real_positions,
2572 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2573 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2574 all of which have been moved to common code.
2576 * xfaces.c: Include TERM_HEADER instead of listing all possible
2577 window-system headers.
2579 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2582 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2583 directly accessing frame internals.
2585 * w32font.h: Include font.h. Define syms_of_w32font and
2588 * process.c: Include TERM_HEADER instead of listing all possible
2589 window-system headers.
2591 * nsterm.h: Remove declarations now in frame.h.
2592 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2594 * menu.c: Include TERM_HEADER instead of listing all possible
2595 window-system headers.
2597 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2600 * keyboard.c: Include TERM_HEADER instead of listing all possible
2601 window-system headers.
2603 * image.c: Include TERM_HEADER instead of listing all possible
2604 window-system headers. Declare Vlibrary_cache when compiling for
2607 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2608 window system declarations.
2610 * frame.h: Move common functions here: set_frame_menubar,
2611 x_set_window_size, x_sync, x_get_focus_frame,
2612 x_set_mouse_position, x_set_mouse_pixel_position,
2613 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2614 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2615 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2616 x_activate_menubar, x_real_positions, x_bitmap_icon,
2617 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2620 * frame.c: Include TERM_HEADER instead of listing all possible
2621 window-system headers.
2623 * font.c: Include TERM_HEADER instead of listing all possible
2624 window-system headers.
2626 * emacs.c: Include TERM_HEADER.
2628 * dispnew.c: Include TERM_HEADER instead of listing all possible
2629 window-system headers.
2631 * ccl.h: Include character.h.
2633 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2634 the current window system; include in list of objects to link into
2637 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2639 Remove mark_ttys function and fix tty_display_info initialization.
2640 * lisp.h (mark_ttys): Remove prototype.
2641 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2642 to mark_ttys because all possible values of 'top_frame' slot are
2643 the frames which are reachable from Vframe_list.
2644 * term.c (mark_ttys): Remove.
2645 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2647 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2649 Change struct frame bitfields from unsigned char to unsigned.
2650 * frame.h (struct frame): Change type of 'display_preempted',
2651 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2652 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2653 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2654 bitfields from unsigned char to unsigned.
2656 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2658 Remove unused member of struct x_output and struct w32_output.
2659 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2660 * w32term.h (struct w32_output): Likewise.
2662 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2664 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2665 does not become zero (Bug#12234).
2667 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2669 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2670 for GCC 4.7.1 x86-64.
2672 2012-08-30 Glenn Morris <rgm@gnu.org>
2674 * lread.c (init_lread): For out-of-tree builds, only add the
2675 source directory's site-lisp dir to the load-path if it exists,
2676 consistent with in-tree builds. (Bug#12302)
2678 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2680 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2681 button_values to NULL. Call setStykeMask so dialogs get a close button.
2682 (windowShouldClose:): Set window_closed.
2683 (dealloc): New member, free button_values.
2684 (process_dialog:): Make member function. Remove window argument,
2685 replace window with self. Count buttons and allocate and store values
2687 (addButton:value:row:): value is int with the name tag. Call setTag
2688 with tag. Remove return self, declare return value as void.
2689 (addString:row:): Remove return self, declare return value as void.
2690 (addSplit): Remove return self, declare return value as void.
2691 (clicked:): Remove return self, declare return value as void.
2692 Set dialog_return to button_values[seltag]. Code formatting change.
2693 (initFromContents:isQuestion:): Adjust call to process_dialog.
2694 Code formatting change.
2695 (timeout_handler:): Set timer_fired to YES.
2696 (runDialogAt:): Set timer_fired to NO.
2697 Handle click on close button as quit.
2699 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2700 Add window_closed and button_values. Add void as return value for
2701 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2702 Add process_dialog as new member.
2704 2012-08-28 Eli Zaretskii <eliz@gnu.org>
2706 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2707 is not one of the heaps we manage. (Bug#12242)
2709 2012-08-28 Glenn Morris <rgm@gnu.org>
2711 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2713 2012-08-28 Martin Rudalics <rudalics@gmx.at>
2715 * window.c (Fset_window_configuration): Remove handling of
2716 auto-buffer-name window parameter. Install revision of reverted
2719 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2721 Do not allow to set major mode for a dead buffer.
2722 * buffer.c (Fset_buffer_major_mode): Signal an error
2723 if the buffer is dead.
2724 (Fother_buffer, other_buffer_safely): Remove redundant
2727 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2729 Always use set_buffer_if_live to restore original buffer at unwind.
2730 * buffer.h (record_unwind_current_buffer): New function.
2731 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2732 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2733 * undo.c, window.c: Adjust users.
2734 * buffer.c (set_buffer_if_live): Fix comment.
2736 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2738 Fix usage of set_buffer_internal.
2739 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2740 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2741 * coding.c (decode_coding): Omit redundant test.
2742 * fileio.c (decide_coding_unwind): Likewise.
2743 * fns.c (secure_hash): Likewise.
2744 * insdel.c (modify_region): Likewise.
2745 * keyboard.c (command_loop_1): Likewise.
2746 * print.c (PRINTFINISH): Likewise.
2747 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2749 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2751 * dispnew.c: Use bool for boolean.
2752 (frame_garbaged, display_completed, delayed_size_change)
2753 (fonts_changed_p, add_window_display_history)
2754 (add_frame_display_history, verify_row_hash)
2755 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2756 (row_equal_p, realloc_glyph_pool)
2757 (allocate_matrices_for_frame_redisplay)
2758 (showing_window_margins_p)
2759 (adjust_frame_glyphs_for_frame_redisplay)
2760 (build_frame_matrix_from_leaf_window, make_current)
2761 (mirrored_line_dance, mirror_line_dance, update_frame)
2762 (update_window_tree, update_single_window)
2763 (check_current_matrix_flags, update_window, update_text_area)
2764 (update_window_line, set_window_update_flags, scrolling_window)
2765 (update_frame_1, scrolling, buffer_posn_from_coords)
2766 (do_pending_window_change, change_frame_size)
2767 (change_frame_size_1, sit_for):
2768 Use bool for boolean.
2769 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2770 and remove last int (actually boolean) argument, which was always 0.
2771 All callers changed.
2772 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2773 * dispextern.h (struct composition_it): Use bool for boolean.
2774 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2775 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2776 * dired.c (file_name_completion):
2777 Use bool for boolean. (This was missed in an earlier change.)
2779 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2781 * window.c (Fset_window_configuration): Revert first part of
2784 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2786 * nsterm.h (NSPanel): New class variable dialog_return.
2788 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2789 Initialize dialog_return.
2790 (windowShouldClose:): Use stop instead of stopModalWithCode.
2791 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2792 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2794 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2797 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2799 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2800 * composite.c (find_composition, composition_gstring_p)
2801 (composition_reseat_it, find_automatic_composition):
2802 * data.c (let_shadows_buffer_binding_p)
2803 (let_shadows_global_binding_p, set_internal, make_blv)
2804 (Fmake_variable_buffer_local, Fmake_local_variable)
2805 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2806 (cons_to_signed, arith_driver):
2807 * dbusbind.c (xd_in_read_queued_messages):
2808 * dired.c (directory_files_internal, file_name_completion):
2809 Use bool for booleans.
2810 * dired.c (file_name_completion):
2811 * process.h (fd_callback):
2812 Omit int (actually boolean) argument. It wasn't being used.
2814 * composite.h, lisp.h: Reflect above API changes.
2816 * cmds.c, coding.c: Use bool for booleans.
2817 * cmds.c (move_point, Fself_insert_command):
2818 * coding.h (struct composition status, struct coding_system):
2819 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2820 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2821 (emacs_mule_char, decode_coding_emacs_mule)
2822 (encode_coding_emacs_mule, detect_coding_iso_2022)
2823 (decode_coding_iso_2022, encode_invocation_designation)
2824 (encode_designation_at_bol, encode_coding_iso_2022)
2825 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2826 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2827 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2828 (encode_coding_raw_text, detect_coding_charset)
2829 (decode_coding_charset, encode_coding_charset, detect_eol)
2830 (detect_coding, get_translation_table, produce_chars)
2831 (consume_chars, reused_workbuf_in_use)
2832 (make_conversion_work_buffer, code_conversion_save)
2833 (decode_coding_object, encode_coding_object)
2834 (detect_coding_system, char_encodable_p)
2835 (Funencodable_char_position, code_convert_region)
2836 (code_convert_string, code_convert_string_norecord)
2837 (Fset_coding_system_priority):
2838 * fileio.c (Finsert_file_contents):
2839 Use bool for booleans.
2840 * coding.h, lisp.h: Reflect above API changes.
2841 * coding.c: Remove unnecessary static function decls.
2842 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2843 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2844 not a boolean 'int', since callers never look at the return value.
2845 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2846 * coding.h (decoding_buffer_size, encoding_buffer_size)
2847 (emacs_mule_string_char): Remove unused extern decls.
2848 (struct iso_2022_spec, struct coding_system):
2849 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2850 (struct emacs_mule_spec): Remove unused field 'full_support'.
2851 All initializations removed.
2852 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2854 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2856 Fix spare memory change (Bug#12286).
2857 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2858 (valid_lisp_object_p): Likewise.
2860 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2862 * window.c (Fset_window_configuration): Record any window's old
2863 buffer if it's replaced (see Bug#8789). If the new current
2864 buffer doesn't appear in the selected window, go to its old
2867 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2869 Special MEM_TYPE_SPARE to denote reserved memory.
2870 * alloc.c (enum mem_type): New memory type.
2871 (refill_memory_reserve): Use new type for spare memory.
2872 This prevents live_cons_p and live_string_p from incorrect
2873 detection of uninitialized objects from spare memory as live.
2875 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2878 * Makefile.in (.PHONY): versioclean -> versionclean.
2880 Remove unused external symbols.
2881 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2882 * window.c (Qwindow_valid_p, decode_valid_window):
2883 Now static, not extern.
2884 * data.c (Qinterval): Remove; unused.
2885 (syms_of_data): Do not define 'interval'.
2886 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2887 * window.h (decode_valid_window):
2890 * character.c, charset.c, chartab.c: Use bool for booleans.
2891 * character.c (lisp_string_width, string_count_byte8)
2892 (string_escape_byte8):
2893 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2894 (load_charset_map_from_file, map_charset_chars)
2895 (Fdefine_charset_internal, define_charset_internal)
2896 (Fdeclare_equiv_charset, find_charsets_in_text)
2897 (Ffind_charset_region, char_charset, Fiso_charset):
2898 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2899 (sub_char_table_set, sub_char_table_set_range)
2900 (char_table_set_range, optimize_sub_char_table)
2901 (map_sub_char_table):
2902 Use bool for boolean.
2903 * character.c (str_to_unibyte): Omit last boolean argument; it was
2904 always 0. All callers changed.
2905 * character.h, charset.h: Adjust to match previous changes.
2906 * character.h (char_printable_p): Remove decl of nonexistent function.
2907 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2908 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2909 are all boolean, so make them single-bit bitfields.
2911 * lisp.h (ASET): Remove attempt to detect side effects.
2912 It was meant to be temporary and it often doesn't work,
2913 because when IDX has side effects the behavior of IDX==IDX
2914 is undefined. See Stefan Monnier in
2915 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2917 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2919 * lisp.h (functionp): New function (extracted from Ffunctionp).
2920 (FUNCTIONP): Use it.
2921 * eval.c (Ffunctionp): Use it.
2923 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2925 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2926 as that's faster and simpler than static storage. Don't bother
2927 with the g_main_context_query overhead if g_main_context_pending
2928 says no events are pending.
2929 (gfds, gfds_size): Remove these static vars.
2930 (xgselect_initialize): Remove; no longer needed.
2931 All uses and decls removed.
2933 * emacs.c (fatal_error_signal_hook): Remove.
2934 All uses removed. This leftover from old code was always 0.
2936 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2937 * casefiddle.c (casify_object, casify_region):
2938 * casetab.c (set_case_table):
2939 * category.c, category.h (word_boundary_p):
2940 * category.h (CHAR_HAS_CATEGORY):
2941 Use bool for booleans, instead of int.
2943 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2945 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2947 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2949 On assertion failure, print backtrace if available.
2950 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2951 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2952 * Makefile.in (LIB_EXECINFO): New macro.
2955 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2956 * bytecode.c (exec_byte_code):
2957 * callint.c (check_mark, Fcall_interactively):
2958 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2959 (getenv_internal, sync_process_alive, call_process_exited):
2960 * lisp.h (USE_SAFE_ALLOCA):
2961 Use bool for booleans, instead of int.
2962 * lisp.h, process.h: Adjust prototypes to match above changes.
2963 * callint.c (Fcall_interactively): Don't assume the mark's
2964 offset fits in 'int'.
2966 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2968 * buffer.c, buffer.h: Use bool for boolean.
2969 * buffer.c (reset_buffer_local_variables)
2970 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2971 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2972 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2973 (overlay_touches_p, overlay_strings, Foverlay_put)
2974 (report_overlay_modification, call_overlay_mod_hooks):
2975 (mmap_enlarge, mmap_set_vars):
2976 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2977 Use bool for booleans, instead of int.
2978 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2979 since the 1-or-0 return value is always ignored anyway.
2980 (mmap_initialized_p):
2981 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2982 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2984 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2986 * bidi.c: Use bool for boolean.
2987 This is a bit more readable, and makes the text segment of bidi.o
2988 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2989 Presumably it's faster too.
2990 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2992 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2993 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2994 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2995 (bidi_explicit_dir_char, bidi_level_of_next_char)
2996 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2997 Use bool for booleans, instead of int.
2998 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2999 (bidi_unshelve_cache): Adjust decls to match code.
3001 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3003 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3006 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3008 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3009 * atimer.h: Include <stdbool.h>.
3011 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3013 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3014 compile time tests instead of run time tests on systems that do
3016 (FRAME_MAC_P): Remove leftover from deleted code.
3017 * frame.c (syms_of_frame): Remove leftover from deleted code.
3019 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3021 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3023 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3025 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3026 Otherwise, the compiler complains about (A?B:C) where B is void
3027 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3028 (fontset_add): Return void, for FONTSET_ADD.
3030 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3032 * alloc.c: Use bool for booleans.
3033 (gc_in_progress, abort_on_gc)
3034 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3035 (dont_register_blocks) [GC_MALLOC_CHECK]:
3036 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3037 (check_string_bytes, make_specified_string, memory_full)
3038 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3039 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3040 (mark_stack, valid_pointer_p, make_pure_string)
3041 (Fgarbage_collect, survives_gc_p, gc_sweep):
3042 Use bool for booleans, instead of int.
3043 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3044 Remove unused local.
3045 * alloc.c (PURE_POINTER_P):
3046 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3047 * editfns.c (Fformat):
3048 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3050 * fns.c (sweep_weak_table):
3051 * lisp.h (suppress_checking, push_message, survives_gc_p)
3052 (make_pure_string, gc_in_progress, abort_on_gc):
3053 * lread.c (readchar, read1):
3054 * print.c (Fprin1_to_string):
3055 * xdisp.c (push_message):
3056 Use bool for booleans affected directly or indirectly by
3059 Make recently-introduced setters macros.
3060 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3061 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3062 (set_fontset_default, set_fontset_fallback): Rename from their
3063 upper-case counterparts, and make them functions rather than macros.
3064 This is more consistent with the other recently-introduced setters.
3065 These don't need to be inline, since they're local.
3067 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3069 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3070 the loop (Bug#12247).
3072 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3074 * lisp.h (vcopy): Use memcpy rather than our own loop.
3075 This fixes a performance regression introduced by the recent
3076 addition of vcopy. This means 'vcopy' will need to be modified
3077 for a copying collector, but that's OK. Also, tighten the
3078 checking in the assertion.
3080 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3082 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3083 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3084 non-base glyph for the width of the base character, according to
3085 what x_draw_composite_glyph_string_foreground expects.
3086 Generate WADJUST value according to composition_gstring_width's
3087 expectations, to produce correct width of the composed character.
3088 Reverse the sign of the DU offset produced by ScriptPlace.
3090 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3092 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3094 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3096 Avoid direct writes to contents member of struct Lisp_Vector.
3097 * lisp.h (vcopy): New function to copy data into vector.
3098 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3099 * fns.c (Ffillarray): Use ASET.
3100 * keyboard.c (timer_check_2): Use AREF and ASET.
3101 (append_tool_bar_item, Frecent_keys): Use vcopy.
3102 * lread.c (read_vector): Use ASET.
3103 * msdos.c (Frecent_doskeys): Use vcopy.
3104 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3105 (Finternal_merge_in_global_face): Use ASET and vcopy.
3106 * xfont.c (xfont_list_pattern): Likewise.
3108 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3110 * window.c (Fwindow_point): For the selected window always return
3111 the position of its buffer's point.
3112 (Fset_window_point): For the selected window always go in its
3113 buffer to the specified position.
3115 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3117 Setter macros for fontsets.
3118 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3119 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3120 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3123 2012-08-20 Glenn Morris <rgm@gnu.org>
3125 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3126 Don't assume that `ln -f' works.
3128 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3130 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3131 and later about non-assignments with no effect. See discussion at
3132 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3135 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3137 Inline setter functions for Lisp_Objects slots of struct specbinding.
3138 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3141 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3143 * window.c (select_window): Always make selected window's buffer
3146 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3148 Use AREF and ASET for docstrings of category tables.
3149 * category.h (CATEGORY_DOCSTRING): Use AREF.
3150 (SET_CATEGORY_DOCSTRING): Use ASET.
3151 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3153 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3155 Inline setter functions for hash table members.
3156 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3157 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3158 (set_hash_key_and_value, set_hash_index, set_hash_next)
3159 (set_hash_hash): New functions.
3160 * charset.c, fns.c: Adjust users.
3162 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3164 Inline getter and setter functions for per-buffer values.
3165 * buffer.h (per_buffer_default, set_per_buffer_default)
3166 (per_buffer_value, set_per_buffer_value): New functions.
3167 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3168 * buffer.c, data.c: Adjust users.
3170 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3172 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3174 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3176 Rely on <config.h> + <unistd.h> to declare 'environ',
3177 as gnulib does this if the system doesn't.
3178 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3179 Remove declaration. MS-Windows declares it on stdlib.h which is
3180 included by conf_post.h.
3181 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3182 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3183 * vm-limit.c: Include <unistd.h>, for 'environ'.
3185 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3186 (start_of_data): Remove decl; mem-limits.h provides it.
3188 * xdisp.c (handle_invisible_prop): Make it a bit faster
3189 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3191 2012-08-19 Chong Yidong <cyd@gnu.org>
3193 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3196 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3198 * .gdbinit: Use call instead of set when calling a function in the
3201 * data.c (set_internal): Don't use set_blv_found.
3202 (Fkill_local_variable): Likewise.
3204 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3206 * nsfont.m (ns_ascii_average_width): Ensure the string
3207 ascii_printable is initialized with a null-terminated character
3208 array. Otherwise, it can contain undesired extra characters.
3210 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3212 port new setting code to Sun C 5.8 2005/10/13
3213 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3214 Return void, not Lisp_Object. Otherwise, the compiler
3215 complains about (A?B:C) where B is void and C is Lisp_Object
3216 when compiling CHAR_TABLE_SET, due to the recent change to
3217 the API of sub_char_table_set_contents.
3219 2012-08-18 Chong Yidong <cyd@gnu.org>
3221 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3222 for the string case (Bug#3874).
3224 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3226 * buffer.h (BSET): Remove (Bug#12215).
3227 Replace all uses with calls to new setter functions.
3228 (bset_bidi_paragraph_direction, bset_case_canon_table)
3229 (bset_case_eqv_table, bset_directory, bset_display_count)
3230 (bset_display_time, bset_downcase_table)
3231 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3232 (bset_last_selected_window, bset_local_var_alist)
3233 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3234 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3236 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3237 (bset_auto_fill_function, bset_auto_save_file_format)
3238 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3239 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3240 (bset_cache_long_line_scans, bset_case_fold_search)
3241 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3242 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3243 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3244 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3245 (bset_header_line_format, bset_indicate_buffer_boundaries)
3246 (bset_indicate_empty_lines, bset_invisibility_spec)
3247 (bset_left_fringe_width, bset_major_mode, bset_mark)
3248 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3249 (bset_name, bset_overwrite_mode, bset_pt_marker)
3250 (bset_right_fringe_width, bset_save_length)
3251 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3252 (bset_scroll_up_aggressively, bset_selective_display)
3253 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3254 (bset_word_wrap, bset_zv_marker):
3255 * category.c (bset_category_table):
3256 * syntax.c (bset_syntax_table):
3257 New setter functions.
3259 * process.h (PSET): Remove (Bug#12215).
3260 Replace all uses with calls to new setter functions.
3261 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3262 (PROCESS_INLINE): New macro.
3263 (pset_childp): New setter function.
3264 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3265 * process.c (PROCESS_INLINE):
3266 Define to EXTERN_INLINE, so that the corresponding functions
3267 are compiled into code.
3268 (pset_buffer, pset_command, pset_decode_coding_system)
3269 (pset_decoding_buf, pset_encode_coding_system)
3270 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3271 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3272 (pset_type, pset_write_queue): New setter functions.
3274 * window.h (WSET): Remove (Bug#12215).
3275 Replace all uses with calls to new setter functions.
3276 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3277 (WINDOW_INLINE): New macro.
3278 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3279 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3280 (wset_total_lines, wset_vertical_scroll_bar)
3281 (wset_window_end_pos, wset_window_end_valid)
3282 (wset_window_end_vpos): New setter functions.
3283 * window.c (WINDOW_INLINE):
3284 Define to EXTERN_INLINE, so that the corresponding functions
3285 are compiled into code.
3286 (wset_combination_limit, wset_dedicated, wset_display_table)
3287 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3288 (wset_new_normal, wset_new_total, wset_next_buffers)
3289 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3290 (wset_prev_buffers, wset_right_fringe_width)
3291 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3292 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3293 (wset_window_parameters):
3294 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3295 (wset_column_number_displayed, wset_region_showing):
3296 New setter functions.
3298 * termhooks.h (TSET): Remove (Bug#12215).
3299 Replace all uses with calls to new setter functions.
3300 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3301 (TERMHOOKS_INLINE): New macro.
3302 (tset_charset_list, tset_selection_alist): New setter functions.
3303 * terminal.c (TERMHOOKS_INLINE):
3304 Define to EXTERN_INLINE, so that the corresponding functions
3305 are compiled into code.
3306 (tset_param_alist): New setter function.
3308 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3310 * keyboard.h (KSET): Remove (Bug#12215).
3311 Replace all uses with calls to new setter functions.
3312 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3313 (KEYBOARD_INLINE): New macro.
3314 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3315 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3316 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3317 New setter functions.
3318 * keyboard.c (KEYBOARD_INLINE):
3319 Define to EXTERN_INLINE, so that the corresponding functions
3320 are compiled into code.
3321 (kset_echo_string, kset_kbd_queue)
3322 (kset_keyboard_translate_table, kset_last_prefix_arg)
3323 (kset_last_repeatable_command, kset_local_function_key_map)
3324 (kset_overriding_terminal_local_map, kset_real_last_command)
3325 (kset_system_key_syms): New setter functions.
3327 * frame.h (FSET): Remove (Bug#12215).
3328 Replace all uses with calls to new setter functions.
3329 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3330 (FRAME_INLINE): New macro.
3331 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3332 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3333 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3334 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3335 (fset_param_alist, fset_root_window, fset_scroll_bars)
3336 (fset_selected_window, fset_title, fset_tool_bar_items)
3337 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3338 * frame.c (FRAME_INLINE):
3339 Define to EXTERN_INLINE, so that the corresponding functions
3340 are compiled into code.
3341 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3343 A few more naming-convention fixes for getters and setters.
3344 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3345 and rename from buffer_overlays_set_before.
3346 (set_buffer_overlays_after): Move here from buffer.h, and rename
3347 from buffer_overlays_set_after.
3348 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3350 (set_buffer_intervals): Rename from buffer_set_intervals.
3351 * intervals.c (set_interval_object): Move here from intervals.h,
3352 and rename from interval_set_object.
3353 (set_interval_left): Move here from intervals.h, and rename from
3355 (set_interval_right): Move here from intervals.h, and rename from
3357 (copy_interval_parent): Move here from intervals.h, and rename from
3358 interval_copy_parent.
3359 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3360 (set_interval_plist): Rename from interval_set_plist.
3361 Return void, not Lisp_Object, since no caller uses the result.
3362 * lisp.h (string_intervals): Rename from string_get_intervals.
3363 (set_string_intervals): Rename from string_set_intervals.
3365 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3366 (set_char_table_contents): Rename from char_table_set_contents.
3367 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3368 All uses changed. See the end of
3369 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3371 * lisp.h (CSET): Remove (Bug#12215).
3372 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3373 (set_char_table_purpose): New functions,
3374 replacing CSET. All uses changed. For example, replace
3375 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3376 "set_char_table_parent (char_table, parent);".
3377 The old version was confusing because it used the same name
3378 'parent' for two different things.
3380 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3382 Functions to get and set Lisp_Object fields of buffer-local variables.
3383 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3384 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3385 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3386 * data.c, eval.c, frame.c: Adjust users.
3388 2012-08-17 Chong Yidong <cyd@gnu.org>
3390 * xfaces.c (merge_face_vectors): If the target font specfies a
3391 font spec, make the font's attributes take precedence over
3392 directly-specified attributes.
3393 (merge_face_ref): Recognize :font.
3395 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3397 Do not use memcpy for copying intervals.
3398 * intervals.c (reproduce_interval): New function.
3399 (reproduce_tree, reproduce_tree_obj): Use it.
3400 (reproduce_tree_obj): Remove prototype.
3402 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3404 * lisp.h (duration_to_sec_usec): Remove unused decl.
3406 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3408 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3409 to an allocated instance of NSString, not to the class itself.
3411 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3413 * makefile.w32-in (C_CTYPE_H): New macro.
3414 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3415 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3416 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3418 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3420 Use ASCII tests for character types.
3421 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3423 Don't include <ctype.h>; was not needed.
3424 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3425 * sysdep.c, xfaces.c:
3426 Include <c-ctype.h> instead of <ctype.h>.
3427 * nsterm.m: Include <c-ctype.h>.
3428 * charset.c (read_hex):
3429 * doc.c (Fsnarf_documentation):
3430 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3431 (DRIVE_LETTER) [DOS_NT]:
3432 (Ffile_name_directory, Fexpand_file_name)
3433 (Fsubstitute_in_file_name):
3434 * font.c (font_parse_xlfd, font_parse_fcname):
3435 * frame.c (x_set_font_backend):
3436 * gtkutil.c (xg_get_font):
3437 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3438 * nsimage.m (hexchar):
3439 * nsterm.m (ns_xlfd_to_fontname):
3440 * sysdep.c (system_process_attributes):
3441 * xfaces.c (hash_string_case_insensitive):
3442 Use C-locale tests instead of locale-specific tests for character
3443 types, since we want the ASCII interpretation here, not the
3444 interpretation suitable for whatever happens to be the current locale.
3446 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3448 Consistently check windows for validity/liveness
3449 (Bug#11984, Bug#12025, Bug#12026).
3450 * lisp.h (CHECK_VALID_WINDOW): New macro.
3451 * window.c (decode_window): Rename to decode_live_window.
3452 (decode_valid_window, Fwindow_valid_p): New functions.
3453 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3454 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3455 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3456 (Fwindow_prev_sibling, Fwindow_combination_limit)
3457 (Fset_window_combination_limit, Fwindow_use_time)
3458 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3459 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3460 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3461 (Fwindow_hscroll, Fset_window_hscroll)
3462 (Fwindow_redisplay_end_trigger)
3463 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3464 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3465 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3466 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3467 (Fwindow_end, Fset_window_point, Fset_window_start)
3468 (Fpos_visible_in_window_p, Fwindow_line_height)
3469 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3470 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3471 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3472 (Fset_window_parameter, Fwindow_display_table)
3473 (Fset_window_display_table, Fdelete_other_windows_internal)
3474 (Fset_window_buffer, Fset_window_new_total)
3475 (Fset_window_new_normal, Fdelete_window_internal)
3476 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3477 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3478 (Fwindow_scroll_bars): Check whether argument window is a valid or
3479 live window. Update doc-strings.
3480 (syms_of_window): New symbol Qwindow_valid_p.
3481 * keyboard.c (Fposn_at_x_y): Check whether argument
3482 frame_or_window denotes a valid window.
3484 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3486 Fix previous char table change.
3487 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3488 * chartab.c (optimize_sub_char_table): Likewise.
3490 2012-08-16 Chong Yidong <cyd@gnu.org>
3492 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3494 * xfont.c (xfont_open):
3495 * xftfont.c (xftfont_open): Set the font's max_width field.
3497 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3498 min_width to space_width and average_width to the average over
3499 printable ASCII characters.
3500 (ns_char_width): Code cleanup.
3501 (ns_ascii_average_width): New utility function.
3503 * font.h (struct font): Update comments.
3505 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3507 Simple interface to set Lisp_Object fields of character tables.
3508 * lisp.h (CSET): New macro.
3509 (char_table_set_extras, char_table_set_contents)
3510 (sub_char_table_set_contents): New function.
3511 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3512 * syntax.c: Adjust users.
3514 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3516 * eval.c (eval_sub): Bind lexical-binding.
3517 * lread.c (Qlexical_binding): Make non-static.
3519 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3521 * nsmenu.m (popupSession): Remove.
3522 (pop_down_menu): Remove endModalSession.
3523 (timeout_handler:): New method.
3524 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3525 Call runModalForWindow. Check timer_fired when it returns.
3526 If not set, cancel timer and break out of loop.
3527 Otherwise loop again, with a new timeout.
3529 * nsterm.m: Include fcntl.h if present.
3530 (fd_entry, t_readfds, inNsSelect): Remove.
3531 (select_writefds, select_valid, select_timeout, selfds)
3532 (select_mutex, apploopnr): Add.
3533 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3534 Otherwise call kbd_buffer_store_event.
3535 (ns_send_appdefined): Remove release of fd_entry.
3536 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3537 Increment and decrement apploopnr.
3538 (ns_select): If no file descriptors, just do a NSTimer.
3539 Otherwise copy read/write masks and start select thread (fd_handler).
3540 Start main loop and wait for application defined event.
3541 Inform select thread to stop selecting after main loop is exited.
3542 (ns_term_init): Create selfds pipe and set non-blocking.
3543 Initialize select_mutex. Start the select thread (fd_handler).
3544 (fd_handler:): Loop forever, wait for info from the main thread
3545 to either start or stop selecting. When select returns, send
3546 and appdefined event.
3547 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3548 If not call kbd_buffer_store_event.
3550 * nsterm.h (EmacsApp): fd_handler takes id argument.
3551 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3553 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3555 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3557 * region-cache.c (move_cache_gap): Update gap_len using the actual
3558 growth of the boundaries array. Do not change cache_len.
3561 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3563 Generalize and cleanup font subsystem checks.
3564 * font.h (FONT_DEBUG, font_assert): Remove.
3565 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3566 Change font_assert to eassert. Use eassert where appropriate.
3568 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3570 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3572 2012-08-15 Chong Yidong <cyd@gnu.org>
3574 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3575 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3576 extract the font descriptor instead of just the font name.
3577 In that case, return a font spec instead of a string.
3578 (x_last_font_name): Move to this file from xfns.c.
3580 * xfns.c (Fx_select_font): The return value can also be a font
3581 spec. Move x_last_font_name management to gtkutil.c.
3583 * xfaces.c: Make font weight and style symbols non-static.
3585 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3587 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3590 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3592 * alloc.c (Fgarbage_collect): Use plural form consistently.
3594 2012-08-14 Eli Zaretskii <eliz@gnu.org>
3596 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3597 iteration through the command loop. Fixes a problem whereby mouse
3598 movements are ignored until the first mouse click.
3600 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3602 Use bool, not int, for Lisp booleans.
3603 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3604 makes Emacs a bit smaller and presumably a bit faster.
3605 * lisp.h: Include <stdbool.h>.
3606 (struct Lisp_Boolfwd, defvar_bool):
3607 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3608 * regex.c [!emacs]: Include <stdbool.h>.
3609 (false, true): Remove; <stdbool.h> does this for us now.
3611 2012-08-14 Chong Yidong <cyd@gnu.org>
3613 * character.c (Fcharacterp): Doc fix (Bug#12076).
3615 * data.c (Findirect_variable): Doc fix (Bug#11040).
3617 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3619 * editfns.c (Fformat): Doc fix (Bug#12059).
3620 (Fsave_current_buffer): Doc fix (Bug#11542).
3622 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3624 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3627 2012-08-14 Martin Rudalics <rudalics@gmx.at>
3629 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3630 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3631 * minibuf.c (choose_minibuf_frame, read_minibuf):
3632 * w32fns.c (x_create_tip_frame):
3633 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3634 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3636 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3638 * intervals.c (offset_intervals): Remove obsolete comment.
3640 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3642 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3644 2012-08-14 Gergely Risko <gergely@risko.hu>
3646 * coding.c (decode_coding): Record buffer modification before
3647 disabling undo_list (Bug#11773).
3649 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3651 Revert and cleanup some recent overlay changes.
3652 * buffer.h (enum overlay_type): Remove.
3653 (buffer_get_overlays, buffer_set_overlays): Likewise.
3654 (buffer_set_overlays_before, buffer_set_overlays_after):
3655 New function. Adjust users.
3656 (unchain_both): Add eassert.
3658 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3660 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3662 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3664 * gtkutil.c (xg_mark_data): Don't assume C99.
3666 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3668 * gtkutil.c (xg_frame_tb_info): New struct.
3669 (TB_INFO_KEY): New define.
3670 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3671 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3672 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3674 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3675 is up to date. Otherwise store new data.
3676 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3678 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3680 Use KSET for write access to Lisp_Object members of struct kboard.
3681 * keyboard.h (KSET): New macro.
3682 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3683 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3684 * xterm.c: Adjust users.
3686 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3688 Use BSET for write access to Lisp_Object members of struct buffer.
3689 * buffer.h (BSET): New macro.
3690 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3691 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3692 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3693 * window.c, xdisp.c, xfns.c: Adjust users.
3695 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3697 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3699 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3701 * nsterm.m (not_in_argv): New function.
3702 (application:openFile, application:openTempFile:):
3703 (application:openFileWithoutUI:, application:openFiles:): Open file
3704 if not_in_argv returns non-zero (bug#12171).
3706 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3707 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3708 Define for Gtk+ versions less than 3.2.
3709 (xg_get_font_name): Use those functions/macros here.
3710 Reported by Frans Oilinki <moilinki@gmail.com>.
3712 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3714 * unexmacosx.c (copy_data_segment): Copy initialized data in
3715 statically linked libraries from input file rather than memory.
3717 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3718 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3719 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3721 2012-08-10 Glenn Morris <rgm@gnu.org>
3723 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3724 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3726 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3728 Fix last change to allow compilation with low optimization levels.
3729 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3730 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3732 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3734 Use common inline syntax in intervals.h.
3735 * intervals.h (INTERVALS_INLINE): New macro.
3736 Change all users from LISP_INLINE.
3738 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3740 Define Qnone once for all platforms.
3741 * frame.c (Qnone): Define here.
3742 (syms_of_frame): DEFSYM it.
3743 * lisp.h (Qnone): New declaration.
3744 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3745 * xfns.c: Remove duplication. Adjust users.
3747 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3749 Remove unused macros from intervals.h.
3750 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3751 * intervals.c: Adjust comment.
3753 2012-08-10 Eli Zaretskii <eliz@gnu.org>
3755 * w32fns.c <w32_unicode_gui>: New static variable.
3756 (globals_of_w32fns): Initialize it according to os_subtype.
3757 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3760 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
3761 Eli Zaretskii <eliz@gnu.org>
3763 Fix bug #10299 with Unicode characters sent by customized
3764 keyboards created by MSKLC.
3765 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3766 (w32_init_class): Use it to initialize the Emacs class with either
3767 ANSI or Unicode API calls.
3768 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3770 (w32_wnd_proc): If the character code sent by WM_CHAR or
3771 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3772 original message. Call DefWindowProcW on NT and later.
3774 2012-08-10 Glenn Morris <rgm@gnu.org>
3776 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3778 * lisp.h (DIRECTORY_SEP): Let configure set it.
3780 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3782 Use TSET for write access to Lisp_Object slots of struct terminal.
3783 * termhooks.h (TSET): New macro.
3784 * coding.c, terminal.c, xselect.c: Adjust users.
3786 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3788 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3789 the failing expression, include them in the error message.
3790 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3791 * lisp.h (internal_condition_case_n): Update declaration.
3793 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3795 Inline functions to examine and change buffer overlays.
3796 * buffer.c (unchain_both): New function.
3797 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3798 (buffer_has_overlays): New function.
3799 (enum overlay_type): New enum.
3800 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3801 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3803 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3805 Inline functions to examine and change buffer intervals.
3806 * alloc.c (mark_interval_tree): Remove.
3807 (MARK_INTERVAL_TREE): Simplify.
3808 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3809 * intervals.c (buffer_balance_intervals): New function.
3810 (graft_intervals_into_buffer): Adjust indentation.
3811 (set_intervals_multibyte): Simplify.
3812 * buffer.h (BUF_INTERVALS): Remove.
3813 (buffer_get_intervals, buffer_set_intervals): New function.
3814 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3815 * intervals.c, textprop.c: Adjust users.
3817 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3819 Inline functions to examine and change string intervals.
3820 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3821 (string_get_intervals, string_set_intervals): New function.
3822 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3823 * lread.c, print.c, textprop.c: Adjust users.
3825 2012-08-08 Glenn Morris <rgm@gnu.org>
3827 * lisp.mk (lisp): Remove language/persian.elc.
3829 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3832 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3833 (NULL_INTERVAL_P): Likewise. Adjust users.
3834 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3835 Adjust comment. Move under #if 0.
3836 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3837 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3839 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3841 Check total length of intervals with eassert.
3842 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3843 * intervals.c: Change all users to eassert.
3845 2012-08-07 Eli Zaretskii <eliz@gnu.org>
3847 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3848 Rename fields to match removal of FGET and WGET and disuse of
3849 INTERNAL_FIELD in Lisp_Cons.
3851 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3853 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3854 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3855 name since all xname users are fixed long time ago. Do not
3857 (set_symbol_name, set_symbol_function, set_symbol_plist):
3858 (set_symbol_next, set_overlay_plist): New function.
3859 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3860 (struct Lisp_Overlay): Likewise.
3861 (CVAR, MVAR, SVAR): Remove.
3862 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3863 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3864 * xterm.c: Adjust users.
3865 * .gdbinit: Change to use name field of struct Lisp_Symbol
3868 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3870 Basic functions to set Lisp_Object and pointer slots of intervals.
3871 * intervals.h (interval_set_parent, interval_set_object):
3872 (interval_set_left, interval_set_right, interval_set_plist):
3873 (interval_copy_parent): New function.
3874 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
3875 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3877 (INTERVAL_SIZE): Remove. Adjust users.
3878 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3880 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3882 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3883 * process.h (PGET): Remove.
3884 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3885 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3887 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3889 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3890 * window.h (WGET): Remove.
3891 (struct window): Do not use INTERNAL_FIELD.
3892 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3893 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3894 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3895 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3896 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3899 2012-08-07 Chong Yidong <cyd@gnu.org>
3901 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3902 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3903 (Fdelete_window_internal): Signal an error if the window is not on
3904 a live frame (Bug#12025).
3906 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3908 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3909 * frame.h (FGET): Remove.
3910 (struct frame): Do not use INTERNAL_FIELD.
3911 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3912 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3913 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3914 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3916 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
3918 * w32.c: Silence compiler warnings.
3919 (map_w32_filename): Remove unused variable `is_fat'.
3920 (chase_symlinks): Add parentheses around expression.
3922 2012-08-06 Glenn Morris <rgm@gnu.org>
3924 * sysdep.c: Respect BROKEN_GETWD.
3926 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3927 Let configure handle it.
3928 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3930 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3932 Use GCALIGNMENT where appropriate.
3933 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3934 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3935 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3937 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3939 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3940 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3942 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3944 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3945 that should be sufficient for everyone.
3947 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3949 * keyboard.c (timer_check_2): Add break so timer_check returns next
3952 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3954 Fix Windows build errors introduced after converting to WGET and WSET.
3955 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3956 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3958 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3960 * nsterm.m (ns_frame_rehighlight): Use FSET.
3962 * nsmenu.m (ns_update_menubar): Use FSET.
3964 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3966 Separate read and write access to Lisp_Object slots of Lisp_Process.
3967 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3968 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3970 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3972 Separate read and write access to Lisp_Object slots of struct window.
3973 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3974 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3975 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3976 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3977 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3978 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3981 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3983 Fix Windows build errors introduced after converting to FGET and FSET.
3984 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3985 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3986 (w32_judge_scroll_bars): Change to use FSET.
3987 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3989 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3991 Fix replacement typo.
3992 * window.c (replace_window): Set root_window instead of
3993 selected_window. This fixes a total window subsystem
3994 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3996 2012-08-06 Glenn Morris <rgm@gnu.org>
3998 * lisp.mk (lisp): Add language/persian.elc.
4000 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4002 Separate read and write access to Lisp_Object slots of struct frame.
4003 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4004 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4005 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4006 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4007 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4009 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4011 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4013 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4015 Generalize common compile-time constants.
4016 * lisp.h (header_size, bool_header_size, word_size): Now here.
4017 (struct Lisp_Vector): Add comment.
4018 (struct Lisp_Bool_Vector): Move up to define handy constants.
4019 (VECSIZE, PSEUDOVECSIZE): Simplify.
4020 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4021 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4022 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4023 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4024 * xfont.c, xmenu.c: Use word_size where appropriate.
4026 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4028 * search.c (Freplace_match): Treat \? in the replacement text
4029 literally (Bug#8161).
4031 2012-08-05 Chong Yidong <cyd@gnu.org>
4033 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4034 * frame.c (Vdelete_frame_functions):
4035 * emacs.c (Vkill_emacs_hook): Doc fix.
4037 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4039 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4040 --with-x-toolkit=no builds.
4041 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4043 2012-08-04 Chong Yidong <cyd@gnu.org>
4045 * syntax.c (Fmodify_syntax_entry): Doc fix.
4047 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4049 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4050 * w32.c (init_environment): Change the default values of many
4051 environment variables in dflt_envvars[] to NULL, to avoid pushing
4052 them into environment when they were not already defined.
4053 Remove the code that deletes site-lisp subdirectories from the default
4054 value of EMACSLOADPATH, as it is no longer needed.
4055 (check_windows_init_file): Now external, not static.
4056 Use Vload_path as is, without adding anything, as this function is now
4057 called when Vload_path is already set up.
4059 * w32.h (check_windows_init_file): Add prototype.
4061 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4062 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4063 compatibility with Posix platforms.
4064 (main): Move the call to check_windows_init_file to here from
4066 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4067 any, in the DEFALT argument into the root of the Emacs build or
4068 installation tree, as appropriate.
4070 * callproc.c (init_callproc_1): Call decode_env_path instead of
4071 doing its equivalent by hand.
4072 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4073 the code that sets Vexec_path run on MS-Windows.
4075 * lread.c (init_lread): Add comments to #ifdef's.
4077 * msdos.c (dos_set_window_size, IT_update_begin)
4078 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4079 instead of direct references.
4081 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4083 Export DEFAULT_REHASH_* to GDB.
4084 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4085 Now constants, not macros.
4087 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4089 Remove unnecessary casts involving pointers.
4090 These casts are no longer needed now that we assume C89 or later,
4091 since they involve casting to or from void *.
4092 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4093 (make_pure_float, make_pure_vector):
4094 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4095 * macros.c (Fstart_kbd_macro):
4096 * menu.c (find_and_return_menu_selection):
4097 * minibuf.c (read_minibuf_noninteractive):
4098 * sysdep.c (closedir):
4099 * xdisp.c (x_produce_glyphs):
4100 * xfaces.c (compare_fonts_by_sort_order):
4101 * xfns.c (x_real_positions, select_visual):
4102 * xselect.c (x_stop_queuing_selection_requests)
4103 (x_get_window_property, x_get_window_property_as_lisp_data):
4104 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4105 Remove unnecessary pointer casts.
4106 * alloc.c (record_xmalloc): New function.
4107 * lisp.h (record_xmalloc): New decl.
4108 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4109 more like a function. This is because the pointer cast is not
4110 needed. All uses changed.
4111 * print.c (print_string, print_error_message): Avoid length recalc.
4113 Improve fix for macroexp crash with debugging (Bug#12118).
4114 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4115 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4116 not supposed to be invoked from the garbage collector.
4117 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4118 (gc_aset): New function, which is like ASET but can be
4119 used in the garbage collector.
4120 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4121 (set_hash_index): Use it instead of ASET.
4123 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4125 Support symlinks on latest versions of MS-Windows.
4126 * w32.c: Include winioctl.h and aclapi.h.
4127 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4128 (revert_to_self): Forward declarations of static functions.
4129 <static BOOL g_b_init_get_security_info>:
4130 <g_b_init_create_symbolic_link>: New static flags.
4131 (globals_of_w32): Initialize them to zero.
4132 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4133 (map_w32_filename): Improve commentary. Simplify switch.
4134 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4135 headers (most versions of MinGW w32api don't).
4136 (get_security_info, create_symbolic_link)
4137 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4139 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4140 in the argument file name.
4141 (sys_access): Call unc_volume_file_attributes only if
4142 GetFileAttributes fails with network-related error codes.
4143 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4144 have the required privileges.
4145 (get_file_security_desc_by_name): Rename from
4146 get_file_security_desc.
4147 (stat_worker): New function, with most of the guts of 'stat', and
4148 with addition of handling of symlinks and support for 'lstat'.
4149 If possible, get file's attributes and security information by
4150 handle, not by name. Produce S_IFLNK bit for symlinks, when
4151 called from 'lstat'.
4152 (stat, lstat): New functions, call 'stat_worker'.
4153 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4154 symlinks when the underlying filesystem supports them.
4156 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4158 Fix macroexp crash on Windows with debugging (Bug#12118).
4159 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4160 checking subscripts; problem introduced with the recent
4161 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4162 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4163 since it's used in non-static inline functions now.
4165 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4166 Don't assume buffer size fits in 'int'. Remove unused local.
4168 Use C99-style 'extern inline' if available.
4169 * buffer.h (BUFFER_INLINE):
4170 * category.h (CATEGORY_INLINE):
4171 * character.h (CHARACTER_INLINE):
4172 * charset.h (CHARSET_INLINE):
4173 * composite.h (COMPOSITE_INLINE):
4174 * dispextern.h (DISPEXTERN_INLINE):
4175 * lisp.h (LISP_INLINE):
4176 * systime.h (SYSTIME_INLINE):
4177 New macro, replacing 'static inline' in this header.
4178 * buffer.h, category.h, character.h, charset.h, composite.h:
4179 * dispextern.h, lisp.h, systime.h:
4180 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4181 * alloc.c (LISP_INLINE):
4182 * buffer.c (BUFFER_INLINE):
4183 * category.c (CATEGORY_INLINE):
4184 * character.c (CHARACTER_INLINE):
4185 * charset.c (CHARSET_INLINE):
4186 * composite.c (COMPOSITE_INLINE):
4187 * dispnew.c (DISPEXTERN_INLINE):
4188 * sysdep.c (SYSTIME_INLINE):
4189 Define to EXTERN_INLINE, so that the corresponding functions
4190 are compiled into code.
4191 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4192 (INLINE_HEADER_END): New macros.
4193 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4194 since it's used in non-static inline functions now.
4195 (VALMASK) [!USE_LSB_TAG]: Likewise.
4197 2012-08-02 Glenn Morris <rgm@gnu.org>
4199 * s/: Remove empty directory.
4201 * s/ms-w32.h: Move to ../nt/inc.
4202 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4203 Update for new ms-w32.h location.
4205 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4208 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4210 2012-08-02 Glenn Morris <rgm@gnu.org>
4212 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4213 hard-coding the path separator.
4215 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4217 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4218 This how ASET and AREF are supposed to work, and makes
4219 it easier to think about future improvements. See
4220 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4221 * charset.h (set_charset_attr): New function.
4222 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4223 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4224 (aref_addr): New function. All uses of &AREF(...) changed.
4225 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4226 (set_hash_index): New functions. All lvalue-style uses of
4227 HASH_KEY etc. changed.
4228 * keyboard.c (set_prop): New function. All lvalue-style uses
4231 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4233 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4234 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4235 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4236 * nsfns.m (ns_set_name_as_filename): Likewise.
4237 * nsmenu.m (ns_update_menubar): Likewise.
4238 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4240 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4242 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4243 Adapt to latest changes in field names of the corresponding Lisp
4246 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4248 2012-08-01 Glenn Morris <rgm@gnu.org>
4250 * s/msdos.h: Remove file.
4251 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4252 * Makefile.in (S_FILE): Remove.
4253 (config_h): Remove S_FILE.
4255 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4257 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4258 Remove; moved to nt/config.nt.
4260 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4262 Use INTERNAL_FIELD for conses and overlays.
4263 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4264 Remove obsolete comment.
4266 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4267 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4269 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4271 Use INTERNAL_FIELD for symbols.
4272 * lisp.h (SVAR): New macro. Adjust users.
4273 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4274 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4276 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4278 Use INTERNAL_FIELD for processes.
4279 * process.h (PVAR): New macro. Adjust style.
4280 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4281 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4283 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4285 Use INTERNAL_FIELD for windows.
4286 * window.h (WVAR): New macro.
4287 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4288 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4289 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4290 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4291 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4292 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4294 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4296 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4298 2012-08-01 Glenn Morris <rgm@gnu.org>
4300 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4301 Move to configure.ac.
4303 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4305 * makefile.w32-in (CONFIG_H): Update dependencies.
4306 (CONF_POST_H): New macro.
4308 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4310 2012-07-31 Glenn Morris <rgm@gnu.org>
4312 * Makefile.in (S_FILE): No longer set by configure.
4314 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4316 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4318 * process.h (NULL_DEVICE):
4319 * emacs.c (SEPCHAR):
4320 * editfns.c (USER_FULL_NAME): Let configure set them.
4322 * s/README, s/template.h: Remove files.
4324 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4326 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4327 Move to configure.ac.
4329 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4331 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4332 resulting renaming of 'struct frame' members.
4334 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4336 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4337 after introduction of FVAR.
4339 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4341 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4343 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4344 instead of compositeToPoint.
4345 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4347 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4349 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4351 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4352 * lisp.h (INTERNAL_FIELD): New macro.
4353 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4354 (BVAR): Change to use INTERNAL_FIELD.
4355 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4356 (KVAR): Change to use INTERNAL_FIELD.
4357 * frame.h (FVAR): New macro.
4358 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4359 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4360 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4361 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4362 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4364 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4366 Miscellaneous fixes for non-default X toolkits.
4367 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4368 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4369 Move under #ifdef USE_LUCID.
4370 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4371 definition and usage to avoid warnings.
4373 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4375 * nsterm.m (openFiles): Fix previous checkin.
4377 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4379 * indent.c (compute_motion): Remove unused local.
4381 2012-07-31 Glenn Morris <rgm@gnu.org>
4383 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4385 * conf_post.h [USG5_4]:
4386 Move remaining contents of s/usg5-4-common.h here.
4387 * s/usg5-4-common.h: Remove file.
4389 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4390 * s/irix6-5.h: Remove file.
4392 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4393 * s/darwin.h: Remove file.
4395 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4396 * s/hpux10-20.h: Remove file, which is now empty.
4398 2012-07-30 Glenn Morris <rgm@gnu.org>
4400 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4401 * Makefile.in (config_h): Add conf_post.h.
4402 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4404 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4406 * nsterm.m (ns_do_open_file): New variable.
4407 (ns_term_init): Set ns_do_open_file to YES after run returns.
4408 (openFile, openTempFile, openFileWithoutUI, openFiles):
4409 Open files only if ns_do_open_file.
4411 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4413 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4414 This no-op macro hasn't been needed for many years.
4415 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4417 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4418 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4419 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4420 gdb_make_enums_visible.
4421 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4422 (DIRECTORY_SEP): Now a constant, not a macro.
4424 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4426 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4427 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4429 * w32term.c <w32_keyboard_codepage>: Renamed from
4430 keyboard_codepage and now external. All users changed.
4432 * w32term.h: Add declaration of w32_keyboard_codepage.
4434 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4435 the codepage to translate keys to Unicode. If this argument is
4436 -1, use the value returned by GetConsoleCP. All callers changed.
4438 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4440 Update .PHONY listings in makefiles.
4441 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4442 bootstrap-clean, distclean, maintainer-clean, versioclean,
4445 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4446 This is a bit clearer. Fix some commentary typos.
4448 2012-07-30 Glenn Morris <rgm@gnu.org>
4450 * s/netbsd.h: Let configure include signal.h if needed.
4451 Remove file, which is now empty.
4453 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4454 Let configure set them.
4455 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4456 No more need to undefine.
4458 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4460 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4461 non-single-byte char when adding meta modifier. (Bug#12090)
4463 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4465 Convert safe_call to use variable number of arguments.
4466 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4467 (safe_call2): Fix comment.
4468 * lisp.h (safe_call): Adjust prototype.
4469 * coding.c (encode_coding_object): Change to use safe_call2.
4470 * xfaces.c (merge_face_heights): Change to use safe_call1.
4472 2012-07-30 Glenn Morris <rgm@gnu.org>
4474 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4475 does that unconditionally. Remove file, which is now empty.
4477 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4480 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4482 Export to GDB most of lisp.h's remaining object-like macros.
4483 * lisp.h (min, max): Move earlier, because they're used earlier now.
4484 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4485 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4486 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4487 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4488 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4489 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4490 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4491 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4492 Now constants, for GDB. They need not be macros.
4493 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4494 Now constants, for GDB, as well as macros, for static initializers.
4495 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4496 Move to after the definition of struct Lisp_Char_Table,
4497 since the former now needs that type defined.
4498 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4499 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4500 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4501 New enums, for gdb_make_enums_visible.
4502 (GLYPH_MODE_LINE_FACE): Remove; unused.
4503 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4504 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4505 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4506 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4507 enum maxargs, enum MAX_ALLOCA.
4508 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4509 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4510 no longer needed, now that they are done in lisp.h.
4512 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4514 Cleanup string bytes checking.
4515 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4516 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4517 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4518 (check_sblock, compact_small_strings): Simplify.
4520 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4522 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4523 These macros are confusing and no longer need to be defined, as
4524 the enum values now suffice. All uses replaced with definiens.
4525 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4527 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4529 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4530 ($(BLD)/w32console.$(O)): Update dependencies.
4532 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4534 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4535 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4537 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4539 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4541 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4542 setting sitelisp (Bug#12010).
4544 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4546 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4548 * w32heap.c (cache_system_info):
4549 * w32.c (sys_rename):
4550 * w32proc.c (find_child_console, sys_kill): All users changed.
4552 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4554 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4556 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4558 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4560 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4562 Cleanup statistics calculation in Fgarbage_collect.
4563 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4564 Fix zombies percentage calculation. Simplify elapsed time calculation.
4566 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4568 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4569 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4570 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4571 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4572 (replace_range, replace_range_2, del_range_2): Change to eassert.
4573 * marker.c (byte_char_debug_check): Adjust style.
4575 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4577 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4578 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4579 long-ago-commented-out code that talks about "WIN32".
4580 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4583 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4585 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4586 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4587 Simplify by using alignof.
4588 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4589 * lisp.h: Include <stdalign.h>.
4590 (GCALIGNMENT): New macro and constant.
4591 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4592 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4593 (stdalign): New macro, if not already defined.
4595 2012-07-28 Eli Zaretskii <eliz@gnu.org>
4597 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4598 * w32inevt.c: Include w32inevt.h.
4599 (w32_read_console_input): New inline function, calls either
4600 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4601 w32_console_unicode_input.
4602 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4603 (w32_kbd_patch_key, key_event): Use the codepage returned by
4604 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4605 (key_event): use uChar.UnicodeChar only if
4606 w32_console_unicode_input is non-zero.
4608 * w32console.c: Include w32heap.h.
4609 <w32_console_unicode_input>: New global variable.
4610 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4611 family of Windows, zero otherwise.
4613 * w32inevt.h: Declare w32_console_unicode_input.
4615 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4616 --without-x. (Bug#11742)
4618 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4620 Adjust GDB to reflect pvec_type changes (Bug#12036).
4621 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4622 2012-07-04 changes to pseudovector representation.
4623 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4625 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
4627 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4629 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4631 2012-07-27 Eli Zaretskii <eliz@gnu.org>
4633 * alloc.c (listn): Fix the order the arguments are consed onto the
4636 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4637 enumeration constants, as PURE and HEAP are too general, and clash
4638 with other headers and sources, such as gmalloc.c and the
4639 MS-Windows system headers. All users changed.
4641 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4643 Revert last save_excursion_save and save_excursion_restore changes.
4644 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4645 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4647 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4649 Fix recently-introduced typos in Windows port.
4650 Reported by Martin Rudalics <rudalics@gmx.at>.
4651 * w32.c (init_environment): Replace comma with semicolon.
4652 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4654 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4656 Improve GDB symbol export (Bug#12036).
4657 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4658 arms of an 'if', not using conditional expressions; otherwise GDB
4659 complains about the types in the unevaluated arm when the argument
4660 is an integer literal.
4661 (xgetint): Simplify expression.
4662 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4663 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4664 Zaretskii in <http://bugs.gnu.org/12036#13>.
4665 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4666 needed now that we have gdb_make_enums_visible.
4667 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4668 (enum enum_USE_LSB_TAG):
4669 New enum types, packaging up enums that need to be exported to GDB.
4671 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4673 Utility function to make a list from specified amount of objects.
4674 * lisp.h (enum constype): New datatype.
4675 (listn): New prototype.
4676 * alloc.c (listn): New function.
4677 (Fmemory_use_count, syms_of_alloc): Use it.
4678 * buffer.c (syms_of_buffer): Likewise.
4679 * callint.c (syms_of_callint): Likewise.
4680 * charset.c (define_charset_internal): Likewise.
4681 * coding.c (syms_of_coding): Likewise.
4682 * keymap.c (syms_of_keymap): Likewise.
4683 * search.c (syms_of_search): Likewise.
4684 * syntax.c (syms_of_syntax): Likewise.
4685 * w32.c (init_environment): Likewise.
4686 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4687 * xdisp.c (syms_of_xdisp): Likewise.
4688 * xfns.c (syms_of_xfns): Likewise.
4690 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4692 Fast save_excursion_save and save_excursion_restore.
4693 * lisp.h (struct Lisp_Excursion): New data type.
4694 (PVEC_EXCURSION): New pseudovector type.
4695 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4696 to deal with it. Adjust comments.
4697 (init_marker, attach_marker): New prototype.
4698 (unchain_marker): Adjust prototype.
4699 * marker.c (attach_marker): Change to global.
4700 (init_marker): New function.
4701 * alloc.c (Fmake_marker, build_marker): Use it.
4702 (build_marker): More easserts.
4703 (mark_object): Handle struct Lisp_Excursion.
4704 * editfns.c (save_excursion_save, save_excursion_restore):
4705 Reimplement to use struct Lisp_Excursion. Add comments.
4707 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4709 Fix export of symbols to GDB (Bug#12036).
4710 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4711 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4712 emacs.c, as this is a more-suitable home. Had this been done earlier
4713 the fix for 12036 would have avoided some of the problems noted in
4714 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4715 would have been more obvious.
4716 * emacs.c: Do not include <verify.h>; no longer needed.
4717 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4718 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4719 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4720 Remove; now done in lisp.h.
4721 * lisp.h (PUBLISH_TO_GDB): New macro.
4722 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4723 (DATA_SEG_BITS): Use it.
4724 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4725 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4726 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4727 not be usable in #if. This simplifies things.
4729 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
4731 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4733 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4735 Simplify export of symbols to GDB (Bug#12036).
4736 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4737 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4738 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4739 Adjust to changes in lisp.h and emacs.c, by using
4740 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4741 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4742 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4743 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4744 instead of gdb_valbits.
4745 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4746 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4747 instead of gdb_array_mark_flag.
4748 (xboolvector): Get size from $->size, not $->header.size.
4749 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4750 (xreload, hook-run, hookpost-run): Remove.
4751 * emacs.c: Include <verify.h>.
4752 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4753 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4755 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4756 (gdb_USE_LSB_TAG): New enum constants.
4757 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4758 Also define these as enum constants, so they're visible to GDB.
4759 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4760 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4761 as constants, so they're visible to GDB.
4762 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4763 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4764 Now enum constants, not macros, so they're visible to GDB.
4765 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4766 more convenient now. All uses changed.
4767 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4768 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4770 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4772 Explicitly free restriction data that are not needed anymore.
4773 * editfns.c (save_restriction_restore): Free restriction data.
4775 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4777 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4778 add argument, tune behavior, and adjust all callers.
4780 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4782 Use typedef for EMACS_INT, EMACS_UINT.
4783 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4784 than macros. This simplifies debugging in the usual case, since
4785 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4786 and it allows expressions involving EMACS_INT casts.
4787 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4789 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4791 * nsterm.m (ns_read_socket): Return early if there is a modal
4794 2012-07-25 Martin Rudalics <rudalics@gmx.at>
4796 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4797 that FOCUS-FRAME can be omitted.
4799 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4801 Adjust buffer text indirection counters at the end of Fkill_buffer.
4802 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4803 buffer is definitely dead. This should really fix an issue reported
4804 by Christoph Scholtes again. (Bug#12007).
4805 (init_buffer_once): Initialize indirection counters of
4806 buffer_defaults and buffer_local_symbols (for sanity and safety).
4808 2012-07-24 Eli Zaretskii <eliz@gnu.org>
4810 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4811 and continuation glyphs on tooltip frames, leave them at zero.
4812 Avoids continued lines in tooltips. (Bug#11832)
4814 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4816 Simplify copy_overlay.
4817 * buffer.c (copy_overlay): Simplify. Use build_marker.
4818 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4820 2012-07-23 Eli Zaretskii <eliz@gnu.org>
4822 * print.c (print_object): Don't crash when a frame's name is nil
4823 or invalid. (Bug#12025)
4825 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4826 it signals an error when a tooltip frame is being created.
4828 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4830 Cleanup miscellaneous objects allocation and initialization.
4831 * alloc.c (allocate_misc): Change to static. Add argument to
4832 specify the subtype. Adjust comment and users.
4833 (build_overlay): New function.
4834 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4835 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4836 (allocate_misc): Remove prototype.
4837 (build_overlay): Add prototype.
4839 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4841 Swap buffer text indirection counters in Fbuffer_swap_text.
4842 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4843 This avoids crash reported by Christoph Scholtes at
4844 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4846 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4848 * nsmenu.m (Popdown_data): New struct.
4849 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4851 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4852 (initWithContentRect): Make imgView and contentView non-static
4853 and autorelease them. Also autorelease img and matrix (Bug#12005).
4854 (dealloc): Remove (Bug#12005).
4856 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4858 Adjust consing_since_gc when objects are explicitly freed.
4859 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4860 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4861 (free_cons, free_misc): Subtract object size from consing_since_gc.
4863 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4865 Simplify and cleanup markers positioning code.
4866 * marker.c (attach_marker): More useful eassert.
4867 (live_buffer, set_marker_internal): New function.
4868 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4869 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4871 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4873 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4874 as it's limited by the amount of memory, not by INT_MAX.
4876 2012-07-21 Eli Zaretskii <eliz@gnu.org>
4878 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4879 in special-event-map. See the discussion at
4880 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4883 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4884 info.dwItemData. Fixes crashes on 64-bit Windows.
4885 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4887 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4889 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4890 (conversationIdentifier): Return value is NSInteger.
4891 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4893 2012-07-21 Chong Yidong <cyd@gnu.org>
4895 * window.c (decode_any_window): Signal an error if the window is
4896 on a dead frame (Bug#11984).
4898 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4900 Add indirection counting to speed up Fkill_buffer.
4901 * buffer.h (struct buffer): New member.
4902 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4903 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4904 base buffer indirection counter.
4905 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4906 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4907 through buffer list if indirection counter is 0.
4909 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4911 Extend the value returned by Fgarbage_collect with heap statistics.
4912 * alloc.c (Qheap): New symbol.
4913 (syms_of_alloc): DEFSYM it.
4914 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4915 (Fmemory_free): Remove.
4916 (syms_of_alloc): Don't defsubr it.
4917 * buffer.c (Fcompact_buffer): Remove.
4918 (syms_of_buffer): Don't defsubr it.
4920 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4922 Make maybe_gc inline.
4923 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4924 * lisp.h (consing_since_gc, gc_relative_threshold)
4925 (memory_full_cons_threshold): Revert declaration.
4926 (maybe_gc): Remove prototype, define as inline.
4927 * alloc.c: Remove old commented-out code.
4928 (consing_since_gc, gc_relative_threshold)
4929 (memory_full_cons_threshold): Revert to global.
4932 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4934 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4935 * lisp.h (build_unibyte_string): New function.
4936 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4937 * sysdep.c, w32fns.c, xfns.c: Use it.
4938 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4939 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4940 Adjust users accordingly.
4941 * font.h (font_open_by_name): Adjust prototype.
4943 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4945 Cleanup calls to Fgarbage_collect.
4946 * lisp.h (maybe_gc): New prototype.
4947 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4948 Remove declarations.
4949 * alloc.c (maybe_gc): New function.
4950 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4952 * bytecode.c (MAYBE_GC): Use maybe_gc.
4953 * eval.c (eval_sub, Ffuncall): Likewise.
4954 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4955 to avoid dependency from auto-save feature.
4957 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4959 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4960 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4961 'for_each_per_buffer_object_at'.
4962 All uses changed. It's better to use upper-case for macros that
4963 cannot be implemented as functions, to give the reader a clue
4964 that they're special.
4966 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4968 * alloc.c (Fgarbage_collect): Tweak docstring.
4970 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4972 Tweak the value returned from Fgarbage_collect again.
4973 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4974 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4975 Adjust documentation.
4976 (total_vector_bytes): Rename to total_vector_slots, adjust
4978 (total_free_vector_bytes): Rename to total_free_vector_slots,
4980 (Qstring_bytes, Qvector_slots): New symbols.
4981 (syms_of_alloc): DEFSYM them.
4983 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4985 Buffer compaction primitive which may be used from Lisp.
4986 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4987 (syms_of_buffer): Register Fcompact_buffer.
4988 * alloc.c (Fgarbage_collect): Use compact_buffer.
4989 * buffer.h (compact_buffer): New prototype.
4990 (struct buffer_text): New member.
4992 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4994 New macro to iterate over all buffers, miscellaneous cleanups.
4995 * lisp.h (all_buffers): Remove declaration.
4996 * buffer.h (all_buffers): Add declaration, with comment.
4997 (for_each_buffer): New macro.
4998 * alloc.c (Fgarbage_collect, mark_object): Use it.
4999 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5000 (init_buffer): Likewise.
5001 * data.c (Fset_default): Likewise.
5002 * coding.c (code_conversion_restore): Remove redundant check
5004 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5006 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5008 Fix bug that created negative-length intervals.
5009 * intervals.c (merge_interval_right, merge_interval_left):
5010 Do not zero out this interval if it is absorbed by its children,
5011 as this interval's total length doesn't change in that case. See
5012 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5014 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5016 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5017 when invoking (make-bool-vector N t) and N is a positive
5018 multiple of 8 -- the last 8 bits were mistakenly cleared.
5020 Remove some struct layout assumptions in bool vectors.
5021 * alloc.c (bool_header_size): New constant.
5022 (header_size, word_size): Move earlier, as they're now used earlier.
5023 Use 'word_size' in a few more places, where it's appropriate.
5024 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5025 padding before the data member of a bool vector.
5026 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5027 than doing the check by hand with an abort ().
5029 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5031 * eval.c (Fdefvar): Don't check constants since we only set the var if
5032 it's not yet defined anyway (bug#11904).
5034 * lisp.h (last_undo_boundary): Declare new var.
5035 * keyboard.c (command_loop_1): Set it.
5036 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5037 were auto-added by the command loop (bug#11774).
5039 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5041 * w32font.c (Qsymbol): Remove local definition.
5042 (syms_of_w32font): Don't DEFSYM it.
5044 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5046 Fix sweep_vectors to handle large bool vectors correctly.
5047 * alloc.c (sweep_vectors): Account total_vector_bytes for
5048 bool vectors larger than VBLOCK_BYTES_MAX.
5050 2012-07-18 Chong Yidong <cyd@gnu.org>
5052 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5053 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5055 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5057 Return more descriptive data from Fgarbage_collect.
5058 Suggested by Stefan Monnier in
5059 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5060 * alloc.c (bounded_number): New function.
5061 (total_buffers, total_vectors): New variable.
5062 (total_string_size): Rename to total_string_bytes, adjust users.
5063 (total_vector_size): Rename to total_vector_bytes, adjust users.
5064 (sweep_vectors): Account total_vectors and total_vector_bytes.
5065 (Fgarbage_collect): New return value. Adjust documentation.
5066 (gc_sweep): Account total_buffers.
5067 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5068 (VECTOR_SIZE): Remove.
5069 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5070 (Qinterval, Qmisc): New symbols.
5071 (syms_of_data): Initialize them.
5072 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5073 (Qcons, Qbuffer): New declarations.
5075 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5077 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5078 Round up, not down. Improve doc.
5080 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5082 Restore old code in allocate_string_data to avoid Faset breakage.
5083 Reported by Julien Danjou <julien@danjou.info> in
5084 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5085 * alloc.c (allocate_string_data): Restore old code with minor
5086 adjustments, fix comment to explain this subtle issue.
5088 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5090 Remove FILE_SYSTEM_CASE.
5091 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5093 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5094 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5095 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5096 call-process-region passes it through expand-file-name.
5098 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5100 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5102 Fix crash when creating indirect buffer (Bug#11917)
5103 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5104 Don't handle unbound variables specially if non-zero.
5105 (Fbuffer_local_variables): Pass zero.
5106 (clone_per_buffer_values): Pass non-zero.
5108 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5110 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5111 to make the loop interruptible.
5113 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5115 * gnutls.c (emacs_gnutls_handshake): Only retry if
5116 GNUTLS_E_INTERRUPTED.
5118 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5120 Cleanup and convert miscellaneous checks to eassert.
5121 * alloc.c (mark_interval): Fix comment, partially rephrase
5122 old comment from intervals.h (see below).
5123 * intervals.c (find_interval, adjust_intervals_for_insertion)
5124 (delete_interval, adjust_intervals_for_deletion)
5125 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5127 (adjust_intervals_for_insertion, make_new_interval):
5128 Remove obsolete and unused code.
5129 * intervals.h (struct interval): Remove obsolete comment.
5130 * textprotp.c (erase_properties): Remove unused code.
5131 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5132 (Fremove_list_of_text_properties): Convert to eassert.
5134 2012-07-17 Chong Yidong <cyd@gnu.org>
5136 * editfns.c (Finsert_char): Doc fix.
5138 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5140 Fix previous change to make Fmemory_free always accurate.
5141 * alloc.c (make_interval): Update total_free_intervals.
5142 (make_float): Likewise for total_free_floats.
5143 (free_cons, Fcons): Likewise for total_free_conses.
5144 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5145 Likewise for total_free_vector_bytes.
5146 (Fmake_symbol): Likewise for total_free_symbols.
5147 (bytes_free): Remove.
5149 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5151 Simple free memory accounting feature.
5152 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5153 (sweep_vectors): Accumulate size of free vectors.
5154 (Fgarbage_collect): Setup bytes_free.
5155 (Fmemory_free): New function.
5156 (syms_of_alloc): Register it.
5158 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5160 Cleanup overlays checking.
5161 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5162 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5163 eassert and OVERLAYP.
5164 (sort_overlays): Change to use OVERLAYP.
5166 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5168 * editfns.c (Finsert_char): Make it interactive, and make the
5169 second arg optional. Copy interactive spec and docstring from
5172 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5174 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5175 Unlike the other wrapped functions, fabs has an unspecified
5178 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5180 * nsterm.m (keyDown): Interpret flags without left/right bits
5181 as the left key (Bug#11670).
5183 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5185 Remove empty and useless init functions.
5186 * lisp.h (init_character_once, init_fns, init_image)
5187 (init_filelock, init_sound): Remove prototype.
5188 * character.c (init_character_once): Remove.
5189 * filelock.c (init_filelock): Likewise.
5190 * fns.c (init_fns): Likewise.
5191 * image.c (init_image): Likewise.
5192 * sound.c (init_sound): Likewise.
5193 * emacs.c (main): Adjust accordingly.
5195 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5197 * gtkutil.h: Tiny cleanups.
5198 (use_old_gtk_file_dialog): Remove useless declaration.
5199 (xg_uses_old_file_dialog): Add suggested const attribute.
5201 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5203 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5204 (bidi_paragraph_init): Use it to limit search forward for a strong
5205 directional character in abnormally large paragraphs full of
5206 neutral or weak characters. (Bug#11943)
5208 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5210 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5211 the toolbar (Bug#9451).
5212 (xg_make_tool_item): Give the widget event box a transparent
5215 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5217 Cleanup basic allocation variables and functions.
5218 * alloc.c (ignore_warnings, init_intervals, init_float)
5219 (init_cons, init_symbol, init_marker): Remove.
5220 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5221 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5222 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5223 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5224 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5225 (staticidx, init_alloc_once, init_strings, free_ablock):
5226 Remove redundant initialization.
5227 * fns.c (init_weak_hash_tables): Remove.
5228 * lisp.h (init_weak_hash_tables): Remove prototype.
5230 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5232 Use zero_vector where appropriate.
5233 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5235 * lisp.h (zero_vector): New declaration.
5236 * font.c (null_vector): Remove.
5237 (syms_of_font): Remove initialization and staticpro.
5238 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5239 * keymap.c (Faccessible_keymaps): Likewise.
5241 2012-07-15 Leo Liu <sdl.web@gmail.com>
5243 * fringe.c: Fix typo in comments.
5245 2012-07-14 Leo Liu <sdl.web@gmail.com>
5247 * fringe.c: Add a new bitmap exclamation-mark.
5249 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5251 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5253 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5254 (HAVE_MENUS): Don't define, defined by editing config.in with
5256 (GMALLOC_INHIBIT_VALLOC): Don't define.
5257 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5259 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5261 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5263 2012-07-14 Glenn Morris <rgm@gnu.org>
5265 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5266 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5267 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5269 2012-07-13 Glenn Morris <rgm@gnu.org>
5271 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5273 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5274 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5276 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5278 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5279 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5280 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5281 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5283 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5284 as boolean expression.
5285 (x_set_window_size): Remove unused variable toolbar.
5286 (ns_get_color_default, ns_mod_to_lisp): Remove.
5287 (ns_mouse_position): Remove unused variables xchar and ychar.
5288 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5289 (ns_set_vertical_scroll_bar): Remove unused variable count.
5290 (ns_delete_terminal): Remove unused variable i.
5291 (ns_term_init): Remove unused variables r, g and b.
5292 (mouseDown): Remove unused variable window.
5293 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5294 (initFrameFromEmacs): Remove unused variable vbextra.
5295 (mouseEntered): Remove unused variables p and dpyinfo.
5296 (mouseExited): Remove unused variables p and r.
5297 (ns_define_frame_cursor, ns_clear_frame_area)
5298 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5299 (menuDown): Assign [sender tag] to variable and cast the variable.
5301 * nsterm.h (menuDown): Add id as type to argument sender.
5302 (ns_display_info_for_name): Add Lisp_Object argument.
5303 (ns_term_init): Add Lisp_Object argument.
5304 (ns_map_event_to_object): Add void argument.
5305 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5306 prototype with arguments and only declare if __OBJC__.
5307 (nxatoms_of_nsselect): Add void argument.
5308 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5309 (ns_alloc_autorelease_pool): Add void argument.
5310 (ns_release_autorelease_pool): Add void* argument.
5311 (ns_get_defaults_value): Add const char* argument.
5313 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5314 (initFromContents): Use SSDATA where appropriate.
5315 (ns_update_menubar): Add braces to ambigous if-else.
5316 (initWithTitle): Put () around assignment in if statement.
5317 (ns_menu_show): Remove unused variables window and keymap.
5318 (update_frame_tool_bar): Remove unused variable selected_p.
5319 (initWithContentRect): Remove unused variable this_cmd_name.
5321 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5323 (setXBMColor): Remove unused variable len.
5324 (setPixmapData): Put () around assignment in loop statement.
5326 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5327 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5329 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5330 around assignment in loop statement.
5331 (nsfont_open): Remove unused variable i.
5332 (nsfont_open): Remove unused variable len.
5333 (nsfont_draw): Remove unused variable cs.
5335 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5336 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5337 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5338 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5339 (Fns_font_name, Fns_perform_service)
5340 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5341 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5342 (ns_set_name): Remove unused variable view.
5343 (x_set_menu_bar_lines): Remove unused variable olines.
5344 (x_set_tool_bar_lines): Remove unused variable root_window.
5345 (Fns_list_colors): Put () around assignment in while statement.
5346 (Fns_perform_service): Remove unused variable len.
5347 (Fns_display_usable_bounds): Remove unused variable top.
5348 (syms_of_nsfns): Remove unused variable i.
5350 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5353 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5355 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5356 and free it with DestroyExceptionInfo (Bug#11558).
5358 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5360 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5361 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5362 Set here, not in nt/config.nt.
5364 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5366 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5367 cursor overflow into the last glyph on display line when the right
5368 fringe is off. (Bug#11832)
5370 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5372 * xdisp.c (produce_special_glyphs): Now static.
5373 * dispextern.h (produce_special_glyphs): Remove decl.
5375 2012-07-13 Glenn Morris <rgm@gnu.org>
5377 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5378 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5380 * s/usg5-4-common.h (USG, USG5):
5381 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5382 * s/sol2-6.h (SOLARIS2):
5383 * s/irix6-5.h (IRIX6_5):
5384 * s/hpux10-20.h (USG, USG5, HPUX):
5385 * s/gnu-linux.h (USG, GNU_LINUX):
5386 * s/freebsd.h (BSD_SYSTEM):
5387 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5388 * s/cygwin.h (CYGWIN):
5389 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5390 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5392 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5394 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5396 2012-07-13 Glenn Morris <rgm@gnu.org>
5398 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5400 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5402 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5403 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5405 2012-07-12 Glenn Morris <rgm@gnu.org>
5407 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5409 * process.c (init_process_emacs): Rename from init_process.
5410 The old name is also the name of a Mach system call.
5411 * lisp.h, emacs.c: Update for this name change.
5412 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5415 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5417 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5418 memmove call that removes glyphs covered by the left truncation
5419 glyph. Improve commentary.
5420 (display_line): Fix display of continuation glyphs on GUI frames
5421 when the right fringe is turned off and variable-size fonts are
5422 used in the window. Move the code that appends a stretch glyph to
5423 produce_special_glyphs, so that it could be used for truncation
5424 and continuation glyphs alike.
5425 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5426 glyph of a suitably computed width, to align the special glyphs at
5427 the window margin. Code moved from display_line. (Bug#11832)
5429 2012-07-12 Glenn Morris <rgm@gnu.org>
5431 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5433 * s/gnu-linux.h, s/hpux10-20.h:
5434 Do not unconditionally define HAVE_XRMSETDATABASE.
5436 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5438 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5440 Fix typos that broke OS X build.
5441 Reported by Randal L. Schwartz in
5442 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5443 * nsterm.m (ns_timeout): Add missing local decl.
5444 (ns_get_color): snprintf -> sprintf, to fix typo.
5446 2012-07-12 Glenn Morris <rgm@gnu.org>
5448 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5449 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5450 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5451 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5453 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5454 Move PTY_OPEN to configure.
5456 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5457 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5458 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5460 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5462 Use empty_unibyte_string where applicable.
5463 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5464 * lread.c (read1): Likewise.
5465 * xsettings.c (syms_of_xsettings): Likewise.
5467 2012-07-12 Glenn Morris <rgm@gnu.org>
5469 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5470 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5471 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5472 * s/hpux10-20.h (RUN_TIME_REMAP):
5473 * s/bsd-common.h (TABDLY): Move to configure.
5475 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5477 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5479 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5480 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5482 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5484 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5485 * s/template.h: Move NARROWPROTO to configure.
5487 2012-07-11 Glenn Morris <rgm@gnu.org>
5489 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5490 unused since 2011-01-17 change to systty.h.
5492 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5493 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5494 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5496 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5498 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5500 2012-07-11 Glenn Morris <rgm@gnu.org>
5502 * s/darwin.h, s/gnu-linux.h, s/template.h:
5503 Move INTERRUPT_INPUT to configure.
5505 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5507 Minor adjustments to interning code.
5508 * lisp.h (intern, intern_c_string): Redefine as static inline
5509 wrappers for intern_1 and intern_c_string_1, respectively.
5510 (intern_1, intern_c_string_1): Rename prototypes.
5511 * lread.c (intern_1, intern_c_string_1, oblookup):
5512 Simplify Vobarray checking.
5513 * font.c (font_intern_prop): Likewise. Adjust comment.
5514 * w32font.c (intern_font_name): Likewise.
5516 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5518 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5520 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5521 of Fcar/Fcdr if possible.
5522 * font.c (check_otf_features): Likewise.
5523 * fontset.c (Fnew_fontset): Likewise.
5524 * gnutls.c (Fgnutls_boot): Likewise.
5525 * minibuf.c (read_minibuf): Likewise.
5526 * msdos.c (IT_set_frame_parameters): Likewise.
5527 * xmenu.c (Fx_popup_dialog): Likewise.
5528 * w32menu.c (Fx_popup_dialog): Likewise.
5530 2012-07-11 Glenn Morris <rgm@gnu.org>
5532 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5533 since nothing has defined it on these platforms.
5535 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5536 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5538 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5539 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5540 Move CLASH_DETECTION to configure.
5542 * s/gnu.h: Remove file, which is now empty.
5544 * s/gnu.h, s/gnu-linux.h:
5545 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5547 2012-07-11 John Wiegley <johnw@newartisans.com>
5549 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5550 function attribute, so we only use it if it exists in the
5553 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5555 Avoid call to strlen in fast_c_string_match_ignore_case.
5556 * search.c (fast_c_string_match_ignore_case): Change to use
5557 length argument. Adjust users accordingly.
5558 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5560 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5562 Assume mkdir, rmdir.
5563 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5564 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5567 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5570 * s/hpux10-20.h (HAVE_PERROR): Remove.
5571 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5572 Remove dummy definition, as this problem was obsolete long ago.
5575 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5577 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5579 Avoid calls to strlen in font processing functions.
5580 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5581 (font_open_by_name): Change to use length argument.
5582 Adjust users accordingly.
5583 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5585 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5586 Change to return ptrdiff_t.
5587 (xfont_list_pattern, xfont_match): Use length returned by
5588 xfont_decode_coding_xlfd.
5589 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5591 2012-07-11 Glenn Morris <rgm@gnu.org>
5593 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5594 Move DONT_REOPEN_PTY to configure.
5596 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5597 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5599 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5601 Remove "#define unix" that is no longer needed (Bug#11905).
5602 * s/aix4-2.h (unix): Remove; no longer needed.
5604 EMACS_TIME simplification (Bug#11875).
5605 This replaces macros (which typically do not work in GDB)
5606 with functions, typedefs and enums, making the code easier to debug.
5607 The functional style also makes code easier to read and maintain.
5608 * systime.h: Include <sys/time.h> on all hosts, not just if
5609 WINDOWSNT, since 'struct timeval' is needed in general.
5610 (EMACS_TIME): Now a typedef, not a macro.
5611 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5613 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5614 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5615 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5616 (EMACS_TIME_LE): Now functions, not macros.
5617 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5618 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5619 which are not functions. All uses rewritten to use:
5620 (make_emacs_time): New function.
5621 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5622 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5623 not functions. All uses rewritten to use the following, respectively:
5624 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5625 (add_emacs_time, sub_emacs_time): New functions.
5626 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5627 * fileio.c (Fcopy_file):
5628 * xterm.c (XTflash): Get the current time closer to when it's used.
5629 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5631 * bytecode.c (targets): Suppress -Woverride-init warnings.
5633 Simplify by avoiding confusing use of strncpy etc.
5634 * doc.c (Fsnarf_documentation):
5635 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5636 * frame.c (Fmake_terminal_frame):
5637 * gtkutil.c (get_utf8_string):
5639 * nsmenu.m (ns_update_menubar):
5640 * regex.c (regerror):
5641 Prefer memcpy to strncpy and strncat when either will do.
5642 * fileio.c (Fsubstitute_in_file_name):
5643 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5644 (menu_separator_name_p):
5645 * nsmenu.m (ns_update_menubar):
5646 Prefer memcmp to strncmp when either will do.
5647 * nsterm.m: Include <ftoastr.h>.
5649 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5650 Prefer snprintf to strncpy.
5651 * nsterm.m (ns_term_init):
5652 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5653 * nsterm.m (ns_term_init):
5654 Avoid the need for strncpy, by using build_string or
5655 make_unibyte_string directly. Use dtoastr, not snprintf.
5656 * process.c (Fmake_network_process): Diagnose service names that
5657 are too long, rather than silently truncating them or creating
5658 non-null-terminated names.
5659 (Fnetwork_interface_info): Likewise, for interface names.
5660 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5661 Prefer sprintf to strncat.
5662 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5663 Prefer vsnprintf to vsprintf + strncpy.
5665 2012-07-10 Glenn Morris <rgm@gnu.org>
5667 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5668 Clarify fallback case.
5670 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5672 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5673 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5674 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5675 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5676 where argument type is known to be a Lisp_Cons.
5678 2012-07-10 Tom Tromey <tromey@redhat.com>
5680 * bytecode.c (BYTE_CODE_THREADED): New macro.
5681 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5682 (enum byte_code_op): New type.
5683 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5684 (exec_byte_code): Use them. Use token threading when applicable.
5686 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5688 Optimize pure C strings initialization.
5689 * lisp.h (make_pure_string): Fix prototype.
5690 (build_pure_c_string): New function, defined as static inline. This
5691 provides a better opportunity to optimize away calls to strlen when
5692 the function is called with compile-time constant argument.
5693 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5694 argument, adjust users accordingly. Use build_pure_c_string where
5696 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5697 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5698 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5700 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5702 Avoid calls to strlen in miscellaneous functions.
5703 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5704 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5705 * lread.c (openp): Likewise.
5707 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5709 Avoid calls to strlen in path processing functions.
5710 * fileio.c (file_name_as_directory): Add comment. Change to add
5711 srclen argument and return the length of result. Adjust users
5713 (directory_file_name): Fix comment. Change to add srclen argument,
5714 swap 1st and 2nd arguments to obey the common convention.
5715 Adjust users accordingly.
5716 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5718 2012-07-10 Glenn Morris <rgm@gnu.org>
5720 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5721 Move PENDING_OUTPUT_COUNT definition to configure.
5723 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5724 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5725 * s/gnu.h (DATA_START): Move definitions to configure.
5727 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5728 We include usg5-4-common.h, which defines them both.
5730 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5731 O_RDONLY already includes it).
5733 Stop ns builds setting the EMACSLOADPATH environment variable.
5734 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5735 Now it does not set EMACSLOADPATH, just returns the load-path string.
5736 * nsterm.h: Update accordingly.
5737 * lread.c [HAVE_NS]: Include nsterm.h.
5738 (init_lread) [HAVE_NS]: Use ns_load_path.
5739 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5741 2012-07-09 Glenn Morris <rgm@gnu.org>
5743 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5744 since the included bsd-common.h does so.
5746 Stop ns builds setting the EMACSPATH environment variable.
5747 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5748 (ns_init_paths): Do not set EMACSPATH.
5749 * nsterm.h (ns_exec_path): Add it.
5750 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5753 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5755 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5757 * process.c (wait_reading_process_output): 'waitchannels' was unset
5758 when read_kbd || !NILP (wait_for_cell); fix this.
5760 Add GCC-style 'const' attribute to functions that can use it.
5761 * character.h (char_resolve_modifier_mask):
5762 * keyboard.h (make_ctrl_char):
5763 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5764 (init_character_once, next_almost_prime, init_fns, init_image)
5765 (flush_pending_output, init_sound):
5766 * mem-limits.h (start_of_data):
5767 * menu.h (finish_menu_items):
5768 Add ATTRIBUTE_CONST.
5769 * emacs.c (DEFINE_DUMMY_FUNCTION):
5770 Declare the dummy function with ATTRIBUTE_CONST.
5771 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5772 Add decls with ATTRIBUTE_CONST.
5774 Minor improvements to make_formatted_string.
5775 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5776 where int is good enough, as vsprintf returns an int.
5777 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5779 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5781 Use make_formatted_string to avoid double length calculation.
5782 * lisp.h (make_formatted_string): New prototype.
5783 * alloc.c (make_formatted_string): New function.
5784 * buffer.c (Fgenerate_new_buffer_name): Use it.
5785 * dbus.c (syms_of_dbusbind): Likewise.
5786 * editfns.c (Fcurrent_time_zone): Likewise.
5787 * filelock.c (get_boot_time): Likewise.
5788 * frame.c (make_terminal_frame, set_term_frame_name)
5789 (x_report_frame_params): Likewise.
5790 * image.c (gs_load): Likewise.
5791 * minibuf.c (get_minibuffer): Likewise.
5792 * msdos.c (dos_set_window_size): Likewise.
5793 * process.c (make_process): Likewise.
5794 * xdisp.c (ensure_echo_area_buffers): Likewise.
5795 * xsettings.c (apply_xft_settings): Likewise.
5797 2012-07-09 Glenn Morris <rgm@gnu.org>
5799 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5800 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5801 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5802 * nsterm.h (ns_etc_directory): Add it.
5803 * callproc.c [HAVE_NS]: Include nsterm.h.
5804 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5806 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5808 Move marker debugging code under MARKER_DEBUG.
5809 * marker.c (MARKER_DEBUG): Move marker debugging code under
5810 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5811 for bootstrap with --enable-checking (~3x slowdown reported
5812 by Juanma Barranquero <lekktu@gmail.com>).
5813 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5815 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5817 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5818 See <http://bugs.gnu.org/11825#29>.
5820 2012-07-08 Eli Zaretskii <eliz@gnu.org>
5822 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5823 has no font, use the frame's font. (Bug#11813)
5824 (display_line): Add commentary about displaying truncation glyphs
5826 (produce_special_glyphs): Move here from term.c.
5828 * term.c (produce_special_glyphs): Move to xdisp.c.
5830 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5833 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5835 * xdisp.c (display_line): Avoid warning about implicit declaration
5838 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5840 * lisp.h: Remove empty conditional.
5842 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5844 * lread.c (load_path_check): Now static.
5846 Fix some minor --with-ns problems found by static checking.
5847 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5848 (x_set_font) [!HAVE_X_WINDOWS]:
5849 * image.c (xpm_load_image) [HAVE_NS]:
5850 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5851 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5852 Remove unused local.
5853 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5854 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5855 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5856 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5857 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5858 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5859 Fix pointer signedness problem.
5860 * xfaces.c (FRAME_X_FONT_TABLE):
5861 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5863 2012-07-07 Glenn Morris <rgm@gnu.org>
5865 * lread.c (load_path_check): New function, split from init_lread.
5866 (init_lread): Reorganize. Motivation:
5867 If EMACSLOADPATH is set, check/warn about that rather than the
5868 defaults, which we are not going to use. Hence we can remove
5869 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5870 Don't warn if site-lisp directories are missing.
5871 If not installed, start from a blank load-path, since
5872 PATH_LOADSEARCH refers to the eventual installation directories.
5874 2012-07-07 Eli Zaretskii <eliz@gnu.org>
5876 Support truncation and continuation glyphs on GUI frames, when
5877 fringes are disabled. (Bug#11832)
5878 * xdisp.c (init_iterator): Get dimensions of truncation and
5879 continuation glyphs even if on GUI frames.
5880 Adjust it->last_visible_x on GUI frames when the left or right fringes,
5881 or both, are absent.
5882 (start_display, move_it_in_display_line_to): Handle the case of a
5883 GUI frame without a fringe to display continuation or truncation
5885 (insert_left_trunc_glyphs): Support GUI frames: make sure
5886 truncation glyphs overwrite enough glyphs from the current line to
5887 have sufficient space in pixels.
5888 (display_line): Support truncation and continuation glyphs on GUI
5889 frames. If some spare pixels are left on the line after inserting
5890 the truncation glyphs, fill that space with a stretch glyph of a
5891 suitably computed width.
5893 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5894 produce_glyphs, to support GUI sessions.
5896 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5898 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5900 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5902 Do not require float-time's arg to fit in time_t (Bug#11825).
5903 This works better on hosts where time_t is unsigned, and where
5904 float-time is applied to the (negative) difference between two times.
5905 * editfns.c (decode_time_components): Last arg is now double *,
5906 not int *, and means to store all the result as a double, without
5907 worrying about whether the seconds part fits in time_t.
5908 All callers changed.
5909 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5910 All callers changed.
5911 (Ffloat_time): Do not fail merely because the specified time falls
5912 outside of time_t range.
5914 2012-07-07 Glenn Morris <rgm@gnu.org>
5916 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5917 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5918 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5920 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
5922 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5923 Update dependencies.
5925 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5927 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5929 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5930 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5931 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5932 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5933 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5934 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5936 * xfont.c (compare_font_names): Redo to omit the need for casts.
5938 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5940 * xfns.c (Fx_change_window_property): Doc fix.
5941 * w32fns.c (Fx_change_window_property): Doc fix.
5943 * w32fns.c (Fx_window_property): Accept the same arguments as the
5944 X Windows version. Doc fix.
5945 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5947 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5948 Eli Zaretskii <eliz@gnu.org>
5950 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5951 Windows-specific code from nt/config.nt moved here.
5952 Obsolete settings removed.
5954 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5956 * process.c: Avoid unnecessary calls to gettime.
5957 (wait_reading_process_output): Don't get the time of day
5958 when gobbling data immediately and not waiting, as there's no need
5959 for it in that case. This removes a FIXME.
5961 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5963 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5964 is defined (Bug#11768).
5966 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5968 Fix marker debugging code.
5969 * marker.c (byte_char_debug_check): Do not perform the check
5970 if buffer is not multibyte.
5971 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5972 Call byte_char_debug_check with correct arguments.
5974 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5976 Compile marker debugging code only if ENABLE_CHECKING is defined.
5977 * marker.c (byte_char_debug_check, count_markers):
5978 Use only if ENABLE_CHECKING is defined.
5979 (byte_debug_flag): Remove.
5980 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5981 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5983 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5985 Avoid code repetition in marker-related functions.
5986 * marker.c (attach_marker): New function.
5987 (Fset_marker, set_marker_restricted, set_marker_both)
5988 (set_marker_restricted_both): Use it.
5989 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5990 Consistently rename charno to charpos.
5991 (marker_position): Add eassert.
5992 (marker_byte_position): Convert to eassert.
5994 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5996 Simplify list operations in unchain_overlay and unchain_marker.
5997 * buffer.c (unchain_overlay): Simplify. Add comment.
5998 * marker.c (unchain_marker): Simplify. Fix comments.
6000 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6002 Introduce fast path for the widely used marker operation.
6003 * alloc.c (build_marker): New function.
6004 * lisp.h (build_marker): New prototype.
6005 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6006 * composite.c (autocmp_chars): Likewise.
6007 * editfns.c (buildmark): Remove.
6008 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6009 (save_restriction_save): Use build_marker.
6010 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6011 * window.c (save_window_save): Likewise.
6013 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6015 Do not use Fdelete_overlay in delete_all_overlays
6016 to avoid redundant calls to unchain_overlay.
6017 * buffer.c (drop_overlay): New function.
6018 (delete_all_overlays, Fdelete_overlay): Use it.
6019 * minibuf.c (get_minibuffer): Fix comment.
6021 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6023 Port to OpenBSD 5.1 amd64.
6024 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6025 This is needed for OpenBSD, and should be harmless on all BSD systems.
6026 Also, include <sys/sysctl.h>, as it should be available on all
6027 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6028 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6029 use p_pid member, not kp_proc.pid.
6031 2012-07-06 Glenn Morris <rgm@gnu.org>
6033 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6035 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6037 More xmalloc and related cleanup.
6038 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6039 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6040 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6041 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6042 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6043 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6044 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6045 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6046 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6048 Omit needless casts involving void * pointers and allocation.
6049 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6050 as the former is more robust if P's type is changed.
6051 Prefer xzalloc to xmalloc + memset 0.
6052 Simplify malloc-or-realloc to realloc.
6053 Don't worry about xmalloc returning a null pointer.
6054 Prefer xstrdup to xmalloc + strcpy.
6055 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6057 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6058 alloca of a constant.
6060 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6062 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6063 hscroll is larger than the line width. Fixes long and futile
6064 looping inside extend_face_to_end_of_line (on a TTY) producing
6065 glyphs that are not needed and thrown away.
6067 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6069 * marker.c (set_marker_restricted_both): Simplify by using
6072 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6074 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6076 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6078 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6079 not defined (Bug#11768).
6080 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6081 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6082 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6083 followed by gtk_box_set_homogeneous (Bug#11768).
6084 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6085 (update_theme_scrollbar_width, xg_create_scroll_bar):
6086 Use gtk_scrollbar_new (Bug#11768).
6087 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6088 (is_box_type): New function (Bug#11768).
6089 (xg_tool_item_stale_p): Call is_box_type.
6090 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6091 with default display (Bug#11768).
6093 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6095 * xdisp.c (window_hscroll_limited): New function.
6096 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6097 coordinates when window's hscroll is set to insanely large
6100 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6102 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6103 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6105 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6108 * lisp.h (xzalloc): New prototype. Omit needless casts.
6109 * alloc.c (xzalloc): New function. Omit needless casts.
6110 * charset.c: Omit needless casts. Convert all calls to
6111 xmalloc with following memset to xzalloc.
6112 * dispnew.c: Likewise.
6113 * fringe.c: Likewise.
6114 * image.c: Likewise.
6115 * sound.c: Likewise.
6117 * w32fns.c: Likewise.
6118 * w32font.c: Likewise.
6119 * w32term.c: Likewise.
6120 * xfaces.c: Likewise.
6122 * xterm.c: Likewise.
6123 * atimer.c: Omit needless casts.
6124 * buffer.c: Likewise.
6125 * callproc.c: Likewise.
6127 * coding.c: Likewise.
6128 * composite.c: Likewise.
6130 * doprnt.c: Likewise.
6131 * editfns.c: Likewise.
6132 * emacs.c: Likewise.
6134 * filelock.c: Likewise.
6136 * gtkutil.c: Likewise.
6137 * keyboard.c: Likewise.
6139 * lread.c: Likewise.
6140 * minibuf.c: Likewise.
6141 * msdos.c: Likewise.
6142 * print.c: Likewise.
6143 * process.c: Likewise.
6144 * region-cache.c: Likewise.
6145 * search.c: Likewise.
6146 * sysdep.c: Likewise.
6147 * termcap.c: Likewise.
6148 * terminal.c: Likewise.
6149 * tparam.c: Likewise.
6150 * w16select.c: Likewise.
6152 * w32reg.c: Likewise.
6153 * w32select.c: Likewise.
6154 * w32uniscribe.c: Likewise.
6155 * widget.c: Likewise.
6156 * xdisp.c: Likewise.
6157 * xmenu.c: Likewise.
6159 * xselect.c: Likewise.
6161 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6163 * fileio.c (time_error_value): Check the right error number.
6164 Problem reported by Troels Nielsen in
6165 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6167 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6169 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6170 This should be fixed in a better way; see Eli Zaretskii in
6171 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6172 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6174 * fileio.c (time_error_value): Rename from special_mtime.
6175 The old name's problems were noted by Eli Zaretskii in
6176 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6178 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6179 This variable's comment says Emacs needs at least one GDB-visible
6180 symbol of type enum pvec_type, to work around GDB problems.
6181 The symbol's value doesn't matter.
6183 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6184 that causes compilation to fail on pre-C99 compilers.
6186 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6188 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6189 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6191 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6193 * buffer.c (init_buffer_once): Fix initialization of
6194 headers for buffer_defaults and buffer_local_symbols.
6195 Reported by Juanma Barranquero <lekktu@gmail.com>.
6197 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6199 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6200 * lisp.h (enum pvec_type): Use fewer bits.
6201 (PSEUDOVECTOR_SIZE_BITS): New constant.
6202 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6203 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6204 change in pvec_type.
6205 (PSEUDOVECTOR_TYPEP): New macro.
6206 (TYPED_PSEUDOVECTORP): Use it.
6207 * fns.c (internal_equal): Adapt code to extract pvectype.
6208 * emacs.c (gdb_pvec_type): Update type.
6209 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6210 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6211 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6212 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6213 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6214 abusing vector->header.next.nbytes.
6215 (live_vector_p): Use PVEC_TYPE.
6216 (mark_object): Adapt code to extract pvectype. Use switch.
6218 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6220 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6221 Tighten new eassert a bit.
6223 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6225 Fix compilation with --enable-gcc-warnings and -O1
6227 * doprnt.c (doprnt): Change type of tem to int, initialize
6228 to avoid compiler warning. Add eassert.
6229 * search.c (simple_search): Initialize match_byte to avoid
6230 compiler warning. Add eassert.
6232 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6234 Avoid weird behavior with large horizontal scrolls.
6235 Without this change, for example, large hscroll values would
6236 mess up Emacs's display on Fedora 15 x86, presumably due to
6237 overflows in int calculations in the display code.
6238 Also, if buffers had long lines, Emacs would freeze.
6239 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6240 (set_window_hscroll): New function, containing the old guts of
6241 Fset_window_hscroll. Return the clipped value.
6242 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6243 This avoids the need to check against PTRDIFF_MAX.
6245 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6247 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6249 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6251 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6253 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6254 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6255 since GCC 4.4.6 issues a bogus warning for them.
6257 Fix bugs in file timestamp newness comparisons.
6258 * fileio.c (Ffile_newer_than_file_p):
6259 * lread.c (Fload): Use full timestamp resolution of files,
6260 not just the 1-second resolution, so that files that are only
6261 slightly newer still count as newer.
6262 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6263 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6265 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6267 * fileio.c: Improve handling of file time marker. (Bug#11852)
6268 (special_mtime): New function.
6269 (Finsert_file_contents, Fverify_visited_file_modtime):
6270 Use it to set special mtime values consistently.
6272 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6274 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6275 marker for non-existing file. (Bug#11852)
6277 2012-07-03 Glenn Morris <rgm@gnu.org>
6279 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6280 and did not make it into globals.h).
6282 2012-07-03 Tom Tromey <tromey@redhat.com>
6284 * window.c (Fset_window_margins, Fset_window_fringes)
6285 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6286 * textprop.c (Fprevious_property_change): No longer static.
6287 * syntax.c (Fsyntax_table_p): No longer static.
6288 * process.c (Fget_process, Fprocess_datagram_address): No longer
6290 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6291 * keyboard.c (Fcommand_execute): No longer static.
6293 * insdel.c (Fcombine_after_change_execute): No longer static.
6294 * image.c (Finit_image_library): No longer static.
6295 * fileio.c (Fmake_symbolic_link): No longer static.
6296 * eval.c (Ffetch_bytecode): No longer static.
6297 * editfns.c (Fuser_full_name): No longer static.
6298 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6300 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6302 * dired.c (Ffile_attributes): No longer static.
6303 * composite.c (Fcomposition_get_gstring): No longer static.
6304 * callproc.c (Fgetenv_internal): No longer static.
6306 * ccl.h: Remove EXFUNs.
6307 * buffer.h: Remove EXFUNs.
6308 * dispextern.h: Remove EXFUNs.
6309 * intervals.h: Remove EXFUNs.
6310 * fontset.h: Remove EXFUN.
6311 * font.h: Remove EXFUNs.
6312 * dosfns.c (system_process_attributes): Remove EXFUN.
6313 * keymap.h: Remove EXFUNs.
6314 * lisp.h: Remove EXFUNs.
6315 * w32term.h: Remove EXFUNs.
6316 * window.h: Remove EXFUNs.
6317 * xsettings.h: Remove EXFUN.
6318 * xterm.h: Remove EXFUN.
6320 2012-07-03 Glenn Morris <rgm@gnu.org>
6322 * lisp.h (Frandom): Make it visible to C.
6323 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6324 buffer for invisible buffers. (Bug#1229)
6326 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6328 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6329 values which aren't power of 2.
6330 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6331 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
6334 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6336 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6338 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6340 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6342 * alloc.c (allocate_vector_block): Remove redundant
6343 calls to mallopt if DOUG_LEA_MALLOC is defined.
6344 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6345 avoid calls to mallopt if zero_vector is returned.
6347 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6349 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6350 is enabled, avoid dereferencing NULL current_sblock if
6353 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6355 Cleanup basic buffer management.
6356 * buffer.h (struct buffer): Change layout to use generic vector
6357 marking code. Fix some comments. Change type of 'clip_changed'
6358 to bitfield. Remove unused #ifndef old.
6359 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6360 (GET_OVERLAYS_AT): Fix indentation.
6361 (for_each_per_buffer_object_at): New macro.
6362 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6363 (Fbuffer_local_variables): Use it.
6364 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6365 * alloc.c (allocate_buffer): Adjust to match new layout of
6366 struct buffer. Fix comment.
6367 (mark_overlay): New function.
6368 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6369 Lisp area of struct buffer.
6370 (mark_object): Use it. Adjust marking of misc objects
6371 and related comments.
6373 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6375 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6376 wrapper that is not needed because the wrapped code is a no-op (zero
6377 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6378 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6380 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6382 * alloc.c (mark_buffer): Simplify. Remove prototype.
6383 (mark_object): Add comment. Reorganize marking of vector-like
6384 objects. Use CHECK_LIVE for all vector-like objects except buffers
6385 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6386 Avoid redundant calls to mark_vectorlike for bool vectors.
6388 2012-06-30 Glenn Morris <rgm@gnu.org>
6390 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6392 * epaths.in (PATH_SITELOADSEARCH): New.
6393 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6394 This is rather than relying on --enable-locallisppath elements
6395 having "site-lisp" in their names. (Bug#10208#25, 11658)
6397 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6399 * w32proc.c (sys_select): Accept and ignore one more argument.
6401 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6403 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6404 (pselect) [!MS_DOS]: Redirect to sys_select.
6406 * sysdep.c: Don't include dos.h and dosfns.h.
6408 * process.c (sys_select):
6409 * msdos.c (sys_select): Accept one more argument and ignore it.
6411 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6412 adapt data types and code to that.
6415 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6416 which clashes with the gnulib function of the same name.
6418 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6420 * font.c (font_style_to_value, font_style_symbolic)
6421 (font_prop_validate_style): Add type checks for values in
6424 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6426 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6429 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6431 * xdisp.c (try_window_id): Undo last change.
6433 * w32.c (getwd): Adjust commentary about startup_dir.
6434 (init_environment): Always call sys_access, even in non-MSVC
6435 builds. Don't chdir to the directory of the Emacs executable.
6436 This undoes code from 1997 which was justified by the need to
6437 "avoid conflicts when removing and renaming directories". But its
6438 downside was that every relative file name was being interpreted
6439 relative to the directory of the Emacs executable, which can never
6440 be TRT. In particular, it broke sys_access when called with
6441 relative file names.
6442 (sys_access): Map GetLastError to errno.
6444 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6446 * window.h (struct window): Change type of 'fringes_outside_margins'
6447 to bitfield. Fix comment. Adjust users accordingly.
6448 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6450 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6453 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6455 * gnutls.c (emacs_gnutls_handshake):
6456 Add QUIT to make the loop interruptible.
6458 2012-06-29 Glenn Morris <rgm@gnu.org>
6460 * charset.c (init_charset): Make lack of etc/charsets fatal.
6462 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6464 * editfns.c (region_limit): Fix type mismatch.
6466 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6468 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6469 undefined. Convert from xassert to eassert.
6470 * nsmenu.m: Convert from xassert to eassert.
6471 * nsterm.m: Likewise.
6473 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6475 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6477 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6479 Avoid integer overflow on scroll-left and scroll-right.
6480 * window.c (HSCROLL_MAX): New macro.
6481 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6482 overflow when requested scroll falls outside ptrdiff_t range.
6484 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6486 * window.h (struct window): Change type of 'hscroll',
6487 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6488 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6489 Adjust users accordingly.
6490 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6491 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6492 from EMACS_INT to ptrdiff_t.
6493 (make_window): Omit redundant initialization.
6495 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
6497 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6499 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6501 * window.h (struct window): Change type of 'use_time' and
6502 'sequence_number' from Lisp_Object to int.
6503 * frame.c (make_frame): Adjust users accordingly.
6504 * print.c (print_object): Likewise.
6505 * window.c (select_window, Fwindow_use_time, make_parent_window)
6506 (make_window): Likewise.
6508 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6510 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6511 enabled with --enable-checking=[all,glyphs] configure option.
6512 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6513 adjust comments accordingly.
6514 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6515 undefined, adjust comments accordingly.
6516 * image.c: Likewise.
6517 * scroll.c: Likewise.
6518 * w32fns.c: Likewise.
6519 * w32term.c: Likewise.
6520 * xdisp.c: Likewise.
6521 * xfaces.c: Likewise.
6523 * xterm.c: Likewise.
6525 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6527 Generalize run-time debugging checks.
6528 * dispextern.h (XASSERTS): Remove.
6529 * fontset.c (xassert): Remove.
6530 Convert from xassert to eassert.
6531 * alloc.c: Convert from xassert to eassert.
6533 * dispnew.c: Likewise.
6535 * fringe.c: Likewise.
6536 * ftfont.c: Likewise.
6537 * gtkutil.c: Likewise.
6538 * image.c: Likewise.
6539 * keyboard.c: Likewise.
6541 * process.c: Likewise.
6542 * scroll.c: Likewise.
6543 * sound.c: Likewise.
6545 * w32console.c: Likewise.
6546 * w32fns.c: Likewise.
6547 * w32term.c: Likewise.
6548 * window.c: Likewise.
6549 * xdisp.c: Likewise.
6550 * xfaces.c: Likewise.
6552 * xselect.c: Likewise.
6553 * xterm.c: Likewise.
6555 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6557 * fns.c (maybe_resize_hash_table): Output message when growing the
6560 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6562 * alloc.c (allocate_string_data): Remove dead code.
6563 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6564 avoid GCC warning about unused macro.
6566 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6568 * alloc.c (allocate_string): Omit intervals initialization.
6569 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6570 as in make_pure_string and make_pure_c_string.
6572 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6574 * alloc.c (allocate_string): Fix last change.
6576 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6578 * alloc.c (allocate_string): Remove two redundant calls
6579 to memset, add explicit initialization where appropriate.
6581 2012-06-27 Glenn Morris <rgm@gnu.org>
6583 * lisp.mk (lisp): Remove paths.elc.
6585 2012-06-27 Chong Yidong <cyd@gnu.org>
6587 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6589 2012-06-26 John Wiegley <johnw@newartisans.com>
6591 * unexmacosx.c (copy_data_segment): Add two section names used
6592 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6594 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6595 when building with Clang.
6597 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6599 * eval.c (Fapply): Allow calling it with a single argument.
6601 2012-06-26 Eli Zaretskii <eliz@gnu.org>
6603 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6604 _stricmp and _strnicmp.
6605 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6607 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6609 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6611 (allocate_process): Likewise for new process.
6612 (allocate_terminal): Change to use offsetof.
6613 (allocate_frame): Likewise.
6614 * frame.c (make_frame): Omit redundant initialization.
6615 * window.c (make_parent_window): Use memset.
6616 (make_window): Omit redundant initialization.
6617 * process.c (make_process): Omit redundant initialization.
6618 * terminal.c (create_terminal): Likewise.
6620 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6622 * term.c (delete_tty): Remove redundant call to memset.
6624 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6626 * alloc.c: Remove build_string.
6627 * lisp.h: Define build_string as static inline. This provides
6628 a better opportunity to optimize away calls to strlen when the
6629 function is called with compile-time constant argument.
6630 * image.c (imagemagick_error): Convert to build_string.
6631 * w32proc.c (sys_spawnve): Likewise.
6632 * xterm.c (x_term_init): Likewise.
6634 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6636 Use sprintf return value instead of invoking strlen on result.
6637 In the old days this wasn't portable, since some sprintf
6638 implementations returned char *. But they died out years ago and
6639 Emacs already assumes sprintf returns int.
6640 Similarly for float_to_string.
6641 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6642 * ccl.c (ccl_driver):
6643 * character.c (string_escape_byte8):
6644 * data.c (Fnumber_to_string):
6645 * doprnt.c (doprnt):
6646 * print.c (print_object):
6647 * xdisp.c (message_dolog):
6648 * xfns.c (syms_of_xfns):
6649 Use sprintf or float_to_string result to avoid need to call strlen.
6650 * data.c (Fnumber_to_string):
6651 Use make_unibyte_string, since the string must be ASCII.
6652 * lisp.h, print.c (float_to_string): Now returns int length.
6653 * term.c (produce_glyphless_glyph):
6654 Use sprintf result rather than recomputing it.
6656 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6657 * Makefile.in (ALL_CFLAGS):
6658 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6659 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6661 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6663 * dispextern.h (xstrcasecmp): Define to library function
6664 strcasecmp if available.
6665 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6667 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6669 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6670 Avoid comma operator.
6671 * menu.c (push_submenu_start, push_submenu_end)
6672 (push_left_right_boundary, push_menu_pane): Likewise.
6673 * msdos.c (dos_rawgetc): Likewise.
6675 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6677 * xfns.c (xic_create_fontsetname): Remove redundant calls
6680 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6682 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6683 sprintf already null-terminates its output.
6685 * xfns.c (x_window): Remove redundant cast.
6687 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6689 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6690 `const char *' to `char *' to avoid compiler warning.
6692 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6694 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6695 instead of truncating it to 63 (admittedly a generous limit).
6697 * process.c: Fix spelling and caps in comments.
6699 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6701 * emacs.c (setpgrp): Remove definition, unused.
6702 * sysdep.c (setpgrp): Remove definition, not used in this file.
6704 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
6706 * makefile.w32-in: Update dependencies.
6708 2012-06-24 Eli Zaretskii <eliz@gnu.org>
6710 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6711 (SYSTIME_H): Add nt/inc/sys/time.h.
6713 * systime.h [WINDOWSNT]: Include sys/time.h.
6715 * s/ms-w32.h (struct timespec): Definition moved from
6716 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6718 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6720 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6721 * buffer.h (buffer_slot_type_mismatch):
6722 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6723 * eval.c (unwind_to_catch):
6724 * image.c (my_png_error, my_error_exit):
6725 * keyboard.c (quit_throw_to_read_char, user_error)
6726 (Fexit_recursive_edit, Fabort_recursive_edit):
6727 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6728 (wrong_type_argument, buffer_overflow, __executable_start)
6729 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6730 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6731 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6733 (child_setup) [!DOS_NT]:
6734 * lread.c (end_of_file_error, invalid_syntax):
6735 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6736 * puresize.h (pure_write_error):
6737 * search.c (matcher_overflow):
6738 * sound.c (sound_perror, alsa_sound_perror):
6739 * sysdep.c, syssignal.h (croak):
6740 * term.c (maybe_fatal, vfatal):
6741 * textprop.c (text_read_only):
6742 * undo.c (user_error):
6743 * unexmacosx.c (unexec_error):
6744 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6745 Use _Noreturn rather than NO_RETURN.
6746 No need for separate decl merely because of _Noreturn.
6747 * sound.c (sound_warning, parse_sound):
6748 Remove unnecessary forward decls.
6750 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6752 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6753 * lisp.h (WAIT_READING_MAX): New macro.
6754 * dispnew.c (Fsleep_for, sit_for):
6755 * keyboard.c (kbd_buffer_get_event):
6756 * process.c (Faccept_process_output):
6757 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6758 This improves on the previous patch, which introduced a bug
6759 when time_t is unsigned and as wide as intmax_t.
6760 See <http://bugs.gnu.org/9000#51>.
6762 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6764 * dispnew.c (sit_for, Fsleep_for):
6765 * keyboard.c (kbd_buffer_get_event):
6766 * process.c (Faccept_process_output): Avoid compiler warnings when
6767 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6769 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
6771 * makefile.w32-in: Update dependencies.
6773 * w32.c (ltime): Add return type and declare static.
6774 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6776 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6778 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6779 Privately reported by Herbert J. Skuhra.
6780 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6782 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6783 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6785 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6787 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6788 last argument of make_unibyte_string.
6790 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6791 language ID in the event parameters.
6793 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6794 event.code, not the obscure "character set ID".
6796 2012-06-23 Chong Yidong <cyd@gnu.org>
6798 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6800 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6802 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6803 * w32.c (fdutimens): New function.
6805 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6807 * s/ms-w32.h (pselect): Redirect to sys_select.
6809 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6811 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6812 in the logic of incrementing and decrementing the value of
6813 use_relocatable_buffers.
6815 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6817 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6818 Privately reported by Herbert J. Skuhra.
6819 [__FreeBSD__]: Remove "*/" typo after "#include".
6820 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6821 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6822 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6823 Don't assume EMACS_TIME and struct timeval are the same type.
6825 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6827 Support higher-resolution time stamps (Bug#9000).
6828 The time stamps are only nanosecond-resolution at the C level,
6829 since that's the best that any real-world system supports now.
6830 But they are picosecond-resolution at the Lisp level, as that's
6831 easy, and leaves room for future OS improvements.
6833 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6836 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6837 Don't get current time unless it's needed.
6839 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6840 now provides it if it's absent.
6841 (start_atimer): Port to higher-res time stamps.
6842 Check for time stamp overflow. Don't get current time more
6843 often than is needed.
6845 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6846 Include systime.h, not time.h.
6847 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6849 * dired.c: Include stat-time.h.
6850 (Ffile-attributes): File times now have higher resolution.
6852 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6853 (struct image): Timestamp now has higher resolution.
6855 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6856 has at least microseconds now. All uses removed.
6857 (update_frame, update_single_window, update_window, update_frame_1)
6858 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
6859 (duration_to_sec_usec): Remove; no longer needed.
6861 * editfns.c (time_overflow): Now extern.
6862 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6863 (float-time, Fformat_time_string, Fcurrent_time_string)
6864 (Fcurrent_time_zone): Accept and generate higher-resolution
6866 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6867 (decode_time_components, lisp_seconds_argument): New functions.
6868 (make_time): Now static.
6869 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6870 Report an error if the time is invalid, rather than having the caller
6873 * fileio.c: Include <stat-time.h>
6874 (Fcopy_file): Copy higher-resolution time stamps.
6875 Prefer to set the time stamp via a file descriptor if that works.
6876 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6877 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6878 (Fvisited_file_modtime, Fset_visited_file_modtime):
6879 Support higher-resolution time stamps.
6881 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6883 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6885 * image.c (prepare_image_for_display, clear_image_cache)
6886 (lookup_image): Port to higer-resolution time stamps.
6888 * keyboard.c (start_polling, bind_polling_period):
6889 Check for time stamp overflow.
6890 (read_char, kbd_buffer_get_event, timer_start_idle)
6891 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6892 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6893 Port to higher-resolution time stamps. Do not assume time_t is signed.
6894 (decode_timer): New function. Timers are now vectors of length 9,
6895 not 8, to accommodate the picosecond component.
6896 (timer_check_2): Use it.
6898 * nsterm.m (select_timeout, timeval_subtract): Remove.
6899 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6900 as they're a bit more accurate and handle overflow better.
6901 (ns_select): Change prototype to be compatible with pselect.
6902 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6903 * nsterm.h (ns_select): Adjust prototype.
6905 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6906 us-resolution time stamps.
6907 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6909 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6911 * lisp.h (time_overflow): New decl.
6912 (wait_reading_process_output): First arg is now intmax_t, not int,
6913 to accommodate larger waits.
6915 * process.h (struct Lisp_Process.read_output_delay):
6916 Now counts nanoseconds, not microseconds.
6917 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6919 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6920 (wait_reading_process_output):
6921 Port to ns-resolution time stamps.
6922 (Faccept_process_output, wait_reading_process_output):
6923 Check for time stamp overflow. Do not assume time_t is signed.
6924 (select_wrapper): Remove; we now use pselect.
6925 (Fprocess_attributes): Now generates ns-resolution time stamps.
6927 * sysdep.c: Include utimens.h. Don't include utime.h
6928 or worry about struct utimbuf; gnulib does that for us now.
6929 (gettimeofday): Remove; gnulib provides a substitute.
6930 (make_timeval): New function.
6931 (set_file_times): Now sets ns-resolution time stamps.
6932 New arg FD; all uses changed.
6933 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6934 (system_process_attributes):
6935 Now returns ns-resolution time stamp. All uses changed.
6936 Check for time stamp overflow.
6938 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6939 provides a substitute now.
6941 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6942 since it guarantees struct timespec.
6943 (EMACS_TIME): Now struct timespec, so that we can support
6944 ns-resolution time stamps.
6945 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6946 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6947 (EMACS_USECS): Remove.
6948 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6949 so multiply the arg by 1000 before storing it.
6950 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6952 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6953 Port to ns-resolution time stamps.
6954 (EMACS_TIME_NEG_P): Remove; replaced by....
6955 (EMACS_TIME_SIGN): New macro.
6956 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6957 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6958 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6959 (make_timeval, make_lisp_time, decode_time_components): New decls.
6960 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6961 that it mishandled time_t overflow. You can't compare by subtracting!
6962 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6963 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6965 * term.c: Include <sys/time.h>.
6966 (timeval_to_Time): New function, for proper overflow wraparound.
6967 (term_mouse_position, term_mouse_click): Use it.
6969 * undo.c (record_first_change): Support higher-resolution time stamps
6971 (Fprimitive_undo): Use them when restoring time stamps.
6973 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6974 (w32_get_internal_run_time):
6975 Port to higher-resolution Emacs time stamps.
6976 (ltime): Now accepts single 64-bit integer, as that's more convenient
6979 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6981 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6982 for compatibility with pselect. Support ns-resolution time stamps.
6984 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6986 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6987 Check for time stamp overflow, and support ns-resolution time stamps.
6989 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6990 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6991 (timeval_subtract): Remove; no longer needed.
6992 (XTflash, XTring_bell, x_wait_for_event):
6993 Port to ns-resolution time stamps. Don't assume time_t is signed.
6995 2012-06-22 Chong Yidong <cyd@gnu.org>
6997 * xdisp.c (x_consider_frame_title): Revert last change.
6999 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7001 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7002 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7003 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7004 staticidx goes up to 1597 out of 1600 = 0x640.)
7006 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7008 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7009 Otherwise, the umask might be mistakenly 0 while handling input signals.
7011 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7013 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7015 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7017 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7018 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7019 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7020 access to `contents' member of Lisp_Vector objects with AREF and ASET
7023 2012-06-19 Chong Yidong <cyd@gnu.org>
7025 * frame.c (delete_frame): When selecting a frame on a different
7026 text terminal, do not alter the terminal's top-frame.
7028 * xdisp.c (format_mode_line_unwind_data): Record the target
7029 frame's selected window and its terminal's top-frame.
7030 (unwind_format_mode_line): Restore them.
7031 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7033 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7034 since tty frames can be explicitly named.
7035 (prepare_menu_bars): Likewise.
7037 * term.c (Ftty_top_frame): New function.
7039 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7041 Port byte-code-meter to modern targets.
7042 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7043 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7044 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7045 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7046 (METER_1, METER_2): Simplify.
7048 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7050 * data.c (Fdefalias): Return `symbol' (bug#11686).
7052 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7054 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7055 gets killed during executing of this function (Bug#11665).
7056 Try to always return Qt when the buffer has been actually killed.
7057 (Vkill_buffer_query_functions): In doc-string say that functions
7058 run by this hook should not change the current buffer.
7060 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7062 Fix recently-introduced process.c problems found by static checking.
7063 * process.c (write_queue_push, write_queue_pop, send_process):
7064 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7065 (write_queue_pop): Fix pointer signedness problem.
7066 (send_process): Remove unused local.
7068 2012-06-17 Chong Yidong <cyd@gnu.org>
7070 * xdisp.c (redisplay_internal): No need to redisplay terminal
7071 frames that are not on top.
7073 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7075 * process.c (make_process): Initialize write_queue.
7076 (write_queue_push, write_queue_pop): New functions.
7077 (send_process): Use them to maintain correct ordering of process
7080 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7082 * lisp.h (eassert): Assume C89 or later.
7083 This removes the need for CHECK.
7084 (CHECK): Remove. Its comments about always evaluating its
7085 argument were confusing, as 'eassert' typically does not evaluate
7088 * coding.c (produce_chars): Use ptrdiff_t, not int.
7090 * xterm.c (x_draw_underwave): Check for integer overflow.
7091 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7093 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7095 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7096 referenced (Bug#11583).
7098 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7100 Implement wave-style variant of underlining.
7101 * dispextern.h (face_underline_type): New enum.
7102 (face): Add field for underline type.
7103 * nsterm.m (ns_draw_underwave): New function.
7104 (ns_draw_text_decoration): Use it.
7105 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7107 (x_draw_glyph_string): Use them.
7108 * xfaces.c (Qline, Qwave): New Lisp objects.
7109 (check_lface_attrs, merge_face_ref)
7110 (Finternal_set_lisp_face_attribute, realize_x_face):
7111 Handle wave-style underline face attributes.
7112 * xterm.c (x_draw_underwave): New function.
7113 (x_draw_glyph_string): Use it.
7115 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7117 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7118 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7119 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7120 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7121 ($(BLD)/w32select.$(O)): Update dependencies.
7123 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7125 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7126 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7127 * character.c (_fetch_multibyte_char_p): Remove.
7128 * alloc.c: Include "character.h" before "buffer.h".
7130 * buffer.c: Likewise.
7131 * bytecode.c: Likewise.
7132 * callint.c: Likewise.
7133 * callproc.c: Likewise.
7134 * casefiddle.c: Likewise.
7135 * casetab.c: Likewise.
7136 * category.c: Likewise.
7138 * coding.c: Likewise.
7139 * composite.c: Likewise.
7140 * dired.c: Likewise.
7141 * dispnew.c: Likewise.
7143 * dosfns.c: Likewise.
7144 * editfns.c: Likewise.
7145 * emacs.c: Likewise.
7146 * fileio.c: Likewise.
7147 * filelock.c: Likewise.
7149 * fontset.c: Likewise.
7150 * fringe.c: Likewise.
7151 * indent.c: Likewise.
7152 * insdel.c: Likewise.
7153 * intervals.c: Likewise.
7154 * keyboard.c: Likewise.
7155 * keymap.c: Likewise.
7156 * lread.c: Likewise.
7157 * macros.c: Likewise.
7158 * marker.c: Likewise.
7159 * minibuf.c: Likewise.
7160 * nsfns.m: Likewise.
7161 * nsmenu.m: Likewise.
7162 * print.c: Likewise.
7163 * process.c: Likewise.
7164 * regex.c: Likewise.
7165 * region-cache.c: Likewise.
7166 * search.c: Likewise.
7167 * syntax.c: Likewise.
7169 * textprop.c: Likewise.
7171 * unexsol.c: Likewise.
7172 * w16select.c: Likewise.
7173 * w32fns.c: Likewise.
7174 * w32menu.c: Likewise.
7175 * window.c: Likewise.
7176 * xdisp.c: Likewise.
7178 * xmenu.c: Likewise.
7180 * xselect.c: Likewise.
7182 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7184 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7185 If all the glyphs of the glyph row came from strings, and we have no
7186 cursor positioning clues, put the cursor on the first glyph of the
7188 (handle_face_prop): Use chunk-relative overlay string index when
7189 indexing into it->string_overlays array. (Bug#11653)
7190 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7191 the rightmost. (Bug#11720)
7193 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7195 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7196 (CATEGORY_MEMBER): Enforce 1/0 value.
7197 * category.c (_temp_category_set): Remove.
7199 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7201 * window.c (Fdelete_other_windows_internal)
7202 (Fdelete_window_internal): Don't access frame's mouse highlight
7203 info of the initial frame. (Bug#11677)
7205 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7207 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7208 Assume USE_2_TAGS_FOR_INTS.
7209 (xreload): Adjust $tagmask width to match recent lisp.h change.
7211 Simplify lisp.h in minor ways that should not affect code.
7212 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7213 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7214 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7215 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7216 (INTTYPEBITS): New macro, for clarity.
7217 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7218 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7219 Simplify now that USE_LSB_TAG is always defined.
7220 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7221 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7223 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7225 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7227 2012-06-13 Glenn Morris <rgm@gnu.org>
7229 * s/bsd-common.h (BSD4_3):
7230 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7232 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7234 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7237 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7239 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7240 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7241 * alloc.c (widen_to_Lisp_Object): Remove.
7242 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7243 * frame.c (delete_frame): Remove outdated comment.
7244 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7245 USE_LISP_UNION_TYPE.
7246 (Fw32_unregister_hot_key): Likewise.
7247 (Fw32_toggle_lock_key): Likewise.
7248 * w32menu.c (add_menu_item): Likewise.
7249 (w32_menu_display_help): Use XIL instead of checking
7250 USE_LISP_UNION_TYPE.
7251 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7252 (init_heap): Likewise.
7253 * w32term.c (w32_read_socket): Update comment.
7255 2012-06-13 Glenn Morris <rgm@gnu.org>
7257 * s/usg5-4-common.h, src/s/unixware.h:
7258 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7260 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7262 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7264 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7265 * alloc.c (make_number) [!defined make_number]:
7266 Remove, as lisp.h always defines this now.
7267 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7268 (roundup_size): Verify that it is a power of 2.
7269 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7270 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7271 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7272 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7273 USE_LSB_TAG now is always defined to be either 0 or 1.
7275 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7276 code works fine either way, and efficiency is not a concern here,
7277 as the union type is for debugging, not for production.
7278 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7279 Use an inline function on all platforms when using the union type,
7280 since this is simpler and 'static inline' can be used portably
7282 (LISP_INITIALLY_ZERO): New macro.
7283 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7284 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7286 2012-06-12 Glenn Morris <rgm@gnu.org>
7288 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7290 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7292 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7293 Move BROKEN_SIGIO to configure.
7295 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7296 Move NO_TERMIO to configure.
7298 2012-06-12 Chong Yidong <cyd@gnu.org>
7300 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7301 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7302 MagickExportImagePixels is undefined.
7304 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7306 * image.c (imagemagick_load_image): Remove unused label.
7308 2012-06-11 Glenn Morris <rgm@gnu.org>
7310 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7311 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7312 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7313 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7315 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7317 * alloc.c (make_byte_code): New function.
7318 (Fmake_byte_code): Use it. Don't purify here.
7319 * lread.c (read1): Use it as well to avoid extra allocation.
7321 2012-06-11 Chong Yidong <cyd@gnu.org>
7323 * image.c (imagemagick_load_image): Implement transparency.
7325 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7327 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7328 account for preceding backslashes. (Bug#11663)
7330 2012-06-09 Chong Yidong <cyd@gnu.org>
7332 * term.c: Support italics in capable terminals (Bug#9652).
7333 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7334 (turn_on_face): Output using TS_enter_italic_mode if available.
7335 Don't handle unused blinking and alt-charset cases.
7336 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7337 and tty_alt_charset_p cases.
7338 (tty_capable_p, init_tty): Support italics.
7340 * termchar.h (struct tty_display_info): Add field for italics.
7341 Remove unused blink field.
7343 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7346 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7347 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7348 tty_alt_charset_p. Add tty_italic_p.
7350 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7352 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7353 dbus_type_is_basic if available.
7354 (xd_extract_signed, xd_extract_unsigned): Rename from
7355 extract_signed and extract_unsigned, respectively. Adapt callers.
7357 2012-06-09 Chong Yidong <cyd@gnu.org>
7359 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7361 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7364 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7366 * xdisp.c (vmessage): Treat frame message as multibyte.
7367 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7368 would generate the diagnostic "Making \302\247 buffer-local while
7371 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7373 * dispnew.c (showing_window_margins_p): Undo last change, which
7374 was done due to an inadvertent commit.
7375 (adjust_frame_glyphs_for_frame_redisplay): Do call
7376 showing_window_margins_p.
7378 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7380 * eval.c (Fmake_var_non_special): New primitive.
7381 (syms_of_eval): Defsubr it.
7382 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7384 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7386 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7387 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7389 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7391 * alloc.c (allocate_vectorlike): Fix last change.
7393 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7395 Block-based vector allocation of small vectors.
7396 * lisp.h (struct vectorlike_header): New field `nbytes',
7397 adjust comment accordingly.
7398 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7399 to denote vector blocks. Adjust users (live_vector_p,
7400 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7401 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7402 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7403 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7404 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7405 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7406 (roundup_size): New constant.
7407 (struct vector_block): New data type.
7408 (vector_blocks, vector_free_lists, zero_vector): New variables.
7409 (all_vectors): Rename to `large_vectors'.
7410 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7411 (sweep_vectors): New functions.
7412 (allocate_vectorlike): Return `zero_vector' as the only vector of
7413 0 items. Allocate new vector from block if vector size is less than
7414 or equal to VBLOCK_BYTES_MAX.
7415 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7416 (init_alloc_once): Add call to init_vectors.
7418 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7420 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7422 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7424 * doprnt.c (doprnt): Truncate multibyte char correctly.
7425 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7426 would mishandle a string argument "Xc" if X was a multibyte
7427 character of length 2: it would truncate after X's first byte
7428 rather than including all of X.
7430 2012-06-06 Chong Yidong <cyd@gnu.org>
7432 * buffer.c (word_wrap): Doc fix.
7434 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7436 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7438 2012-06-03 Glenn Morris <rgm@gnu.org>
7440 * xdisp.c (tool-bar-style): Doc fix.
7442 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7444 * Makefile.in (PAXCTL): Define.
7445 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7446 binary via PaX flags if the paxctl utility is available.
7447 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7448 Restore PaX flags to their default. (Bug#11398)
7450 2012-06-03 Chong Yidong <cyd@gnu.org>
7452 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7455 2012-06-03 Chong Yidong <cyd@gnu.org>
7457 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7458 (note_mode_line_or_margin_highlight): If there is no help echo,
7459 use mode-line-default-help-echo. Handle the case where the mouse
7460 position is past the end of the mode line string.
7462 * buffer.c (buffer_local_value_1): New function, split from
7463 Fbuffer_local_value; can return Qunbound.
7464 (Fbuffer_local_value): Use it.
7465 (Vmode_line_format): Docstring tweaks.
7467 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7469 * sysdep.c (system_process_attributes): Improve comment.
7471 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7473 * keyboard.c: Export real-this-command to Elisp.
7474 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7475 and DEFVAR it. Update all users.
7477 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7479 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7481 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7482 Convert pctcpu and pctmem to Lisp float properly.
7483 Let the compiler fold better, as 100.0/0x8000 is exact.
7485 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7487 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7490 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7492 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7494 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7496 For a 'struct window', replace some Lisp_Object fields to
7497 bitfields where appropriate, remove unused fields.
7498 * window.h (struct window): Remove unused 'last_mark_x' and
7499 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7500 change it's type from Lisp_Object to bitfield.
7501 Change type of 'force_start', 'optional_new_start',
7502 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7503 fields from Lisp_Object to bitfield. Adjust users accordingly.
7505 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7507 Pacify gcc -Wdouble-precision when using Xaw.
7508 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7509 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7510 Use 'float' consistently, rather than 'float' in most places
7511 and 'double' in a couple of places.
7513 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7515 * xdisp.c (handle_stop): Detect whether we have overlay strings
7516 loaded by testing it->current.overlay_string_index to be
7517 non-negative, instead of checking whether n_overlay_strings is
7518 positive. (Bug#11587)
7520 2012-05-31 Chong Yidong <cyd@gnu.org>
7522 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7524 * doc.c (Fsubstitute_command_keys): Doc fix.
7526 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7528 * search.c (search_buffer): Remove calls to
7529 r_alloc_inhibit_buffer_relocation, as it is now called by
7530 maybe_unify_char, which was the cause of relocation of buffer text
7533 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7535 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7536 for the duration of call to load_charset, to avoid problems with
7537 callers of maybe_unify_char that access buffer text through C
7540 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7541 decrement the inhibition flag, instead of just setting or
7544 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7546 Remove obsolete '#define static' cruft.
7547 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7548 This #undef was "temporary" in 2000; it is no longer needed
7549 now that '#define static' has gone away.
7550 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7551 (gray_bitmap_bits): Remove; no longer needed.
7552 All uses replaced with definiens.
7553 * xterm.c: Include "bitmaps/gray.xbm".
7555 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7557 Clean up __executable_start, monstartup when --enable-profiling.
7558 The following changes affect the code only when profiling.
7559 * dispnew.c (__executable_start): Rename from safe_bcopy.
7560 Define only on platforms that need it.
7561 * emacs.c: Include <sys/gmon.h> when profiling.
7562 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7563 (__executable_start): Remove decl, since lisp.h does it now.
7564 (safe_bcopy): Remove decl; no longer has that name.
7565 (main): Coalesce #if into single bit of code, for simplicity.
7566 Cast pointers to uintptr_t, since standard libraries want integers
7568 * lisp.h (__executable_start): New decl.
7570 2012-05-31 Glenn Morris <rgm@gnu.org>
7572 * image.c (Fimagemagick_types): Doc fix.
7574 2012-05-30 Jim Meyering <meyering@redhat.com>
7576 * callproc.c (Fcall_process_region): Include directory component
7577 in mkstemp error message (Bug#11586).
7579 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7581 * alloc.c, lisp.h (make_pure_vector): Now static.
7583 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7585 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7586 Move to byte-run.el.
7587 (Fautoload): Do the hash-doc more carefully.
7588 * data.c (Fdefalias): Purify definition, except for keymaps.
7589 (Qdefun): Move from eval.c.
7590 * lisp.h (Qdefun): Remove.
7591 * lread.c (read1): Tiny simplification.
7593 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
7595 Do not create empty overlays with the evaporate property (Bug#9642).
7596 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7597 Bug#9642, but explicitly check that the buffer the overlay would
7598 be moved to is live and rearrange lines to make sure that errors
7599 will not put the overlay in an inconsistent state.
7600 (Fdelete_overlay): Cosmetics.
7602 2012-05-28 Eli Zaretskii <eliz@gnu.org>
7604 * w32term.c (my_bring_window_to_top): New function.
7605 (x_raise_frame): Use handle returned by DeferWindowPos, which
7606 could be different from the original one.
7607 Call my_bring_window_to_top instead of my_set_foreground_window.
7610 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7611 by calling BringWindowToTop.
7613 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7614 (WM_EMACS_END): Increase by one.
7616 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7618 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7619 This avoids undefined behavior that might cause the eassert
7620 to not catch an out-of-range value.
7622 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
7624 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7625 Update dependencies.
7627 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7629 * bidi.c (bidi_mirror_char): Fix last change.
7631 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7633 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7634 when referring to sectname field in printf format.
7636 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7638 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7639 Only r_alloc_inhibit_buffer_relocation needed to be added;
7640 the others were already declared.
7642 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7643 before checking whether it's out of range. Put the check inside
7645 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7647 2012-05-27 Ken Brown <kbrown@cornell.edu>
7649 * callproc.c (Fcall_process): Restore a line that was accidentally
7650 commented out in the 2011-02-13 change (bug#11547).
7652 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7654 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7655 defined on ralloc.c.
7657 * buffer.c [REL_ALLOC]: Remove prototypes of
7658 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7659 they are now on lisp.h.
7661 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7663 * search.c (search_buffer): Use it to inhibit relocation of buffer
7664 text while re_search_2 is doing its job, because re_search_2 is
7665 passed C pointers to buffer text. (Bug#11519)
7667 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7670 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7671 state after an additional call to move_it_in_display_line_to, keep
7672 the values of it->max_ascent and it->max_descent found for the
7674 (pos_visible_p): Revert the comparison against bottom_y to what it
7675 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7678 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7680 Fix coding-related core dumps with gcc -ftrapv.
7681 The code was computing A - B, where A and B are pointers, and B is
7682 random garbage. This can lead to core dumps on platforms that
7683 have special pointer registers, and it also leads to core dumps on
7684 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7685 A - B only when B is initialized properly.
7686 * coding.c (coding_set_source, coding_set_destination): Return void.
7687 (coding_change_source, coding_change_destinations): New functions,
7688 with the old behaviors of coding_set_source and coding_set_destination.
7689 All callers that need an offset changed to use these new functions.
7691 2012-05-26 Glenn Morris <rgm@gnu.org>
7693 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7695 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7697 Extend mouse support on W32 text-mode console.
7698 * xdisp.c (draw_row_with_mouse_face):
7699 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7701 * w32console.c: Include window.h.
7702 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7704 (initialize_w32_display): Initialize mouse-highlight data.
7706 * w32inevt.c: Include termchar.h and window.h.
7707 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7708 moves, call note_mouse_highlight. If help_echo changed, call
7709 gen_help_event to produce help-echo message in the echo area.
7710 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7713 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7715 * lread.c (read1): Simplify slightly to avoid an overflow warning
7716 with GCC 4.7.0 on x86-64.
7718 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7720 * bidi.c (bidi_mirror_char): Revert last change: an int is
7721 definitely wide enough here.
7723 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
7725 Fix integer width and related bugs (Bug#9874).
7726 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7727 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7728 (string_bytes, check_sblock, allocate_string_data):
7729 (compact_small_strings, Fmake_bool_vector, make_string)
7730 (make_unibyte_string, make_multibyte_string)
7731 (make_string_from_bytes, make_specified_string)
7732 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7733 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7735 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7736 (allocate_pseudovector):
7737 Use int, not EMACS_INT, where int is wide enough.
7738 (inhibit_garbage_collection, Fgarbage_collect):
7739 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7740 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7741 int might not be wide enough.
7742 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7743 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7744 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7745 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7746 (bidi_level_of_next_char, bidi_move_to_visually_next):
7747 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7748 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7749 (Fkill_buffer, Fset_buffer_major_mode)
7750 (advance_to_char_boundary, Fbuffer_swap_text)
7751 (Fset_buffer_multibyte, overlays_at, overlays_in)
7752 (overlay_touches_p, struct sortvec, record_overlay_string)
7753 (overlay_strings, recenter_overlay_lists)
7754 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7755 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7756 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7757 (Foverlay_recenter, last_overlay_modification_hooks_used)
7758 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7760 (validate_region): Omit unnecessary test for b <= e,
7761 since that's guaranteed by the previous test.
7762 (adjust_overlays_for_delete): Avoid pos + length overflow.
7763 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7764 (report_overlay_modification):
7765 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7766 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7767 Omit pointer cast, which isn't needed anyway, and doesn't work
7768 after the EMACS_INT -> ptrdiff_t change.
7769 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7770 * buffer.h: Adjust decls to match defn changes elsewhere.
7771 (struct buffer_text, struct buffer):
7772 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7773 Use EMACS_INT, not int, where int might not be wide enough.
7774 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7775 not int, to avoid needless 32-bit limit on 64-bit hosts.
7776 (exec_byte_code): Use tighter memory-full test, one that checks
7777 for alloca overflow. Don't compute the address of the object just
7778 before an array, as that's not portable. Use EMACS_INT, not
7779 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7780 * callint.c (Fcall_interactively):
7781 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7782 * callproc.c (call_process_kill, Fcall_process):
7783 Don't assume pid_t fits into an Emacs fixnum.
7784 (call_process_cleanup, Fcall_process, child_setup):
7785 Don't assume pid_t fits into int.
7786 (call_process_cleanup, Fcall_process, delete_temp_file)
7787 (Fcall_process_region):
7788 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7789 (Fcall_process): Simplify handling of volatile integers.
7790 Use int, not EMACS_INT, where int will do.
7791 * casefiddle.c (casify_object, casify_region, operate_on_word)
7792 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7794 (casify_object): Avoid integer overflow when overallocating buffer.
7795 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7796 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
7797 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7798 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7799 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7800 integers are now checked earlier. All uses replaced with XINT.
7802 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7803 For CCL_MapSingle, check that content and value are in int range.
7804 (ccl_driver, Fregister_code_conversion_map):
7805 Check that Vcode_version_map_vector is a vector.
7806 (resolve_symbol_ccl_program): Check that vector header is in range.
7807 Always copy the vector, so that we can check its contents reliably
7808 now rather than having to recheck each instruction as it's being
7809 executed. Check that vector words fit in 'int'.
7810 (ccl_get_compiled_code, Fregister_ccl_program)
7811 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7812 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7813 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7814 contents are in range.
7815 (Fccl_execute_on_string): Check that status is in range.
7816 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7817 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7818 Accept and return EMACS_INT, not int, because callers can pass values
7820 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7821 (multibyte_chars_in_text, parse_str_as_multibyte)
7822 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7823 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7824 (string_escape_byte8, Fget_byte):
7825 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7826 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7827 avoid mishandling large integers.
7828 * character.h: Adjust decls to match defn changes elsewhere.
7829 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7830 (Ffind_charset_region):
7831 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7832 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7833 (load_charset_map_from_vector, Fdefine_charset_internal):
7834 Don't assume fixnum fits in int.
7835 (load_charset_map_from_vector, Fmap_charset_chars):
7836 Remove now-unnecessary CHECK_NATNUMs.
7837 (Fdefine_charset_internal): Check ranges here, more carefully.
7838 Don't rely on undefined behavior with signed left shift overflow.
7839 Don't assume unsigned int fits into fixnum, or that fixnum fits
7840 into unsigned int. Don't require max_code to be a valid fixnum;
7841 that's not true for gb10830 4-byte on a 32-bit host. Allow
7842 invalid_code to be a cons, for the same reason. Require code_offset
7843 to be a character. Avoid int overflow if max_char is close
7845 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7846 this is intended anyway and avoids some undefined behavior.
7847 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7848 INDEX_TO_CODE_POINT, as that's what it expects.
7849 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
7850 * charset.h (DECODE_CHAR): Return int, not unsigned;
7851 this is what was intended anyway, and it avoids undefined behavior.
7852 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7853 integer-overflow issues.
7854 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7855 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7856 where the argument is EMACS_INT, and this behavior is not intended.
7857 * chartab.c (Fmake_char_table, Fset_char_table_range)
7858 (uniprop_get_decoder, uniprop_get_encoder):
7859 Don't assume fixnum fits in int.
7860 * cmds.c (move_point): New function, that does the gist of
7861 Fforward_char and Fbackward_char, but does so while checking
7862 for integer overflow more accurately.
7863 (Fforward_char, Fbackward_char): Use it.
7864 (Fforward_line, Fend_of_line, internal_self_insert)
7865 (internal_self_insert):
7866 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7867 Fix a FIXME, by checking for integer overflow when calculating
7868 target_clm and actual_clm.
7869 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
7870 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
7871 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7872 (coding_alloc_by_making_gap, alloc_destination)
7873 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7874 (encode_coding_utf_16, detect_coding_emacs_mule)
7875 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7876 (detect_coding_iso_2022, decode_coding_iso_2022)
7877 (encode_invocation_designation, encode_designation_at_bol)
7878 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7879 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7880 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7881 (encode_coding_ccl, encode_coding_raw_text)
7882 (detect_coding_charset, decode_coding_charset)
7883 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7884 (produce_composition, produce_charset, produce_annotation)
7885 (decode_coding, handle_composition_annotation)
7886 (handle_charset_annotation, consume_chars, decode_coding_gap)
7887 (decode_coding_object, encode_coding_object, detect_coding_system)
7888 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7889 (code_convert_region, code_convert_string)
7890 (Fdefine_coding_system_internal)
7891 (coding_set_source, coding_set_destination):
7892 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7893 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7894 (Fdefine_coding_system_internal):
7895 Don't assume fixnums fit in int.
7896 (decode_coding_gap, decode_coding_object, encode_coding_object)
7897 (Fread_coding_system, Fdetect_coding_region)
7898 (Funencodable_char_position, Fcheck_coding_systems_region)
7899 (get_translation, handle_composition_annotation, consume_chars):
7900 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7901 (consume_chars): Rewrite to not calculate an address outside buffer.
7902 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7903 Don't access memory outside of the args array.
7904 (Fdefine_coding_system_internal): Check for charset-id overflow.
7905 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7906 result of ENCODE_CHAR.
7907 * coding.h: Adjust decls to match defn changes elsewhere.
7908 (struct coding_system):
7909 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7910 * composite.c (get_composition_id, find_composition)
7911 (run_composition_function, update_compositions)
7912 (compose_text, composition_gstring_put_cache)
7913 (composition_gstring_p, composition_gstring_width)
7914 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7915 (composition_compute_stop_pos, composition_reseat_it)
7916 (composition_update_it, struct position_record)
7917 (find_automatic_composition, composition_adjust_point)
7918 (Fcomposition_get_gstring, Ffind_composition_internal):
7919 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7920 (update_compositions):
7921 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7922 * composite.h: Adjust decls to match defn changes elsewhere.
7923 (struct composition):
7924 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7925 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7926 Do not attempt to compute the address of the object just before a
7927 buffer; this is not portable.
7929 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7930 (Faset): Use int, not EMACS_INT, where int is wide enough.
7931 (Fstring_to_number): Don't assume fixnums fit in int.
7932 (Frem): Don't assume arg is nonnegative.
7933 * dbusbind.c (xd_append_arg): Check for integers out of range.
7934 (Fdbus_call_method): Don't overflow the timeout int.
7935 (extract_signed, extract_unsigned): New functions.
7936 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7937 (xd_get_connection_references): Return ptrdiff_t, not int.
7939 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7940 (xd_read_message_1):
7941 Use int, not unsigned, where the dbus API uses int.
7942 (Fdbus_message_internal): Don't overflow mtype.
7943 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7944 * dired.c (directory_files_internal, file_name_completion, scmp)
7945 (file_name_completion_stat):
7946 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7947 (file_name_completion): Don't overflow matchcount.
7948 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7949 * dispextern.h: Adjust decls to match defn changes elsewhere.
7950 (struct text_pos, struct glyph, struct bidi_saved_info)
7951 (struct bidi_string_data, struct bidi_it, struct composition_it)
7953 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7954 (struct display_pos, struct composition_it, struct it):
7955 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7956 * dispnew.c (increment_matrix_positions)
7957 (increment_row_positions, mode_line_string)
7958 (marginal_area_string):
7959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7960 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7961 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7962 (duration_to_sec_usec): New function, to check for overflow better.
7963 (Fsleep_for, sit_for): Use it.
7964 * doc.c (get_doc_string, store_function_docstring):
7965 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7966 (get_doc_string, Fsnarf_documentation):
7967 Use int, not EMACS_INT, where int is wide enough.
7969 Use SAFE_ALLOCA, not alloca.
7970 Check for overflow when converting EMACS_INT to off_t.
7971 * doprnt.c (doprnt):
7972 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7973 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7974 Don't assume uid_t fits into fixnum.
7975 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7976 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7977 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7978 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7979 (general_insert_function)
7980 (Finsert_char, make_buffer_string, make_buffer_string_both)
7981 (update_buffer_properties, Fbuffer_substring)
7982 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7983 (Fsubst_char_in_region, check_translation)
7984 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7985 (transpose_markers, Ftranspose_regions):
7986 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7987 (clip_to_bounds): Move to lisp.h as an inline function).
7988 (Fconstrain_to_field): Don't assume integers are nonnegative.
7989 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7990 (Fsubst_char_in_region, Fsave_restriction):
7991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7992 (Femacs_pid): Don't assume pid_t fits into fixnum.
7993 (lo_time): Use int, not EMACS_INT, when int suffices.
7994 (lisp_time_argument): Check for usec out of range.
7995 (Fencode_time): Don't assume fixnum fits in int.
7996 (Fuser_login_name, Fuser_full_name): Signal an error
7997 if a uid argument is out of range, rather than relying on
7999 (Fformat_time_string): Remove now-unnecessary check.
8000 lisp_time_argument checks for out-of-range usec now.
8001 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8002 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8003 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8004 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8005 (init_cmdargs, Fdump_emacs):
8006 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8007 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8008 the bottom (typically) 32 bits of the fixnum.
8009 * eval.c (specpdl_size, call_debugger):
8010 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8011 (when_entered_debugger, Fbacktrace_debug):
8012 Don't assume fixnum can fit in int.
8013 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8014 the object just before a buffer; this is not portable.
8015 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8016 (grow_specpdl, unbind_to):
8017 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8018 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8019 (grow_specpdl): Simplify allocation by using xpalloc.
8020 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8021 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8022 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8023 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8024 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8026 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8027 (Fcopy_file, non_regular_nbytes, read_non_regular)
8028 (Finsert_file_contents):
8029 Use int, not EMACS_INT, where int is wide enough.
8030 (READ_BUF_SIZE): Verify that it fits in int.
8031 (Finsert_file_contents): Check that counts are in proper range,
8032 rather than assuming fixnums fit into ptrdiff_t etc.
8033 Don't assume fixnums fit into int.
8034 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8035 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8036 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8037 (string_char_to_byte, string_byte_to_char)
8038 (string_make_multibyte, string_to_multibyte)
8039 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8040 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8041 (substring_both, Fdelete, internal_equal, Ffillarray)
8042 (Fclear_string, mapcar1)
8043 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8044 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8045 (larger_vector, make_hash_table, maybe_resize_hash_table)
8046 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8047 (Fmaphash, secure_hash):
8048 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8049 (concat): Check for string index and length overflow.
8050 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8052 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8053 (larger_vector): New API (vec, incr_min, size_max) replaces old
8054 one (vec, new_size, init). This catches size overflow.
8055 INIT was removed because it was always Qnil.
8056 All callers changed.
8057 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8058 the upper bound on a hash table index size.
8059 (make_hash_table, maybe_resize_hash_table): Use it.
8060 (secure_hash): Computer start_byte and end_byte only after
8061 they're known to be in ptrdiff_t range.
8062 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8063 (Ffont_get_glyphs, Ffont_at):
8064 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8065 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8066 (Flist_fonts, Fopen_font):
8067 Don't assume fixnum can fit in int.
8068 (check_gstring): Don't assume index can fit in int.
8069 (font_match_p): Check that fixnum is a character, not a nonnegative
8070 fixnum, since the later code needs to stuff it into an int.
8071 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8072 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8073 conversion overflow issues.
8074 (Fopen_font): Check for integer out of range.
8075 (Ffont_get_glyphs): Don't assume index can fit in int.
8076 * font.h: Adjust decls to match defn changes elsewhere.
8077 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8079 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8080 printmax_t, where ptrdiff_t is wide enough.
8081 (Finternal_char_font):
8082 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8083 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8084 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8085 (Fset_frame_position, x_set_frame_parameters)
8086 (x_set_line_spacing, x_set_border_width)
8087 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8088 Check that fixnums are in proper range for system types.
8089 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8090 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8091 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8092 Use SAFE_ALLOCA_LISP, not alloca.
8093 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8094 intptr_t is wide enough.
8095 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8096 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8097 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8098 Check for fixnum out of range.
8099 * ftfont.c (ftfont_list): Don't assume index fits in int.
8100 Check that fixnums are in proper range for system types.
8101 (ftfont_shape_by_flt):
8102 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8103 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8104 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8105 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8106 Check that fixnums are in proper range for system types.
8107 * gnutls.h: Adjust decls to match defn changes elsewhere.
8108 * gtkutil.c (xg_dialog_run):
8109 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8110 (update_frame_tool_bar):
8111 Check that fixnums are in proper range for system types.
8112 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8113 (lookup_image): Check that fixnums are in range for system types.
8114 * indent.c (last_known_column, last_known_column_point):
8115 (current_column_bol_cache):
8116 (skip_invisible, current_column, check_display_width):
8117 (check_display_width, scan_for_column, current_column_1)
8118 (Findent_to, Fcurrent_indentation, position_indentation)
8119 (indented_beyond_p, Fmove_to_column, compute_motion):
8120 (Fcompute_motion, Fvertical_motion):
8121 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8122 (last_known_column_modified): Use EMACS_INT, not int.
8123 (check_display_width):
8125 Check that fixnums and floats are in proper range for system types.
8126 (compute_motion): Don't assume index or fixnum fits in int.
8127 (compute_motion, Fcompute_motion):
8128 Use int, not EMACS_INT, when it is wide enough.
8129 (vmotion): Omit local var start_hpos that is always 0; that way
8130 we don't need to worry about overflow in expressions involving it.
8131 * indent.h: Adjust decls to match defn changes elsewhere.
8133 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8134 Use int, not EMACS_INT, where int is wide enough.
8135 Remove unused members ovstring_chars_done and tab_offset;
8137 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8138 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8139 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8140 (make_gap, copy_text, insert, insert_and_inherit)
8141 (insert_before_markers, insert_before_markers_and_inherit)
8142 (insert_1, count_combining_before, count_combining_after)
8143 (insert_1_both, insert_from_string)
8144 (insert_from_string_before_markers, insert_from_string_1)
8145 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8146 (adjust_after_replace, adjust_after_insert, replace_range)
8147 (replace_range_2, del_range, del_range_1, del_range_byte)
8148 (del_range_both, del_range_2, modify_region)
8149 (prepare_to_modify_buffer, signal_before_change)
8150 (signal_after_change, Fcombine_after_change_execute):
8151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8152 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8153 (balance_an_interval, split_interval_right, split_interval_left)
8154 (find_interval, next_interval, update_interval)
8155 (adjust_intervals_for_insertion, delete_node, delete_interval)
8156 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8157 (static_offset_intervals, offset_intervals)
8158 (merge_interval_right, merge_interval_left, make_new_interval)
8159 (graft_intervals_into_buffer, temp_set_point_both)
8160 (temp_set_point, set_point, adjust_for_invis_intang)
8161 (set_point_both, move_if_not_intangible, get_property_and_range)
8162 (get_local_map, copy_intervals, copy_intervals_to_string)
8163 (compare_string_intervals, set_intervals_multibyte_1):
8164 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8165 * intervals.h: Adjust decls to match defn changes elsewhere.
8167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8168 * keyboard.c (this_command_key_count, this_single_command_key_start)
8169 (before_command_key_count, before_command_echo_length, echo_now)
8170 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8171 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8172 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8173 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8174 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8175 (last_non_minibuf_size, last_point_position, echo_truncate)
8176 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8177 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8178 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8179 (stuff_buffered_input):
8180 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8181 (last_auto_save, command_loop_1, read_char):
8182 Use EMACS_INT, not int, to avoid integer overflow.
8183 (record_char): Avoid overflow in total_keys computation.
8184 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8185 * keyboard.h: Adjust decls to match defn changes elsewhere.
8186 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8187 (Fkey_description, Fdescribe_vector, Flookup_key):
8188 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8189 (click_position): New function, to check that positions are in range.
8190 (Fcurrent_active_maps):
8192 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8193 (Faccessible_keymaps, Fkey_description):
8194 (preferred_sequence_p):
8195 Don't assume fixnum can fit into int.
8196 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8197 Check for integer overflow in size calculations.
8198 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8199 avoid mishandling large integers.
8200 * lisp.h: Adjust decls to match defn changes elsewhere.
8201 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8202 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8203 (struct Lisp_Marker):
8204 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8205 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8206 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8207 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8208 All callers changed.
8209 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8210 Assume the arg has valid form, since it always does.
8211 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8212 unsigned integer system type.
8213 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8214 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8215 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8216 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8217 (duration_to_sec_usec): New decl.
8218 * lread.c (read_from_string_index, read_from_string_index_byte)
8219 (read_from_string_limit, readchar, unreadchar, openp)
8220 (read_internal_start, read1, oblookup):
8221 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8222 (Fload, readevalloop, Feval_buffer, Feval_region):
8223 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8224 (openp): Check for out-of-range argument to 'access'.
8225 (read1): Use int, not EMACS_INT, where int is wide enough.
8226 Don't assume fixnum fits into int.
8227 Fix off-by-one error that can read outside a buffer.
8228 (read_filtered_event): Use duration_to_sec_usec
8229 to do proper overflow checking on durations.
8230 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8231 in size calculation.
8232 (Fexecute_kbd_macro):
8233 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8234 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8235 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8236 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8237 (set_marker_both, set_marker_restricted_both, marker_position)
8238 (marker_byte_position, Fbuffer_has_markers_at):
8239 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8240 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8241 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8242 It now merely ensures that the menu is large enough, without
8243 necessarily growing it, as this avoids some integer overflow issues.
8244 All callers changed.
8245 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8246 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8247 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8248 Use SAFE_ALLOCA_LISP, not alloca.
8249 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8250 to EMACS_INT. Check that fixnums are in proper range for system types.
8251 * minibuf.c (minibuf_prompt_width, string_to_object)
8252 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8253 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8254 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8255 (get_minibuffer, read_minibuf_unwind):
8256 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8257 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8258 this simplifies overflow checking. All callers changed.
8259 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8261 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8262 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8263 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8264 Check that fixnums are in proper range for system types.
8265 (Fx_create_frame, Fx_show_tip):
8266 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8267 * nsfont.m (ns_findfonts, nsfont_list_family):
8268 Don't assume fixnum fits in long.
8269 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8270 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8271 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8273 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8274 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8275 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8276 (PRINTDECLARE, PRINTPREPARE):
8277 (strout, print_string):
8278 (print, print_preprocess, print_check_string_charset_prop)
8280 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8282 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8283 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8284 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8285 (printchar, strout): Use xpalloc to catch size calculation overflow.
8286 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8287 (print_error_message): Use SAFE_ALLOCA, not alloca.
8288 (print_object): Use int, not EMACS_INT, where int is wide enough.
8289 (print_depth, new_backquote_output, print_number_index):
8290 Use ptrdiff_t, not int, where int might not be wide enough.
8291 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8292 (Fset_process_window_size, Fformat_network_address)
8293 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8295 Check that fixnums are in proper range for system types.
8296 (Fsignal_process): Simplify by avoiding a goto.
8297 Check for process-ids out of pid_t range rather than relying on
8299 (process_tick, update_tick): Use EMACS_INT, not int.
8300 (Fformat_network_address, read_process_output, send_process)
8301 (Fprocess_send_region, status_notify):
8302 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8303 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8304 (wait_reading_process_output, read_process_output, exec_sentinel):
8305 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8306 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8307 (Faccept_process_output): Use duration_to_sec_usec to do proper
8308 overflow checking on durations.
8309 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8310 Don't assume pid_t fits in int.
8311 * process.h (struct Lisp_Process): Members tick and update_tick
8312 are now of type EMACS_INT, not int.
8313 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8314 configured --with-wide-int.
8315 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8316 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8317 * search.c (looking_at_1, string_match_1):
8318 (fast_string_match, fast_c_string_match_ignore_case)
8319 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8320 (scan_newline, find_before_next_newline, search_command)
8321 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8322 (set_search_regs, wordify):
8325 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8326 (string_match_1, search_buffer, set_search_regs):
8328 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8329 (wordify): Check for overflow in size calculation.
8330 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8331 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8332 Check that fixnums are in proper range for system types.
8333 * sound.c (struct sound_device)
8334 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8335 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8336 (Fplay_sound_internal):
8337 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8338 * syntax.c (struct lisp_parse_state, find_start_modiff)
8339 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8340 (Fparse_partial_sexp):
8341 Don't assume fixnums can fit in int.
8342 (struct lisp_parse_state, find_start_pos, find_start_value)
8343 (find_start_value_byte, find_start_begv)
8344 (update_syntax_table, char_quoted, dec_bytepos)
8345 (find_defun_start, prev_char_comend_first, back_comment):
8346 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8347 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8348 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8349 (Finternal_describe_syntax_value): Check that match_lisp is a
8350 character, not an integer, since the code stuffs it into int.
8351 (scan_words, scan_sexps_forward):
8352 Check that fixnums are in proper range for system types.
8354 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8355 (scan_sexps_forward):
8356 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8357 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8358 * syntax.h: Adjust decls to match defn changes elsewhere.
8359 (struct gl_state_s):
8360 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8361 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8362 MOST_POSITIVE_FIXNUM.
8363 * sysdep.c (wait_for_termination_1, wait_for_termination)
8364 (interruptible_wait_for_termination, mkdir):
8365 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8366 (emacs_read, emacs_write):
8367 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8368 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8369 and double all fit in int.
8370 * term.c (set_tty_color_mode):
8371 Check that fixnums are in proper range for system types.
8372 * termhooks.h (struct input_event):
8373 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8374 * textprop.c (validate_interval_range, interval_of)
8375 (Fadd_text_properties, set_text_properties_1)
8376 (Fremove_text_properties, Fremove_list_of_text_properties)
8377 (Ftext_property_any, Ftext_property_not_all)
8378 (copy_text_properties, text_property_list, extend_property_ranges)
8379 (verify_interval_modification):
8380 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8381 (Fnext_single_char_property_change)
8382 (Fprevious_single_char_property_change):
8383 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8384 (copy_text_properties):
8385 Check for integer overflow in index calculation.
8386 * undo.c (last_boundary_position, record_point, record_insert)
8387 (record_delete, record_marker_adjustment, record_change)
8388 (record_property_change):
8389 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8390 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8391 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8392 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8393 (Fx_hide_tip, Fx_file_dialog):
8394 * w32menu.c (set_frame_menubar):
8395 Use ptrdiff_t, not int, for consistency with rest of code.
8396 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8397 (select_window, Fdelete_other_windows_internal)
8398 (window_scroll_pixel_based, window_scroll_line_based)
8399 (Frecenter, Fset_window_configuration):
8400 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8401 (Fset_window_hscroll, run_window_configuration_change_hook)
8402 (set_window_buffer, temp_output_buffer_show, scroll_command)
8403 (Fscroll_other_window, Frecenter):
8404 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8405 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8406 Don't assume fixnum fits in int.
8407 (Fset_window_scroll_bars):
8408 Check that fixnums are in proper range for system types.
8409 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8410 (string_pos, c_string_pos, number_of_chars, init_iterator)
8411 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8412 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8413 (compute_display_string_end, handle_face_prop)
8414 (face_before_or_after_it_pos, handle_invisible_prop)
8415 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8416 (display_prop_intangible_p, string_buffer_position_lim)
8417 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8418 (get_overlay_strings_1, get_overlay_strings)
8419 (iterate_out_of_display_property, forward_to_next_line_start)
8420 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8421 (get_next_display_element, set_iterator_to_next)
8422 (get_visually_first_element, compute_stop_pos_backwards)
8423 (handle_stop_backwards, next_element_from_buffer)
8424 (move_it_in_display_line_to, move_it_in_display_line)
8425 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8426 (add_to_log, message_dolog, message_log_check_duplicate)
8427 (message2, message2_nolog, message3, message3_nolog
8428 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8429 (current_message_1, truncate_echo_area, truncate_message_1)
8430 (set_message, set_message_1, store_mode_line_noprop)
8431 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8432 (text_outside_line_unchanged_p, check_point_in_composition)
8433 (reconsider_clip_changes)
8434 (redisplay_internal, set_cursor_from_row, try_scrolling)
8435 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8436 (redisplay_window, find_last_unchanged_at_beg_row)
8437 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8438 (trailing_whitespace_p, find_row_edges, display_line)
8439 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8440 (display_mode_element, store_mode_line_string)
8441 (pint2str, pint2hrstr, decode_mode_spec)
8442 (display_count_lines, display_string, draw_glyphs)
8443 (x_produce_glyphs, x_insert_glyphs)
8444 (rows_from_pos_range, mouse_face_from_buffer_pos)
8445 (fast_find_string_pos, mouse_face_from_string_pos)
8446 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8448 (safe_call, init_from_display_pos, handle_fontified_prop)
8449 (handle_single_display_spec, load_overlay_strings)
8450 (with_echo_area_buffer, setup_echo_area_for_printing)
8451 (display_echo_area, echo_area_display)
8452 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8453 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8454 (redisplay_window, dump_glyph_row, display_mode_line)
8455 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8456 (handle_display_spec, display_prop_string_p):
8457 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8458 (handle_single_display_spec, build_desired_tool_bar_string)
8459 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8460 (get_specified_cursor_type):
8461 Check that fixnums are in proper range for system types.
8462 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8463 (Flookup_image_map):
8464 Don't assume fixnums fit in int.
8465 (compare_overlay_entries):
8466 Avoid mishandling comparisons due to subtraction overflow.
8467 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8468 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8469 (handle_tool_bar_click):
8470 Use int, not unsigned, since we prefer signed and the signedness
8471 doesn't matter here.
8472 (get_next_display_element, next_element_from_display_vector):
8473 Use int, not EMACS_INT, when int is wide enough.
8474 (start_hourglass): Use duration_to_sec_usec to do proper
8475 overflow checking on durations.
8476 * xfaces.c (Fbitmap_spec_p):
8477 Check that fixnums are in proper range for system types.
8478 (compare_fonts_by_sort_order):
8479 Avoid mishandling comparisons due to subtraction overflow.
8480 (Fx_family_fonts, realize_basic_faces):
8481 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8483 Don't assume fixnum fits in int.
8484 Use SAFE_ALLOCA_LISP, not alloca.
8485 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8486 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8487 (face_at_buffer_position, face_for_overlay_string)
8488 (face_at_string_position):
8489 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8490 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8491 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8493 Check that fixnums are in proper range for system types.
8494 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8495 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8496 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8497 (Fx_change_window_property): Don't assume fixnums fit in int.
8498 * xfont.c (xfont_chars_supported):
8499 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8500 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8501 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8502 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8503 * xml.c (parse_region):
8504 * xrdb.c (magic_file_p):
8505 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8506 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8507 (x_get_local_selection, x_reply_selection_request)
8508 (x_handle_selection_request, wait_for_property_change):
8509 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8510 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8511 short is wide enough.
8512 (x_send_client_event): Don't assume fixnum fits in int.
8513 * xterm.c (x_x_to_emacs_modifiers):
8514 Don't assume EMACS_INT overflows nicely into int.
8515 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8517 (handle_one_xevent): NATNUMP can eval its arg twice.
8518 (x_connection_closed):
8519 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8520 * xterm.h: Adjust decls to match defn changes elsewhere.
8521 (struct scroll_bar): Use struct vectorlike_header
8522 rather than rolling our own approximation.
8523 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8525 2012-05-25 Glenn Morris <rgm@gnu.org>
8527 * lisp.mk (lisp): Update for more files being compiled now.
8529 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8531 * lread.c: Remove `read_pure' which makes no difference.
8532 (read_pure): Remove var.
8533 (unreadpure): Remove function.
8534 (readevalloop): Don't call read_list with -1 flag.
8535 (read1, read_vector): Don't test read_pure any more.
8536 (read_list): Simplify.
8538 * fileio.c, character.h: Minor style tweaks.
8540 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8542 * window.h (clip_changed): Remove useless declaration.
8544 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8546 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8547 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8549 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8552 This directory predates autoconf and is no longer needed nowadays.
8553 Move its few remaining bits of functionality to where they're needed.
8554 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8555 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8556 * m/template.h: Remove.
8557 * Makefile.in (M_FILE): Remove. All uses removed.
8558 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8559 * lisp.h (USE_LSB_TAG):
8560 * mem-limits.h (EXCEEDS_LISP_PTR):
8561 Use VAL_MAX, not VALBITS, in #if.
8562 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8563 (EMACS_UINT): Define unconditionally now.
8564 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8565 (BITS_PER_EMACS_INT): New constants, replacing
8566 what used to be in config.h, but not useful in #if.
8567 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8568 define them any more.
8569 (VAL_MAX): New macro.
8571 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8572 BITS_PER_EMACS_INT, in #if.
8573 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8574 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8575 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8576 * s/ms-w32.h (DATA_START):
8577 Move here from removed file m/intel386.h.
8578 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8579 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8581 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8583 Assume C89 or later.
8584 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8585 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8587 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8588 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8589 * textprop.c, tparam.c (NULL): Remove.
8590 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8591 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8592 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8593 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8594 * xterm.c (input_signal_count): Assume volatile works.
8596 2012-05-21 Ken Brown <kbrown@cornell.edu>
8598 * xgselect.c (xg_select): Fix first argument in call to 'select'
8601 2012-05-20 Ken Brown <kbrown@cornell.edu>
8603 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8604 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8606 2012-05-19 Ken Brown <kbrown@cornell.edu>
8608 * xfns.c (x_in_use): Remove `static' qualifier.
8609 * xterm.h (x_in_use): Declare.
8610 * xgselect.c: Include xterm.h.
8611 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8612 and `display_arg' (bug#9754).
8614 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8616 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8618 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8619 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8621 2012-05-18 Eli Zaretskii <eliz@gnu.org>
8623 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8625 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8626 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8628 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8629 reference to image_cache->refcount.
8630 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8632 2012-05-17 Juri Linkov <juri@jurta.org>
8634 * search.c (Fword_search_regexp, Fword_search_backward)
8635 (Fword_search_forward, Fword_search_backward_lax)
8636 (Fword_search_forward_lax): Move functions to isearch.el
8637 (bug#10145, bug#11381).
8639 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8641 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8643 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8645 * lread.c (init_obarray): Declare Qt and Qnil as special.
8647 2012-05-14 Glenn Morris <rgm@gnu.org>
8649 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8650 Put "libexec" before "bin", for the sake of init_callproc_1.
8652 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8654 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8656 * unexaix.c: Port to more-recent AIX compilers.
8657 (report_error, report_error_1, make_hdr, copy_sym)
8658 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8659 Make arguments const char *, not char *, to avoid violations of C
8660 standard and to fix some AIX warnings reported by Gilles Pion.
8662 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8664 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8665 already have overlays loaded.
8666 (handle_single_display_spec): Before returning without displaying
8667 fringe bitmap, synchronize the bidi iterator with the main display
8668 iterator, by calling iterate_out_of_display_property.
8669 (iterate_out_of_display_property): Detect buffer iteration by
8670 testing that it->string is a Lisp string.
8671 (get_next_display_element): When the current object is exhausted,
8672 and there's something on it->stack, call set_iterator_to_next to
8673 proceed with what's on the stack, instead of returning zero.
8674 (set_iterator_to_next): If called at the end of a Lisp string,
8675 proceed to consider_string_end without incrementing string
8676 position. Don't increment display vector index past the end of
8677 the display vector. (Bug#11417)
8678 (pos_visible_p): Don't report a position visible when move_it_to
8679 stopped at the last line of window, which happens to be scanned
8680 backwards by the bidi iteration. (Bug#11464)
8682 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8684 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8685 and right-margin display specs even if the spec is invalid or we
8686 are on a TTY, and thus unable to display on the fringes.
8687 That's because the text with the property will not be displayed anyway,
8688 so we need to signal to the caller that this is a "replacing"
8689 display spec. This fixes display when the spec is invalid or we
8692 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8694 * unexaix.c (make_hdr): Fix typo in prototype.
8695 This bug broke the build on AIX. Problem reported by Gilles Pion.
8697 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
8699 * keyboard.c (kbd_buffer_get_event): Read special events also in
8700 batch mode. (Bug#11415)
8702 2012-05-12 Glenn Morris <rgm@gnu.org>
8704 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8706 2012-05-12 Eli Zaretskii <eliz@gnu.org>
8708 * lisp.mk (lisp): Add newcomment.elc.
8710 2012-05-12 Glenn Morris <rgm@gnu.org>
8712 * Makefile.in (MKDIR_P): New, set by configure.
8713 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8715 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8717 Remove unused function hourglass_started.
8718 * dispextern.h (hourglass_started):
8719 * w32fns.c (hourglass_started):
8720 * xdisp.c (hourglass_started): Remove.
8722 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
8724 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8725 Update dependencies.
8727 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8729 * xgselect.c (xg_select): Put maxfds+1 into a var.
8730 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8732 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8734 2012-05-10 Dave Abrahams <dave@boostpro.com>
8736 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8737 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8739 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
8741 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8742 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8743 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8744 Initialize xd_registered_buses.
8746 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8748 Untag more efficiently if USE_LSB_TAG.
8749 This is based on a proposal by YAMAMOTO Mitsuharu in
8750 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8751 For an admittedly artificial (nth 8000 longlist) benchmark on
8752 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8753 Emacs's overall text size by 1%.
8754 * lisp.h (XUNTAG): New macro.
8755 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8756 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8757 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8758 * eval.c (Fautoload):
8759 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8760 * frame.h (XFRAME): Use XUNTAG.
8762 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8763 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8764 Remove unportable assumptions about print widths of types like
8766 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8767 intptr_t when converting between pointer and integer, to avoid GCC
8768 warnings about wrong width.
8770 2012-05-09 Eli Zaretskii <eliz@gnu.org>
8772 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8773 stack for each reader_thread, instead of defaulting to 8MB
8774 determined by the linker. This avoids failures in creating
8775 subprocesses on Windows 7, see the discussion in this thread:
8776 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8778 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8780 Fix up display of the *Minibuf-0* buffer in the mini window.
8781 * keyboard.c (read_char): Don't clear the echo area if there's no
8783 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8784 contents of *Minibuf-0*) if there's no message displayed in its stead.
8786 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
8788 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8791 2012-05-06 Chong Yidong <cyd@gnu.org>
8793 * lisp.mk (lisp): Update.
8795 2012-05-05 Jim Meyering <meyering@redhat.com>
8797 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8799 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8801 * data.c (PUT_ERROR): New macro.
8802 (syms_of_data): Use it. Add new error type `user-error'.
8803 * undo.c (user_error): New function.
8804 (Fprimitive_undo): Use it.
8805 * print.c (print_error_message): Adjust print style for `user-error'.
8806 * keyboard.c (user_error): New function.
8807 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8809 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8811 Do not limit current-time-string to years 1000..9999.
8812 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8813 (Fcurrent_time_string): Support any year that is supported by the
8814 underlying localtime representation. Don't use asctime, as it
8815 has undefined behavior for years outside the range -999..9999.
8817 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8819 Fix race conditions involving setenv, gmtime, localtime, asctime.
8820 Without this fix, interrupts could mess up code that uses these
8821 nonreentrant functions, since setting TZ invalidates existing
8822 tm_zone or tzname values, and since most of these functions return
8823 pointers to static storage.
8824 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8825 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8826 Grow the critical sections to include not just invoking
8827 localtime/gmtime, but also accessing these functions' results
8828 including their tm_zone values if any, and any related TZ setting.
8829 (format_time_string): Last arg is now struct tm *, not struct tm **,
8830 so that the struct tm is saved in the critical section.
8831 All callers changed. Simplify allocation of initial buffer, partly
8832 motivated by the fact that memory allocation needs to be outside
8833 the critical section.
8835 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8837 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8838 with RESET_INTERVAL.
8840 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8841 Remove duplicated buffer name initialization.
8843 2012-05-02 Jim Meyering <jim@meyering.net>
8845 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8847 * xfns.c (x_window): Use xstrdup (Bug#11375).
8849 2012-05-02 Eli Zaretskii <eliz@gnu.org>
8851 * xdisp.c (pos_visible_p): If already at a newline from the
8852 display string before the 'while' loop, don't walk back the glyphs
8853 from it3.glyph_row. Solves assertion violation when the display
8854 string begins with a newline (egg.el). (Bug#11367)
8856 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8858 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8861 2012-05-01 Glenn Morris <rgm@gnu.org>
8863 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8864 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8865 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8866 All were removed before 23.1.
8868 * dispnew.c: Remove HAVE_LIBNCURSES test;
8869 it is always true on relevant platforms.
8871 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8872 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8874 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8876 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8878 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8879 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8882 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8884 Do not avoid creating empty evaporating overlays (Bug#9642).
8885 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8886 That is, do not delete an evaporating overlay if it becomes
8887 empty after its bounds are adjusted to fit within its buffer.
8888 This fix caused other problems, and I'm reverting it until we get
8889 to the bottom of them.
8891 2012-04-27 Chong Yidong <cyd@gnu.org>
8893 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8895 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8897 * xdisp.c (pos_visible_p): If the window start position is beyond
8898 ZV, start the display from buffer beginning. Prevents assertion
8899 violation in init_iterator when the minibuffer window is scrolled
8902 * window.c (window_scroll_pixel_based): Likewise.
8904 2012-04-27 Chong Yidong <cyd@gnu.org>
8906 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8908 2012-04-27 Glenn Morris <rgm@gnu.org>
8910 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8911 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8913 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8915 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8916 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
8918 2012-04-26 Eli Zaretskii <eliz@gnu.org>
8920 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8921 display element, check also the underlying string or buffer
8922 character. (Bug#11341)
8924 * w32menu.c: Include w32heap.h.
8925 (add_menu_item): If the call to AppendMenuW (via
8926 unicode_append_menu) fails, disable Unicode menus only if we are
8927 running on Windows 9X/Me.
8929 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8931 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8932 (xgetint): Add missing shift for LSB tags.
8934 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8936 * keyboard.c (read_char): Don't wipe echo area for select window
8937 events: These might get delayed via `mouse-autoselect-window'
8940 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8942 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8943 manipulation of :loaded-from data.
8945 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8947 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8948 now a cons (bug#11311).
8950 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8952 Do not create empty overlays with the evaporate property (Bug#9642).
8953 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8954 if it becomes empty after its bounds are adjusted to fit within
8955 its buffer. Without this fix, in a nonempty buffer (let ((o
8956 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8957 yields an empty overlay that has the evaporate property, which is
8958 not supposed to happen.
8960 Fix minor GTK3 problems found by static checking.
8961 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8962 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8963 (struct _EmacsFixedClass, emacs_fixed_get_type):
8964 Move decls here from emacsgtkfixed.h, since they needn't be public.
8965 (emacs_fixed_get_type): Now static.
8966 (emacs_fixed_class_init): Omit unused local.
8967 (emacs_fixed_child_type): Remove; unused.
8968 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8969 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8970 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8971 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8972 (EMACS_FIXED_GET_CLASS): Remove; unused.
8973 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8975 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8976 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8978 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8980 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8981 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8982 (__malloc_size_t, __malloc_ptrdiff_t):
8983 Remove. All uses removed, replaced by the definiens if needed,
8984 since we can assume C89 or better now.
8985 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8986 (protect_malloc_state, align, get_contiguous_space)
8987 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8988 (malloc_atfork_handler_child, malloc_enable_thread)
8989 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8990 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8991 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8992 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8993 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8994 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8995 Define using prototypes, not old style.
8996 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8997 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8998 (align): Don't assume that signed integer overflow wraps around.
8999 Omit unused local var.
9000 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9001 (_free_internal_nolock, memalign, mallochook, reallochook):
9002 Omit no-longer-needed casts.
9003 (valloc): Use getpagesize, not __getpagesize.
9004 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9005 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9007 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9009 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9011 Move functions from C to Lisp. Make non-blocking method calls
9012 the default. Implement further D-Bus standard interfaces.
9014 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9015 (QCdbus_request_name_allow_replacement)
9016 (QCdbus_request_name_replace_existing)
9017 (QCdbus_request_name_do_not_queue)
9018 (QCdbus_request_name_reply_primary_owner)
9019 (QCdbus_request_name_reply_in_queue)
9020 (QCdbus_request_name_reply_exists)
9021 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9022 (QCdbus_registered_serial, QCdbus_registered_method)
9023 (QCdbus_registered_signal): New Lisp objects.
9024 (XD_DEBUG_MESSAGE): Use sizeof.
9025 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9026 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9027 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9028 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9029 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9030 (xd_signature, xd_append_arg): Allow float for integer types.
9031 (xd_get_connection_references): New function.
9032 (xd_get_connection_address): Rename from xd_initialize.
9033 Return cached address.
9034 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9035 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9037 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9038 Return number of refcounts.
9039 (Fdbus_get_unique_name): Make stronger parameter check.
9040 (Fdbus_message_internal): New defun.
9041 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9042 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9043 (Fdbus_send_signal, Fdbus_register_service)
9044 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9045 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9046 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9047 (Vdbus_compiled_version, Vdbus_runtime_version)
9048 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9049 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9050 (Vdbus_message_type_signal): New defvars.
9051 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9054 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9056 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9057 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9058 Do not assume ptrdiff_t is the same width as 'int'.
9060 * alloc.c: Handle unusual debugging option combinations.
9061 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9062 since the two debugging options are incompatible.
9063 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9065 (mem_init, mem_insert, mem_insert_fixup):
9066 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9067 (NEED_MEM_INSERT): Remove; no longer needed.
9069 2012-04-22 Leo Liu <sdl.web@gmail.com>
9071 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9073 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9075 * sysdep.c [__FreeBSD__]: Minor cleanups.
9076 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9077 Use Emacs indenting style more consistently. Avoid some casts.
9078 Use 'double' consistently rather than mixing 'float' and 'double'.
9080 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9082 * sysdep.c (list_system_processes, system_process_attributes):
9083 Add implementation for FreeBSD (Bug#5243).
9085 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9087 * lisp.mk (lisp): Update.
9089 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9091 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9092 It is never used otherwise.
9094 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9096 * print.c (print_preprocess): Only check print_depth if print-circle
9098 (print_object): Check for cycles even when print-circle is nil and
9099 print-gensym is t, but only check print_depth if print-circle is nil.
9101 2012-04-20 Chong Yidong <cyd@gnu.org>
9103 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9104 set the status to "failed" and ensure that sentinel is run.
9106 2012-04-20 Glenn Morris <rgm@gnu.org>
9108 * process.c (Fset_process_inherit_coding_system_flag)
9109 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9110 (Fmake_network_process, Fmake_serial_process): Doc fix.
9112 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9114 * xdisp.c (string_buffer_position_lim): Limit starting position to
9116 (set_cursor_from_row): If called for a mode-line or header-line
9117 row, return zero immediately.
9118 (try_cursor_movement): If inside continuation line, don't back up
9119 farther than the first row after the header line, if any.
9120 Don't consider the header-line row as "partially visible", even if
9121 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9123 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9125 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9128 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9129 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9131 configure: new option --enable-gcc-warnings (Bug#11207)
9132 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9133 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9134 (ALL_CFLAGS): Use new macros rather than old.
9135 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9136 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9137 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9138 -Wunused-result, -Wunused-variable. This should go away once
9139 the Emacs and Gnulib regex code is merged.
9140 (xmalloc, xrealloc): Now static.
9142 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9144 * dired.c (Fsystem_groups): Remove unused local.
9146 2012-04-17 Glenn Morris <rgm@gnu.org>
9148 * dired.c (Fsystem_users): Doc fix.
9150 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9152 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9153 (syms_of_dired): Add them.
9155 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9157 Fix minor alloc.c problems found by static checking.
9158 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9159 New extern decls, to avoid calling undeclared functions.
9160 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9161 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9162 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9163 (NEED_MEM_INSERT): New macro.
9164 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9165 Remove one incorrect comment and fix another.
9167 Fix minor ralloc.c problems found by static checking.
9168 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9169 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9170 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9171 (r_alloc_sbrk): Now static.
9173 Improve ralloc.c interface checking.
9174 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9175 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9176 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9177 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9178 [REL_ALLOC]: ... to here, to check interface.
9179 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9180 Remove decls. This fixes an "It stinks!".
9182 * alloc.c (which_symbols): Fix alignment issue / type clash.
9184 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9186 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9187 (struct Lisp_Misc_Any): Likewise.
9188 (struct Lisp_Free): Likewise.
9189 * alloc.c (union aligned_Lisp_Symbol): Define.
9190 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9191 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9192 (union aligned_Lisp_Misc): Define.
9193 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9194 aligned_Lisp_Misc instead of union Lisp_Misc.
9195 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9197 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9199 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9200 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9201 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9202 * s/netbsd.h, s/sol2-6.h:
9203 Remove definition of GC_MARK_STACK, since the default now works.
9204 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9205 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9206 no longer the default.
9207 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9209 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9211 * lread.c (lisp_file_lexically_bound_p):
9212 Fix hang at ";-*-\n" (bug#11238).
9214 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9216 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9217 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9219 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9221 * nsterm.m (constrainFrameRect): Always constrain when there is only
9222 one screen (Bug#10962).
9224 2012-04-13 Ken Brown <kbrown@cornell.edu>
9226 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9228 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9230 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9232 2012-04-11 Daniel Colascione <dancol@dancol.org>
9234 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9235 against is gone. It's better to use vfork now so that when Cygwin
9236 gains a new, working vfork, we use it automatically (bug#10398).
9238 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9240 * window.c (save_window_save): Obey window-point-insertion-type.
9242 2012-04-11 Glenn Morris <rgm@gnu.org>
9244 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9246 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9248 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9250 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9252 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9253 (force_quit_count): New var.
9254 (handle_interrupt): Use it.
9256 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9258 * w32.c (w32_delayed_load): Record the full path of the library
9259 being loaded (bug#10424).
9261 2012-04-09 Glenn Morris <rgm@gnu.org>
9263 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9264 not just in the obarray, before snarfing them. (Bug#11036)
9266 * Makefile.in ($(leimdir)/leim-list.el):
9267 Pass EMACS rather than BUILT_EMACS.
9269 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9271 * process.c (make_process):
9272 * process.h: Add integer `gnutls_handshakes_tried' member to
9275 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9276 Add convenience `GNUTLS_LOG2i' macro.
9278 * gnutls.c (gnutls_log_function2i): Convenience log function.
9279 (emacs_gnutls_read): Use new log functions,
9280 `gnutls_handshakes_tried' process member, and
9281 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9282 attempts per process (connection).
9284 2012-04-09 Chong Yidong <cyd@gnu.org>
9286 * eval.c (Fuser_variable_p, user_variable_p_eh)
9287 (lisp_indirect_variable): Functions deleted.
9288 (Fdefvar): Caller changed.
9290 * callint.c (Finteractive, Fcall_interactively):
9291 * minibuf.c (Fread_variable): Callers changed.
9293 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9295 * xdisp.c (set_cursor_from_row): If the display string appears in
9296 the buffer at position that is closer to point than the position
9297 after the display string, display the cursor on the first glyph of
9298 the display string. Fixes cursor display when a 'display' text
9299 property immediately follows invisible text. (Bug#11094)
9301 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9303 composite.c: use 'double' consistently
9304 * composite.c (get_composition_id): Use 'double' consistently
9305 instead of converting 'float' to 'double' and vice versa; this is
9306 easier to understand and avoids a GCC warning.
9308 2012-04-09 Glenn Morris <rgm@gnu.org>
9310 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9311 preparation for dumping it with emacs. (Bug#4789)
9312 (leimdir): New variable.
9313 ($(leimdir)/leim-list.el): New rule.
9314 (emacs$(EXEEXT)): Depend on leim-list.el.
9316 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9317 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9318 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9320 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9322 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9325 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9327 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9328 Remove unused local variable.
9330 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9332 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9333 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9334 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9335 objects, as mark_maybe_pointer will catch them otherwise.
9336 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9337 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9339 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9341 Fix typo that broke non-Windows builds.
9342 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9344 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9346 Support building on MS-Windows with libxml2.
9348 * makefile.w32-in (OBJ2): Add xml.$(O).
9349 (GLOBAL_SOURCES): Add xml.c.
9350 ($(BLD)/xml.$(O)): New dependency list.
9352 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9353 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9354 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9355 [!WINDOWSNT]: New macros.
9356 (init_libxml2_functions, libxml2_loaded_p): New functions.
9357 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9358 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9359 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9360 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9362 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9363 Call init_libxml2_functions before calling libxml2 functions.
9364 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9366 * emacs.c: Don't include libxml/parser.h.
9367 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9368 xmlCleanupParser directly.
9370 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9372 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9374 * indent.c (Fvertical_motion): If there is a display string at
9375 point, use it.vpos to compute how many lines to backtrack after
9376 move_it_to point. (Bug#11133)
9378 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9380 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9381 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9382 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9383 macros related to unification of CJK characters. For the details,
9384 see the discussion following the message here:
9385 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9387 2012-04-04 Chong Yidong <cyd@gnu.org>
9389 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9391 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9393 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9394 instead of alloca. (Bug#11138)
9396 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9398 * w32menu.c (is_simple_dialog): Properly check lisp types.
9401 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9403 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9404 position we get to after a call to move_it_to fails the
9405 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9406 only if we wind up in a string from display property. (Bug#11063)
9408 * window.c (Fdelete_other_windows_internal): Invalidate the row
9409 and column information about mouse highlight, so that redisplay
9410 restores it after reallocating the glyph matrices. (Bug#7464)
9412 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9413 string comes from a `display' text property, use the buffer
9414 position of that property as if we actually saw that position in
9416 (move_it_by_lines): Remove the assertion that
9417 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9418 violated when there's a before-string at the beginning of a line.
9421 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9423 * xdisp.c (append_space_for_newline): If the default face was
9424 remapped, use the remapped face for the appended newline.
9425 (extend_face_to_end_of_line): Use the remapped default face for
9426 extending the face to the end of the line.
9427 (display_line): Call extend_face_to_end_of_line when the default
9428 face was remapped. (Bug#11068)
9430 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9432 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9434 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9436 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9438 2012-03-27 Glenn Morris <rgm@gnu.org>
9440 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9443 2012-03-26 Kenichi Handa <handa@m17n.org>
9445 * dispextern.h (struct glyph): Fix previous change. Change the
9446 bit length of glyphless.ch to 25 (Bug#11082).
9448 2012-03-26 Chong Yidong <cyd@gnu.org>
9450 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9451 (command_loop_1): Use it; inhibit selection update for
9452 handle-select-window too (Bug#8996).
9454 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9456 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9458 2012-03-25 Kenichi Handa <handa@m17n.org>
9460 * dispextern.h (struct glyph): Change the bit length of
9461 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9463 2012-03-24 Eli Zaretskii <eliz@gnu.org>
9465 * s/ms-w32.h (tzname): Include time.h before redirecting to
9466 _tzname. Fixes the MSVC build. (Bug#9960)
9468 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9470 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9473 * xterm.c (XTread_socket): Only modify handling_signal if
9474 !SYNC_INPUT. (Bug#11080)
9476 2012-03-23 Eli Zaretskii <eliz@gnu.org>
9478 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9479 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9480 when fetching a multibyte character consumes more bytes than
9481 CHAR_BYTES returns, due to unification of CJK characters in
9482 string_char. (Bug#11073)
9484 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9486 * process.c (wait_reading_process_output): Handle pty disconnect
9487 by refraining from sending oneself a SIGCHLD (bug#10933).
9489 2012-03-22 Chong Yidong <cyd@gnu.org>
9491 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9493 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9494 Mark string as coming from a prefix property.
9495 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9496 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9498 2012-03-21 Chong Yidong <cyd@gnu.org>
9500 * xfaces.c (Vface_remapping_alist): Doc fix.
9502 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9504 * w32proc.c (Fw32_set_console_codepage)
9505 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9508 2012-03-20 Chong Yidong <cyd@gnu.org>
9510 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9511 to reflect default non-nil value of redisplay-dont-pause.
9513 2012-03-19 Kenichi Handa <handa@m17n.org>
9515 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9516 it fit in a valid range (Bug#11003).
9518 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9520 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9521 that is not from display property, accept the row as a "cursor
9522 row" if one of the string's character has a non-nil `cursor'
9523 property. Fixes cursor positioning when there are newlines in
9524 overlay strings, e.g. in icomplete.el. (Bug#11035)
9526 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9528 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9530 2012-03-12 Chong Yidong <cyd@gnu.org>
9532 * eval.c (inhibit_lisp_code): Rename from
9533 inhibit_window_configuration_change_hook; move from window.c.
9535 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9536 * window.c (run_window_configuration_change_hook)
9537 (syms_of_window): Callers changed.
9539 2012-03-11 Chong Yidong <cyd@gnu.org>
9541 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9543 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9545 2012-03-10 Chong Yidong <cyd@gnu.org>
9547 * frame.c (other_visible_frames): Don't assume the selected frame
9548 is visible (Bug#10955).
9550 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9552 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9554 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9556 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9557 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9560 2012-03-03 Glenn Morris <rgm@gnu.org>
9562 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9564 2012-03-02 Eli Zaretskii <eliz@gnu.org>
9566 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9567 position past the first glyph_row that ends at ZV. (Bug#10902)
9568 (redisplay_window, next_element_from_string): Fix typos in
9570 (redisplay_window): Pass to move_it_vertically the margin in
9571 pixels, not in screen lines.
9573 2012-03-02 Glenn Morris <rgm@gnu.org>
9575 * buffer.c (buffer-list-update-hook): Doc fix.
9577 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9579 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9580 push_it before setting up the iterator for the first overlay
9581 string, even if we have an empty string loaded.
9582 (next_overlay_string): If there's an empty string on the iterator
9583 stack, pop the stack. (Bug#10903)
9585 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9587 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9588 Suggested by Stefan Monnier in
9589 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9590 * alloc.c (widen_to_Lisp_Object): New static function.
9591 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9592 and widening them to Lisp_Objects. This would work even if
9593 USE_LSB_TAG is defined and wide integers are used, which might
9594 happen in a future version of Emacs.
9596 2012-02-25 Chong Yidong <cyd@gnu.org>
9598 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9601 * xselect.c (Fx_selection_exists_p): Doc fix.
9602 (x_clipboard_manager_save_all): Print an informative message
9603 before saving to clipboard manager.
9605 2012-02-24 Chong Yidong <cyd@gnu.org>
9607 * keyboard.c (process_special_events): Handle all X selection
9608 requests in kbd_buffer, not just the next one (Bug#8869).
9610 2012-02-23 Chong Yidong <cyd@gnu.org>
9612 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9613 call when setting menu-bar-lines and tool-bar-lines parameters.
9614 (unwind_create_frame_1): New helper function.
9616 * window.c (inhibit_window_configuration_change_hook): New var.
9617 (run_window_configuration_change_hook): Obey it.
9618 (syms_of_window): Initialize it.
9620 2012-02-22 Chong Yidong <cyd@gnu.org>
9622 * xterm.c (x_draw_image_relief): Add missing type check for
9623 Vtool_bar_button_margin (Bug#10743).
9625 2012-02-21 Chong Yidong <cyd@gnu.org>
9627 * fileio.c (Vfile_name_handler_alist): Doc fix.
9629 * buffer.c (Fget_file_buffer): Protect against invalid file
9630 handler return value.
9632 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9634 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9635 when computing $valmask.
9637 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9638 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9639 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9640 It's useless in that case, and it can cause problems on hosts
9641 that allocate halves of EMACS_INT values separately.
9642 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9643 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9644 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9645 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9646 it avoids undefined behavior on hosts where shifting right by more
9647 than the word width has undefined behavior.
9649 2012-02-19 Chong Yidong <cyd@gnu.org>
9651 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9652 (Funhandled_file_name_directory, Ffile_name_as_directory)
9653 (Fdirectory_file_name, Fexpand_file_name)
9654 (Fsubstitute_in_file_name): Protect against invalid file handler
9655 return values (Bug#10845).
9657 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9659 * .gdbinit (pitx): Fix incorrect references to fields of the
9662 2012-02-17 Chong Yidong <cyd@gnu.org>
9664 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9666 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9668 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9669 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9671 2012-02-15 Chong Yidong <cyd@gnu.org>
9673 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9674 marked as special. Also, starting docstrings with * is obsolete.
9676 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9678 * gnutls.c (emacs_gnutls_write): Fix last change.
9680 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9682 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9685 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9687 * keymap.c (Fsingle_key_description): Handle char ranges.
9689 2012-02-12 Chong Yidong <cyd@gnu.org>
9691 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9692 as that creates a dangerous corner case.
9694 * window.c (Fdelete_window_internal): Invalidate the mouse
9695 highlight (Bug#9904).
9697 2012-02-12 Glenn Morris <rgm@gnu.org>
9699 * xselect.c (Fx_own_selection_internal)
9700 (Fx_get_selection_internal, Fx_disown_selection_internal)
9701 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9702 * nsselect.m (Fx_own_selection_internal)
9703 (Fx_disown_selection_internal, Fx_selection_exists_p)
9704 (Fx_selection_owner_p, Fx_get_selection_internal):
9705 Sync docs and argument specs with the xselect.c versions.
9707 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9709 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9711 2012-02-11 Eli Zaretskii <eliz@gnu.org>
9713 * w32select.c (Fx_selection_exists_p): Sync doc string and
9714 argument list with xselect.c. (Bug#10783)
9716 * w16select.c (Fx_selection_exists_p): Sync doc string and
9717 argument list with xselect.c. (Bug#10783)
9719 2012-02-10 Glenn Morris <rgm@gnu.org>
9721 * fns.c (Fsecure_hash): Doc fix.
9723 2012-02-09 Kenichi Handa <handa@m17n.org>
9725 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9727 2012-02-07 Chong Yidong <cyd@gnu.org>
9729 * buffer.c (Fbuffer_local_variables)
9730 (buffer_lisp_local_variables): Handle unbound vars correctly;
9731 don't let Qunbound leak into Lisp.
9733 2012-02-07 Glenn Morris <rgm@gnu.org>
9735 * image.c (Fimagemagick_types): Doc fix.
9737 * image.c (imagemagick-render-type): Change it from a lisp object
9738 to an integer. Move the doc here from the lisp manual.
9739 Treat all values not equal to 0 the same.
9741 2012-02-06 Chong Yidong <cyd@gnu.org>
9743 * doc.c (store_function_docstring): Avoid applying docstring of
9744 alias to base function (Bug#2603).
9746 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9748 * .gdbinit (pp1, pv1): Remove redundant defines.
9751 2012-02-04 Chong Yidong <cyd@gnu.org>
9753 * nsterm.m: Declare a global (Bug#10694).
9755 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9757 * w32.c (get_emacs_configuration_options):
9758 Include --enable-checking, if specified, in the return value.
9760 2012-02-04 Martin Rudalics <rudalics@gmx.at>
9762 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9763 after rounding frame sizes. (Bug#9723)
9765 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9767 * keyboard.c (adjust_point_for_property): Don't position point
9768 before BEGV. (Bug#10696)
9770 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9772 Handle overflow when computing char display width (Bug#9496).
9773 * character.c (char_width): Return EMACS_INT, not int.
9774 (char_width, c_string_width): Check for overflow when
9775 computing the width; this is possible now that individual
9776 characters can have unbounded width. Problem introduced
9777 by merge from Emacs 23 on 2012-01-19.
9779 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
9781 * dbusbind.c (Fdbus_register_method): Mention the return value
9782 :ignore in the docstring.
9784 2012-02-02 Glenn Morris <rgm@gnu.org>
9786 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9788 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9789 Unconditionally set to t. (Bug#10673)
9790 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9791 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9792 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9794 2012-02-02 Kenichi Handa <handa@m17n.org>
9796 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9797 0, do not call append_composite_glyph.
9799 2012-02-02 Kenichi Handa <handa@m17n.org>
9801 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9803 (x_produce_glyphs): If the component of a composition is a null
9804 string, set it->pixel_width to 1 to avoid zero-width glyph.
9806 2012-02-01 Eli Zaretskii <eliz@gnu.org>
9808 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9809 first 2 arguments are identical. This makes inserting large
9810 output from a subprocess an order of magnitude faster on
9811 MS-Windows, where all sbrk'ed memory is always contiguous.
9813 2012-01-31 Glenn Morris <rgm@gnu.org>
9815 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9816 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9817 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9819 2012-01-29 Glenn Morris <rgm@gnu.org>
9821 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9823 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9825 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9827 2012-01-28 Chong Yidong <cyd@gnu.org>
9829 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9831 2012-01-26 Chong Yidong <cyd@gnu.org>
9833 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9835 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9836 repeat counts (Bug#10507).
9838 2012-01-26 Glenn Morris <rgm@gnu.org>
9840 * lread.c (syms_of_lread): Doc fix.
9842 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9844 * coding.c (encode_designation_at_bol): Change return value to
9847 2012-01-25 Chong Yidong <cyd@gnu.org>
9849 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9851 2012-01-21 Chong Yidong <cyd@gnu.org>
9853 * floatfns.c (Fcopysign): Make the second argument non-optional,
9854 since nil is not allowed anyway.
9856 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9858 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9859 (send_process): Likewise.
9861 2012-01-19 Martin Rudalics <rudalics@gmx.at>
9863 * window.c (save_window_save, Fcurrent_window_configuration)
9864 (Vwindow_persistent_parameters): Do not use Qstate.
9865 Rewrite doc-strings.
9867 2012-01-19 Kenichi Handa <handa@m17n.org>
9869 * character.c (char_width): New function.
9870 (Fchar_width, c_string_width, lisp_string_width):
9871 Use char_width (Bug#9496).
9873 2012-01-16 Martin Rudalics <rudalics@gmx.at>
9875 * window.c (Vwindow_persistent_parameters): New variable.
9876 (Fset_window_configuration, save_window_save): Handle persistent
9879 2012-01-14 Eli Zaretskii <eliz@gnu.org>
9881 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9882 thrashing the stack of the thread. (Bug#9087)
9884 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9886 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9888 2012-01-11 Eli Zaretskii <eliz@gnu.org>
9890 * xdisp.c (rows_from_pos_range): Handle the case where the
9891 highlight ends on a newline. (Bug#10464)
9892 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9893 he end column for display of highlight that ends on a newline
9896 2012-01-11 Glenn Morris <rgm@gnu.org>
9898 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9899 from load-path also when installation-directory is nil. (Bug#10208)
9901 2012-01-10 Glenn Morris <rgm@gnu.org>
9903 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9905 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9906 Update template values to be closer to their typical values these days.
9908 2012-01-09 Eli Zaretskii <eliz@gnu.org>
9910 * xdisp.c (rows_from_pos_range): Accept additional argument
9911 DISP_STRING, and accept any glyph in a row whose object is that
9912 string as eligible for mouse highlight. Fixes mouse highlight of
9913 display strings from overlays. (Bug#10464)
9915 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
9917 emacs: fix an auto-save permissions race condition (Bug#10400)
9918 * fileio.c (auto_saving_dir_umask): New static var.
9919 (Fmake_directory_internal): Use it.
9920 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9921 creating the directory. The old code temporarily assigns
9922 too-generous permissions to the directory.
9923 (do_auto_save_eh): Clear it.
9924 (Fdo_auto_save): Catch all errors, not just file errors, so
9925 that the var is always cleared.
9927 2012-01-07 Eli Zaretskii <eliz@gnu.org>
9929 * search.c (scan_buffer): Pass character positions to
9930 know_region_cache, not byte positions. (Bug#6540)
9932 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
9934 * w32.c (sys_rename): Report EXDEV when rename of a directory
9935 fails because the target is on another logical disk. (Bug#10284)
9937 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9939 * xterm.c (x_embed_request_focus): New function.
9941 * xterm.h: Add prototype.
9943 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9945 2012-01-05 Glenn Morris <rgm@gnu.org>
9947 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9949 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9951 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9952 Load gnutls_transport_set_lowat only if GnuTLS version is below
9954 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9955 GnuTLS versions below 2.11.1.
9957 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9959 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9960 to the doc string advising against its use for altering the way
9961 windows are scrolled.
9963 2011-12-28 Kenichi Handa <handa@m17n.org>
9965 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9966 coding-system ASCII compatible only when it does not produce BOM
9967 on encoding (Bug#10383).
9969 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9971 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9973 (create_and_show_popup_menu): Always use menu_position_func for
9976 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9978 * callint.c (Fcall_interactively): Don't truncate prompt string.
9980 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9982 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9983 property that ends at ZV, so that the bidi iteration could be
9984 resumed from there (after widening). (Bug#10360)
9986 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9988 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9990 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9992 * nsterm.m (x_free_frame_resources):
9993 Release f->output_data.ns->miniimage.
9994 (ns_index_color): Fix indentation. Do not retain
9995 color_table->colors[i].
9997 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10000 * nsfns.m (x_set_background_color): Assign return value from
10001 ns_index_color to face-background instead of NSColor*.
10002 (ns_implicitly_set_icon_type): Fix indentation.
10003 Change assignment in for loop to comparison.
10005 * emacs.c (ns_pool): New variable.
10006 (main): Assign ns_pool.
10007 (Fkill_emacs): Call ns_release_autorelease_pool.
10009 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10010 autorelease fdesc, release fdAttrs and tdict.
10011 (ns_get_covering_families): Release charset.
10012 (ns_findfonts): Release NSFontDescriptor created with new.
10013 (ns_uni_to_glyphs): Fix indentation.
10014 (setString): Release attrStr before assigning new value.
10016 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10018 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10020 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10021 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10023 2011-12-18 David Reitter <reitter@cmu.edu>
10025 * nsterm.m (ns_term_init): Subscribe for notifications
10026 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10027 to method trackingNotification in EmacsMenu.
10029 * nsmenu.m (trackingMenu): New variable.
10030 (trackingNotification): New method (from Aquamacs).
10031 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10032 from Aquamacs (Bug#7030).
10034 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10036 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10037 (symbol_to_nsstring): Fix indentation.
10038 (ns_symbol_to_pb): New function.
10039 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10040 (Fns_rotate_cut_buffers_internal): Remove.
10041 (Fns_store_selection_internal): Rename from
10042 Fns_store_cut_buffer_internal.
10043 (ns_get_foreign_selection, Fx_own_selection_internal)
10044 (Fx_disown_selection_internal, Fx_selection_exists_p)
10045 (Fns_get_selection_internal, Fns_store_selection_internal):
10046 Use ns_symbol_to_pb and check if return value is nil.
10047 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10048 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10049 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10050 renamed to Sns_store_selection_internal.
10051 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10052 and remove this function.
10053 (ns_handle_selection_clear): Remove, never used.
10054 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10057 2011-12-17 Ken Brown <kbrown@cornell.edu>
10059 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10060 GID is unknown (Bug#10257).
10062 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10064 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10065 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10066 which caused a build failure on GNU/Linux IA-64. This problem was
10067 introduced by my 2011-10-07 patch.
10069 2011-12-15 Juri Linkov <juri@jurta.org>
10071 * image.c (imagemagick_error): New function. (Bug#10112)
10072 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10073 Use `imagemagick_error' where ImageMagick functions return
10075 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10078 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10080 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10081 fill background (Bug#8992).
10083 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10085 * window.c (Vwindow_combination_resize)
10086 (Vwindow_combination_limit): Use t instead of non-nil in
10088 (Vrecenter_redisplay): Add first sentence of doc-string on
10090 (Frecenter): Fix doc-string typo.
10092 2011-12-11 Kenichi Handa <handa@m17n.org>
10094 * coding.c (Funencodable_char_position): Pay attention to the
10095 buffer text relocation (Bug#9389).
10097 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10099 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10100 gtk_init (Bug#10100).
10102 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10104 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10105 IT->string is nil. (Bug#10263)
10107 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10109 * nsterm.h (x_free_frame_resources): Declare.
10111 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10112 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10114 * nsterm.h (ns_get_defaults_value): Declare.
10116 * nsterm.m (ns_default): Call ns_get_defaults_value.
10118 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10120 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10123 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10125 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10126 that where the value of an _OBJC_* symbol points to is in the .bss
10127 section (Bug#10240).
10129 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10131 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10132 after the loop to call ccl_driver at least once (Bug#8619).
10134 2011-12-08 Kenichi Handa <handa@m17n.org>
10136 * ftfont.c (get_adstyle_property): Fix previous change
10139 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10141 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10142 dirs from the default value of EMACSLOADPATH (bug#10208).
10144 2011-12-07 Glenn Morris <rgm@gnu.org>
10146 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10147 installation and source directories as well. (Bug#10208)
10149 2011-12-06 Chong Yidong <cyd@gnu.org>
10151 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10153 2011-12-06 Glenn Morris <rgm@gnu.org>
10155 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10156 as an error, not just -1. (Bug#10217)
10158 2011-12-05 Chong Yidong <cyd@gnu.org>
10160 * keyboard.c (process_special_events): New function.
10161 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10163 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10165 * coding.c (encode_designation_at_bol): Don't use uninitialized
10166 local variable (Bug#9318).
10168 2011-12-05 Kenichi Handa <handa@m17n.org>
10170 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10171 return Qnil (Bug#8046, Bug#10193).
10173 2011-12-05 Kenichi Handa <handa@m17n.org>
10175 * coding.c (encode_designation_at_bol): New args charbuf_end and
10176 dst. Return the number of produced bytes. Callers changed.
10177 (coding_set_source): Return how many bytes coding->source was
10179 (coding_set_destination): Return how many bytes
10180 coding->destination was relocated.
10181 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10182 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10184 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10186 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10187 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10190 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10192 The following changes are to fix Bug#9318.
10194 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10195 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10196 (encode_coding_iso_2022, encode_coding_sjis)
10197 (encode_coding_big5, encode_coding_charset): Use the above macros.
10199 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10201 * lisp.h (process_quit_flag): Fix external declaration.
10203 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10205 Don't macro-inline non-performance-critical code.
10206 * eval.c (process_quit_flag): New function.
10207 * lisp.h (QUIT): Use it.
10209 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10211 * nsfns.m (get_geometry_from_preferences): New function.
10212 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10214 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10216 * emacs.c (Qkill_emacs): Define.
10217 (syms_of_emacs): Initialize it.
10218 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10219 Qquit_flag to `kill-emacs' instead.
10220 (quit_throw_to_read_char): Add parameter `from_signal'.
10221 All callers changed. Call Fkill_emacs if requested and safe.
10222 * lisp.h (QUIT): Call Fkill_emacs if requested.
10224 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10226 * widget.c (update_wm_hints): Return if wmshell is null.
10227 (widget_update_wm_size_hints): New function.
10229 * widget.h (widget_update_wm_size_hints): Declare.
10231 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10232 widget_update_wm_size_hints (Bug#10104).
10234 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10236 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10237 before a newline, prepare the bidi iterator for consuming the
10238 newline, and keep the current paragraph direction. (Bug#10183)
10239 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10241 2011-12-02 Juri Linkov <juri@jurta.org>
10243 * search.c (Fword_search_regexp): New Lisp function created from
10244 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10245 (Fword_search_backward, Fword_search_forward)
10246 (Fword_search_backward_lax, Fword_search_forward_lax):
10247 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10248 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10250 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10252 * fileio.c (Finsert_file_contents): Move after-change-function call
10253 to before the "handled:" label, since all "goto handled" appear in
10254 cases where the *-change-functions have already been properly called
10257 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10259 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10260 waiting for input. (Bug#10169)
10262 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10264 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10265 verifies glyph row's hash code--we have just reallocated the
10266 glyphs, so their contents can be complete garbage. (Bug#10164)
10268 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10270 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10272 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10274 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10275 attributes are tested _before_ calling verify_row_hash, to protect
10276 against GCC re-ordering of the tests. (Bug#10164)
10278 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10280 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10282 * xterm.c (handle_one_xevent): Only set async_visible and friends
10283 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10284 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10285 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10287 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10289 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10290 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10291 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10292 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10293 All uses changed to use GCPRO1 etc.
10294 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10295 Revert to old implementation (i.e., before 2011-03-11).
10297 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10299 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10300 of scroll runs so as to avoid assigning disabled bogus rows and
10301 unnecessary graphics copy operations.
10303 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10305 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10306 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10307 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10308 (malloc, free, realloc, calloc): Redirect to e_* only when
10311 * lisp.h (GCTYPEBITS): Move before first use.
10312 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10313 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10314 this macro definition.
10316 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10319 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10321 * gtkutil.c (xg_create_frame_widgets):
10322 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10323 present with Gtk+ 2.0.
10325 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10327 * fileio.c (Finsert_file_contents): Undo previous change; see
10328 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10330 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10332 Rename locals to avoid shadowing.
10333 * fileio.c (Finsert_file_contents):
10334 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10335 * process.c (wait_reading_process_output):
10336 Rename inner 'proc' to 'p' to avoid shadowing.
10337 Indent for consistency with usual Emacs style.
10339 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10341 * xdisp.c (redisplay_window): If cursor row is not fully visible
10342 after recentering, and scroll-conservatively is set to a large
10343 number, scroll window by a few more lines to make the cursor fully
10344 visible and out of scroll-margin. (Bug#10105)
10345 (start_display): Don't move to the next line if the display should
10346 start at a newline that is part of a display vector or an overlay
10347 string. (Bug#10119)
10349 2011-11-24 Juri Linkov <juri@jurta.org>
10351 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10352 after the `MagickPingImage' call. (Bug#10112)
10354 2011-11-23 Chong Yidong <cyd@gnu.org>
10356 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10358 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10360 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10361 making another buffer current. (Bug#10114)
10363 2011-11-23 Glenn Morris <rgm@gnu.org>
10365 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10367 2011-11-23 Chong Yidong <cyd@gnu.org>
10369 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10370 using it (Bug#5984).
10372 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10374 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10375 and header-lines, as they don't have one computed for them.
10378 * .gdbinit (prow): Make displayed values more self-explaining.
10379 Add row's hash code.
10381 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10383 * process.c (wait_reading_process_output): Fix asynchrounous
10384 GnuTLS socket handling on some versions of the GnuTLS library.
10385 (wait_reading_process_output): Add comment and URL.
10387 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10389 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10391 2011-11-21 Chong Yidong <cyd@gnu.org>
10393 * window.c (Fnext_window, Fprevious_window): Doc fix.
10395 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10397 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10399 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10401 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10403 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10405 * window.c (Fset_window_combination_limit): Rename argument
10407 (Vwindow_combination_limit): Remove "status" from doc-string.
10409 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10411 * m/ibms390.h: Remove.
10412 * m/ibms390x.h: Don't include "ibms390.h".
10414 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10416 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10417 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10419 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10421 * casetab.c (Fset_case_table):
10422 * charset.c (Fcharset_after): Fix typos.
10424 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10426 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10427 Otherwise, valgrind does not work on some platforms.
10428 Problem reported by Andreas Schwab in
10429 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10430 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10431 is set, removing the need for VIRT_ADDRESS_VARIES.
10432 (PURE_P): Use a more-efficient implementation that needs just one
10433 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10434 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10435 to 4 (xorl, subq, cmpq, setbe).
10436 * alloc.c (pure): Always extern now, since that's the
10437 VIRT_ADDR_VARIES behavior.
10438 (PURE_POINTER_P): Use a single comparison, not two, for
10439 consistency with the new puresize.h.
10440 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10441 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10442 Remove VIRT_ADDR_VARIES no longer needed.
10444 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10446 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10447 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10448 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10449 behave as if the cursor position were at the window margin.
10451 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10452 and the cursor position is out of bounds, behave as if the cursor
10453 position were at the window margin. (Bug#10075)
10455 2011-11-18 Chong Yidong <cyd@gnu.org>
10457 * window.c (Fwindow_combination_limit): Make first argument
10458 non-optional, since it is meaningless for live windows like the
10461 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10463 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10465 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10467 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10468 (graft_intervals_into_buffer): Simplify.
10470 2011-11-18 Eli Zaretskii <eliz@gnu.org>
10472 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10473 hash values of the two rows.
10474 (copy_row_except_pointers): Preserve the used[] arrays and the
10475 hash values of the two rows. (Bug#10035)
10476 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10478 * xdisp.c (row_hash): New function, body extracted from
10479 compute_line_metrics.
10480 (compute_line_metrics): Call row_hash, instead of computing the
10483 * dispnew.c (verify_row_hash): Call row_hash for computing the
10484 hash code of a row, instead of duplicating code from xdisp.c.
10486 * dispextern.h (row_hash): Add prototype.
10488 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10490 * frame.c (delete_frame): Don't delete the terminal when the last
10491 X frame is closed if emacs is built with GTK toolkit.
10493 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
10495 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10497 2011-11-17 Martin Rudalics <rudalics@gmx.at>
10499 * window.c (Vwindow_splits): Rename to
10500 Vwindow_combination_resize. Suggested by Juri Linkov.
10501 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10504 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10506 * nsfns.m (Fns_font_name):
10507 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10509 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10511 * window.h (window): Rename slot "nest" to "combination_limit".
10512 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10513 (Fset_window_nest): Rename to Fset_window_combination_limit.
10514 (Vwindow_nest): Rename to Vwindow_combination_limit.
10515 (recombine_windows, make_parent_window, make_window)
10516 (Fsplit_window_internal, saved_window)
10517 (Fset_window_configuration, save_window_save): Rename all
10518 occurrences of window_nest to window_combination_limit.
10520 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10522 * image.c (imagemagick_load_image): Fix typo.
10524 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10526 * xdisp.c (display_line): Move the call to
10527 highlight_trailing_whitespace before the call to
10528 compute_line_metrics, since the latter needs to see the final
10529 faces of all the glyphs to compute ROW's hash value.
10530 Fixes assertion violations in row_equal_p. (Bug#10035)
10532 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10534 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10535 just return (bug#10044).
10537 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10539 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10540 with user-defined heap size. Bump the default size of the temacs
10541 heap to 27MB, to avoid memory warning when running temacs.
10542 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10544 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10545 current_matrix and desired_matrix. (Bug#9990)
10546 (verify_row_hash) [XASSERTS]: New function.
10547 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10548 that the hash value of glyph rows is correct.
10550 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10552 * window.h (window): Remove splits slot.
10553 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10554 (Fdelete_other_windows_internal, make_parent_window)
10555 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10556 (Fset_window_configuration, save_window_save): Don't deal with
10557 split status of windows.
10558 (saved_window): Remove splits slot.
10559 (Vwindow_splits): Rewrite doc-string.
10561 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10563 * xfns.c (unwind_create_frame):
10564 * nsfns.m (unwind_create_frame):
10565 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10566 Vframe_list (Bug#9999).
10568 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10570 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10572 2011-11-11 Kenichi Handa <handa@m17n.org>
10574 * callproc.c (Fcall_process): Set the member dst_multibyte of
10577 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10579 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10580 avoid a crash (bug#9496).
10582 2011-11-09 Chong Yidong <cyd@gnu.org>
10584 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10585 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10587 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10589 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10591 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10593 Avoid some portability problems by eschewing 'extern inline' functions.
10594 The trivial performance wins aren't worth the portability hassles; see
10595 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10597 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10598 (window_box_width, window_box_left, window_box_left_offset)
10599 (window_box_right, window_box_right_offset): Undo previous change,
10600 by removing the "extern"s.
10601 * intervals.c (adjust_intervals_for_insertion)
10602 (adjust_intervals_for_deletion): Undo previous change,
10603 making these static again.
10604 (offset_intervals, temp_set_point_both, temp_set_point)
10605 (copy_intervals_to_string): No longer inline.
10606 * xdisp.c (window_text_bottom_y, window_box_width)
10607 (window_box_height, window_box_left_offset)
10608 (window_box_right_offset, window_box_left, window_box_right)
10609 (window_box): No longer inline.
10611 2011-11-08 Chong Yidong <cyd@gnu.org>
10613 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10614 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10615 Signal an error if not a live window.
10616 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10617 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10619 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
10621 * lisp.h (syms_of_abbrev): Remove declaration.
10622 Reported by CHENG Gao <chenggao@royau.me>.
10624 2011-11-07 Eli Zaretskii <eliz@gnu.org>
10626 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10627 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10628 of temacs in GUI mode.
10630 2011-11-07 Martin Rudalics <rudalics@gmx.at>
10632 * window.h: Declare delete_all_child_windows instead of
10633 delete_all_subwindows.
10634 * window.c (Fwindow_nest, Fset_window_nest)
10635 (Fset_window_new_total, Fset_window_new_normal)
10636 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10637 (delete_all_subwindows): Rename to delete_all_child_windows.
10638 (Fdelete_other_windows_internal, Fset_window_configuration):
10639 Call delete_all_child_windows instead of delete_all_subwindows.
10640 * frame.c (delete_frame): Call delete_all_child_windows instead
10641 of delete_all_subwindows.
10643 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10645 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10646 This is also needed for porting to any host where GC_MARK_STACK is
10647 not GC_MAKE_GCPROS_NOOPS.
10648 (which_symbols): Use it.
10650 2011-11-07 Kenichi Handa <handa@m17n.org>
10652 * coding.c (coding_set_destination): Check coding->src_pos only
10653 when coding->src_object is a buffer (bug#9910).
10655 * process.c (send_process): Set the member src_multibyte of coding
10656 to 0 (bug#9911) when sending a unibyte text.
10658 * callproc.c (Fcall_process): Set the member src_multibyte of
10659 process_coding to 0 (bug#9912).
10661 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10663 * xmenu.c (cleanup_widget_value_tree): New function.
10664 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10665 calling free_menubar_widget_value_tree directly (Bug#9830).
10667 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10669 Fix some portability problems with 'inline'.
10670 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10671 (window_box_width, window_box_left, window_box_left_offset)
10672 (window_box_right, window_box_right_offset): Declare extern.
10673 Otherwise, these inline functions do not conform to C99 and
10674 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10675 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10676 * intervals.c (adjust_intervals_for_insertion)
10677 (adjust_intervals_for_deletion): Now extern, because otherwise the
10678 extern inline functions 'offset_intervals' couldn't refer to it.
10679 (static_offset_intervals): Remove.
10680 (offset_intervals): Rewrite using the old contents of
10681 static_offset_intervals. The old version didn't conform to C99
10682 because an extern inline function contained a reference to an
10683 identifier with static linkage.
10685 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10687 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10690 2011-11-06 Eli Zaretskii <eliz@gnu.org>
10692 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10693 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10694 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10695 return Qleft_to_right.
10697 2011-11-06 Chong Yidong <cyd@gnu.org>
10699 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10700 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10701 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10702 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10703 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10704 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10705 (Fwindow_vscroll): Doc fix.
10706 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10707 argument, since it makes no sense to pass a live window and for
10708 consistency with window-child.
10710 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10712 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10715 2011-11-05 Jason Rumney <jasonr@gnu.org>
10717 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10718 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10720 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10721 bitwise arithmetic preventing use of unicode-sip and non-truetype
10724 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10726 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10729 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10730 initialization code to keep similarity to xfns.c after changes
10733 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10735 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10736 (unwind_create_frame): New function (Bug#9943).
10737 (Fx_create_frame): Restructure code to be more similar to the one in
10738 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10739 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10740 Move terminal->reference_count++ just before making the frame official
10743 * nsterm.m (x_free_frame_resources): New function.
10744 (x_destroy_window): Move code to x_free_frame_resources.
10746 * xfns.c (unwind_create_frame): Fix comment.
10747 (Fx_create_frame, x_create_tip_frame):
10748 Move terminal->reference_count++ just before making the frame
10749 official. Move initialization of image_cache_refcount and
10750 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10752 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10754 Support MSVC build with newer versions of Visual Studio.
10755 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10756 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10759 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10760 which are not supported by MSVC.
10761 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10762 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10764 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10765 types in bitfields.
10766 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10768 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10770 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
10772 Support MSVC build with newer versions of Visual Studio.
10773 * w32.c: Don't include w32api.h for MSVC.
10774 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10776 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10777 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10778 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10779 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10781 (alloca) [_MSC_VER]: Define to _alloca.
10783 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10785 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10787 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10789 * xdisp.c (note_mouse_highlight): If either of
10790 previous/next-single-property-change returns nil, treat that as
10791 the beginning or the end of the buffer. (Bug#9955)
10793 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10795 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10796 label is not null (Bug#9951).
10797 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10800 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10802 * window.c (Fwindow_body_size): Mention in the doc string that the
10803 return value is in frame's canonical units. (Bug#9949)
10805 2011-11-03 Eli Zaretskii <eliz@gnu.org>
10807 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10809 * w32fns.c (unwind_create_frame): If needed, free the glyph
10810 matrices of the partially constructed frame. (Bug#9943)
10811 * xfns.c (unwind_create_frame): Likewise.
10813 2011-11-01 Eli Zaretskii <eliz@gnu.org>
10815 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10816 Don't stop backward scan on the continuation glyph, even though
10817 its CHARPOS is positive.
10818 (mouse_face_from_buffer_pos, note_mouse_highlight):
10819 Rename cover_string to disp_string.
10821 2011-11-01 Martin Rudalics <rudalics@gmx.at>
10823 * window.c (temp_output_buffer_show): Don't use
10824 Vtemp_buffer_show_specifiers.
10825 (Vtemp_buffer_show_specifiers): Remove unused variable.
10827 2011-10-30 Eli Zaretskii <eliz@gnu.org>
10829 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10830 past the beginning of the current glyph matrix.
10832 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
10834 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10835 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10836 HAVE_GTK3 (Bug#9869).
10838 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10839 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10841 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10843 * xterm.c: Declare x_handle_net_wm_state to return int.
10844 (handle_one_xevent): Check if we are iconified but don't have
10845 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10846 (get_current_wm_state): Return non-zero if not hidden,
10847 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10848 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10849 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10850 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10852 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10854 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10855 so that this new function doesn't get optimized away by a
10856 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10858 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10860 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10862 2011-10-29 Eli Zaretskii <eliz@gnu.org>
10864 Fix the `xbytecode' command.
10865 * .gdbinit (xprintbytestr): New command.
10866 (xwhichsymbols): Rename from `which'; all callers changed.
10867 (xbytecode): Print the byte-code string as well.
10869 2011-10-29 Kim Storm <storm@cua.dk>
10871 * alloc.c (which_symbols): New function.
10873 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10875 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10878 2011-10-29 Glenn Morris <rgm@gnu.org>
10880 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10881 Not clear what it was for, and it causes various bugs. (Bug#9839)
10883 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10885 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10886 possible random value that matches one of those tested as
10887 condition to clear the mouse face.
10889 2011-10-28 Chong Yidong <cyd@gnu.org>
10891 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10893 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10895 * window.c (make_window): Initialize phys_cursor_on_p.
10897 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10899 * lisp.h (struct Lisp_Symbol): Update comments.
10901 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
10903 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10905 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10907 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10908 <oslsachem@gmail.com> for helping to debug this.
10910 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10911 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10912 (g_b_init_get_glyph_outline_w): New static variables.
10913 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10914 (GetGlyphOutlineW_Proc): New typedefs.
10915 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10916 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10918 (w32font_open_internal, compute_metrics):
10919 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10920 instead of calling the "wide" APIs directly.
10922 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10924 * w32.h (syms_of_w32font): Add prototype.
10926 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10928 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10929 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10930 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10931 (Fmove_to_window_line): Doc fix.
10933 2011-10-27 Chong Yidong <cyd@gnu.org>
10935 * process.c (make_process): Set gnutls_state to NULL.
10937 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10938 non-NULL, regardless of GNUTLS_INITSTAGE.
10939 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10940 an error. Set process slots as soon as we allocate them.
10942 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10944 2011-10-27 Chong Yidong <cyd@gnu.org>
10946 * gnutls.c (emacs_gnutls_deinit): New function.
10947 Deallocate credentials structures as well as calling gnutls_deinit.
10948 (Fgnutls_deinit, Fgnutls_boot): Use it.
10950 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10951 (deactivate_process): Call emacs_gnutls_deinit.
10953 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10955 * image.c (x_create_x_image_and_pixmap):
10956 * w32.c (sys_rename, w32_delayed_load):
10957 * w32font.c (fill_in_logfont):
10958 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10960 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10962 * w32fns.c (w32_default_color_map): New function,
10963 extracted from Fw32_default_color_map.
10964 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10966 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10968 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10970 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10972 * keyboard.c (test_undefined): New function (bug#9751).
10973 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10975 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10977 * sysdep.c (init_sys_modes): Fix the check for the controlling
10978 terminal (Bug#6649).
10980 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10982 * dispextern.h (struct bidi_it): New member next_en_type.
10984 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10985 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10986 current character, check also for next_en_type being WEAK_EN.
10987 (bidi_resolve_weak): Don't enter the expensive loop if the current
10988 position is before next_en_pos. Record the bidi type of the first
10989 non-ET, non-BN character we find, in addition to its position.
10990 (bidi_level_of_next_char): Invalidate next_en_type when
10991 next_en_pos is over-stepped.
10993 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10995 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10996 * editfns.c: Rewrite current-time-zone so that it invokes
10997 the equivalent of (format-time-string "%Z") to get the time zone name.
10998 This fixes a bug when the time zone name contains characters that
10999 need converting from the system time locale to Emacs internal format.
11000 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11001 that patch fixed format-time-string to do the conversion, but
11002 I forgot to fix current-time-zone.
11003 (format_time_string): New function, containing most of
11004 what Fformat_time_string used to contain.
11005 (Fformat_time_string): Rewrite in terms of format_time_string.
11006 This doesn't change this function's behavior.
11007 (current-time-zone): Rewrite to use format_time_string.
11008 This fixes the bug reported by Michael Schierl in
11009 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11010 Jason Rumney's 2007-06-07 change worked around this bug, but
11012 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11014 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11016 * xdisp.c (start_display): If the character at POS is displayed
11017 via a display vector, reset IT->current.dpvec_index to zero.
11018 (try_window_reusing_current_matrix): If a line ends in a display
11019 vector or the next line starts in a display vector, continue
11020 redrawing the window even though the character position of
11021 start_row was reached.
11024 2011-10-18 Chong Yidong <cyd@gnu.org>
11026 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11027 with nobreak-char-display too.
11029 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11031 Fix part 3 of bug#9771.
11032 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11033 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11034 non-neutral characters if the current character is a paragraph
11035 separator (a.k.a. Newline). This avoids running the same
11036 expensive loop twice, once when we consume the preceding newline
11037 and the other time when the line actually needs to be displayed.
11038 Avoid the loop when we see neutrals on the base embedding level
11039 following a character whose directionality is the same as the
11040 paragraph's. This avoids running the expensive loop when a line
11041 ends in a long sequence of neutrals, like control characters.
11042 Add assertion against STRONG_AL type. Slightly rearrange code
11043 that determines the type of a neutral given the first non-neutral
11045 (bidi_level_of_next_char): Set next_en_pos to zero when
11046 invalidating its info.
11048 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11050 * xdisp.c (push_display_prop): Determine whether to record string
11051 or buffer position by IT->string, not by IT->method. Allow
11052 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11053 (move_it_vertically_backward): Don't look for character position
11054 immediately after the newline when in a continuation line.
11057 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11059 * window.c (coordinates_in_window): Rewrite and delabelize
11060 vertical border check. (Bug#5357) (Bug#9618)
11062 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11064 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11065 errors in XSetWindowBorder (bug#9310).
11067 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11069 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11070 avoid crash when xmalloc overrun checking is enabled.
11072 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11074 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11075 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11076 cursor motion with <left> and <right> arrow keys.
11078 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11079 some callers set that themselves.
11081 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11083 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11084 display string and the previous row comes from the same string and
11085 is empty. (Bug#9739) (Bug#9738)
11087 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11089 * doc.c (get_doc_string): Encode file name (bug#9735).
11091 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11093 * bidi.c (bidi_level_of_next_char):
11094 * xdisp.c (get_visually_first_element): Remove old incorrect
11095 comments regarding the Unicode Line Separator character.
11097 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11099 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11101 * alloc.c (Fgc_status): Do not access beyond zombies array
11102 boundary if nzombies > MAX_ZOMBIES.
11103 * alloc.c (dump_zombies): Add missing format specifier.
11105 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11107 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11108 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11110 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11111 Some packages use them to denote characters with modifiers.
11113 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11115 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11116 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11117 matching a pp-number. Rename parameter var to var1.
11119 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11121 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11123 2011-10-08 Glenn Morris <rgm@gnu.org>
11125 * callint.c (Fcall_interactively): Give a more explicit error for the
11126 'c' case with a non-character input. (Bug#8479)
11128 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11130 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11132 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11133 lines that are hscrolled on the left.
11135 * dispnew.c (buffer_posn_from_coords): Account for a possible
11136 presence of header-line. (Bug#4426)
11138 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11140 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11141 Don't advertise functionality which we discourage or doesn't work.
11143 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11145 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11146 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11147 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11148 this makes Emacs dump core during garbage collection on rare
11149 occasions. sizeof is obviously inferior to offsetof here, so
11150 stick with offsetof.
11151 (GC_POINTER_ALIGNMENT): New macro.
11152 (mark_memory): Omit 3rd (offset) arg; caller changed.
11153 Don't assume EMACS_INT alignment is the same as pointer alignment.
11155 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11157 * keyboard.c (read_key_sequence_remapped): New var.
11158 (read_key_sequence): Compute remapping in the right buffer.
11159 (command_loop_1): Use read_key_sequence's remapping directly.
11161 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11163 * dired.c (file_name_completion): Don't expand file name.
11164 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11165 before checking file name handler.
11167 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11168 they've been requested explicitly (bug#9591).
11170 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11172 * keymap.c (Fsingle_key_description): Use make_specified_string
11173 instead of build_string to build string from push_key_description.
11176 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11178 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11179 This fixes a Y2038 bug on 64-bit hosts.
11180 * buffer.c (reset_buffer):
11181 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11182 (Fclear_buffer_auto_save_failure):
11183 Use 0, not -1, to represent an unset failure time, since time_t
11184 might not be signed.
11186 Remove dependency on glibc malloc internals.
11187 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11188 Move back here from lisp.h, but with their new implementations.
11189 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11190 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11191 * charset.c (charset_table_init): New static var.
11192 (syms_of_charset): Use it instead of xmalloc. This removes a
11193 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11194 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11195 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11196 Move back to alloc.c.
11197 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11198 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11200 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11202 * nsterm.m (windowDidResize): Call x_set_window_size only when
11203 ns_in_resize is true. Otherwise set pixelwidth/height and
11204 call change_frame_size (Bug#9628).
11206 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11208 Port --enable-checking=all to Fedora 14 x86-64.
11209 * charset.c (syms_of_charset): Also account for glibc malloc's
11210 internal overhead when calculating the initial malloc maximum.
11212 Port --enable-checking=all to Fedora 14 x86.
11213 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11215 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11216 (overrun_check_realloc, overrun_check_free):
11217 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11218 That way, xmalloc returns a properly-aligned pointer even if
11219 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11220 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11221 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11222 into account when calculating the initial malloc maximum.
11223 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11224 Move here from alloc.c, so that charset.c can use it too.
11225 Properly align; the old code wasn't right for common 32-bit hosts
11226 when configured with --enable-checking=all.
11227 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11228 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11230 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11232 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11235 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11237 * xdisp.c (compute_display_string_end): If there's no display
11238 string at CHARPOS, return -1.
11240 * bidi.c (bidi_fetch_char): When compute_display_string_end
11241 returns a negative value, treat the character as a normal
11242 character not covered by a display string. (Bug#9624)
11244 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11246 * lread.c (Fread_from_string): Fix typo in docstring.
11248 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11250 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11251 newline, reseat the iterator instead of bidi-iterating there one
11252 character at a time. (Bug#9610)
11253 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11254 TO_CHARPOS if the bidi iterator is at base embedding level.
11256 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11258 * lread.c (readevalloop): Use correct code for NBSP.
11259 (read1): Likewise. (Bug#9608)
11261 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11263 * dbusbind.c (Fdbus_register_signal): When service is not
11264 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11266 2011-09-25 Glenn Morris <rgm@gnu.org>
11268 * buffer.c (truncate-lines): Doc fix.
11270 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11272 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11273 (Fset_window_next_buffers): Doc fix.
11275 2011-09-24 Glenn Morris <rgm@gnu.org>
11277 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11279 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11281 Fix minor problems found by static checking.
11282 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11283 * indent.c (Fvertical_motion): Fix == vs = typo.
11285 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11287 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11288 Default value is now t. Doc fix.
11290 * indent.c (Fvertical_motion): Compute and apply the overshoot
11291 logic when moving up, not only when moving down. Fix the
11292 confusing name and values of the it_overshoot_expected variable;
11293 logic changes accordingly. (Bug#9254) (Bug#9549)
11295 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11296 CHARPOS is covered by a display string which includes newlines.
11297 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11298 is covered by a display string with embedded newlines.
11300 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11302 * dbusbind.c (Fdbus_register_signal): Add match rule to
11303 Vdbus_registered_objects_table. (Bug#9581)
11304 (Fdbus_register_method, Vdbus_registered_objects_table):
11307 2011-09-24 Jim Meyering <meyering@redhat.com>
11309 do not ignore write error for any output size
11310 The previous change was incomplete.
11311 While it makes emacs --batch detect the vast majority of stdout
11312 write failures, errors were still ignored whenever the output size is
11313 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11314 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11315 && echo FAIL: ignored write error
11316 FAIL: ignored write error
11317 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11318 && echo FAIL: ignored write error
11319 FAIL: ignored write error
11320 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11322 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11324 * emacs.c (Fkill_emacs): In noninteractive mode exit
11325 non-successfully if a write error occurred on stdout. (Bug#9574)
11327 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11329 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11332 * dispextern.h (struct it): Update the comment documenting what
11335 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11337 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11338 a display string, extend search for cursor position to end of row.
11339 (find_row_edges): If the row ends in a newline from a display
11340 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11341 Handle the case of a display string with multiple newlines.
11342 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11343 non-empty line. Fixes confusing cursor motion with arrow keys at
11344 the beginning of a line that starts with whitespace.
11346 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11348 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11351 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11353 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11354 boolean (Bug#9154).
11356 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11358 * xdisp.c (display_line): Record maximum and minimum buffer
11359 positions even if no glyphs were produced (e.g., by a zero-width
11360 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11361 buffer positions that will be removed from the glyph row because
11363 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11364 column is beyond frame width: don't subtract 1 "pixel" when
11365 computing width of the stretch.
11366 (reseat_at_next_visible_line_start): Undo the change made on
11367 2011-09-17 that saved paragraph information and restored it after
11368 the call to `reseat'. (Bug#9545)
11370 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11372 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11373 and turn window cursor on if cleared (Bug#9415).
11375 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11377 * search.c (boyer_moore): Take unibyte characters from pattern
11378 literally. (Bug#9458)
11380 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11382 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11384 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11386 Fix minor problem found by static checking.
11387 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11388 initialized, to pacify gcc -Wuninitialized.
11390 * fileio.c: Report proper errno when syscall falls.
11391 (Finsert_file_contents): Save and restore errno,
11392 so that report_file_error outputs the correct diagnostic.
11393 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11395 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11397 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11399 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11401 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11402 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11404 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11406 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11407 about the current paragraph and restore it after the call to reseat.
11409 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11410 (bidi_find_paragraph_start): Search back for paragraph beginning
11411 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11412 (bidi_move_to_visually_next): Only trigger paragraph-related
11413 computations when the last character is a newline or at EOB, not
11414 just any NEUTRAL_B. (Bug#9470)
11416 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11417 truncated lines if point is covered by a display string. (Bug#9524)
11419 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11421 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11422 (cons_to_x_long): New function.
11423 (lisp_data_to_selection_data): Use it. Correct the test for
11424 short-versus-long data; it was negated. Break out of vector
11425 loop, for efficiency, when a long datum is discovered.
11427 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11429 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11431 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11433 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11434 GCC PR/17406) by declaring this function with external scope.
11436 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11438 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11439 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11441 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11443 * editfns.c (Fformat): Correctly handle text properties on "%%".
11445 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11447 * xterm.c (x_draw_composite_glyph_string_foreground):
11448 * w32term.c (x_draw_composite_glyph_string_foreground):
11449 * term.c (encode_terminal_code):
11450 * composite.c (composition_update_it, get_composition_id):
11451 * xdisp.c (get_next_display_element)
11452 (fill_composite_glyph_string): Add comments about special meaning
11453 of TAB characters in a composition.
11455 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11457 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11458 This occurs when processing a multibyte format.
11459 Problem reported by Wolfgang Jenker.
11461 2011-09-15 Johan Bockgård <bojohan@gnu.org>
11463 * xdisp.c (try_cursor_movement): Only check for exact match if
11464 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11466 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11468 Remove unused external symbols.
11469 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11470 * xdisp.c (calc_pixel_width_or_height): Now static.
11471 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11472 * indent.c (check_display_width):
11473 * w32term.c: Fix comment to match code.
11474 * xterm.c, xterm.h (x_catching_errors): Remove.
11476 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11478 * xselect.c: Use signed conversions more consistently (Bug#9498).
11479 (selection_data_to_lisp_data): Assume incoming selection data are
11480 signed integers, not unsigned. This is to be consistent with
11481 outgoing selection data, which was modified to use signed integers
11482 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11483 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11484 expects long, not unsigned long.
11486 2011-09-14 Eli Zaretskii <eliz@gnu.org>
11488 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11489 computation of loop end. Reported by Johan Bockgård
11492 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
11494 * frame.c (Fother_visible_frames_p): Function deleted.
11496 2011-09-12 Eli Zaretskii <eliz@gnu.org>
11498 * indent.c (compute_motion): Process display vector front to back
11499 rather than the other way around. (Bug#2496)
11501 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11503 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11505 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11507 * minibuf.c (Fread_from_minibuffer): Doc fix.
11509 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11511 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11512 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11514 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11516 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11517 value for non-existent files.
11519 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11521 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11522 set its "size" to -1. This will set the modtime_size field of
11523 the corresponding buffer to -1, which is what
11524 verify-visited-file-modtime expects for files that do not exist.
11527 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11529 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11531 * lisp.h: ... from here. push_key_description is no longer
11532 defined in keyboard.c, so its declaration should not be in
11533 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11534 logically belongs with push_key_description.
11536 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11538 * buffer.h: Include <sys/types.h> instead of <time.h>.
11539 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11540 Problem reported by Herbert J. Skuhra.
11542 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11544 * xml.c (parse_region): Make the parsing work for
11545 non-comment-starting XML files again (bug#9144).
11547 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11549 * image.c (gif_load): Fix calculation of bottom and right corner.
11552 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11554 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11555 redisplay in small windows.
11557 2011-09-09 Eli Zaretskii <eliz@gnu.org>
11559 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11561 2011-09-08 Martin Rudalics <rudalics@gmx.at>
11563 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11564 Operate on live windows only.
11566 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
11568 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11570 2011-09-07 Eli Zaretskii <eliz@gnu.org>
11572 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11573 only under bidi iteration.
11575 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11577 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11579 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11581 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11582 Without this fix, the command to link temacs failed due to an
11583 undefined symbol __builtin_isnan. This is because
11584 /usr/include/iso/math_c99.h #defines isnan(x) to
11585 __builtin_isnan(x), but the bundled gcc, which identifies itself
11586 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11588 * floatfns.c (isnan): #undef, and then #define to a clone of
11590 (Fisnan): Always define, since it's always available now.
11591 (syms_of_floatfns): Always define isnan at the Lisp level.
11593 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11595 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11597 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11599 * fileio.c: Fix bugs with large file offsets (Bug#9428).
11600 The previous code assumed that file offsets (off_t values) fit in
11601 EMACS_INT variables, which is not true on typical 32-bit hosts.
11602 The code messed up by falsely reporting buffer overflow in cases
11603 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11604 when "big" contains more than 2**29 bytes, even though this
11605 inserts just one byte and does not overflow the buffer.
11606 (Finsert_file_contents): Store file offsets as off_t
11607 values, not as EMACS_INT values. Check for overflow when
11608 converting between EMACS_INT and off_t. When checking for
11609 buffer overflow or for overlap, take the offsets into account.
11610 Don't use EMACS_INT for small values where int suffices.
11611 When checking for overlap, fix a typo: ZV was used where
11612 ZV_BYTE was intended.
11613 (Fwrite_region): Don't assume off_t fits into 'long'.
11614 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11616 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
11618 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11620 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11622 sprintf-related integer and memory overflow issues (Bug#9412).
11624 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11625 (esprintf, exprintf, evxprintf): New functions.
11626 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11627 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11628 (modify_event_symbol): Do not assume that the length of
11629 name_alist_or_stem is safe to alloca and fits in int.
11630 (Fexecute_extended_command): Likewise for function name and binding.
11631 (Frecursion_depth): Wrap around reliably on integer overflow.
11632 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11633 since some callers pass EMACS_INT values.
11634 (Fsingle_key_description): Don't crash if symbol name contains more
11635 than MAX_ALLOCA bytes.
11636 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11637 (get_minibuffer): Arg is now EMACS_INT, not int.
11638 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11639 (esprintf, exprintf, evxprintf): New decls.
11640 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11642 * dbusbind.c (signature_cat): New function.
11643 (xd_signature, Fdbus_register_signal):
11644 Do not overrun buffer; instead, report string overflow.
11646 * dispnew.c (add_window_display_history): Don't overrun buffer.
11647 Truncate instead; this is OK since it's just a log.
11649 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11650 even if the time zone offset is outlandishly large.
11651 Don't mishandle offset == INT_MIN.
11653 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11654 when creating daemon; the previous buffer-overflow check was incorrect.
11656 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11657 which has the guts of the old verror function.
11659 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11660 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11662 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11663 (font_unparse_xlfd): Don't blindly alloca long strings.
11664 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11665 fits in int, when using sprintf. Use single snprintf to count
11666 length of string rather than counting it via multiple sprintfs;
11667 that's simpler and more reliable.
11668 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11669 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11670 sprintf, in case result does not fit in int.
11672 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11673 (fontset_from_font): Print it.
11675 * frame.c (tty_frame_count): Now printmax_t, not int.
11676 (make_terminal_frame, set_term_frame_name): Print it.
11677 (x_report_frame_params): In X, window IDs are unsigned long,
11678 not signed long, so print them as unsigned.
11679 (validate_x_resource_name): Check for implausibly long names,
11680 and don't assume name length fits in 'int'.
11681 (x_get_resource_string): Don't blindly alloca invocation name;
11682 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11685 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11686 (xg_check_special_colors, xg_set_geometry):
11687 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11689 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11690 Use esprintf, not sprintf, in case result does not fit in int.
11692 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11693 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11694 it as a large positive number.
11695 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11696 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11698 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11699 in case result does not fit in int.
11701 * print.c (float_to_string): Detect width overflow more reliably.
11702 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11703 buffer overrun. Don't assume list length fits in 'int'. Treat
11704 print length of 0 as 0, not as infinity; to be consistent with other
11705 uses of print length in this function. Don't overflow print length
11706 index. Don't assume hash table size fits in 'long', or that
11707 vectorlike size fits in 'unsigned long'.
11709 * process.c (make_process): Use printmax_t, not int, to format
11710 process-name gensyms.
11712 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11714 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11715 to avoid potential buffer overrun.
11717 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11718 if X resource line is longer than 512 bytes.
11720 * xfns.c (x_window): Make sprintf buffer a bit bigger
11721 to avoid potential buffer overrun.
11723 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11725 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11727 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11729 Integer overflow fixes for scrolling, etc.
11730 Without these, Emacs silently mishandles large integers sometimes.
11731 For example, "C-u 4294967297 M-x recenter" was treated as if
11732 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11734 * xdisp.c (try_window_id): Check Emacs fixnum range before
11735 converting to 'int'.
11737 * window.c (window_scroll_line_based, Frecenter):
11738 Check that an Emacs fixnum is in range before assigning it to 'int'.
11739 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11740 values converted from Emacs fixnums.
11741 (Frecenter): Don't wrap around a line count if it is out of 'int'
11742 range; instead, treat it as an extreme value.
11743 (Fset_window_configuration, compare_window_configurations):
11744 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11746 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11747 that can exceed INT_MAX. Check that EMACS_INT value is in range
11748 before assigning it to the (possibly-narrower) index.
11749 (match_limit): Don't assume that a fixnum can fit in 'int'.
11751 * print.c (print_object): Use ptrdiff_t, not int, for index that can
11754 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11755 (Fvertical_motion): Don't wrap around LINES values that don't fit
11756 in 'int'. Instead, treat them as extreme values. This is good
11757 enough for windows, which can't have more than INT_MAX lines anyway.
11759 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11761 * Require libxml/parser.h to avoid compilation warning.
11763 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11765 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11766 since this reportedly can destroy thread storage.
11768 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
11770 * syntax.c (find_defun_start): Update all cache variables if
11771 exiting early (Bug#9401).
11773 2011-08-30 Eli Zaretskii <eliz@gnu.org>
11775 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11777 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11778 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11779 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11781 * term.c (tty_append_glyph): New function.
11782 (produce_stretch_glyph): Static function and its prototype deleted.
11784 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11787 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11789 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11790 when checking :margin (Bug#9390).
11791 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11792 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11793 so that the name doesn't mislead. All uses changed.
11795 2011-08-28 Johan Bockgård <bojohan@gnu.org>
11797 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11800 2011-08-27 Eli Zaretskii <eliz@gnu.org>
11802 * xdisp.c (move_it_to): Don't bail out early when reaching
11803 position beyond to_charpos, if we are scanning backwards.
11804 (move_it_vertically_backward): When DY == 0, make sure we get to
11805 the first character in the line after the newline.
11807 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11809 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11810 (ccl_driver): Do not generate an out-of-range pointer.
11811 (Fccl_execute_on_string): Remove unnecessary check for
11812 integer overflow, noted by Stefan Monnier in
11813 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11814 Remove a FIXME that didn't need fixing.
11815 Simplify the newly-introduced buffer reallocation code.
11817 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
11819 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11821 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
11823 Integer and memory overflow issues (Bug#9196).
11825 * doc.c (get_doc_string): Rework so that
11826 get_doc_string_buffer_size is the actual buffer size, rather than
11827 being 1 less than the actual buffer size; this makes xpalloc more
11830 * image.c (x_allocate_bitmap_record, cache_image):
11831 * xselect.c (Fx_register_dnd_atom):
11832 Simplify previous changes by using xpalloc.
11834 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11835 since either will do and ptrdiff_t is convenient with xpalloc.
11837 * charset.c (charset_table_size)
11838 (struct charset_sort_data.priority): Now ptrdiff_t.
11839 (charset_compare): Don't overflow if priorities differ greatly.
11840 (Fsort_charsets): Don't assume list length fits in int.
11841 Check for size-calculation overflow when allocating sort data.
11842 (syms_of_charset): Allocate an initial charset table that is
11843 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11845 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11847 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11848 The actual value is always <= INT_MAX, and leaving it unsigned made
11849 overflow checking harder.
11851 * dispextern.h (struct glyph_matrix.rows_allocated)
11852 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11853 with xpalloc. The values are still always <= INT_MAX.
11855 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11857 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11858 (SAFE_NALLOCA): New macro.
11860 * region-cache.c (struct boundary.pos, find_cache_boundary)
11861 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11862 (set_cache_region, invalidate_region_cache)
11863 (revalidate_region_cache, know_region_cache, region_cache_forward)
11864 (region_cache_backward, pp_cache):
11865 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11866 so that ptrdiff_t * can be passed to xpalloc.
11867 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11868 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11869 (pp_cache): Don't assume cache_len fits in int.
11870 * region-cache.h: Adjust extern decls to match.
11872 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11873 EMACS_INT, since either will do, for xpalloc.
11875 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11876 (xnmalloc, xnrealloc, xpalloc): New functions.
11878 * bidi.c (bidi_shelve_header_size): New constant.
11879 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11880 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11882 * bidi.c (bidi_cache_shrink):
11883 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11885 Don't update size of array until after memory allocation succeeds,
11886 because xmalloc/xrealloc may not return.
11887 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11888 now that we have proper integer overflow checking.
11889 (record_overlay_string, overlay_strings): Catch overflows when
11890 calculating size of overlay_str_buf.
11892 * callproc.c (Fcall_process): Check for size overflow when
11893 calculating size of args2.
11894 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11895 Normally we prefer signed values, but sticking with ptrdiff_t would
11896 require adding more-complicated checks.
11898 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11899 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11900 Redo buffer-overflow calculations to avoid integer overflow.
11901 Add a FIXME comment where memory seems to be over-allocated.
11903 * character.c (Fstring): Check for size-calculation overflow.
11905 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11906 unnecessary integer overflow. Check for size overflow.
11907 (encode_coding_object): Don't update size until xmalloc succeeds.
11909 * composite.c (get_composition_id): Check for overflow in glyph
11910 length calculations.
11912 Integer and memory overflow fixes for display code.
11913 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11914 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11915 (scrolling_window): Check for overflow in size calculations.
11916 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11917 Don't assume glyph table len fits in int.
11918 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11919 (row_table_size): Now ptrdiff_t, not int.
11920 (scrolling_window): Avoid overflow in size calculations.
11921 Don't update size until allocation succeeds.
11922 * fns.c (concat): Check for overflow in size calculations.
11923 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11924 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11925 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11927 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11928 (get_doc_string): Check for size calculation overflow.
11929 Don't update size until allocation succeeds.
11930 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11931 EMACS_INT, where ptrdiff_t will do.
11932 (Fsubstitute_command_keys): Check for string overflow.
11934 * editfns.c (set_time_zone_rule): Don't assume environment length
11936 (message_length): Now ptrdiff_t, not int.
11937 (Fmessage_box): Don't update size until allocation succeeds.
11938 Don't assume message length fits in int.
11939 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11941 * emacs.c (main): Do not reallocate argv, since there is a null at
11942 the end that can be overwritten, and this way there's no need to
11943 worry about size-calculation overflow.
11944 (sort_args): Check for size-calculation overflow.
11946 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11948 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11950 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11951 (x_set_scroll_bar_width, x_figure_window_size):
11952 Check for integer overflow.
11953 (x_set_alpha): Do not assume XINT fits in int.
11955 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11956 This is for the members text_lines, text_cols, total_lines, total_cols,
11957 where the system imposes an 'int' limit.
11959 * fringe.c (Fdefine_fringe_bitmap):
11960 Don't update size until alloc works.
11962 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11963 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11965 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11966 Check for size-calculation overflow.
11967 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11968 do, as we prefer signed integers.
11969 (id_to_widget.max_size, id_to_widget.used)
11970 (xg_store_widget_in_map, xg_remove_widget_from_map)
11971 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11972 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11973 Use and return ptrdiff_t, not int.
11974 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11975 * gtkutil.h: Change prototypes to match the above.
11977 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11978 are duplicate now that they've been promoted to lisp.h.
11979 (x_allocate_bitmap_record, x_alloc_image_color)
11980 (make_image_cache, cache_image, xpm_load):
11981 Don't update size until alloc is done.
11982 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11984 Check for size calculation overflow.
11985 (ct_colors_allocated_max): New constant.
11986 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11989 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11990 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11991 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11992 Use ptrdiff_t, not int, to count maps.
11993 (read_char_minibuf_menu_prompt): Check for overflow in size
11994 calculations. Don't update size until allocation succeeds.
11995 Redo calculations to avoid overflow.
11996 * keyboard.h: Change prototypes to match the above.
11998 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12000 (current_minor_maps): Check for size calculation overflow.
12001 * keymap.h: Change prototypes to match the above.
12003 * lread.c (read1, init_obarray): Don't update size until alloc done.
12005 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12006 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12008 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12009 Now ptrdiff_t, not int.
12010 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12011 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12013 * process.c (Fnetwork_interface_list): Check for overflow
12014 in size calculation.
12016 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12018 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12019 overflow. Don't bother calling xmalloc when xrealloc will do.
12021 * search.c (Freplace_match): Check for size calculation overflow.
12022 (Fset_match_data): Don't assume list lengths fit in 'int'.
12024 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12025 for command line length. Do not attempt to address one before the
12026 beginning of an array, as that's not portable.
12028 * term.c (max_frame_lines): Remove; unused.
12029 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12031 (encode_terminal_code, calculate_costs): Check for size
12032 calculation overflow.
12033 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12034 table lengths and related sizes. Don't update size until alloc
12035 done. Redo calculations to avoid overflow.
12036 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12038 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12039 subtracting pointers.
12040 (gobble_line): Check for overflow more carefully. Don't update size
12043 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12044 Don't update size until alloc done.
12045 Redo size calculations to avoid overflow.
12046 Check for size calculation overflow.
12047 (main) [DEBUG]: Fix typo in invoking tparam1.
12049 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12050 Use ptrdiff_t, not int, for sizes.
12051 (store_mode_line_noprop_char): Don't update size until alloc done.
12053 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12054 Use ptrdiff_t, not int, for sizes.
12055 (Finternal_make_lisp_face, cache_face):
12056 Check for size calculation overflow.
12057 (cache_face): Treat size calculation overflows as if they were
12058 memory exhaustion (the usual treatment), rather than aborting.
12060 * xfns.c (x_encode_text, x_set_name_internal)
12061 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12062 sizes, since they can exceed INT_MAX in size. Check for size
12063 calculation overflow.
12065 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12066 (xg_select): Check for size calculation overflow.
12067 Don't update size until alloc done.
12069 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12070 as sprintf is limited to int lengths.
12072 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12073 (X_LONG_MIN): New macros.
12074 Use them to make the following changes clearer.
12075 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12076 This change doesn't affect the value now, but it may help remind
12077 future maintainers not to raise the value too much later.
12078 (SELECTION_QUANTUM): Remove, replacing with ...
12079 (selection_quantum): ... new function, which avoids overflow.
12081 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12082 assumption that selection length fits in 'int'.
12083 (x_reply_selection_request, x_handle_selection_request)
12084 (x_get_window_property, receive_incremental_selection)
12085 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12086 (lisp_data_to_selection_data, clean_local_selection_data):
12087 Use ptrdiff_t, not int, to record length of selection.
12088 (x_reply_selection_request, x_get_window_property)
12089 (receive_incremental_selection, x_property_data_to_lisp):
12090 Redo calculations to avoid overflow.
12091 (x_reply_selection_request): When sending hint, ceiling it at
12092 X_LONG_MAX rather than relying on wraparound overflow to send
12094 (x_get_window_property, receive_incremental_selection)
12095 (lisp_data_to_selection_data, x_property_data_to_lisp):
12096 Check for size-calculation overflow.
12097 (x_get_window_property, receive_incremental_selection)
12098 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12099 Don't store size until memory allocation succeeds.
12100 (x_get_window_property): Plug memory leak on memory exhaustion.
12101 Don't double-block input; malloc is safe here. Don't assume 2**34
12102 - 4 fits in unsigned long. Add an xassert to check
12103 XGetWindowProperty overflow. Be more careful about overflow
12104 calculations, and distinguish size from memory overflow better.
12105 (receive_incremental_selection): When tracing, don't assume
12106 unsigned int is less than INT_MAX.
12107 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12108 harmful) conversions of unsigned short to int.
12109 (lisp_data_to_selection_data): Don't assume that integers
12110 in the range -65535 through -1 fit in an X unsigned short.
12111 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12112 result parameters unless successful. Rely on cons_to_unsigned
12113 to report problems with elements; the old code wasn't right anyway.
12114 (x_check_property_data): Check for int overflow; we cannot use
12115 a wider type due to X limits.
12116 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12118 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12120 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12121 (x_term_init): Check for size calculation overflow.
12122 (x_color_cells): Don't store size until memory allocation succeeds.
12123 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12124 Don't assume alloca size is less than MAX_ALLOCA.
12125 (x_term_init): Don't assume length fits in int (sprintf is limited
12128 Use ptrdiff_t for composition IDs.
12129 * character.c (lisp_string_width):
12130 * composite.c (composition_table_size, n_compositions)
12131 (get_composition_id, composition_gstring_from_id):
12132 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12133 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12134 * window.c (Frecenter):
12135 Use ptrdiff_t, not int, for composition IDs.
12136 * composite.c (get_composition_id): Check for integer overflow.
12137 * composite.h: Adjust prototypes to match the above changes.
12139 Use ptrdiff_t for hash table indexes.
12140 * category.c (hash_get_category_set):
12141 * ccl.c (ccl_driver):
12142 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12143 * coding.c (coding_system_charset_list, detect_coding_system):
12144 * coding.h (struct coding_system.id):
12145 * composite.c (get_composition_id, gstring_lookup_cache):
12146 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12147 * image.c (xpm_get_color_table_h):
12148 * lisp.h (hash_lookup, hash_put):
12149 * minibuf.c (Ftest_completion):
12150 Use ptrdiff_t for hash table indexes, not int (which is too
12151 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12152 32-bit --with-wide-int hosts).
12154 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12155 Add a FIXME comment about memory leaks.
12156 (syms_of_charset): Don't assume xmalloc returns.
12158 Don't assume that stated character widths fit in int.
12159 * character.c (Fchar_width, c_string_width, lisp_string_width):
12160 * character.h (CHAR_WIDTH):
12161 * indent.c (MULTIBYTE_BYTES_WIDTH):
12162 Use sanitize_char_width to avoid undefined and/or bad behavior
12163 with outlandish widths.
12164 * character.h (sanitize_tab_width): Rename from sanitize_width,
12165 now that we have two such functions. All uses changed.
12166 (sanitize_char_width): New inline function.
12168 Don't assume that tab-width fits in int.
12169 * character.h (sanitize_width): New inline function.
12170 (SANE_TAB_WIDTH): New macro.
12171 (ASCII_CHAR_WIDTH): Use it.
12172 * indent.c (sane_tab_width): Remove. All uses replaced by
12173 SANE_TAB_WIDTH (current_buffer).
12174 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12176 * fileio.c: Integer overflow issues with file modes.
12177 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12179 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12180 Remove unreachable code.
12181 (read_hex, load_charset_map_from_file): Check for integer overflow.
12183 * xterm.c: Don't go over XClientMessageEvent limit.
12184 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12185 (x_send_scroll_bar_event): Likewise. Check that the size does not
12186 exceed limits imposed by XClientMessageEvent, as well as the usual
12187 ptrdiff_t and size_t limits.
12189 * keyboard.c: Overflow, signedness and related fixes.
12190 (make_lispy_movement): Use same integer type in forward decl
12191 that is used in the definition.
12192 (read_key_sequence, keyremap_step):
12193 Change bufsize argument back to int, undoing my 2011-03-30 change.
12194 We prefer signed types, and int is wide enough here.
12195 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12196 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12197 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12198 length, not size_t. Use ptrdiff_t for index, not int.
12199 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12200 possibility of integer overflow.
12202 Overflow, signedness and related fixes for images.
12204 * dispextern.h (struct it.stack[0].u.image.image_id)
12205 (struct_it.image_id, struct image.id, struct image_cache.size)
12206 (struct image_cache.used, struct image_cache.ref_count):
12207 * gtkutil.c (update_frame_tool_bar):
12208 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12209 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12210 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12211 * nsmenu.m (update_frame_tool_bar):
12212 * xdisp.c (calc_pixel_width_or_height):
12213 * xfns.c (image_cache_refcount):
12214 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12215 on typical 64-bit hosts.
12217 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12218 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12219 Omit unnecessary casts to int.
12220 (parse_image_spec): Check that integers fall into 'int' range
12221 when the callers expect that.
12222 (image_ascent): Redo ascent calculation to avoid int overflow.
12223 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12224 (lookup_image): Remove unnecessary tests.
12225 (xbm_image_p): Locals are now of int, not EMACS_INT,
12226 since parse_image_check makes sure they fit into int.
12227 (png_load, gif_load, svg_load_image):
12228 Prefer int to unsigned where either will do.
12229 (tiff_handler): New function, combining the cores of the
12230 old tiff_error_handler and tiff_warning_handler.
12231 This function is rewritten to use vsnprintf and thereby avoid
12232 stack buffer overflows. It uses only the features of vsnprintf
12233 that are common to both POSIX and native Microsoft.
12234 (tiff_error_handler, tiff_warning_handler): Use it.
12235 (tiff_load, gif_load, imagemagick_load_image):
12236 Don't assume :index value fits in 'int'.
12237 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12238 (imagemagick_load_image): Check that crop parameters fit into
12239 the integer types that MagickCropImage accepts. Don't assume
12240 Vimagemagick_render_type has a nonnegative value. Don't assume
12241 size_t fits in 'long'.
12242 (gs_load): Use printmax_t to print the widest integers possible.
12243 Check for integer overflow when computing image height and width.
12245 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12247 * xdisp.c (redisplay_window): Don't force window start if point
12248 will be invisible in the resulting window. (Bug#9324)
12250 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12252 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12253 the display spec is of the form `(space ...)'.
12254 (handle_display_spec): Return the value returned by
12255 handle_single_display_spec, not just 1 or zero.
12256 (handle_single_display_spec): If the display spec is of the form
12257 `(space ...)', and specifies display in the text area, return 2
12259 (try_cursor_movement): Check for the need to scroll more
12260 accurately, and prefer exact match for point under bidi.
12261 Don't advance `row' beyond the last row of the window.
12263 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12264 into disp_prop; all users changed.
12266 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12267 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12268 for the text covered by the display property.
12270 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12272 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12273 Change return value to nil.
12274 (Frecord_buffer): Delete unused function.
12276 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12278 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12279 buffers, return left-to-right.
12280 (set_cursor_from_row): Consider candidate row a win if its glyph
12281 represents a newline and point is on that newline. Fixes cursor
12282 positioning on the newline at EOL of R2L text within L2R
12283 paragraph, and vice versa.
12284 (try_cursor_movement): Check continued rows, in addition to
12285 continuation rows. Fixes unwarranted scroll when point enters a
12286 continued line of R2L text within an L2R paragraph, or vice versa.
12287 (cursor_row_p): Consider the case of point being equal to
12288 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12289 from the end of a short line to the beginning of a continued line
12290 of R2L text within L2R paragraph.
12291 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12292 composed characters.
12294 * bidi.c (bidi_check_type): Use xassert.
12295 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12298 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12300 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12303 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12305 * nsfont.m (ns_otf_to_script): Fix typo.
12307 2011-08-22 Kenichi Handa <handa@m17n.org>
12309 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12310 extra slot even if the purpose is char-code-property-table.
12312 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12314 * xdisp.c (redisplay_window): When computing centering_position,
12315 account for the height of the header line. (Bug#8874)
12317 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12318 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12319 candidate is selected by the mouse, and that candidate has a
12320 composed character under the mouse.
12322 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12323 coordinates reported by pos-visible-in-window-p for a composed
12324 character in column zero.
12326 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12328 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12330 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12332 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12333 consider it a hit if to_charpos is anywhere in the range of the
12334 composed buffer positions.
12336 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12338 * image.c (gif_load): Don't assume that each subimage has the same
12339 dimensions as the base image. Handle disposal method that is
12340 "undefined" by the gif spec (Bug#9335).
12342 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12344 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12345 (Fcondition_case): Document `debug' symbol in error handler.
12347 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12349 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12350 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12351 from an Org mode buffer to a Speedbar frame.
12353 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12354 a composition, take its buffer position from IT->cmp_it.charpos.
12355 Fixes cursor positioning at the beginning of a line that begins
12356 with a composed character.
12358 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12360 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12361 character bidirectional type, use STRONG_L instead. Fixes crashes
12362 in a buffer produced by `describe-categories'.
12364 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12365 members before the level stack, so they would be saved and
12366 restored when copying iterator state. Fixes incorrect reordering
12367 around TABs covered by display properties.
12369 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12371 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12373 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12375 * eval.c (internal_condition_case, internal_condition_case_1)
12376 (internal_condition_case_2, internal_condition_case_n):
12377 Remove unnecessary aborts (Bug#9081).
12379 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12381 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12382 has no `load' handler, try opening the file locally. (Bug#9311)
12384 2011-08-16 Ken Brown <kbrown@cornell.edu>
12386 * gmalloc.c: Expand comment.
12388 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12390 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12391 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12393 2011-08-16 Ken Brown <kbrown@cornell.edu>
12395 Fix memory allocation problems in Cygwin build (Bug#9273).
12397 * unexcw.c ( __malloc_initialized): Declare external variable.
12398 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12400 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12402 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12404 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12405 in the static heap.
12406 [CYGWIN] (special_realloc): New function.
12407 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12408 requests to realloc storage in the static heap.
12410 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12412 * bidi.c (bidi_initialize): Remove unused local.
12414 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12417 * biditype.h: Remove file.
12418 * makefile.w32-in ($(BLD)/bidi.$(O)):
12419 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12421 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12423 * chartab.c: Improve commentary for the uniprop_table API.
12425 * bidi.c (bidi_paragraph_init): Support zero value of
12426 bidi_ignore_explicit_marks_for_paragraph_level.
12427 (bidi_initialize): Use uniprop_table instead of including
12428 biditype.h and bidimirror.h.
12430 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12431 coordinates of the iterator when restoring from ppos_it.
12434 2011-08-14 Kenichi Handa <handa@m17n.org>
12436 * process.c (create_process): Call setup_process_coding_systems
12437 after the pid of the process is set to -1 (Bug#8162).
12439 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12441 * xdisp.c (move_it_in_display_line_to): Don't invoke
12442 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12443 ppos_it. Fixes vertical cursor motion when line beginning is
12444 covered by an image. (Bug#9296)
12446 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12448 * nsterm.h (ns_run_ascript): Declare.
12449 (NSAPP_DATA2_RUNASSCRIPT): Define.
12451 * nsfns.m (as_script, as_result, as_status): New static variables.
12452 (ns_run_ascript): New function.
12453 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12454 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12455 the event loop. Get status from as_status (Bug#7276).
12457 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12458 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12459 the event loop (Bug#7276).
12461 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12463 * gnutls.c (QCgnutls_bootprop_priority)
12464 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12465 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12466 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12467 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12468 (QCgnutls_bootprop_verify_hostname_error)
12469 (QCgnutls_bootprop_callbacks_verify): Rename from
12470 Qgnutls_bootprop_..., all uses changed.
12472 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12475 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12477 * xfaces.c (Qframe_set_background_mode): Now static.
12478 * dispextern.h (Qframe_set_background_mode): Remove decl.
12480 * process.c (Fnetwork_interface_info): Declare local only if needed.
12482 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12484 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12485 (Fnetwork_interface_list): Allocate in increments of bytes instead
12486 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12487 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12489 (struct ifflag_def): notrailers is smart on OSX.
12490 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12491 Get hardware address with getifaddrs if available.
12493 2011-08-12 Eli Zaretskii <eliz@gnu.org>
12495 * xdisp.c (iterate_out_of_display_property): xassert that
12496 IT->position is set to within IT->object's boundaries. Break from
12497 the loop as soon as EOB is reached; avoids infloops in redisplay
12498 when IT->position is set up wrongly due to some bug.
12499 Set IT->current to match the bidi iterator unconditionally.
12500 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12501 entry. Force push_it to save on the stack the current
12502 buffer/string position, to be restored by pop_it. Fix flags in
12503 the iterator structure wrt the object coming from a display
12504 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12505 properties. (Bug#9284)
12507 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12509 * fontset.c (fontset_get_font_group): Add proper type checks.
12512 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12514 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12515 and LC_VERSION_MIN_MACOSX.
12516 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12517 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12519 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12521 * xdisp.c (forward_to_next_line_start): Allow to use the
12522 no-display-properties-and-no-overlays under bidi display.
12523 Set disp_pos in the bidi iterator to avoid searches for display
12524 properties and overlays.
12526 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12528 * editfns.c (Fset_time_zone_rule): Document relationship with the
12531 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12532 the font entity extracted from the cache (Bug#8109).
12534 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12536 * composite.c (autocmp_chars): Don't reset point. That is done by
12537 restore_point_unwind (Bug#5984).
12539 2011-08-07 Juri Linkov <juri@jurta.org>
12541 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12542 to show the arg `TIME' instead of `TIMEVAL'.
12544 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12546 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12547 display property strides EOL and includes a newline, as in
12548 longlines-mode. (Bug#9254)
12549 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12550 word-wrap under bidirectional display. (Bug#9224)
12552 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12553 is non-zero, even if the data buffer is NULL. Fixes a crash in
12554 vertical-motion with longlines-mode. (Bug#9254)
12556 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12558 * bidi.c <bidi_cache_total_alloc>: Now static.
12559 (bidi_initialize): Initialize bidi_cache_total_alloc.
12561 * xdisp.c (display_line): Release buffer allocated for shelved bidi
12564 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12565 amount allocated this far in `bidi_cache_total_alloc'.
12566 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12567 non-zero, only free the data buffer without restoring the cache
12568 contents. All callers changed.
12570 * dispextern.h (bidi_unshelve_cache): Update prototype.
12572 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12573 (move_it_in_display_line, move_it_to)
12574 (move_it_vertically_backward, move_it_by_lines): Replace the call
12575 to xfree to an equivalent call to bidi_unshelve_cache.
12576 (move_it_in_display_line_to): Fix logic of returning
12577 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12579 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12581 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12582 came from a string character with a `cursor' property. (Bug#9229)
12584 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12586 * Makefile.in (LIB_PTHREAD): New variable.
12587 (LIBES): Add LIB_PTHREAD (Bug#9216).
12589 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12590 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12592 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12594 * regex.c (re_iswctype): Remove some redundant boolean conversions.
12596 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12598 * xterm.c (x_find_topmost_parent): New function.
12599 (x_set_frame_alpha): Find topmost parent window with
12600 x_find_topmost_parent and set the property there also (bug#9181).
12601 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12603 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12605 * callproc.c (Fcall_process): Avoid vfork clobbering
12606 the local vars buffer, coding_systems, current_dir.
12608 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12610 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12612 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12614 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12615 so that it is not optimized away.
12617 * xdisp.c (compute_display_string_pos): Remove unused local.
12619 2011-08-02 Eli Zaretskii <eliz@gnu.org>
12621 Fix slow cursor motion and scrolling in large buffers with
12622 selective display, like Org Mode buffers. (Bug#9218)
12624 * dispextern.h (struct bidi_it): New member disp_prop_p.
12626 * xdisp.c: Remove one-slot cache of display string positions.
12627 (compute_display_string_pos): Accept an additional argument
12628 DISP_PROP_P; callers changed. Scan at most 5K characters forward
12629 for a display string or property. If found, set DISP_PROP_P
12632 * bidi.c (bidi_fetch_char): Accept an additional argument
12633 DISP_PROP_P, and pass it to compute_display_string_pos.
12634 Only handle text covered by a display string if DISP_PROP_P is returned
12635 non-zero. All callers of bidi_fetch_char changed.
12637 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12639 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12641 2010-12-03 Don March <don@ohspite.net>
12643 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12644 last character M-[char] is translated to ESC [char] (bug#7541).
12646 2011-08-02 Kenichi Handa <handa@m17n.org>
12648 * lisp.h (uniprop_table): Extern it.
12650 * chartab.c (uniprop_table): Make it non-static.
12652 2011-08-01 Eli Zaretskii <eliz@gnu.org>
12654 * xdisp.c (forward_to_next_line_start): Accept additional argument
12655 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12657 (reseat_at_next_visible_line_start): Use the bidi iterator state
12658 returned by forward_to_next_line_start to restore the state of
12659 it->bidi_it after backing up to previous newline. (Bug#9212)
12661 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12663 * regex.c (re_comp): Protoize.
12664 (re_exec): Fix return type.
12665 (regexec): Fix type of `ret'. (Bug#9203)
12667 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12669 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12670 This is needed if max-image-size is a floating-point number.
12672 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12674 * print.c (print_object): Print empty symbol as ##.
12676 * lread.c (read1): Read ## as empty symbol.
12678 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12680 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12681 setting frame foreground color (Bug#9175).
12682 (x_set_background_color): Likewise.
12684 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12685 contents (Bug#9176).
12686 (EmacsTooltip -init): Remove bezels and add shadows to
12689 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12690 or scroll bar (Bug#8470).
12692 * nsfont.m (nsfont_open): Remove assignment to voffset and
12693 unnecessary vars hshink, expand, hd, full_height, min_height.
12694 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12696 * nsterm.h (nsfont_info): Remove voffset field.
12698 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12700 Implement strike-through and overline on NextStep (Bug#8863).
12702 * nsfont.m (nsfont_open): Use underline position provided by font,
12703 instead of hard-coded value of 2.
12704 (nsfont_draw): Call ns_draw_text_decoration instead.
12706 * nsterm.h: Add declaration for ns_draw_text_decoration.
12708 * nsterm.m (ns_draw_text_decoration): New function for drawing
12709 underline, overline, and strike-through.
12710 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12711 ns_draw_text_decoration. Change treatment of cursor drawing to
12712 accommodate underlining, etc.
12714 2011-07-28 Eli Zaretskii <eliz@gnu.org>
12716 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12719 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12721 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12722 Without this fix, if a signal arrives just after memory fills up,
12723 'malloc' might be invoked reentrantly.
12725 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12726 In other words, assume that every image size is allowed, on non-X
12727 hosts. This assumption is probably wrong, but it lets Emacs compile.
12729 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12731 * regex.c (re_iswctype): Convert return values to boolean.
12733 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12735 * xdisp.c (compute_display_string_pos): Don't use cached display
12736 string position if the buffer had its restriction changed.
12739 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12741 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12743 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12745 Integer signedness and overflow and related fixes. (Bug#9079)
12747 * bidi.c: Integer size and overflow fixes.
12748 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12749 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12750 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12751 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12752 (bidi_find_other_level_edge):
12753 Use ptrdiff_t instead of EMACS_INT where either will do.
12754 This works better on 32-bit hosts configured --with-wide-int.
12755 (bidi_cache_ensure_space): Check for size-calculation overflow.
12756 Use % rather than repeated addition, for better worst-case speed.
12757 Don't set bidi_cache_size until after xrealloc returns, because it
12759 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12760 (bidi_cache_ensure_space): Also check that the bidi cache size
12761 does not exceed that of the largest Lisp string or buffer. See Eli
12762 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12764 * alloc.c (__malloc_size_t): Remove.
12765 All uses replaced by size_t. See Andreas Schwab's note
12766 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12768 * image.c: Improve checking for integer overflow.
12769 (check_image_size): Assume that f is nonnull, since
12770 it is always nonnull in practice. This is one less thing to
12771 worry about when checking for integer overflow later.
12772 (x_check_image_size): New function, which checks for integer
12773 overflow issues inside X.
12774 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12775 This removes the need for a memory_full check.
12776 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12777 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12778 (xbm_read_bitmap_data): Change locals back to 'int', since
12779 their values must fit in 'int'.
12780 (xpm_load_image, png_load, tiff_load):
12781 Invoke x_create_x_image_and_pixmap earlier,
12782 to avoid much needless work if the image is too large.
12783 (tiff_load): Treat overly large images as if
12784 x_create_x_image_and_pixmap failed, not as malloc failures.
12785 (gs_load): Use x_check_image_size.
12787 * gtkutil.c: Omit integer casts.
12788 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12789 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12791 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12793 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12794 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12795 would wrongly return t on a 64-bit host.
12797 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12798 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12799 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12800 and therefore cause GCC to emit a bogus diagnostic in some cases.
12802 * image.c: Integer signedness and overflow and related fixes.
12803 This is not an exhaustive set of fixes, but it's time to
12804 record what I've got.
12805 (lookup_pixel_color, check_image_size): Remove redundant decls.
12806 (check_image_size): Don't assume that arbitrary EMACS_INT values
12807 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12808 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12809 (tiff_load, imagemagick_load_image):
12810 Check for overflow in size calculations.
12811 (x_create_x_image_and_pixmap): Remove unnecessary test for
12812 xmalloc returning NULL; that can't happen.
12813 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12814 (xpm_color_bucket): Use better integer hashing function.
12815 (xpm_cache_color): Don't possibly over-allocate memory.
12816 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12817 (gif_memory_source):
12818 Use ptrdiff_t, not int or size_t, to record sizes.
12819 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12820 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12821 either works, as we prefer signed integers.
12822 (tiff_read_from_memory, tiff_write_from_memory):
12823 Return tsize_t, not size_t, since that's what the TIFF API wants.
12824 (tiff_read_from_memory): Don't fail simply because the read would
12825 go past EOF; instead, return a short read.
12826 (tiff_load): Omit no-longer-needed casts.
12827 (Fimagemagick_types): Don't assume size fits into 'int'.
12829 Improve hashing quality when configured --with-wide-int.
12830 * fns.c (hash_string): New function, taken from sxhash_string.
12831 Do not discard information about ASCII character case; this
12832 discarding is no longer needed.
12833 (sxhash-string): Use it. Change sig to match it. Caller changed.
12834 * lisp.h: Declare it.
12835 * lread.c (hash_string): Remove, since we now use fns.c's version.
12836 The fns.c version returns a wider integer if --with-wide-int is
12837 specified, so this should help the quality of the hashing a bit.
12839 * emacs.c: Integer overflow minor fix.
12840 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12841 Define only if GNU_LINUX.
12842 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12844 * dispnew.c: Integer signedness and overflow fixes.
12845 Remove unnecessary forward decls, that were a maintenance hassle.
12846 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12848 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12849 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12850 (prepare_desired_row, line_draw_cost):
12851 Use int, not unsigned, where either works.
12852 (save_current_matrix, restore_current_matrix):
12853 Use ptrdiff_t, not size_t, where either works.
12854 (init_display): Check for overflow more accurately, and without
12855 relying on undefined behavior.
12857 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12858 Remove, replacing with the new symbols in lisp.h. All uses changed.
12859 * fileio.c (make_temp_name):
12860 * filelock.c (lock_file_1, lock_file):
12861 * xdisp.c (message_dolog):
12862 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12863 Use pMd etc. instead.
12864 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12865 replacing the pWIDE etc. symbols removed from editfns.c.
12867 * keyboard.h (num_input_events): Now uintmax_t.
12868 This is (very slightly) less likely to mess up due to wraparound.
12871 * buffer.c: Integer signedness fixes.
12872 (alloc_buffer_text, enlarge_buffer_text):
12873 Use ptrdiff_t rather than size_t when either will do, as we prefer
12876 * alloc.c: Integer signedness and overflow fixes.
12877 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12878 (__malloc_size_t): Default to size_t, not to int.
12879 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12880 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12881 Prefer ptrdiff_t to size_t when either would do, as we prefer
12883 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12884 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12885 Now const. Initialize with values that are in range even if char
12887 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12888 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12889 These functions do the right thing with sizes > 2**32.
12890 (check_depth): Now ptrdiff_t, not int.
12891 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12892 Adjust to new way of storing sizes. Check for size overflow bugs
12894 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12895 slightly wrong anyway, as it missed one instance of
12896 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12897 (refill_memory_reserve): Omit needless cast to size_t.
12898 (mark_object_loop_halt): Mark as externally visible.
12900 * xselect.c: Integer signedness and overflow fixes.
12901 (Fx_register_dnd_atom, x_handle_dnd_message):
12902 Use ptrdiff_t, not size_t, since we prefer signed.
12903 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12904 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12905 x_dnd_atoms_size and x_dnd_atoms_length.
12907 * doprnt.c: Prefer signed to unsigned when either works.
12909 * doprnt.c (doprnt):
12911 * xdisp.c (vmessage):
12912 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12913 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12914 prefer signed arithmetic to avoid comparison confusion.
12915 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12916 but is a bit tricky.
12918 Assume freestanding C89 headers, string.h, stdlib.h.
12919 * data.c, doprnt.c, floatfns.c, print.c:
12920 Include float.h unconditionally.
12921 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12922 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12923 * regex.c: Likewise for stddef.h, string.h.
12924 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12925 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12926 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12927 (STDC_HEADERS): Remove obsolete defines.
12928 * sysdep.c: Include limits.h unconditionally.
12930 Assume support for memcmp, memcpy, memmove, memset.
12931 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12932 * regex.c (memcmp, memcpy):
12933 Remove; we assume C89 now.
12935 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12936 (__malloc_safe_bcopy): Remove; no longer needed.
12938 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12939 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12940 well either way, and we prefer signed to unsigned.
12942 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12944 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12945 closes the connection while we're reading (bug#9182).
12947 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12949 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12950 are specified (Bug#9168).
12952 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12954 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12955 Found by GCC static checking and --with-wide-int on a 32-bit host.
12957 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12959 * xdisp.c (compute_display_string_pos): Fix logic of caching
12960 previous display string position. Initialize cached_prev_pos to
12961 -1. Fixes slow-down at the beginning of a buffer.
12963 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12965 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12966 for attrs[LFACE_FONTSET_INDEX].
12968 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12970 * xml.c (parse_region): Remove unused local
12971 that was recently introduced.
12973 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12975 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12976 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12978 * xdisp.c (move_it_in_display_line_to): Record the best matching
12979 position for TO_CHARPOS while scanning the line, and restore it on
12980 exit if none of the characters scanned was an exact match.
12981 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12982 when exact match is impossible due to invisible text, and the
12983 lines are truncated.
12985 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12987 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12990 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12992 Fix a significant slow-down of cursor motion with C-n, C-p,
12993 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12994 auto-repeat under bidi redisplay in fontified buffers.
12995 * xdisp.c (compute_stop_pos_backwards): New function.
12996 (next_element_from_buffer): Call compute_stop_pos_backwards to
12997 find a suitable prev_stop when we find ourselves before
12999 (reseat): Don't look for prev_stop, as that could mean a very long
13001 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13002 <cached_disp_overlay_modiff>: Cache for last found display string
13004 (compute_display_string_pos): Return the cached position if asked
13005 about the same buffer in the same area of character positions, and
13006 the buffer wasn't changed since the time the display string
13007 position was cached.
13009 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13011 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13012 is an integer, which is important for empty lines. (Bug#9149)
13014 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13016 * frame.c (Fmodify_frame_parameters): In tty case, update the
13017 default face if necessary (Bug#4238).
13019 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13021 * editfns.c (Fstring_to_char): No need to explain what a character
13022 is in the docstring (Bug#6576).
13024 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13026 * xml.c (parse_region): Make sure we always return a tree.
13028 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13030 * xml.c (parse_region): If a document contains only comments,
13033 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13035 * xml.c (make_dom): Return comments, too.
13037 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13040 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13041 and the surrounding thread.
13042 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13043 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13044 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13046 * s/openbsd.h (BROKEN_SIGIO): Define.
13047 * unexelf.c (unexec) [__OpenBSD__]:
13048 Don't update the .mdebug section of the Alpha COFF symbol table.
13050 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13052 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13055 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13057 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13058 This fixes some race conditions on the permissions of any newly
13061 * alloc.c (valid_pointer_p): Use pipe, not open.
13062 This fixes some permissions issues when debugging.
13064 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13065 If fchown fails to set both uid and gid, try to set just gid,
13066 as that is sometimes allowed. Adjust the file's mode to eliminate
13067 setuid or setgid bits that are inappropriate if fchown fails.
13069 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13071 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13072 to compare Lisp_Objects.
13073 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13074 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13075 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13077 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13079 * lread.c (read_integer): Unread even EOF character.
13080 (read1): Likewise. Properly record start position of symbol.
13082 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13083 symbol character follows.
13085 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13087 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13088 This works around a problem with the previous change to Fcopy_file.
13089 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13090 and without this change, GCC might complain about discarding
13091 fchown's return value.
13093 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13095 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13097 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13099 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13101 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13103 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13104 it's used from the C level.
13106 * process.c: Use the same condition for POLL_FOR_INPUT in both
13107 keyboard.c and process.c (bug#1858).
13109 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13111 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13112 (Fgnutls_boot): Use it.
13114 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13116 * doc.c (Fsubstitute_command_keys): Revert last change.
13118 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13120 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13121 quotes the next character, and doesn't affect other longer
13122 sequences (bug#8935).
13124 * lread.c (syms_of_lread): Clarify that is isn't only
13125 `eval-buffer' and `eval-defun' that's affected by
13126 `lexical-binding' (bug#8460).
13128 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13130 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13131 bidi redisplay when a line includes both an image and is truncated.
13133 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13135 Fix minor problems found by static checking.
13136 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13137 (elsz): Now a signed constant, not a size_t var. We prefer signed
13138 types to unsigned, to avoid integer comparison confusion. Without
13139 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13140 "cannot optimize loop, the loop counter may overflow", a symptom
13142 * indent.c (Fvertical_motion): Mark locals as initialized.
13143 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13145 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13147 * search.c (Fre_search_backward): Mention `case-fold-search' in
13148 all the re_search_* functions (bug#8138).
13150 * keyboard.c (Fopen_dribble_file): Document when the file is
13153 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13155 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13158 Support bidi reordering of display and overlay strings.
13159 * xdisp.c (compute_display_string_pos)
13160 (compute_display_string_end): Accept additional argument STRING.
13161 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13162 (reseat_to_string): Initialize bidi_it->string.s and
13163 bidi_it->string.schars.
13164 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13165 NULL (avoids a crash in bidi_paragraph_init).
13166 Initialize itb.string.lstring.
13167 (init_iterator): Call bidi_init_it only of a valid
13168 buffer position was specified. Initialize paragraph_embedding to
13170 (reseat_to_string): Initialize the bidi iterator.
13171 (display_string): If we need to ignore text properties of
13172 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13173 original value of -1 will not work with bidi.)
13174 (compute_display_string_pos): First arg is now struct
13175 `text_pos *'; all callers changed. Support display properties on
13177 (compute_display_string_end): Support display properties on Lisp
13179 (init_iterator, reseat_1, reseat_to_string): Initialize the
13180 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13181 when iterating on a string not from display properties).
13182 (compute_display_string_pos, compute_display_string_end):
13183 Fix calculation of the object to scan. Fixes an error when using
13185 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13186 base_level_stop; instead, set base_level_stop to BEGV.
13187 Fixes crashes in vertical-motion.
13188 (next_element_from_buffer): Improve commentary for when
13189 the iterator is before prev_stop.
13190 (init_iterator): Initialize bidi_p from the default value of
13191 bidi-display-reordering, not from buffer-local value. Use the
13192 buffer-local value only if initializing for buffer iteration.
13193 (handle_invisible_prop): Support invisible properties on strings
13194 that are being bidi-reordered.
13195 (set_iterator_to_next): Support bidi reordering of C strings and
13197 (next_element_from_string): Support bidi reordering of Lisp
13199 (handle_stop_backwards): Support Lisp strings as well.
13200 (display_string): Support display of R2L glyph rows.
13201 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13202 (init_iterator): Don't initialize it->bidi_p for strings
13204 (reseat_to_string): Initialize it->bidi_p for strings here.
13205 (next_element_from_string, next_element_from_c_string)
13206 (next_element_from_buffer): Add xassert's for correspondence
13207 between IT's object being iterated and it->bidi_it.string
13209 (face_before_or_after_it_pos): Support bidi iteration.
13210 (next_element_from_c_string): Handle the case of the first string
13211 character that is not the first one in the visual order.
13212 (get_visually_first_element): New function, refactored from common
13213 parts of next_element_from_buffer, next_element_from_string, and
13214 next_element_from_c_string.
13215 (tool_bar_lines_needed, redisplay_tool_bar)
13216 (display_menu_bar): Force left-to-right direction. Add a FIXME
13217 comment for making that be controlled by a user option.
13218 (push_it, pop_it): Save and restore the state of the
13219 bidi iterator. Save and restore the bidi_p flag.
13220 (pop_it): Iterate out of display property for string iteration as
13222 (iterate_out_of_display_property): Support iteration over strings.
13223 (handle_single_display_spec): Set up it->bidi_it for iteration
13224 over a display string, and call bidi_init_it.
13225 (handle_single_display_spec, next_overlay_string)
13226 (get_overlay_strings_1, push_display_prop): Set up the bidi
13227 iterator for displaying display or overlay strings.
13228 (forward_to_next_line_start): Don't use the shortcut if
13230 (back_to_previous_visible_line_start): If handle_display_prop
13231 pushed the iterator stack, restore the internal state of the bidi
13232 iterator by calling bidi_pop_it same number of times.
13233 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13234 and we are bidi-iterating, don't decrement the iterator position;
13235 instead, set the first_elt flag in the bidi iterator, to produce
13237 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13238 (push_display_prop): xassert that we are iterating a buffer.
13239 (push_it, pop_it): Save and restore paragraph_embedding member.
13240 (handle_single_display_spec, next_overlay_string)
13241 (get_overlay_strings_1, reseat_1, reseat_to_string)
13242 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13243 correctly. Don't assume unibyte strings are not bidi-reordered.
13244 (compute_display_string_pos)
13245 (compute_display_string_end): Fix handling the case of C string.
13246 (push_it, pop_it): Save and restore from_disp_prop_p.
13247 (handle_single_display_spec, push_display_prop): Set the
13248 from_disp_prop_p flag.
13249 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13250 (pop_it): Call iterate_out_of_display_property only if we are
13251 popping after iteration over a string that came from a display
13252 property. Fix a typo in popping stretch info. Add an assertion
13253 for verifying that the iterator position is in sync with the bidi
13255 (handle_single_display_spec, get_overlay_strings_1)
13256 (push_display_prop): Fix initialization of paragraph direction for
13257 string when that of the parent object is not yet determined.
13258 (reseat_1): Call bidi_init_it to resync the bidi
13259 iterator with IT's position. (Bug#7616)
13260 (find_row_edges): If ROW->start.pos gives position
13261 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13262 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13263 Reset the from_disp_prop_p flag.
13264 (SAVE_IT, RESTORE_IT): New macros.
13265 (pos_visible_p, face_before_or_after_it_pos)
13266 (back_to_previous_visible_line_start)
13267 (move_it_in_display_line_to, move_it_in_display_line)
13268 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13269 (try_scrolling, redisplay_window, display_line): Use them when
13270 saving a temporary copy of the iterator and restoring it back.
13271 (back_to_previous_visible_line_start, reseat_1)
13272 (init_iterator): Empty the bidi cache "stack".
13273 (move_it_in_display_line_to): If iterator ended up at
13274 EOL, but we never saw any buffer positions smaller than
13275 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13276 motion in bidi-reordered lines.
13277 (move_it_in_display_line_to): Record prev_method and prev_pos
13278 immediately before the call to set_iterator_to_next. Fixes cursor
13279 motion in bidi-reordered lines with stretch glyphs and strings
13280 displayed in margins. (Bug#8133) (Bug#8867)
13281 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13283 (pos_visible_p): Support positions in bidi-reordered lines.
13284 Save and restore bidi cache.
13286 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13287 (bidi_paragraph_info): Delete unused struct.
13288 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13289 (bidi_cache_start): New variable.
13290 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13292 (bidi_cache_fetch_state, bidi_cache_search)
13293 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13294 (bidi_cache_find, bidi_peek_at_next_level)
13295 (bidi_level_of_next_char, bidi_find_other_level_edge)
13296 (bidi_move_to_visually_next): Compare cache index with
13297 bidi_cache_start rather than with zero.
13298 (bidi_fetch_char): Accept new argument STRING; all callers
13299 changed. Support iteration over a string. Support strings with
13300 display properties. Support unibyte strings. Fix the type of
13301 `len' according to what STRING_CHAR_AND_LENGTH expects.
13302 (bidi_paragraph_init, bidi_resolve_explicit_1)
13303 (bidi_resolve_explicit, bidi_resolve_weak)
13304 (bidi_level_of_next_char, bidi_move_to_visually_next):
13305 Support iteration over a string.
13306 (bidi_set_sor_type, bidi_resolve_explicit_1)
13307 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13308 can now be zero (for strings); special values 0 and -1 were
13309 changed to -1 and -2, respectively.
13310 (bidi_char_at_pos): New function.
13311 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13312 Call it instead of FETCH_MULTIBYTE_CHAR.
13313 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13314 initialized to valid values.
13315 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13317 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13318 the test for valid cached positions. Fix the logic for looking up
13319 the sentinel state in the cache. GCPRO the Lisp string we are
13321 (bidi_push_it, bidi_pop_it): New functions.
13322 (bidi_initialize): Initialize the bidi cache start stack pointer.
13323 (bidi_cache_ensure_space): New function, refactored from part of
13324 bidi_cache_iterator_state. Don't assume the required size is just
13325 one BIDI_CACHE_CHUNK away.
13326 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13327 (bidi_count_bytes, bidi_char_at_pos): New functions.
13328 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13329 always valid if bidi_cache_idx is valid.
13330 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13331 is valid if it's going to be used.
13332 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13333 (bidi_cache_fetch_state, bidi_cache_search)
13334 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13335 (bidi_cache_iterator_state, bidi_cache_find)
13336 (bidi_find_other_level_edge, bidi_cache_start_stack):
13337 All variables related to cache indices are now EMACS_INT.
13339 * dispextern.h (struct bidi_string_data): New structure.
13340 (struct bidi_it): New member `string'. Make flag members be 1-bit
13341 fields, and put them last in the struct.
13342 (compute_display_string_pos, compute_display_string_end):
13344 (bidi_push_it, bidi_pop_it): Add prototypes.
13345 (struct iterator_stack_entry): New members bidi_p,
13346 paragraph_embedding, and from_disp_prop_p.
13347 (struct it): Member bidi_p is now a bit field 1 bit wide.
13348 (bidi_shelve_cache, bidi_unshelve_cache):
13349 Declare prototypes.
13351 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13352 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13353 and vector-like objects.
13355 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13356 cache around display iteration.
13358 * window.c (Fwindow_end, window_scroll_pixel_based)
13359 (displayed_window_lines, Frecenter): Save and restore the bidi
13360 cache around display iteration.
13362 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13364 * editfns.c (Fdelete_region): Clarify the use of the named
13365 parameters (bug#6788).
13367 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13369 * indent.c (Fvertical_motion): Set and restore w->pointm when
13370 saving and restoring the window's buffer (Bug#9006).
13372 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13374 * editfns.c (Fstring_to_char): Clarify just what is returned
13375 (bug#6576). Text by Eli Zaretskii.
13377 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13379 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13381 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13383 * buffer.c (mmap_find): Fix a typo.
13385 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13387 Fix execution of x selection hooks.
13388 * xselect.c (Qx_lost_selection_functions)
13389 (Qx_sent_selection_functions): New vars.
13390 (syms_of_xselect): DEFSYM them.
13391 (x_handle_selection_request): Pass Qx_sent_selection_functions
13392 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13393 (x_handle_selection_clear,x_clear_frame_selections):
13394 Pass Qx_lost_selection_functions rather than
13395 Vx_lost_selection_functions to Frun_hook_with_args.
13397 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13399 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13400 The old code sometimes used this field without initializing it.
13402 * alloc.c (gc_sweep): Don't read past end of array.
13403 In theory, the old code could also have corrupted Emacs internals,
13404 though it'd be very unlikely.
13406 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13408 * character.c (Fcharacterp): Don't advertise optional ignored
13409 argument. (Bug#4026)
13411 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13413 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13416 * window.c (Fset_window_start): Doc fix (bug#4199).
13417 (Fset_window_hscroll): Ditto.
13419 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13421 Fix minor new problems caught by GCC 4.6.1.
13422 * term.c (init_tty): Remove unused local.
13423 * xsettings.c (store_monospaced_changed): Define this function only
13424 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13425 not used otherwise.
13427 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13429 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13431 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13433 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13434 are the mini-buffer and the echo area (bug#3320).
13436 * term.c (init_tty): Remove support for supdup, c10 and perq
13437 terminals, which are no longer supported (bug#1482).
13439 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13441 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13443 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13445 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13446 for non-popups (Bug#3642).
13448 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13450 * alloc.c (reset_malloc_hooks): Protoize.
13451 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13452 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13453 * cm.c (losecursor): Likewise.
13454 * data.c (fmod): Likewise.
13455 * dispnew.c (swap_glyphs_in_rows): Likewise.
13456 * emacs.c (memory_warning_signal): Likewise.
13457 * floatfns.c (float_error): Likewise.
13458 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13459 (otf_open, font_otf_capability, generate_otf_features)
13460 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13462 * image.c (pbm_read_file): Likewise.
13463 * indent.c (string_display_width): Likewise.
13464 * intervals.c (check_for_interval, search_for_interval)
13465 (inc_interval_count, count_intervals, root_interval)
13466 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13467 * lread.c (defalias): Likewise.
13468 * ralloc.c (r_alloc_check): Likewise.
13469 * regex.c (set_image_of_range_1, set_image_of_range)
13470 (regex_grow_registers): Likewise.
13471 * sysdep.c (strerror): Likewise.
13472 * termcap.c (valid_filename_p, tprint, main): Likewise.
13473 * tparam.c (main): Likewise.
13474 * unexhp9k800.c (run_time_remap, save_data_space)
13475 (update_file_ptrs, read_header, write_header, calculate_checksum)
13476 (copy_file, copy_rest, display_header): Likewise.
13477 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13479 * xdisp.c (check_it): Likewise.
13480 * xfaces.c (register_color, unregister_color, unregister_colors):
13482 * xfns.c (print_fontset_result): Likewise.
13483 * xrdb.c (member, fatal, main): Likewise.
13485 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13487 Fix minor problems found by static checking (Bug#9031).
13488 * chartab.c (char_table_set_range, map_sub_char_table):
13489 Remove unused locals.
13490 (uniprop_table): Now static.
13491 * composite.c (_work_char): Remove unused static var.
13493 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
13495 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13497 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13499 * gtkutil.c (qttip_cb): Remove code without function.
13501 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13503 * w32.c (pthread_sigmask): New stub.
13505 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13507 Use pthread_sigmask, not sigprocmask (Bug#9010).
13508 sigprocmask is portable only for single-threaded applications, and
13509 Emacs can be multi-threaded when it uses GTK.
13510 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13512 * callproc.c (Fcall_process):
13513 * process.c (create_process):
13514 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13515 Use pthread_sigmask, not sigprocmask.
13517 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13519 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13520 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13523 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13525 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13526 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13527 (xg_hide_tooltip): Fix comment.
13529 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13530 in registerServicesMenuSendTypes.
13531 (validRequestorForSendType): Don't check ns_return_types.
13533 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13536 2011-07-08 Jason Rumney <jasonr@gnu.org>
13538 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13539 SH_SHOW for hidden windows (Bug#5482).
13541 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13542 frame struct members of non-existent frames (Bug#6284).
13544 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13546 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13547 variable firstTime not needed on OSX >= 10.6.
13548 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13549 >= 10.5. Use setKnobProportion, setDoubleValue.
13551 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13552 (MAC_OS_X_VERSION_10_5): Define if not defined.
13553 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13554 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13555 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13557 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13558 cString and lossyCString on OSX >= 10.4.
13560 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13561 sizeToFit on OSX >= 10.2.
13563 * nsimage.m (allocInitFromFile): Don't use deprecated method
13564 bestRepresentationForDevice on OSX >= 10.6.
13566 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13569 * emacs.c: Declare unexec_init_emacs_zone.
13571 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13573 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13575 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13576 on svcsMenu (Bug#8842).
13578 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13580 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13582 * nsterm.m (QUTF8_STRING): Declare.
13583 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13584 (validRequestorForSendType): Return type is (id).
13585 Change indexOfObjectIdenticalTo to indexOfObject.
13586 Check if we have local selection before returning self (Bug#8842).
13587 (writeSelectionToPasteboard): Put local selection into paste board
13588 if we have a local selection (Bug#8842).
13589 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13591 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13592 (ns_get_local_selection): Declare.
13594 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13596 * keymap.c (describe_map_tree): Don't insert a double newline at
13597 the end of the buffer (bug#1169) and return whether we inserted
13600 * callint.c (Fcall_interactively): Change "reading args" to
13601 "providing args" to try to clarify what it does (bug#1010).
13603 2011-07-07 Kenichi Handa <handa@m17n.org>
13605 * composite.c (composition_compute_stop_pos): Ignore a static
13606 composition starting before CHARPOS (Bug#8915).
13608 * xdisp.c (handle_composition_prop): Likewise.
13610 2011-07-07 Eli Zaretskii <eliz@gnu.org>
13612 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13615 2011-07-07 Kenichi Handa <handa@m17n.org>
13617 * character.h (unicode_category_t): New enum type.
13619 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13620 (Qchar_code_property_table): New variable.
13621 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13622 (UNIPROP_COMPRESSED_FORM_P): New macros.
13623 (char_table_ascii): Uncompress the compressed values.
13624 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13625 Uncompress the compressed values.
13626 (sub_char_table_ref_and_range): Likewise.
13627 (char_table_ref_and_range): Uncompress the compressed values.
13628 (sub_char_table_set): New arg is_uniprop. Callers changed.
13629 Uncompress the compressed values.
13630 (sub_char_table_set_range): Args changed. Callers changed.
13631 (char_table_set_range): Adjuted for the above change.
13632 (map_sub_char_table): Delete args default_val and parent. Add arg
13633 top. Give decoded values to a Lisp function.
13634 (map_char_table): Adjust for the above change. Give decoded
13635 values to a Lisp function. Gcpro more variables.
13636 (uniprop_table_uncompress)
13637 (uniprop_decode_value_run_length): New functions.
13638 (uniprop_decoder, uniprop_decoder_count): New variables.
13639 (uniprop_get_decoder, uniprop_encode_value_character)
13640 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13642 (uniprop_encoder, uniprop_encoder_count): New variables.
13643 (uniprop_get_encoder, uniprop_table)
13644 (Funicode_property_table_internal, Fget_unicode_property_internal)
13645 (Fput_unicode_property_internal): New functions.
13646 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13647 Sunicode_property_table_internal, Sget_unicode_property_internal,
13648 and Sput_unicode_property_internal. Defvar_lisp
13649 char-code-property-alist.
13651 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13652 Vunicode_category_table.
13654 * font.c (font_range): Adjust for the change of
13655 Vunicode_category_table.
13657 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13659 * m/iris4d.h: Remove file, move contents ...
13660 * s/irix6-5.h: ... here.
13662 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13664 Remove unportable assumption about struct layout (Bug#8884).
13665 * alloc.c (mark_buffer):
13666 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13667 (clone_per_buffer_values): Don't assume that
13668 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13669 This isn't true in general, and it's particularly not true
13670 if Emacs is configured with --with-wide-int.
13671 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13672 New macros, used in the buffer.c change.
13674 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13676 * xsettings.c: Use both GConf and GSettings if both are available.
13677 (store_config_changed_event): Add comment.
13678 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13679 (store_tool_bar_style_changed): New functions.
13680 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
13681 (struct xsettings): Move font inside HAVE_XFT.
13682 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13683 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13684 Move inside HAVE_XFT.
13685 (something_changed_gsettingsCB): Rename from something_changedCB.
13686 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13688 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13689 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
13690 (something_changed_gconfCB): Rename from something_changedCB.
13691 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13692 (parse_settings): Move check for font inside HAVE_XFT.
13693 (read_settings, apply_xft_settings): Add comment.
13694 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13695 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13696 call store_font_name_changed.
13697 (xft_settings_event): Add comment.
13698 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13699 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13700 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13701 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13702 (xsettings_initialize): Call init_gsettings last.
13703 (xsettings_get_system_font, xsettings_get_system_normal_font):
13706 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13708 Random fixes. E.g., (random) never returned negative values.
13709 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13710 subseconds part to the entropy, as that's a bit more random.
13711 Prefer signed to unsigned, since the signedness doesn't matter and
13712 in general we prefer signed. When given a limit, use a
13713 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13714 latter isn't right if USE_2_TAGS_FOR_INTS.
13715 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13716 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13718 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13720 * textprop.c (text_property_stickiness):
13721 Obey Vtext_property_default_nonsticky.
13722 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13723 * w32fns.c (syms_of_w32fns):
13724 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13726 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13728 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13729 This is more efficient than Ffile_directory_p and avoids a minor race.
13731 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13733 * buffer.c (Foverlay_put): Say what the return value is
13736 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13737 is a directory before asking whether to use the file name
13739 (barf_or_query_if_file_exists): Make the "File is a directory"
13740 error be more correct.
13742 * fns.c (Frequire): Remove the mention of the .gz files, since
13743 that's installation-specific, but keep the mention of
13744 `get-load-suffixes'.
13746 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13748 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13749 Report string overflow if the output is too long.
13751 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
13753 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13754 (syms_of_gnutls): Remove duplicate DEFSYM for
13755 Qgnutls_bootprop_verify_hostname_error, an error for
13756 Qgnutls_bootprop_verify_error (which is no longer used).
13758 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13759 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13760 Also (re)move comments that are misplaced or no longer relevant.
13762 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13764 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13766 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
13768 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13769 and background color parameters if they have been changed.
13771 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13773 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13775 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13777 * xsettings.c (SYSTEM_FONT): Define only when used.
13778 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13780 * keymap.c (access_keymap_1): Now static.
13782 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
13784 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13785 leave any prefix arg for the up event (Bug#1586).
13787 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13789 * lread.c (syms_of_lread): Mention single symbols defined by
13790 `defvar' or `defconst' (bug#7154).
13792 * fns.c (Frequire): Mention .el.gz files (bug#7314).
13793 (Frequire): Mention get-load-suffixes.
13795 2011-07-02 Martin Rudalics <rudalics@gmx.at>
13797 * window.h (window): Remove clone_number slot.
13798 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13800 (make_parent_window, make_window, saved_window)
13801 (Fset_window_configuration, save_window_save): Don't deal with
13803 * buffer.c (Qclone_number): Remove declaration.
13804 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13806 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13808 Add multiple inheritance to keymaps.
13809 * keymap.c (Fmake_composed_keymap): New function.
13810 (Fset_keymap_parent): Simplify.
13811 (fix_submap_inheritance): Remove.
13812 (access_keymap_1): New function extracted from access_keymap to handle
13813 embedded parents and handle lists of maps.
13814 (access_keymap): Use it.
13815 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13816 (Fcopy_keymap): Handle embedded parents.
13817 (Fcommand_remapping, define_as_prefix): Simplify.
13818 (Fkey_binding): Simplify.
13819 (syms_of_keymap): Move minibuffer-local-completion-map,
13820 minibuffer-local-filename-completion-map,
13821 minibuffer-local-must-match-map, and
13822 minibuffer-local-filename-must-match-map to Elisp.
13823 (syms_of_keymap): Defsubr make-composed-keymap.
13824 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13825 (parse_menu_item): Trivial simplification.
13827 2011-07-01 Glenn Morris <rgm@gnu.org>
13829 * Makefile.in (SETTINGS_LIBS): Fix typo.
13831 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13833 * coding.c (Fencode_coding_string): Record the last coding system
13834 used, as the function doc string says (bug#8738).
13836 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13838 * xsettings.c (store_monospaced_changed): Take new font as arg and
13839 check for change against current_mono_font.
13840 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13841 (emacs_settings_constructor, emacs_settings_get_property)
13842 (emacs_settings_set_property, emacs_settings_class_init)
13843 (emacs_settings_init, gsettings_obj): Remove.
13844 (something_changedCB): New function for HAVE_GSETTINGS.
13845 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13846 with value as argument.
13847 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13848 g_settings_new (Bug#8967). Do not create gsettings_obj.
13849 Remove calls to g_settings_bind. Connect something_changedCB to
13852 * xgselect.c: Add defined (HAVE_GSETTINGS).
13853 (xgselect_initialize): Ditto.
13855 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13856 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13859 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13861 * eval.c (struct backtrace): Simplify and port the data structure.
13862 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13863 signed bit field, as this assumption is not portable and it makes
13864 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13865 "char debug_on_exit : 1" as this is not portable either; instead,
13866 use the portable "unsigned int debug_on_exit : 1". Remove unused
13867 member evalargs. Remove obsolete comments about cc bombing out.
13869 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13871 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
13872 Let HAVE_GSETTINGS override HAVE_GCONF.
13873 (store_monospaced_changed): New function.
13874 (EMACS_SETTINGS): A new type derived from GObject to handle
13875 GSettings notifications.
13876 (emacs_settings_constructor, emacs_settings_get_property)
13877 (emacs_settings_set_property, emacs_settings_class_init):
13879 (gsettings_client, gsettings_obj): New variables.
13880 (GSETTINGS_SCHEMA): New define.
13881 (something_changedCB): Call store_monospaced_changed.
13882 (init_gsettings): New function.
13883 (xsettings_initialize): Call init_gsettings.
13884 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13887 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13890 2011-06-29 Martin Rudalics <rudalics@gmx.at>
13892 * window.c (resize_root_window, grow_mini_window)
13893 (shrink_mini_window): Rename Qresize_root_window to
13894 Qwindow_resize_root_window and Qresize_root_window_vertically to
13895 Qwindow_resize_root_window_vertically.
13897 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13899 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13901 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
13903 * makefile.w32-in: Redesign dependencies so they reflect more
13904 clearly which files are directly included by each source file,
13905 and not through other includes.
13907 2011-06-27 Martin Rudalics <rudalics@gmx.at>
13909 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13910 (sort_overlays, overlay_strings): When an overlay's clone number
13911 matches the window's clone number process the overlay even if
13912 the overlay's window property doesn't match the current window.
13914 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13915 (Fwindow_hchild): Rename to Fwindow_left_child.
13916 (Fwindow_next): Rename to Fwindow_next_sibling.
13917 (Fwindow_prev): Rename to Fwindow_prev_sibling.
13918 (resize_window_check): Rename to window_resize_check.
13919 (resize_window_apply): Rename to window_resize_apply.
13920 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13921 (Fdelete_other_windows_internal, resize_frame_windows)
13922 (Fsplit_window_internal, Fdelete_window_internal)
13923 (grow_mini_window, shrink_mini_window)
13924 (Fresize_mini_window_internal): Fix callers accordingly.
13926 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13928 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13929 (emacs_fixed_set_min_size): Remove.
13930 (emacs_fixed_new): Take frame as argument.
13932 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13933 (_EmacsFixedPrivate): Remove minwidth/height.
13934 Add struct frame *f.
13935 (emacs_fixed_init): Initialize priv->f.
13936 (get_parent_class, emacs_fixed_set_min_size): Remove.
13937 (emacs_fixed_new): Set priv->f to argument.
13938 (emacs_fixed_get_preferred_width)
13939 (emacs_fixed_get_preferred_height): Use min_width/height from
13940 frames size_hint to set minimum and natural (Bug#8919).
13941 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13942 and use min_width/height from frames size_hint to set
13943 min_width/height (Bug#8919).
13945 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13946 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13949 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13951 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13952 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13955 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13957 * process.c (wait_reading_process_output): Bypass select if
13958 waiting for a cell while ignoring keyboard input, and input is
13959 pending. Suggested by Jan Djärv (Bug#8869).
13961 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13963 Use gnulib's dup2 module instead of rolling our own.
13964 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13966 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13968 * dispnew.c (scrolling_window): Before scrolling, turn off a
13969 mouse-highlight in the window being scrolled.
13971 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13973 Move DEFSYM to lisp.h and use everywhere.
13975 * character.h (DEFSYM): Move declaration...
13976 * lisp.h (DEFSYM): ...here.
13982 * w32select.c: Don't include character.h.
13984 * alloc.c (syms_of_alloc):
13985 * buffer.c (syms_of_buffer):
13986 * bytecode.c (syms_of_bytecode):
13987 * callint.c (syms_of_callint):
13988 * casefiddle.c (syms_of_casefiddle):
13989 * casetab.c (init_casetab_once):
13990 * category.c (init_category_once, syms_of_category):
13991 * ccl.c (syms_of_ccl):
13992 * cmds.c (syms_of_cmds):
13993 * composite.c (syms_of_composite):
13994 * dbusbind.c (syms_of_dbusbind):
13995 * dired.c (syms_of_dired):
13996 * dispnew.c (syms_of_display):
13997 * doc.c (syms_of_doc):
13998 * editfns.c (syms_of_editfns):
13999 * emacs.c (syms_of_emacs):
14000 * eval.c (syms_of_eval):
14001 * fileio.c (syms_of_fileio):
14002 * fns.c (syms_of_fns):
14003 * frame.c (syms_of_frame):
14004 * fringe.c (syms_of_fringe):
14005 * insdel.c (syms_of_insdel):
14006 * keymap.c (syms_of_keymap):
14007 * lread.c (init_obarray, syms_of_lread):
14008 * macros.c (syms_of_macros):
14009 * msdos.c (syms_of_msdos):
14010 * print.c (syms_of_print):
14011 * process.c (syms_of_process):
14012 * search.c (syms_of_search):
14013 * sound.c (syms_of_sound):
14014 * syntax.c (init_syntax_once, syms_of_syntax):
14015 * terminal.c (syms_of_terminal):
14016 * textprop.c (syms_of_textprop):
14017 * undo.c (syms_of_undo):
14018 * w32.c (globals_of_w32):
14019 * window.c (syms_of_window):
14020 * xdisp.c (syms_of_xdisp):
14021 * xfaces.c (syms_of_xfaces):
14022 * xfns.c (syms_of_xfns):
14023 * xmenu.c (syms_of_xmenu):
14024 * xsettings.c (syms_of_xsettings):
14025 * xterm.c (syms_of_xterm): Use DEFSYM.
14027 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14029 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14031 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14033 Integer and buffer overflow fixes (Bug#8873).
14035 * print.c (printchar, strout): Check for string overflow.
14036 (PRINTPREPARE, printchar, strout):
14037 Don't set size unless allocation succeeds.
14039 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14040 for sizes. Check for string overflow more accurately.
14041 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14043 * macros.c: Integer and buffer overflow fixes.
14044 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14045 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14046 Use ptrdiff_t, not int, for sizes.
14047 Don't increment bufsize until after realloc succeeds.
14048 Check for size-calculation overflow.
14049 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14051 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14053 * lread.c: Integer overflow fixes.
14054 (read_integer): Radix is now EMACS_INT, not int,
14055 to improve quality of diagnostics for out-of-range radices.
14056 Calculate buffer size correctly for out-of-range radices.
14057 (read1): Check for integer overflow in radices, and in
14058 read-circle numbers.
14059 (read_escape): Avoid int overflow.
14060 (Fload, openp, read_buffer_size, read1)
14061 (substitute_object_recurse, read_vector, read_list, map_obarray):
14062 Use ptrdiff_t, not int, for sizes.
14063 (read1): Use EMACS_INT, not int, for sizes.
14064 Check for size overflow.
14066 * image.c (cache_image): Check for size arithmetic overflow.
14068 * lread.c: Integer overflow issues.
14069 (saved_doc_string_size, saved_doc_string_length)
14070 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14071 Now ptrdiff_t, not int.
14072 (read1): Don't assume doc string length fits in int. Check for
14073 out-of-range doc string lengths.
14074 (read_list): Don't assume file position fits in int.
14075 (read_escape): Check for hex character overflow.
14077 2011-06-22 Leo Liu <sdl.web@gmail.com>
14079 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14080 Move to minibuffer.el.
14082 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14084 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14085 The following patches are for when GLYPH_DEBUG && !XASSERT.
14086 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14087 * dispnew.c (flush_stdout):
14088 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14089 Mark as externally visible.
14090 * dispnew.c (check_window_matrix_pointers): Now static.
14091 * dispnew.c (window_to_frame_vpos):
14092 * xfns.c (unwind_create_frame):
14093 * xterm.c (x_check_font): Remove unused local.
14094 * scroll.c (CHECK_BOUNDS):
14095 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14096 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14097 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14098 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14099 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14101 (debug_method_add): Use va_list and vsprintf rather than relying
14102 on undefined behavior with wrong number of arguments.
14103 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14104 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14105 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14106 since we're not interested in debugging glyphs with old libraries.
14107 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14108 GCC 4.6.0's static checking.
14110 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14112 Integer overflow and signedness fixes (Bug#8873).
14113 A few related buffer overrun fixes, too.
14115 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14117 * dispextern.h (struct face.stipple):
14118 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14119 (x_bitmap_mask, x_allocate_bitmap_record)
14120 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14121 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14122 (x_create_bitmap_from_xpm_data):
14123 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14124 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14126 * xfaces.c (load_pixmap):
14127 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14128 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14129 (.bitmaps_last, struct x_output.icon_bitmap):
14130 Use ptrdiff_t, not int, for bitmap indexes.
14131 (x_allocate_bitmap_record): Check for size overflow.
14132 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14134 Use ptrdiff_t, not int, for overlay counts.
14135 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14136 * editfns.c (overlays_around, get_pos_property):
14137 * textprop.c (get_char_property_and_overlay):
14138 * xdisp.c (next_overlay_change, note_mouse_highlight):
14139 * xfaces.c (face_at_buffer_position):
14140 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14141 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14142 (Fnext_overlay_change, Fprevious_overlay_change)
14143 (mouse_face_overlay_overlaps, Foverlays_in):
14144 Use ptrdiff_t, not int, for sizes.
14145 (overlays_at, overlays_in): Check for size-calculation overflow.
14147 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14149 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14150 (x_session_initialize): Do not assume string length fits in int.
14152 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14153 This is unlikely, but can occur if DPI is outlandish.
14155 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14156 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14158 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14159 * xrdb.c (magic_file_p, search_magic_path):
14160 Omit last arg SUFFIX; it was always 0. All callers changed.
14161 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14163 * xfont.c (xfont_match): Avoid need for strlen.
14165 * xfns.c: Don't assume strlen fits in int.
14166 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14168 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14169 not unsigned long, as we prefer signed integers. All callers changed.
14170 Detect integer overflow in repeat count.
14171 (message_dolog): Don't assume print length fits in 39 bytes.
14172 (display_mode_element): Don't assume strlen fits in int.
14174 * termcap.c: Don't assume sizes fit in int and never overflow.
14175 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14176 (gobble_line): Check for size-calculation overflow.
14178 * minibuf.c (Fread_buffer):
14179 * lread.c (intern, intern_c_string):
14180 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14181 Don't assume string length fits in int.
14183 * keyboard.c (parse_tool_bar_item):
14184 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14186 * font.c: Don't assume string length fits in int.
14187 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14188 Use ptrdiff_t, not int.
14189 (font_intern_prop): Don't assume string length fits in int.
14190 Don't assume integer property fits in fixnum.
14191 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14193 * filelock.c: Fix some buffer overrun and integer overflow issues.
14194 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14195 Reformulate so as not to need the command string.
14196 Invoke gzip -cd rather than gunzip, as it's more portable.
14197 (lock_info_type, lock_file_1, lock_file):
14198 Don't assume pid_t and time_t fit in unsigned long.
14199 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14200 (current_lock_owner): Prefer signed type for sizes.
14201 Use memcpy, not strncpy, where memcpy is what is really wanted.
14202 Don't assume (via atoi) that time_t and pid_t fit in int.
14203 Check for time_t and/or pid_t out of range, e.g., via a network share.
14204 Don't alloca where an auto var works fine.
14206 * fileio.c: Fix some integer overflow issues.
14207 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14208 Don't assume string length fits in int.
14209 (directory_file_name): Don't assume string length fits in long.
14210 (make_temp_name): Don't assume pid fits in int, or that its print
14211 length is less than 20.
14213 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14215 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14217 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14219 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14220 We prefer signed integers, even for size calculations.
14222 * emacs.c: Don't assume string length fits in 'int'.
14223 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14224 (main): Don't invoke strlen when not needed.
14226 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14227 (XD_DEBUG_MESSAGE): Don't waste a byte.
14229 * callproc.c (getenv_internal_1, getenv_internal)
14230 (Fgetenv_internal):
14231 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14233 * lread.c (invalid_syntax): Omit length argument.
14234 All uses changed. This doesn't fix a bug, but it simplifies the
14235 code away from its former Hollerith-constant appearance, and it's
14236 one less 'int' to worry about when looking at integer-overflow issues.
14237 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14239 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14240 This didn't break anything, but it didn't help either.
14241 It's confusing to put a bogus integer in a place where the actual
14242 value does not matter.
14243 (LIST_END_P): Remove unused macro and its bogus comment.
14244 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14246 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14247 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14249 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14250 We prefer signed types, and the value cannot exceed the EMACS_INT
14251 range anyway (because otherwise the length would not be representable).
14252 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14253 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14254 This avoids a GCC warning when WIDE_EMACS_INT.
14256 * indent.c (sane_tab_width): New function.
14257 (current_column, scan_for_column, Findent_to, position_indentation)
14258 (compute_motion): Use it. This is just for clarity.
14259 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14261 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14263 * lisp.h (lint_assume): New macro.
14264 * composite.c (composition_gstring_put_cache):
14265 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14267 * editfns.c, insdel.c:
14268 Omit unnecessary forward decls, to simplify future changes.
14270 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14272 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14274 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14275 Use much-faster test for byte-length change.
14276 Don't assume string byte-length fits in 'int'.
14277 Check that character arg fits in 'int'.
14278 (mapcar1): Declare byte as byte, for clarity.
14280 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14282 * fns.c (concat): Catch string overflow earlier.
14283 Do not rely on integer wraparound.
14285 * dispextern.h (struct it.overlay_strings_charpos)
14286 (struct it.selective): Now EMACS_INT, not int.
14287 * xdisp.c (forward_to_next_line_start)
14288 (back_to_previous_visible_line_start)
14289 (reseat_at_next_visible_line_start, next_element_from_buffer):
14290 Don't arbitrarily truncate the value of 'selective' to int.
14292 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14294 * composite.c: Don't truncate sizes to 'int'.
14295 (composition_gstring_p, composition_reseat_it)
14296 (composition_adjust_point): Use EMACS_INT, not int.
14297 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14298 not EMACS_UINT, for indexes.
14300 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14302 * buffer.c: Include <verify.h>.
14303 (struct sortvec.priority, struct sortstr.priority):
14304 Now EMACS_INT, not int.
14305 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14306 (struct sortstr.size, record_overlay_string)
14307 (struct sortstrlist.size, struct sortlist.used):
14308 Don't truncate size to int.
14309 (record_overlay_string): Check for size-calculation overflow.
14310 (init_buffer_once): Check at compile-time, not run-time.
14312 2011-06-22 Jim Meyering <meyering@redhat.com>
14314 Don't leak an XBM-image-sized buffer
14315 * image.c (xbm_load): Free the image buffer after using it.
14317 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14320 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14321 that Sun C diagnosed.
14322 * fns.c (secure_hash): Fix pointer signedness issue.
14323 * intervals.c (static_offset_intervals): New function.
14324 (offset_intervals): Use it.
14326 2011-06-21 Leo Liu <sdl.web@gmail.com>
14329 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14332 * fns.c (secure_hash): Rename from crypto_hash_function and change
14333 the first arg to accept symbols.
14334 (Fsecure_hash): New primitive.
14335 (syms_of_fns): New symbols.
14337 2011-06-20 Deniz Dogan <deniz@dogan.se>
14339 * process.c (Fset_process_buffer): Clarify return value in
14342 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14344 * dispnew.c (add_window_display_history): Use BVAR.
14346 * xdisp.c (debug_method_add): Use BVAR.
14347 (check_window_end, dump_glyph_matrix, dump_glyph)
14348 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14350 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14353 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14354 check till after the cache is created in init_frame_faces.
14356 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14358 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14360 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14362 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14363 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14364 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14366 Improve buffer-overflow checking (Bug#8873).
14367 * fileio.c (Finsert_file_contents):
14368 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14369 Remove the old (too-loose) buffer overflow checks.
14370 They weren't needed, since make_gap checks for buffer overflow.
14371 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14372 The old code merely checked for Emacs fixnum overflow, and relied
14373 on undefined (wraparound) behavior. The new code avoids undefined
14374 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14376 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14377 Tune. Don't use wider integers than needed. Don't use alloca.
14378 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14380 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14382 * insdel.c, lisp.h (buffer_overflow): New function.
14383 (insert_from_buffer_1, replace_range, replace_range_2):
14384 * insdel.c (make_gap_larger):
14385 * editfns.c (Finsert_char):
14386 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14388 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14390 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14392 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14394 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14395 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14397 * fileio.c: Don't assume EMACS_INT fits in off_t.
14398 (emacs_lseek): New static function.
14399 (Finsert_file_contents, Fwrite_region): Use it.
14400 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14402 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14404 * fns.c: Don't overflow int when computing a list length.
14405 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14406 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14407 truncation on 64-bit hosts. Check for QUIT every
14408 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14409 faster and is responsive enough.
14410 (Flength): Report an error instead of overflowing an integer.
14411 (Fsafe_length): Return a float if the value is not representable
14412 as a fixnum. This shouldn't happen except in contrived situations.
14413 (Fnthcdr, Fsort): Don't assume list length fits in int.
14414 (Fcopy_sequence): Don't assume vector length fits in int.
14416 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14417 (header_size, word_size): New constants.
14418 (allocate_vectorlike): Don't check size overflow here.
14419 (allocate_vector): Check it here instead, since this is the only
14420 caller of allocate_vectorlike that could cause overflow.
14421 Check that the new vector's length is representable as a fixnum.
14423 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14424 The previous code was bogus. For example, next_almost_prime (32)
14425 returned 39, which is undesirable as it is a multiple of 3; and
14426 next_almost_prime (24) returned 25, which is a multiple of 5 so
14427 why was the code bothering to check for multiples of 7?
14429 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14431 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14433 Variadic C functions now count arguments with ptrdiff_t.
14434 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14435 Back then I didn't know that the Emacs coding style prefers signed int.
14436 Also, in the meantime I found a few more instances where arguments
14437 were being counted with int, which may truncate counts on 64-bit
14438 machines, or EMACS_INT, which may be unnecessarily wide.
14439 * lisp.h (struct Lisp_Subr.function.aMANY)
14440 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14441 Arg counts are now ptrdiff_t, not size_t.
14442 All variadic functions and their callers changed accordingly.
14443 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14444 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14445 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14446 * callint.c (Fcall_interactively): Check arg count for overflow,
14447 to avoid potential buffer overrun. Use signed char, not 'int',
14448 for 'varies' array, so that we needn't bother to check its size
14449 calculation for overflow.
14450 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14451 * eval.c (apply_lambda):
14452 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14453 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14454 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14456 * callint.c (Fcall_interactively): Don't use index var as event count.
14458 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14459 * mem-limits.h (SIZE): Remove; no longer used.
14461 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14463 Remove unnecessary casts.
14464 * xterm.c (x_term_init):
14465 * xfns.c (x_set_border_pixel):
14466 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14467 These aren't needed now that we assume ANSI C.
14469 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14470 It's more likely to cause problems (due to unsigned overflow)
14473 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14475 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14477 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14479 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14481 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14483 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14485 GLYPH_CODE_FACE returns EMACS_INT, not int.
14486 * dispextern.h (merge_faces):
14487 * xfaces.c (merge_faces):
14488 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14489 Don't assume EMACS_INT fits in int.
14491 * character.h (CHAR_VALID_P): Remove unused parameter.
14492 * fontset.c, lisp.h, xdisp.c: All uses changed.
14494 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14496 * fns.c (concat): Minor tuning based on overflow analysis.
14497 This doesn't fix any bugs. Use int to hold character, instead
14498 of constantly refetching from Emacs object. Use XFASTINT, not
14499 XINT, for value known to be a character. Don't bother comparing
14500 a single byte to 0400, as it's always less.
14502 * floatfns.c (Fexpt):
14503 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14505 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14508 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14510 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14511 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14512 incorrectly succeed when S was a string, because 4294967386 was
14513 truncated before it was used.
14515 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14516 Otherwise, an out-of-range integer could cause undefined behavior
14519 * composite.c: Use int, not EMACS_INT, for characters.
14520 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14521 EMACS_INT, for values that are known to be in character range.
14522 This doesn't fix any bugs but is the usual style inside Emacs and
14523 may generate better code on 32-bit machines.
14525 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14526 This is for reasons similar to the recent CHAR_STRING fix.
14527 * charset.c (Fencode_char): Check that character arg is actually
14528 a character. Pass an int to ENCODE_CHAR.
14529 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14530 wider than 'int', as a compile-time check to prevent future regressions
14533 * character.c (char_string): Remove unnecessary casts.
14535 Make sure a 64-bit char is never passed to CHAR_STRING.
14536 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14537 by silently ignoring the top 32 bits, allowing some values
14538 that were far too large to be valid characters.
14539 * character.h: Include <verify.h>.
14540 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14541 arguments are no wider than unsigned, as a compile-time check
14542 to prevent future regressions in this area.
14544 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14545 (Fsubst_char_in_region):
14547 * xdisp.c (decode_mode_spec_coding):
14548 Adjust to CHAR_STRING's new requirement.
14549 * editfns.c (Finsert_char, Fsubst_char_in_region):
14550 * fns.c (concat): Check that character args are actually
14551 characters. Without this test, these functions did the wrong
14552 thing with wildly out-of-range values on 64-bit hosts.
14554 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14555 These casts should not be needed on 32-bit hosts, either.
14556 * keyboard.c (read_char):
14557 * lread.c (Fload): Remove casts to unsigned.
14559 * lisp.h (UNSIGNED_CMP): New macro.
14560 This fixes comparison bugs on 64-bit hosts.
14561 (ASCII_CHAR_P): Use it.
14562 * casefiddle.c (casify_object):
14563 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14564 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14565 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14566 * dispextern.h (FACE_FROM_ID):
14567 * keyboard.c (read_char): Use UNSIGNED_CMP.
14569 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14570 not to EMACS_INT, to avoid GCC warning.
14572 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14574 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14575 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14576 isn't needed on 32-bit machines.
14578 * buffer.c (Fgenerate_new_buffer_name):
14579 Use EMACS_INT for count, not int.
14580 (advance_to_char_boundary): Return EMACS_INT, not int.
14582 * data.c (Qcompiled_function): Now static.
14584 * window.c (window_body_lines): Now static.
14586 * image.c (gif_load): Rename local to avoid shadowing.
14588 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14589 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14590 * alloc.c (make_save_value): Integer argument is now of type
14591 ptrdiff_t, not int.
14592 (mark_object): Use ptrdiff_t, not int.
14593 * lisp.h (pD): New macro.
14594 * print.c (print_object): Use it.
14596 * alloc.c: Use EMACS_INT, not int, to count objects.
14597 (total_conses, total_markers, total_symbols, total_vector_size)
14598 (total_free_conses, total_free_markers, total_free_symbols)
14599 (total_free_floats, total_floats, total_free_intervals)
14600 (total_intervals, total_strings, total_free_strings):
14601 Now EMACS_INT, not int. All uses changed.
14602 (Fgarbage_collect): Compute overall total using a double, so that
14603 integer overflow is less likely to be a problem. Check for overflow
14604 when converting back to an integer.
14605 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14606 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14607 These were 'int' variables that could overflow on 64-bit hosts;
14608 they were never used, so remove them instead of repairing them.
14609 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14610 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14611 Previously, this ceilinged at INT_MAX, but that doesn't work on
14613 (allocate_pseudovector): Don't use EMACS_INT when int would do.
14615 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14616 (allocate_vectorlike): Check for ptrdiff_t overflow.
14617 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14618 when a (possibly-narrower) signed value would do just as well.
14619 We prefer using signed arithmetic, to avoid comparison confusion.
14621 * alloc.c: Catch some string size overflows that we were missing.
14622 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14623 for convenience in STRING_BYTES_MAX.
14624 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14625 The definition here is exact; the one in lisp.h was approximate.
14626 (allocate_string_data): Check for string overflow. This catches
14627 some instances we weren't catching before. Also, it catches
14628 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14629 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14630 and ptrdiff_t and EMACS_INT are both 64 bits.
14632 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14633 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14634 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14636 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14638 * alloc.c (Fmake_string): Check for out-of-range init.
14640 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14642 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14644 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14646 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14647 xg_get_default_scrollbar_width.
14649 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14650 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14651 (style_changed_cb): Call update_theme_scrollbar_width and call
14652 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14653 all frames (Bug#8505).
14654 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14655 Call gtk_window_set_resizable if HAVE_GTK3.
14656 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14657 and height if HAVE_GTK3 (Bug#8505).
14658 (scroll_bar_width_for_theme): New variable.
14659 (update_theme_scrollbar_width): New function.
14660 (xg_get_default_scrollbar_width): Move code to
14661 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14662 (xg_initialize): Call update_theme_scrollbar_width.
14664 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14666 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14668 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14670 * frame.c (make_frame): Call other_buffer_safely instead of
14673 * window.c (temp_output_buffer_show): Call display_buffer with
14674 second argument Vtemp_buffer_show_specifiers and reset latter
14675 immediately after the call.
14676 (Vtemp_buffer_show_specifiers): New variable.
14677 (auto_window_vscroll_p, next_screen_context_lines)
14678 (Vscroll_preserve_screen_position): Remove leading asterisks from
14681 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
14683 Fix minor problems found by GCC 4.6.0 static checking.
14684 * buffer.c (Qclone_number): Remove for now, as it's unused.
14685 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14686 (record_buffer): Remove unused local.
14687 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14688 (set_frame_buffer_list): Remove; unused.
14689 * frame.h (other_visible_frames): Remove decl.
14690 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14691 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14692 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14694 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14695 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14696 Define only if HAVE_GPM.
14697 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14698 (update_hints_inhibit): Remove; never set. All uses removed.
14699 * widgetprv.h (emacsFrameClassRec): Remove decl.
14700 * window.c (delete_deletable_window): Now returns void, since it
14701 wasn't returning anything.
14702 (compare_window_configurations): Remove unused locals.
14703 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14704 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14705 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14706 the same widths as pointers. This follows up on the 2011-05-06 patch.
14707 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14708 * xterm.h: Likewise.
14709 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14711 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
14713 * makefile.w32-in: Update dependencies.
14714 (LISP_H): Add lib/intprops.h.
14716 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14718 * image.c (gif_load): Add animation frame delay to the metadata.
14719 (syms_of_image): Use DEFSYM. New symbol `delay'.
14721 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14723 * window.c (delete_deletable_window): Re-add.
14724 (Fset_window_configuration): Rewrite to handle dead buffers and
14725 consequently deletable windows.
14726 (window_tree, Fwindow_tree): Remove. Supply functionality in
14728 (compare_window_configurations): Simplify code.
14730 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14732 * image.c (imagemagick_load_image): Fix type mismatch.
14733 (Fimagemagick_types): Likewise.
14735 * window.h (replace_buffer_in_windows): Declare.
14737 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14739 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14740 Qclone_number. Remove external declaration of Qdelete_window.
14741 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14743 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14744 Run Qbuffer_list_update_hook if allowed.
14745 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14746 buffer list implementation.
14747 (other_buffer_safely): New function.
14748 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14749 calls to replace_buffer_in_windows and
14750 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14752 (record_buffer): Inhibit quitting and rewrite using quittable
14753 functions. Run Qbuffer_list_update_hook if allowed.
14754 (Frecord_buffer, Funrecord_buffer): New functions.
14755 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14756 Move switch-to-buffer to window.el.
14757 (bury-buffer): Move to window.el.
14758 (Vbuffer_list_update_hook): New variable.
14760 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14763 * window.h (resize_frame_windows): Move up in code.
14764 (Fwindow_frame): Remove EXFUN.
14765 (replace_buffer_in_all_windows): Remove prototype.
14766 (replace_buffer_in_windows_safely): Add prototype.
14768 * window.c: Declare Qdelete_window static again. Move down
14769 declaration of select_count.
14770 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14771 (Fother_window): Move to window.el.
14772 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14773 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14774 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14776 (replace_buffer_in_windows): Implement by calling
14777 Qreplace_buffer_in_windows.
14778 (replace_buffer_in_all_windows): Remove with some functionality
14779 moved into replace_buffer_in_windows_safely.
14780 (replace_buffer_in_windows_safely): New function.
14781 (select_window_norecord, select_frame_norecord): Move in front
14782 of run_window_configuration_change_hook. Remove now obsolete
14784 (Fset_window_buffer): Rewrite doc-string.
14785 Call Qrecord_window_buffer.
14786 (keys_of_window): Move binding for other-window to window.el.
14788 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14790 * dispextern.h (struct image): Replace data member, whose int_val
14791 and ptr_val fields were not used by anything, with a single
14794 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14795 (gif_clear_image, gif_load, imagemagick_load_image)
14796 (gs_clear_image, gs_load): Callers changed.
14798 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14800 * buffer.h: Include <time.h>, for time_t.
14801 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14803 Fix minor problems found by static checking.
14805 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14807 Make identifiers static if they are not used in other modules.
14808 * data.c (Qcompiled_function, Qframe, Qvector):
14809 * image.c (QimageMagick, Qsvg):
14810 * minibuf.c (Qmetadata):
14811 * window.c (resize_window_check, resize_root_window): Now static.
14812 * window.h (resize_window_check, resize_root_window): Remove decls.
14814 * window.c (window_deletion_count, delete_deletable_window):
14816 (window_body_lines): Now static.
14817 (Fdelete_other_windows_internal): Mark vars as initialized.
14818 Make sure 'resize_failed' is initialized.
14819 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14820 (resize_window_apply): Remove unused local.
14821 * window.h (delete_deletable_window): Remove decl.
14823 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14824 (imagemagick_load_image): Fix pointer signedness problem by changing
14825 last arg from unsigned char * to char *. All uses changed.
14826 Also, fix a local for similar reasons.
14827 Remove unused locals. Remove locals to avoid shadowing.
14828 (fn_rsvg_handle_free): Remove; unused.
14829 (svg_load, svg_load_image): Fix pointer signedness problem.
14830 (imagemagick_load_image): Don't use garbage pointer image_wand.
14832 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14834 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
14836 * image.c (gif_load): Fix omitted cast error introduced by
14839 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14841 * window.h (resize_proportionally, orig_total_lines)
14842 (orig_top_line): Remove from window structure.
14843 (set_window_height, set_window_width, change_window_heights)
14844 (Fdelete_window): Remove prototypes.
14845 (resize_frame_windows): Remove duplicate declaration.
14847 2011-06-10 Eli Zaretskii <eliz@gnu.org>
14849 * window.h (resize_frame_windows, resize_window_check)
14850 (delete_deletable_window, resize_root_window)
14851 (resize_frame_windows): Declare prototypes.
14853 * window.c (resize_window_apply): Make definition be "static" to
14854 match the prototype.
14856 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14858 * window.c: Remove declarations of Qwindow_size_fixed,
14859 window_min_size_1, window_min_size_2, window_min_size,
14860 size_window, window_fixed_size_p, enlarge_window, delete_window.
14861 Remove static from declaration of Qdelete_window, it's
14862 temporarily needed by Fbury_buffer.
14863 (replace_window): Don't assign orig_top_line and
14865 (Fdelete_window, delete_window): Remove. Window deletion is
14866 handled by window.el.
14867 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14868 Replace Fdelete_window calls with calls to Qdelete_window.
14869 (Fdelete_other_windows): Remove. Deleting other windows is
14870 handled by window.el.
14871 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14872 handled in window.el.
14873 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14874 Window minimum sizes are handled in window.el.
14875 (shrink_windows, size_window, set_window_height)
14876 (set_window_width, change_window_heights, window_height)
14877 (window_width, CURBEG, CURSIZE, enlarge_window)
14878 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14879 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14880 handled in window.el.
14881 (make_dummy_parent): Rename to make_parent_window and give it a
14882 second argument horflag.
14883 (make_window): Don't set resize_proportionally any more.
14884 (Fsplit_window): Remove. Windows are split in window.el.
14885 (save_restore_action, save_restore_orig_size)
14886 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14887 Resize mini windows in window.el.
14888 (grow_mini_window, shrink_mini_window): Implement by calling
14889 Qresize_root_window_vertically, resize_window_check and
14890 resize_window_apply.
14891 (saved_window, Fset_window_configuration, save_window_save):
14892 Do not handle orig_top_line, orig_total_lines, and
14893 resize_proportionally.
14894 (window_min_height, window_min_width): Move to window.el.
14895 (keys_of_window): Move bindings for delete-other-windows,
14896 split-window, delete-window and enlarge-window to window.el.
14898 * buffer.c: Temporarily extern Qdelete_window.
14899 (Fbury_buffer): Temporarily call Qdelete_window instead of
14900 Fdelete_window (Fbury_buffer will move to window.el soon).
14902 * frame.c (set_menu_bar_lines_1): Remove code handling
14903 orig_top_line and orig_total_lines.
14905 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14906 set_window_height but set heights directly.
14907 (change_frame_size_1): Use resize_frame_windows.
14909 * xdisp.c (init_xdisp): Don't use set_window_height but set
14912 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14913 Use resize_frame_windows instead of change_window_heights and run
14914 run_window_configuration_change_hook.
14916 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14917 instead of change_window_heights and run
14918 run_window_configuration_change_hook.
14920 2011-06-09 Martin Rudalics <rudalics@gmx.at>
14922 * window.c (replace_window): Rename second argument REPLACEMENT to
14923 NEW. New third argument SETFLAG. Rewrite.
14924 (delete_window, make_dummy_parent): Call replace_window with
14926 (window_list_1): Move down in code.
14927 (run_window_configuration_change_hook): Move set_buffer part
14928 before select_frame_norecord part in order to unwind correctly.
14929 Rename count1 to count.
14930 (recombine_windows, delete_deletable_window, resize_root_window)
14931 (Fdelete_other_windows_internal)
14932 (Frun_window_configuration_change_hook, make_parent_window)
14933 (resize_window_check, resize_window_apply, Fresize_window_apply)
14934 (resize_frame_windows, Fsplit_window_internal)
14935 (Fdelete_window_internal, Fresize_mini_window_internal):
14937 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14939 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14941 * window.h (window): Add some new members to window structure -
14942 normal_lines, normal_cols, new_total, new_normal, clone_number,
14943 splits, nest, prev_buffers, next_buffers.
14944 (WINDOW_TOTAL_SIZE): Move here from window.c.
14945 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14947 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14949 (make_dummy_parent): Set new members of windows structure.
14950 (make_window): Move down in code. Handle new members of window
14952 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14953 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14954 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14955 (Fset_window_prev_buffers, Fwindow_next_buffers)
14956 (Fset_window_next_buffers, Fset_window_clone_number):
14958 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14959 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14961 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14962 Argument WINDOW can be now internal window too.
14963 (Fwindow_use_time): Move up in code.
14964 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14965 Rewrite doc-string.
14966 (Fset_window_configuration, saved_window)
14967 (Fcurrent_window_configuration, save_window_save): Handle new
14968 members of window structure.
14969 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14970 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14971 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14972 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14973 Qget_mru_window, Qresize_root_window,
14974 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14975 Qauto_buffer_name; staticpro them.
14977 2011-06-07 Martin Rudalics <rudalics@gmx.at>
14979 * window.c (Fwindow_total_size, Fwindow_left_column)
14980 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14981 (Fwindow_list_1): New functions.
14982 (window_box_text_cols): Replace with window_body_cols.
14983 (Fwindow_width, Fscroll_left, Fscroll_right):
14984 Use window_body_cols instead of window_box_text_cols.
14985 (delete_window, Fset_window_configuration):
14986 Call delete_all_subwindows with window as argument.
14987 (delete_all_subwindows): Take a window as argument and not a
14988 structure. Rewrite.
14989 (window_loop): Remove handling of GET_LRU_WINDOW and
14990 GET_LARGEST_WINDOW.
14991 (Fget_lru_window, Fget_largest_window): Move to window.el.
14993 * window.h: Extern window_body_cols instead of
14994 window_box_text_cols. delete_all_subwindows now takes a
14995 Lisp_Object as argument.
14997 * indent.c (compute_motion, Fcompute_motion):
14998 Use window_body_cols instead of window_box_text_cols.
15000 * frame.c (delete_frame): Call delete_all_subwindows with root
15001 window as argument.
15003 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15005 * fns.c (Fputhash): Document return value.
15007 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15009 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15011 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15013 Cons<->int and similar integer overflow fixes (Bug#8794).
15015 Check for overflow when converting integer to cons and back.
15016 * charset.c (Fdefine_charset_internal, Fdecode_char):
15017 Use cons_to_unsigned to catch overflow.
15018 (Fencode_char): Use INTEGER_TO_CONS.
15019 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15020 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15021 * data.c (long_to_cons, cons_to_long): Remove.
15022 (cons_to_unsigned, cons_to_signed): New functions.
15023 These signal an error for invalid or out-of-range values.
15024 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15025 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15026 * font.c (Ffont_variation_glyphs):
15027 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15028 * lisp.h: Include <intprops.h>.
15029 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15030 (cons_to_signed, cons_to_unsigned): New decls.
15031 (long_to_cons, cons_to_long): Remove decls.
15032 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15033 (Fprimitive_undo): Use CONS_TO_INTEGER.
15034 * xfns.c (Fx_window_property): Likewise.
15035 * xselect.c: Include <limits.h>.
15036 (x_own_selection, selection_data_to_lisp_data):
15037 Use INTEGER_TO_CONS.
15038 (x_handle_selection_request, x_handle_selection_clear)
15039 (x_get_foreign_selection, Fx_disown_selection_internal)
15040 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15041 (lisp_data_to_selection_data): Use cons_to_unsigned.
15042 (x_fill_property_data): Use cons_to_signed.
15043 Report values out of range.
15045 Check for buffer and string overflow more precisely.
15046 * buffer.h (BUF_BYTES_MAX): New macro.
15047 * lisp.h (STRING_BYTES_MAX): New macro.
15048 * alloc.c (Fmake_string):
15049 * character.c (string_escape_byte8):
15050 * coding.c (coding_alloc_by_realloc):
15051 * doprnt.c (doprnt):
15052 * editfns.c (Fformat):
15054 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15055 since they may not be the same number.
15056 * editfns.c (Finsert_char):
15057 * fileio.c (Finsert_file_contents):
15058 Likewise for BUF_BYTES_MAX.
15060 * image.c: Use ptrdiff_t, not int, for sizes.
15061 (slurp_file): Switch from int to ptrdiff_t.
15063 (slurp_file): Check that file size fits in both size_t (for
15064 malloc) and ptrdiff_t (for sanity and safety).
15066 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15067 if b->modtime has its maximal value.
15069 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15071 Don't assume time_t can fit into int.
15072 * buffer.h (struct buffer.modtime): Now time_t, not int.
15073 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15074 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15076 Minor fixes for signed vs unsigned integers.
15077 * character.h (MAYBE_UNIFY_CHAR):
15078 * charset.c (maybe_unify_char):
15079 * keyboard.c (read_char, reorder_modifiers):
15080 XINT -> XFASTINT, since the integer must be nonnegative.
15081 * ftfont.c (ftfont_spec_pattern):
15082 * keymap.c (access_keymap, silly_event_symbol_error):
15083 XUINT -> XFASTINT, since the integer must be nonnegative.
15084 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15085 since it makes no difference and we prefer signed.
15086 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15087 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15090 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15092 * window.h (Fwindow_frame): Declare.
15094 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15096 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15097 (SPARE_MEMORY): Always define.
15098 (LARGE_REQUEST): Remove.
15099 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15101 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15103 * lisp.h: Move EXFUNS for Fframe_root_window,
15104 Fframe_first_window and Fset_frame_selected_window to window.h.
15106 * window.h: Move EXFUNS for Fframe_root_window,
15107 Fframe_first_window and Fset_frame_selected_window here from
15110 * frame.c (Fwindow_frame, Fframe_first_window)
15111 (Fframe_root_window, Fframe_selected_window)
15112 (Fset_frame_selected_window): Move to window.c.
15113 (Factive_minibuffer_window): Move to minibuf.c.
15114 (Fother_visible_frames_p): New function.
15116 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15118 * window.c (decode_window, decode_any_window): Move up in code.
15119 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15120 (inhibit_frame_unsplittable): Remove unused variable.
15121 (Fwindow_buffer): Move up and rewrite doc-string.
15122 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15123 (Fwindow_prev): New functions.
15124 (Fwindow_frame): Move here from frame.c. Accept any window as
15126 (Fframe_root_window, Fframe_first_window)
15127 (Fframe_selected_window): Move here from frame.c. Accept frame
15128 or arbitrary window as argument. Update doc-strings.
15129 (Fminibuffer_window): Move up in code.
15130 (Fwindow_minibuffer_p): Move up in code and simplify.
15131 (Fset_frame_selected_window): Move here from frame.c.
15133 (Fselected_window, select_window, Fselect_window): Move up in
15134 code. Minor doc-string fixes.
15136 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15138 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15139 Do not assume that spare memory exists; that assumption is valid
15140 only if SYSTEM_MALLOC.
15141 (LARGE_REQUEST): New macro, so that the issue of large requests
15142 is separated from the issue of spare memory.
15144 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15146 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15149 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15151 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15154 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15156 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15158 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15160 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15161 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15163 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15165 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15167 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15169 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15170 (x_clipboard_manager_save): Add return value.
15171 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15172 New error handlers.
15173 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15174 Obey Vx_select_enable_clipboard_manager. Catch errors in
15175 x_clipboard_manager_save (Bug#8779).
15176 (Vx_select_enable_clipboard_manager): New variable.
15177 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15179 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15181 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15183 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15185 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15186 in the current matrix if keep_current_p is non-zero.
15188 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15190 * bidi.c (bidi_level_of_next_char): Fix last change.
15192 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15194 Support bidi reordering of text covered by display properties.
15196 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15197 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15198 (bidi_cache_search, bidi_cache_iterator_state)
15199 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15200 (bidi_level_of_next_char, bidi_move_to_visually_next):
15201 Support character positions inside a run of characters covered by a
15203 (bidi_paragraph_init, bidi_resolve_explicit_1)
15204 (bidi_level_of_next_char): Call bidi_fetch_char and
15205 bidi_fetch_char_advance instead of FETCH_CHAR and
15206 FETCH_CHAR_ADVANCE.
15207 (bidi_init_it): Initialize new members.
15208 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15210 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15211 instead of using explicit *_CHAR codes.
15212 (bidi_resolve_explicit, bidi_resolve_weak):
15213 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15214 bidirectional text is supported only in multibyte buffers.
15215 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15216 it to initialize the frame_window_p member of struct bidi_it.
15217 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15218 (bidi_resolve_explicit, bidi_resolve_weak)
15219 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15220 bidi_it->nchars is non-positive.
15221 (bidi_level_of_next_char): Don't try to lookup the cache for the
15222 next/previous character if nothing is cached there yet, or if we
15223 were just reseat()'ed to a new position.
15225 * xdisp.c (set_cursor_from_row): Set start and stop points
15226 according to the row's direction when priming the loop that looks
15227 for the glyph on which to display cursor.
15228 (single_display_spec_intangible_p): Function deleted.
15229 (display_prop_intangible_p): Reimplement to call
15230 handle_display_spec instead of single_display_spec_intangible_p.
15231 Accept 3 additional arguments needed by handle_display_spec.
15232 This fixes incorrect cursor motion across display property with complex
15233 values: lists, `(when COND...)' forms, etc.
15234 (single_display_spec_string_p): Support property values that are
15235 lists with the argument STRING its top-level element.
15236 (display_prop_string_p): Fix the condition for processing a
15237 property that is a list to be consistent with handle_display_spec.
15238 (handle_display_spec): New function, refactored from the
15239 last portion of handle_display_prop.
15240 (compute_display_string_pos): Accept additional argument
15241 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15242 value of a `display' property is a "replacing spec".
15243 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15244 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15245 the display property, but just return a value indicating whether
15246 the display property will replace the characters it covers.
15247 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15248 frame_window_p members of struct bidi_it.
15249 (compute_display_string_pos, compute_display_string_end):
15251 (push_it): Accept second argument POSITION, where pop_it should
15252 jump to continue iteration.
15253 (reseat_1): Initialize bidi_it.disp_pos.
15255 * keyboard.c (adjust_point_for_property): Adjust the call to
15256 display_prop_intangible_p to its new signature.
15258 * dispextern.h (struct bidi_it): New member frame_window_p.
15259 (bidi_init_it): Update prototypes.
15260 (display_prop_intangible_p): Update prototype.
15261 (compute_display_string_pos, compute_display_string_end):
15262 Declare prototypes.
15263 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15266 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15268 Malloc failure behavior now depends on size of allocation.
15269 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15270 * lisp.h: Change signatures accordingly.
15271 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15272 All callers changed. (Bug#8762)
15274 * gnutls.c: Use Emacs's memory allocators.
15275 Without this change, the gnutls library would invoke malloc etc.
15276 directly, which causes problems on non-SYNC_INPUT hosts, and which
15277 runs afoul of improving memory_full behavior. (Bug#8761)
15278 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15279 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15280 xfree instead of the default malloc, realloc, free.
15281 (Fgnutls_boot): No need to check for memory allocation failure,
15282 since xmalloc does that for us.
15284 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15285 * category.c (hash_get_category_set):
15286 * ccl.c (ccl_driver):
15287 * charset.c (Fdefine_charset_internal):
15288 * charset.h (struct charset.hash_index):
15289 * composite.c (get_composition_id, gstring_lookup_cache)
15290 (composition_gstring_put_cache):
15291 * composite.h (struct composition.hash_index):
15292 * dispextern.h (struct image.hash):
15293 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15294 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15295 (hashfn_equal, hashfn_user_defined, make_hash_table)
15296 (maybe_resize_hash_table, hash_lookup, hash_put)
15297 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15298 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15299 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15300 * image.c (make_image, search_image_cache, lookup_image)
15301 (xpm_put_color_table_h):
15302 * lisp.h (struct Lisp_Hash_Table):
15303 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15304 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15305 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15306 * alloc.c (allocate_vectorlike):
15307 Check for overflow in vector size calculations.
15308 * ccl.c (ccl_driver):
15309 Check for overflow when converting EMACS_INT to int.
15310 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15311 need to be updated by these changes.
15312 * fns.c (make_hash_table, maybe_resize_hash_table):
15313 Check for integer overflow with large hash tables.
15314 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15315 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15316 (SXHASH_REDUCE): New macro.
15317 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15318 Use it instead of discarding useful hash info with large hash values.
15319 (sxhash_float): New function.
15320 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15321 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15322 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15323 Rewrite to use FIXNUM_BITS, as this simplifies things.
15324 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15325 Adjust signatures to match updated version of code.
15326 (consing_since_gc): Now EMACS_INT, since a single hash table can
15327 use more than INT_MAX bytes.
15329 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15331 Make it possible to build with GCC-4.6+ -O2 -flto.
15333 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15335 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15337 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15338 Call minibuffer-inactive-mode.
15340 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15342 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15343 Update dependencies.
15345 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15347 * data.c (init_data): Remove code for UTS, this system is not
15350 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15352 Don't force ./temacs to start in terminal mode.
15354 * frame.c (make_initial_frame): Initialize faces in all cases, not
15355 only when CANNOT_DUMP is defined.
15356 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15358 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15360 * dispnew.c (add_window_display_history): Use const for the string
15361 pointer. Remove declaration, not needed.
15363 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15365 Use 'inline', not 'INLINE'.
15366 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15367 * alloc.c, fontset.c (INLINE): Remove.
15368 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15369 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15370 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15371 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15372 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15374 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15376 Make it possible to run ./temacs.
15378 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15379 syms_of_callproc does the same thing. Remove test for
15380 "initialized", do it in the caller.
15381 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15383 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15385 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15386 (read_minibuf): Use get_minibuffer.
15387 (syms_of_minibuf): Use DEFSYM.
15388 (Qmetadata): New var.
15389 * data.c (Qbuffer): Don't make it static.
15390 (syms_of_data): Use DEFSYM.
15392 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15394 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15395 (CCL_CODE_MIN): New macro.
15397 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15399 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15401 * eval.c (Qdebug): Now static.
15402 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15403 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15404 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15406 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15408 * image.c: Various fixes to ImageMagick code comments.
15409 (Fimagemagick_types): Doc fix.
15411 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15413 Minor fixes prompted by GCC 4.6.0 warnings.
15415 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15417 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15418 (x_clipboard_manager_save_all): Move extern decl to ...
15419 * xterm.h: ... here, so that it can be checked for consistency.
15421 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15423 * xselect.c (x_clipboard_manager_save_frame)
15424 (x_clipboard_manager_save_all): New functions.
15425 (Fx_clipboard_manager_save): Lisp function deleted.
15427 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15428 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15430 * xterm.h: Update prototype.
15432 2011-05-28 William Xu <william.xwl@gmail.com>
15434 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15435 exiting (Bug#8239).
15437 2011-05-28 Jim Meyering <meyering@redhat.com>
15439 Avoid a sign-extension bug in crypto_hash_function.
15440 * fns.c (to_uchar): Define.
15441 (crypto_hash_function): Use it to convert some newly-signed
15442 variables to unsigned, to avoid sign-extension bugs. For example,
15443 without this change, (md5 "truc") would evaluate to
15444 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15445 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15446 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15448 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15450 Integer overflow fixes.
15452 * dbusbind.c: Serial number integer overflow fixes.
15453 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15454 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15455 to hold a serial number that is too large for a fixnum.
15456 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15457 Check for serial numbers out of range. Decode any serial number
15458 that was so large that it became a float. (Bug#8722)
15460 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15461 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15462 Use XFASTINT rather than XUINT when numbers are nonnegative.
15463 (xd_append_arg, Fdbus_method_return_internal):
15464 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15465 arguments, check that Lisp number is nonnegative, rather than
15466 silently wrapping negative numbers around. (Bug#8722)
15467 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15470 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15472 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15474 ccl: Add integer overflow checks.
15475 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15476 (IN_INT_RANGE): New macros.
15477 (ccl_driver): Use them to check for integer overflow when
15478 decoding a CCL program. Many of the new checks are whether XINT (x)
15479 fits in int; it doesn't always, on 64-bit hosts. The new version
15480 doesn't catch all possible integer overflows, but it's an
15481 improvement. (Bug#8719)
15483 * alloc.c (make_event_array): Use XINT, not XUINT.
15484 There's no need for unsigned here.
15486 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15487 This follows up to the 2011-05-06 change that substituted uintptr_t
15488 for EMACS_INT. This case wasn't caught back then.
15490 Rework Fformat to avoid integer overflow issues.
15491 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15492 now (part of C89). Include <verify.h>.
15493 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15494 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15495 (Fformat): Avoid the prepass trying to compute sizes; it was only
15496 approximate and thus did not catch overflow reliably. Instead, walk
15497 through the format just once, formatting and computing sizes as we go,
15498 checking for integer overflow at every step, and allocating a larger
15499 buffer as needed. Keep track separately whether the format is
15500 multibyte. Keep only the most-recently calculated precision, rather
15501 than them all. Record whether each argument has been converted to
15502 string. Use EMACS_INT, not int, for byte and char and arg counts.
15503 Support field widths and precisions larger than INT_MAX. Avoid
15504 sprintf's undefined behavior with conversion specifications such as %#d
15505 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15506 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15507 formatting out-of-range floating point numbers with int
15508 formats. (Bug#8668)
15510 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15512 * data.c: Avoid integer truncation in expressions involving floats.
15513 * data.c: Include <intprops.h>.
15514 (arith_driver): When there's an integer overflow in an expression
15515 involving floating point, convert the integers to floating point
15516 so that the resulting value does not suffer from catastrophic
15517 integer truncation. For example, on a 64-bit host (* 4
15518 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15519 Do not rely on undefined behavior after integer overflow.
15521 merge count_size_as_multibyte, parse_str_to_multibyte
15522 * character.c, character.h (count_size_as_multibyte):
15523 Rename from parse_str_to_multibyte; all uses changed.
15524 Check for integer overflow.
15525 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15526 since it's now a duplicate of the other. This is more of
15527 a character than a buffer op, so better that it's in character.c.
15528 * fns.c, print.c: Adjust to above changes.
15530 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15532 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15534 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15536 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15537 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15538 (x_clipboard_manager_save): Now static.
15539 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15541 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15542 (crypto_hash_function): Now static.
15543 Fix pointer signedness problems. Avoid unnecessary initializations.
15545 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15547 * termhooks.h (Vselection_alist): Make it terminal-local.
15549 * terminal.c (create_terminal): Initialize it.
15551 * xselect.c: Support for clipboard managers.
15552 (Vselection_alist): Move to termhooks.h as terminal-local var.
15553 (LOCAL_SELECTION): New macro.
15554 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15555 (symbol_to_x_atom): Remove gratuitous arg.
15556 (x_handle_selection_request, lisp_data_to_selection_data)
15557 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15558 (x_own_selection, x_get_local_selection, x_convert_selection):
15559 New arg, specifying work frame. Use terminal-local Vselection_alist.
15560 (some_frame_on_display): Delete unused function.
15561 (Fx_own_selection_internal, Fx_get_selection_internal)
15562 (Fx_disown_selection_internal, Fx_selection_owner_p)
15563 (Fx_selection_exists_p): New optional frame arg.
15564 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15565 (x_handle_selection_clear): Don't treat other terminals with the
15566 same keyboard specially. Use the terminal-local Vselection_alist.
15567 (x_clear_frame_selections): Use Frun_hook_with_args.
15569 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15571 * xterm.h: Add support for those atoms.
15573 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
15575 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15576 (converted_selections, conversion_fail_tag): New global variables.
15577 (x_selection_request_lisp_error): Free the above.
15578 (x_get_local_selection): Remove unnecessary code.
15579 (x_reply_selection_request): Args changed; handle arbitrary array
15580 of converted selections stored in converted_selections.
15581 Separate the XChangeProperty and SelectionNotify steps.
15582 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15583 (x_convert_selection): New function.
15584 (x_handle_selection_event): Simplify.
15585 (x_get_foreign_selection): Don't ignore incoming requests while
15586 waiting for an answer; this will fail when we implement
15587 SAVE_TARGETS, and seems unnecessary anyway.
15588 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15589 (Vx_sent_selection_functions): Doc fix.
15591 2011-05-26 Leo Liu <sdl.web@gmail.com>
15593 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15595 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15597 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15599 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15600 for fringe update if it has periodic bitmap.
15601 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15602 and fringe_bitmap_periodic_p.
15604 * fringe.c (get_fringe_bitmap_data): New function.
15605 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15606 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15607 row. Mark glyph row for fringe update if periodicity changed.
15609 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15610 for fringe update unless it has periodic bitmap.
15612 2011-05-25 Kenichi Handa <handa@m17n.org>
15614 * xdisp.c (get_next_display_element): Set correct it->face_id for
15615 a static composition.
15617 2011-05-24 Leo Liu <sdl.web@gmail.com>
15620 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15622 * fns.c (crypto_hash_function, Fsha1): New function.
15623 (Fmd5): Use crypto_hash_function.
15624 (syms_of_fns): Add Ssha1.
15626 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15628 * gnutls.c: Remove unused macros.
15629 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15630 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15631 Remove macros that are defined and never used.
15632 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15634 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15636 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15637 (Fx_get_selection_internal): Minor cleanup.
15638 (Fx_own_selection_internal): Rename arguments for consistency with
15641 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15643 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15645 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15647 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15649 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15651 * dispnew.c (scrolling_window): Don't exclude the case that the
15652 last enabled row in the desired matrix touches the bottom boundary.
15654 2011-05-21 Glenn Morris <rgm@gnu.org>
15656 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15657 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15658 and add some more files.
15660 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15662 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15663 report_file_error introduced by the change from 2011-05-07.
15665 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15667 * systime.h (Time): Define only if emacs is defined.
15668 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15669 where the include path doesn't have X11/X.h by default. See
15670 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15672 2011-05-20 Kenichi Handa <handa@m17n.org>
15674 * composite.c (find_automatic_composition): Fix previous change.
15676 2011-05-20 Glenn Morris <rgm@gnu.org>
15678 * lisp.mk: New file, split from Makefile.in.
15679 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15680 (shortlisp): Remove.
15681 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15683 2011-05-19 Glenn Morris <rgm@gnu.org>
15685 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15686 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15687 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15688 (lisp): Set the order to that of loadup.el.
15689 (shortlisp): Make it a copy of $lisp.
15690 (SOME_MACHINE_LISP): Remove.
15691 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15692 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15694 2011-05-18 Kenichi Handa <handa@m17n.org>
15696 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15697 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15698 (find_automatic_composition): Mostly rewrite for efficiency.
15700 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
15702 * makefile.w32-in: Update dependencies.
15704 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15706 * menu.c: Include limits.h (fixes the MS-Windows build broken by
15707 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15709 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
15711 Fix some integer overflow issues, such as string length overflow.
15713 * insdel.c (count_size_as_multibyte): Check for string overflow.
15715 * character.c (lisp_string_width): Check for string overflow.
15716 Use EMACS_INT, not int, for string indexes and lengths; in
15717 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15718 the resulting string length overflows an EMACS_INT; instead,
15719 report a string overflow if no precision given. When checking for
15720 precision exhaustion, use a check that cannot possibly have
15721 integer overflow. (Bug#8675)
15722 * character.h (lisp_string_width): Adjust to new signature.
15724 * alloc.c (string_overflow): New function.
15725 (Fmake_string): Use it. This doesn't change behavior, but saves
15726 a few bytes and will simplify future changes.
15727 * character.c (string_escape_byte8): Likewise.
15728 * lisp.h (string_overflow): New decl.
15730 Fixups, following up to the user-interface timestamp change.
15731 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15732 for UI timestamps, instead of unsigned long.
15733 * msdos.c (mouse_get_pos): Likewise.
15734 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15735 * w32gui.h (Time): Define by including "systime.h" rather than by
15736 declaring it ourselves. (Bug#8664)
15738 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15739 * image.c (clear_image_cache): Likewise.
15741 * term.c (term_mouse_position): Don't assume time_t wraparound.
15743 Be more systematic about user-interface timestamps.
15744 Before, the code sometimes used 'Time', sometimes 'unsigned long',
15745 and sometimes 'EMACS_UINT', to represent these timestamps.
15746 This change causes it to use 'Time' uniformly, as that's what X uses.
15747 This makes the code easier to follow, and makes it easier to catch
15748 integer overflow bugs such as Bug#8664.
15749 * frame.c (Fmouse_position, Fmouse_pixel_position):
15750 Use Time, not unsigned long, for user-interface timestamps.
15751 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15752 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15753 * keyboard.h (last_event_timestamp): Likewise.
15754 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15755 * menu.h (xmenu_show): Likewise.
15756 * term.c (term_mouse_position): Likewise.
15757 * termhooks.h (struct input_event.timestamp): Likewise.
15758 (struct terminal.mouse_position_hook): Likewise.
15759 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15760 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15761 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15762 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15763 what it was before.
15764 * menu.h, termhooks.h: Include "systime.h", for Time.
15766 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15767 Don't assume that the difference between two unsigned long values
15768 can fit into an integer. At this point, we know button_down_time
15769 <= event->timestamp, so the difference must be nonnegative, so
15770 there's no need to cast the result if double-click-time is
15771 nonnegative, as it should be; check that it's nonnegative, just in
15772 case. This bug is triggered when events are more than 2**31 ms
15773 apart (about 25 days). (Bug#8664)
15775 * xselect.c (last_event_timestamp): Remove duplicate decl.
15776 (x_own_selection): Remove needless cast to unsigned long.
15778 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15779 that always fit in int. Use a sentinel instead of a counter, to
15780 avoid a temp and to allay GCC's concerns about possible int overflow.
15781 * frame.h (struct frame): Use int for menu_bar_items_used
15782 instead of EMACS_INT, since it always fits in int.
15784 * menu.c (grow_menu_items): Check for int overflow.
15786 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15788 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15789 Before, the code was not consistent. These values cannot exceed
15790 2**31 - 1 so there's no need to make them unsigned.
15791 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15792 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15793 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15795 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15797 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15798 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15799 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15800 presumably because the widths might not match.
15802 * window.c (size_window): Avoid needless test at loop start.
15804 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15806 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15808 2011-05-12 Drew Adams <drew.adams@oracle.com>
15810 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15812 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15814 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15815 `width' to `bar_area_x' and `bar_area_width', respectively.
15816 (x_scroll_run): Take account of fringe background extension.
15818 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15819 Rename local vars `left' and `width' to `bar_area_x' and
15820 `bar_area_width', respectively.
15821 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15822 background extension.
15824 2011-05-10 Jim Meyering <meyering@redhat.com>
15826 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15828 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
15830 * image.c (Finit_image_library): Return t for built-in image types,
15831 like pbm and xbm. (Bug#8640)
15833 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15835 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15837 2011-05-07 Eli Zaretskii <eliz@gnu.org>
15839 * w32console.c (Fset_screen_color): Doc fix.
15840 (Fget_screen_color): New function.
15841 (syms_of_ntterm): Defsubr it.
15843 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15844 unlink the temporary file if Fcall_process didn't create it in the
15846 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15847 child process will be redirected to a file specified with `:file'.
15848 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15849 cue to call_process_cleanup not to close that handle.
15851 2011-05-07 Ben Key <bkey76@gmail.com>
15853 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15854 one of two shell specific rules, either bootstrap-temacs-CMD or
15855 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15856 to the previous implementation of the bootstrap-temacs rule.
15857 The bootstrap-temacs-CMD rule is similar to the previous
15858 implementation of the bootstrap-temacs rule except that it
15859 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15862 These changes, along with some changes to nt/configure.bat,
15863 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15864 earlier fix to add support for --cflags and --ldflags options
15865 that include quotes so that it works whether make uses cmd or
15868 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
15870 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15871 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15873 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15874 a string. Handle both cases.
15875 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15876 (Fdbus_register_method): Use Qinvalid_function.
15878 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15880 * makefile.w32-in: Update dependencies.
15881 (LISP_H): Add inttypes.h and stdin.h.
15882 (PROCESS_H): Add unistd.h.
15884 2011-05-06 Eli Zaretskii <eliz@gnu.org>
15886 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15887 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15889 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
15891 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15893 * term.c (vfatal): Remove stray call to va_end.
15894 It's not needed and the C Standard doesn't allow it here anyway.
15896 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15897 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15899 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15902 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15904 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15906 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15908 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15910 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15912 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15913 * charset.c (Fdefine_charset_internal): Don't initialize
15914 charset.code_space[15]. The value was garbage, on hosts with
15915 32-bit int (Bug#8600).
15917 * lread.c (read_integer): Be more consistent with string-to-number.
15918 Use string_to_number to do the actual conversion; this avoids
15919 rounding errors and fixes some other screwups. Without this fix,
15920 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15921 (digit_to_number): Move earlier, for benefit of read_integer.
15922 Return -1 if the digit is out of range for the base, -2 if it is
15923 not a digit in any supported base. (Bug#8602)
15925 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15927 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15928 to match comment at start of function. This also removes a
15929 GCC warning about overflow in a 32+64-bit port.
15931 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15933 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15934 Reported by Stefan Monnier in
15935 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15936 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15937 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15939 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15940 (EMACS_UINTPTR): Likewise, with uintptr_t.
15942 * lisp.h: Prefer 64-bit EMACS_INT if available.
15943 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15944 on 32-bit hosts that have 64-bit int, so that they can access
15946 However, temporarily disable this change unless the temporary
15947 symbol WIDE_EMACS_INT is defined.
15949 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15951 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15952 This removes an assumption that EMACS_INT and long are the same
15953 width as pointers. The assumption is true for Emacs porting targets
15954 now, but we want to make other targets possible.
15955 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15956 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15957 In the rest of the code, change types of integers that hold casted
15958 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15959 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15960 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15961 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15962 No need to cast type when ORing.
15963 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15964 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15965 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15966 assume EMACS_INT is the same width as char *.
15967 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15968 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15969 Remove no-longer-needed casts.
15970 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15971 (xg_tool_bar_help_callback, xg_make_tool_item):
15972 Use EMACS_INTPTR to hold an integer
15973 that will be cast to void *; this can avoid a GCC warning
15974 if EMACS_INT is not the same width as void *.
15975 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15976 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15977 (current_message_1, set_message_1):
15978 Use a local to convert to proper width without a cast.
15979 * xmenu.c (dialog_selection_callback): Likewise.
15981 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15982 Also, don't assume VALBITS / RAND_BITS is less than 5,
15983 and don't rely on undefined behavior when shifting a 1 left into
15985 * lisp.h (get_random): Change signature to match.
15987 * lread.c (hash_string): Use size_t, not int, for hash computation.
15988 Normally we prefer signed values; but hashing is special, because
15989 it's better to use unsigned division on hash table sizes so that
15990 the remainder is nonnegative. Also, size_t is the natural width
15991 for hashing into memory. The previous code used 'int', which doesn't
15992 retain enough info to hash well into very large tables.
15993 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15995 * dbusbind.c: Don't possibly lose pointer info when converting.
15996 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15997 Use XPNTR rather than XHASH, so that the high-order bits of
15998 the pointer aren't lost when converting through void *.
16000 * eval.c (Fautoload): Don't double-shift a pointer.
16002 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16004 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16006 * gnutls.c (DEF_GNUTLS_FN):
16007 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16009 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16011 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16014 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16016 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16017 New version that can reserve upto 2GB of heap space.
16019 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16021 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16023 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16025 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16026 `gnutls_certificate_set_x509_key_file'.
16028 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16030 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16031 Update dependencies.
16033 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16035 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16036 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16037 Remove unused parameter `fildes'.
16038 * process.c (read_process_output, send_process): Don't pass it.
16040 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16042 Fix previous change: the library cache is defined in w32.c.
16043 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16044 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16046 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16048 Implement dynamic loading of GnuTLS on Windows.
16050 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16051 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16052 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16055 * gnutls.c (Qgnutls_dll): Define.
16056 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16057 (gnutls_*): Declare function pointers.
16058 (init_gnutls_functions): New function to initialize function pointers.
16059 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16060 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16061 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16062 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16063 (emacs_gnutls_write, emacs_gnutls_read)
16064 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16065 (Fgnutls_available_p): New function.
16066 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16067 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16068 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16070 * image.c: Include w32.h.
16071 (Vimage_type_cache): Delete.
16072 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16073 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16074 (w32_delayed_load): Move to w32.c.
16076 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16078 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16079 (w32_delayed_load): Move from image.c. When loading a library, record
16080 its filename in the :loaded-from property of the library id.
16081 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16082 Initialize and staticpro them.
16083 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16085 * process.c: Include lisp.h before w32.h, not after.
16086 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16087 instead of gnutls_record_check_pending.
16089 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16091 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16093 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16094 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16097 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16099 * xterm.c (x_set_frame_alpha): Do not set property on anything
16100 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16102 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16104 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16106 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16108 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16109 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16110 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16111 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16112 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16113 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16114 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16115 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16116 (Qgnutls_bootprop_callbacks_verify): Make static.
16118 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16120 * callproc.c: Indentation fixup.
16122 * sysdep.c (wait_for_termination_1): Make static.
16123 (wait_for_termination, interruptible_wait_for_termination):
16124 Move after wait_for_termination_1.
16126 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16128 * sysdep.c (interruptible_wait_for_termination): New function
16129 which is like wait_for_termination, but allows keyboard
16132 * callproc.c (Fcall_process): Add (:file "file") as an option for
16134 (Fcall_process_region): Ditto.
16136 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16138 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16139 rather than `XVECTOR (FOO)->size'.
16141 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16142 inttypes.h, as a gnulib replacement is used if it not available in
16145 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16147 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16148 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16149 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16151 * coding.c (coding_alloc_by_realloc): Error out if destination
16152 will grow beyond MOST_POSITIVE_FIXNUM.
16153 (decode_coding_emacs_mule): Abort if there isn't enough place in
16154 charbuf for the composition carryover bytes. Reserve an extra
16155 space for up to 2 characters produced in a loop.
16156 (decode_coding_iso_2022): Abort if there isn't enough place in
16157 charbuf for the composition carryover bytes.
16159 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16161 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16162 aborting when %lld or %lll format is passed.
16163 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16164 %llo or %llx format is passed. (Bug#8545)
16166 * window.c (window_scroll_line_based): Use a marker instead of
16167 simple variables to record original value of point. (Bug#7952)
16169 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16170 produced by %s or %c overflows available buffer space. (Bug#8545)
16172 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16174 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16175 (SIZE_MAX): Move defn after all includes, as they might #define it.
16177 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16179 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16181 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16183 * keyboard.c (Qdelayed_warnings_hook): Define.
16184 (command_loop_1): Run `delayed-warnings-hook'
16185 if Vdelayed_warnings_list is non-nil.
16186 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16187 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16189 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16191 * doprnt.c (doprnt): Don't return value smaller than the buffer
16192 size if the message was truncated. (Bug#8545).
16194 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16196 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16197 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16199 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16201 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16203 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16205 * makefile.w32-in: Update dependencies.
16207 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16209 Improve `doprnt' and its usage. (Bug#8545)
16210 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16211 `format_end'. Remove support for %l as a conversion specifier.
16212 Don't use xrealloc. Improve diagnostics when the %l size modifier
16213 is used. Update the commentary.
16215 * eval.c (verror): Simplify calculation of size_t.
16217 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16220 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16222 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16225 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16227 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16228 This makes this file independent of the recent pseudovector change.
16230 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16232 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16234 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16235 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16236 Remove unused local.
16237 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16239 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16240 GCC 4.6.0 optimizes based on type-based alias analysis.
16241 For example, if b is of type struct buffer * and v of type struct
16242 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16243 != &v->size, and therefore "v->size = 1; b->size = 2; return
16244 v->size;" must therefore return 1. This assumption is incorrect
16245 for Emacs, since it type-puns struct Lisp_Vector * with many other
16246 types. To fix this problem, this patch adds a new type struct
16247 vectorlike_header that documents the constraints on layout of vectors
16248 and pseudovectors, and helps optimizing compilers not get fooled
16249 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16250 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16251 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16253 (XSETPVECTYPE): Rewrite in terms of new macro.
16254 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16255 This is a bit clearer, and further avoids the possibility of
16256 undesirable aliasing.
16257 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16258 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16259 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16260 since Lisp_Subr is a special case (no "next" field).
16261 (ASIZE): Now uses header.size rather than size.
16262 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16263 to avoid the hassle of writing XVECTOR (foo)->header.size.
16264 (struct vectorlike_header): New type.
16265 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16266 object, to help avoid aliasing.
16267 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16268 (SUBRP): Likewise, since Lisp_Subr is a special case.
16269 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16270 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16271 (struct Lisp_Hash_Table): Combine first two members into a single
16272 struct vectorlike_header member. All uses of "size" and "next" members
16273 changed to be "header.size" and "header.next".
16274 * buffer.h (struct buffer): Likewise.
16275 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16276 * frame.h (struct frame): Likewise.
16277 * process.h (struct Lisp_Process): Likewise.
16278 * termhooks.h (struct terminal): Likewise.
16279 * window.c (struct save_window_data, struct saved_window): Likewise.
16280 * window.h (struct window): Likewise.
16281 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16282 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16283 * buffer.c (init_buffer_once): Likewise.
16284 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16286 * process.c (Fformat_network_address): Use local var for size,
16289 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16291 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16292 * data.c (atof): Remove decl; no longer used or needed.
16293 (digit_to_number): Move to lread.c.
16294 (Fstring_to_number): Use new string_to_number function, to be
16295 consistent with how the Lisp reader treats infinities and NaNs.
16296 Do not assume that floating-point numbers represent EMACS_INT
16297 without losing information; this is not true on most 64-bit hosts.
16298 Avoid double-rounding errors, by insisting on integers when
16299 parsing non-base-10 numbers, as the documentation specifies.
16300 * lisp.h (string_to_number): New decl, replacing ...
16301 (isfloat_string): Remove.
16302 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16303 (read1): Do not accept +. and -. as integers; this
16304 appears to have been a coding error. Similarly, do not accept
16305 strings like +-1e0 as floating point numbers. Do not report
16306 overflow for integer overflows unless the base is not 10 which
16307 means we have no simple and reliable way to continue.
16308 Break out the floating-point parsing into a new
16309 function string_to_number, so that Fstring_to_number parses
16310 floating point numbers consistently with the Lisp reader.
16311 (digit_to_number): Move here from data.c. Make it static inline.
16312 (E_CHAR, EXP_INT): Remove, replacing with ...
16313 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16314 (string_to_number): New function, replacing isfloat_string.
16315 This function checks for valid syntax and produces the resulting
16316 Lisp float number too. Rework it so that string-to-number
16317 no longer mishandles examples like "1.0e+". Use strtoumax,
16318 so that overflow for non-base-10 numbers is reported only when
16319 there's no portable and simple way to convert to floating point.
16321 * textprop.c (set_text_properties_1): Rewrite for clarity,
16322 and to avoid GCC warning about integer overflow.
16324 * intervals.h (struct interval): Use EMACS_INT for members
16325 where EMACS_UINT might cause problems. See
16326 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16327 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16328 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16330 (offset_intervals): Tell GCC not to worry about length overflow
16331 when negating a negative length.
16333 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16334 (overrun_check_free): Likewise.
16336 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16337 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16340 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16341 (gnutls_make_error): Rename local to avoid shadowing.
16342 (gnutls_emacs_global_deinit): ifdef out; not used.
16343 (Fgnutls_boot): Use const for pointer to readonly storage.
16344 Comment out unused local. Fix pointer signedness problems.
16346 * lread.c (openp): Don't stuff size_t into an 'int'.
16347 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16348 about possible signed overflow.
16350 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16351 (GDK_KEY_g): Don't define if already defined.
16352 (xg_prepare_tooltip): Avoid pointer signedness problem.
16353 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16355 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16356 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16358 * xfns.c (Fx_window_property): Simplify a bit,
16359 to make a bit faster and to avoid GCC 4.6.0 warning.
16360 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16362 * fns.c (internal_equal): Don't assume size_t fits in int.
16364 * alloc.c (compact_small_strings): Tighten assertion a little.
16366 Replace pEd with more-general pI, and fix some printf arg casts.
16367 * lisp.h (pI): New macro, generalizing old pEd macro to other
16368 conversion specifiers. For example, use "...%"pI"d..." rather
16369 than "...%"pEd"...".
16370 (pEd): Remove. All uses replaced with similar uses of pI.
16371 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16372 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16373 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16374 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16375 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16376 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16377 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16379 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16380 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16381 * print.c (safe_debug_print, print_object): Likewise.
16382 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16384 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16385 avoiding the 0 flag, which is not portable.
16386 * process.c (Fmake_network_process): Use pI to avoid cast.
16387 * region-cache.c (pp_cache): Likewise.
16388 * xdisp.c (decode_mode_spec): Likewise.
16389 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16390 behavior on 64-bit hosts with printf arg.
16391 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16392 (x_stop_queuing_selection_requests): Likewise.
16393 (x_get_window_property): Don't truncate byte count to an 'int'
16396 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16397 here, since it parses constructs like leading '-' and spaces,
16398 which are not wanted; and it overflows with large numbers.
16399 Instead, simply match F[0-9]+, which is what is wanted anyway.
16401 * alloc.c: Remove unportable assumptions about struct layout.
16402 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16403 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16404 (allocate_vectorlike, make_pure_vector): Use the new macros,
16405 plus offsetof, to remove unportable assumptions about struct layout.
16406 These assumptions hold on all porting targets that I know of, but
16407 they are not guaranteed, they're easy to remove, and removing them
16408 makes further changes easier.
16410 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16411 This doesn't fix a bug but makes the code clearer.
16412 (string_overrun_cookie): Now const. Use initializers that
16413 don't formally overflow signed char, to avoid warnings.
16414 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16415 can cause Emacs to crash when string overrun checking is enabled.
16416 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16417 multiple of sizeof (EMACS_INT); it need not be, if
16418 alignof(EMACS_INT) < sizeof (EMACS_INT).
16419 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16421 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16423 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16425 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16427 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16428 supposed to be handshaking. (Bug#8556)
16429 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16431 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16433 * lisp.h (Qdebug): List symbol.
16434 * eval.c (Qdebug): Restore global linkage.
16435 * keyboard.c (debug-on-event): New variable.
16436 (handle_user_signal): Break into debugger when debug-on-event
16437 matches the current signal symbol.
16439 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16441 * alloc.c (check_sblock, check_string_bytes)
16442 (check_string_free_list): Convert to standard C.
16444 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16446 * w32.c (emacs_gnutls_push): Fix typo.
16448 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16450 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16451 "cast to pointer from integer of different size".
16453 Improve doprnt and its use in verror. (Bug#8545)
16454 * doprnt.c (doprnt): Document the set of format control sequences
16455 supported by the function. Use SAFE_ALLOCA instead of always
16458 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16459 is one byte too soon. Don't use xrealloc; instead xfree and
16462 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16464 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16467 * gnutls.c: Renamed global_initialized to
16468 gnutls_global_initialized. Added internals for the
16469 :verify-hostname-error, :verify-error, and :verify-flags
16470 parameters of `gnutls-boot' and documented those parameters in the
16471 docstring. Start callback support.
16472 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16473 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16474 on error. Return error code.
16475 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16476 (emacs_gnutls_read): Likewise.
16477 (Fgnutls_boot): Return handshake error code.
16478 (emacs_gnutls_handle_error): New function.
16479 (wsaerror_to_errno): Likewise.
16481 * w32.h (emacs_gnutls_pull): Add prototype.
16482 (emacs_gnutls_push): Likewise.
16484 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16485 (emacs_gnutls_push): Likewise.
16487 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16489 * process.c (wait_reading_process_output): Check if GnuTLS
16490 buffered some data internally if no FDs are set for TLS
16493 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16494 (LIBS): Link to USER_LIBS.
16495 ($(BLD)/gnutls.$(0)): New target.
16497 2011-04-24 Eli Zaretskii <eliz@gnu.org>
16499 * xdisp.c (handle_single_display_spec): Rename the
16500 display_replaced_before_p argument into display_replaced_p, to
16501 make it consistent with the commentary. Fix typos in the
16504 * textprop.c (syms_of_textprop): Remove dead code.
16505 (copy_text_properties): Delete obsolete commentary about an
16506 interface that was deleted long ago. Fix typos in the description
16509 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16510 to changes in oldXMenu/XMenu.h from 2011-04-16.
16511 <menu_help_message, prev_menu_help_message>: Constify.
16512 (IT_menu_make_room): menu->help_text is now `const char **';
16515 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16516 to changes in oldXMenu/XMenu.h from 2011-04-16.
16517 (struct XMenu): Declare `help_text' `const char **'.
16519 * xfaces.c <Qunspecified>: Make extern again.
16521 * syntax.c: Include sys/types.h before including regex.h, as
16524 * doc.c (get_doc_string): Improve the format passed to `error'.
16526 * doprnt.c (doprnt): Improve commentary.
16528 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16530 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16533 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16534 changes in globals.h immediately force recompilation.
16535 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16536 $(CURDIR)/s/ms-w32.h.
16537 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16539 * character.c (Fchar_direction): Function deleted.
16540 (syms_of_character): Don't defsubr it.
16541 <char-direction-table>: Deleted.
16543 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16545 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16546 * doprnt.c: Include limits.h.
16547 (SIZE_MAX): New macro.
16548 (doprnt): Return a size_t value. 2nd arg is now size_t.
16549 Many local variables are now size_t instead of int or unsigned.
16550 Improve overflow protection. Support `l' modifier for integer
16551 conversions. Support %l conversion. Don't assume an EMACS_INT
16552 argument for integer conversions and for %c.
16554 * lisp.h (doprnt): Restore prototype.
16556 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16557 $(SRC)/character.h.
16559 * Makefile.in (base_obj): Add back doprnt.o.
16561 * deps.mk (doprnt.o): Add back prerequisites.
16562 (callint.o): Depend on character.h.
16564 * eval.c (internal_lisp_condition_case): Include the handler
16565 representation in the error message.
16566 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16567 when breaking from the loop.
16569 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16571 * callint.c (Fcall_interactively): When displaying error message
16572 about invalid control letter, pass the character's codepoint, not
16573 a pointer to its multibyte form. Improve display of the character
16574 in octal and display also its hex code.
16576 * character.c (char_string): Use %x to display the (unsigned)
16577 codepoint of an invalid character, to avoid displaying a bogus
16580 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16581 `error', not SYMBOL_NAME itself.
16583 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16584 character arguments to `error'.
16586 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16587 to `error' in error message about FINAL_CHAR argument. Make sure
16588 FINAL_CHAR is a character, and use %c when it is passed as
16589 argument to `error'.
16591 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16593 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16595 * w32.c: Include <time.h>.
16596 (sys_localtime): New function.
16598 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
16600 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16602 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16604 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
16606 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16607 zombies (Bug#8467).
16609 2011-04-19 Eli Zaretskii <eliz@gnu.org>
16611 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16612 gl_state.e_property when gl_state.object is Qt.
16614 * insdel.c (make_gap_larger): Remove limitation of buffer size
16617 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
16619 * xdisp.c (lookup_glyphless_char_display)
16620 (produce_glyphless_glyph): Handle cons cell entry in
16621 glyphless-char-display.
16622 (Vglyphless_char_display): Document it.
16624 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16625 glyphless-char-display.
16627 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
16629 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16631 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16633 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16634 definition for no-X builds.
16636 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
16638 Static checks with GCC 4.6.0 and non-default toolkits.
16640 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16642 * process.c (keyboard_bit_set): Define only if SIGIO.
16643 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16644 (send_process): Repair possible setjmp clobbering.
16646 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16648 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16650 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16652 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16653 Define only if needed.
16655 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16656 by pacifying GCC about it. Maybe it's time to retire it?
16657 * xfaces.c (USG, __TIMEVAL__): Likewise.
16659 * dispextern.h (struct redisplay_interface): Rename param
16660 to avoid shadowing.
16661 * termhooks.h (struct terminal): Likewise.
16662 * xterm.c (xembed_send_message): Likewise.
16664 * insdel.c (make_gap_smaller): Define only if
16665 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16667 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16670 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16671 so that we aren't warned about unused symbols.
16673 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16675 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16677 * xfns.c (x_real_positions): Mark locals as initialized.
16679 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16681 * xterm.c: Fix problems found by static analysis with other toolkits.
16682 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16683 (x_dispatch_event): Declare static if USE_GTK, and
16684 define if USE_GTK || USE_X_TOOLKIT.
16685 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16686 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16687 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16688 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16690 * xmenu.c (menu_help_callback): Pointer type fixes.
16691 Use const pointers when pointing at readonly data. Avoid pointer
16692 signedness clashes.
16693 (FALSE): Remove unused macro.
16694 (update_frame_menubar): Remove unused decl.
16696 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16698 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16699 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16700 (single_menu_item): Rename local to avoid shadowing.
16702 * keyboard.c (make_lispy_event): Remove unused local var.
16704 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16705 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16707 * bitmaps: Change bitmaps from unsigned char back to the X11
16708 compatible char. Avoid the old compiler warnings about
16709 out-of-range initializers by using, for example, '\xab' rather
16712 * xgselect.c (xgselect_initialize): Check vs interface
16713 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16715 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16717 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16718 to read-only memory.
16720 * fns.c (vector): Remove; this old hack is no longer needed.
16722 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16724 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16726 * xrdb.c (x_load_resources): Omit unused local.
16728 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16729 (x_window): Rename locals to avoid shadowing.
16730 (USG): Use the kludged USG macro, to pacify gcc.
16732 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16733 (x_term_init): Remove local to avoid shadowing.
16735 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16737 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16738 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16740 2011-04-16 Eli Zaretskii <eliz@gnu.org>
16742 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16744 Fix regex.c, syntax.c and friends for buffers > 2GB.
16745 * syntax.h (struct gl_state_s): Declare character position members
16748 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16750 * textprop.c (verify_interval_modification, interval_of):
16751 Declare arguments EMACS_INT.
16753 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16756 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16758 * indent.c (Fvertical_motion): Local variable it_start is now
16761 * regex.c (re_match, re_match_2, re_match_2_internal)
16762 (bcmp_translate, regcomp, regexec, print_double_string)
16763 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16764 (re_compile_pattern, re_exec): Declare arguments and local
16765 variables `size_t' and `ssize_t' and return values `regoff_t', as
16767 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16768 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16769 <compile_stack_type>: `size' and `avail' are now `size_t'.
16771 * regex.h <regoff_t>: Use ssize_t, not int.
16772 (re_search, re_search_2, re_match, re_match_2): Arguments that
16773 specify buffer/string position and length are now ssize_t and
16774 size_t. Return type is regoff_t.
16776 2011-04-16 Ben Key <bkey76@gmail.com>
16778 * nsfont.m: Fixed bugs in ns_get_family and
16779 ns_descriptor_to_entity that were caused by using free to
16780 deallocate memory blocks that were allocated by xmalloc (via
16781 xstrdup). This caused Emacs to crash when compiled with
16782 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16783 --enable-checking=xmallocoverrun). xfree is now used to
16784 deallocate these memory blocks.
16786 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
16788 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16790 emacs_write: Accept and return EMACS_INT for sizes.
16791 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16793 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16794 Accept and return EMACS_INT.
16795 (emacs_gnutls_write): Return the number of bytes written on
16797 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16798 (emacs_read, emacs_write): Remove check for negative size, as the
16799 Emacs source code has been audited now.
16800 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16801 (emacs_read, emacs_write): Use it.
16802 * process.c (send_process): Adjust to the new signatures of
16803 emacs_write and emacs_gnutls_write. Do not attempt to store
16804 a byte offset into an 'int'; it might overflow.
16805 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16807 * sound.c: Don't assume sizes fit in 'int'.
16808 (struct sound_device.period_size, alsa_period_size):
16809 Return EMACS_INT, not int.
16810 (struct sound_device.write, vox_write, alsa_write):
16811 Accept EMACS_INT, not int.
16812 (wav_play, au_play): Use EMACS_INT to store sizes and to
16813 record read return values.
16815 2011-04-15 Ben Key <bkey76@gmail.com>
16817 * keyboard.c (Qundefined): Don't declare static since it is used
16819 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16820 static since they are used in nsfont.m.
16822 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16824 * process.c (Qprocessp): Don't declare static.
16825 * lisp.h (Qprocessp): Declare again.
16827 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
16829 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16831 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16833 Improve C-level modularity by making more things 'static'.
16835 Don't publish debugger-only interfaces to other modules.
16836 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16837 (verify_bytepos, count_markers): Move decls to the only modules
16839 * region-cache.h (pp_cache): Likewise.
16840 * window.h (check_all_windows): Likewise.
16841 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16843 * sysdep.c (croak): Now static, if
16844 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16845 * syssignal.h (croak): Declare only if not static.
16847 * alloc.c (refill_memory_reserve): Now static if
16848 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16849 * lisp.h (refill_memory_reserve): Declare only if not static.
16851 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16852 Define only if USE_LUCID.
16854 * xrdb.c (x_customization_string, x_rm_string): Now static.
16856 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16857 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16859 * xdisp.c (draw_row_with_mouse_face): Now static.
16860 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16862 * window.h (check_all_windows): Mark externally visible.
16864 * window.c (window_deletion_count): Now static.
16866 * undo.c: Make symbols static if they're not exported.
16867 (last_undo_buffer, last_boundary_position, pending_boundary):
16870 * textprop.c (interval_insert_behind_hooks): Now static.
16871 (interval_insert_in_front_hooks): Likewise.
16873 * term.c: Make symbols static if they're not exported.
16874 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16875 (max_frame_lines, tty_set_terminal_modes):
16876 (tty_reset_terminal_modes, tty_turn_off_highlight):
16877 (get_tty_terminal): Now static.
16878 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16879 * termhooks.h (term_mouse_moveto): Do not declare if
16880 HAVE_WINDOW_SYSTEM.
16881 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16882 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16884 * sysdep.c: Make symbols static if they're not exported.
16885 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16887 (sigprocmask_set, full_mask): Remove; unused.
16888 (wait_debugging): Mark as visible.
16889 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16890 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16892 * syntax.c (syntax_temp): Define only if !__GNUC__.
16894 * sound.c (current_sound_device, current_sound): Now static.
16896 * search.c (searchbufs, searchbuf_head): Now static.
16898 * scroll.c (scroll_cost): Remove; unused.
16899 * dispextern.h (scroll_cost): Remove decl.
16901 * region-cache.h (pp_cache): Mark as externally visible.
16903 * process.c: Make symbols static if they're not exported.
16904 (process_tick, update_tick, create_process, chan_process):
16905 (Vprocess_alist, proc_buffered_char, datagram_access):
16906 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16907 (deactivate_process): Mark defn as static, as well as decl.
16908 * lisp.h (create_process): Remove decl.
16909 * process.h (chan_process, Vprocess_alist): Remove decls.
16911 * print.c: Make symbols static if they're not exported.
16912 (print_depth, new_backquote_output, being_printed, print_buffer):
16913 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16914 (print_interval, print_number_index, initial_stderr_stream):
16916 * lisp.h (Fprinc): Remove decl.
16917 (debug_output_compilation_hack): Mark as externally visible.
16919 * sysdep.c (croak): Move decl from here to syssignal.h.
16920 * syssignal.h (croak): Put it here, so the API can be checked when
16921 'croak' is called from dissociate_if_controlling_tty.
16923 * minibuf.c: Make symbols static if they're not exported.
16924 (minibuf_save_list, choose_minibuf_frame): Now static.
16925 * lisp.h (choose_minibuf_frame): Remove decl.
16927 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16929 * lread.c: Make symbols static if they're not exported.
16930 (read_objects, initial_obarray, oblookup_last_bucket_number):
16932 (make_symbol): Remove; unused.
16933 * lisp.h (initial_obarray, make_symbol): Remove decls.
16935 * keyboard.c: Make symbols static if they're not exported.
16936 (single_kboard, recent_keys_index, total_keys, recent_keys):
16937 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16938 (this_single_command_key_start, echoing, last_auto_save):
16939 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16940 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16941 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16942 (Vlispy_mouse_stem, double_click_count):
16944 (force_auto_save_soon): Define only if SIGDANGER.
16945 (ignore_mouse_drag_p): Now static if
16946 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16947 (print_help): Remove; unused.
16948 (stop_character, last_timer_event): Mark as externally visible.
16949 * keyboard.h (ignore_mouse_drag_p): Declare only if
16950 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16951 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16952 * lisp.h (echoing): Remove decl.
16953 (force_auto_save_soon): Declare only if SIGDANGER.
16954 * xdisp.c (redisplay_window): Simplify code, to make it more
16955 obvious that ignore_mouse_drag_p is not accessed if !defined
16956 USE_GTK && !defined HAVE_NS.
16958 * intervals.c: Make symbols static if they're not exported.
16959 (merge_properties_sticky, merge_interval_right, delete_interval):
16961 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16963 * insdel.c: Make symbols static if they're not exported.
16964 However, leave prepare_to_modify_buffer alone. It's never
16965 called from outside this function, but that appears to be a bug.
16966 (combine_after_change_list, combine_after_change_buffer):
16967 (adjust_after_replace, signal_before_change): Now static.
16968 (adjust_after_replace_noundo): Remove; unused.
16969 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16970 (signal_before_change): Remove decls.
16972 * indent.c (val_compute_motion, val_vmotion): Now static.
16974 * image.c: Make symbols static if they're not exported.
16975 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16977 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16978 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16980 * fringe.c (standard_bitmaps): Now static.
16981 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16983 * frame.c: Make symbols static if they're not exported.
16984 (x_report_frame_params, make_terminal_frame): Now static.
16985 (get_frame_param): Now static, unless HAVE_NS.
16986 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16987 (x_get_resource_string): Remove; not used.
16988 * frame.h (make_terminal_frame, x_report_frame_params):
16989 (x_get_resource_string); Remove decls.
16990 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16991 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16993 * font.c, fontset.c: Make symbols static if they're not exported.
16994 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16995 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16996 * font.c (font_close_object): Now static.
16997 * font.h (font_close_object): Remove.
16998 * fontset.c (FONTSET_OBJLIST): Remove.
16999 (free_realized_fontset) #if-0 the body, which does nothing.
17000 (face_suitable_for_char_p): #if-0, as it's never called.
17001 * fontset.h (face_suitable_for_char_p): Remove decl.
17002 * xfaces.c (face_at_string_position):
17003 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17004 since 0 is always ASCII.
17006 * fns.c (weak_hash_tables): Now static.
17008 * fileio.c: Make symbols static if they're not exported.
17009 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17010 (Vwrite_region_annotation_buffers): Now static.
17012 * eval.c: Make symbols static if they're not exported.
17013 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17014 * lisp.h (backtrace_list): Remove decl.
17016 * emacs.c: Make symbols static if they're not exported.
17017 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17018 (fatal_error_code, fatal_error_signal_hook, standard_args):
17020 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17021 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17022 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17023 * lisp.h (fatal_error_signal_hook): Remove decl.
17024 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17026 * editfns.c: Move a (normally-unused) function to its only use.
17027 * editfns.c, lisp.h (get_operating_system_release): Remove.
17028 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17029 worth the hassle of breaking this out.
17031 * xterm.c: Make symbols static if they're not exported.
17032 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17033 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17034 (x_destroy_window, x_delete_display):
17036 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17037 (x_mouse_leave): Remove; unused.
17038 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17039 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17040 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17042 (x_mouse_leave): Declare only if WINDOWSNT.
17043 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17044 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17047 * ftxfont.c: Make symbols static if they're not exported.
17048 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17050 * font.h (ftxfont_driver): Likewise.
17052 * xfns.c: Make symbols static if they're not exported.
17053 (x_last_font_name, x_display_info_for_name):
17054 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17055 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17056 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17057 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17058 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17059 (last_show_tip_args): Now static.
17060 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17061 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17062 (x_screen_planes): Remove; unused.
17063 * dispextern.h (x_screen_planes): Remove decl.
17065 * dispnew.c: Make symbols static if they're not exported.
17066 * dispextern.h (redraw_garbaged_frames, scrolling):
17067 (increment_row_positions): Remove.
17068 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17069 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17071 (redraw_garbaged_frames): Remove; unused.
17073 * xfaces.c: Make symbols static if they're not exported.
17074 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17076 * xterm.h (defined_color): Remove decls.
17077 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17078 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17079 (menu_face_changed_default, defined_color, free_realized_face):
17080 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17081 (ascii_face_of_lisp_face): Remove; unused.
17083 * xdisp.c: Make symbols static if they're not exported.
17084 * dispextern.h (scratch_glyph_row, window_box_edges):
17085 (glyph_to_pixel_coords, set_cursor_from_row):
17086 (get_next_display_element, set_iterator_to_next):
17087 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17088 (show_mouse_face): Remove decls
17089 * frame.h (message_buf_print): Likewise.
17090 * lisp.h (pop_message, set_message, check_point_in_composition):
17092 * xterm.h (set_vertical_scroll_bar): Likewise.
17093 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17094 (message_buf_print, scratch_glyph_row, displayed_buffer):
17095 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17096 (get_next_display_element, show_mouse_face, window_box_edges):
17097 (frame_to_window_pixel_xy, check_point_in_composition):
17098 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17099 (glyph_to_pixel_coords): Remove; unused.
17101 * dired.c (file_name_completion): Now static.
17103 * dbusbind.c (xd_in_read_queued_messages): Now static.
17105 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17106 * data.c (circular_list_error): Remove.
17108 * commands.h (last_point_position, last_point_position_buffer):
17109 (last_point_position_window): Remove decls.
17110 * keyboard.c: Make these variables static.
17112 * coding.h (coding, code_convert_region, encode_coding_gap):
17114 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17115 (iso_code_class, detect_coding, code_convert_region): Now static.
17116 (encode_coding_gap): Remove; unused.
17118 * chartab.c (chartab_chars, chartab_bits): Now static.
17120 * charset.h (charset_iso_8859_1): Remove decl.
17121 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17124 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17125 * ccl.c (Vccl_program_table): Now static.
17126 (check_ccl_update): Remove; unused.
17128 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17129 * category.h: ... from here.
17130 * category.c (check_category_table, set_category_set): Now static.
17132 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17133 * lisp.h: Remove these decls.
17135 * buffer.c (buffer_count): Remove unused var.
17137 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17138 so that it's not optimized away.
17139 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17140 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17141 exported only to the debugger.
17143 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17144 * atimer.h (run_all_atimers): Remove; not exported.
17146 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17147 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17148 was inaccessible from Lisp.
17149 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17150 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17152 alloc.c: Import and export fewer symbols, and remove unused items.
17153 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17155 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17156 it's not optimized away by whole-program optimization.
17157 (message_enable_multibyte, free_misc): Remove.
17158 (catchlist, handlerlist, mark_backtrace):
17159 Declare only if BYTE_MARK_STACK.
17160 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17161 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17162 (message_enable_multibyte): Remove decl.
17163 (free_misc, interval_free_list, float_block, float_block_index):
17164 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17165 (cons_free_list, last_marked_index):
17167 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17168 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17169 (mark_backtrace): Define only if BYTE_MARK_STACK.
17170 * xdisp.c (message_enable_multibyte): Now static.
17172 Declare Lisp_Object Q* variables to be 'static' if not exported.
17173 This makes it easier for human readers (and static analyzers)
17174 to see whether these variables are used from other modules.
17175 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17176 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17177 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17178 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17179 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17180 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17181 * xmenu.c, xselect.c:
17182 Declare Q* vars static if they are not used in other modules.
17183 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17184 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17185 Remove decls of unexported vars.
17186 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17188 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17190 Make Emacs functions such as Fatom 'static' by default.
17191 This makes it easier for human readers (and static analyzers)
17192 to see whether these functions can be called from other modules.
17193 DEFUN now defines a static function. To make the function external
17194 so that it can be used in other C modules, use the new macro DEFUE.
17195 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17196 (Finit_image_library):
17197 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17198 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17199 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17200 Remove decls, since these functions are now static.
17201 (Funintern, Fget_internal_run_time): New decls, since these functions
17202 were already external.
17204 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17205 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17206 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17207 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17208 * keyboard.c, keymap.c, lread.c:
17209 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17210 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17211 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17212 Mark functions with DEFUE instead of DEFUN,
17213 if they are used in other modules.
17214 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17215 decls for now-static functions.
17216 * buffer.h (Fdelete_overlay): Remove decl.
17217 * callproc.c (Fgetenv_internal): Mark as internal.
17218 * composite.c (Fremove_list_of_text_properties): Remove decl.
17219 (Fcomposition_get_gstring): New forward static decl.
17220 * composite.h (Fcomposite_get_gstring): Remove decl.
17221 * dired.c (Ffile_attributes): New forward static decl.
17222 * doc.c (Fdocumntation_property): New forward static decl.
17223 * eval.c (Ffetch_bytecode): New forward static decl.
17224 (Funintern): Remove extern decl; now in .h file where it belongs.
17225 * fileio.c (Fmake_symbolic_link): New forward static decl.
17226 * image.c (Finit_image_library): New forward static decl.
17227 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17228 * intervals.h (Fprevious_property_change):
17229 (Fremove_list_of_text_properties): Remove decls.
17230 * keyboard.c (Fthis_command_keys): Remove decl.
17231 (Fcommand_execute): New forward static decl.
17232 * keymap.c (Flookup_key): New forward static decl.
17233 (Fcopy_keymap): Now static.
17234 * keymap.h (Flookup_key): Remove decl.
17235 * process.c (Fget_process): New forward static decl.
17236 (Fprocess_datagram_address): Mark as internal.
17237 * syntax.c (Fsyntax_table_p): New forward static decl.
17238 (skip_chars): Remove duplicate decl.
17239 * textprop.c (Fprevious_property_change): New forward static decl.
17240 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17242 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17243 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17245 * editfns.c (Fformat): Remove unreachable code.
17247 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17249 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17252 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17254 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17255 when at ZV. (Bug#8487)
17257 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17259 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17261 * keyboard.c (parse_tool_bar_item): Likewise.
17262 * sound.c (sound_cleanup, alsa_close): Likewise.
17263 * termcap.c (tgetent): Likewise.
17264 * xfns.c (x_default_font_parameter): Likewise.
17265 * xsettings.c (read_and_apply_settings): Likewise.
17267 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17268 (overrun_check_free): Protoize.
17270 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17272 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17273 since callers should never pass a negative size.
17274 Change the signature to match that of plain 'read' and 'write'; see
17275 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17276 * lisp.h: Update prototypes of emacs_write and emacs_read.
17278 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17280 * xdisp.c (redisplay_window): Don't try to determine the character
17281 position of the scroll margin if the window start point w->startp
17282 is outside the buffer's accessible region. (Bug#8468)
17284 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17286 Fix write-region and its subroutines for buffers > 2GB.
17287 * fileio.c (a_write, e_write): Modify declaration of arguments and
17288 local variables to support buffers larger than 2GB.
17289 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17291 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17292 argument, local variables, and return value.
17294 * lisp.h: Update prototypes of emacs_write and emacs_read.
17296 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17298 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17300 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17302 Fix more problems found by GCC 4.6.0's static checks.
17304 * xdisp.c (vmessage): Use a better test for character truncation.
17306 * charset.c (load_charset_map): <, not <=, for optimization,
17307 and to avoid potential problems with integer overflow.
17308 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17309 * casetab.c (set_identity, shuffle): Likewise.
17310 * editfns.c (Fformat): Likewise.
17311 * syntax.c (skip_chars): Likewise.
17313 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17314 This also lets GCC 4.6.0 generate slightly better loop code.
17316 * callint.c (Fcall_interactively): <, not <=, for optimization.
17317 (Fcall_interactively): Count the number of arguments produced,
17318 not the number of arguments given. This is simpler and lets GCC
17319 4.6.0 generate slightly better code.
17321 * ftfont.c: Distingish more carefully between FcChar8 and char.
17322 The previous code passed unsigned char * to a functions like
17323 strlen and xstrcasecmp that expect char *, which does not
17324 conform to the C standard.
17325 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17326 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17327 char * when the C standard requires it.
17329 * keyboard.c (read_char): Remove unused var.
17331 * eval.c: Port to Windows vsnprintf (Bug#8435).
17332 Include <limits.h>.
17333 (SIZE_MAX): Define if the headers do not.
17334 (verror): Do not give up if vsnprintf returns a negative count.
17335 Instead, grow the buffer. This ports to Windows vsnprintf, which
17336 does not conform to C99. Problem reported by Eli Zaretskii.
17337 Also, simplify the allocation scheme, by avoiding the need for
17338 calling realloc, and removing the ALLOCATED variable.
17340 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17342 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17343 But keep the doprint source code for now, as we might revamp it
17344 and use it again (Bug#8435).
17345 * lisp.h (doprnt): Remove.
17346 * Makefile.in (base_obj): Remove doprnt.o.
17347 * deps.mk (doprnt.o): Remove.
17349 error: Print 32- and 64-bit integers portably (Bug#8435).
17350 Without this change, on typical 64-bit hosts error ("...%d...", N)
17351 was used to print both 32- and 64-bit integers N, which relied on
17352 undefined behavior.
17353 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17354 * lisp.h (error, verror): Mark as printf-like functions.
17355 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17356 Report overflow in size calculations when allocating printf buffer.
17357 Do not truncate output string at its first null byte.
17358 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17359 Truncate the output at a character boundary, since vsnprintf does not
17361 * charset.c (check_iso_charset_parameter): Convert internal
17362 character to string before calling 'error', since %c now has the
17364 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17365 overflow when computing char to be passed to 'error'. Do not
17366 pass Lisp_Object to 'error'; pass the integer instead.
17367 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17368 formatted with plain %d.
17370 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17372 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17374 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17376 * xterm.c (x_catch_errors): Remove duplicate declaration.
17378 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17380 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17382 2011-04-10 Jim Meyering <meyering@redhat.com>
17384 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17385 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17386 return ssize_t not "int", and use size_t as the buffer length.
17387 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17388 * gnutls.h: Update declarations.
17389 * process.c (read_process_output): Use ssize_t, to match.
17390 (send_process): Likewise.
17392 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17394 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17396 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17398 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17399 Use unsigned char, to match FcChar8 type definition.
17401 * xterm.c (handle_one_xevent):
17402 * xmenu.c (create_and_show_popup_menu):
17403 * xselect.c (x_decline_selection_request)
17404 (x_reply_selection_request): Avoid type-punned deref of X events.
17406 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17408 Fix some uses of `int' instead of EMACS_INT.
17409 * search.c (string_match_1, fast_string_match)
17410 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17411 (scan_buffer, find_next_newline_no_quit)
17412 (find_before_next_newline, search_command, Freplace_match)
17413 (Fmatch_data): Make some `int' variables be EMACS_INT.
17415 * xdisp.c (display_count_lines): 3rd argument and return value now
17416 EMACS_INT. All callers changed.
17417 (pint2hrstr): Last argument is now EMACS_INT.
17419 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17420 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17421 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17422 (decode_coding_utf_16, decode_coding_emacs_mule)
17423 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17424 (decode_coding_ccl, decode_coding_charset)
17425 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17426 (decode_coding_iso_2022, decode_coding_emacs_mule)
17427 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17428 <char_offset, last_offset>: Declare EMACS_INT.
17429 (encode_coding_utf_8, encode_coding_utf_16)
17430 (encode_coding_emacs_mule, encode_invocation_designation)
17431 (encode_designation_at_bol, encode_coding_iso_2022)
17432 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17433 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17435 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17436 (encode_invocation_designation): Last argument P_NCHARS is now
17438 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17439 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17441 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17444 * ccl.c (Fccl_execute_on_string): Declare some variables
17447 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17449 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17451 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17453 * process.c (Fformat_network_address): Doc fix.
17455 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17457 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17459 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
17461 * keyboard.c (read_char): Call Lisp function help-form-show,
17462 instead of using internal_with_output_to_temp_buffer.
17463 (Qhelp_form_show): New var.
17464 (syms_of_keyboard): Use DEFSYM macro.
17466 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17468 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17470 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
17472 * process.c (Flist_processes): Remove to Lisp.
17473 (list_processes_1): Delete.
17475 2011-04-06 Eli Zaretskii <eliz@gnu.org>
17477 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17479 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17481 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
17483 Fix more problems found by GCC 4.6.0's static checks.
17485 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17487 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17489 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17491 * xdisp.c (vmessage): Mark as a printf-like function.
17493 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17495 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17497 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17498 printf-like functions.
17499 (tiff_load): Add casts to remove these marks before passing them
17500 to system-supplied API.
17502 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17504 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17505 This avoids several warnings with gcc -Wstrict-overflow.
17506 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17507 directly, rather than having caller test rule sign. This avoids
17508 some unnecessary tests.
17509 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17510 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17511 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17513 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17514 (xfont_open): Avoid unnecessary tests.
17516 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17518 * composite.h, composite.c (composition_gstring_put_cache):
17519 Use EMACS_INT, not int, for length.
17521 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17522 breaking out part of COMPOSITION_DECODE_RULE.
17523 (COMPOSITION_DECODE_RULE): Use it.
17524 * composite.c (get_composition_id): Remove unused local vars,
17525 by using the new macro.
17527 * textprop.c (set_text_properties_1): Change while to do-while,
17528 since the condition is always true at first.
17530 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17531 (interval_deletion_adjustment): Return unsigned value.
17534 * process.c (list_processes_1, create_pty, read_process_output):
17535 (exec_sentinel): Remove vars that were set but not used.
17536 (create_pty): Remove unnecessary "volatile"s.
17537 (Fnetwork_interface_info): Avoid possibility of int overflow.
17538 (read_process_output): Do adaptive read buffering even if carryover.
17539 (read_process_output): Simplify nbytes computation if buffered.
17541 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17543 * syntax.c (scan_words): Remove var that was set but not used.
17544 (update_syntax_table): Use unsigned instead of int.
17546 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17547 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17548 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17550 * print.c (print_error_message): Avoid int overflow.
17552 * font.c (font_list_entities): Redo for clarity,
17553 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17555 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17556 (font_score): Avoid potential overflow in diff calculation.
17558 * fns.c (substring_both): Remove var that is set but not used.
17559 (sxhash): Redo loop for clarity and to avoid wraparound warning.
17561 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17563 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17564 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17565 can always succeed if overflow has undefined behavior.
17567 * search.c (boyer_moore, wordify): Remove vars set but not used.
17568 (wordify): Omit three unnecessary tests.
17570 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17571 All callers changed. This avoids the need for an unused var.
17573 * casefiddle.c (casify_region): Remove var that is set but not used.
17575 * dired.c (file_name_completion): Remove var that is set but not used.
17577 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17579 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17580 (Finsert_file_contents): Remove unnecessary code checking fd.
17582 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17583 Check for integer overflow on size calculations.
17585 * buffer.c (Fprevious_overlay_change): Remove var that is set
17588 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17589 Remove vars that are set but not used.
17590 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17591 (timer_check_2): Mark vars as initialized.
17593 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17595 * image.c (lookup_image): Remove var that is set but not used.
17596 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17598 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17599 that are set but not used.
17601 * xfns.c (make_invisible_cursor): Don't return garbage
17602 if XCreateBitmapFromData fails (Bug#8410).
17604 * xselect.c (x_get_local_selection, x_handle_property_notify):
17605 Remove vars that are set but not used.
17607 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17608 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17610 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17611 Remove var that is set but not used.
17612 (scroll_bar_windows_size): Now size_t, not int.
17613 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17614 Check for overflow.
17616 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17617 (map_tty_color) [!defined MSDOS]: Likewise.
17619 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17621 * coding.c: Remove vars that are set but not used.
17622 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17623 All callers changed.
17624 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17625 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17626 (decode_coding_charset): Remove vars that are set but not used.
17628 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17629 that is set but not used.
17631 * print.c (print_object): Remove var that is set but not used.
17633 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17634 The gnulib version avoids calling malloc in the usual case,
17635 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17636 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17637 * filelock.c (current_lock_owner): Likewise.
17638 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17639 * sysdep.c: Include allocator.h, careadlinkat.h.
17640 (emacs_no_realloc_allocator): New static constant.
17641 (emacs_readlink): New function.
17642 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17643 ../lib/careadlinkat.h.
17645 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17647 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17648 first non-nil return value).
17650 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17652 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17653 if not defined (Bug#8403).
17655 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17657 * xdisp.c (display_count_lines): Remove parameter `start',
17658 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17659 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17660 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17661 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17662 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17663 and thereabouts. All callers changed.
17664 (get_per_char_metric): Remove parameter `f', unused since
17665 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17667 2011-04-02 Jim Meyering <meyering@redhat.com>
17669 do not dereference NULL upon failed strdup
17670 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17671 (ns_get_family): Likewise.
17673 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17675 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17677 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17679 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17682 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17684 Add lexical binding.
17686 * window.c (Ftemp_output_buffer_show): New fun.
17687 (Fsave_window_excursion):
17688 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17690 * lread.c (lisp_file_lexically_bound_p): New function.
17691 (Fload): Bind Qlexical_binding.
17692 (readevalloop): Remove `evalfun' arg.
17693 Bind Qinternal_interpreter_environment.
17694 (Feval_buffer): Bind Qlexical_binding.
17695 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17697 (syms_of_lread): Declare `lexical-binding'.
17699 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17701 * keyboard.c (eval_dyn): New fun.
17702 (menu_item_eval_property): Use it.
17704 * image.c (parse_image_spec): Use Ffunctionp.
17706 * fns.c (concat, mapcar1): Accept byte-code-functions.
17708 * eval.c (Fsetq): Handle lexical vars.
17709 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17710 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17711 (FletX, Flet): Obey lexical binding.
17712 (Fcommandp): Handle closures.
17713 (Feval): New `lexical' arg.
17714 (eval_sub): New function extracted from Feval. Use it almost
17715 everywhere where Feval was used. Look up vars in lexical env.
17717 (Ffunctionp): Move from subr.el.
17718 (Ffuncall): Handle closures.
17719 (apply_lambda): Remove `eval_flags'.
17720 (funcall_lambda): Handle closures and new byte-code-functions.
17721 (Fspecial_variable_p): New function.
17722 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17723 but without exporting it to Lisp.
17725 * doc.c (Fdocumentation, store_function_docstring):
17726 * data.c (Finteractive_form): Handle closures.
17728 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17731 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17733 (exec_byte_code): New function extracted from Fbyte_code to handle new
17734 calling convention for byte-code-functions. Add new byte-codes.
17736 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17738 * alloc.c (Fmake_symbol): Init new `declared_special' field.
17740 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17742 * xdisp.c (redisplay_internal): Fix prototype.
17744 2011-03-31 Eli Zaretskii <eliz@gnu.org>
17746 * xdisp.c (SCROLL_LIMIT): New macro.
17747 (try_scrolling): Use it when setting scroll_limit.
17748 Limit scrolling to 100 screen lines.
17749 (redisplay_window): Even when falling back on "recentering",
17750 position point in the window according to scroll-conservatively,
17751 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17753 (try_scrolling): When point is above the window, allow searching
17754 as far as scroll_max, or one screenful, to compute vertical
17755 distance from PT to the scroll margin position. This prevents
17756 try_scrolling from unnecessarily failing when
17757 scroll-conservatively is set to a value slightly larger than the
17758 window height. Clean up the case of PT below the margin at bottom
17759 of window: scroll_max can no longer be INT_MAX. When aggressive
17760 scrolling is in use, don't let point enter the opposite scroll
17761 margin as result of the scroll.
17762 (syms_of_xdisp) <scroll-conservatively>: Document the
17763 threshold of 100 lines for never-recentering scrolling.
17765 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17767 * dispextern.h (move_it_by_lines):
17768 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17769 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17770 (message_log_check_duplicate): Remove parameters `prev_bol' and
17771 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17772 (redisplay_internal): Remove parameter `preserve_echo_area',
17773 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17775 * indent.c (Fvertical_motion):
17776 * window.c (window_scroll_pixel_based, Frecenter):
17777 Don't pass `need_y_p' to `move_it_by_lines'.
17779 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17781 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17782 steal a few bits to be more compact.
17783 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17784 Remove unneeded casts.
17786 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17788 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17790 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17791 binding" message (bug#7967).
17793 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17795 Fix more problems found by GCC 4.6.0's static checks.
17797 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17798 Remove unused local var.
17800 * editfns.c (Fmessage_box): Remove unused local var.
17802 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17803 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17804 Omit unused local vars.
17805 * window.c (shrink_windows): Omit unused local var.
17806 * menu.c (digest_single_submenu): Omit unused local var.
17807 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17808 Omit unused local var.
17810 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17811 Don't assume string length fits in int.
17812 (keyremap_step, read_key_sequence): Use size_t for sizes.
17813 (read_key_sequence): Don't check last_real_key_start redundantly.
17815 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17816 instead of alloca (Bug#8344).
17818 * eval.c (Fbacktrace): Don't assume nargs fits in int.
17819 (Fbacktrace_frame): Don't assume nframes fits in int.
17821 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17823 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17826 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17828 * cm.c (calccost): Turn while-do into do-while, for clarity.
17830 * keyboard.c (syms_of_keyboard): Use the same style as later
17831 in this function when indexing through an array. This also
17832 works around GCC bug 48267.
17834 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17836 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17838 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17839 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17841 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17842 This avoids undefined behavior on integer overflow, and is a bit
17843 more convenient anyway since it is compared to a size_t variable.
17845 Variadic C functions now count arguments with size_t, not int.
17846 This avoids an unnecessary limitation on 64-bit machines, which
17847 caused (substring ...) to crash on large vectors (Bug#8344).
17848 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17849 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
17850 All variadic functions and their callers changed accordingly.
17851 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17852 * data.c (arith_driver, float_arith_driver): Likewise.
17853 * editfns.c (general_insert_function): Likewise.
17854 * eval.c (struct backtrace.nargs, interactive_p)
17855 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17856 (funcall_lambda, mark_backtrace): Likewise.
17857 * fns.c (concat): Likewise.
17858 * frame.c (x_set_frame_parameters): Likewise.
17859 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17860 0 if not found, not -1. All callers changed.
17862 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17863 (stack_copy_size): Now size_t, not int.
17864 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17866 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17868 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17869 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17870 All callers changed.
17872 * lisp.h (multibyte_char_to_unibyte):
17873 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17874 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17875 * character.h (CHAR_TO_BYTE8):
17876 * cmds.c (internal_self_insert):
17877 * editfns.c (general_insert_function):
17878 * keymap.c (push_key_description):
17879 * search.c (Freplace_match):
17880 * xdisp.c (message_dolog, set_message_1): All callers changed.
17882 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17884 * keyboard.c (safe_run_hook_funcall): New function.
17885 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17886 don't set the hook to nil, but remove the offending function instead.
17887 (Qcommand_hook_internal): Remove, unused.
17888 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17889 Vcommand_hook_internal.
17891 * eval.c (enum run_hooks_condition): Remove.
17892 (funcall_nil, funcall_not): New functions.
17893 (run_hook_with_args): Call each function through a `funcall' argument.
17894 Remove `cond' argument, now redundant.
17895 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17896 (Frun_hook_with_args_until_failure): Adjust accordingly.
17897 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17899 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17901 * dispextern.h (string_buffer_position): Remove declaration.
17903 * print.c (strout): Remove parameter `multibyte', unused since
17904 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17906 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17907 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17908 All callers changed.
17910 * w32.c (_wsa_errlist): Use braces for struct initializers.
17912 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17913 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17914 All callers changed.
17915 (string_buffer_position): Likewise. Also, make static (it's never
17916 used outside xdisp.c).
17917 (cursor_row_p): Remove parameter `w', unused since
17918 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17919 (decode_mode_spec): Remove parameter `precision', introduced during
17920 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17921 All callers changed.
17923 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17925 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17927 2011-03-27 Anders Lindgren <andlind@gmail.com>
17929 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17930 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17931 (ns_update_auto_hide_menu_bar): New functions.
17932 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17933 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17934 ns_constrain_all_frames.
17935 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17936 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17938 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17940 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17942 2011-03-27 Glenn Morris <rgm@gnu.org>
17944 * syssignal.h: Replace RETSIGTYPE with void.
17945 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17946 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17947 Replace SIGTYPE with void everywhere.
17948 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17949 * s/template.h (SIGTYPE): Remove commented out definition.
17951 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17953 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17954 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17956 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17958 * w32.c (read_unc_volume): Use parameter `henum', instead of
17959 global variable `wget_enum_handle'.
17961 * keymap.c (describe_vector): Remove parameters `indices' and
17962 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17963 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17965 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17967 * keyboard.c (timer_check): Remove parameter `do_it_now',
17968 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17969 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17970 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17972 * keyboard.c (read_char):
17973 * w32menu.c (w32_menu_display_help):
17974 * xmenu.c (show_help_event, menu_help_callback):
17975 Adjust calls to `show_help_echo'.
17977 * gtkutil.c (xg_maybe_add_timer):
17978 * keyboard.c (readable_events):
17979 * process.c (wait_reading_process_output):
17980 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17982 * insdel.c (adjust_markers_gap_motion):
17983 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17984 (gap_left, gap_right): Don't call it.
17986 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17988 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17989 incurred during fontification.
17991 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17993 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17994 (DEFVAR_PER_BUFFER): Don't pass it.
17996 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17997 (scrolling_window): Don't pass it.
17999 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18001 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18003 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18005 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18006 of variables specific to SELinux and computation of `encoded_absname'.
18008 * image.c (XPutPixel): Remove unused variable `height'.
18010 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18012 * unexw32.c (get_section_info): Remove unused variable `section'.
18014 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18015 (system_process_attributes): Remove unused variable `sess'.
18016 (sys_read): Remove unused variable `err'.
18018 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18019 (w32_wnd_proc): Remove unused variable `isdead'.
18020 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18021 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18022 (x_create_tip_frame): Remove unused variable `tem'.
18024 * w32inevt.c (w32_console_read_socket):
18025 Remove unused variable `no_events'.
18027 * w32term.c (x_draw_composite_glyph_string_foreground):
18028 Remove unused variable `width'.
18030 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18032 * w32term.c (x_set_glyph_string_clipping):
18033 Don't pass uninitialized region to CombineRgn.
18035 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18037 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18038 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18039 (Fx_close_connection): Remove unused variable `i'.
18041 * w32font.c (w32font_draw): Return number of glyphs.
18042 (w32font_open_internal): Remove unused variable `i'.
18043 (w32font_driver): Add missing initializer.
18045 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18046 (fill_in_menu): Remove unused variable `items_added'.
18048 * w32term.c (last_mouse_press_frame): Remove static global variable.
18049 (w32_clip_to_row): Remove unused variable `f'.
18050 (x_delete_terminal): Remove unused variable `i'.
18052 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18053 (NOTHING): Remove unused static global variable.
18054 (uniscribe_check_otf): Remove unused variable `table'.
18055 (uniscribe_font_driver): Add missing initializers.
18057 2011-03-23 Julien Danjou <julien@danjou.info>
18059 * term.c (Fsuspend_tty, Fresume_tty):
18060 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18061 * window.c (temp_output_buffer_show):
18062 * insdel.c (signal_before_change):
18063 * frame.c (Fhandle_switch_frame):
18064 * fileio.c (Fdo_auto_save):
18065 * emacs.c (Fkill_emacs):
18066 * editfns.c (save_excursion_restore):
18067 * cmds.c (internal_self_insert):
18068 * callint.c (Fcall_interactively):
18069 * buffer.c (Fkill_all_local_variables):
18070 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18072 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18073 unconditionally since it does the check itself.
18075 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18077 Fix more problems found by GCC 4.5.2's static checks.
18079 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18080 the first time through the loop, since we know p0 < p1 then.
18081 This also avoids a gcc -Wstrict-overflow warning.
18083 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18084 leading to a memory leak, possible in functions like
18085 load_charset_map_from_file that can allocate an unbounded number
18086 of objects (Bug#8318).
18088 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18089 that could (at least in theory) be that large.
18091 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18092 This is less likely to overflow, and avoids undefined behavior if
18093 overflow does occur. All callers changed. Use strtoul to scan
18094 for the unsigned long integer.
18095 (pint2hrstr): Simplify and tune code slightly.
18096 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18098 * scroll.c (do_scrolling): Work around GCC bug 48228.
18099 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18101 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18102 This also avoids a warning with gcc -Wstrict-overflow.
18103 (validate_x_resource_name): Simplify count usage.
18104 This also avoids a warning with gcc -Wstrict-overflow.
18106 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18109 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18111 * process.c (Fmake_network_process): Use socklen_t, not int,
18112 where POSIX says socklen_t is required in portable programs.
18113 This fixes a porting bug on hosts like 64-bit HP-UX, where
18114 socklen_t is wider than int (Bug#8277).
18115 (Fmake_network_process, server_accept_connection):
18116 (wait_reading_process_output, read_process_output):
18119 * process.c: Rename or move locals to avoid shadowing.
18120 (list_processes_1, Fmake_network_process):
18121 (read_process_output_error_handler, exec_sentinel_error_handler):
18122 Rename or move locals.
18123 (Fmake_network_process): Define label "retry_connect" only if needed.
18124 (Fnetwork_interface_info): Fix pointer signedness.
18125 (process_send_signal): Add cast to avoid pointer signedness problem.
18126 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18127 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18129 Make tparam.h and terminfo.c consistent.
18130 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18131 Include tparam.h instead, since it declares them.
18132 * cm.h (PC): Remove extern decl; tparam.h now does this.
18133 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18134 * terminfo.c: Include tparam.h, to check interfaces.
18135 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18136 (tparam): Adjust signature to match interface in tparam.h;
18137 this removes some undefined behavior. Check that outstring and len
18138 are zero, which they always are with Emacs.
18139 * tparam.h (PC, BC, UP): New extern decls.
18141 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18142 (xftfont_open): Rename locals to avoid shadowing.
18144 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18145 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18146 (OTF_TAG_SYM): Omit macro if not needed.
18147 (ftfont_list): Remove unused local.
18148 (get_adstyle_property, ftfont_pattern_entity):
18149 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18150 Rename locals to avoid shadowing.
18152 * xfont.c (xfont_list_family): Mark var as initialized.
18154 * xml.c (make_dom): Now static.
18156 * composite.c (composition_compute_stop_pos): Rename local to
18158 (composition_reseat_it): Remove unused locals.
18159 (find_automatic_composition, composition_adjust_point): Likewise.
18160 (composition_update_it): Mark var as initialized.
18161 (find_automatic_composition): Mark vars as initialized,
18162 with a FIXME (Bug#8290).
18164 character.h: Rename locals to avoid shadowing.
18165 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18166 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18167 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18168 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18169 to avoid shadowing.
18171 * textprop.c (property_change_between_p): Remove; unused.
18173 * intervals.c (interval_start_pos): Now static.
18175 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18177 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18178 Rename locals to avoid shadowing.
18180 * sound.c (wav_play, au_play, Fplay_sound_internal):
18181 Fix pointer signedness.
18182 (alsa_choose_format): Remove unused local var.
18183 (wav_play): Initialize a variable to 0, to prevent undefined
18184 behavior (Bug#8278).
18186 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18188 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18190 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18191 clobbering (Bug#8298).
18192 * sysdep.c (sys_subshell): Likewise.
18193 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18195 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18196 This should get cleaned up, so that child_setup has the
18197 same signature on all platforms.
18199 * callproc.c (call_process_cleanup): Now static.
18200 (relocate_fd): Rename locals to avoid shadowing.
18202 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18204 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18205 not to be necessary, and produces flickering.
18207 2011-03-20 Glenn Morris <rgm@gnu.org>
18209 * config.in: Remove file.
18211 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18213 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18214 are now in src/globals.h.
18215 (syms_of_minibuf): Remove spurious & from previous change.
18217 2011-03-20 Leo Liu <sdl.web@gmail.com>
18219 * minibuf.c (completing-read-function): New variable.
18220 (completing-read-default): Rename from completing-read.
18221 (completing-read): Call completing-read-function.
18223 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18225 * xfaces.c (Fx_load_color_file):
18226 Read color file from absolute filename (bug#8250).
18228 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18230 * makefile.w32-in: Update dependencies.
18232 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18234 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18236 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18238 Fix more problems found by GCC 4.5.2's static checks.
18240 * process.c (make_serial_process_unwind, send_process_trap):
18241 (sigchld_handler): Now static.
18243 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18244 That way, the code declares only the vars that it needs.
18245 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18246 * s/cygwin.h (PTY_ITERATION): Likewise.
18247 * s/darwin.h (PTY_ITERATION): Likewise.
18248 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18250 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18251 * process.c (allocate_pty): Don't declare stb unless it's needed.
18253 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18254 (CONSTANTLIM): Remove; unused.
18255 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18256 Define only if needed.
18258 * unexelf.c (unexec): Name an expression,
18259 to avoid gcc -Wbad-function-cast warning.
18260 Use a different way to cause a compilation error if anyone uses
18261 n rather than nn, a way that does not involve shadowing.
18262 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18264 * deps.mk (unexalpha.o): Remove; unused.
18266 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18267 * unexec.h: New file.
18268 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18269 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18270 Depend on unexec.h.
18271 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18272 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18273 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18274 Change as necessary to match prototype in unexec.h.
18276 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18278 (back_comment, skip_chars): Mark vars as initialized.
18280 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18281 Rename locals to avoid shadowing.
18283 * lread.c (read1): Rewrite so as not to use empty "else".
18284 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18286 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18288 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18289 warning when compiling print.c.
18291 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18292 instead of using an uninitialized var.
18293 (font_sort_entities): Mark var as initialized.
18295 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18297 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18298 pointers to constants.
18299 (font_parse_fcname): Remove unused vars.
18300 (font_delete_unmatched): Now static.
18301 (font_get_spec): Remove; unused.
18302 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18303 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18304 Rename or move locals to avoid shadowing.
18306 * fns.c (require_nesting_list, require_unwind): Now static.
18307 (Ffillarray): Rename locals to avoid shadowing.
18309 * floatfns.c (domain_error2): Define only if needed.
18310 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18312 * alloc.c (mark_backtrace): Move decl from here ...
18313 * lisp.h: ... to here, so that it can be checked.
18315 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18316 (Fdefvar): Rewrite so as not to use empty "else".
18317 (lisp_indirect_variable): Name an expression,
18318 to avoid gcc -Wbad-function-cast warning.
18319 (Fdefvar): Rename locals to avoid shadowing.
18321 * callint.c (quotify_arg, quotify_args): Now static.
18322 (Fcall_interactively): Rename locals to avoid shadowing.
18323 Use const pointer when appropriate.
18325 * lisp.h (get_system_name, get_operating_system_release):
18326 Move decls here, to check interfaces.
18327 * process.c (get_operating_system_release): Move decl to lisp.h.
18328 * xrdb.c (get_system_name): Likewise.
18329 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18330 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18331 some of which prompt warnings from gcc -Wbad-function-cast.
18332 (Fformat_time_string, Fencode_time, Finsert_char):
18333 (Ftranslate_region_internal, Fformat):
18334 Rename or remove local vars to avoid shadowing.
18335 (Ftranslate_region_internal): Mark var as initialized.
18337 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18340 * lisp.h (eassert): Check that the argument compiles, even if
18341 ENABLE_CHECKING is not defined.
18343 * data.c (Findirect_variable): Name an expression, to avoid
18344 gcc -Wbad-function-cast warning.
18345 (default_value, arithcompare, arith_driver, arith_error): Now static.
18346 (store_symval_forwarding): Rename local to avoid shadowing.
18347 (Fmake_variable_buffer_local, Fmake_local_variable):
18348 Mark variables as initialized.
18349 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18351 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18352 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18353 Rename locals to avoid shadowing.
18354 (mark_stack): Move local variables into the #ifdef region where
18356 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18357 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18359 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18360 (GC_STRING_CHARS): Remove; not used.
18361 (Fmemory_limit): Cast sbrk's returned value to char *.
18363 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18364 avoids undefined behavior in theory.
18366 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18368 Use functions, not macros, for up- and down-casing (Bug#8254).
18369 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18370 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18371 to use the following functions instead of these macros.
18372 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18373 EMACS_INT, since callers assume the returned value fits in int.
18374 (upcase1): Likewise, for UPCASE_TABLE.
18375 (uppercasep, lowercasep, upcase): New static inline functions.
18376 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18377 the race-condition problem in the old DOWNCASE.
18379 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18380 Rename locals to avoid shadowing.
18381 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18382 (regex_compile, re_search_2, re_match_2_internal):
18383 Remove unused local vars.
18384 (FREE_VAR): Rewrite so as not to use empty "else",
18385 which gcc can warn about.
18386 (regex_compile, re_match_2_internal): Mark locals as initialized.
18387 (RETALLOC_IF): Define only if needed.
18388 (WORDCHAR_P): Likewise. This one is never needed, but is used
18389 only in a comment talking about a compiler bug, so put inside
18390 the #if 0 of that comment.
18391 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18392 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18395 * search.c (boyer_moore): Rename locals to avoid shadowing.
18396 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18397 (PREV_CHAR_BOUNDARY): Likewise.
18399 * search.c (simple_search): Remove unused var.
18401 * dired.c (compile_pattern): Move decl from here ...
18402 * lisp.h: ... to here, so that it can be checked.
18403 (struct re_registers): New forward decl.
18405 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18407 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18409 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18410 Rename locals to avoid shadowing.
18411 (Fvertical_motion): Mark locals as initialized.
18413 * casefiddle.c (casify_object, casify_region): Now static.
18414 (casify_region): Mark local as initialized.
18416 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18418 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18419 New macros, so that the caller can use some names other than
18420 gcpro1, gcpro2, etc.
18421 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18423 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18424 argument, for consistency with GCPRO2_VAR, etc: it is now the
18425 prefix of the variable, not the variable itself. All uses
18427 * dired.c (directory_files_internal, file_name_completion):
18428 Rename locals to avoid shadowing.
18430 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18431 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18432 dired.c's scmp function, had undefined behavior.
18433 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18434 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18435 * buffer.h: ... to here, because these macros use current_buffer,
18436 and the new implementation with inline functions needs to have
18437 current_buffer in scope now, rather than later when the macros
18439 (downcase, upcase1): New static inline functions.
18440 (DOWNCASE, UPCASE1): Reimplement using these functions.
18441 This avoids undefined behavior in expressions like
18442 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18443 from race conditions in accessing the global variables
18444 case_temp1 and case_temp2.
18445 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18446 * lisp.h (case_temp1, case_temp2): Remove their decls.
18447 * character.h (ASCII_CHAR_P): Move from here ...
18448 * lisp.h: ... to here, so that the inline functions mentioned
18449 above can use them.
18451 * dired.c (directory_files_internal_unwind): Now static.
18453 * fileio.c (file_name_as_directory, directory_file_name):
18454 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18456 (file_name_as_directory): Use const pointers when appropriate.
18457 (Fexpand_file_name): Likewise. In particular, newdir might
18458 point at constant storage, so make it a const pointer.
18459 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18460 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18462 (Fset_file_times, Finsert_file_contents, auto_save_error):
18463 Rename locals to avoid shadowing.
18465 * minibuf.c (choose_minibuf_frame_1): Now static.
18466 (Ftry_completion, Fall_completions): Rename or remove locals
18467 to avoid shadowing.
18469 * marker.c (bytepos_to_charpos): Remove; unused.
18471 * lisp.h (verify_bytepos, count_markers): New decls,
18472 so that gcc does not warn that these functions aren't declared.
18474 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18475 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18476 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18477 (copy_text): Remove unused local var.
18479 * filelock.c (within_one_second): Now static.
18480 (lock_file_1): Rename local to avoid shadowing.
18482 * buffer.c (fix_overlays_before): Mark locals as initialized.
18483 (fix_start_end_in_overlays): Likewise. This function should be
18484 simplified by using pointers-to-pointers, but that's a different
18486 (switch_to_buffer_1): Now static.
18487 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18488 (report_overlay_modification): Rename locals to avoid shadowing.
18490 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18491 Fix pointer signedness issue.
18492 (sys_subshell): Mark local as volatile if checking for lint,
18493 to suppress a gcc -Wclobbered warning that does not seem to be right.
18494 (MAXPATHLEN): Define only if needed.
18496 * process.c (serial_open, serial_configure): Move decls from here ...
18497 * systty.h: ... to here, so that they can be checked.
18499 * fns.c (get_random, seed_random): Move extern decls from here ...
18500 * lisp.h: ... to here, so that they can be checked.
18502 * sysdep.c (reset_io): Now static.
18503 (wait_for_termination_signal): Remove; unused.
18505 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18506 (copy_keymap_item, append_key, push_text_char_description):
18508 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18509 (DENSE_TABLE_SIZE): Remove; unused.
18510 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18511 (describe_map_tree):
18512 Rename locals to avoid shadowing.
18514 * keyboard.c: Declare functions static if they are not used elsewhere.
18515 (echo_char, echo_dash, cmd_error, top_level_2):
18516 (poll_for_input, handle_async_input): Now static.
18517 (read_char, kbd_buffer_get_event, make_lispy_position):
18518 (make_lispy_event, make_lispy_movement, apply_modifiers):
18519 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18520 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18521 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18522 (read_key_sequence, read_char): Mark locals as initialized.
18523 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18525 * keyboard.h (make_ctrl_char): New decl.
18526 (mark_kboards): Move decl here ...
18527 * alloc.c (mark_kboards): ... from here.
18529 * lisp.h (force_auto_save_soon): New decl.
18531 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18532 (DEFINE_DUMMY_FUNCTION): New macro.
18533 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18535 (main): Add casts to avoid warnings
18536 if GCC considers string literals to be constants.
18538 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18540 * dbusbind.c: Pointer signedness fixes.
18541 (xd_signature, xd_append_arg, xd_initialize):
18542 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18543 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18544 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18545 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18547 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18548 if GCC considers string literals to be constants.
18549 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18551 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18553 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18554 (print_preprocess, print_object): New macro to fix last change.
18556 * print.c (print_preprocess): Don't forget font objects.
18558 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
18560 * emacs.c (USAGE3): Doc fixes.
18562 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18564 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18567 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
18569 * lisp.h (VWindow_system, Qfile_name_history):
18570 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18571 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18572 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18574 * w32select.c: Don't #include "keyboard.h".
18575 (run_protected): Add extern declaration for waiting_for_input.
18577 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18578 * w32console.c (detect_input_pending, read_input_pending)
18579 (encode_terminal_code):
18580 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18581 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18582 (w32_system_caret_y, Qfile_name_history):
18583 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18584 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18585 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18586 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18587 * w32proc.c (Qlocal, report_file_error):
18588 * w32term.c (Vwindow_system, updating_frame):
18589 * w32uniscribe.c (initialized, uniscribe_font_driver):
18590 Remove unneeded extern declarations.
18592 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
18594 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18596 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
18598 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18599 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18600 These macros can no longer be used for assignment.
18602 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18603 Assign struct members directly, instead of using BUF_BEGV etc.
18604 (record_buffer_markers, fetch_buffer_markers): New functions for
18605 recording and fetching special buffer markers.
18606 (set_buffer_internal_1, set_buffer_temp): Use them.
18608 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18610 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18612 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18613 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18615 * xdisp.c (hscroll_window_tree):
18616 (reconsider_clip_changes): Use PT instead of BUF_PT.
18618 2011-03-13 Eli Zaretskii <eliz@gnu.org>
18620 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18621 $(EMACS_ROOT)/lib/intprops.h.
18623 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18625 Fix more problems found by GCC 4.5.2's static checks.
18627 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18628 to unsigned char * to avoid compiler diagnostic.
18629 (xg_free_frame_widgets): Make it clear that a local variable is
18630 needed only if USE_GTK_TOOLTIP.
18631 (gdk_window_get_screen): Make it clear that this macro is needed
18632 only if USE_GTK_TOOLTIP.
18633 (int_gtk_range_get_value): New function, which avoids a diagnostic
18634 from gcc -Wbad-function-cast.
18635 (xg_set_toolkit_scroll_bar_thumb): Use it.
18636 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18637 diagnostic from gcc -Wbad-function-cast.
18638 (get_utf8_string, xg_get_file_with_chooser):
18639 Rename locals to avoid shadowing.
18640 (create_dialog): Move locals to avoid shadowing.
18642 * xgselect.c (xg_select): Remove unused var.
18644 * image.c (four_corners_best): Mark locals as initialized.
18645 (gif_load): Initialize transparent_p to zero (Bug#8238).
18646 Mark another local as initialized.
18647 (my_png_error, my_error_exit): Mark with NO_RETURN.
18649 * image.c (clear_image_cache): Now static.
18650 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18651 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18652 (x_edge_detection): Remove unnecessary cast that
18653 gcc -Wbad-function-cast diagnoses.
18654 (gif_load): Fix pointer signedness.
18655 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18656 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18658 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18660 Improve quality of tests for time stamp overflow.
18661 For example, without this patch (encode-time 0 0 0 1 1
18662 1152921504606846976) returns the obviously-bogus value (-948597
18663 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18664 reports time overflow. See
18665 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18666 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18667 * editfns.c: Include limits.h and intprops.h.
18668 (TIME_T_MIN, TIME_T_MAX): New macros.
18669 (time_overflow): Move earlier, to before first use.
18670 (hi_time, lo_time): New functions, for an accurate test for
18671 out-of-range times.
18672 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18673 (Fget_internal_run_time): Don't assume time_t fits in int.
18674 (make_time): Use list2 instead of Fcons twice.
18675 (Fdecode_time): More accurate test for out-of-range times.
18676 (check_tm_member): New function.
18677 (Fencode_time): Use it, to test for out-of-range times.
18678 (lisp_time_argument): Don't rely on undefined left-shift and
18679 right-shift behavior when checking for time stamp overflow.
18681 * editfns.c (time_overflow): New function, refactoring common code.
18682 (Fformat_time_string, Fdecode_time, Fencode_time):
18683 (Fcurrent_time_string): Use it.
18685 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18686 * dired.c (make_time): Move to ...
18687 * editfns.c (make_time): ... here.
18688 * systime.h: Note the move.
18690 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18692 * fringe.c (update_window_fringes): Remove unused variables.
18694 * unexmacosx.c (copy_data_segment): Also copy __got section.
18697 2011-03-12 Eli Zaretskii <eliz@gnu.org>
18699 * termcap.c [MSDOS]: Include "msdos.h".
18700 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18701 Constify `char *' arguments and their references according to
18702 prototypes in tparam.h.
18704 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18706 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18707 Adapt all references accordingly.
18709 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18711 2011-03-11 Tom Tromey <tromey@redhat.com>
18713 * buffer.c (syms_of_buffer): Remove obsolete comment.
18715 2011-03-11 Eli Zaretskii <eliz@gnu.org>
18717 * termhooks.h (encode_terminal_code): Declare prototype.
18719 * msdos.c (encode_terminal_code): Don't declare prototype.
18721 * term.c (encode_terminal_code): Now external again, used by
18722 w32console.c and msdos.c.
18724 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18725 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18727 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
18729 Fix some minor problems found by GCC 4.5.2's static checks.
18731 * fringe.c (update_window_fringes): Mark locals as initialized
18733 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18735 * alloc.c (mark_fringe_data): Move decl from here ...
18736 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18737 to check its interface.
18738 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18740 * fontset.c (free_realized_fontset): Now static.
18741 (Fset_fontset_font): Rename local to avoid shadowing.
18742 (fontset_font): Mark local as initialized.
18743 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18745 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18747 * xselect.c (x_disown_buffer_selections): Remove; not used.
18748 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18749 (x_own_selection, Fx_disown_selection_internal): Rename locals
18750 to avoid shadowing.
18751 (x_handle_dnd_message): Remove local to avoid shadowing.
18753 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18754 so that the caller can use some name other than gcpro1.
18755 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18756 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18757 (Fx_backspace_delete_keys_p):
18758 Use them to avoid shadowing, and rename vars to avoid shadowing.
18759 (x_decode_color, x_set_name, x_window): Now static.
18760 (Fx_create_frame): Add braces to silence GCC warning.
18761 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18762 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18763 Remove unused locals.
18764 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18765 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18766 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18769 * xterm.h (x_mouse_leave): New decl.
18771 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18772 Remove unused functions.
18773 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18774 (x_calc_absolute_position): Now static.
18775 (XTread_socket): Don't define label "out" unless it's used.
18776 Don't declare local "event" unless it's used.
18777 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18778 unless they are used.
18779 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18780 (x_fatal_error_signal): Remove; not used.
18781 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18782 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18783 (x_error_catcher, x_connection_closed, x_error_handler):
18784 (x_error_quitter, xembed_send_message, x_iconify_frame):
18785 (my_log_handler): Rename locals to avoid shadowing.
18786 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18787 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18789 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18790 Rename or move locals to avoid shadowing.
18791 (tty_defined_color, merge_face_heights): Now static.
18792 (free_realized_faces_for_fontset): Remove; not used.
18793 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18794 does not deduce is never used uninitialized.
18795 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18796 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18798 * terminal.c (store_terminal_param): Now static.
18800 * xmenu.c (menu_highlight_callback): Now static.
18801 (set_frame_menubar): Remove unused local.
18802 (xmenu_show): Rename parameter to avoid shadowing.
18803 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18804 since they might point to immutable storage.
18805 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18806 since it's unused otherwise.
18808 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18809 Add a FIXME, since the code still doesn't look right. (Bug#8215)
18810 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18811 avoids a gcc -Wuninitialized diagnostic.
18812 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18813 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18814 does not deduce are never used uninitialized.
18816 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18818 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18819 * window.c (window_loop, size_window):
18820 (run_window_configuration_change_hook, enlarge_window): Likewise.
18822 * window.c (display_buffer): Now static.
18823 (size_window): Mark variables that gcc -Wuninitialized
18824 does not deduce are never used uninitialized.
18825 * window.h (check_all_windows): New decl, to forestall
18826 gcc -Wmissing-prototypes diagnostic.
18827 * dispextern.h (bidi_dump_cached_states): Likewise.
18829 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18831 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18832 Include <limits.h>.
18833 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18834 and to avoid gcc -Wuninitialized warning.
18835 (load_charset_map): Mark variables that gcc -Wuninitialized
18836 does not deduce are never used uninitialized.
18837 (load_charset): Abort instead of using uninitialized var (Bug#8229).
18839 * coding.c (coding_set_source, coding_set_destination):
18840 Use "else { /* comment */ }" rather than "else /* comment */;"
18841 for clarity, and to avoid gcc -Wempty-body warning.
18842 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18843 a block, when the outer 'i' will do.
18844 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18845 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18846 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18847 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18848 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18849 Rename locals to avoid shadowing.
18850 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
18851 * coding.c (emacs_mule_char, encode_invocation_designation):
18852 Now static, since they're not used elsewhere.
18853 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
18854 (decode_coding_object, encode_coding_object, detect_coding_system):
18855 (decode_coding_emacs_mule): Mark variables that gcc
18856 -Wuninitialized does not deduce are never used uninitialized.
18857 (detect_coding_iso_2022): Initialize a local variable that might
18858 be used uninitialized. Leave a FIXME because it's not clear that
18859 this initialization is needed. (Bug#8211)
18860 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18861 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18862 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18863 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18864 Remove unused macros.
18866 * category.c (hash_get_category_set): Remove unused local var.
18867 (copy_category_table): Now static, since it's not used elsewhere.
18868 * character.c (string_count_byte8): Likewise.
18870 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18871 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18873 * chartab.c (copy_sub_char_table): Now static, since it's not used
18875 (sub_char_table_ref_and_range, char_table_ref_and_range):
18876 Rename locals to avoid shadowing.
18877 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
18879 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18880 (BIDI_BOB): Remove unused macro.
18882 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18883 deduce are never used uninitialized.
18884 * term.c (encode_terminal_code): Likewise.
18886 * term.c (encode_terminal_code): Now static. Remove unused local.
18888 * tparam.h: New file.
18889 * term.c, tparam.h: Include it.
18890 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18891 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18892 Move these decls to tparam.h, and make them agree with what
18893 is actually in tparam.c. The previous trick of using incompatible
18894 decls in different modules does not conform to the C standard.
18895 All callers of tparam changed to use tparam's actual API.
18896 * tparam.c (tparam1, tparam, tgoto):
18897 Use const pointers where appropriate.
18899 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18900 * cm.h (struct cm): Likewise.
18901 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18902 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18903 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18904 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18905 (turn_on_face, init_tty): Likewise.
18906 * termchar.h (struct tty_display_info): Likewise.
18908 * term.c (term_mouse_position): Rename local to avoid shadowing.
18910 * alloc.c (mark_ttys): Move decl from here ...
18911 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18913 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18915 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18917 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
18919 * search.c (compile_pattern_1): Remove argument regp, unused since
18920 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18921 (compile_pattern): Don't pass it.
18923 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18925 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18926 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18928 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18930 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18932 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18933 gdk_window_get_screen, gdk_window_get_geometry,
18934 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18935 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18936 (xg_get_pixbuf_from_pixmap): New function.
18937 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18938 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18939 Call xg_get_pixbuf_from_pixmap instead of
18940 gdk_pixbuf_get_from_drawable.
18941 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18942 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18943 (xg_check_special_colors): Use GtkStyleContext and its functions
18945 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18946 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18947 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18948 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18949 Call gtk_widget_get_preferred_size.
18950 (xg_frame_resized): gdk_window_get_geometry only takes 5
18952 (xg_win_to_widget, xg_event_is_for_menubar):
18953 Call gdk_x11_window_lookup_for_display.
18954 (xg_set_widget_bg): New function.
18955 (delete_cb): New function.
18956 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18957 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18958 (xg_set_background_color): Call xg_set_widget_bg.
18959 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18960 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18961 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18962 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18964 (update_frame_tool_bar): Call gtk_widget_hide.
18965 (xg_initialize): Use GDK_KEY_g.
18967 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18969 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18971 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18972 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18973 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18975 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18977 * w32xfns.c (select_palette): Check success of RealizePalette against
18978 GDI_ERROR, not zero.
18980 See ChangeLog.11 for earlier changes.
18982 ;; Local Variables:
18986 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18988 This file is part of GNU Emacs.
18990 GNU Emacs is free software: you can redistribute it and/or modify
18991 it under the terms of the GNU General Public License as published by
18992 the Free Software Foundation, either version 3 of the License, or
18993 (at your option) any later version.
18995 GNU Emacs is distributed in the hope that it will be useful,
18996 but WITHOUT ANY WARRANTY; without even the implied warranty of
18997 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18998 GNU General Public License for more details.
19000 You should have received a copy of the GNU General Public License
19001 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.