1 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
3 * fileio.c: Formatting fixes.
5 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
7 Fix some stat-related races.
8 * fileio.c (Fwrite_region): Avoid race condition if a file is
9 removed or renamed by some other process immediately after Emacs
10 writes it but before Emacs stats it. Do not assume that stat (or
12 * image.c (slurp_file): Resolve the file name with fopen + fstat
13 rather than stat + fopen.
14 (pbm_read_file) [0]: Remove unused code with stat race.
15 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
16 Remove ineffective code with stat race.
18 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
20 * doc.c (get_doc_string): Don't signal an error if the file is missing.
22 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
24 * nsterm.m (hold_event_q): New static variable.
25 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
27 (hold_event): New function.
28 (ns_read_socket): If hold_event_q have events, store them and
30 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
33 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
35 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
37 2012-10-12 Eli Zaretskii <eliz@gnu.org>
39 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
41 * fileio.c (check_existing): New function.
42 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
43 instead of calling 'stat', when what's needed is to check whether
44 a file exists. This avoids expensive system calls on MS-Windows.
47 * w32.c (init_environment): Call 'check_existing' instead of
50 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
51 determine whether a file exists and is not a directory.
53 * lisp.h (check_existing): Add prototype.
55 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
57 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
59 2012-10-12 Glenn Morris <rgm@gnu.org>
61 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
63 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
65 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
67 * eval.c (Fautoload): Remember previous autoload status in load-history.
69 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
71 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
72 * lread.c (load_each_byte, new_backquote_flag, readchar)
73 (read_filtered_event, lisp_file_lexically_bound_p)
74 (safe_to_load_version, Fload, complete_filename_p, openp)
75 (build_load_history, readevalloop, read_escape, read1)
76 (string_to_number, read_vector, read_list):
77 * macros.c (Fstart_kbd_macro):
78 * marker.c (CONSIDER):
79 * menu.c (parse_single_submenu, digest_single_submenu)
80 (find_and_return_menu_selection, Fx_popup_menu):
81 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
83 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
85 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
86 (xmenu_show, xdialog_show):
87 Use bool for booleans.
88 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
89 as it's not a predicate. All uses changed. Omit unnecessary
92 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
94 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
95 (save_excursion_restore): Do not restore mark if it was not saved.
97 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
99 * marker.c (cached_modiff): EMACS_INT, not int.
101 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
102 instead of having a wrong decl.
103 * nsmenu.m (waiting_for_input): Remove wrong decl.
105 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
107 keyboard.c, keymap.c: Use bool for booleans.
108 * dispnew.c (sit_for): Distinguish between 3-way display_option
109 and boolean do_display.
110 * keyboard.c (single_kboard, this_command_key_count_reset)
111 (waiting_for_input, echoing, immediate_quit, input_pending)
112 (interrupt_input, interrupts_deferred, pop_kboard)
113 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
114 (command_loop_1, adjust_point_for_property)
115 (safe_run_hooks_error, input_polling_used, read_char):
116 (help_char_p, readable_events, kbd_buffer_events_waiting)
117 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
118 (lucid_event_type_list_p, get_input_pending):
119 (gobble_input, menu_separator_name_p, menu_bar_item)
120 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
121 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
122 (keyremap_step, test_undefined, read_key_sequence)
123 (detect_input_pending, detect_input_pending_ignore_squeezables)
124 (detect_input_pending_run_timers, requeued_events_pending_p)
125 (quit_throw_to_read_char, Fset_input_interrupt_mode):
126 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
127 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
128 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
129 (accessible_keymaps_1, Fkey_description, push_key_description):
130 (shadow_lookup, struct where_is_internal_data)
131 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
132 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
133 (describe_map, describe_vector):
134 * menu.c (single_menu_item):
135 * nsmenu.m (ns_update_menubar):
136 * process.c (wait_reading_process_output):
137 * search.c (scan_buffer, scan_newline):
138 Use bool for boolean.
139 * keyboard.c (timers_run, swallow_events)
140 (detect_input_pending_run_timers):
141 * process.c (wait_reading_process_output):
142 Use unsigned for counter where wraparound-on-overflow is desired,
143 since unsigned is guaranteed to have that behavior and signed is not.
144 (read_char): Use ptrdiff_t for string length.
145 (get_input_pending): Remove first argument, since it was always
146 the same pointer-to-int (now pointer-to-boolean) &input_pending,
147 and behave as if it had that value. Return new value of
148 input_pending. All callers changed.
149 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
150 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
152 * keymap.c (push_key_description): Omit last arg, which was always 1.
155 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
157 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
159 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
160 ($(BLD)/term.$(O)): Update dependencies.
162 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
164 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
165 * lisp.h (enum pvec_type): Adjust comments and omit explicit
166 initializer for PVEC_NORMAL_VECTOR.
168 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
170 Clean out old termopts cruft.
171 * termopts.h (flow_control, meta_key): Remove unused decls.
172 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
173 Don't include termopts.h.
175 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
177 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
179 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
181 * commands.h (immediate_quit): Remove duplicate decl.
183 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
185 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
187 (nsfont_open): Remove setting of Vfonts_in_cache.
188 (syms_of_nsfont): Remove initialization of Vfonts_in_cache
190 2012-10-09 Eli Zaretskii <eliz@gnu.org>
192 * w32fns.c (w32_last_error): Change the return value to DWORD, to
193 match what GetLastError returns. Explain why the function is
196 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
197 'is_tooltip_frame', to avoid confusion with its global namesake.
199 2012-10-08 Daniel Colascione <dancol@dancol.org>
201 * xdisp.c (start_hourglass): Call w32_note_current_window when
202 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
203 build that caused Emacs to display the hourglass cursor forever.
205 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
206 which is broken under remote desktop, calculate the number of
207 colors available for a display based on the display's number of
208 planes and number of bits per pixel per plane. (bug#10397).
210 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
212 * nsfont.m (Vfonts_in_cache): New variable.
213 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
214 are used. Add cached fonts to Vfonts_in_cache.
215 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
217 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
219 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
221 (FONT_H): Define after FRAME_H.
222 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
225 * w32term.c: Remove leftover declaration of keyboard_codepage.
227 2012-10-08 Eli Zaretskii <eliz@gnu.org>
229 * makefile.w32-in (FONT_H): Add $(FRAME_H).
230 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
231 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
232 (GLOBAL_SOURCES): Add cygw32.c.
233 ($(BLD)/unexw32.$(O)):
235 ($(BLD)/w32console.$(O)):
236 ($(BLD)/w32fns.$(O)):
237 ($(BLD)/w32heap.$(O)):
238 ($(BLD)/w32menu.$(O)):
239 ($(BLD)/w32proc.$(O)): Add w32common.h.
241 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
243 (x_to_w32_color): Don't modify the argument, modify a copy instead.
245 2012-10-08 Daniel Colascione <dancol@dancol.org>
247 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
248 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
249 accidental message numbering hole. Change other messages to
252 * w32select.h (HAVE_W32SELECT): Remove.
254 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
255 w32common.h instead of w32heap.h
257 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
258 (get_allocation_unit, get_processor_type, get_w32_major_version)
259 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
260 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
261 (OS_NT, os_subtype, cache_system_info): Move declarations to
264 * w32heap.c: Include w32common.h.
265 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
266 (w32_minor_version, w32_build_number, w32_subtype): Remove
267 duplicate definitions.
269 * w32fns.c: Include w32common.h; include w32heap.h only in
272 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
273 Use `report_file_error' instead of `error' in order to better
274 inform users of what went wrong. Increase NTGUI_UNICODE file
275 dialog box file name length to 32k, the maximum allowed by the NT
278 * w32common.h: New file.
279 (ROUND_UP, ROUND_DOWN, get_page_size)
280 (get_allocation_unit, get_processor_type, get_w32_major_version)
281 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
282 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
283 (OS_NT, os_subtype, cache_system_info): Move here.
285 * unexw32.c, unexcw.c: Include w32common.h.
287 * emacs.c (main): Use (defined (WINDOWSNT) || defined
288 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
289 to call syms_of_w32select.
291 * cygw32.h: Remove obsolete EXFUN declarations.
293 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
295 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
296 of w32inevt.o from SOME_MACHINE_OBJECTS.
298 2012-10-08 Daniel Colascione <dancol@dancol.org>
300 * image.c: Permanent fix for JPEG compilation issue --- limit
301 jpeglib `boolean' redefinition to Cygwin builds.
303 2012-10-08 Eli Zaretskii <eliz@gnu.org>
305 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
307 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
310 2012-10-08 Daniel Colascione <dancol@dancol.org>
312 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
313 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
314 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
315 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
316 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
317 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
318 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
319 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
320 now a supported configuration.
322 * Makefile.in: consolidate image variables into LIBIMAGE; add
323 W32_OBJ and W32_LIBS. Compile new files.
326 (_DebPrint) declare tracing facility for W32 debugging. We need
327 to unify tracing later.
329 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
330 unconditional use of W32 Unicode functions. Cygwin runs only on
331 100% Unicode operating systems.
333 * cygw32.c: New file. Define Cygwin-specific facilities.
334 (Fcygwin_convert_path_to_windows)
335 (Fcygwin_convert_path_from_windows): New user functions for
336 accessing Cygwin path-munging routines.
338 * cygw32.h: New file.
339 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
340 UTF-16LE strings temporarily inside non-Lisp-visible string
343 (w32_strerror): Just what it says on the tin.
345 * emacs.c: Make the NS fork-then-exec code for daemon-launching
346 also run for Cygwin; both systems have the same problem with using
347 GUI facilities in a forked child. Also call syms_of_cygw32,
348 syms_of_w32select in correct places.
350 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
351 needs fork-then-exec for daemon launching.
353 * font.h: Include frame.h.
355 * image.c: Use the image library cache machinery only when we're
356 compiling for native WINDOWSNT; Cygwin can use shared libraries
357 like any other Unixlike system.
359 * keyboard.c: Clarify a comment regarding the input loop.
361 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
362 functions directly instead of trying to detect at runtime that our
363 host operating system supports them. We make this change for two
364 reasons: Cygwin lacks support for the multibyte character
365 conversion functions used by the legacy menu code, and Cygwin
366 never needs to rely on non-Unicode APIs.
368 * unexw32.c (hinst): Declare extern.
370 * w32.c: Change header order;
371 (w32_strerror): Move to w32fns.c because we need it for
372 non-WINDOWSNT builds.
374 * w32.h: Add #error macro to make sure we don't include w32.h for
375 Cygwin builds. Remove w32select declarations.
377 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
378 w32fns.c. w32console.c is WINDOWSNT-only.
380 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
381 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
383 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
384 (w32_major_version, w32_minor_version, w32_build_number)
385 (os_subtype, sound_type): Define here
386 (w32_defined_color): Make color parameter const for consistency
387 with other _defined_color functions.
388 (w32_createwindow): Unconditionally call w32_init_class instead of
389 doing so only when hprevinst is non-NULL. Plumbing hprevinst
390 through the code is complex and unnecessary because class
391 registration is practically free.
392 (w32_name_of_message): New EMACSDEBUG-only function.
393 (Fset_message_beep): Move here
394 (Fx_open_connection): Require that the display name for Windows be
395 "w32" for consistency, emacsclient disambiguation, and maybe, one
396 day, multi-window-system support.
397 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
398 Cygwin files for W32 GUI facilities, since these clearly don't
401 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
402 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
403 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
404 (w32_last_error): Remove.
406 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
408 * w32heap.c (syspage_mask): Declare here.
409 (cache_system_info): Remove.
411 * w32inevt.c (faked_key): Define globally, not statically.
412 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
413 (w32_console_toggle_lock_key): Move to w32fns.c.
415 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
417 * w32proc.c (_DebPrint): Move to w32fns.c.
418 * w32select.c: Include string.h, stdio.h for Cygwin.
419 * w32select.h: New File.
421 * w32term.c: Include io.h for non-CYGWIN builds; needed for
423 (w32_message_fd): New variable. Under Cygwin, holds the file
424 descriptor the system used to tell us about pending thread
427 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
428 that prevented compilation under non-WINDOWSNT systems.
430 (w32_initialize): Open /dev/windows and assign it to
431 w32_message_fd. Provide w32 feature.
433 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
434 (WM_EMACS_INPUT_READY): add.
435 (prepend_msg, w32_message_fd): Declare globally.
438 (keyboard_handle): Use only when WINDOWSNT.
439 (notify_msg_ready): New function. Posts a message to the main
440 thread's message queue under CYGWIN, which wakes up the main
441 thread from select(2) by making the /dev/windows file descriptor
442 ready. Under WINDOWSNT, it sets an event the same way the old
445 (post, prepend_msg): Actually call notify_msg_ready instead of
446 setting the input event directly.
448 2012-10-07 Eli Zaretskii <eliz@gnu.org>
450 * ralloc.c (relinquish): If a heap is ready to be relinquished,
451 but it still has blocs in it, don't return it to the system,
452 instead of aborting. (Bug#12402)
454 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
456 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
458 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
459 MAC_OS_X_VERSION_10_6.
460 (syms_of_nsterm): Remove comment about Panther and above for
462 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
463 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
464 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
466 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
467 MAC_OS_X_VERSION_10_4.
469 * nsmenu.m (fillWithWidgetValue:): Remove code for <
470 MAC_OS_X_VERSION_10_2.
472 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
474 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
475 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
477 * nsterm.m (ns_in_resize): Remove (Bug#12479).
478 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
479 (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove
481 (ns_clear_frame_area): Remove resize handle code.
483 * nsfns.m (ns_in_resize): Remove.
484 (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
487 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
489 Improve sys_siglist detection.
490 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
491 defined as a macro, as is done in Solaris.
492 (sys_siglist_entries): New macro.
493 (save_strsignal): Use it.
494 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
495 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
497 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
499 * nsfns.m (Fx_create_frame): Call x_default_parameter with
500 fullscreen/Fullscreen.
502 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
505 * nsterm.m (x_make_frame_visible): Check for fullscreen.
506 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
507 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
508 (windowDidResize:): Check for correct window if old style fullscreen.
509 Capitalize word in comment. Remove incorrect comment.
510 (initFrameFromEmacs:): tbar_height renamed tibar_height.
511 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
512 error in drawing background.
513 (toggleFullScreen:): Remove comment. Rearrange calls.
514 Set toolbar values to zero, save old height in tobar_height.
515 Restore tool bar height when leaving fullscreen.
516 (canBecomeMainWindow): New function.
518 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
520 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
522 2012-10-05 Eli Zaretskii <eliz@gnu.org>
524 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
526 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
527 that time stamps of directories could also be changed. Don't
528 request the too broad GENERIC_WRITE, only the more restrictive
529 FILE_WRITE_ATTRIBUTES access rights.
531 * fileio.c (Fset_file_times): Special-case ignoring errors for
532 directories only on MSDOS, not on MS-Windows.
534 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
536 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
538 2012-10-04 Eli Zaretskii <eliz@gnu.org>
540 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
541 see whether CreateFile failed.
543 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
545 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
546 to avoid similar races.
547 * keyboard.c (pending_signals): Now bool, not int.
549 Port timers to OpenBSD, plus check for timer failures.
550 OpenBSD problem reported by Han Boetes.
551 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
553 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
554 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
555 like OpenBSD, which has timer_settime but does not declare it.
556 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
557 whether to use itimerspec-related primitives. All uses of
558 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
560 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
562 * profiler.c (handle_profiler_signal): Fix a malloc race
563 that caused Emacs to hang on Fedora 17 when profiling Lisp.
565 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
567 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
569 2012-10-02 Eli Zaretskii <eliz@gnu.org>
571 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
572 consistent with the change in return value of 'safe_strsignal'.
574 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
576 Prefer plain 'static' to 'static inline' (Bug#12541).
577 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
578 (bidi_set_sor_type, bidi_push_embedding_level)
579 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
580 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
581 (bidi_cache_search, bidi_cache_ensure_space)
582 (bidi_cache_iterator_state, bidi_cache_find)
583 (bidi_peek_at_next_level, bidi_set_paragraph_end)
584 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
585 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
586 Now 'static', not 'static inline'.
588 Count overruns when profiling; change units to ns.
589 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
590 Give extra weight to samples after overruns, to attempt to count
591 the time more accurately.
592 (setup_cpu_timer): Change sampling interval units from ms to ns, since
593 the underlying primitives nominally do ns.
594 (Fprofiler_cpu_start): Document the change. Mention that
595 the sampling intervals are only approximate.
597 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
599 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
601 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
602 case for the special 0 coding-system.
604 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
605 (Fmake_overlay): Remove redundant tests.
606 (fix_start_end_in_overlays): Remove redundant recentering.
608 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
610 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
613 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
615 Fix a malloc race condition involving strsignal.
616 A signal can arrive in the middle of a malloc, and Emacs's signal
617 handler can invoke strsignal, which can invoke malloc, which is
618 not portable. This race condition bug makes Emacs hang on GNU/Linux.
619 Fix it by altering the signal handler so that it does not invoke
621 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
622 * process.c (status_message): Use const pointer, in case strsignal
623 is #defined to safe_strsignal.
624 * sysdep.c (sys_siglist, init_signals): Always define and
625 initialize a substitute sys_siglist if the system does not define
626 one, even if HAVE_STRSIGNAL.
627 (safe_strsignal): Rename from strsignal. Always define,
628 using sys_siglist. Return a const pointer.
629 * syssignal.h (safe_strsignal): New decl.
630 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
632 2012-10-01 Eli Zaretskii <eliz@gnu.org>
634 * w32proc.c (timer_loop): Fix code that waits for timer
635 expiration, to avoid high CPU usage.
637 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
639 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
640 (sweep_weak_table): Remove redundant prototypes.
642 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
644 * emacs.c: Move the inclusion of TERM_HEADER after including
645 windows.h on WINDOWSNT. This avoids compilation problems with
648 2012-10-01 Eli Zaretskii <eliz@gnu.org>
650 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
651 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
652 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
653 as the previous version used 'void *'.
655 * ralloc.c (ROUNDUP): Fix last change.
656 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
659 * w32proc.c <disable_itimers>: New static flag.
660 (init_timers): Initialize it to zero, after creating the critical
661 sections used by the timer threads.
662 (term_timers): Set to 1 before deleting the critical sections.
663 (getitimer, setitimer): If disable_itimers is non-zero, return an
664 error indication without doing anything. Reported by Fabrice
665 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
666 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
668 [!HAVE_SETITIMER]: Behave as the previous version that didn't
671 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
672 term_ntproc after all the other bookkeeping, to get timers working
675 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
677 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
678 Suggested by Juri Linkov in
679 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
681 Prefer plain 'static' to 'static inline' (Bug#12541).
682 With static functions, modern compilers inline pretty well by
683 themselves; advice from programmers often hurts as much as it helps.
684 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
685 this change shrinks the text size of the Emacs executable by 1.1%
686 without affecting CPU significantly in my benchmark.
687 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
688 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
689 (mark_maybe_object, mark_maybe_pointer, bounded_number):
690 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
691 (bset_auto_fill_function, bset_auto_save_file_format)
692 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
693 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
694 (bset_cache_long_line_scans, bset_case_fold_search)
695 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
696 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
697 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
698 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
699 (bset_header_line_format, bset_indicate_buffer_boundaries)
700 (bset_indicate_empty_lines, bset_invisibility_spec)
701 (bset_left_fringe_width, bset_major_mode, bset_mark)
702 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
703 (bset_name, bset_overwrite_mode, bset_pt_marker)
704 (bset_right_fringe_width, bset_save_length)
705 (bset_scroll_bar_width, bset_scroll_down_aggressively)
706 (bset_scroll_up_aggressively, bset_selective_display)
707 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
708 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
709 (set_buffer_overlays_after):
710 * category.c (bset_category_table):
711 * charset.c (read_hex):
712 * coding.c (produce_composition, produce_charset)
713 (handle_composition_annotation, handle_charset_annotation)
715 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
716 (assign_row, set_frame_matrix_frame, make_current)
718 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
719 * fns.c (maybe_resize_hash_table):
720 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
721 * gmalloc.c (register_heapinfo):
722 * image.c (lookup_image_type):
723 * intervals.c (set_interval_object, set_interval_left)
724 (set_interval_right, copy_interval_parent, rotate_right)
725 (rotate_left, balance_possible_root_interval):
726 * keyboard.c (kset_echo_string, kset_kbd_queue)
727 (kset_keyboard_translate_table, kset_last_prefix_arg)
728 (kset_last_repeatable_command, kset_local_function_key_map)
729 (kset_overriding_terminal_local_map, kset_real_last_command)
730 (kset_system_key_syms, clear_event, set_prop):
731 * lread.c (digit_to_number):
732 * marker.c (attach_marker, live_buffer, set_marker_internal):
733 * nsterm.m (ns_compute_glyph_string_overhangs):
734 * process.c (pset_buffer, pset_command)
735 (pset_decode_coding_system, pset_decoding_buf)
736 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
737 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
738 (pset_status, pset_tty_name, pset_type, pset_write_queue):
739 * syntax.c (bset_syntax_table, dec_bytepos):
740 * terminal.c (tset_param_alist):
741 * textprop.c (interval_has_some_properties)
742 (interval_has_some_properties_list):
743 * window.c (wset_combination_limit, wset_dedicated)
744 (wset_display_table, wset_hchild, wset_left_fringe_width)
745 (wset_left_margin_cols, wset_new_normal, wset_new_total)
746 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
747 (wset_right_fringe_width, wset_right_margin_cols)
748 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
749 (wset_vertical_scroll_bar_type, wset_window_parameters):
750 * xdisp.c (wset_base_line_number, wset_base_line_pos)
751 (wset_column_number_displayed, wset_region_showing)
752 (window_box_edges, run_window_scroll_functions)
753 (append_glyph_string_lists, prepend_glyph_string_lists)
754 (append_glyph_string, set_glyph_string_background_width)
755 (append_glyph, append_composite_glyph)
756 (take_vertical_position_into_account):
757 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
758 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
759 (lface_hash, lface_same_font_attributes_p, lookup_face):
760 * xml.c (libxml2_loaded_p):
761 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
762 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
763 Now 'static', not 'static inline'.
766 (bidi_copy_it): Do the whole copy with a single memcpy.
767 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
769 Revert the FOLLOW-SYMLINKS change for file-attributes.
770 Doing it right would require several changes to Tramp, and there's
771 not enough time to get that tested before the freeze today.
772 * dired.c (directory_files_internal, Ffile_attributes):
775 * frame.c (x_report_frame_params): Port better to wider ints.
776 Do not assume that EMACS_UINT is the same width as uprintmax_t,
777 or that pointers can be printed in 15 decimal digits.
778 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
780 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
782 Support x64 build on MS-Windows.
783 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
784 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
785 compatibility with x64.
786 (x_get_focus_frame): Add prototype.
788 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
789 defining an XRectangle structure.
791 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
792 arithmetics for compatibility with x64.
794 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
795 compatibility with x64.
797 * w32heap.h: Adjust prototypes and declarations.
799 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
800 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
801 DWORD, long, and unsigned long, for compatibility with x64.
802 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
803 (sbrk): Argument is now of type ptrdiff_t.
805 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
807 (w32_msg_pump): Use WPARAM type for 'result'.
809 * w32.c (init_environment, get_emacs_configuration): Support AMD64
811 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
812 compatibility with x64.
814 * vm-limit.c (lim_data): Now size_t.
815 (check_memory_limits): Adjust prototypes of real_morecore and
816 __morecore to receive argument of type ptrdiff_t. Use size_t for
817 five_percent and data_size.
819 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
820 variables, for compatibility with x64.
821 (rva_to_section, offset_to_section, relocate_offset)
822 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
823 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
824 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
825 for compatibility with x64.
827 * sysdep.c (STDERR_FILENO): Define if not already defined.
829 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
830 (__morecore): Argument type is now ptrdiff_t.
831 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
832 (relinquish): Use ptrdiff_t type for 'excess'.
833 (r_alloc_sbrk): Argument type is now ptrdiff_t.
835 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
836 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
837 instead of a literal number.
839 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
840 (min): Define only if not already defined.
842 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
843 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
846 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
847 'bitmaps' is a pointer.
849 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
851 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
853 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
855 file-attributes has a new optional arg FOLLOW-SYMLINKS.
856 * dired.c (directory_files_internal, Ffile_attributes):
857 New arg follow_symlinks. All uses changed.
859 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
861 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
863 2012-09-30 Eli Zaretskii <eliz@gnu.org>
865 Support atimers and CPU profiler via profile.c on MS-Windows.
866 * w32proc.c (sig_mask, crit_sig): New static variables.
867 (sys_signal): Support SIGALRM and SIGPROF.
868 (sigemptyset, sigaddset, sigfillset, sigprocmask)
869 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
870 sigfillset, and sigprocmask are no longer no-ops.
871 (sigismember): New function.
872 (struct itimer_data): New definition.
873 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
874 (crit_prof): New static variables.
875 (MAX_SINGLE_SLEEP): New definition.
876 (timer_loop, stop_timer_thread, term_timers, init_timers)
877 (start_timer_thread, getitimer, setitimer): New functions.
878 (alarm): No longer a no-op, calls setitimer.
880 * w32.c (term_ntproc): Call term_timers.
881 (init_ntproc): Make sure all signals are unblocked at startup, to
882 erase any traces of dumping. Call init_timers.
884 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
885 Windows-specific code to display the hourglass mouse pointer is no
887 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
888 to hourglass timer expiration.
889 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
890 Remove, no longer used.
891 (w32_note_current_window, show_hourglass, hide_hourglass):
892 New functions, in support of hourglass cursor display similar to other
894 (syms_of_w32fns): Don't initialize hourglass_timer.
896 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
898 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
900 * w32.h (init_timers, term_timers): Add prototypes.
902 2012-09-30 Kenichi Handa <handa@gnu.org>
904 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
905 to the buffer relocation which may be caused by ccl_driver.
907 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
909 * xfns.c (Fx_file_dialog): Update comment.
911 * w32fns.c (Fx_file_dialog): Update comment.
913 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
914 Initialize panel name field if OSX >= 10.6.
916 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
918 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
920 * nsterm.m (NEW_STYLE_FS): New define.
921 (ns_fullscreen_hook, windowWillEnterFullScreen)
922 (windowDidEnterFullScreen, windowWillExitFullScreen)
923 (windowDidExitFullScreen, toggleFullScreen, handleFS)
924 (setFSValue): New functions.
925 (EmacsFSWindow): New implementation.
926 (canBecomeKeyWindow): New function for EmacsFSWindow.
927 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
928 (dealloc): Release nonfs_window if in fullscreen.
929 (updateFrameSize:): Call windowDidMove to update top/left.
930 (windowWillResize:toSize:): Check if frame is still maximized.
931 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
932 next_maximized, maximized_width, maximized_height and nonfs_window.
933 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
935 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
936 fullscreen. Set maximized_width/height. Act on next_maximized.
938 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
939 (EmacsView): Add variables for fullscreen.
940 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
941 (EmacsFSWindow): New interface for fullscreen.
943 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
945 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
947 2012-09-30 Chong Yidong <cyd@gnu.org>
949 * fns.c (Frandom): Doc fix.
951 2012-09-30 Martin Rudalics <rudalics@gmx.at>
953 * window.c (Vwindow_combination_limit): New default value.
954 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
956 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
958 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
959 Suggested by Eli Zaretskii in
960 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
962 2012-09-30 Eli Zaretskii <eliz@gnu.org>
964 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
965 HAVE_TIMER_SETTIME is defined.
967 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
969 Profiler improvements: more-accurate timers, overflow checks.
970 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
971 signal.h, setjmp.h. Include systime.h instead.
972 (saturated_add): New function.
973 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
974 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
975 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
977 (enum profiler_cpu_running): New enum.
978 (profiler_cpu_running): Now of that enum type, not bool.
979 All uses changed to store the new value.
980 (handle_profiler_signal): Rename from sigprof_handler_1,
981 for consistency with other handlers. Do not check whether
982 cpu_log is a hash-table if garbage collecting, since it
983 doesn't matter in that case.
984 (deliver_profiler_signal): Rename from sigprof_handler,
985 for consistency with other handlers.
986 (setup_cpu_timer): New function, with much of what used to be in
987 Fprofiler_cpu_start. Check for out-of-range argument.
988 Prefer timer_settime if available, and prefer
989 thread cputime clocks, then process cputime clocks, then
990 monotonic clocks, to the old realtime clock. Use make_timeval
991 to round more-correctly when falling back to setitimer.
992 (Fprofiler_cpu_start): Use it.
993 (Fprofiler_cpu_stop): Prefer timer_settime if available.
994 Don't assume that passing NULL as the 2nd argument of setitimer
995 is the same as passing a pointer to all-zero storage.
996 Ignore SIGPROF afterwards.
997 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
998 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
999 non-fatal signal handlers. Ignore SIGPROF on startup.
1000 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1001 in profiler.c, since sysdep.c now uses it.
1003 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1004 Suggested by Eli Zaretskii in
1005 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1007 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1009 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1011 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1013 * lisp.h (struct backtrace): Remove indirection for `function' field.
1014 * xdisp.c (redisplay_internal):
1015 * profiler.c (record_backtrace, sigprof_handler_1):
1016 * alloc.c (Fgarbage_collect):
1017 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1018 (Fbacktrace_frame): Adjust accordingly.
1020 2012-09-28 Glenn Morris <rgm@gnu.org>
1022 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1023 (Frun_hook_with_args_until_failure): Doc fixes.
1025 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1027 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1028 Qautomatic_redisplay and change the symbol name. All users changed.
1030 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1032 * profiler.c (sigprof_handler): Fix race condition.
1034 2012-09-28 Glenn Morris <rgm@gnu.org>
1036 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1038 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1040 Check more robustly for timer_settime.
1041 * Makefile.in (LIB_TIMER_TIME): New macro.
1043 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1044 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1047 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1049 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1051 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1053 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1055 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1057 * character.h (MAYBE_UNIFY_CHAR): Remove.
1058 * charset.c, charset.h (maybe_unify_char): Now static.
1059 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1060 Since this stuff is now private to charset.c, there's no need for
1061 a public macro and no need to inline by hand.
1063 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1064 Stefan Monnier <monnier@iro.umontreal.ca>
1065 Juanma Barranquero <lekktu@gmail.com>
1067 * profiler.c: New file.
1068 * Makefile.in (base_obj): Add profiler.o.
1069 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1070 ($(BLD)/profiler.$(O)): New target.
1071 * emacs.c (main): Call syms_of_profiler.
1072 * alloc.c (Qautomatic_gc): New constant.
1073 (MALLOC_PROBE): New macro.
1074 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1075 (total_bytes_of_live_objects): New function.
1076 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1077 Call malloc_probe for the memory profiler.
1078 (syms_of_alloc): Define Qautomatic_gc.
1079 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1081 (struct backtrace): Move definition...
1082 * lisp.h (struct backtrace): ..here.
1083 (Qautomatic_gc, profiler_memory_running): Declare vars.
1084 (malloc_probe, syms_of_profiler): Declare functions.
1085 * xdisp.c (Qautomatic_redisplay): New constant.
1086 (redisplay_internal): Record itself in backtrace_list.
1087 (syms_of_xdisp): Define Qautomatic_redisplay.
1089 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1090 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1092 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1094 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1096 Prefer POSIX timers if available.
1097 They avoid a race if the timer is too close to the current time.
1098 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1099 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1100 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1102 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1104 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1105 CHAR_STRING_ADVANCE.
1106 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1107 STRING_CHAR_ADVANCE.
1109 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1111 Move Vlibrary_cache to emacs.c and reset before dumping.
1113 * lisp.h (reset_image_types): Declare.
1114 [WINDOWSNT] (Vlibrary_cache): Declare.
1116 * image.c (reset_image_types): New function.
1118 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1119 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1120 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1122 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1123 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1125 * w32.h (Vlibrary_cache): Do not declare.
1127 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1129 * w32proc.c (sys_signal): Handle all signals defined by the
1130 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1131 handlers for signals supported by Windows. Don't override
1132 term_ntproc as the handler for SIGABRT.
1133 (sigaction): Rewrite to call sys_signal instead of duplicating its
1135 (sys_kill): Improve commentary.
1137 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1138 consistency with a signature of a signal handler. All callers
1140 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1141 install term_ntproc as a signal handler for SIGABRT, as that
1142 should be done by the dumped Emacs.
1144 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1146 * w32select.c (term_w32select): Protect against repeated
1147 invocation by setting clipboard_owner to NULL after calling
1150 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1151 and term_ntproc to their modified signatures.
1153 * character.c (char_string, string_char): Remove calls to
1154 MAYBE_UNIFY_CHAR. See the discussion starting at
1155 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1158 2012-09-25 Chong Yidong <cyd@gnu.org>
1160 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1162 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1164 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1165 when encountering an unknown bytecode.
1167 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1169 image.c, indent.c: Use bool for booleans.
1170 * dispextern.h (struct image_type): Members valid_p, load, init
1171 now return bool, not int. All uses changed.
1172 * image.c: Omit unnecessary static decls.
1173 (x_create_bitmap_mask, x_build_heuristic_mask):
1174 Return void, not int, since callers don't care about the return value.
1175 (x_create_bitmap_mask, define_image_type, valid_image_p)
1176 (struct image_keyword, parse_image_spec, image_spec_value)
1177 (check_image_size, image_background)
1178 (image_background_transparent, x_clear_image_1)
1179 (postprocess_image, lookup_image, x_check_image_size)
1180 (x_create_x_image_and_pixmap, xbm_image_p)
1181 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1182 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1183 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1184 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1185 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1186 (png_image_p, init_png_functions, png_load_body, png_load)
1187 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1188 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1189 (init_gif_functions, gif_load, imagemagick_image_p)
1190 (imagemagick_load_image, imagemagick_load, svg_image_p)
1191 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1193 * nsimage.m (ns_load_image):
1194 * nsterm.m (ns_defined_color):
1195 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1196 * xfns.c (x_defined_color):
1197 * xterm.c (x_alloc_lighter_color_for_widget)
1198 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1199 (x_alloc_lighter_color):
1200 * indent.c (disptab_matches_widthtab, current_column)
1201 (scan_for_column, string_display_width, indented_beyond_p)
1202 (compute_motion, vmotion, Fvertical_motion):
1203 Use bool for booleans.
1205 2012-09-24 Chong Yidong <cyd@gnu.org>
1207 * chartab.c (Fset_char_table_default): Obsolete function removed.
1209 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1211 Move pid_t related decls out of lisp.h.
1212 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1213 (interruptible_wait_for_termination):
1214 Move these decls from lisp.h to syswait.h, since they use pid_t.
1215 Needed on FreeBSD; see Herbert J. Skuhra in
1216 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1217 * callproc.c: Include syswait.h.
1219 gnutls.c, gtkutil.c: Use bool for boolean.
1220 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1221 (emacs_gnutls_handle_error):
1222 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1223 (xg_hide_tooltip, xg_create_frame_widgets)
1224 (create_dialog, xg_uses_old_file_dialog)
1225 (xg_get_file_with_chooser, xg_get_file_with_selection)
1226 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1227 (xg_item_label_same_p, xg_update_menubar)
1228 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1229 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1230 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1231 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1232 (update_frame_tool_bar, free_frame_tool_bar):
1233 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1234 * nsmenu.m (ns_update_menubar):
1235 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1236 * xfns.c (Fx_show_tip) [USE_GTK]:
1237 Use bool for boolean.
1238 * gtkutil.c (xg_update_frame_menubar):
1239 * xmenu.c (update_frame_menubar):
1240 Return void, not int, since caller ignores return value.
1241 * gtkutil.c (xg_change_toolbar_position):
1244 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1246 * makefile.w32-in (BLOCKINPUT_H): Remove.
1247 (SYSSIGNAL_H): New macro.
1248 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1249 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1250 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1251 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1252 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1253 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1254 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1255 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1256 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1257 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1258 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1259 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1260 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1261 ($(BLD)/w32xfns.$(O)): Update dependencies.
1263 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1265 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1266 fatal_error_backtrace.
1268 * w32proc.c (sys_kill): Undo last change: don't do anything when
1269 invoked to deliver SIGABRT to our own process. This is now
1270 handled by emacs_raise.
1272 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1274 * w32term.c (w32_read_socket): Remove leftover reference to
1275 interrupt_input_pending.
1277 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1279 Do not use SA_NODEFER.
1280 Problem reported by Dani Moncayo in
1281 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1283 * sysdep.c (emacs_abort): Do not reset signal handler.
1284 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1285 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1286 wanted even on POSIXish hosts, and it doesn't work on Windows.
1288 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1290 * xterm.c (x_term_init): Call fixup_locale before and after calling
1291 gtk_init (Bug#12392).
1293 2012-09-23 Chong Yidong <cyd@gnu.org>
1295 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1296 Vdynamic_library_alist.
1298 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1299 (Fgnutls_available_p): Caller changed.
1301 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1302 (Flibxml_parse_xml_region): Likewise.
1304 * dispextern.h (struct image_type): Remove arg from init function.
1306 * image.c (Finit_image_library, lookup_image_type)
1307 (define_image_type): Remove now-unneeded second arg.
1308 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1309 (init_tiff_functions, init_gif_functions, init_svg_functions):
1310 Arglist and w32_delayed_load calling convention changed.
1311 (gs_type): Remove init_gs_functions; there is no such function.
1312 (valid_image_p, make_image): Fix caller to lookup_image_type.
1314 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1316 Simplify and avoid signal-handling races (Bug#12471).
1318 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1319 Avoid recursive loop if there's a fatal error in the function itself.
1320 * atimer.c (pending_atimers):
1321 * blockinput.h: Don't include "atimer.h"; no longer needed.
1322 (interrupt_input_pending): Remove. All uses removed.
1323 pending_signals now counts both atimers and ordinary interrupts.
1324 This is less racy than having three separate pending-signal flags.
1325 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1327 Rename from their upper-case counterparts BLOCK_INPUT,
1328 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1329 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1330 This makes it easier to access volatile variables more accurately.
1331 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1332 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1333 that's more reliable if the code is buggy and sets
1334 interrupt_input_blocked to a negative value. All uses changed.
1335 * atimer.c (deliver_alarm_signal):
1336 Remove. No need to deliver this to the parent; any thread can
1337 handle this signal now. All uses replaced by underlying handler.
1338 * atimer.c (turn_on_atimers):
1339 * dispnew.c (handle_window_change_signal):
1340 * emacs.c (handle_danger_signal):
1341 * keyboard.c (kbd_buffer_get_event):
1342 Don't reestablish signal handler; not needed with sigaction.
1343 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1345 Rework to avoid unnecessary accesses to volatile variables.
1346 (UNBLOCK_INPUT_TO): Now a function.
1347 (totally_unblock_input, unblock_input): New decls.
1348 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1349 (init_data): Remove. Necessary stuff now done in init_signal.
1350 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1351 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1352 (fatal_error_code): Remove; no longer needed.
1353 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1354 it doesn't always backtrace. All uses changed. No need to reset
1355 signal to default, since sigaction and/or die does that for us now.
1356 Use emacs_raise (FOO), not kill (getpid (), FOO).
1357 (main): Check more-accurately whether we're dumping.
1358 Move fatal-error setup to sysdep.c
1359 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1360 * gtkutil.c (xg_get_file_name, xg_get_font):
1361 Remove no-longer-needed signal-mask manipulation.
1362 * keyboard.c, process.c (POLL_FOR_INPUT):
1363 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1364 * keyboard.c (read_avail_input): Remove.
1365 All uses replaced by gobble_input.
1366 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1367 (kbd_buffer_store_event_hold, gobble_input):
1368 (record_asynch_buffer_change) [USABLE_SIGIO]:
1369 (store_user_signal_events):
1370 No need to mess with signal mask.
1371 (gobble_input): If blocking input and there are terminals, simply
1372 set pending_signals to 1 and return. All hooks changed to not
1373 worry about whether input is blocked.
1374 (process_pending_signals): Clear pending_signals before processing
1375 them, in case a signal comes in while we're processing.
1376 By convention callers now test pending_signals before calling us.
1377 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1378 New functions, to support changes to blockinput.h.
1379 (handle_input_available_signal): Now extern.
1380 (reinvoke_input_signal): Remove. All uses replaced by
1382 (quit_count): Now volatile, since a signal handler uses it.
1383 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1384 All callers changed. Block SIGINT only if not already blocked.
1385 Clear sigmask reliably, even if Fsignal returns, which it can.
1386 Omit unnecessary accesses to volatile var.
1387 (quit_throw_to_read_char): No need to restore sigmask.
1388 * keyboard.c (gobble_input, handle_user_signal):
1389 * process.c (wait_reading_process_output):
1390 Call signal-handling code rather than killing ourselves.
1391 * lisp.h: Include <float.h>, for...
1392 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1393 (pending_signals): Now volatile.
1394 (syms_of_data): Now const if IEEE floating point.
1395 (handle_input_available_signal) [USABLE_SIGIO]:
1396 (terminate_due_to_signal, record_child_status_change): New decls.
1397 * process.c (create_process): Avoid disaster if memory is exhausted
1398 while we're processing a vfork, by tightening the critical section
1400 (send_process_frame, process_sent_to, handle_pipe_signal)
1401 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1403 (send_process): No need for setjmp/longjmp any more, since the
1404 SIGPIPE stuff is now gone. Instead, report an error if errno
1406 (record_child_status_change): Now extern. PID and W are now args.
1407 Return void, not bool. All callers changed.
1408 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1409 Remove. All uses removed. This bug should be fixed now in a
1411 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1412 and record the child status change directly. This avoids the
1413 need to futz with the signal mask.
1414 (process_fatal_action): Move here from emacs.c.
1415 (emacs_sigaction_flags): New function, containing
1416 much of what used to be in emacs_sigaction_init.
1417 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1418 caught by emacs, to make races less likely.
1419 (deliver_process_signal): Rename from handle_on_main_thread.
1421 (BACKTRACE_LIMIT_MAX): Now at top level.
1422 (thread_backtrace_buffer, threadback_backtrace_pointers):
1424 (deliver_thread_signal, deliver_fatal_thread_signal):
1425 New functions, for more-accurate delivery of thread-specific signals.
1426 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1427 (deliver_arith_signal): Handle in this thread, not
1428 in the main thread, since it's triggered by this thread.
1429 (maybe_fatal_sig): New function.
1430 (init_signals): New arg DUMPING so that we can be more accurate
1431 about whether we're dumping. Caller changed.
1432 Treat thread-specific signals differently from process-general signals.
1433 Block all signals while handling fatal error; that's safer.
1434 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1436 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1437 Ignore SIGPIPE unless batch.
1438 (emacs_backtrace): Output backtrace for the appropriate thread,
1439 which is not necessarily the main thread.
1440 * syssignal.h: Include <stdbool.h>.
1441 (emacs_raise): New macro.
1442 * xterm.c (x_connection_signal): Remove; no longer needed
1443 now that we use sigaction.
1444 (x_connection_closed): No need to mess with sigmask now.
1445 (x_initialize): No need to reset SIGPIPE handler here, since
1446 init_signals does this for us now.
1448 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1450 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1451 background rect may be larger (Bug#12245).
1453 2012-09-23 Chong Yidong <cyd@gnu.org>
1455 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1457 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1459 * .gdbinit: Just stop at fatal_error_backtrace.
1460 See Stefan Monnier's request in
1461 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1462 Remove no-longer-used query of system type.
1464 2012-09-22 Chong Yidong <cyd@gnu.org>
1466 * search.c (Freplace_match): Doc fix (Bug#12325).
1468 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1470 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1471 (Fline_end_position): Doc fix.
1473 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1475 2012-09-22 Chong Yidong <cyd@gnu.org>
1477 * dispextern.h (struct image_type): Add new slot, storing a type
1478 initialization function.
1480 * image.c (define_image_type): Call the image initializer function
1481 if it is defined. Arguments and return value changed.
1482 (valid_image_p, make_image): Callers changed.
1483 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1484 (gif_type, imagemagick_type, svg_type, gs_type):
1485 Add initialization functions.
1486 (Finit_image_library): Call lookup_image_type.
1487 (CHECK_LIB_AVAILABLE): Macro deleted.
1488 (lookup_image_type): Call define_image_type here, rather than via
1489 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1490 (syms_of_image): Move define_image_type calls for xbm_type and
1491 pbm_type to lookup_image_type.
1493 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1495 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1496 'idle_timers' from here ...
1497 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1498 lists, to avoid infloops when the timer does something stupid,
1499 like reinvoke itself with the same or smaller time-out.
1502 2012-09-22 Martin Rudalics <rudalics@gmx.at>
1504 * window.c (Fsplit_window_internal): Handle only Qt value of
1505 Vwindow_combination_limit separately.
1506 (Qtemp_buffer_resize): New symbol.
1507 (Vwindow_combination_limit): New default value.
1510 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1512 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1513 the new overlay string. (Bug#10159)
1515 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1517 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1518 or that fprintf is async-signal-safe. POSIX doesn't require
1521 2012-09-22 Chong Yidong <cyd@gnu.org>
1523 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1526 2012-09-22 Kenichi Handa <handa@gnu.org>
1528 * composite.c (composition_reseat_it): Handle the case that a
1529 grapheme cluster is not covered by a single font (Bug#12352).
1531 2012-09-21 Chong Yidong <cyd@gnu.org>
1533 * image.c (define_image_type): Avoid adding duplicate types to
1534 image_types (Bug#12463). Suggested by Jörg Walter.
1536 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1538 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1539 (print_load_command_name): Add case LC_DATA_IN_CODE.
1540 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1542 2012-09-21 Glenn Morris <rgm@gnu.org>
1544 * eval.c (Frun_hook_with_args_until_success)
1545 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1547 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1549 * fileio.c (Ffile_selinux_context): Only call freecon when
1550 lgetfilecon succeeded.
1551 (Fset_file_selinux_context): Likewise. (Bug#12444)
1553 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1555 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1556 reordering, locate the cursor by calling set_cursor_from_row; if
1557 that fails, clear the desired glyph matrix before returning a
1558 failure indication to the caller. Fixes leaving garbled display
1559 when fast scrolling with a down-key. (Bug#12403)
1560 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1561 scrolling through multibyte text.
1563 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1565 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1566 calling mark_vectorlike since that's the one that marks the window.
1567 (mark_discard_killed_buffers): Mark the final cdr.
1568 * window.h (struct window): Move prev/next_buffers to the
1569 non-standard fields.
1570 * window.c (make_window): Initialize prev/next_buffers manually.
1572 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1574 Omit unused arg EXPECTED from socket hooks.
1575 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1576 * nsterm.m (ns_term_init):
1577 * termhooks.h (struct terminal.read_socket_hook):
1578 * w32inevt.c (w32_console_read_socket):
1579 * w32term.c (w32_read_socket):
1580 * xterm.c (XTread_socket):
1581 Omit unused arg EXPECTED. All callers changed.
1582 (store_user_signal_events): Return void, not int, since callers no
1583 longer care about the return value. All uses changed.
1585 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
1587 * w32gui.h (XParseGeometry): Do not declare.
1589 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1591 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1592 Ignore 'expected'. See Eli Zaretskii in
1593 <http://bugs.gnu.org/12471#8> (last line).
1595 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1596 (XParseGeometry): Now static. Substitute extremal values for
1597 values that are out of range.
1599 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1601 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1603 * nsfns.m (XParseGeometry): Remove.
1604 (Fx_create_frame): Call x_set_offset to correctly interpret
1605 top_pos in geometry.
1607 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1608 (Fx_parse_geometry): If there is a space in string, call
1609 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1611 2012-09-17 Eli Zaretskii <eliz@gnu.org>
1613 * search.c (scan_buffer): Use character positions in calls to
1614 region_cache_forward and region_cache_backward, not byte
1615 positions. (Bug#12196)
1617 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1618 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1620 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1621 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1622 emacs_blocked_malloc, now deleted.
1624 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1626 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1627 The workaround was for improving performance on Solaris 2.4, but
1628 is getting in the way now. Emacs will still work if someone is
1629 still running Solaris 2.4 in a museum somewhere; Sun dropped
1630 support for Solaris 2.4 in 2003.
1631 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1632 * process.c (create_process) [HAVE_WORKING_VFORK]:
1633 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1634 since Emacs no longer uses vfork on that platform.
1636 2012-09-17 Glenn Morris <rgm@gnu.org>
1638 * emacs.c: Use COPYRIGHT.
1640 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1642 Remove configure's --without-sync-input option (Bug#12450).
1643 When auditing signal-handling in preparation for cleaning it up,
1644 I found that SYNC_INPUT has race conditions and would be a real
1645 pain to fix. Since it's an undocumented and deprecated
1646 configure-time option, now seems like a good time to remove it.
1647 Also see <http://bugs.gnu.org/11080#16>.
1648 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1649 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1650 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1651 (malloc_hysteresis):
1652 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1653 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1654 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1655 (dont_register_blocks, bytes_used_when_reconsidered)
1656 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1657 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1658 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1659 Remove. All uses removed.
1660 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1661 implementation, one that depends on whether the new macro
1662 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1664 * atimer.c (run_timers, handle_alarm_signal):
1665 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1666 (handle_async_input, process_pending_signals)
1667 (handle_input_available_signal, init_keyboard):
1668 * nsterm.m (ns_read_socket):
1669 * process.c (wait_reading_process_output):
1670 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1671 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1673 * xterm.c (XTread_socket):
1675 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1676 * eval.c (handling_signal): Remove. All uses removed.
1677 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1678 All uses replaced with the SYNC_INPUT version.
1679 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1681 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1684 * font.c (Ffont_shape_gstring): Remove unused local.
1686 2012-09-16 Glenn Morris <rgm@gnu.org>
1688 * Makefile.in (clean): No longer run nextstep's clean.
1690 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1692 (ns-app): Move here from ns.mk, and simplify.
1693 (clean): Simplify nextstep entry.
1694 * ns.mk: Remove file.
1696 2012-09-17 Kenichi Handa <handa@gnu.org>
1698 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1699 not covert the last few charactes.
1701 2012-09-16 Kenichi Handa <handa@gnu.org>
1703 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1704 here, but just check the validity of glyphs in the glyph-string.
1706 2012-09-16 Martin Rudalics <rudalics@gmx.at>
1708 * window.c (Fwindow_parameter, Fset_window_parameter):
1709 Accept any window as argument (Bug#12452).
1711 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1713 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1714 to ns_term_init to avoid memory leak.
1716 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1717 explicit retain/release.
1718 (ns_term_init): Only allow one display. Initialize outerpool and
1721 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1723 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1724 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1725 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1726 the Microsoft problem in a different way, by altering ../nt/config.nt.
1728 2012-09-15 Eli Zaretskii <eliz@gnu.org>
1743 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1744 by lisp.h. This completes removal of setjmp.h inclusion
1745 erroneously announced in the previous commit. (Bug#12446)
1747 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1750 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1751 not defined as a macro. The latter happens on MS-Windows.
1754 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1756 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1757 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1758 Some instances of '#include <setjmp.h>' removed, if the
1759 only reason for the instance was because "lisp.h" was included.
1760 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1761 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1762 and _longjmp with the new symbols. Emacs already uses _setjmp if
1763 available, so this change affects only POSIXish hosts that have
1764 sigsetjmp but not _setjmp, such as some versions of Solaris and
1765 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1766 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1767 (png_load_body) [HAVE_PNG]:
1768 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1769 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1770 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1771 since PNG requires jmp_buf. This is the only exception to the
1772 general rule that we now use sys_setjmp and sys_longjmp.
1773 This exception is OK since this code does not change the signal
1774 mask or longjmp out of a signal handler.
1776 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1778 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1779 Include "syssignal.h", for 'main_thread'.
1781 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1783 Avoid out-of-range marker position (Bug#12426).
1784 * insdel.c (replace_range, replace_range_2):
1785 Adjust markers before overlays, as suggested by comments.
1786 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1787 Remove redundant check before calling offset_intervals.
1789 2012-09-14 Martin Rudalics <rudalics@gmx.at>
1791 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1792 current buffer (Bug#12387).
1794 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
1796 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1798 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1800 Use a more backwards-compatible timer format (Bug#12430).
1801 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1802 vector element, not from the 4th, since PSECS is now at the end.
1803 (Fcurrent_idle_time): Doc fix.
1805 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1807 Function to mark objects and remove killed buffers at once.
1808 * alloc.c (discard_killed_buffers): Rename to ...
1809 (mark_discard_killed buffers) ... new name. Add marking
1810 of remaining objects. Fix comment. Adjust users.
1811 (mark_object): Do not touch frame buffer lists here.
1812 * frame.c (delete_frame): Reset frame buffer lists here.
1814 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1816 Better workaround for GNOME bug when --enable-gcc-warnings.
1817 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1818 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1819 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1821 Simplify SIGIO usage (Bug#12408).
1822 The code that dealt with SIGIO was crufty and confusing, e.g., it
1823 played tricks like "#undef SIGIO" but these tricks were not used
1824 consistently. Simplify mostly by not #undeffing standard symbols,
1825 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1826 or not as we please) rather than "defined SIGIO" (standard symbol
1827 that we probably shouldn't #undef).
1828 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1829 Modules that need it can include it.
1830 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1831 * dispextern.h (ignore_sigio): New decl.
1832 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1833 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1834 * emacs.c (shut_down_emacs):
1835 * keyboard.c (kbd_buffer_store_event_hold):
1836 Use ignore_sigio rather than invoking 'signal' directly.
1837 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1839 (FIONREAD, SIGIO): Do not #undef.
1840 (tty_read_avail_input): Use #error rather than a syntax error.
1841 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1842 for I_PIPE, used by SETUP_SLAVE_PTY.
1843 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1844 * sysdep.c (croak): Remove; no longer needed. This bit of
1845 temporary code, with Fred N. Fish's comment that it's temporary,
1846 has been in Emacs since at least 1992!
1847 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1848 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1849 * syssignal.h (croak): Remove decl.
1850 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1851 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1852 now that we're termios-only.
1853 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1854 * term.c (dissociate_if_controlling_tty): Use #error rather than
1857 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1858 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1859 to work around GNOME bug 683906.
1860 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1861 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1862 This works around GCC bug 54561.
1864 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1866 More fixes for 'volatile' and setjmp/longjmp.
1867 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1868 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1869 (png_load_body) [HAVE_PNG]:
1870 (jpeg_load_body) [HAVE_JPEG]:
1871 New function, with most of the old parent function's body.
1872 (png_load) [HAVE_PNG]:
1873 (jpeg_load) [HAVE_JPEG]:
1874 Invoke the new function, to avoid longjmp munging our locals.
1875 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1876 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1877 longjmp is passed 2, as the C standard doesn't guarantee this.
1878 Instead, store the failure code into mgr->failure_code.
1880 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1882 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1883 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1884 (syms_of_keyboard): Remove support for unread-command-char.
1886 2012-09-12 Eli Zaretskii <eliz@gnu.org>
1888 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1889 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1890 violation. (Bug#12426)
1892 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1894 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1896 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1898 * eval.c: Add `inhibit-debugger'.
1899 (Qinhibit_debugger): New symbol.
1900 (call_debugger): Bind it instead of Qdebug_on_error.
1901 (maybe_call_debugger): Test Vinhibit_debugger.
1902 (syms_of_eval): Define inhibit-debugger.
1903 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1904 (syms_of_xdisp): Remove inhibit-debug-on-message.
1906 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1908 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1909 If a nonvolatile local variable is written before a _longjmp to
1910 the frame containing the variable, and is read after the _longjmp,
1911 the value read is indeterminate. Some local variables of type
1912 'struct handler' and 'struct catchtag' are used in this way, so
1913 mark each of their slots as volatile if the slot can be set before
1914 _longjmp and read afterwards.
1915 * lisp.h (struct handler): var and chosen_clause are now volatile.
1916 (struct catchtag): val, next, and pdlcount are now volatile.
1918 * bidi.c (bidi_push_it, bidi_pop_it):
1919 * fns.c (copy_hash_table):
1920 * image.c (define_image_type):
1921 * keyboard.c (kbd_buffer_store_event_hold):
1922 * process.c (Fprocess_send_eof):
1923 * xfaces.c (x_create_gc) [HAVE_NS]:
1924 * xgselect.c (xg_select):
1925 Prefer assignment to memcpy when either will do.
1927 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1928 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1929 time an item is removed. No need to mark this function 'inline';
1930 the compiler knows better than we do.
1932 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1934 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1935 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1936 to change_frame_size (Bug#12388).
1937 (windowDidResize:): Pass YES to updateFrameSize.
1939 * nsterm.h: Add delay parameter to updateFrameSize.
1941 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1943 Discard killed buffers from deleted window and frame objects.
1944 This reduces an amount of references to killed buffers and
1945 helps GC to reclaim them faster.
1946 * alloc.c (discard_killed_buffers): New function.
1947 (mark_object): Use it for deleted windows and frames.
1948 (mark_object): If symbol's value is set up for a killed buffer
1949 or deleted frame, restore it's global binding.
1950 * data.c (swap_in_global_binding): Add GC notice.
1951 (swap_in_symval_forwarding): Use convenient set_blv_where.
1952 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1953 * window.h: ... to here.
1955 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1957 Convenient macro to check whether the buffer is live.
1958 * buffer.h (BUFFER_LIVE_P): New macro.
1959 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1960 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1962 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1964 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1965 composition cases (Bug#12364).
1967 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1968 overhang of succeeding glyphs overlapping box cursor.
1970 * w32term.c (x_draw_glyph_string): Likewise.
1972 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1974 Simplify, document, and port floating-point (Bug#12381).
1975 The porting part of this patch fixes bugs on non-IEEE platforms
1976 with frexp, ldexp, logb.
1977 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1979 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1980 support, by removing commented-out code and briefly listing the
1981 C89 functions excluded. The commented-out stuff was confusing
1982 maintenance, e.g., we thought we needed cbrt but it was commented out.
1983 (logb): Remove decl; no longer needed.
1984 (isfinite): New macro, if not already supplied.
1985 (isnan): Don't replace any existing macro.
1986 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1987 are present on all C89 platforms.
1988 (Ffrexp): Do not special-case zero, as frexp does the right thing
1990 (Flogb): Do not use logb, as it doesn't have the desired meaning
1991 on hosts that use non-base-2 floating point. Instead, stick with
1992 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1993 frexp, to avoid getting an unspecified result.
1995 * xdisp.c (Qinhibit_debug_on_message): Now static.
1997 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1999 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2000 NSBezierPath (Bug#12131).
2002 2012-09-10 Chong Yidong <cyd@gnu.org>
2004 * fns.c (Fdelq, Fdelete): Doc fix.
2006 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2008 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2009 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2011 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2013 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2014 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2017 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2019 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2020 left fringe if the window has a left margin. This avoids leaving
2021 traces of the cursor because its leftmost pixel is not drawn over.
2023 * dispnew.c (update_window_line): When the left margin area of a
2024 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2025 that screen line. (Bug#12277)
2027 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2029 Assume C89 or later for math functions (Bug#12381).
2030 This simplifies the code, and makes it a bit smaller and faster,
2031 and (most important) makes it easier to clean up signal handling
2032 since we can stop worring about floating-point exceptions in
2033 library code. That was a problem before C89, but the problem
2034 went away many years ago on all practical Emacs targets.
2035 * data.c, image.c, lread.c, print.c:
2036 Don't include <math.h>; no longer needed.
2037 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2038 might be autoconfigured, as that never happens.
2040 * doprnt.c (DBL_MAX_10_EXP):
2041 * print.c (DBL_DIG):
2042 Remove. C89 or later always defines these.
2043 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2044 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2045 (arith_error, domain_error, domain_error2):
2046 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2047 no longer needed -- we simply return what C returns. All uses removed.
2048 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2050 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2051 Remove. All uses expanded, as these macros are no longer used
2052 more than once and are now more trouble than they're worth.
2053 (Ftan): Use tan, not sin / cos.
2054 (Flogb): Assume C89 frexp.
2055 (fmod_float): Assume C89 fmod.
2056 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2057 (init_floatfns): Remove. All uses removed.
2059 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2061 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2062 compositeToPoint for OSX < 10.6 (Bug#12390).
2064 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2066 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2067 This produces more-accurate results.
2069 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2071 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2072 changes (Bug#12088).
2074 2012-09-08 Chong Yidong <cyd@gnu.org>
2076 * syntax.c (Fstring_to_syntax): Doc fix.
2078 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2080 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2081 in the internal border.
2082 (x_set_window_size): Remove static variables and their usage.
2083 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2084 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2085 Remove fringe/internal border adjustment (Bug#11052).
2086 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2087 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2088 (ns_fix_rect_ibw): Remove.
2089 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2090 (ns_dumpglyphs_box_or_relief): Ditto.
2091 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2093 (ns_dumpglyphs_image): Ditto.
2094 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2096 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2097 their usage. Add fringe_extended_p and its use as in other terms.
2098 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2099 scroll bar was removed.
2100 (updateFrameSize): New function.
2101 (windowDidResize): Move code to updateFrameSize and call it.
2103 * nsterm.h (EmacsView): Add updateFrameSize.
2105 2012-09-07 Chong Yidong <cyd@gnu.org>
2107 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2109 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2111 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2113 More signal-handler cleanup (Bug#12327).
2114 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2115 Problem introduced when merging patches. Noted by Eli Zaretskii in
2116 <http://bugs.gnu.org/12327#67>.
2117 * floatfns.c: Comment fix.
2118 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2119 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2120 and anyway the declaration is harmless even if SIGDANGER is not defined.
2121 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2122 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2123 source files not surprisingly expected syssignal.h to define, or
2124 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2125 Include <sys/ioctl.h>, for FIONREAD.
2126 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2127 This eliminates a problem whereby other files mysteriously had
2128 to include "syssignal.h" before including "systty.h" if they
2129 wanted to use "#ifdef SIGIO".
2131 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2133 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2135 * w32.c (sigemptyset): Empty the set.
2136 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2138 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2140 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2142 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2143 (mark_object): Likewise for frame objects.
2145 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2147 * syssignal.h (handle_on_main_thread): Always declare,
2148 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2149 This ports to platforms without HAVE_PTHREAD.
2151 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2153 Signal-handler cleanup (Bug#12327).
2154 Emacs's signal handlers were written in the old 4.2BSD style with
2155 sigblock and sigmask and so forth, and this led to some
2156 inefficiencies and confusion. Rewrite these to use
2157 pthread_sigmask etc. without copying signal sets around. Also,
2158 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2159 'signal', and instead use functions that do not attempt to take
2160 over the system name space. This patch causes Emacs's text
2161 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2162 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2163 Do not include <signal.h> or "syssignal.h", as these
2164 modules do not use signals.
2165 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2166 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2167 Do not include <signal.h>, as "syssignal.h" does that for us now.
2168 * atimer.c (sigmask_atimers): New function.
2169 (block_atimers, unblock_atimers): New functions,
2170 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2172 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2173 no longer needed here.
2174 * emacs.c (main): Inspect existing signal handler with sigaction,
2175 so that there's no need to block and unblock SIGHUP.
2176 * sysdep.c (struct save_signal): New member 'action', replacing
2177 old member 'handler'.
2178 (save_signal_handlers, restore_signal_handlers):
2179 Use sigaction instead of 'signal' to save and restore.
2180 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2181 New function. All users of 'signal' modified to use set_sighandler
2182 if they're writeonly, and to use sys_signal if they're read+write.
2183 (emacs_sigaction_init, forwarded_signal): New functions.
2184 (sys_signal): Remove. All uses replaced by calls to sigaction
2185 and emacs_sigaction_init, or by direct calls to 'signal'.
2186 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2187 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2188 all uses replaced by pthread_sigmask etc. calls.
2189 * syssignal.h: Include <signal.h>.
2190 (emacs_sigaction_init, forwarded_signal): New decls.
2191 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2192 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2193 (sigmask, sys_sigmask): Remove; no longer needed.
2194 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2195 (sigblock, sigunblock, sigfree):
2196 (sigsetmask) [!defined sigsetmask]:
2197 Remove. All uses replaced by pthread_sigmask.
2198 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2199 no longer need to be replaced, and its typical old uses
2200 are now done via emacs_sigaction_init and sigaction.
2201 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2202 (sys_sigdel): Remove; unused.
2203 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2205 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2207 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2208 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2210 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2212 Explicitly mark buffer_defaults and buffer_local_symbols.
2213 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2214 mark_local_symbols here.
2215 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2216 since special buffers aren't marked here any more.
2217 (allocate_buffer): Chain new buffer with all_buffers here...
2218 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2220 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2221 (syms_of_buffer): Remove staticpro of the above.
2222 (init_buffer_once): Set names for buffer_defaults and
2223 buffer_local_symbols.
2225 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2227 Use bool for booleans in font-related modules.
2228 * font.c (font_intern_prop, font_style_to_value)
2229 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2230 (generate_otf_features, font_check_otf_features, font_check_otf)
2231 (font_match_p, font_list_entities, font_at):
2232 * fontset.c (fontset_id_valid_p, reorder_font_vector
2233 (fontset_find_font, Fset_fontset_font)
2234 (face_suitable_for_char_p) [0]:
2235 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2236 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2237 (m17n_flt_initialized, ftfont_shape_by_flt):
2238 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2239 * nsfont.m (nsfont_draw):
2240 * w32font.c (w32font_draw):
2241 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2242 Use bool for booleans.
2243 * font.h: Adjust to above API changes.
2244 (struct font, struct font_driver, struct font_driver_list):
2245 Use bool for booleans.
2246 (struct font): Remove useless member encoding_type.
2248 * fontset.c, xftfont.c: Omit unnecessary static decls.
2250 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2252 * alloc.c (mark_object): Revert window marking code
2253 since it's unsafe for the Fset_window_configuration.
2255 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2257 Fix race conditions with signal handlers and errno (Bug#12327).
2258 Be more systematic about preserving errno whenever a signal
2259 handler returns, even if it's not in the main thread. Do this by
2260 renaming signal handlers to distinguish between signal delivery
2261 and signal handling. All uses changed.
2262 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2263 * data.c (deliver_arith_signal): Rename from arith_error.
2264 * dispnew.c (deliver_window_change_signal): Rename from
2265 window_change_signal.
2266 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2267 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2268 * keyboard.c (deliver_input_available_signal): Rename from
2269 input_available_signal.
2270 (deliver_user_signal): Rename from handle_user_signal.
2271 (deliver_interrupt_signal): Rename from interrupt_signal.
2272 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2273 (deliver_child_signal): Rename from sigchld_handler.
2274 * atimer.c (handle_alarm_signal):
2275 * data.c (handle_arith_signal):
2276 * dispnew.c (handle_window_change_signal):
2277 * emacs.c (handle_fatal_signal, handle_danger_signal):
2278 * keyboard.c (handle_input_available_signal):
2279 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2280 * process.c (handle_pipe_signal, handle_child_signal):
2281 New functions, with the actual signal-handling code taken from the
2282 original respective signal handlers, sans the sporadic attempts to
2283 preserve errno, since that's now done by handle_on_main_thread.
2284 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2285 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2286 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2288 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2289 Move initialization of main_thread to sysdep.c's init_signals.
2290 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2291 our usage, and simplifies the mainline code.
2292 (record_child_status_change): New static function, as a helper
2293 for handle_child_signal, and with most of the old child handler's
2295 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2296 (handle_child_signal): Use the above.
2297 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2298 Moved here from emacs.c.
2299 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2300 code moved here from emacs.c's main function.
2301 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2302 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2303 This lets callers save and restore errno properly.
2305 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2307 Remove redundant or unused things here and there.
2308 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2309 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2310 * editfns.c (Fcompare_buffer_substrings): Likewise.
2311 * frame.h (struct terminal, struct font_driver_list):
2312 Remove redundant declarations.
2313 * window.h (Qleft, Qright): Likewise.
2315 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2317 Do not mark objects from deleted buffers, windows and frames.
2318 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2319 (mark_object): Likewise for windows and frames.
2321 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2323 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2324 buffer_defaults and buffer_local_symbols as valid objects.
2325 Return special value to denote them.
2327 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2329 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2330 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2331 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2332 (file_name_absolute_p, Fsubstitute_in_file_name):
2333 (check_executable, check_writable, Ffile_accessible_directory_p)
2334 (Fset_file_selinux_context, Fdefault_file_modes)
2335 (Finsert_file_contents, choose_write_coding_system)
2336 (Fwrite_region, build_annotations, a_write, e_write)
2338 * filelock.c (boot_time_initialized, get_boot_time)
2339 (get_boot_time_1, lock_file_1, within_one_second):
2340 * floatfns.c (in_float):
2341 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2342 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2343 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2344 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2345 * window.c (compare_window_configurations):
2346 Use bool for booleans.
2347 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2348 (Fdefault_file_modes): Now mode_t, not int, for modes.
2349 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2350 (internal_delete_file): Now returns void, not a (boolean) int,
2351 since nobody was looking at the return value.
2352 * lisp.h, window.h: Adjust to above API changes.
2354 * xdisp.c (set_message): Simplify and reindent last change.
2356 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2358 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2360 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2362 * eval.c (call_debugger): Make the function non-static so that we
2363 can call it from set_message.
2365 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2366 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2368 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2370 Give more-useful info on a fatal error (Bug#12328).
2371 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2372 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2373 of doing the work ourselves.
2374 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2375 do most of the work.
2376 (fatal_error_backtrace): New function, taken from the guts
2377 of the old fatal_error_signal, but with a new option to output
2379 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2380 info about the signal than just its number.
2381 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2382 * sysdep.c: Include <execinfo.h>
2383 (emacs_backtrace): New function, taken partly from the previous
2384 code of the 'die' function.
2385 (emacs_abort): Call fatal_error_backtrace rather than abort.
2387 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2389 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2390 eager (load-time) macro-expansion.
2391 * lisp.mk (lisp): Add macroexp.
2393 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2395 Simplify redefinition of 'abort' (Bug#12316).
2396 Do not try to redefine the 'abort' function. Instead, redo
2397 the code so that it calls 'emacs_abort' rather than 'abort'.
2398 This removes the need for the NO_ABORT configure-time macro
2399 and makes it easier to change the abort code to do a backtrace.
2400 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2401 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2402 Remove; sysdep.c's emacs_abort now takes its place.
2403 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2404 'abort' changed to use 'emacs_abort'.
2405 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2406 (abort) [!defined abort]: Rename to ...
2407 (emacs_abort): ... new name.
2408 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2409 the place of the old 'abort' in emacs.c.
2410 * w32.c, w32fns.c (abort): Do not #undef.
2411 * w32.c (emacs_abort): Rename from w32_abort.
2413 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2415 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2416 offsets[j].dv, since the y axis of the screen coordinates points
2417 down, while the y axis of the font definition coordinates points
2418 up. This fixes display of Arabic diacritics such as KASRA and
2419 KASRATAN. (Bug#11860)
2421 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2423 Be more systematic about _setjmp vs setjmp.
2424 * alloc.c (test_setjmp, mark_stack):
2425 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2426 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2427 (png_load, my_error_exit, jpeg_load):
2428 * process.c (send_process_trap, send_process):
2429 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2430 The underscored versions are up to 30x faster on some hosts.
2431 Formerly, the code used setjmp+longjmp sometimes and
2432 _setjmp+_longjmp at other times, with no particular reason to
2433 prefer setjmp+longjmp.
2435 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2437 Fix minor problem found by static checking.
2438 * buffer.c (Fdelete_all_overlays): Return nil.
2440 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2442 * buffer.c (Fdelete_all_overlays): New function.
2444 2012-09-03 Chong Yidong <cyd@gnu.org>
2446 * gtkutil.c: Add extern decl for Qxft.
2448 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2450 * emacs.c, eval.c: Use bool for boolean.
2451 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2452 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2453 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2454 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2455 (main, decode_env_path, Fdaemon_initialized):
2456 * eval.c (call_debugger, Finteractive_p, interactive_p):
2457 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2458 (maybe_call_debugger, Fbacktrace):
2459 * process.c (read_process_output, exec_sentinel):
2460 Use bool for booleans.
2461 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2462 All callers changed.
2463 * eval.c (interactive_p): Omit always-true boolean argument
2464 EXCLUDE_SUBRS_P. All callers changed.
2465 * dispextern.h, lisp.h: Reflect above API changes.
2466 * firstfile.c (dummy): Use the address of 'main', whose signature
2467 won't change, instead of the address of 'initialize', whose
2468 signature just changed from int to bool.
2469 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2470 * msdos.c (fatal_error_in_progress): ... from here.
2471 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2473 (redisplay_internal, unwind_redisplay): Simply clear
2474 REDISPLAYING_P when unwinding, instead of saving its previous,
2475 always-false value and then restoring it.
2477 Clean up some extern decls.
2478 Mostly, this hoists extern decls out of .c files and into .h files.
2479 That way, we're more likely to catch errors if the interfaces change.
2480 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2481 declare xg_mark_data.
2482 * dispextern.h (x_frame_parm_handlers):
2484 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2485 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2486 (Qultra_bold, Qoblique, Qitalic):
2487 Move extern decl here from .c file.
2488 * alloc.c (xg_mark_data) [USE_GTK]:
2490 * eval.c (Qlexical_binding):
2491 * fns.c (time) [!HAVE_UNISTD_H]:
2492 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2493 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2494 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2495 * lread.c (Qinternal_interpreter_environment):
2496 * minibuf.c (Qbuffer):
2497 * process.c (QCfamily, QCfilter):
2498 * widget.c (free_frame_faces):
2499 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2500 * xfont.c (x_clear_errors):
2501 * xterm.c (x_frame_parm_handlers):
2502 Remove now-redundant extern decls.
2503 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2504 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2506 * xfaces.c: Remove unnecessary static decls.
2507 * xterm.c (updating_frame): Remove decl of nonexistent object.
2509 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2510 when building globals.h, as the objects that are not built on
2511 this host are not needed to compile C files on this host.
2513 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2515 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2517 * frame.h: Add missing prototype for x_wm_set_size_hint.
2519 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2521 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2522 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2523 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2524 (Fsubstitute_command_keys):
2525 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2526 (save_excursion_save, save_excursion_restore)
2527 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2528 (format_time_string, general_insert_function)
2529 (make_buffer_string, make_buffer_string_both)
2530 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2531 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2532 (copy_text, insert_1, insert_1_both, insert_from_string)
2533 (insert_from_string_before_markers, insert_from_string_1)
2534 (insert_from_buffer, insert_from_buffer_1, replace_range)
2535 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2536 (del_range_2, modify_region):
2537 * intervals.c (intervals_equal, balance_possible_root_interval)
2538 (adjust_intervals_for_insertion, merge_properties_sticky)
2539 (graft_intervals_into_buffer, lookup_char_property)
2540 (adjust_for_invis_intang, set_point_both)
2541 (get_property_and_range, compare_string_intervals)
2542 (set_intervals_multibyte_1, set_intervals_multibyte):
2543 * keyboard.c (decode_timer):
2544 Use bool for boolean.
2545 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2546 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2548 2012-09-02 Chong Yidong <cyd@gnu.org>
2550 * keymap.c (push_key_description): Print M-TAB as C-M-i
2553 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2555 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2556 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2557 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2558 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2559 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2560 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2561 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2563 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2565 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2566 more than one grapheme cluster passed to the shaper: compute the
2567 offset adjustment values separately for each cluster. (Bug#11860)
2569 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2570 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2571 about implicit conversions from integer to pointer.
2573 2012-09-01 Daniel Colascione <dancol@dancol.org>
2575 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2576 system used too early.
2578 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2580 Better seed support for (random).
2581 * emacs.c (main): Call init_random.
2582 * fns.c (Frandom): Set the seed from a string argument, if given.
2583 Remove long-obsolete Gentzel cruft.
2584 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2585 (init_random): New function.
2587 2012-09-01 Daniel Colascione <dancol@dancol.org>
2589 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2590 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2591 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2592 x_wm_set_size_hint, x_query_colors, x_real_positions,
2593 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2594 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2595 all of which have been moved to common code.
2597 * xfaces.c: Include TERM_HEADER instead of listing all possible
2598 window-system headers.
2600 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2603 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2604 directly accessing frame internals.
2606 * w32font.h: Include font.h. Define syms_of_w32font and
2609 * process.c: Include TERM_HEADER instead of listing all possible
2610 window-system headers.
2612 * nsterm.h: Remove declarations now in frame.h.
2613 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2615 * menu.c: Include TERM_HEADER instead of listing all possible
2616 window-system headers.
2618 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2621 * keyboard.c: Include TERM_HEADER instead of listing all possible
2622 window-system headers.
2624 * image.c: Include TERM_HEADER instead of listing all possible
2625 window-system headers. Declare Vlibrary_cache when compiling for
2628 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2629 window system declarations.
2631 * frame.h: Move common functions here: set_frame_menubar,
2632 x_set_window_size, x_sync, x_get_focus_frame,
2633 x_set_mouse_position, x_set_mouse_pixel_position,
2634 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2635 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2636 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2637 x_activate_menubar, x_real_positions, x_bitmap_icon,
2638 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2641 * frame.c: Include TERM_HEADER instead of listing all possible
2642 window-system headers.
2644 * font.c: Include TERM_HEADER instead of listing all possible
2645 window-system headers.
2647 * emacs.c: Include TERM_HEADER.
2649 * dispnew.c: Include TERM_HEADER instead of listing all possible
2650 window-system headers.
2652 * ccl.h: Include character.h.
2654 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2655 the current window system; include in list of objects to link into
2658 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2660 Remove mark_ttys function and fix tty_display_info initialization.
2661 * lisp.h (mark_ttys): Remove prototype.
2662 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2663 to mark_ttys because all possible values of 'top_frame' slot are
2664 the frames which are reachable from Vframe_list.
2665 * term.c (mark_ttys): Remove.
2666 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2668 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2670 Change struct frame bitfields from unsigned char to unsigned.
2671 * frame.h (struct frame): Change type of 'display_preempted',
2672 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2673 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2674 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2675 bitfields from unsigned char to unsigned.
2677 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2679 Remove unused member of struct x_output and struct w32_output.
2680 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2681 * w32term.h (struct w32_output): Likewise.
2683 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2685 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2686 does not become zero (Bug#12234).
2688 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2690 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2691 for GCC 4.7.1 x86-64.
2693 2012-08-30 Glenn Morris <rgm@gnu.org>
2695 * lread.c (init_lread): For out-of-tree builds, only add the
2696 source directory's site-lisp dir to the load-path if it exists,
2697 consistent with in-tree builds. (Bug#12302)
2699 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2701 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2702 button_values to NULL. Call setStykeMask so dialogs get a close button.
2703 (windowShouldClose:): Set window_closed.
2704 (dealloc): New member, free button_values.
2705 (process_dialog:): Make member function. Remove window argument,
2706 replace window with self. Count buttons and allocate and store values
2708 (addButton:value:row:): value is int with the name tag. Call setTag
2709 with tag. Remove return self, declare return value as void.
2710 (addString:row:): Remove return self, declare return value as void.
2711 (addSplit): Remove return self, declare return value as void.
2712 (clicked:): Remove return self, declare return value as void.
2713 Set dialog_return to button_values[seltag]. Code formatting change.
2714 (initFromContents:isQuestion:): Adjust call to process_dialog.
2715 Code formatting change.
2716 (timeout_handler:): Set timer_fired to YES.
2717 (runDialogAt:): Set timer_fired to NO.
2718 Handle click on close button as quit.
2720 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2721 Add window_closed and button_values. Add void as return value for
2722 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2723 Add process_dialog as new member.
2725 2012-08-28 Eli Zaretskii <eliz@gnu.org>
2727 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2728 is not one of the heaps we manage. (Bug#12242)
2730 2012-08-28 Glenn Morris <rgm@gnu.org>
2732 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2734 2012-08-28 Martin Rudalics <rudalics@gmx.at>
2736 * window.c (Fset_window_configuration): Remove handling of
2737 auto-buffer-name window parameter. Install revision of reverted
2740 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2742 Do not allow to set major mode for a dead buffer.
2743 * buffer.c (Fset_buffer_major_mode): Signal an error
2744 if the buffer is dead.
2745 (Fother_buffer, other_buffer_safely): Remove redundant
2748 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2750 Always use set_buffer_if_live to restore original buffer at unwind.
2751 * buffer.h (record_unwind_current_buffer): New function.
2752 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2753 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2754 * undo.c, window.c: Adjust users.
2755 * buffer.c (set_buffer_if_live): Fix comment.
2757 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2759 Fix usage of set_buffer_internal.
2760 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2761 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2762 * coding.c (decode_coding): Omit redundant test.
2763 * fileio.c (decide_coding_unwind): Likewise.
2764 * fns.c (secure_hash): Likewise.
2765 * insdel.c (modify_region): Likewise.
2766 * keyboard.c (command_loop_1): Likewise.
2767 * print.c (PRINTFINISH): Likewise.
2768 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2770 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2772 * dispnew.c: Use bool for boolean.
2773 (frame_garbaged, display_completed, delayed_size_change)
2774 (fonts_changed_p, add_window_display_history)
2775 (add_frame_display_history, verify_row_hash)
2776 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2777 (row_equal_p, realloc_glyph_pool)
2778 (allocate_matrices_for_frame_redisplay)
2779 (showing_window_margins_p)
2780 (adjust_frame_glyphs_for_frame_redisplay)
2781 (build_frame_matrix_from_leaf_window, make_current)
2782 (mirrored_line_dance, mirror_line_dance, update_frame)
2783 (update_window_tree, update_single_window)
2784 (check_current_matrix_flags, update_window, update_text_area)
2785 (update_window_line, set_window_update_flags, scrolling_window)
2786 (update_frame_1, scrolling, buffer_posn_from_coords)
2787 (do_pending_window_change, change_frame_size)
2788 (change_frame_size_1, sit_for):
2789 Use bool for boolean.
2790 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2791 and remove last int (actually boolean) argument, which was always 0.
2792 All callers changed.
2793 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2794 * dispextern.h (struct composition_it): Use bool for boolean.
2795 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2796 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2797 * dired.c (file_name_completion):
2798 Use bool for boolean. (This was missed in an earlier change.)
2800 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2802 * window.c (Fset_window_configuration): Revert first part of
2805 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2807 * nsterm.h (NSPanel): New class variable dialog_return.
2809 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2810 Initialize dialog_return.
2811 (windowShouldClose:): Use stop instead of stopModalWithCode.
2812 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2813 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2815 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2818 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2820 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2821 * composite.c (find_composition, composition_gstring_p)
2822 (composition_reseat_it, find_automatic_composition):
2823 * data.c (let_shadows_buffer_binding_p)
2824 (let_shadows_global_binding_p, set_internal, make_blv)
2825 (Fmake_variable_buffer_local, Fmake_local_variable)
2826 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2827 (cons_to_signed, arith_driver):
2828 * dbusbind.c (xd_in_read_queued_messages):
2829 * dired.c (directory_files_internal, file_name_completion):
2830 Use bool for booleans.
2831 * dired.c (file_name_completion):
2832 * process.h (fd_callback):
2833 Omit int (actually boolean) argument. It wasn't being used.
2835 * composite.h, lisp.h: Reflect above API changes.
2837 * cmds.c, coding.c: Use bool for booleans.
2838 * cmds.c (move_point, Fself_insert_command):
2839 * coding.h (struct composition status, struct coding_system):
2840 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2841 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2842 (emacs_mule_char, decode_coding_emacs_mule)
2843 (encode_coding_emacs_mule, detect_coding_iso_2022)
2844 (decode_coding_iso_2022, encode_invocation_designation)
2845 (encode_designation_at_bol, encode_coding_iso_2022)
2846 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2847 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2848 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2849 (encode_coding_raw_text, detect_coding_charset)
2850 (decode_coding_charset, encode_coding_charset, detect_eol)
2851 (detect_coding, get_translation_table, produce_chars)
2852 (consume_chars, reused_workbuf_in_use)
2853 (make_conversion_work_buffer, code_conversion_save)
2854 (decode_coding_object, encode_coding_object)
2855 (detect_coding_system, char_encodable_p)
2856 (Funencodable_char_position, code_convert_region)
2857 (code_convert_string, code_convert_string_norecord)
2858 (Fset_coding_system_priority):
2859 * fileio.c (Finsert_file_contents):
2860 Use bool for booleans.
2861 * coding.h, lisp.h: Reflect above API changes.
2862 * coding.c: Remove unnecessary static function decls.
2863 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2864 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2865 not a boolean 'int', since callers never look at the return value.
2866 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2867 * coding.h (decoding_buffer_size, encoding_buffer_size)
2868 (emacs_mule_string_char): Remove unused extern decls.
2869 (struct iso_2022_spec, struct coding_system):
2870 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2871 (struct emacs_mule_spec): Remove unused field 'full_support'.
2872 All initializations removed.
2873 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2875 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2877 Fix spare memory change (Bug#12286).
2878 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2879 (valid_lisp_object_p): Likewise.
2881 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2883 * window.c (Fset_window_configuration): Record any window's old
2884 buffer if it's replaced (see Bug#8789). If the new current
2885 buffer doesn't appear in the selected window, go to its old
2888 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2890 Special MEM_TYPE_SPARE to denote reserved memory.
2891 * alloc.c (enum mem_type): New memory type.
2892 (refill_memory_reserve): Use new type for spare memory.
2893 This prevents live_cons_p and live_string_p from incorrect
2894 detection of uninitialized objects from spare memory as live.
2896 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2899 * Makefile.in (.PHONY): versioclean -> versionclean.
2901 Remove unused external symbols.
2902 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2903 * window.c (Qwindow_valid_p, decode_valid_window):
2904 Now static, not extern.
2905 * data.c (Qinterval): Remove; unused.
2906 (syms_of_data): Do not define 'interval'.
2907 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2908 * window.h (decode_valid_window):
2911 * character.c, charset.c, chartab.c: Use bool for booleans.
2912 * character.c (lisp_string_width, string_count_byte8)
2913 (string_escape_byte8):
2914 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2915 (load_charset_map_from_file, map_charset_chars)
2916 (Fdefine_charset_internal, define_charset_internal)
2917 (Fdeclare_equiv_charset, find_charsets_in_text)
2918 (Ffind_charset_region, char_charset, Fiso_charset):
2919 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2920 (sub_char_table_set, sub_char_table_set_range)
2921 (char_table_set_range, optimize_sub_char_table)
2922 (map_sub_char_table):
2923 Use bool for boolean.
2924 * character.c (str_to_unibyte): Omit last boolean argument; it was
2925 always 0. All callers changed.
2926 * character.h, charset.h: Adjust to match previous changes.
2927 * character.h (char_printable_p): Remove decl of nonexistent function.
2928 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2929 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2930 are all boolean, so make them single-bit bitfields.
2932 * lisp.h (ASET): Remove attempt to detect side effects.
2933 It was meant to be temporary and it often doesn't work,
2934 because when IDX has side effects the behavior of IDX==IDX
2935 is undefined. See Stefan Monnier in
2936 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2938 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2940 * lisp.h (functionp): New function (extracted from Ffunctionp).
2941 (FUNCTIONP): Use it.
2942 * eval.c (Ffunctionp): Use it.
2944 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2946 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2947 as that's faster and simpler than static storage. Don't bother
2948 with the g_main_context_query overhead if g_main_context_pending
2949 says no events are pending.
2950 (gfds, gfds_size): Remove these static vars.
2951 (xgselect_initialize): Remove; no longer needed.
2952 All uses and decls removed.
2954 * emacs.c (fatal_error_signal_hook): Remove.
2955 All uses removed. This leftover from old code was always 0.
2957 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2958 * casefiddle.c (casify_object, casify_region):
2959 * casetab.c (set_case_table):
2960 * category.c, category.h (word_boundary_p):
2961 * category.h (CHAR_HAS_CATEGORY):
2962 Use bool for booleans, instead of int.
2964 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2966 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2968 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2970 On assertion failure, print backtrace if available.
2971 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2972 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2973 * Makefile.in (LIB_EXECINFO): New macro.
2976 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2977 * bytecode.c (exec_byte_code):
2978 * callint.c (check_mark, Fcall_interactively):
2979 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2980 (getenv_internal, sync_process_alive, call_process_exited):
2981 * lisp.h (USE_SAFE_ALLOCA):
2982 Use bool for booleans, instead of int.
2983 * lisp.h, process.h: Adjust prototypes to match above changes.
2984 * callint.c (Fcall_interactively): Don't assume the mark's
2985 offset fits in 'int'.
2987 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2989 * buffer.c, buffer.h: Use bool for boolean.
2990 * buffer.c (reset_buffer_local_variables)
2991 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2992 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2993 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2994 (overlay_touches_p, overlay_strings, Foverlay_put)
2995 (report_overlay_modification, call_overlay_mod_hooks):
2996 (mmap_enlarge, mmap_set_vars):
2997 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2998 Use bool for booleans, instead of int.
2999 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3000 since the 1-or-0 return value is always ignored anyway.
3001 (mmap_initialized_p):
3002 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3003 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3005 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3007 * bidi.c: Use bool for boolean.
3008 This is a bit more readable, and makes the text segment of bidi.o
3009 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3010 Presumably it's faster too.
3011 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3013 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3014 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3015 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3016 (bidi_explicit_dir_char, bidi_level_of_next_char)
3017 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3018 Use bool for booleans, instead of int.
3019 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3020 (bidi_unshelve_cache): Adjust decls to match code.
3022 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3024 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3027 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3029 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3030 * atimer.h: Include <stdbool.h>.
3032 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3034 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3035 compile time tests instead of run time tests on systems that do
3037 (FRAME_MAC_P): Remove leftover from deleted code.
3038 * frame.c (syms_of_frame): Remove leftover from deleted code.
3040 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3042 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3044 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3046 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3047 Otherwise, the compiler complains about (A?B:C) where B is void
3048 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3049 (fontset_add): Return void, for FONTSET_ADD.
3051 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3053 * alloc.c: Use bool for booleans.
3054 (gc_in_progress, abort_on_gc)
3055 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3056 (dont_register_blocks) [GC_MALLOC_CHECK]:
3057 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3058 (check_string_bytes, make_specified_string, memory_full)
3059 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3060 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3061 (mark_stack, valid_pointer_p, make_pure_string)
3062 (Fgarbage_collect, survives_gc_p, gc_sweep):
3063 Use bool for booleans, instead of int.
3064 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3065 Remove unused local.
3066 * alloc.c (PURE_POINTER_P):
3067 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3068 * editfns.c (Fformat):
3069 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3071 * fns.c (sweep_weak_table):
3072 * lisp.h (suppress_checking, push_message, survives_gc_p)
3073 (make_pure_string, gc_in_progress, abort_on_gc):
3074 * lread.c (readchar, read1):
3075 * print.c (Fprin1_to_string):
3076 * xdisp.c (push_message):
3077 Use bool for booleans affected directly or indirectly by
3080 Make recently-introduced setters macros.
3081 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3082 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3083 (set_fontset_default, set_fontset_fallback): Rename from their
3084 upper-case counterparts, and make them functions rather than macros.
3085 This is more consistent with the other recently-introduced setters.
3086 These don't need to be inline, since they're local.
3088 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3090 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3091 the loop (Bug#12247).
3093 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3095 * lisp.h (vcopy): Use memcpy rather than our own loop.
3096 This fixes a performance regression introduced by the recent
3097 addition of vcopy. This means 'vcopy' will need to be modified
3098 for a copying collector, but that's OK. Also, tighten the
3099 checking in the assertion.
3101 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3103 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3104 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3105 non-base glyph for the width of the base character, according to
3106 what x_draw_composite_glyph_string_foreground expects.
3107 Generate WADJUST value according to composition_gstring_width's
3108 expectations, to produce correct width of the composed character.
3109 Reverse the sign of the DU offset produced by ScriptPlace.
3111 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3113 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3115 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3117 Avoid direct writes to contents member of struct Lisp_Vector.
3118 * lisp.h (vcopy): New function to copy data into vector.
3119 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3120 * fns.c (Ffillarray): Use ASET.
3121 * keyboard.c (timer_check_2): Use AREF and ASET.
3122 (append_tool_bar_item, Frecent_keys): Use vcopy.
3123 * lread.c (read_vector): Use ASET.
3124 * msdos.c (Frecent_doskeys): Use vcopy.
3125 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3126 (Finternal_merge_in_global_face): Use ASET and vcopy.
3127 * xfont.c (xfont_list_pattern): Likewise.
3129 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3131 * window.c (Fwindow_point): For the selected window always return
3132 the position of its buffer's point.
3133 (Fset_window_point): For the selected window always go in its
3134 buffer to the specified position.
3136 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3138 Setter macros for fontsets.
3139 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3140 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3141 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3144 2012-08-20 Glenn Morris <rgm@gnu.org>
3146 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3147 Don't assume that `ln -f' works.
3149 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3151 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3152 and later about non-assignments with no effect. See discussion at
3153 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3156 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3158 Inline setter functions for Lisp_Objects slots of struct specbinding.
3159 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3162 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3164 * window.c (select_window): Always make selected window's buffer
3167 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3169 Use AREF and ASET for docstrings of category tables.
3170 * category.h (CATEGORY_DOCSTRING): Use AREF.
3171 (SET_CATEGORY_DOCSTRING): Use ASET.
3172 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3174 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3176 Inline setter functions for hash table members.
3177 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3178 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3179 (set_hash_key_and_value, set_hash_index, set_hash_next)
3180 (set_hash_hash): New functions.
3181 * charset.c, fns.c: Adjust users.
3183 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3185 Inline getter and setter functions for per-buffer values.
3186 * buffer.h (per_buffer_default, set_per_buffer_default)
3187 (per_buffer_value, set_per_buffer_value): New functions.
3188 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3189 * buffer.c, data.c: Adjust users.
3191 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3193 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3195 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3197 Rely on <config.h> + <unistd.h> to declare 'environ',
3198 as gnulib does this if the system doesn't.
3199 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3200 Remove declaration. MS-Windows declares it on stdlib.h which is
3201 included by conf_post.h.
3202 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3203 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3204 * vm-limit.c: Include <unistd.h>, for 'environ'.
3206 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3207 (start_of_data): Remove decl; mem-limits.h provides it.
3209 * xdisp.c (handle_invisible_prop): Make it a bit faster
3210 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3212 2012-08-19 Chong Yidong <cyd@gnu.org>
3214 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3217 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3219 * .gdbinit: Use call instead of set when calling a function in the
3222 * data.c (set_internal): Don't use set_blv_found.
3223 (Fkill_local_variable): Likewise.
3225 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3227 * nsfont.m (ns_ascii_average_width): Ensure the string
3228 ascii_printable is initialized with a null-terminated character
3229 array. Otherwise, it can contain undesired extra characters.
3231 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3233 port new setting code to Sun C 5.8 2005/10/13
3234 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3235 Return void, not Lisp_Object. Otherwise, the compiler
3236 complains about (A?B:C) where B is void and C is Lisp_Object
3237 when compiling CHAR_TABLE_SET, due to the recent change to
3238 the API of sub_char_table_set_contents.
3240 2012-08-18 Chong Yidong <cyd@gnu.org>
3242 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3243 for the string case (Bug#3874).
3245 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3247 * buffer.h (BSET): Remove (Bug#12215).
3248 Replace all uses with calls to new setter functions.
3249 (bset_bidi_paragraph_direction, bset_case_canon_table)
3250 (bset_case_eqv_table, bset_directory, bset_display_count)
3251 (bset_display_time, bset_downcase_table)
3252 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3253 (bset_last_selected_window, bset_local_var_alist)
3254 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3255 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3257 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3258 (bset_auto_fill_function, bset_auto_save_file_format)
3259 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3260 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3261 (bset_cache_long_line_scans, bset_case_fold_search)
3262 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3263 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3264 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3265 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3266 (bset_header_line_format, bset_indicate_buffer_boundaries)
3267 (bset_indicate_empty_lines, bset_invisibility_spec)
3268 (bset_left_fringe_width, bset_major_mode, bset_mark)
3269 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3270 (bset_name, bset_overwrite_mode, bset_pt_marker)
3271 (bset_right_fringe_width, bset_save_length)
3272 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3273 (bset_scroll_up_aggressively, bset_selective_display)
3274 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3275 (bset_word_wrap, bset_zv_marker):
3276 * category.c (bset_category_table):
3277 * syntax.c (bset_syntax_table):
3278 New setter functions.
3280 * process.h (PSET): Remove (Bug#12215).
3281 Replace all uses with calls to new setter functions.
3282 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3283 (PROCESS_INLINE): New macro.
3284 (pset_childp): New setter function.
3285 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3286 * process.c (PROCESS_INLINE):
3287 Define to EXTERN_INLINE, so that the corresponding functions
3288 are compiled into code.
3289 (pset_buffer, pset_command, pset_decode_coding_system)
3290 (pset_decoding_buf, pset_encode_coding_system)
3291 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3292 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3293 (pset_type, pset_write_queue): New setter functions.
3295 * window.h (WSET): Remove (Bug#12215).
3296 Replace all uses with calls to new setter functions.
3297 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3298 (WINDOW_INLINE): New macro.
3299 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3300 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3301 (wset_total_lines, wset_vertical_scroll_bar)
3302 (wset_window_end_pos, wset_window_end_valid)
3303 (wset_window_end_vpos): New setter functions.
3304 * window.c (WINDOW_INLINE):
3305 Define to EXTERN_INLINE, so that the corresponding functions
3306 are compiled into code.
3307 (wset_combination_limit, wset_dedicated, wset_display_table)
3308 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3309 (wset_new_normal, wset_new_total, wset_next_buffers)
3310 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3311 (wset_prev_buffers, wset_right_fringe_width)
3312 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3313 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3314 (wset_window_parameters):
3315 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3316 (wset_column_number_displayed, wset_region_showing):
3317 New setter functions.
3319 * termhooks.h (TSET): Remove (Bug#12215).
3320 Replace all uses with calls to new setter functions.
3321 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3322 (TERMHOOKS_INLINE): New macro.
3323 (tset_charset_list, tset_selection_alist): New setter functions.
3324 * terminal.c (TERMHOOKS_INLINE):
3325 Define to EXTERN_INLINE, so that the corresponding functions
3326 are compiled into code.
3327 (tset_param_alist): New setter function.
3329 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3331 * keyboard.h (KSET): Remove (Bug#12215).
3332 Replace all uses with calls to new setter functions.
3333 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3334 (KEYBOARD_INLINE): New macro.
3335 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3336 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3337 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3338 New setter functions.
3339 * keyboard.c (KEYBOARD_INLINE):
3340 Define to EXTERN_INLINE, so that the corresponding functions
3341 are compiled into code.
3342 (kset_echo_string, kset_kbd_queue)
3343 (kset_keyboard_translate_table, kset_last_prefix_arg)
3344 (kset_last_repeatable_command, kset_local_function_key_map)
3345 (kset_overriding_terminal_local_map, kset_real_last_command)
3346 (kset_system_key_syms): New setter functions.
3348 * frame.h (FSET): Remove (Bug#12215).
3349 Replace all uses with calls to new setter functions.
3350 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3351 (FRAME_INLINE): New macro.
3352 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3353 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3354 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3355 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3356 (fset_param_alist, fset_root_window, fset_scroll_bars)
3357 (fset_selected_window, fset_title, fset_tool_bar_items)
3358 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3359 * frame.c (FRAME_INLINE):
3360 Define to EXTERN_INLINE, so that the corresponding functions
3361 are compiled into code.
3362 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3364 A few more naming-convention fixes for getters and setters.
3365 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3366 and rename from buffer_overlays_set_before.
3367 (set_buffer_overlays_after): Move here from buffer.h, and rename
3368 from buffer_overlays_set_after.
3369 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3371 (set_buffer_intervals): Rename from buffer_set_intervals.
3372 * intervals.c (set_interval_object): Move here from intervals.h,
3373 and rename from interval_set_object.
3374 (set_interval_left): Move here from intervals.h, and rename from
3376 (set_interval_right): Move here from intervals.h, and rename from
3378 (copy_interval_parent): Move here from intervals.h, and rename from
3379 interval_copy_parent.
3380 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3381 (set_interval_plist): Rename from interval_set_plist.
3382 Return void, not Lisp_Object, since no caller uses the result.
3383 * lisp.h (string_intervals): Rename from string_get_intervals.
3384 (set_string_intervals): Rename from string_set_intervals.
3386 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3387 (set_char_table_contents): Rename from char_table_set_contents.
3388 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3389 All uses changed. See the end of
3390 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3392 * lisp.h (CSET): Remove (Bug#12215).
3393 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3394 (set_char_table_purpose): New functions,
3395 replacing CSET. All uses changed. For example, replace
3396 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3397 "set_char_table_parent (char_table, parent);".
3398 The old version was confusing because it used the same name
3399 'parent' for two different things.
3401 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3403 Functions to get and set Lisp_Object fields of buffer-local variables.
3404 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3405 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3406 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3407 * data.c, eval.c, frame.c: Adjust users.
3409 2012-08-17 Chong Yidong <cyd@gnu.org>
3411 * xfaces.c (merge_face_vectors): If the target font specfies a
3412 font spec, make the font's attributes take precedence over
3413 directly-specified attributes.
3414 (merge_face_ref): Recognize :font.
3416 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3418 Do not use memcpy for copying intervals.
3419 * intervals.c (reproduce_interval): New function.
3420 (reproduce_tree, reproduce_tree_obj): Use it.
3421 (reproduce_tree_obj): Remove prototype.
3423 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3425 * lisp.h (duration_to_sec_usec): Remove unused decl.
3427 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3429 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3430 to an allocated instance of NSString, not to the class itself.
3432 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3434 * makefile.w32-in (C_CTYPE_H): New macro.
3435 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3436 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3437 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3439 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3441 Use ASCII tests for character types.
3442 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3444 Don't include <ctype.h>; was not needed.
3445 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3446 * sysdep.c, xfaces.c:
3447 Include <c-ctype.h> instead of <ctype.h>.
3448 * nsterm.m: Include <c-ctype.h>.
3449 * charset.c (read_hex):
3450 * doc.c (Fsnarf_documentation):
3451 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3452 (DRIVE_LETTER) [DOS_NT]:
3453 (Ffile_name_directory, Fexpand_file_name)
3454 (Fsubstitute_in_file_name):
3455 * font.c (font_parse_xlfd, font_parse_fcname):
3456 * frame.c (x_set_font_backend):
3457 * gtkutil.c (xg_get_font):
3458 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3459 * nsimage.m (hexchar):
3460 * nsterm.m (ns_xlfd_to_fontname):
3461 * sysdep.c (system_process_attributes):
3462 * xfaces.c (hash_string_case_insensitive):
3463 Use C-locale tests instead of locale-specific tests for character
3464 types, since we want the ASCII interpretation here, not the
3465 interpretation suitable for whatever happens to be the current locale.
3467 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3469 Consistently check windows for validity/liveness
3470 (Bug#11984, Bug#12025, Bug#12026).
3471 * lisp.h (CHECK_VALID_WINDOW): New macro.
3472 * window.c (decode_window): Rename to decode_live_window.
3473 (decode_valid_window, Fwindow_valid_p): New functions.
3474 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3475 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3476 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3477 (Fwindow_prev_sibling, Fwindow_combination_limit)
3478 (Fset_window_combination_limit, Fwindow_use_time)
3479 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3480 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3481 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3482 (Fwindow_hscroll, Fset_window_hscroll)
3483 (Fwindow_redisplay_end_trigger)
3484 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3485 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3486 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3487 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3488 (Fwindow_end, Fset_window_point, Fset_window_start)
3489 (Fpos_visible_in_window_p, Fwindow_line_height)
3490 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3491 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3492 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3493 (Fset_window_parameter, Fwindow_display_table)
3494 (Fset_window_display_table, Fdelete_other_windows_internal)
3495 (Fset_window_buffer, Fset_window_new_total)
3496 (Fset_window_new_normal, Fdelete_window_internal)
3497 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3498 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3499 (Fwindow_scroll_bars): Check whether argument window is a valid or
3500 live window. Update doc-strings.
3501 (syms_of_window): New symbol Qwindow_valid_p.
3502 * keyboard.c (Fposn_at_x_y): Check whether argument
3503 frame_or_window denotes a valid window.
3505 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3507 Fix previous char table change.
3508 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3509 * chartab.c (optimize_sub_char_table): Likewise.
3511 2012-08-16 Chong Yidong <cyd@gnu.org>
3513 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3515 * xfont.c (xfont_open):
3516 * xftfont.c (xftfont_open): Set the font's max_width field.
3518 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3519 min_width to space_width and average_width to the average over
3520 printable ASCII characters.
3521 (ns_char_width): Code cleanup.
3522 (ns_ascii_average_width): New utility function.
3524 * font.h (struct font): Update comments.
3526 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3528 Simple interface to set Lisp_Object fields of character tables.
3529 * lisp.h (CSET): New macro.
3530 (char_table_set_extras, char_table_set_contents)
3531 (sub_char_table_set_contents): New function.
3532 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3533 * syntax.c: Adjust users.
3535 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3537 * eval.c (eval_sub): Bind lexical-binding.
3538 * lread.c (Qlexical_binding): Make non-static.
3540 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3542 * nsmenu.m (popupSession): Remove.
3543 (pop_down_menu): Remove endModalSession.
3544 (timeout_handler:): New method.
3545 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3546 Call runModalForWindow. Check timer_fired when it returns.
3547 If not set, cancel timer and break out of loop.
3548 Otherwise loop again, with a new timeout.
3550 * nsterm.m: Include fcntl.h if present.
3551 (fd_entry, t_readfds, inNsSelect): Remove.
3552 (select_writefds, select_valid, select_timeout, selfds)
3553 (select_mutex, apploopnr): Add.
3554 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3555 Otherwise call kbd_buffer_store_event.
3556 (ns_send_appdefined): Remove release of fd_entry.
3557 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3558 Increment and decrement apploopnr.
3559 (ns_select): If no file descriptors, just do a NSTimer.
3560 Otherwise copy read/write masks and start select thread (fd_handler).
3561 Start main loop and wait for application defined event.
3562 Inform select thread to stop selecting after main loop is exited.
3563 (ns_term_init): Create selfds pipe and set non-blocking.
3564 Initialize select_mutex. Start the select thread (fd_handler).
3565 (fd_handler:): Loop forever, wait for info from the main thread
3566 to either start or stop selecting. When select returns, send
3567 and appdefined event.
3568 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3569 If not call kbd_buffer_store_event.
3571 * nsterm.h (EmacsApp): fd_handler takes id argument.
3572 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3574 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3576 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3578 * region-cache.c (move_cache_gap): Update gap_len using the actual
3579 growth of the boundaries array. Do not change cache_len.
3582 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3584 Generalize and cleanup font subsystem checks.
3585 * font.h (FONT_DEBUG, font_assert): Remove.
3586 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3587 Change font_assert to eassert. Use eassert where appropriate.
3589 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3591 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3593 2012-08-15 Chong Yidong <cyd@gnu.org>
3595 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3596 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3597 extract the font descriptor instead of just the font name.
3598 In that case, return a font spec instead of a string.
3599 (x_last_font_name): Move to this file from xfns.c.
3601 * xfns.c (Fx_select_font): The return value can also be a font
3602 spec. Move x_last_font_name management to gtkutil.c.
3604 * xfaces.c: Make font weight and style symbols non-static.
3606 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3608 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3611 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3613 * alloc.c (Fgarbage_collect): Use plural form consistently.
3615 2012-08-14 Eli Zaretskii <eliz@gnu.org>
3617 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3618 iteration through the command loop. Fixes a problem whereby mouse
3619 movements are ignored until the first mouse click.
3621 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3623 Use bool, not int, for Lisp booleans.
3624 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3625 makes Emacs a bit smaller and presumably a bit faster.
3626 * lisp.h: Include <stdbool.h>.
3627 (struct Lisp_Boolfwd, defvar_bool):
3628 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3629 * regex.c [!emacs]: Include <stdbool.h>.
3630 (false, true): Remove; <stdbool.h> does this for us now.
3632 2012-08-14 Chong Yidong <cyd@gnu.org>
3634 * character.c (Fcharacterp): Doc fix (Bug#12076).
3636 * data.c (Findirect_variable): Doc fix (Bug#11040).
3638 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3640 * editfns.c (Fformat): Doc fix (Bug#12059).
3641 (Fsave_current_buffer): Doc fix (Bug#11542).
3643 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3645 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3648 2012-08-14 Martin Rudalics <rudalics@gmx.at>
3650 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3651 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3652 * minibuf.c (choose_minibuf_frame, read_minibuf):
3653 * w32fns.c (x_create_tip_frame):
3654 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3655 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3657 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3659 * intervals.c (offset_intervals): Remove obsolete comment.
3661 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3663 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3665 2012-08-14 Gergely Risko <gergely@risko.hu>
3667 * coding.c (decode_coding): Record buffer modification before
3668 disabling undo_list (Bug#11773).
3670 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3672 Revert and cleanup some recent overlay changes.
3673 * buffer.h (enum overlay_type): Remove.
3674 (buffer_get_overlays, buffer_set_overlays): Likewise.
3675 (buffer_set_overlays_before, buffer_set_overlays_after):
3676 New function. Adjust users.
3677 (unchain_both): Add eassert.
3679 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3681 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3683 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3685 * gtkutil.c (xg_mark_data): Don't assume C99.
3687 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3689 * gtkutil.c (xg_frame_tb_info): New struct.
3690 (TB_INFO_KEY): New define.
3691 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3692 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3693 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3695 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3696 is up to date. Otherwise store new data.
3697 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3699 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3701 Use KSET for write access to Lisp_Object members of struct kboard.
3702 * keyboard.h (KSET): New macro.
3703 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3704 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3705 * xterm.c: Adjust users.
3707 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3709 Use BSET for write access to Lisp_Object members of struct buffer.
3710 * buffer.h (BSET): New macro.
3711 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3712 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3713 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3714 * window.c, xdisp.c, xfns.c: Adjust users.
3716 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3718 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3720 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3722 * nsterm.m (not_in_argv): New function.
3723 (application:openFile, application:openTempFile:):
3724 (application:openFileWithoutUI:, application:openFiles:): Open file
3725 if not_in_argv returns non-zero (bug#12171).
3727 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3728 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3729 Define for Gtk+ versions less than 3.2.
3730 (xg_get_font_name): Use those functions/macros here.
3731 Reported by Frans Oilinki <moilinki@gmail.com>.
3733 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3735 * unexmacosx.c (copy_data_segment): Copy initialized data in
3736 statically linked libraries from input file rather than memory.
3738 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3739 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3740 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3742 2012-08-10 Glenn Morris <rgm@gnu.org>
3744 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3745 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3747 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3749 Fix last change to allow compilation with low optimization levels.
3750 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3751 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3753 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3755 Use common inline syntax in intervals.h.
3756 * intervals.h (INTERVALS_INLINE): New macro.
3757 Change all users from LISP_INLINE.
3759 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3761 Define Qnone once for all platforms.
3762 * frame.c (Qnone): Define here.
3763 (syms_of_frame): DEFSYM it.
3764 * lisp.h (Qnone): New declaration.
3765 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3766 * xfns.c: Remove duplication. Adjust users.
3768 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3770 Remove unused macros from intervals.h.
3771 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3772 * intervals.c: Adjust comment.
3774 2012-08-10 Eli Zaretskii <eliz@gnu.org>
3776 * w32fns.c <w32_unicode_gui>: New static variable.
3777 (globals_of_w32fns): Initialize it according to os_subtype.
3778 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3781 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
3782 Eli Zaretskii <eliz@gnu.org>
3784 Fix bug #10299 with Unicode characters sent by customized
3785 keyboards created by MSKLC.
3786 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3787 (w32_init_class): Use it to initialize the Emacs class with either
3788 ANSI or Unicode API calls.
3789 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3791 (w32_wnd_proc): If the character code sent by WM_CHAR or
3792 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3793 original message. Call DefWindowProcW on NT and later.
3795 2012-08-10 Glenn Morris <rgm@gnu.org>
3797 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3799 * lisp.h (DIRECTORY_SEP): Let configure set it.
3801 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3803 Use TSET for write access to Lisp_Object slots of struct terminal.
3804 * termhooks.h (TSET): New macro.
3805 * coding.c, terminal.c, xselect.c: Adjust users.
3807 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3809 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3810 the failing expression, include them in the error message.
3811 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3812 * lisp.h (internal_condition_case_n): Update declaration.
3814 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3816 Inline functions to examine and change buffer overlays.
3817 * buffer.c (unchain_both): New function.
3818 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3819 (buffer_has_overlays): New function.
3820 (enum overlay_type): New enum.
3821 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3822 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3824 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3826 Inline functions to examine and change buffer intervals.
3827 * alloc.c (mark_interval_tree): Remove.
3828 (MARK_INTERVAL_TREE): Simplify.
3829 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3830 * intervals.c (buffer_balance_intervals): New function.
3831 (graft_intervals_into_buffer): Adjust indentation.
3832 (set_intervals_multibyte): Simplify.
3833 * buffer.h (BUF_INTERVALS): Remove.
3834 (buffer_get_intervals, buffer_set_intervals): New function.
3835 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3836 * intervals.c, textprop.c: Adjust users.
3838 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3840 Inline functions to examine and change string intervals.
3841 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3842 (string_get_intervals, string_set_intervals): New function.
3843 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3844 * lread.c, print.c, textprop.c: Adjust users.
3846 2012-08-08 Glenn Morris <rgm@gnu.org>
3848 * lisp.mk (lisp): Remove language/persian.elc.
3850 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3853 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3854 (NULL_INTERVAL_P): Likewise. Adjust users.
3855 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3856 Adjust comment. Move under #if 0.
3857 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3858 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3860 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3862 Check total length of intervals with eassert.
3863 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3864 * intervals.c: Change all users to eassert.
3866 2012-08-07 Eli Zaretskii <eliz@gnu.org>
3868 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3869 Rename fields to match removal of FGET and WGET and disuse of
3870 INTERNAL_FIELD in Lisp_Cons.
3872 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3874 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3875 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3876 name since all xname users are fixed long time ago. Do not
3878 (set_symbol_name, set_symbol_function, set_symbol_plist):
3879 (set_symbol_next, set_overlay_plist): New function.
3880 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3881 (struct Lisp_Overlay): Likewise.
3882 (CVAR, MVAR, SVAR): Remove.
3883 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3884 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3885 * xterm.c: Adjust users.
3886 * .gdbinit: Change to use name field of struct Lisp_Symbol
3889 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3891 Basic functions to set Lisp_Object and pointer slots of intervals.
3892 * intervals.h (interval_set_parent, interval_set_object):
3893 (interval_set_left, interval_set_right, interval_set_plist):
3894 (interval_copy_parent): New function.
3895 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
3896 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3898 (INTERVAL_SIZE): Remove. Adjust users.
3899 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3901 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3903 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3904 * process.h (PGET): Remove.
3905 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3906 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3908 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3910 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3911 * window.h (WGET): Remove.
3912 (struct window): Do not use INTERNAL_FIELD.
3913 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3914 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3915 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3916 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3917 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3920 2012-08-07 Chong Yidong <cyd@gnu.org>
3922 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3923 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3924 (Fdelete_window_internal): Signal an error if the window is not on
3925 a live frame (Bug#12025).
3927 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3929 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3930 * frame.h (FGET): Remove.
3931 (struct frame): Do not use INTERNAL_FIELD.
3932 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3933 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3934 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3935 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3937 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
3939 * w32.c: Silence compiler warnings.
3940 (map_w32_filename): Remove unused variable `is_fat'.
3941 (chase_symlinks): Add parentheses around expression.
3943 2012-08-06 Glenn Morris <rgm@gnu.org>
3945 * sysdep.c: Respect BROKEN_GETWD.
3947 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3948 Let configure handle it.
3949 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3951 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3953 Use GCALIGNMENT where appropriate.
3954 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3955 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3956 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3958 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3960 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3961 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3963 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3965 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3966 that should be sufficient for everyone.
3968 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3970 * keyboard.c (timer_check_2): Add break so timer_check returns next
3973 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3975 Fix Windows build errors introduced after converting to WGET and WSET.
3976 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3977 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3979 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3981 * nsterm.m (ns_frame_rehighlight): Use FSET.
3983 * nsmenu.m (ns_update_menubar): Use FSET.
3985 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3987 Separate read and write access to Lisp_Object slots of Lisp_Process.
3988 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3989 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3991 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3993 Separate read and write access to Lisp_Object slots of struct window.
3994 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3995 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3996 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3997 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3998 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3999 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4002 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4004 Fix Windows build errors introduced after converting to FGET and FSET.
4005 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4006 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4007 (w32_judge_scroll_bars): Change to use FSET.
4008 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4010 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4012 Fix replacement typo.
4013 * window.c (replace_window): Set root_window instead of
4014 selected_window. This fixes a total window subsystem
4015 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4017 2012-08-06 Glenn Morris <rgm@gnu.org>
4019 * lisp.mk (lisp): Add language/persian.elc.
4021 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4023 Separate read and write access to Lisp_Object slots of struct frame.
4024 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4025 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4026 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4027 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4028 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4030 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4032 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4034 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4036 Generalize common compile-time constants.
4037 * lisp.h (header_size, bool_header_size, word_size): Now here.
4038 (struct Lisp_Vector): Add comment.
4039 (struct Lisp_Bool_Vector): Move up to define handy constants.
4040 (VECSIZE, PSEUDOVECSIZE): Simplify.
4041 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4042 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4043 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4044 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4045 * xfont.c, xmenu.c: Use word_size where appropriate.
4047 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4049 * search.c (Freplace_match): Treat \? in the replacement text
4050 literally (Bug#8161).
4052 2012-08-05 Chong Yidong <cyd@gnu.org>
4054 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4055 * frame.c (Vdelete_frame_functions):
4056 * emacs.c (Vkill_emacs_hook): Doc fix.
4058 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4060 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4061 --with-x-toolkit=no builds.
4062 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4064 2012-08-04 Chong Yidong <cyd@gnu.org>
4066 * syntax.c (Fmodify_syntax_entry): Doc fix.
4068 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4070 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4071 * w32.c (init_environment): Change the default values of many
4072 environment variables in dflt_envvars[] to NULL, to avoid pushing
4073 them into environment when they were not already defined.
4074 Remove the code that deletes site-lisp subdirectories from the default
4075 value of EMACSLOADPATH, as it is no longer needed.
4076 (check_windows_init_file): Now external, not static.
4077 Use Vload_path as is, without adding anything, as this function is now
4078 called when Vload_path is already set up.
4080 * w32.h (check_windows_init_file): Add prototype.
4082 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4083 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4084 compatibility with Posix platforms.
4085 (main): Move the call to check_windows_init_file to here from
4087 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4088 any, in the DEFALT argument into the root of the Emacs build or
4089 installation tree, as appropriate.
4091 * callproc.c (init_callproc_1): Call decode_env_path instead of
4092 doing its equivalent by hand.
4093 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4094 the code that sets Vexec_path run on MS-Windows.
4096 * lread.c (init_lread): Add comments to #ifdef's.
4098 * msdos.c (dos_set_window_size, IT_update_begin)
4099 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4100 instead of direct references.
4102 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4104 Export DEFAULT_REHASH_* to GDB.
4105 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4106 Now constants, not macros.
4108 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4110 Remove unnecessary casts involving pointers.
4111 These casts are no longer needed now that we assume C89 or later,
4112 since they involve casting to or from void *.
4113 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4114 (make_pure_float, make_pure_vector):
4115 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4116 * macros.c (Fstart_kbd_macro):
4117 * menu.c (find_and_return_menu_selection):
4118 * minibuf.c (read_minibuf_noninteractive):
4119 * sysdep.c (closedir):
4120 * xdisp.c (x_produce_glyphs):
4121 * xfaces.c (compare_fonts_by_sort_order):
4122 * xfns.c (x_real_positions, select_visual):
4123 * xselect.c (x_stop_queuing_selection_requests)
4124 (x_get_window_property, x_get_window_property_as_lisp_data):
4125 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4126 Remove unnecessary pointer casts.
4127 * alloc.c (record_xmalloc): New function.
4128 * lisp.h (record_xmalloc): New decl.
4129 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4130 more like a function. This is because the pointer cast is not
4131 needed. All uses changed.
4132 * print.c (print_string, print_error_message): Avoid length recalc.
4134 Improve fix for macroexp crash with debugging (Bug#12118).
4135 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4136 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4137 not supposed to be invoked from the garbage collector.
4138 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4139 (gc_aset): New function, which is like ASET but can be
4140 used in the garbage collector.
4141 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4142 (set_hash_index): Use it instead of ASET.
4144 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4146 Support symlinks on latest versions of MS-Windows.
4147 * w32.c: Include winioctl.h and aclapi.h.
4148 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4149 (revert_to_self): Forward declarations of static functions.
4150 <static BOOL g_b_init_get_security_info>:
4151 <g_b_init_create_symbolic_link>: New static flags.
4152 (globals_of_w32): Initialize them to zero.
4153 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4154 (map_w32_filename): Improve commentary. Simplify switch.
4155 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4156 headers (most versions of MinGW w32api don't).
4157 (get_security_info, create_symbolic_link)
4158 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4160 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4161 in the argument file name.
4162 (sys_access): Call unc_volume_file_attributes only if
4163 GetFileAttributes fails with network-related error codes.
4164 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4165 have the required privileges.
4166 (get_file_security_desc_by_name): Rename from
4167 get_file_security_desc.
4168 (stat_worker): New function, with most of the guts of 'stat', and
4169 with addition of handling of symlinks and support for 'lstat'.
4170 If possible, get file's attributes and security information by
4171 handle, not by name. Produce S_IFLNK bit for symlinks, when
4172 called from 'lstat'.
4173 (stat, lstat): New functions, call 'stat_worker'.
4174 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4175 symlinks when the underlying filesystem supports them.
4177 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4179 Fix macroexp crash on Windows with debugging (Bug#12118).
4180 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4181 checking subscripts; problem introduced with the recent
4182 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4183 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4184 since it's used in non-static inline functions now.
4186 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4187 Don't assume buffer size fits in 'int'. Remove unused local.
4189 Use C99-style 'extern inline' if available.
4190 * buffer.h (BUFFER_INLINE):
4191 * category.h (CATEGORY_INLINE):
4192 * character.h (CHARACTER_INLINE):
4193 * charset.h (CHARSET_INLINE):
4194 * composite.h (COMPOSITE_INLINE):
4195 * dispextern.h (DISPEXTERN_INLINE):
4196 * lisp.h (LISP_INLINE):
4197 * systime.h (SYSTIME_INLINE):
4198 New macro, replacing 'static inline' in this header.
4199 * buffer.h, category.h, character.h, charset.h, composite.h:
4200 * dispextern.h, lisp.h, systime.h:
4201 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4202 * alloc.c (LISP_INLINE):
4203 * buffer.c (BUFFER_INLINE):
4204 * category.c (CATEGORY_INLINE):
4205 * character.c (CHARACTER_INLINE):
4206 * charset.c (CHARSET_INLINE):
4207 * composite.c (COMPOSITE_INLINE):
4208 * dispnew.c (DISPEXTERN_INLINE):
4209 * sysdep.c (SYSTIME_INLINE):
4210 Define to EXTERN_INLINE, so that the corresponding functions
4211 are compiled into code.
4212 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4213 (INLINE_HEADER_END): New macros.
4214 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4215 since it's used in non-static inline functions now.
4216 (VALMASK) [!USE_LSB_TAG]: Likewise.
4218 2012-08-02 Glenn Morris <rgm@gnu.org>
4220 * s/: Remove empty directory.
4222 * s/ms-w32.h: Move to ../nt/inc.
4223 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4224 Update for new ms-w32.h location.
4226 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4229 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4231 2012-08-02 Glenn Morris <rgm@gnu.org>
4233 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4234 hard-coding the path separator.
4236 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4238 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4239 This how ASET and AREF are supposed to work, and makes
4240 it easier to think about future improvements. See
4241 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4242 * charset.h (set_charset_attr): New function.
4243 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4244 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4245 (aref_addr): New function. All uses of &AREF(...) changed.
4246 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4247 (set_hash_index): New functions. All lvalue-style uses of
4248 HASH_KEY etc. changed.
4249 * keyboard.c (set_prop): New function. All lvalue-style uses
4252 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4254 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4255 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4256 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4257 * nsfns.m (ns_set_name_as_filename): Likewise.
4258 * nsmenu.m (ns_update_menubar): Likewise.
4259 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4261 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4263 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4264 Adapt to latest changes in field names of the corresponding Lisp
4267 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4269 2012-08-01 Glenn Morris <rgm@gnu.org>
4271 * s/msdos.h: Remove file.
4272 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4273 * Makefile.in (S_FILE): Remove.
4274 (config_h): Remove S_FILE.
4276 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4278 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4279 Remove; moved to nt/config.nt.
4281 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4283 Use INTERNAL_FIELD for conses and overlays.
4284 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4285 Remove obsolete comment.
4287 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4288 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4290 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4292 Use INTERNAL_FIELD for symbols.
4293 * lisp.h (SVAR): New macro. Adjust users.
4294 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4295 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4297 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4299 Use INTERNAL_FIELD for processes.
4300 * process.h (PVAR): New macro. Adjust style.
4301 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4302 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4304 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4306 Use INTERNAL_FIELD for windows.
4307 * window.h (WVAR): New macro.
4308 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4309 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4310 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4311 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4312 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4313 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4315 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4317 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4319 2012-08-01 Glenn Morris <rgm@gnu.org>
4321 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4322 Move to configure.ac.
4324 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4326 * makefile.w32-in (CONFIG_H): Update dependencies.
4327 (CONF_POST_H): New macro.
4329 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4331 2012-07-31 Glenn Morris <rgm@gnu.org>
4333 * Makefile.in (S_FILE): No longer set by configure.
4335 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4337 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4339 * process.h (NULL_DEVICE):
4340 * emacs.c (SEPCHAR):
4341 * editfns.c (USER_FULL_NAME): Let configure set them.
4343 * s/README, s/template.h: Remove files.
4345 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4347 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4348 Move to configure.ac.
4350 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4352 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4353 resulting renaming of 'struct frame' members.
4355 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4357 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4358 after introduction of FVAR.
4360 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4362 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4364 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4365 instead of compositeToPoint.
4366 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4368 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4370 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4372 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4373 * lisp.h (INTERNAL_FIELD): New macro.
4374 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4375 (BVAR): Change to use INTERNAL_FIELD.
4376 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4377 (KVAR): Change to use INTERNAL_FIELD.
4378 * frame.h (FVAR): New macro.
4379 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4380 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4381 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4382 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4383 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4385 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4387 Miscellaneous fixes for non-default X toolkits.
4388 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4389 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4390 Move under #ifdef USE_LUCID.
4391 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4392 definition and usage to avoid warnings.
4394 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4396 * nsterm.m (openFiles): Fix previous checkin.
4398 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4400 * indent.c (compute_motion): Remove unused local.
4402 2012-07-31 Glenn Morris <rgm@gnu.org>
4404 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4406 * conf_post.h [USG5_4]:
4407 Move remaining contents of s/usg5-4-common.h here.
4408 * s/usg5-4-common.h: Remove file.
4410 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4411 * s/irix6-5.h: Remove file.
4413 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4414 * s/darwin.h: Remove file.
4416 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4417 * s/hpux10-20.h: Remove file, which is now empty.
4419 2012-07-30 Glenn Morris <rgm@gnu.org>
4421 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4422 * Makefile.in (config_h): Add conf_post.h.
4423 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4425 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4427 * nsterm.m (ns_do_open_file): New variable.
4428 (ns_term_init): Set ns_do_open_file to YES after run returns.
4429 (openFile, openTempFile, openFileWithoutUI, openFiles):
4430 Open files only if ns_do_open_file.
4432 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4434 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4435 This no-op macro hasn't been needed for many years.
4436 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4438 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4439 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4440 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4441 gdb_make_enums_visible.
4442 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4443 (DIRECTORY_SEP): Now a constant, not a macro.
4445 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4447 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4448 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4450 * w32term.c <w32_keyboard_codepage>: Renamed from
4451 keyboard_codepage and now external. All users changed.
4453 * w32term.h: Add declaration of w32_keyboard_codepage.
4455 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4456 the codepage to translate keys to Unicode. If this argument is
4457 -1, use the value returned by GetConsoleCP. All callers changed.
4459 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4461 Update .PHONY listings in makefiles.
4462 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4463 bootstrap-clean, distclean, maintainer-clean, versioclean,
4466 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4467 This is a bit clearer. Fix some commentary typos.
4469 2012-07-30 Glenn Morris <rgm@gnu.org>
4471 * s/netbsd.h: Let configure include signal.h if needed.
4472 Remove file, which is now empty.
4474 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4475 Let configure set them.
4476 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4477 No more need to undefine.
4479 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4481 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4482 non-single-byte char when adding meta modifier. (Bug#12090)
4484 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4486 Convert safe_call to use variable number of arguments.
4487 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4488 (safe_call2): Fix comment.
4489 * lisp.h (safe_call): Adjust prototype.
4490 * coding.c (encode_coding_object): Change to use safe_call2.
4491 * xfaces.c (merge_face_heights): Change to use safe_call1.
4493 2012-07-30 Glenn Morris <rgm@gnu.org>
4495 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4496 does that unconditionally. Remove file, which is now empty.
4498 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4501 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4503 Export to GDB most of lisp.h's remaining object-like macros.
4504 * lisp.h (min, max): Move earlier, because they're used earlier now.
4505 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4506 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4507 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4508 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4509 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4510 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4511 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4512 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4513 Now constants, for GDB. They need not be macros.
4514 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4515 Now constants, for GDB, as well as macros, for static initializers.
4516 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4517 Move to after the definition of struct Lisp_Char_Table,
4518 since the former now needs that type defined.
4519 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4520 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4521 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4522 New enums, for gdb_make_enums_visible.
4523 (GLYPH_MODE_LINE_FACE): Remove; unused.
4524 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4525 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4526 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4527 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4528 enum maxargs, enum MAX_ALLOCA.
4529 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4530 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4531 no longer needed, now that they are done in lisp.h.
4533 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4535 Cleanup string bytes checking.
4536 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4537 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4538 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4539 (check_sblock, compact_small_strings): Simplify.
4541 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4543 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4544 These macros are confusing and no longer need to be defined, as
4545 the enum values now suffice. All uses replaced with definiens.
4546 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4548 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4550 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4551 ($(BLD)/w32console.$(O)): Update dependencies.
4553 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4555 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4556 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4558 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4560 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4562 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4563 setting sitelisp (Bug#12010).
4565 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4567 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4569 * w32heap.c (cache_system_info):
4570 * w32.c (sys_rename):
4571 * w32proc.c (find_child_console, sys_kill): All users changed.
4573 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4575 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4577 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4579 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4581 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4583 Cleanup statistics calculation in Fgarbage_collect.
4584 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4585 Fix zombies percentage calculation. Simplify elapsed time calculation.
4587 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4589 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4590 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4591 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4592 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4593 (replace_range, replace_range_2, del_range_2): Change to eassert.
4594 * marker.c (byte_char_debug_check): Adjust style.
4596 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4598 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4599 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4600 long-ago-commented-out code that talks about "WIN32".
4601 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4604 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4606 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4607 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4608 Simplify by using alignof.
4609 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4610 * lisp.h: Include <stdalign.h>.
4611 (GCALIGNMENT): New macro and constant.
4612 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4613 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4614 (stdalign): New macro, if not already defined.
4616 2012-07-28 Eli Zaretskii <eliz@gnu.org>
4618 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4619 * w32inevt.c: Include w32inevt.h.
4620 (w32_read_console_input): New inline function, calls either
4621 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4622 w32_console_unicode_input.
4623 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4624 (w32_kbd_patch_key, key_event): Use the codepage returned by
4625 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4626 (key_event): use uChar.UnicodeChar only if
4627 w32_console_unicode_input is non-zero.
4629 * w32console.c: Include w32heap.h.
4630 <w32_console_unicode_input>: New global variable.
4631 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4632 family of Windows, zero otherwise.
4634 * w32inevt.h: Declare w32_console_unicode_input.
4636 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4637 --without-x. (Bug#11742)
4639 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4641 Adjust GDB to reflect pvec_type changes (Bug#12036).
4642 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4643 2012-07-04 changes to pseudovector representation.
4644 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4646 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
4648 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4650 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4652 2012-07-27 Eli Zaretskii <eliz@gnu.org>
4654 * alloc.c (listn): Fix the order the arguments are consed onto the
4657 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4658 enumeration constants, as PURE and HEAP are too general, and clash
4659 with other headers and sources, such as gmalloc.c and the
4660 MS-Windows system headers. All users changed.
4662 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4664 Revert last save_excursion_save and save_excursion_restore changes.
4665 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4666 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4668 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4670 Fix recently-introduced typos in Windows port.
4671 Reported by Martin Rudalics <rudalics@gmx.at>.
4672 * w32.c (init_environment): Replace comma with semicolon.
4673 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4675 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4677 Improve GDB symbol export (Bug#12036).
4678 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4679 arms of an 'if', not using conditional expressions; otherwise GDB
4680 complains about the types in the unevaluated arm when the argument
4681 is an integer literal.
4682 (xgetint): Simplify expression.
4683 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4684 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4685 Zaretskii in <http://bugs.gnu.org/12036#13>.
4686 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4687 needed now that we have gdb_make_enums_visible.
4688 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4689 (enum enum_USE_LSB_TAG):
4690 New enum types, packaging up enums that need to be exported to GDB.
4692 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4694 Utility function to make a list from specified amount of objects.
4695 * lisp.h (enum constype): New datatype.
4696 (listn): New prototype.
4697 * alloc.c (listn): New function.
4698 (Fmemory_use_count, syms_of_alloc): Use it.
4699 * buffer.c (syms_of_buffer): Likewise.
4700 * callint.c (syms_of_callint): Likewise.
4701 * charset.c (define_charset_internal): Likewise.
4702 * coding.c (syms_of_coding): Likewise.
4703 * keymap.c (syms_of_keymap): Likewise.
4704 * search.c (syms_of_search): Likewise.
4705 * syntax.c (syms_of_syntax): Likewise.
4706 * w32.c (init_environment): Likewise.
4707 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4708 * xdisp.c (syms_of_xdisp): Likewise.
4709 * xfns.c (syms_of_xfns): Likewise.
4711 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4713 Fast save_excursion_save and save_excursion_restore.
4714 * lisp.h (struct Lisp_Excursion): New data type.
4715 (PVEC_EXCURSION): New pseudovector type.
4716 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4717 to deal with it. Adjust comments.
4718 (init_marker, attach_marker): New prototype.
4719 (unchain_marker): Adjust prototype.
4720 * marker.c (attach_marker): Change to global.
4721 (init_marker): New function.
4722 * alloc.c (Fmake_marker, build_marker): Use it.
4723 (build_marker): More easserts.
4724 (mark_object): Handle struct Lisp_Excursion.
4725 * editfns.c (save_excursion_save, save_excursion_restore):
4726 Reimplement to use struct Lisp_Excursion. Add comments.
4728 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4730 Fix export of symbols to GDB (Bug#12036).
4731 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4732 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4733 emacs.c, as this is a more-suitable home. Had this been done earlier
4734 the fix for 12036 would have avoided some of the problems noted in
4735 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4736 would have been more obvious.
4737 * emacs.c: Do not include <verify.h>; no longer needed.
4738 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4739 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4740 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4741 Remove; now done in lisp.h.
4742 * lisp.h (PUBLISH_TO_GDB): New macro.
4743 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4744 (DATA_SEG_BITS): Use it.
4745 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4746 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4747 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4748 not be usable in #if. This simplifies things.
4750 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
4752 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4754 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4756 Simplify export of symbols to GDB (Bug#12036).
4757 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4758 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4759 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4760 Adjust to changes in lisp.h and emacs.c, by using
4761 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4762 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4763 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4764 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4765 instead of gdb_valbits.
4766 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4767 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4768 instead of gdb_array_mark_flag.
4769 (xboolvector): Get size from $->size, not $->header.size.
4770 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4771 (xreload, hook-run, hookpost-run): Remove.
4772 * emacs.c: Include <verify.h>.
4773 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4774 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4776 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4777 (gdb_USE_LSB_TAG): New enum constants.
4778 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4779 Also define these as enum constants, so they're visible to GDB.
4780 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4781 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4782 as constants, so they're visible to GDB.
4783 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4784 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4785 Now enum constants, not macros, so they're visible to GDB.
4786 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4787 more convenient now. All uses changed.
4788 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4789 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4791 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4793 Explicitly free restriction data that are not needed anymore.
4794 * editfns.c (save_restriction_restore): Free restriction data.
4796 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4798 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4799 add argument, tune behavior, and adjust all callers.
4801 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4803 Use typedef for EMACS_INT, EMACS_UINT.
4804 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4805 than macros. This simplifies debugging in the usual case, since
4806 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4807 and it allows expressions involving EMACS_INT casts.
4808 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4810 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4812 * nsterm.m (ns_read_socket): Return early if there is a modal
4815 2012-07-25 Martin Rudalics <rudalics@gmx.at>
4817 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4818 that FOCUS-FRAME can be omitted.
4820 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4822 Adjust buffer text indirection counters at the end of Fkill_buffer.
4823 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4824 buffer is definitely dead. This should really fix an issue reported
4825 by Christoph Scholtes again. (Bug#12007).
4826 (init_buffer_once): Initialize indirection counters of
4827 buffer_defaults and buffer_local_symbols (for sanity and safety).
4829 2012-07-24 Eli Zaretskii <eliz@gnu.org>
4831 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4832 and continuation glyphs on tooltip frames, leave them at zero.
4833 Avoids continued lines in tooltips. (Bug#11832)
4835 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4837 Simplify copy_overlay.
4838 * buffer.c (copy_overlay): Simplify. Use build_marker.
4839 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4841 2012-07-23 Eli Zaretskii <eliz@gnu.org>
4843 * print.c (print_object): Don't crash when a frame's name is nil
4844 or invalid. (Bug#12025)
4846 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4847 it signals an error when a tooltip frame is being created.
4849 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4851 Cleanup miscellaneous objects allocation and initialization.
4852 * alloc.c (allocate_misc): Change to static. Add argument to
4853 specify the subtype. Adjust comment and users.
4854 (build_overlay): New function.
4855 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4856 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4857 (allocate_misc): Remove prototype.
4858 (build_overlay): Add prototype.
4860 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4862 Swap buffer text indirection counters in Fbuffer_swap_text.
4863 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4864 This avoids crash reported by Christoph Scholtes at
4865 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4867 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4869 * nsmenu.m (Popdown_data): New struct.
4870 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4872 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4873 (initWithContentRect): Make imgView and contentView non-static
4874 and autorelease them. Also autorelease img and matrix (Bug#12005).
4875 (dealloc): Remove (Bug#12005).
4877 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4879 Adjust consing_since_gc when objects are explicitly freed.
4880 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4881 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4882 (free_cons, free_misc): Subtract object size from consing_since_gc.
4884 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4886 Simplify and cleanup markers positioning code.
4887 * marker.c (attach_marker): More useful eassert.
4888 (live_buffer, set_marker_internal): New function.
4889 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4890 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4892 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4894 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4895 as it's limited by the amount of memory, not by INT_MAX.
4897 2012-07-21 Eli Zaretskii <eliz@gnu.org>
4899 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4900 in special-event-map. See the discussion at
4901 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4904 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4905 info.dwItemData. Fixes crashes on 64-bit Windows.
4906 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4908 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4910 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4911 (conversationIdentifier): Return value is NSInteger.
4912 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4914 2012-07-21 Chong Yidong <cyd@gnu.org>
4916 * window.c (decode_any_window): Signal an error if the window is
4917 on a dead frame (Bug#11984).
4919 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4921 Add indirection counting to speed up Fkill_buffer.
4922 * buffer.h (struct buffer): New member.
4923 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4924 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4925 base buffer indirection counter.
4926 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4927 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4928 through buffer list if indirection counter is 0.
4930 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4932 Extend the value returned by Fgarbage_collect with heap statistics.
4933 * alloc.c (Qheap): New symbol.
4934 (syms_of_alloc): DEFSYM it.
4935 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4936 (Fmemory_free): Remove.
4937 (syms_of_alloc): Don't defsubr it.
4938 * buffer.c (Fcompact_buffer): Remove.
4939 (syms_of_buffer): Don't defsubr it.
4941 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4943 Make maybe_gc inline.
4944 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4945 * lisp.h (consing_since_gc, gc_relative_threshold)
4946 (memory_full_cons_threshold): Revert declaration.
4947 (maybe_gc): Remove prototype, define as inline.
4948 * alloc.c: Remove old commented-out code.
4949 (consing_since_gc, gc_relative_threshold)
4950 (memory_full_cons_threshold): Revert to global.
4953 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4955 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4956 * lisp.h (build_unibyte_string): New function.
4957 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4958 * sysdep.c, w32fns.c, xfns.c: Use it.
4959 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4960 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4961 Adjust users accordingly.
4962 * font.h (font_open_by_name): Adjust prototype.
4964 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4966 Cleanup calls to Fgarbage_collect.
4967 * lisp.h (maybe_gc): New prototype.
4968 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4969 Remove declarations.
4970 * alloc.c (maybe_gc): New function.
4971 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4973 * bytecode.c (MAYBE_GC): Use maybe_gc.
4974 * eval.c (eval_sub, Ffuncall): Likewise.
4975 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4976 to avoid dependency from auto-save feature.
4978 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4980 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4981 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4982 'for_each_per_buffer_object_at'.
4983 All uses changed. It's better to use upper-case for macros that
4984 cannot be implemented as functions, to give the reader a clue
4985 that they're special.
4987 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4989 * alloc.c (Fgarbage_collect): Tweak docstring.
4991 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4993 Tweak the value returned from Fgarbage_collect again.
4994 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4995 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4996 Adjust documentation.
4997 (total_vector_bytes): Rename to total_vector_slots, adjust
4999 (total_free_vector_bytes): Rename to total_free_vector_slots,
5001 (Qstring_bytes, Qvector_slots): New symbols.
5002 (syms_of_alloc): DEFSYM them.
5004 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5006 Buffer compaction primitive which may be used from Lisp.
5007 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5008 (syms_of_buffer): Register Fcompact_buffer.
5009 * alloc.c (Fgarbage_collect): Use compact_buffer.
5010 * buffer.h (compact_buffer): New prototype.
5011 (struct buffer_text): New member.
5013 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5015 New macro to iterate over all buffers, miscellaneous cleanups.
5016 * lisp.h (all_buffers): Remove declaration.
5017 * buffer.h (all_buffers): Add declaration, with comment.
5018 (for_each_buffer): New macro.
5019 * alloc.c (Fgarbage_collect, mark_object): Use it.
5020 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5021 (init_buffer): Likewise.
5022 * data.c (Fset_default): Likewise.
5023 * coding.c (code_conversion_restore): Remove redundant check
5025 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5027 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5029 Fix bug that created negative-length intervals.
5030 * intervals.c (merge_interval_right, merge_interval_left):
5031 Do not zero out this interval if it is absorbed by its children,
5032 as this interval's total length doesn't change in that case. See
5033 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5035 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5037 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5038 when invoking (make-bool-vector N t) and N is a positive
5039 multiple of 8 -- the last 8 bits were mistakenly cleared.
5041 Remove some struct layout assumptions in bool vectors.
5042 * alloc.c (bool_header_size): New constant.
5043 (header_size, word_size): Move earlier, as they're now used earlier.
5044 Use 'word_size' in a few more places, where it's appropriate.
5045 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5046 padding before the data member of a bool vector.
5047 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5048 than doing the check by hand with an abort ().
5050 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5052 * eval.c (Fdefvar): Don't check constants since we only set the var if
5053 it's not yet defined anyway (bug#11904).
5055 * lisp.h (last_undo_boundary): Declare new var.
5056 * keyboard.c (command_loop_1): Set it.
5057 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5058 were auto-added by the command loop (bug#11774).
5060 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5062 * w32font.c (Qsymbol): Remove local definition.
5063 (syms_of_w32font): Don't DEFSYM it.
5065 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5067 Fix sweep_vectors to handle large bool vectors correctly.
5068 * alloc.c (sweep_vectors): Account total_vector_bytes for
5069 bool vectors larger than VBLOCK_BYTES_MAX.
5071 2012-07-18 Chong Yidong <cyd@gnu.org>
5073 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5074 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5076 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5078 Return more descriptive data from Fgarbage_collect.
5079 Suggested by Stefan Monnier in
5080 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5081 * alloc.c (bounded_number): New function.
5082 (total_buffers, total_vectors): New variable.
5083 (total_string_size): Rename to total_string_bytes, adjust users.
5084 (total_vector_size): Rename to total_vector_bytes, adjust users.
5085 (sweep_vectors): Account total_vectors and total_vector_bytes.
5086 (Fgarbage_collect): New return value. Adjust documentation.
5087 (gc_sweep): Account total_buffers.
5088 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5089 (VECTOR_SIZE): Remove.
5090 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5091 (Qinterval, Qmisc): New symbols.
5092 (syms_of_data): Initialize them.
5093 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5094 (Qcons, Qbuffer): New declarations.
5096 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5098 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5099 Round up, not down. Improve doc.
5101 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5103 Restore old code in allocate_string_data to avoid Faset breakage.
5104 Reported by Julien Danjou <julien@danjou.info> in
5105 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5106 * alloc.c (allocate_string_data): Restore old code with minor
5107 adjustments, fix comment to explain this subtle issue.
5109 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5111 Remove FILE_SYSTEM_CASE.
5112 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5114 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5115 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5116 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5117 call-process-region passes it through expand-file-name.
5119 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5121 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5123 Fix crash when creating indirect buffer (Bug#11917)
5124 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5125 Don't handle unbound variables specially if non-zero.
5126 (Fbuffer_local_variables): Pass zero.
5127 (clone_per_buffer_values): Pass non-zero.
5129 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5131 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5132 to make the loop interruptible.
5134 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5136 * gnutls.c (emacs_gnutls_handshake): Only retry if
5137 GNUTLS_E_INTERRUPTED.
5139 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5141 Cleanup and convert miscellaneous checks to eassert.
5142 * alloc.c (mark_interval): Fix comment, partially rephrase
5143 old comment from intervals.h (see below).
5144 * intervals.c (find_interval, adjust_intervals_for_insertion)
5145 (delete_interval, adjust_intervals_for_deletion)
5146 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5148 (adjust_intervals_for_insertion, make_new_interval):
5149 Remove obsolete and unused code.
5150 * intervals.h (struct interval): Remove obsolete comment.
5151 * textprotp.c (erase_properties): Remove unused code.
5152 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5153 (Fremove_list_of_text_properties): Convert to eassert.
5155 2012-07-17 Chong Yidong <cyd@gnu.org>
5157 * editfns.c (Finsert_char): Doc fix.
5159 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5161 Fix previous change to make Fmemory_free always accurate.
5162 * alloc.c (make_interval): Update total_free_intervals.
5163 (make_float): Likewise for total_free_floats.
5164 (free_cons, Fcons): Likewise for total_free_conses.
5165 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5166 Likewise for total_free_vector_bytes.
5167 (Fmake_symbol): Likewise for total_free_symbols.
5168 (bytes_free): Remove.
5170 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5172 Simple free memory accounting feature.
5173 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5174 (sweep_vectors): Accumulate size of free vectors.
5175 (Fgarbage_collect): Setup bytes_free.
5176 (Fmemory_free): New function.
5177 (syms_of_alloc): Register it.
5179 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5181 Cleanup overlays checking.
5182 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5183 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5184 eassert and OVERLAYP.
5185 (sort_overlays): Change to use OVERLAYP.
5187 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5189 * editfns.c (Finsert_char): Make it interactive, and make the
5190 second arg optional. Copy interactive spec and docstring from
5193 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5195 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5196 Unlike the other wrapped functions, fabs has an unspecified
5199 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5201 * nsterm.m (keyDown): Interpret flags without left/right bits
5202 as the left key (Bug#11670).
5204 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5206 Remove empty and useless init functions.
5207 * lisp.h (init_character_once, init_fns, init_image)
5208 (init_filelock, init_sound): Remove prototype.
5209 * character.c (init_character_once): Remove.
5210 * filelock.c (init_filelock): Likewise.
5211 * fns.c (init_fns): Likewise.
5212 * image.c (init_image): Likewise.
5213 * sound.c (init_sound): Likewise.
5214 * emacs.c (main): Adjust accordingly.
5216 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5218 * gtkutil.h: Tiny cleanups.
5219 (use_old_gtk_file_dialog): Remove useless declaration.
5220 (xg_uses_old_file_dialog): Add suggested const attribute.
5222 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5224 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5225 (bidi_paragraph_init): Use it to limit search forward for a strong
5226 directional character in abnormally large paragraphs full of
5227 neutral or weak characters. (Bug#11943)
5229 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5231 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5232 the toolbar (Bug#9451).
5233 (xg_make_tool_item): Give the widget event box a transparent
5236 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5238 Cleanup basic allocation variables and functions.
5239 * alloc.c (ignore_warnings, init_intervals, init_float)
5240 (init_cons, init_symbol, init_marker): Remove.
5241 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5242 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5243 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5244 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5245 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5246 (staticidx, init_alloc_once, init_strings, free_ablock):
5247 Remove redundant initialization.
5248 * fns.c (init_weak_hash_tables): Remove.
5249 * lisp.h (init_weak_hash_tables): Remove prototype.
5251 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5253 Use zero_vector where appropriate.
5254 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5256 * lisp.h (zero_vector): New declaration.
5257 * font.c (null_vector): Remove.
5258 (syms_of_font): Remove initialization and staticpro.
5259 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5260 * keymap.c (Faccessible_keymaps): Likewise.
5262 2012-07-15 Leo Liu <sdl.web@gmail.com>
5264 * fringe.c: Fix typo in comments.
5266 2012-07-14 Leo Liu <sdl.web@gmail.com>
5268 * fringe.c: Add a new bitmap exclamation-mark.
5270 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5272 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5274 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5275 (HAVE_MENUS): Don't define, defined by editing config.in with
5277 (GMALLOC_INHIBIT_VALLOC): Don't define.
5278 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5280 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5282 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5284 2012-07-14 Glenn Morris <rgm@gnu.org>
5286 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5287 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5288 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5290 2012-07-13 Glenn Morris <rgm@gnu.org>
5292 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5294 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5295 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5297 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5299 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5300 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5301 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5302 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5304 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5305 as boolean expression.
5306 (x_set_window_size): Remove unused variable toolbar.
5307 (ns_get_color_default, ns_mod_to_lisp): Remove.
5308 (ns_mouse_position): Remove unused variables xchar and ychar.
5309 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5310 (ns_set_vertical_scroll_bar): Remove unused variable count.
5311 (ns_delete_terminal): Remove unused variable i.
5312 (ns_term_init): Remove unused variables r, g and b.
5313 (mouseDown): Remove unused variable window.
5314 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5315 (initFrameFromEmacs): Remove unused variable vbextra.
5316 (mouseEntered): Remove unused variables p and dpyinfo.
5317 (mouseExited): Remove unused variables p and r.
5318 (ns_define_frame_cursor, ns_clear_frame_area)
5319 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5320 (menuDown): Assign [sender tag] to variable and cast the variable.
5322 * nsterm.h (menuDown): Add id as type to argument sender.
5323 (ns_display_info_for_name): Add Lisp_Object argument.
5324 (ns_term_init): Add Lisp_Object argument.
5325 (ns_map_event_to_object): Add void argument.
5326 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5327 prototype with arguments and only declare if __OBJC__.
5328 (nxatoms_of_nsselect): Add void argument.
5329 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5330 (ns_alloc_autorelease_pool): Add void argument.
5331 (ns_release_autorelease_pool): Add void* argument.
5332 (ns_get_defaults_value): Add const char* argument.
5334 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5335 (initFromContents): Use SSDATA where appropriate.
5336 (ns_update_menubar): Add braces to ambigous if-else.
5337 (initWithTitle): Put () around assignment in if statement.
5338 (ns_menu_show): Remove unused variables window and keymap.
5339 (update_frame_tool_bar): Remove unused variable selected_p.
5340 (initWithContentRect): Remove unused variable this_cmd_name.
5342 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5344 (setXBMColor): Remove unused variable len.
5345 (setPixmapData): Put () around assignment in loop statement.
5347 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5348 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5350 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5351 around assignment in loop statement.
5352 (nsfont_open): Remove unused variable i.
5353 (nsfont_open): Remove unused variable len.
5354 (nsfont_draw): Remove unused variable cs.
5356 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5357 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5358 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5359 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5360 (Fns_font_name, Fns_perform_service)
5361 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5362 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5363 (ns_set_name): Remove unused variable view.
5364 (x_set_menu_bar_lines): Remove unused variable olines.
5365 (x_set_tool_bar_lines): Remove unused variable root_window.
5366 (Fns_list_colors): Put () around assignment in while statement.
5367 (Fns_perform_service): Remove unused variable len.
5368 (Fns_display_usable_bounds): Remove unused variable top.
5369 (syms_of_nsfns): Remove unused variable i.
5371 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5374 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5376 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5377 and free it with DestroyExceptionInfo (Bug#11558).
5379 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5381 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5382 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5383 Set here, not in nt/config.nt.
5385 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5387 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5388 cursor overflow into the last glyph on display line when the right
5389 fringe is off. (Bug#11832)
5391 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5393 * xdisp.c (produce_special_glyphs): Now static.
5394 * dispextern.h (produce_special_glyphs): Remove decl.
5396 2012-07-13 Glenn Morris <rgm@gnu.org>
5398 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5399 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5401 * s/usg5-4-common.h (USG, USG5):
5402 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5403 * s/sol2-6.h (SOLARIS2):
5404 * s/irix6-5.h (IRIX6_5):
5405 * s/hpux10-20.h (USG, USG5, HPUX):
5406 * s/gnu-linux.h (USG, GNU_LINUX):
5407 * s/freebsd.h (BSD_SYSTEM):
5408 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5409 * s/cygwin.h (CYGWIN):
5410 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5411 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5413 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5415 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5417 2012-07-13 Glenn Morris <rgm@gnu.org>
5419 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5421 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5423 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5424 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5426 2012-07-12 Glenn Morris <rgm@gnu.org>
5428 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5430 * process.c (init_process_emacs): Rename from init_process.
5431 The old name is also the name of a Mach system call.
5432 * lisp.h, emacs.c: Update for this name change.
5433 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5436 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5438 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5439 memmove call that removes glyphs covered by the left truncation
5440 glyph. Improve commentary.
5441 (display_line): Fix display of continuation glyphs on GUI frames
5442 when the right fringe is turned off and variable-size fonts are
5443 used in the window. Move the code that appends a stretch glyph to
5444 produce_special_glyphs, so that it could be used for truncation
5445 and continuation glyphs alike.
5446 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5447 glyph of a suitably computed width, to align the special glyphs at
5448 the window margin. Code moved from display_line. (Bug#11832)
5450 2012-07-12 Glenn Morris <rgm@gnu.org>
5452 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5454 * s/gnu-linux.h, s/hpux10-20.h:
5455 Do not unconditionally define HAVE_XRMSETDATABASE.
5457 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5459 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5461 Fix typos that broke OS X build.
5462 Reported by Randal L. Schwartz in
5463 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5464 * nsterm.m (ns_timeout): Add missing local decl.
5465 (ns_get_color): snprintf -> sprintf, to fix typo.
5467 2012-07-12 Glenn Morris <rgm@gnu.org>
5469 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5470 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5471 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5472 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5474 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5475 Move PTY_OPEN to configure.
5477 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5478 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5479 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5481 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5483 Use empty_unibyte_string where applicable.
5484 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5485 * lread.c (read1): Likewise.
5486 * xsettings.c (syms_of_xsettings): Likewise.
5488 2012-07-12 Glenn Morris <rgm@gnu.org>
5490 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5491 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5492 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5493 * s/hpux10-20.h (RUN_TIME_REMAP):
5494 * s/bsd-common.h (TABDLY): Move to configure.
5496 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5498 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5500 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5501 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5503 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5505 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5506 * s/template.h: Move NARROWPROTO to configure.
5508 2012-07-11 Glenn Morris <rgm@gnu.org>
5510 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5511 unused since 2011-01-17 change to systty.h.
5513 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5514 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5515 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5517 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5519 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5521 2012-07-11 Glenn Morris <rgm@gnu.org>
5523 * s/darwin.h, s/gnu-linux.h, s/template.h:
5524 Move INTERRUPT_INPUT to configure.
5526 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5528 Minor adjustments to interning code.
5529 * lisp.h (intern, intern_c_string): Redefine as static inline
5530 wrappers for intern_1 and intern_c_string_1, respectively.
5531 (intern_1, intern_c_string_1): Rename prototypes.
5532 * lread.c (intern_1, intern_c_string_1, oblookup):
5533 Simplify Vobarray checking.
5534 * font.c (font_intern_prop): Likewise. Adjust comment.
5535 * w32font.c (intern_font_name): Likewise.
5537 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5539 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5541 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5542 of Fcar/Fcdr if possible.
5543 * font.c (check_otf_features): Likewise.
5544 * fontset.c (Fnew_fontset): Likewise.
5545 * gnutls.c (Fgnutls_boot): Likewise.
5546 * minibuf.c (read_minibuf): Likewise.
5547 * msdos.c (IT_set_frame_parameters): Likewise.
5548 * xmenu.c (Fx_popup_dialog): Likewise.
5549 * w32menu.c (Fx_popup_dialog): Likewise.
5551 2012-07-11 Glenn Morris <rgm@gnu.org>
5553 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5554 since nothing has defined it on these platforms.
5556 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5557 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5559 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5560 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5561 Move CLASH_DETECTION to configure.
5563 * s/gnu.h: Remove file, which is now empty.
5565 * s/gnu.h, s/gnu-linux.h:
5566 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5568 2012-07-11 John Wiegley <johnw@newartisans.com>
5570 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5571 function attribute, so we only use it if it exists in the
5574 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5576 Avoid call to strlen in fast_c_string_match_ignore_case.
5577 * search.c (fast_c_string_match_ignore_case): Change to use
5578 length argument. Adjust users accordingly.
5579 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5581 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5583 Assume mkdir, rmdir.
5584 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5585 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5588 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5591 * s/hpux10-20.h (HAVE_PERROR): Remove.
5592 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5593 Remove dummy definition, as this problem was obsolete long ago.
5596 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5598 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5600 Avoid calls to strlen in font processing functions.
5601 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5602 (font_open_by_name): Change to use length argument.
5603 Adjust users accordingly.
5604 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5606 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5607 Change to return ptrdiff_t.
5608 (xfont_list_pattern, xfont_match): Use length returned by
5609 xfont_decode_coding_xlfd.
5610 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5612 2012-07-11 Glenn Morris <rgm@gnu.org>
5614 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5615 Move DONT_REOPEN_PTY to configure.
5617 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5618 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5620 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5622 Remove "#define unix" that is no longer needed (Bug#11905).
5623 * s/aix4-2.h (unix): Remove; no longer needed.
5625 EMACS_TIME simplification (Bug#11875).
5626 This replaces macros (which typically do not work in GDB)
5627 with functions, typedefs and enums, making the code easier to debug.
5628 The functional style also makes code easier to read and maintain.
5629 * systime.h: Include <sys/time.h> on all hosts, not just if
5630 WINDOWSNT, since 'struct timeval' is needed in general.
5631 (EMACS_TIME): Now a typedef, not a macro.
5632 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5634 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5635 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5636 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5637 (EMACS_TIME_LE): Now functions, not macros.
5638 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5639 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5640 which are not functions. All uses rewritten to use:
5641 (make_emacs_time): New function.
5642 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5643 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5644 not functions. All uses rewritten to use the following, respectively:
5645 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5646 (add_emacs_time, sub_emacs_time): New functions.
5647 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5648 * fileio.c (Fcopy_file):
5649 * xterm.c (XTflash): Get the current time closer to when it's used.
5650 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5652 * bytecode.c (targets): Suppress -Woverride-init warnings.
5654 Simplify by avoiding confusing use of strncpy etc.
5655 * doc.c (Fsnarf_documentation):
5656 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5657 * frame.c (Fmake_terminal_frame):
5658 * gtkutil.c (get_utf8_string):
5660 * nsmenu.m (ns_update_menubar):
5661 * regex.c (regerror):
5662 Prefer memcpy to strncpy and strncat when either will do.
5663 * fileio.c (Fsubstitute_in_file_name):
5664 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5665 (menu_separator_name_p):
5666 * nsmenu.m (ns_update_menubar):
5667 Prefer memcmp to strncmp when either will do.
5668 * nsterm.m: Include <ftoastr.h>.
5670 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5671 Prefer snprintf to strncpy.
5672 * nsterm.m (ns_term_init):
5673 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5674 * nsterm.m (ns_term_init):
5675 Avoid the need for strncpy, by using build_string or
5676 make_unibyte_string directly. Use dtoastr, not snprintf.
5677 * process.c (Fmake_network_process): Diagnose service names that
5678 are too long, rather than silently truncating them or creating
5679 non-null-terminated names.
5680 (Fnetwork_interface_info): Likewise, for interface names.
5681 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5682 Prefer sprintf to strncat.
5683 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5684 Prefer vsnprintf to vsprintf + strncpy.
5686 2012-07-10 Glenn Morris <rgm@gnu.org>
5688 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5689 Clarify fallback case.
5691 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5693 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5694 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5695 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5696 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5697 where argument type is known to be a Lisp_Cons.
5699 2012-07-10 Tom Tromey <tromey@redhat.com>
5701 * bytecode.c (BYTE_CODE_THREADED): New macro.
5702 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5703 (enum byte_code_op): New type.
5704 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5705 (exec_byte_code): Use them. Use token threading when applicable.
5707 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5709 Optimize pure C strings initialization.
5710 * lisp.h (make_pure_string): Fix prototype.
5711 (build_pure_c_string): New function, defined as static inline. This
5712 provides a better opportunity to optimize away calls to strlen when
5713 the function is called with compile-time constant argument.
5714 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5715 argument, adjust users accordingly. Use build_pure_c_string where
5717 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5718 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5719 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5721 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5723 Avoid calls to strlen in miscellaneous functions.
5724 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5725 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5726 * lread.c (openp): Likewise.
5728 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5730 Avoid calls to strlen in path processing functions.
5731 * fileio.c (file_name_as_directory): Add comment. Change to add
5732 srclen argument and return the length of result. Adjust users
5734 (directory_file_name): Fix comment. Change to add srclen argument,
5735 swap 1st and 2nd arguments to obey the common convention.
5736 Adjust users accordingly.
5737 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5739 2012-07-10 Glenn Morris <rgm@gnu.org>
5741 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5742 Move PENDING_OUTPUT_COUNT definition to configure.
5744 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5745 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5746 * s/gnu.h (DATA_START): Move definitions to configure.
5748 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5749 We include usg5-4-common.h, which defines them both.
5751 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5752 O_RDONLY already includes it).
5754 Stop ns builds setting the EMACSLOADPATH environment variable.
5755 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5756 Now it does not set EMACSLOADPATH, just returns the load-path string.
5757 * nsterm.h: Update accordingly.
5758 * lread.c [HAVE_NS]: Include nsterm.h.
5759 (init_lread) [HAVE_NS]: Use ns_load_path.
5760 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5762 2012-07-09 Glenn Morris <rgm@gnu.org>
5764 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5765 since the included bsd-common.h does so.
5767 Stop ns builds setting the EMACSPATH environment variable.
5768 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5769 (ns_init_paths): Do not set EMACSPATH.
5770 * nsterm.h (ns_exec_path): Add it.
5771 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5774 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5776 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5778 * process.c (wait_reading_process_output): 'waitchannels' was unset
5779 when read_kbd || !NILP (wait_for_cell); fix this.
5781 Add GCC-style 'const' attribute to functions that can use it.
5782 * character.h (char_resolve_modifier_mask):
5783 * keyboard.h (make_ctrl_char):
5784 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5785 (init_character_once, next_almost_prime, init_fns, init_image)
5786 (flush_pending_output, init_sound):
5787 * mem-limits.h (start_of_data):
5788 * menu.h (finish_menu_items):
5789 Add ATTRIBUTE_CONST.
5790 * emacs.c (DEFINE_DUMMY_FUNCTION):
5791 Declare the dummy function with ATTRIBUTE_CONST.
5792 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5793 Add decls with ATTRIBUTE_CONST.
5795 Minor improvements to make_formatted_string.
5796 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5797 where int is good enough, as vsprintf returns an int.
5798 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5800 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5802 Use make_formatted_string to avoid double length calculation.
5803 * lisp.h (make_formatted_string): New prototype.
5804 * alloc.c (make_formatted_string): New function.
5805 * buffer.c (Fgenerate_new_buffer_name): Use it.
5806 * dbus.c (syms_of_dbusbind): Likewise.
5807 * editfns.c (Fcurrent_time_zone): Likewise.
5808 * filelock.c (get_boot_time): Likewise.
5809 * frame.c (make_terminal_frame, set_term_frame_name)
5810 (x_report_frame_params): Likewise.
5811 * image.c (gs_load): Likewise.
5812 * minibuf.c (get_minibuffer): Likewise.
5813 * msdos.c (dos_set_window_size): Likewise.
5814 * process.c (make_process): Likewise.
5815 * xdisp.c (ensure_echo_area_buffers): Likewise.
5816 * xsettings.c (apply_xft_settings): Likewise.
5818 2012-07-09 Glenn Morris <rgm@gnu.org>
5820 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5821 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5822 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5823 * nsterm.h (ns_etc_directory): Add it.
5824 * callproc.c [HAVE_NS]: Include nsterm.h.
5825 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5827 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5829 Move marker debugging code under MARKER_DEBUG.
5830 * marker.c (MARKER_DEBUG): Move marker debugging code under
5831 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5832 for bootstrap with --enable-checking (~3x slowdown reported
5833 by Juanma Barranquero <lekktu@gmail.com>).
5834 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5836 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5838 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5839 See <http://bugs.gnu.org/11825#29>.
5841 2012-07-08 Eli Zaretskii <eliz@gnu.org>
5843 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5844 has no font, use the frame's font. (Bug#11813)
5845 (display_line): Add commentary about displaying truncation glyphs
5847 (produce_special_glyphs): Move here from term.c.
5849 * term.c (produce_special_glyphs): Move to xdisp.c.
5851 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5854 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5856 * xdisp.c (display_line): Avoid warning about implicit declaration
5859 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5861 * lisp.h: Remove empty conditional.
5863 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5865 * lread.c (load_path_check): Now static.
5867 Fix some minor --with-ns problems found by static checking.
5868 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5869 (x_set_font) [!HAVE_X_WINDOWS]:
5870 * image.c (xpm_load_image) [HAVE_NS]:
5871 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5872 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5873 Remove unused local.
5874 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5875 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5876 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5877 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5878 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5879 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5880 Fix pointer signedness problem.
5881 * xfaces.c (FRAME_X_FONT_TABLE):
5882 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5884 2012-07-07 Glenn Morris <rgm@gnu.org>
5886 * lread.c (load_path_check): New function, split from init_lread.
5887 (init_lread): Reorganize. Motivation:
5888 If EMACSLOADPATH is set, check/warn about that rather than the
5889 defaults, which we are not going to use. Hence we can remove
5890 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5891 Don't warn if site-lisp directories are missing.
5892 If not installed, start from a blank load-path, since
5893 PATH_LOADSEARCH refers to the eventual installation directories.
5895 2012-07-07 Eli Zaretskii <eliz@gnu.org>
5897 Support truncation and continuation glyphs on GUI frames, when
5898 fringes are disabled. (Bug#11832)
5899 * xdisp.c (init_iterator): Get dimensions of truncation and
5900 continuation glyphs even if on GUI frames.
5901 Adjust it->last_visible_x on GUI frames when the left or right fringes,
5902 or both, are absent.
5903 (start_display, move_it_in_display_line_to): Handle the case of a
5904 GUI frame without a fringe to display continuation or truncation
5906 (insert_left_trunc_glyphs): Support GUI frames: make sure
5907 truncation glyphs overwrite enough glyphs from the current line to
5908 have sufficient space in pixels.
5909 (display_line): Support truncation and continuation glyphs on GUI
5910 frames. If some spare pixels are left on the line after inserting
5911 the truncation glyphs, fill that space with a stretch glyph of a
5912 suitably computed width.
5914 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5915 produce_glyphs, to support GUI sessions.
5917 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5919 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5921 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5923 Do not require float-time's arg to fit in time_t (Bug#11825).
5924 This works better on hosts where time_t is unsigned, and where
5925 float-time is applied to the (negative) difference between two times.
5926 * editfns.c (decode_time_components): Last arg is now double *,
5927 not int *, and means to store all the result as a double, without
5928 worrying about whether the seconds part fits in time_t.
5929 All callers changed.
5930 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5931 All callers changed.
5932 (Ffloat_time): Do not fail merely because the specified time falls
5933 outside of time_t range.
5935 2012-07-07 Glenn Morris <rgm@gnu.org>
5937 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5938 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5939 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5941 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
5943 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5944 Update dependencies.
5946 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5948 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5950 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5951 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5952 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5953 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5954 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5955 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5957 * xfont.c (compare_font_names): Redo to omit the need for casts.
5959 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5961 * xfns.c (Fx_change_window_property): Doc fix.
5962 * w32fns.c (Fx_change_window_property): Doc fix.
5964 * w32fns.c (Fx_window_property): Accept the same arguments as the
5965 X Windows version. Doc fix.
5966 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5968 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5969 Eli Zaretskii <eliz@gnu.org>
5971 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5972 Windows-specific code from nt/config.nt moved here.
5973 Obsolete settings removed.
5975 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5977 * process.c: Avoid unnecessary calls to gettime.
5978 (wait_reading_process_output): Don't get the time of day
5979 when gobbling data immediately and not waiting, as there's no need
5980 for it in that case. This removes a FIXME.
5982 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5984 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5985 is defined (Bug#11768).
5987 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5989 Fix marker debugging code.
5990 * marker.c (byte_char_debug_check): Do not perform the check
5991 if buffer is not multibyte.
5992 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5993 Call byte_char_debug_check with correct arguments.
5995 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5997 Compile marker debugging code only if ENABLE_CHECKING is defined.
5998 * marker.c (byte_char_debug_check, count_markers):
5999 Use only if ENABLE_CHECKING is defined.
6000 (byte_debug_flag): Remove.
6001 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6002 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6004 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6006 Avoid code repetition in marker-related functions.
6007 * marker.c (attach_marker): New function.
6008 (Fset_marker, set_marker_restricted, set_marker_both)
6009 (set_marker_restricted_both): Use it.
6010 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6011 Consistently rename charno to charpos.
6012 (marker_position): Add eassert.
6013 (marker_byte_position): Convert to eassert.
6015 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6017 Simplify list operations in unchain_overlay and unchain_marker.
6018 * buffer.c (unchain_overlay): Simplify. Add comment.
6019 * marker.c (unchain_marker): Simplify. Fix comments.
6021 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6023 Introduce fast path for the widely used marker operation.
6024 * alloc.c (build_marker): New function.
6025 * lisp.h (build_marker): New prototype.
6026 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6027 * composite.c (autocmp_chars): Likewise.
6028 * editfns.c (buildmark): Remove.
6029 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6030 (save_restriction_save): Use build_marker.
6031 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6032 * window.c (save_window_save): Likewise.
6034 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6036 Do not use Fdelete_overlay in delete_all_overlays
6037 to avoid redundant calls to unchain_overlay.
6038 * buffer.c (drop_overlay): New function.
6039 (delete_all_overlays, Fdelete_overlay): Use it.
6040 * minibuf.c (get_minibuffer): Fix comment.
6042 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6044 Port to OpenBSD 5.1 amd64.
6045 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6046 This is needed for OpenBSD, and should be harmless on all BSD systems.
6047 Also, include <sys/sysctl.h>, as it should be available on all
6048 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6049 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6050 use p_pid member, not kp_proc.pid.
6052 2012-07-06 Glenn Morris <rgm@gnu.org>
6054 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6056 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6058 More xmalloc and related cleanup.
6059 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6060 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6061 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6062 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6063 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6064 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6065 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6066 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6067 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6069 Omit needless casts involving void * pointers and allocation.
6070 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6071 as the former is more robust if P's type is changed.
6072 Prefer xzalloc to xmalloc + memset 0.
6073 Simplify malloc-or-realloc to realloc.
6074 Don't worry about xmalloc returning a null pointer.
6075 Prefer xstrdup to xmalloc + strcpy.
6076 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6078 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6079 alloca of a constant.
6081 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6083 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6084 hscroll is larger than the line width. Fixes long and futile
6085 looping inside extend_face_to_end_of_line (on a TTY) producing
6086 glyphs that are not needed and thrown away.
6088 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6090 * marker.c (set_marker_restricted_both): Simplify by using
6093 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6095 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6097 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6099 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6100 not defined (Bug#11768).
6101 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6102 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6103 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6104 followed by gtk_box_set_homogeneous (Bug#11768).
6105 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6106 (update_theme_scrollbar_width, xg_create_scroll_bar):
6107 Use gtk_scrollbar_new (Bug#11768).
6108 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6109 (is_box_type): New function (Bug#11768).
6110 (xg_tool_item_stale_p): Call is_box_type.
6111 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6112 with default display (Bug#11768).
6114 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6116 * xdisp.c (window_hscroll_limited): New function.
6117 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6118 coordinates when window's hscroll is set to insanely large
6121 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6123 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6124 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6126 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6129 * lisp.h (xzalloc): New prototype. Omit needless casts.
6130 * alloc.c (xzalloc): New function. Omit needless casts.
6131 * charset.c: Omit needless casts. Convert all calls to
6132 xmalloc with following memset to xzalloc.
6133 * dispnew.c: Likewise.
6134 * fringe.c: Likewise.
6135 * image.c: Likewise.
6136 * sound.c: Likewise.
6138 * w32fns.c: Likewise.
6139 * w32font.c: Likewise.
6140 * w32term.c: Likewise.
6141 * xfaces.c: Likewise.
6143 * xterm.c: Likewise.
6144 * atimer.c: Omit needless casts.
6145 * buffer.c: Likewise.
6146 * callproc.c: Likewise.
6148 * coding.c: Likewise.
6149 * composite.c: Likewise.
6151 * doprnt.c: Likewise.
6152 * editfns.c: Likewise.
6153 * emacs.c: Likewise.
6155 * filelock.c: Likewise.
6157 * gtkutil.c: Likewise.
6158 * keyboard.c: Likewise.
6160 * lread.c: Likewise.
6161 * minibuf.c: Likewise.
6162 * msdos.c: Likewise.
6163 * print.c: Likewise.
6164 * process.c: Likewise.
6165 * region-cache.c: Likewise.
6166 * search.c: Likewise.
6167 * sysdep.c: Likewise.
6168 * termcap.c: Likewise.
6169 * terminal.c: Likewise.
6170 * tparam.c: Likewise.
6171 * w16select.c: Likewise.
6173 * w32reg.c: Likewise.
6174 * w32select.c: Likewise.
6175 * w32uniscribe.c: Likewise.
6176 * widget.c: Likewise.
6177 * xdisp.c: Likewise.
6178 * xmenu.c: Likewise.
6180 * xselect.c: Likewise.
6182 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6184 * fileio.c (time_error_value): Check the right error number.
6185 Problem reported by Troels Nielsen in
6186 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6188 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6190 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6191 This should be fixed in a better way; see Eli Zaretskii in
6192 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6193 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6195 * fileio.c (time_error_value): Rename from special_mtime.
6196 The old name's problems were noted by Eli Zaretskii in
6197 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6199 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6200 This variable's comment says Emacs needs at least one GDB-visible
6201 symbol of type enum pvec_type, to work around GDB problems.
6202 The symbol's value doesn't matter.
6204 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6205 that causes compilation to fail on pre-C99 compilers.
6207 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6209 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6210 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6212 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6214 * buffer.c (init_buffer_once): Fix initialization of
6215 headers for buffer_defaults and buffer_local_symbols.
6216 Reported by Juanma Barranquero <lekktu@gmail.com>.
6218 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6220 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6221 * lisp.h (enum pvec_type): Use fewer bits.
6222 (PSEUDOVECTOR_SIZE_BITS): New constant.
6223 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6224 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6225 change in pvec_type.
6226 (PSEUDOVECTOR_TYPEP): New macro.
6227 (TYPED_PSEUDOVECTORP): Use it.
6228 * fns.c (internal_equal): Adapt code to extract pvectype.
6229 * emacs.c (gdb_pvec_type): Update type.
6230 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6231 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6232 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6233 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6234 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6235 abusing vector->header.next.nbytes.
6236 (live_vector_p): Use PVEC_TYPE.
6237 (mark_object): Adapt code to extract pvectype. Use switch.
6239 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6241 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6242 Tighten new eassert a bit.
6244 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6246 Fix compilation with --enable-gcc-warnings and -O1
6248 * doprnt.c (doprnt): Change type of tem to int, initialize
6249 to avoid compiler warning. Add eassert.
6250 * search.c (simple_search): Initialize match_byte to avoid
6251 compiler warning. Add eassert.
6253 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6255 Avoid weird behavior with large horizontal scrolls.
6256 Without this change, for example, large hscroll values would
6257 mess up Emacs's display on Fedora 15 x86, presumably due to
6258 overflows in int calculations in the display code.
6259 Also, if buffers had long lines, Emacs would freeze.
6260 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6261 (set_window_hscroll): New function, containing the old guts of
6262 Fset_window_hscroll. Return the clipped value.
6263 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6264 This avoids the need to check against PTRDIFF_MAX.
6266 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6268 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6270 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6272 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6274 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6275 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6276 since GCC 4.4.6 issues a bogus warning for them.
6278 Fix bugs in file timestamp newness comparisons.
6279 * fileio.c (Ffile_newer_than_file_p):
6280 * lread.c (Fload): Use full timestamp resolution of files,
6281 not just the 1-second resolution, so that files that are only
6282 slightly newer still count as newer.
6283 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6284 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6286 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6288 * fileio.c: Improve handling of file time marker. (Bug#11852)
6289 (special_mtime): New function.
6290 (Finsert_file_contents, Fverify_visited_file_modtime):
6291 Use it to set special mtime values consistently.
6293 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6295 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6296 marker for non-existing file. (Bug#11852)
6298 2012-07-03 Glenn Morris <rgm@gnu.org>
6300 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6301 and did not make it into globals.h).
6303 2012-07-03 Tom Tromey <tromey@redhat.com>
6305 * window.c (Fset_window_margins, Fset_window_fringes)
6306 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6307 * textprop.c (Fprevious_property_change): No longer static.
6308 * syntax.c (Fsyntax_table_p): No longer static.
6309 * process.c (Fget_process, Fprocess_datagram_address): No longer
6311 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6312 * keyboard.c (Fcommand_execute): No longer static.
6314 * insdel.c (Fcombine_after_change_execute): No longer static.
6315 * image.c (Finit_image_library): No longer static.
6316 * fileio.c (Fmake_symbolic_link): No longer static.
6317 * eval.c (Ffetch_bytecode): No longer static.
6318 * editfns.c (Fuser_full_name): No longer static.
6319 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6321 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6323 * dired.c (Ffile_attributes): No longer static.
6324 * composite.c (Fcomposition_get_gstring): No longer static.
6325 * callproc.c (Fgetenv_internal): No longer static.
6327 * ccl.h: Remove EXFUNs.
6328 * buffer.h: Remove EXFUNs.
6329 * dispextern.h: Remove EXFUNs.
6330 * intervals.h: Remove EXFUNs.
6331 * fontset.h: Remove EXFUN.
6332 * font.h: Remove EXFUNs.
6333 * dosfns.c (system_process_attributes): Remove EXFUN.
6334 * keymap.h: Remove EXFUNs.
6335 * lisp.h: Remove EXFUNs.
6336 * w32term.h: Remove EXFUNs.
6337 * window.h: Remove EXFUNs.
6338 * xsettings.h: Remove EXFUN.
6339 * xterm.h: Remove EXFUN.
6341 2012-07-03 Glenn Morris <rgm@gnu.org>
6343 * lisp.h (Frandom): Make it visible to C.
6344 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6345 buffer for invisible buffers. (Bug#1229)
6347 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6349 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6350 values which aren't power of 2.
6351 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6352 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
6355 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6357 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6359 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6361 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6363 * alloc.c (allocate_vector_block): Remove redundant
6364 calls to mallopt if DOUG_LEA_MALLOC is defined.
6365 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6366 avoid calls to mallopt if zero_vector is returned.
6368 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6370 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6371 is enabled, avoid dereferencing NULL current_sblock if
6374 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6376 Cleanup basic buffer management.
6377 * buffer.h (struct buffer): Change layout to use generic vector
6378 marking code. Fix some comments. Change type of 'clip_changed'
6379 to bitfield. Remove unused #ifndef old.
6380 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6381 (GET_OVERLAYS_AT): Fix indentation.
6382 (for_each_per_buffer_object_at): New macro.
6383 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6384 (Fbuffer_local_variables): Use it.
6385 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6386 * alloc.c (allocate_buffer): Adjust to match new layout of
6387 struct buffer. Fix comment.
6388 (mark_overlay): New function.
6389 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6390 Lisp area of struct buffer.
6391 (mark_object): Use it. Adjust marking of misc objects
6392 and related comments.
6394 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6396 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6397 wrapper that is not needed because the wrapped code is a no-op (zero
6398 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6399 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6401 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6403 * alloc.c (mark_buffer): Simplify. Remove prototype.
6404 (mark_object): Add comment. Reorganize marking of vector-like
6405 objects. Use CHECK_LIVE for all vector-like objects except buffers
6406 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6407 Avoid redundant calls to mark_vectorlike for bool vectors.
6409 2012-06-30 Glenn Morris <rgm@gnu.org>
6411 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6413 * epaths.in (PATH_SITELOADSEARCH): New.
6414 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6415 This is rather than relying on --enable-locallisppath elements
6416 having "site-lisp" in their names. (Bug#10208#25, 11658)
6418 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6420 * w32proc.c (sys_select): Accept and ignore one more argument.
6422 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6424 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6425 (pselect) [!MS_DOS]: Redirect to sys_select.
6427 * sysdep.c: Don't include dos.h and dosfns.h.
6429 * process.c (sys_select):
6430 * msdos.c (sys_select): Accept one more argument and ignore it.
6432 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6433 adapt data types and code to that.
6436 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6437 which clashes with the gnulib function of the same name.
6439 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6441 * font.c (font_style_to_value, font_style_symbolic)
6442 (font_prop_validate_style): Add type checks for values in
6445 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6447 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6450 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6452 * xdisp.c (try_window_id): Undo last change.
6454 * w32.c (getwd): Adjust commentary about startup_dir.
6455 (init_environment): Always call sys_access, even in non-MSVC
6456 builds. Don't chdir to the directory of the Emacs executable.
6457 This undoes code from 1997 which was justified by the need to
6458 "avoid conflicts when removing and renaming directories". But its
6459 downside was that every relative file name was being interpreted
6460 relative to the directory of the Emacs executable, which can never
6461 be TRT. In particular, it broke sys_access when called with
6462 relative file names.
6463 (sys_access): Map GetLastError to errno.
6465 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6467 * window.h (struct window): Change type of 'fringes_outside_margins'
6468 to bitfield. Fix comment. Adjust users accordingly.
6469 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6471 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6474 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6476 * gnutls.c (emacs_gnutls_handshake):
6477 Add QUIT to make the loop interruptible.
6479 2012-06-29 Glenn Morris <rgm@gnu.org>
6481 * charset.c (init_charset): Make lack of etc/charsets fatal.
6483 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6485 * editfns.c (region_limit): Fix type mismatch.
6487 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6489 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6490 undefined. Convert from xassert to eassert.
6491 * nsmenu.m: Convert from xassert to eassert.
6492 * nsterm.m: Likewise.
6494 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6496 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6498 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6500 Avoid integer overflow on scroll-left and scroll-right.
6501 * window.c (HSCROLL_MAX): New macro.
6502 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6503 overflow when requested scroll falls outside ptrdiff_t range.
6505 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6507 * window.h (struct window): Change type of 'hscroll',
6508 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6509 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6510 Adjust users accordingly.
6511 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6512 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6513 from EMACS_INT to ptrdiff_t.
6514 (make_window): Omit redundant initialization.
6516 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
6518 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6520 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6522 * window.h (struct window): Change type of 'use_time' and
6523 'sequence_number' from Lisp_Object to int.
6524 * frame.c (make_frame): Adjust users accordingly.
6525 * print.c (print_object): Likewise.
6526 * window.c (select_window, Fwindow_use_time, make_parent_window)
6527 (make_window): Likewise.
6529 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6531 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6532 enabled with --enable-checking=[all,glyphs] configure option.
6533 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6534 adjust comments accordingly.
6535 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6536 undefined, adjust comments accordingly.
6537 * image.c: Likewise.
6538 * scroll.c: Likewise.
6539 * w32fns.c: Likewise.
6540 * w32term.c: Likewise.
6541 * xdisp.c: Likewise.
6542 * xfaces.c: Likewise.
6544 * xterm.c: Likewise.
6546 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6548 Generalize run-time debugging checks.
6549 * dispextern.h (XASSERTS): Remove.
6550 * fontset.c (xassert): Remove.
6551 Convert from xassert to eassert.
6552 * alloc.c: Convert from xassert to eassert.
6554 * dispnew.c: Likewise.
6556 * fringe.c: Likewise.
6557 * ftfont.c: Likewise.
6558 * gtkutil.c: Likewise.
6559 * image.c: Likewise.
6560 * keyboard.c: Likewise.
6562 * process.c: Likewise.
6563 * scroll.c: Likewise.
6564 * sound.c: Likewise.
6566 * w32console.c: Likewise.
6567 * w32fns.c: Likewise.
6568 * w32term.c: Likewise.
6569 * window.c: Likewise.
6570 * xdisp.c: Likewise.
6571 * xfaces.c: Likewise.
6573 * xselect.c: Likewise.
6574 * xterm.c: Likewise.
6576 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6578 * fns.c (maybe_resize_hash_table): Output message when growing the
6581 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6583 * alloc.c (allocate_string_data): Remove dead code.
6584 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6585 avoid GCC warning about unused macro.
6587 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6589 * alloc.c (allocate_string): Omit intervals initialization.
6590 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6591 as in make_pure_string and make_pure_c_string.
6593 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6595 * alloc.c (allocate_string): Fix last change.
6597 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6599 * alloc.c (allocate_string): Remove two redundant calls
6600 to memset, add explicit initialization where appropriate.
6602 2012-06-27 Glenn Morris <rgm@gnu.org>
6604 * lisp.mk (lisp): Remove paths.elc.
6606 2012-06-27 Chong Yidong <cyd@gnu.org>
6608 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6610 2012-06-26 John Wiegley <johnw@newartisans.com>
6612 * unexmacosx.c (copy_data_segment): Add two section names used
6613 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6615 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6616 when building with Clang.
6618 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6620 * eval.c (Fapply): Allow calling it with a single argument.
6622 2012-06-26 Eli Zaretskii <eliz@gnu.org>
6624 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6625 _stricmp and _strnicmp.
6626 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6628 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6630 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6632 (allocate_process): Likewise for new process.
6633 (allocate_terminal): Change to use offsetof.
6634 (allocate_frame): Likewise.
6635 * frame.c (make_frame): Omit redundant initialization.
6636 * window.c (make_parent_window): Use memset.
6637 (make_window): Omit redundant initialization.
6638 * process.c (make_process): Omit redundant initialization.
6639 * terminal.c (create_terminal): Likewise.
6641 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6643 * term.c (delete_tty): Remove redundant call to memset.
6645 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6647 * alloc.c: Remove build_string.
6648 * lisp.h: Define build_string as static inline. This provides
6649 a better opportunity to optimize away calls to strlen when the
6650 function is called with compile-time constant argument.
6651 * image.c (imagemagick_error): Convert to build_string.
6652 * w32proc.c (sys_spawnve): Likewise.
6653 * xterm.c (x_term_init): Likewise.
6655 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6657 Use sprintf return value instead of invoking strlen on result.
6658 In the old days this wasn't portable, since some sprintf
6659 implementations returned char *. But they died out years ago and
6660 Emacs already assumes sprintf returns int.
6661 Similarly for float_to_string.
6662 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6663 * ccl.c (ccl_driver):
6664 * character.c (string_escape_byte8):
6665 * data.c (Fnumber_to_string):
6666 * doprnt.c (doprnt):
6667 * print.c (print_object):
6668 * xdisp.c (message_dolog):
6669 * xfns.c (syms_of_xfns):
6670 Use sprintf or float_to_string result to avoid need to call strlen.
6671 * data.c (Fnumber_to_string):
6672 Use make_unibyte_string, since the string must be ASCII.
6673 * lisp.h, print.c (float_to_string): Now returns int length.
6674 * term.c (produce_glyphless_glyph):
6675 Use sprintf result rather than recomputing it.
6677 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6678 * Makefile.in (ALL_CFLAGS):
6679 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6680 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6682 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6684 * dispextern.h (xstrcasecmp): Define to library function
6685 strcasecmp if available.
6686 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6688 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6690 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6691 Avoid comma operator.
6692 * menu.c (push_submenu_start, push_submenu_end)
6693 (push_left_right_boundary, push_menu_pane): Likewise.
6694 * msdos.c (dos_rawgetc): Likewise.
6696 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6698 * xfns.c (xic_create_fontsetname): Remove redundant calls
6701 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6703 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6704 sprintf already null-terminates its output.
6706 * xfns.c (x_window): Remove redundant cast.
6708 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6710 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6711 `const char *' to `char *' to avoid compiler warning.
6713 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6715 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6716 instead of truncating it to 63 (admittedly a generous limit).
6718 * process.c: Fix spelling and caps in comments.
6720 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6722 * emacs.c (setpgrp): Remove definition, unused.
6723 * sysdep.c (setpgrp): Remove definition, not used in this file.
6725 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
6727 * makefile.w32-in: Update dependencies.
6729 2012-06-24 Eli Zaretskii <eliz@gnu.org>
6731 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6732 (SYSTIME_H): Add nt/inc/sys/time.h.
6734 * systime.h [WINDOWSNT]: Include sys/time.h.
6736 * s/ms-w32.h (struct timespec): Definition moved from
6737 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6739 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6741 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6742 * buffer.h (buffer_slot_type_mismatch):
6743 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6744 * eval.c (unwind_to_catch):
6745 * image.c (my_png_error, my_error_exit):
6746 * keyboard.c (quit_throw_to_read_char, user_error)
6747 (Fexit_recursive_edit, Fabort_recursive_edit):
6748 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6749 (wrong_type_argument, buffer_overflow, __executable_start)
6750 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6751 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6752 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6754 (child_setup) [!DOS_NT]:
6755 * lread.c (end_of_file_error, invalid_syntax):
6756 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6757 * puresize.h (pure_write_error):
6758 * search.c (matcher_overflow):
6759 * sound.c (sound_perror, alsa_sound_perror):
6760 * sysdep.c, syssignal.h (croak):
6761 * term.c (maybe_fatal, vfatal):
6762 * textprop.c (text_read_only):
6763 * undo.c (user_error):
6764 * unexmacosx.c (unexec_error):
6765 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6766 Use _Noreturn rather than NO_RETURN.
6767 No need for separate decl merely because of _Noreturn.
6768 * sound.c (sound_warning, parse_sound):
6769 Remove unnecessary forward decls.
6771 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6773 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6774 * lisp.h (WAIT_READING_MAX): New macro.
6775 * dispnew.c (Fsleep_for, sit_for):
6776 * keyboard.c (kbd_buffer_get_event):
6777 * process.c (Faccept_process_output):
6778 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6779 This improves on the previous patch, which introduced a bug
6780 when time_t is unsigned and as wide as intmax_t.
6781 See <http://bugs.gnu.org/9000#51>.
6783 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6785 * dispnew.c (sit_for, Fsleep_for):
6786 * keyboard.c (kbd_buffer_get_event):
6787 * process.c (Faccept_process_output): Avoid compiler warnings when
6788 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6790 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
6792 * makefile.w32-in: Update dependencies.
6794 * w32.c (ltime): Add return type and declare static.
6795 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6797 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6799 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6800 Privately reported by Herbert J. Skuhra.
6801 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6803 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6804 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6806 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6808 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6809 last argument of make_unibyte_string.
6811 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6812 language ID in the event parameters.
6814 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6815 event.code, not the obscure "character set ID".
6817 2012-06-23 Chong Yidong <cyd@gnu.org>
6819 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6821 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6823 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6824 * w32.c (fdutimens): New function.
6826 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6828 * s/ms-w32.h (pselect): Redirect to sys_select.
6830 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6832 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6833 in the logic of incrementing and decrementing the value of
6834 use_relocatable_buffers.
6836 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6838 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6839 Privately reported by Herbert J. Skuhra.
6840 [__FreeBSD__]: Remove "*/" typo after "#include".
6841 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6842 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6843 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6844 Don't assume EMACS_TIME and struct timeval are the same type.
6846 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6848 Support higher-resolution time stamps (Bug#9000).
6849 The time stamps are only nanosecond-resolution at the C level,
6850 since that's the best that any real-world system supports now.
6851 But they are picosecond-resolution at the Lisp level, as that's
6852 easy, and leaves room for future OS improvements.
6854 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6857 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6858 Don't get current time unless it's needed.
6860 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6861 now provides it if it's absent.
6862 (start_atimer): Port to higher-res time stamps.
6863 Check for time stamp overflow. Don't get current time more
6864 often than is needed.
6866 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6867 Include systime.h, not time.h.
6868 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6870 * dired.c: Include stat-time.h.
6871 (Ffile-attributes): File times now have higher resolution.
6873 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6874 (struct image): Timestamp now has higher resolution.
6876 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6877 has at least microseconds now. All uses removed.
6878 (update_frame, update_single_window, update_window, update_frame_1)
6879 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
6880 (duration_to_sec_usec): Remove; no longer needed.
6882 * editfns.c (time_overflow): Now extern.
6883 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6884 (float-time, Fformat_time_string, Fcurrent_time_string)
6885 (Fcurrent_time_zone): Accept and generate higher-resolution
6887 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6888 (decode_time_components, lisp_seconds_argument): New functions.
6889 (make_time): Now static.
6890 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6891 Report an error if the time is invalid, rather than having the caller
6894 * fileio.c: Include <stat-time.h>
6895 (Fcopy_file): Copy higher-resolution time stamps.
6896 Prefer to set the time stamp via a file descriptor if that works.
6897 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6898 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6899 (Fvisited_file_modtime, Fset_visited_file_modtime):
6900 Support higher-resolution time stamps.
6902 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6904 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6906 * image.c (prepare_image_for_display, clear_image_cache)
6907 (lookup_image): Port to higer-resolution time stamps.
6909 * keyboard.c (start_polling, bind_polling_period):
6910 Check for time stamp overflow.
6911 (read_char, kbd_buffer_get_event, timer_start_idle)
6912 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6913 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6914 Port to higher-resolution time stamps. Do not assume time_t is signed.
6915 (decode_timer): New function. Timers are now vectors of length 9,
6916 not 8, to accommodate the picosecond component.
6917 (timer_check_2): Use it.
6919 * nsterm.m (select_timeout, timeval_subtract): Remove.
6920 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6921 as they're a bit more accurate and handle overflow better.
6922 (ns_select): Change prototype to be compatible with pselect.
6923 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6924 * nsterm.h (ns_select): Adjust prototype.
6926 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6927 us-resolution time stamps.
6928 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6930 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6932 * lisp.h (time_overflow): New decl.
6933 (wait_reading_process_output): First arg is now intmax_t, not int,
6934 to accommodate larger waits.
6936 * process.h (struct Lisp_Process.read_output_delay):
6937 Now counts nanoseconds, not microseconds.
6938 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6940 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6941 (wait_reading_process_output):
6942 Port to ns-resolution time stamps.
6943 (Faccept_process_output, wait_reading_process_output):
6944 Check for time stamp overflow. Do not assume time_t is signed.
6945 (select_wrapper): Remove; we now use pselect.
6946 (Fprocess_attributes): Now generates ns-resolution time stamps.
6948 * sysdep.c: Include utimens.h. Don't include utime.h
6949 or worry about struct utimbuf; gnulib does that for us now.
6950 (gettimeofday): Remove; gnulib provides a substitute.
6951 (make_timeval): New function.
6952 (set_file_times): Now sets ns-resolution time stamps.
6953 New arg FD; all uses changed.
6954 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6955 (system_process_attributes):
6956 Now returns ns-resolution time stamp. All uses changed.
6957 Check for time stamp overflow.
6959 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6960 provides a substitute now.
6962 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6963 since it guarantees struct timespec.
6964 (EMACS_TIME): Now struct timespec, so that we can support
6965 ns-resolution time stamps.
6966 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6967 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6968 (EMACS_USECS): Remove.
6969 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6970 so multiply the arg by 1000 before storing it.
6971 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6973 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6974 Port to ns-resolution time stamps.
6975 (EMACS_TIME_NEG_P): Remove; replaced by....
6976 (EMACS_TIME_SIGN): New macro.
6977 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6978 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6979 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6980 (make_timeval, make_lisp_time, decode_time_components): New decls.
6981 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6982 that it mishandled time_t overflow. You can't compare by subtracting!
6983 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6984 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6986 * term.c: Include <sys/time.h>.
6987 (timeval_to_Time): New function, for proper overflow wraparound.
6988 (term_mouse_position, term_mouse_click): Use it.
6990 * undo.c (record_first_change): Support higher-resolution time stamps
6992 (Fprimitive_undo): Use them when restoring time stamps.
6994 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6995 (w32_get_internal_run_time):
6996 Port to higher-resolution Emacs time stamps.
6997 (ltime): Now accepts single 64-bit integer, as that's more convenient
7000 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7002 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7003 for compatibility with pselect. Support ns-resolution time stamps.
7005 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7007 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7008 Check for time stamp overflow, and support ns-resolution time stamps.
7010 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7011 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7012 (timeval_subtract): Remove; no longer needed.
7013 (XTflash, XTring_bell, x_wait_for_event):
7014 Port to ns-resolution time stamps. Don't assume time_t is signed.
7016 2012-06-22 Chong Yidong <cyd@gnu.org>
7018 * xdisp.c (x_consider_frame_title): Revert last change.
7020 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7022 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7023 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7024 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7025 staticidx goes up to 1597 out of 1600 = 0x640.)
7027 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7029 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7030 Otherwise, the umask might be mistakenly 0 while handling input signals.
7032 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7034 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7036 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7038 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7039 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7040 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7041 access to `contents' member of Lisp_Vector objects with AREF and ASET
7044 2012-06-19 Chong Yidong <cyd@gnu.org>
7046 * frame.c (delete_frame): When selecting a frame on a different
7047 text terminal, do not alter the terminal's top-frame.
7049 * xdisp.c (format_mode_line_unwind_data): Record the target
7050 frame's selected window and its terminal's top-frame.
7051 (unwind_format_mode_line): Restore them.
7052 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7054 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7055 since tty frames can be explicitly named.
7056 (prepare_menu_bars): Likewise.
7058 * term.c (Ftty_top_frame): New function.
7060 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7062 Port byte-code-meter to modern targets.
7063 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7064 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7065 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7066 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7067 (METER_1, METER_2): Simplify.
7069 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7071 * data.c (Fdefalias): Return `symbol' (bug#11686).
7073 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7075 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7076 gets killed during executing of this function (Bug#11665).
7077 Try to always return Qt when the buffer has been actually killed.
7078 (Vkill_buffer_query_functions): In doc-string say that functions
7079 run by this hook should not change the current buffer.
7081 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7083 Fix recently-introduced process.c problems found by static checking.
7084 * process.c (write_queue_push, write_queue_pop, send_process):
7085 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7086 (write_queue_pop): Fix pointer signedness problem.
7087 (send_process): Remove unused local.
7089 2012-06-17 Chong Yidong <cyd@gnu.org>
7091 * xdisp.c (redisplay_internal): No need to redisplay terminal
7092 frames that are not on top.
7094 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7096 * process.c (make_process): Initialize write_queue.
7097 (write_queue_push, write_queue_pop): New functions.
7098 (send_process): Use them to maintain correct ordering of process
7101 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7103 * lisp.h (eassert): Assume C89 or later.
7104 This removes the need for CHECK.
7105 (CHECK): Remove. Its comments about always evaluating its
7106 argument were confusing, as 'eassert' typically does not evaluate
7109 * coding.c (produce_chars): Use ptrdiff_t, not int.
7111 * xterm.c (x_draw_underwave): Check for integer overflow.
7112 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7114 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7116 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7117 referenced (Bug#11583).
7119 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7121 Implement wave-style variant of underlining.
7122 * dispextern.h (face_underline_type): New enum.
7123 (face): Add field for underline type.
7124 * nsterm.m (ns_draw_underwave): New function.
7125 (ns_draw_text_decoration): Use it.
7126 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7128 (x_draw_glyph_string): Use them.
7129 * xfaces.c (Qline, Qwave): New Lisp objects.
7130 (check_lface_attrs, merge_face_ref)
7131 (Finternal_set_lisp_face_attribute, realize_x_face):
7132 Handle wave-style underline face attributes.
7133 * xterm.c (x_draw_underwave): New function.
7134 (x_draw_glyph_string): Use it.
7136 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7138 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7139 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7140 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7141 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7142 ($(BLD)/w32select.$(O)): Update dependencies.
7144 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7146 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7147 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7148 * character.c (_fetch_multibyte_char_p): Remove.
7149 * alloc.c: Include "character.h" before "buffer.h".
7151 * buffer.c: Likewise.
7152 * bytecode.c: Likewise.
7153 * callint.c: Likewise.
7154 * callproc.c: Likewise.
7155 * casefiddle.c: Likewise.
7156 * casetab.c: Likewise.
7157 * category.c: Likewise.
7159 * coding.c: Likewise.
7160 * composite.c: Likewise.
7161 * dired.c: Likewise.
7162 * dispnew.c: Likewise.
7164 * dosfns.c: Likewise.
7165 * editfns.c: Likewise.
7166 * emacs.c: Likewise.
7167 * fileio.c: Likewise.
7168 * filelock.c: Likewise.
7170 * fontset.c: Likewise.
7171 * fringe.c: Likewise.
7172 * indent.c: Likewise.
7173 * insdel.c: Likewise.
7174 * intervals.c: Likewise.
7175 * keyboard.c: Likewise.
7176 * keymap.c: Likewise.
7177 * lread.c: Likewise.
7178 * macros.c: Likewise.
7179 * marker.c: Likewise.
7180 * minibuf.c: Likewise.
7181 * nsfns.m: Likewise.
7182 * nsmenu.m: Likewise.
7183 * print.c: Likewise.
7184 * process.c: Likewise.
7185 * regex.c: Likewise.
7186 * region-cache.c: Likewise.
7187 * search.c: Likewise.
7188 * syntax.c: Likewise.
7190 * textprop.c: Likewise.
7192 * unexsol.c: Likewise.
7193 * w16select.c: Likewise.
7194 * w32fns.c: Likewise.
7195 * w32menu.c: Likewise.
7196 * window.c: Likewise.
7197 * xdisp.c: Likewise.
7199 * xmenu.c: Likewise.
7201 * xselect.c: Likewise.
7203 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7205 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7206 If all the glyphs of the glyph row came from strings, and we have no
7207 cursor positioning clues, put the cursor on the first glyph of the
7209 (handle_face_prop): Use chunk-relative overlay string index when
7210 indexing into it->string_overlays array. (Bug#11653)
7211 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7212 the rightmost. (Bug#11720)
7214 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7216 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7217 (CATEGORY_MEMBER): Enforce 1/0 value.
7218 * category.c (_temp_category_set): Remove.
7220 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7222 * window.c (Fdelete_other_windows_internal)
7223 (Fdelete_window_internal): Don't access frame's mouse highlight
7224 info of the initial frame. (Bug#11677)
7226 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7228 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7229 Assume USE_2_TAGS_FOR_INTS.
7230 (xreload): Adjust $tagmask width to match recent lisp.h change.
7232 Simplify lisp.h in minor ways that should not affect code.
7233 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7234 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7235 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7236 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7237 (INTTYPEBITS): New macro, for clarity.
7238 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7239 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7240 Simplify now that USE_LSB_TAG is always defined.
7241 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7242 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7244 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7246 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7248 2012-06-13 Glenn Morris <rgm@gnu.org>
7250 * s/bsd-common.h (BSD4_3):
7251 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7253 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7255 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7258 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7260 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7261 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7262 * alloc.c (widen_to_Lisp_Object): Remove.
7263 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7264 * frame.c (delete_frame): Remove outdated comment.
7265 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7266 USE_LISP_UNION_TYPE.
7267 (Fw32_unregister_hot_key): Likewise.
7268 (Fw32_toggle_lock_key): Likewise.
7269 * w32menu.c (add_menu_item): Likewise.
7270 (w32_menu_display_help): Use XIL instead of checking
7271 USE_LISP_UNION_TYPE.
7272 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7273 (init_heap): Likewise.
7274 * w32term.c (w32_read_socket): Update comment.
7276 2012-06-13 Glenn Morris <rgm@gnu.org>
7278 * s/usg5-4-common.h, src/s/unixware.h:
7279 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7281 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7283 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7285 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7286 * alloc.c (make_number) [!defined make_number]:
7287 Remove, as lisp.h always defines this now.
7288 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7289 (roundup_size): Verify that it is a power of 2.
7290 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7291 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7292 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7293 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7294 USE_LSB_TAG now is always defined to be either 0 or 1.
7296 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7297 code works fine either way, and efficiency is not a concern here,
7298 as the union type is for debugging, not for production.
7299 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7300 Use an inline function on all platforms when using the union type,
7301 since this is simpler and 'static inline' can be used portably
7303 (LISP_INITIALLY_ZERO): New macro.
7304 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7305 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7307 2012-06-12 Glenn Morris <rgm@gnu.org>
7309 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7311 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7313 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7314 Move BROKEN_SIGIO to configure.
7316 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7317 Move NO_TERMIO to configure.
7319 2012-06-12 Chong Yidong <cyd@gnu.org>
7321 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7322 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7323 MagickExportImagePixels is undefined.
7325 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7327 * image.c (imagemagick_load_image): Remove unused label.
7329 2012-06-11 Glenn Morris <rgm@gnu.org>
7331 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7332 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7333 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7334 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7336 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7338 * alloc.c (make_byte_code): New function.
7339 (Fmake_byte_code): Use it. Don't purify here.
7340 * lread.c (read1): Use it as well to avoid extra allocation.
7342 2012-06-11 Chong Yidong <cyd@gnu.org>
7344 * image.c (imagemagick_load_image): Implement transparency.
7346 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7348 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7349 account for preceding backslashes. (Bug#11663)
7351 2012-06-09 Chong Yidong <cyd@gnu.org>
7353 * term.c: Support italics in capable terminals (Bug#9652).
7354 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7355 (turn_on_face): Output using TS_enter_italic_mode if available.
7356 Don't handle unused blinking and alt-charset cases.
7357 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7358 and tty_alt_charset_p cases.
7359 (tty_capable_p, init_tty): Support italics.
7361 * termchar.h (struct tty_display_info): Add field for italics.
7362 Remove unused blink field.
7364 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7367 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7368 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7369 tty_alt_charset_p. Add tty_italic_p.
7371 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7373 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7374 dbus_type_is_basic if available.
7375 (xd_extract_signed, xd_extract_unsigned): Rename from
7376 extract_signed and extract_unsigned, respectively. Adapt callers.
7378 2012-06-09 Chong Yidong <cyd@gnu.org>
7380 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7382 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7385 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7387 * xdisp.c (vmessage): Treat frame message as multibyte.
7388 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7389 would generate the diagnostic "Making \302\247 buffer-local while
7392 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7394 * dispnew.c (showing_window_margins_p): Undo last change, which
7395 was done due to an inadvertent commit.
7396 (adjust_frame_glyphs_for_frame_redisplay): Do call
7397 showing_window_margins_p.
7399 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7401 * eval.c (Fmake_var_non_special): New primitive.
7402 (syms_of_eval): Defsubr it.
7403 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7405 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7407 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7408 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7410 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7412 * alloc.c (allocate_vectorlike): Fix last change.
7414 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7416 Block-based vector allocation of small vectors.
7417 * lisp.h (struct vectorlike_header): New field `nbytes',
7418 adjust comment accordingly.
7419 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7420 to denote vector blocks. Adjust users (live_vector_p,
7421 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7422 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7423 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7424 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7425 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7426 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7427 (roundup_size): New constant.
7428 (struct vector_block): New data type.
7429 (vector_blocks, vector_free_lists, zero_vector): New variables.
7430 (all_vectors): Rename to `large_vectors'.
7431 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7432 (sweep_vectors): New functions.
7433 (allocate_vectorlike): Return `zero_vector' as the only vector of
7434 0 items. Allocate new vector from block if vector size is less than
7435 or equal to VBLOCK_BYTES_MAX.
7436 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7437 (init_alloc_once): Add call to init_vectors.
7439 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7441 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7443 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7445 * doprnt.c (doprnt): Truncate multibyte char correctly.
7446 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7447 would mishandle a string argument "Xc" if X was a multibyte
7448 character of length 2: it would truncate after X's first byte
7449 rather than including all of X.
7451 2012-06-06 Chong Yidong <cyd@gnu.org>
7453 * buffer.c (word_wrap): Doc fix.
7455 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7457 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7459 2012-06-03 Glenn Morris <rgm@gnu.org>
7461 * xdisp.c (tool-bar-style): Doc fix.
7463 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7465 * Makefile.in (PAXCTL): Define.
7466 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7467 binary via PaX flags if the paxctl utility is available.
7468 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7469 Restore PaX flags to their default. (Bug#11398)
7471 2012-06-03 Chong Yidong <cyd@gnu.org>
7473 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7476 2012-06-03 Chong Yidong <cyd@gnu.org>
7478 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7479 (note_mode_line_or_margin_highlight): If there is no help echo,
7480 use mode-line-default-help-echo. Handle the case where the mouse
7481 position is past the end of the mode line string.
7483 * buffer.c (buffer_local_value_1): New function, split from
7484 Fbuffer_local_value; can return Qunbound.
7485 (Fbuffer_local_value): Use it.
7486 (Vmode_line_format): Docstring tweaks.
7488 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7490 * sysdep.c (system_process_attributes): Improve comment.
7492 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7494 * keyboard.c: Export real-this-command to Elisp.
7495 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7496 and DEFVAR it. Update all users.
7498 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7500 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7502 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7503 Convert pctcpu and pctmem to Lisp float properly.
7504 Let the compiler fold better, as 100.0/0x8000 is exact.
7506 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7508 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7511 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7513 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7515 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7517 For a 'struct window', replace some Lisp_Object fields to
7518 bitfields where appropriate, remove unused fields.
7519 * window.h (struct window): Remove unused 'last_mark_x' and
7520 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7521 change it's type from Lisp_Object to bitfield.
7522 Change type of 'force_start', 'optional_new_start',
7523 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7524 fields from Lisp_Object to bitfield. Adjust users accordingly.
7526 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7528 Pacify gcc -Wdouble-precision when using Xaw.
7529 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7530 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7531 Use 'float' consistently, rather than 'float' in most places
7532 and 'double' in a couple of places.
7534 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7536 * xdisp.c (handle_stop): Detect whether we have overlay strings
7537 loaded by testing it->current.overlay_string_index to be
7538 non-negative, instead of checking whether n_overlay_strings is
7539 positive. (Bug#11587)
7541 2012-05-31 Chong Yidong <cyd@gnu.org>
7543 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7545 * doc.c (Fsubstitute_command_keys): Doc fix.
7547 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7549 * search.c (search_buffer): Remove calls to
7550 r_alloc_inhibit_buffer_relocation, as it is now called by
7551 maybe_unify_char, which was the cause of relocation of buffer text
7554 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7556 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7557 for the duration of call to load_charset, to avoid problems with
7558 callers of maybe_unify_char that access buffer text through C
7561 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7562 decrement the inhibition flag, instead of just setting or
7565 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7567 Remove obsolete '#define static' cruft.
7568 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7569 This #undef was "temporary" in 2000; it is no longer needed
7570 now that '#define static' has gone away.
7571 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7572 (gray_bitmap_bits): Remove; no longer needed.
7573 All uses replaced with definiens.
7574 * xterm.c: Include "bitmaps/gray.xbm".
7576 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7578 Clean up __executable_start, monstartup when --enable-profiling.
7579 The following changes affect the code only when profiling.
7580 * dispnew.c (__executable_start): Rename from safe_bcopy.
7581 Define only on platforms that need it.
7582 * emacs.c: Include <sys/gmon.h> when profiling.
7583 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7584 (__executable_start): Remove decl, since lisp.h does it now.
7585 (safe_bcopy): Remove decl; no longer has that name.
7586 (main): Coalesce #if into single bit of code, for simplicity.
7587 Cast pointers to uintptr_t, since standard libraries want integers
7589 * lisp.h (__executable_start): New decl.
7591 2012-05-31 Glenn Morris <rgm@gnu.org>
7593 * image.c (Fimagemagick_types): Doc fix.
7595 2012-05-30 Jim Meyering <meyering@redhat.com>
7597 * callproc.c (Fcall_process_region): Include directory component
7598 in mkstemp error message (Bug#11586).
7600 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7602 * alloc.c, lisp.h (make_pure_vector): Now static.
7604 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7606 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7607 Move to byte-run.el.
7608 (Fautoload): Do the hash-doc more carefully.
7609 * data.c (Fdefalias): Purify definition, except for keymaps.
7610 (Qdefun): Move from eval.c.
7611 * lisp.h (Qdefun): Remove.
7612 * lread.c (read1): Tiny simplification.
7614 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
7616 Do not create empty overlays with the evaporate property (Bug#9642).
7617 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7618 Bug#9642, but explicitly check that the buffer the overlay would
7619 be moved to is live and rearrange lines to make sure that errors
7620 will not put the overlay in an inconsistent state.
7621 (Fdelete_overlay): Cosmetics.
7623 2012-05-28 Eli Zaretskii <eliz@gnu.org>
7625 * w32term.c (my_bring_window_to_top): New function.
7626 (x_raise_frame): Use handle returned by DeferWindowPos, which
7627 could be different from the original one.
7628 Call my_bring_window_to_top instead of my_set_foreground_window.
7631 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7632 by calling BringWindowToTop.
7634 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7635 (WM_EMACS_END): Increase by one.
7637 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7639 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7640 This avoids undefined behavior that might cause the eassert
7641 to not catch an out-of-range value.
7643 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
7645 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7646 Update dependencies.
7648 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7650 * bidi.c (bidi_mirror_char): Fix last change.
7652 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7654 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7655 when referring to sectname field in printf format.
7657 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7659 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7660 Only r_alloc_inhibit_buffer_relocation needed to be added;
7661 the others were already declared.
7663 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7664 before checking whether it's out of range. Put the check inside
7666 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7668 2012-05-27 Ken Brown <kbrown@cornell.edu>
7670 * callproc.c (Fcall_process): Restore a line that was accidentally
7671 commented out in the 2011-02-13 change (bug#11547).
7673 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7675 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7676 defined on ralloc.c.
7678 * buffer.c [REL_ALLOC]: Remove prototypes of
7679 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7680 they are now on lisp.h.
7682 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7684 * search.c (search_buffer): Use it to inhibit relocation of buffer
7685 text while re_search_2 is doing its job, because re_search_2 is
7686 passed C pointers to buffer text. (Bug#11519)
7688 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7691 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7692 state after an additional call to move_it_in_display_line_to, keep
7693 the values of it->max_ascent and it->max_descent found for the
7695 (pos_visible_p): Revert the comparison against bottom_y to what it
7696 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7699 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7701 Fix coding-related core dumps with gcc -ftrapv.
7702 The code was computing A - B, where A and B are pointers, and B is
7703 random garbage. This can lead to core dumps on platforms that
7704 have special pointer registers, and it also leads to core dumps on
7705 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7706 A - B only when B is initialized properly.
7707 * coding.c (coding_set_source, coding_set_destination): Return void.
7708 (coding_change_source, coding_change_destinations): New functions,
7709 with the old behaviors of coding_set_source and coding_set_destination.
7710 All callers that need an offset changed to use these new functions.
7712 2012-05-26 Glenn Morris <rgm@gnu.org>
7714 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7716 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7718 Extend mouse support on W32 text-mode console.
7719 * xdisp.c (draw_row_with_mouse_face):
7720 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7722 * w32console.c: Include window.h.
7723 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7725 (initialize_w32_display): Initialize mouse-highlight data.
7727 * w32inevt.c: Include termchar.h and window.h.
7728 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7729 moves, call note_mouse_highlight. If help_echo changed, call
7730 gen_help_event to produce help-echo message in the echo area.
7731 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7734 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7736 * lread.c (read1): Simplify slightly to avoid an overflow warning
7737 with GCC 4.7.0 on x86-64.
7739 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7741 * bidi.c (bidi_mirror_char): Revert last change: an int is
7742 definitely wide enough here.
7744 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
7746 Fix integer width and related bugs (Bug#9874).
7747 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7748 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7749 (string_bytes, check_sblock, allocate_string_data):
7750 (compact_small_strings, Fmake_bool_vector, make_string)
7751 (make_unibyte_string, make_multibyte_string)
7752 (make_string_from_bytes, make_specified_string)
7753 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7754 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7756 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7757 (allocate_pseudovector):
7758 Use int, not EMACS_INT, where int is wide enough.
7759 (inhibit_garbage_collection, Fgarbage_collect):
7760 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7761 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7762 int might not be wide enough.
7763 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7764 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7765 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7766 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7767 (bidi_level_of_next_char, bidi_move_to_visually_next):
7768 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7769 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7770 (Fkill_buffer, Fset_buffer_major_mode)
7771 (advance_to_char_boundary, Fbuffer_swap_text)
7772 (Fset_buffer_multibyte, overlays_at, overlays_in)
7773 (overlay_touches_p, struct sortvec, record_overlay_string)
7774 (overlay_strings, recenter_overlay_lists)
7775 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7776 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7777 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7778 (Foverlay_recenter, last_overlay_modification_hooks_used)
7779 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7780 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7781 (validate_region): Omit unnecessary test for b <= e,
7782 since that's guaranteed by the previous test.
7783 (adjust_overlays_for_delete): Avoid pos + length overflow.
7784 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7785 (report_overlay_modification):
7786 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7787 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7788 Omit pointer cast, which isn't needed anyway, and doesn't work
7789 after the EMACS_INT -> ptrdiff_t change.
7790 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7791 * buffer.h: Adjust decls to match defn changes elsewhere.
7792 (struct buffer_text, struct buffer):
7793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7794 Use EMACS_INT, not int, where int might not be wide enough.
7795 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7796 not int, to avoid needless 32-bit limit on 64-bit hosts.
7797 (exec_byte_code): Use tighter memory-full test, one that checks
7798 for alloca overflow. Don't compute the address of the object just
7799 before an array, as that's not portable. Use EMACS_INT, not
7800 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7801 * callint.c (Fcall_interactively):
7802 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7803 * callproc.c (call_process_kill, Fcall_process):
7804 Don't assume pid_t fits into an Emacs fixnum.
7805 (call_process_cleanup, Fcall_process, child_setup):
7806 Don't assume pid_t fits into int.
7807 (call_process_cleanup, Fcall_process, delete_temp_file)
7808 (Fcall_process_region):
7809 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7810 (Fcall_process): Simplify handling of volatile integers.
7811 Use int, not EMACS_INT, where int will do.
7812 * casefiddle.c (casify_object, casify_region, operate_on_word)
7813 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7815 (casify_object): Avoid integer overflow when overallocating buffer.
7816 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7817 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
7818 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7819 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7820 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7821 integers are now checked earlier. All uses replaced with XINT.
7823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7824 For CCL_MapSingle, check that content and value are in int range.
7825 (ccl_driver, Fregister_code_conversion_map):
7826 Check that Vcode_version_map_vector is a vector.
7827 (resolve_symbol_ccl_program): Check that vector header is in range.
7828 Always copy the vector, so that we can check its contents reliably
7829 now rather than having to recheck each instruction as it's being
7830 executed. Check that vector words fit in 'int'.
7831 (ccl_get_compiled_code, Fregister_ccl_program)
7832 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7833 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7834 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7835 contents are in range.
7836 (Fccl_execute_on_string): Check that status is in range.
7837 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7838 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7839 Accept and return EMACS_INT, not int, because callers can pass values
7841 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7842 (multibyte_chars_in_text, parse_str_as_multibyte)
7843 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7844 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7845 (string_escape_byte8, Fget_byte):
7846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7847 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7848 avoid mishandling large integers.
7849 * character.h: Adjust decls to match defn changes elsewhere.
7850 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7851 (Ffind_charset_region):
7852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7853 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7854 (load_charset_map_from_vector, Fdefine_charset_internal):
7855 Don't assume fixnum fits in int.
7856 (load_charset_map_from_vector, Fmap_charset_chars):
7857 Remove now-unnecessary CHECK_NATNUMs.
7858 (Fdefine_charset_internal): Check ranges here, more carefully.
7859 Don't rely on undefined behavior with signed left shift overflow.
7860 Don't assume unsigned int fits into fixnum, or that fixnum fits
7861 into unsigned int. Don't require max_code to be a valid fixnum;
7862 that's not true for gb10830 4-byte on a 32-bit host. Allow
7863 invalid_code to be a cons, for the same reason. Require code_offset
7864 to be a character. Avoid int overflow if max_char is close
7866 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7867 this is intended anyway and avoids some undefined behavior.
7868 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7869 INDEX_TO_CODE_POINT, as that's what it expects.
7870 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
7871 * charset.h (DECODE_CHAR): Return int, not unsigned;
7872 this is what was intended anyway, and it avoids undefined behavior.
7873 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7874 integer-overflow issues.
7875 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7876 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7877 where the argument is EMACS_INT, and this behavior is not intended.
7878 * chartab.c (Fmake_char_table, Fset_char_table_range)
7879 (uniprop_get_decoder, uniprop_get_encoder):
7880 Don't assume fixnum fits in int.
7881 * cmds.c (move_point): New function, that does the gist of
7882 Fforward_char and Fbackward_char, but does so while checking
7883 for integer overflow more accurately.
7884 (Fforward_char, Fbackward_char): Use it.
7885 (Fforward_line, Fend_of_line, internal_self_insert)
7886 (internal_self_insert):
7887 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7888 Fix a FIXME, by checking for integer overflow when calculating
7889 target_clm and actual_clm.
7890 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
7891 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
7892 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7893 (coding_alloc_by_making_gap, alloc_destination)
7894 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7895 (encode_coding_utf_16, detect_coding_emacs_mule)
7896 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7897 (detect_coding_iso_2022, decode_coding_iso_2022)
7898 (encode_invocation_designation, encode_designation_at_bol)
7899 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7900 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7901 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7902 (encode_coding_ccl, encode_coding_raw_text)
7903 (detect_coding_charset, decode_coding_charset)
7904 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7905 (produce_composition, produce_charset, produce_annotation)
7906 (decode_coding, handle_composition_annotation)
7907 (handle_charset_annotation, consume_chars, decode_coding_gap)
7908 (decode_coding_object, encode_coding_object, detect_coding_system)
7909 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7910 (code_convert_region, code_convert_string)
7911 (Fdefine_coding_system_internal)
7912 (coding_set_source, coding_set_destination):
7913 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7914 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7915 (Fdefine_coding_system_internal):
7916 Don't assume fixnums fit in int.
7917 (decode_coding_gap, decode_coding_object, encode_coding_object)
7918 (Fread_coding_system, Fdetect_coding_region)
7919 (Funencodable_char_position, Fcheck_coding_systems_region)
7920 (get_translation, handle_composition_annotation, consume_chars):
7921 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7922 (consume_chars): Rewrite to not calculate an address outside buffer.
7923 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7924 Don't access memory outside of the args array.
7925 (Fdefine_coding_system_internal): Check for charset-id overflow.
7926 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7927 result of ENCODE_CHAR.
7928 * coding.h: Adjust decls to match defn changes elsewhere.
7929 (struct coding_system):
7930 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7931 * composite.c (get_composition_id, find_composition)
7932 (run_composition_function, update_compositions)
7933 (compose_text, composition_gstring_put_cache)
7934 (composition_gstring_p, composition_gstring_width)
7935 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7936 (composition_compute_stop_pos, composition_reseat_it)
7937 (composition_update_it, struct position_record)
7938 (find_automatic_composition, composition_adjust_point)
7939 (Fcomposition_get_gstring, Ffind_composition_internal):
7940 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7941 (update_compositions):
7942 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7943 * composite.h: Adjust decls to match defn changes elsewhere.
7944 (struct composition):
7945 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7946 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7947 Do not attempt to compute the address of the object just before a
7948 buffer; this is not portable.
7950 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7951 (Faset): Use int, not EMACS_INT, where int is wide enough.
7952 (Fstring_to_number): Don't assume fixnums fit in int.
7953 (Frem): Don't assume arg is nonnegative.
7954 * dbusbind.c (xd_append_arg): Check for integers out of range.
7955 (Fdbus_call_method): Don't overflow the timeout int.
7956 (extract_signed, extract_unsigned): New functions.
7957 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7958 (xd_get_connection_references): Return ptrdiff_t, not int.
7960 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7961 (xd_read_message_1):
7962 Use int, not unsigned, where the dbus API uses int.
7963 (Fdbus_message_internal): Don't overflow mtype.
7964 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7965 * dired.c (directory_files_internal, file_name_completion, scmp)
7966 (file_name_completion_stat):
7967 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7968 (file_name_completion): Don't overflow matchcount.
7969 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7970 * dispextern.h: Adjust decls to match defn changes elsewhere.
7971 (struct text_pos, struct glyph, struct bidi_saved_info)
7972 (struct bidi_string_data, struct bidi_it, struct composition_it)
7974 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7975 (struct display_pos, struct composition_it, struct it):
7976 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7977 * dispnew.c (increment_matrix_positions)
7978 (increment_row_positions, mode_line_string)
7979 (marginal_area_string):
7980 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7981 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7982 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7983 (duration_to_sec_usec): New function, to check for overflow better.
7984 (Fsleep_for, sit_for): Use it.
7985 * doc.c (get_doc_string, store_function_docstring):
7986 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7987 (get_doc_string, Fsnarf_documentation):
7988 Use int, not EMACS_INT, where int is wide enough.
7990 Use SAFE_ALLOCA, not alloca.
7991 Check for overflow when converting EMACS_INT to off_t.
7992 * doprnt.c (doprnt):
7993 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7994 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7995 Don't assume uid_t fits into fixnum.
7996 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7997 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7998 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7999 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8000 (general_insert_function)
8001 (Finsert_char, make_buffer_string, make_buffer_string_both)
8002 (update_buffer_properties, Fbuffer_substring)
8003 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8004 (Fsubst_char_in_region, check_translation)
8005 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8006 (transpose_markers, Ftranspose_regions):
8007 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8008 (clip_to_bounds): Move to lisp.h as an inline function).
8009 (Fconstrain_to_field): Don't assume integers are nonnegative.
8010 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8011 (Fsubst_char_in_region, Fsave_restriction):
8012 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8013 (Femacs_pid): Don't assume pid_t fits into fixnum.
8014 (lo_time): Use int, not EMACS_INT, when int suffices.
8015 (lisp_time_argument): Check for usec out of range.
8016 (Fencode_time): Don't assume fixnum fits in int.
8017 (Fuser_login_name, Fuser_full_name): Signal an error
8018 if a uid argument is out of range, rather than relying on
8020 (Fformat_time_string): Remove now-unnecessary check.
8021 lisp_time_argument checks for out-of-range usec now.
8022 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8023 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8024 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8025 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8026 (init_cmdargs, Fdump_emacs):
8027 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8028 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8029 the bottom (typically) 32 bits of the fixnum.
8030 * eval.c (specpdl_size, call_debugger):
8031 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8032 (when_entered_debugger, Fbacktrace_debug):
8033 Don't assume fixnum can fit in int.
8034 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8035 the object just before a buffer; this is not portable.
8036 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8037 (grow_specpdl, unbind_to):
8038 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8039 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8040 (grow_specpdl): Simplify allocation by using xpalloc.
8041 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8042 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8043 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8044 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8045 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8047 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8048 (Fcopy_file, non_regular_nbytes, read_non_regular)
8049 (Finsert_file_contents):
8050 Use int, not EMACS_INT, where int is wide enough.
8051 (READ_BUF_SIZE): Verify that it fits in int.
8052 (Finsert_file_contents): Check that counts are in proper range,
8053 rather than assuming fixnums fit into ptrdiff_t etc.
8054 Don't assume fixnums fit into int.
8055 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8056 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8057 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8058 (string_char_to_byte, string_byte_to_char)
8059 (string_make_multibyte, string_to_multibyte)
8060 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8061 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8062 (substring_both, Fdelete, internal_equal, Ffillarray)
8063 (Fclear_string, mapcar1)
8064 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8065 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8066 (larger_vector, make_hash_table, maybe_resize_hash_table)
8067 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8068 (Fmaphash, secure_hash):
8069 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8070 (concat): Check for string index and length overflow.
8071 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8073 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8074 (larger_vector): New API (vec, incr_min, size_max) replaces old
8075 one (vec, new_size, init). This catches size overflow.
8076 INIT was removed because it was always Qnil.
8077 All callers changed.
8078 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8079 the upper bound on a hash table index size.
8080 (make_hash_table, maybe_resize_hash_table): Use it.
8081 (secure_hash): Computer start_byte and end_byte only after
8082 they're known to be in ptrdiff_t range.
8083 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8084 (Ffont_get_glyphs, Ffont_at):
8085 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8086 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8087 (Flist_fonts, Fopen_font):
8088 Don't assume fixnum can fit in int.
8089 (check_gstring): Don't assume index can fit in int.
8090 (font_match_p): Check that fixnum is a character, not a nonnegative
8091 fixnum, since the later code needs to stuff it into an int.
8092 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8093 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8094 conversion overflow issues.
8095 (Fopen_font): Check for integer out of range.
8096 (Ffont_get_glyphs): Don't assume index can fit in int.
8097 * font.h: Adjust decls to match defn changes elsewhere.
8098 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8100 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8101 printmax_t, where ptrdiff_t is wide enough.
8102 (Finternal_char_font):
8103 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8104 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8105 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8106 (Fset_frame_position, x_set_frame_parameters)
8107 (x_set_line_spacing, x_set_border_width)
8108 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8109 Check that fixnums are in proper range for system types.
8110 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8111 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8112 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8113 Use SAFE_ALLOCA_LISP, not alloca.
8114 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8115 intptr_t is wide enough.
8116 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8117 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8118 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8119 Check for fixnum out of range.
8120 * ftfont.c (ftfont_list): Don't assume index fits in int.
8121 Check that fixnums are in proper range for system types.
8122 (ftfont_shape_by_flt):
8123 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8124 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8125 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8126 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8127 Check that fixnums are in proper range for system types.
8128 * gnutls.h: Adjust decls to match defn changes elsewhere.
8129 * gtkutil.c (xg_dialog_run):
8130 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8131 (update_frame_tool_bar):
8132 Check that fixnums are in proper range for system types.
8133 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8134 (lookup_image): Check that fixnums are in range for system types.
8135 * indent.c (last_known_column, last_known_column_point):
8136 (current_column_bol_cache):
8137 (skip_invisible, current_column, check_display_width):
8138 (check_display_width, scan_for_column, current_column_1)
8139 (Findent_to, Fcurrent_indentation, position_indentation)
8140 (indented_beyond_p, Fmove_to_column, compute_motion):
8141 (Fcompute_motion, Fvertical_motion):
8142 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8143 (last_known_column_modified): Use EMACS_INT, not int.
8144 (check_display_width):
8146 Check that fixnums and floats are in proper range for system types.
8147 (compute_motion): Don't assume index or fixnum fits in int.
8148 (compute_motion, Fcompute_motion):
8149 Use int, not EMACS_INT, when it is wide enough.
8150 (vmotion): Omit local var start_hpos that is always 0; that way
8151 we don't need to worry about overflow in expressions involving it.
8152 * indent.h: Adjust decls to match defn changes elsewhere.
8154 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8155 Use int, not EMACS_INT, where int is wide enough.
8156 Remove unused members ovstring_chars_done and tab_offset;
8158 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8159 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8160 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8161 (make_gap, copy_text, insert, insert_and_inherit)
8162 (insert_before_markers, insert_before_markers_and_inherit)
8163 (insert_1, count_combining_before, count_combining_after)
8164 (insert_1_both, insert_from_string)
8165 (insert_from_string_before_markers, insert_from_string_1)
8166 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8167 (adjust_after_replace, adjust_after_insert, replace_range)
8168 (replace_range_2, del_range, del_range_1, del_range_byte)
8169 (del_range_both, del_range_2, modify_region)
8170 (prepare_to_modify_buffer, signal_before_change)
8171 (signal_after_change, Fcombine_after_change_execute):
8172 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8173 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8174 (balance_an_interval, split_interval_right, split_interval_left)
8175 (find_interval, next_interval, update_interval)
8176 (adjust_intervals_for_insertion, delete_node, delete_interval)
8177 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8178 (static_offset_intervals, offset_intervals)
8179 (merge_interval_right, merge_interval_left, make_new_interval)
8180 (graft_intervals_into_buffer, temp_set_point_both)
8181 (temp_set_point, set_point, adjust_for_invis_intang)
8182 (set_point_both, move_if_not_intangible, get_property_and_range)
8183 (get_local_map, copy_intervals, copy_intervals_to_string)
8184 (compare_string_intervals, set_intervals_multibyte_1):
8185 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8186 * intervals.h: Adjust decls to match defn changes elsewhere.
8188 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8189 * keyboard.c (this_command_key_count, this_single_command_key_start)
8190 (before_command_key_count, before_command_echo_length, echo_now)
8191 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8192 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8193 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8194 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8195 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8196 (last_non_minibuf_size, last_point_position, echo_truncate)
8197 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8198 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8199 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8200 (stuff_buffered_input):
8201 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8202 (last_auto_save, command_loop_1, read_char):
8203 Use EMACS_INT, not int, to avoid integer overflow.
8204 (record_char): Avoid overflow in total_keys computation.
8205 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8206 * keyboard.h: Adjust decls to match defn changes elsewhere.
8207 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8208 (Fkey_description, Fdescribe_vector, Flookup_key):
8209 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8210 (click_position): New function, to check that positions are in range.
8211 (Fcurrent_active_maps):
8213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8214 (Faccessible_keymaps, Fkey_description):
8215 (preferred_sequence_p):
8216 Don't assume fixnum can fit into int.
8217 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8218 Check for integer overflow in size calculations.
8219 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8220 avoid mishandling large integers.
8221 * lisp.h: Adjust decls to match defn changes elsewhere.
8222 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8223 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8224 (struct Lisp_Marker):
8225 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8226 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8227 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8228 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8229 All callers changed.
8230 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8231 Assume the arg has valid form, since it always does.
8232 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8233 unsigned integer system type.
8234 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8235 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8236 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8237 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8238 (duration_to_sec_usec): New decl.
8239 * lread.c (read_from_string_index, read_from_string_index_byte)
8240 (read_from_string_limit, readchar, unreadchar, openp)
8241 (read_internal_start, read1, oblookup):
8242 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8243 (Fload, readevalloop, Feval_buffer, Feval_region):
8244 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8245 (openp): Check for out-of-range argument to 'access'.
8246 (read1): Use int, not EMACS_INT, where int is wide enough.
8247 Don't assume fixnum fits into int.
8248 Fix off-by-one error that can read outside a buffer.
8249 (read_filtered_event): Use duration_to_sec_usec
8250 to do proper overflow checking on durations.
8251 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8252 in size calculation.
8253 (Fexecute_kbd_macro):
8254 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8255 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8256 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8257 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8258 (set_marker_both, set_marker_restricted_both, marker_position)
8259 (marker_byte_position, Fbuffer_has_markers_at):
8260 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8261 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8262 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8263 It now merely ensures that the menu is large enough, without
8264 necessarily growing it, as this avoids some integer overflow issues.
8265 All callers changed.
8266 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8267 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8268 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8269 Use SAFE_ALLOCA_LISP, not alloca.
8270 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8271 to EMACS_INT. Check that fixnums are in proper range for system types.
8272 * minibuf.c (minibuf_prompt_width, string_to_object)
8273 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8274 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8275 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8276 (get_minibuffer, read_minibuf_unwind):
8277 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8278 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8279 this simplifies overflow checking. All callers changed.
8280 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8282 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8283 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8284 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8285 Check that fixnums are in proper range for system types.
8286 (Fx_create_frame, Fx_show_tip):
8287 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8288 * nsfont.m (ns_findfonts, nsfont_list_family):
8289 Don't assume fixnum fits in long.
8290 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8291 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8292 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8294 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8295 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8296 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8297 (PRINTDECLARE, PRINTPREPARE):
8298 (strout, print_string):
8299 (print, print_preprocess, print_check_string_charset_prop)
8301 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8303 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8305 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8306 (printchar, strout): Use xpalloc to catch size calculation overflow.
8307 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8308 (print_error_message): Use SAFE_ALLOCA, not alloca.
8309 (print_object): Use int, not EMACS_INT, where int is wide enough.
8310 (print_depth, new_backquote_output, print_number_index):
8311 Use ptrdiff_t, not int, where int might not be wide enough.
8312 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8313 (Fset_process_window_size, Fformat_network_address)
8314 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8316 Check that fixnums are in proper range for system types.
8317 (Fsignal_process): Simplify by avoiding a goto.
8318 Check for process-ids out of pid_t range rather than relying on
8320 (process_tick, update_tick): Use EMACS_INT, not int.
8321 (Fformat_network_address, read_process_output, send_process)
8322 (Fprocess_send_region, status_notify):
8323 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8324 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8325 (wait_reading_process_output, read_process_output, exec_sentinel):
8326 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8327 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8328 (Faccept_process_output): Use duration_to_sec_usec to do proper
8329 overflow checking on durations.
8330 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8331 Don't assume pid_t fits in int.
8332 * process.h (struct Lisp_Process): Members tick and update_tick
8333 are now of type EMACS_INT, not int.
8334 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8335 configured --with-wide-int.
8336 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8337 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8338 * search.c (looking_at_1, string_match_1):
8339 (fast_string_match, fast_c_string_match_ignore_case)
8340 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8341 (scan_newline, find_before_next_newline, search_command)
8342 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8343 (set_search_regs, wordify):
8346 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8347 (string_match_1, search_buffer, set_search_regs):
8349 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8350 (wordify): Check for overflow in size calculation.
8351 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8352 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8353 Check that fixnums are in proper range for system types.
8354 * sound.c (struct sound_device)
8355 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8356 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8357 (Fplay_sound_internal):
8358 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8359 * syntax.c (struct lisp_parse_state, find_start_modiff)
8360 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8361 (Fparse_partial_sexp):
8362 Don't assume fixnums can fit in int.
8363 (struct lisp_parse_state, find_start_pos, find_start_value)
8364 (find_start_value_byte, find_start_begv)
8365 (update_syntax_table, char_quoted, dec_bytepos)
8366 (find_defun_start, prev_char_comend_first, back_comment):
8367 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8368 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8369 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8370 (Finternal_describe_syntax_value): Check that match_lisp is a
8371 character, not an integer, since the code stuffs it into int.
8372 (scan_words, scan_sexps_forward):
8373 Check that fixnums are in proper range for system types.
8375 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8376 (scan_sexps_forward):
8377 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8378 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8379 * syntax.h: Adjust decls to match defn changes elsewhere.
8380 (struct gl_state_s):
8381 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8382 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8383 MOST_POSITIVE_FIXNUM.
8384 * sysdep.c (wait_for_termination_1, wait_for_termination)
8385 (interruptible_wait_for_termination, mkdir):
8386 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8387 (emacs_read, emacs_write):
8388 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8389 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8390 and double all fit in int.
8391 * term.c (set_tty_color_mode):
8392 Check that fixnums are in proper range for system types.
8393 * termhooks.h (struct input_event):
8394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8395 * textprop.c (validate_interval_range, interval_of)
8396 (Fadd_text_properties, set_text_properties_1)
8397 (Fremove_text_properties, Fremove_list_of_text_properties)
8398 (Ftext_property_any, Ftext_property_not_all)
8399 (copy_text_properties, text_property_list, extend_property_ranges)
8400 (verify_interval_modification):
8401 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8402 (Fnext_single_char_property_change)
8403 (Fprevious_single_char_property_change):
8404 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8405 (copy_text_properties):
8406 Check for integer overflow in index calculation.
8407 * undo.c (last_boundary_position, record_point, record_insert)
8408 (record_delete, record_marker_adjustment, record_change)
8409 (record_property_change):
8410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8411 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8412 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8413 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8414 (Fx_hide_tip, Fx_file_dialog):
8415 * w32menu.c (set_frame_menubar):
8416 Use ptrdiff_t, not int, for consistency with rest of code.
8417 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8418 (select_window, Fdelete_other_windows_internal)
8419 (window_scroll_pixel_based, window_scroll_line_based)
8420 (Frecenter, Fset_window_configuration):
8421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8422 (Fset_window_hscroll, run_window_configuration_change_hook)
8423 (set_window_buffer, temp_output_buffer_show, scroll_command)
8424 (Fscroll_other_window, Frecenter):
8425 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8426 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8427 Don't assume fixnum fits in int.
8428 (Fset_window_scroll_bars):
8429 Check that fixnums are in proper range for system types.
8430 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8431 (string_pos, c_string_pos, number_of_chars, init_iterator)
8432 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8433 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8434 (compute_display_string_end, handle_face_prop)
8435 (face_before_or_after_it_pos, handle_invisible_prop)
8436 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8437 (display_prop_intangible_p, string_buffer_position_lim)
8438 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8439 (get_overlay_strings_1, get_overlay_strings)
8440 (iterate_out_of_display_property, forward_to_next_line_start)
8441 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8442 (get_next_display_element, set_iterator_to_next)
8443 (get_visually_first_element, compute_stop_pos_backwards)
8444 (handle_stop_backwards, next_element_from_buffer)
8445 (move_it_in_display_line_to, move_it_in_display_line)
8446 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8447 (add_to_log, message_dolog, message_log_check_duplicate)
8448 (message2, message2_nolog, message3, message3_nolog
8449 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8450 (current_message_1, truncate_echo_area, truncate_message_1)
8451 (set_message, set_message_1, store_mode_line_noprop)
8452 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8453 (text_outside_line_unchanged_p, check_point_in_composition)
8454 (reconsider_clip_changes)
8455 (redisplay_internal, set_cursor_from_row, try_scrolling)
8456 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8457 (redisplay_window, find_last_unchanged_at_beg_row)
8458 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8459 (trailing_whitespace_p, find_row_edges, display_line)
8460 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8461 (display_mode_element, store_mode_line_string)
8462 (pint2str, pint2hrstr, decode_mode_spec)
8463 (display_count_lines, display_string, draw_glyphs)
8464 (x_produce_glyphs, x_insert_glyphs)
8465 (rows_from_pos_range, mouse_face_from_buffer_pos)
8466 (fast_find_string_pos, mouse_face_from_string_pos)
8467 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8469 (safe_call, init_from_display_pos, handle_fontified_prop)
8470 (handle_single_display_spec, load_overlay_strings)
8471 (with_echo_area_buffer, setup_echo_area_for_printing)
8472 (display_echo_area, echo_area_display)
8473 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8474 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8475 (redisplay_window, dump_glyph_row, display_mode_line)
8476 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8477 (handle_display_spec, display_prop_string_p):
8478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8479 (handle_single_display_spec, build_desired_tool_bar_string)
8480 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8481 (get_specified_cursor_type):
8482 Check that fixnums are in proper range for system types.
8483 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8484 (Flookup_image_map):
8485 Don't assume fixnums fit in int.
8486 (compare_overlay_entries):
8487 Avoid mishandling comparisons due to subtraction overflow.
8488 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8489 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8490 (handle_tool_bar_click):
8491 Use int, not unsigned, since we prefer signed and the signedness
8492 doesn't matter here.
8493 (get_next_display_element, next_element_from_display_vector):
8494 Use int, not EMACS_INT, when int is wide enough.
8495 (start_hourglass): Use duration_to_sec_usec to do proper
8496 overflow checking on durations.
8497 * xfaces.c (Fbitmap_spec_p):
8498 Check that fixnums are in proper range for system types.
8499 (compare_fonts_by_sort_order):
8500 Avoid mishandling comparisons due to subtraction overflow.
8501 (Fx_family_fonts, realize_basic_faces):
8502 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8504 Don't assume fixnum fits in int.
8505 Use SAFE_ALLOCA_LISP, not alloca.
8506 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8507 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8508 (face_at_buffer_position, face_for_overlay_string)
8509 (face_at_string_position):
8510 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8511 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8512 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8514 Check that fixnums are in proper range for system types.
8515 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8516 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8517 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8518 (Fx_change_window_property): Don't assume fixnums fit in int.
8519 * xfont.c (xfont_chars_supported):
8520 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8521 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8522 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8523 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8524 * xml.c (parse_region):
8525 * xrdb.c (magic_file_p):
8526 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8527 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8528 (x_get_local_selection, x_reply_selection_request)
8529 (x_handle_selection_request, wait_for_property_change):
8530 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8531 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8532 short is wide enough.
8533 (x_send_client_event): Don't assume fixnum fits in int.
8534 * xterm.c (x_x_to_emacs_modifiers):
8535 Don't assume EMACS_INT overflows nicely into int.
8536 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8538 (handle_one_xevent): NATNUMP can eval its arg twice.
8539 (x_connection_closed):
8540 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8541 * xterm.h: Adjust decls to match defn changes elsewhere.
8542 (struct scroll_bar): Use struct vectorlike_header
8543 rather than rolling our own approximation.
8544 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8546 2012-05-25 Glenn Morris <rgm@gnu.org>
8548 * lisp.mk (lisp): Update for more files being compiled now.
8550 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8552 * lread.c: Remove `read_pure' which makes no difference.
8553 (read_pure): Remove var.
8554 (unreadpure): Remove function.
8555 (readevalloop): Don't call read_list with -1 flag.
8556 (read1, read_vector): Don't test read_pure any more.
8557 (read_list): Simplify.
8559 * fileio.c, character.h: Minor style tweaks.
8561 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8563 * window.h (clip_changed): Remove useless declaration.
8565 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8567 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8568 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8570 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8573 This directory predates autoconf and is no longer needed nowadays.
8574 Move its few remaining bits of functionality to where they're needed.
8575 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8576 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8577 * m/template.h: Remove.
8578 * Makefile.in (M_FILE): Remove. All uses removed.
8579 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8580 * lisp.h (USE_LSB_TAG):
8581 * mem-limits.h (EXCEEDS_LISP_PTR):
8582 Use VAL_MAX, not VALBITS, in #if.
8583 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8584 (EMACS_UINT): Define unconditionally now.
8585 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8586 (BITS_PER_EMACS_INT): New constants, replacing
8587 what used to be in config.h, but not useful in #if.
8588 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8589 define them any more.
8590 (VAL_MAX): New macro.
8592 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8593 BITS_PER_EMACS_INT, in #if.
8594 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8595 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8596 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8597 * s/ms-w32.h (DATA_START):
8598 Move here from removed file m/intel386.h.
8599 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8600 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8602 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8604 Assume C89 or later.
8605 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8606 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8608 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8609 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8610 * textprop.c, tparam.c (NULL): Remove.
8611 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8612 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8613 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8614 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8615 * xterm.c (input_signal_count): Assume volatile works.
8617 2012-05-21 Ken Brown <kbrown@cornell.edu>
8619 * xgselect.c (xg_select): Fix first argument in call to 'select'
8622 2012-05-20 Ken Brown <kbrown@cornell.edu>
8624 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8625 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8627 2012-05-19 Ken Brown <kbrown@cornell.edu>
8629 * xfns.c (x_in_use): Remove `static' qualifier.
8630 * xterm.h (x_in_use): Declare.
8631 * xgselect.c: Include xterm.h.
8632 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8633 and `display_arg' (bug#9754).
8635 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8637 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8639 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8640 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8642 2012-05-18 Eli Zaretskii <eliz@gnu.org>
8644 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8646 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8647 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8649 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8650 reference to image_cache->refcount.
8651 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8653 2012-05-17 Juri Linkov <juri@jurta.org>
8655 * search.c (Fword_search_regexp, Fword_search_backward)
8656 (Fword_search_forward, Fword_search_backward_lax)
8657 (Fword_search_forward_lax): Move functions to isearch.el
8658 (bug#10145, bug#11381).
8660 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8662 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8664 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8666 * lread.c (init_obarray): Declare Qt and Qnil as special.
8668 2012-05-14 Glenn Morris <rgm@gnu.org>
8670 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8671 Put "libexec" before "bin", for the sake of init_callproc_1.
8673 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8675 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8677 * unexaix.c: Port to more-recent AIX compilers.
8678 (report_error, report_error_1, make_hdr, copy_sym)
8679 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8680 Make arguments const char *, not char *, to avoid violations of C
8681 standard and to fix some AIX warnings reported by Gilles Pion.
8683 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8685 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8686 already have overlays loaded.
8687 (handle_single_display_spec): Before returning without displaying
8688 fringe bitmap, synchronize the bidi iterator with the main display
8689 iterator, by calling iterate_out_of_display_property.
8690 (iterate_out_of_display_property): Detect buffer iteration by
8691 testing that it->string is a Lisp string.
8692 (get_next_display_element): When the current object is exhausted,
8693 and there's something on it->stack, call set_iterator_to_next to
8694 proceed with what's on the stack, instead of returning zero.
8695 (set_iterator_to_next): If called at the end of a Lisp string,
8696 proceed to consider_string_end without incrementing string
8697 position. Don't increment display vector index past the end of
8698 the display vector. (Bug#11417)
8699 (pos_visible_p): Don't report a position visible when move_it_to
8700 stopped at the last line of window, which happens to be scanned
8701 backwards by the bidi iteration. (Bug#11464)
8703 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8705 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8706 and right-margin display specs even if the spec is invalid or we
8707 are on a TTY, and thus unable to display on the fringes.
8708 That's because the text with the property will not be displayed anyway,
8709 so we need to signal to the caller that this is a "replacing"
8710 display spec. This fixes display when the spec is invalid or we
8713 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8715 * unexaix.c (make_hdr): Fix typo in prototype.
8716 This bug broke the build on AIX. Problem reported by Gilles Pion.
8718 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
8720 * keyboard.c (kbd_buffer_get_event): Read special events also in
8721 batch mode. (Bug#11415)
8723 2012-05-12 Glenn Morris <rgm@gnu.org>
8725 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8727 2012-05-12 Eli Zaretskii <eliz@gnu.org>
8729 * lisp.mk (lisp): Add newcomment.elc.
8731 2012-05-12 Glenn Morris <rgm@gnu.org>
8733 * Makefile.in (MKDIR_P): New, set by configure.
8734 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8736 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8738 Remove unused function hourglass_started.
8739 * dispextern.h (hourglass_started):
8740 * w32fns.c (hourglass_started):
8741 * xdisp.c (hourglass_started): Remove.
8743 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
8745 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8746 Update dependencies.
8748 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8750 * xgselect.c (xg_select): Put maxfds+1 into a var.
8751 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8753 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8755 2012-05-10 Dave Abrahams <dave@boostpro.com>
8757 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8758 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8760 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
8762 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8763 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8764 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8765 Initialize xd_registered_buses.
8767 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8769 Untag more efficiently if USE_LSB_TAG.
8770 This is based on a proposal by YAMAMOTO Mitsuharu in
8771 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8772 For an admittedly artificial (nth 8000 longlist) benchmark on
8773 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8774 Emacs's overall text size by 1%.
8775 * lisp.h (XUNTAG): New macro.
8776 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8777 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8778 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8779 * eval.c (Fautoload):
8780 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8781 * frame.h (XFRAME): Use XUNTAG.
8783 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8784 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8785 Remove unportable assumptions about print widths of types like
8787 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8788 intptr_t when converting between pointer and integer, to avoid GCC
8789 warnings about wrong width.
8791 2012-05-09 Eli Zaretskii <eliz@gnu.org>
8793 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8794 stack for each reader_thread, instead of defaulting to 8MB
8795 determined by the linker. This avoids failures in creating
8796 subprocesses on Windows 7, see the discussion in this thread:
8797 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8799 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8801 Fix up display of the *Minibuf-0* buffer in the mini window.
8802 * keyboard.c (read_char): Don't clear the echo area if there's no
8804 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8805 contents of *Minibuf-0*) if there's no message displayed in its stead.
8807 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
8809 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8812 2012-05-06 Chong Yidong <cyd@gnu.org>
8814 * lisp.mk (lisp): Update.
8816 2012-05-05 Jim Meyering <meyering@redhat.com>
8818 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8820 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8822 * data.c (PUT_ERROR): New macro.
8823 (syms_of_data): Use it. Add new error type `user-error'.
8824 * undo.c (user_error): New function.
8825 (Fprimitive_undo): Use it.
8826 * print.c (print_error_message): Adjust print style for `user-error'.
8827 * keyboard.c (user_error): New function.
8828 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8830 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8832 Do not limit current-time-string to years 1000..9999.
8833 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8834 (Fcurrent_time_string): Support any year that is supported by the
8835 underlying localtime representation. Don't use asctime, as it
8836 has undefined behavior for years outside the range -999..9999.
8838 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8840 Fix race conditions involving setenv, gmtime, localtime, asctime.
8841 Without this fix, interrupts could mess up code that uses these
8842 nonreentrant functions, since setting TZ invalidates existing
8843 tm_zone or tzname values, and since most of these functions return
8844 pointers to static storage.
8845 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8846 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8847 Grow the critical sections to include not just invoking
8848 localtime/gmtime, but also accessing these functions' results
8849 including their tm_zone values if any, and any related TZ setting.
8850 (format_time_string): Last arg is now struct tm *, not struct tm **,
8851 so that the struct tm is saved in the critical section.
8852 All callers changed. Simplify allocation of initial buffer, partly
8853 motivated by the fact that memory allocation needs to be outside
8854 the critical section.
8856 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8858 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8859 with RESET_INTERVAL.
8861 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8862 Remove duplicated buffer name initialization.
8864 2012-05-02 Jim Meyering <jim@meyering.net>
8866 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8868 * xfns.c (x_window): Use xstrdup (Bug#11375).
8870 2012-05-02 Eli Zaretskii <eliz@gnu.org>
8872 * xdisp.c (pos_visible_p): If already at a newline from the
8873 display string before the 'while' loop, don't walk back the glyphs
8874 from it3.glyph_row. Solves assertion violation when the display
8875 string begins with a newline (egg.el). (Bug#11367)
8877 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8879 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8882 2012-05-01 Glenn Morris <rgm@gnu.org>
8884 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8885 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8886 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8887 All were removed before 23.1.
8889 * dispnew.c: Remove HAVE_LIBNCURSES test;
8890 it is always true on relevant platforms.
8892 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8893 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8895 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8897 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8899 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8900 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8903 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8905 Do not avoid creating empty evaporating overlays (Bug#9642).
8906 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8907 That is, do not delete an evaporating overlay if it becomes
8908 empty after its bounds are adjusted to fit within its buffer.
8909 This fix caused other problems, and I'm reverting it until we get
8910 to the bottom of them.
8912 2012-04-27 Chong Yidong <cyd@gnu.org>
8914 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8916 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8918 * xdisp.c (pos_visible_p): If the window start position is beyond
8919 ZV, start the display from buffer beginning. Prevents assertion
8920 violation in init_iterator when the minibuffer window is scrolled
8923 * window.c (window_scroll_pixel_based): Likewise.
8925 2012-04-27 Chong Yidong <cyd@gnu.org>
8927 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8929 2012-04-27 Glenn Morris <rgm@gnu.org>
8931 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8932 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8934 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8936 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8937 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
8939 2012-04-26 Eli Zaretskii <eliz@gnu.org>
8941 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8942 display element, check also the underlying string or buffer
8943 character. (Bug#11341)
8945 * w32menu.c: Include w32heap.h.
8946 (add_menu_item): If the call to AppendMenuW (via
8947 unicode_append_menu) fails, disable Unicode menus only if we are
8948 running on Windows 9X/Me.
8950 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8952 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8953 (xgetint): Add missing shift for LSB tags.
8955 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8957 * keyboard.c (read_char): Don't wipe echo area for select window
8958 events: These might get delayed via `mouse-autoselect-window'
8961 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8963 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8964 manipulation of :loaded-from data.
8966 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8968 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8969 now a cons (bug#11311).
8971 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8973 Do not create empty overlays with the evaporate property (Bug#9642).
8974 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8975 if it becomes empty after its bounds are adjusted to fit within
8976 its buffer. Without this fix, in a nonempty buffer (let ((o
8977 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8978 yields an empty overlay that has the evaporate property, which is
8979 not supposed to happen.
8981 Fix minor GTK3 problems found by static checking.
8982 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8983 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8984 (struct _EmacsFixedClass, emacs_fixed_get_type):
8985 Move decls here from emacsgtkfixed.h, since they needn't be public.
8986 (emacs_fixed_get_type): Now static.
8987 (emacs_fixed_class_init): Omit unused local.
8988 (emacs_fixed_child_type): Remove; unused.
8989 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8990 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8991 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8992 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8993 (EMACS_FIXED_GET_CLASS): Remove; unused.
8994 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8996 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8997 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8999 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9001 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9002 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9003 (__malloc_size_t, __malloc_ptrdiff_t):
9004 Remove. All uses removed, replaced by the definiens if needed,
9005 since we can assume C89 or better now.
9006 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9007 (protect_malloc_state, align, get_contiguous_space)
9008 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9009 (malloc_atfork_handler_child, malloc_enable_thread)
9010 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9011 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9012 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9013 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9014 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9015 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9016 Define using prototypes, not old style.
9017 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9018 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9019 (align): Don't assume that signed integer overflow wraps around.
9020 Omit unused local var.
9021 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9022 (_free_internal_nolock, memalign, mallochook, reallochook):
9023 Omit no-longer-needed casts.
9024 (valloc): Use getpagesize, not __getpagesize.
9025 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9026 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9028 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9030 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9032 Move functions from C to Lisp. Make non-blocking method calls
9033 the default. Implement further D-Bus standard interfaces.
9035 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9036 (QCdbus_request_name_allow_replacement)
9037 (QCdbus_request_name_replace_existing)
9038 (QCdbus_request_name_do_not_queue)
9039 (QCdbus_request_name_reply_primary_owner)
9040 (QCdbus_request_name_reply_in_queue)
9041 (QCdbus_request_name_reply_exists)
9042 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9043 (QCdbus_registered_serial, QCdbus_registered_method)
9044 (QCdbus_registered_signal): New Lisp objects.
9045 (XD_DEBUG_MESSAGE): Use sizeof.
9046 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9047 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9048 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9049 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9050 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9051 (xd_signature, xd_append_arg): Allow float for integer types.
9052 (xd_get_connection_references): New function.
9053 (xd_get_connection_address): Rename from xd_initialize.
9054 Return cached address.
9055 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9056 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9058 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9059 Return number of refcounts.
9060 (Fdbus_get_unique_name): Make stronger parameter check.
9061 (Fdbus_message_internal): New defun.
9062 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9063 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9064 (Fdbus_send_signal, Fdbus_register_service)
9065 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9066 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9067 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9068 (Vdbus_compiled_version, Vdbus_runtime_version)
9069 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9070 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9071 (Vdbus_message_type_signal): New defvars.
9072 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9075 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9077 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9078 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9079 Do not assume ptrdiff_t is the same width as 'int'.
9081 * alloc.c: Handle unusual debugging option combinations.
9082 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9083 since the two debugging options are incompatible.
9084 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9086 (mem_init, mem_insert, mem_insert_fixup):
9087 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9088 (NEED_MEM_INSERT): Remove; no longer needed.
9090 2012-04-22 Leo Liu <sdl.web@gmail.com>
9092 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9094 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9096 * sysdep.c [__FreeBSD__]: Minor cleanups.
9097 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9098 Use Emacs indenting style more consistently. Avoid some casts.
9099 Use 'double' consistently rather than mixing 'float' and 'double'.
9101 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9103 * sysdep.c (list_system_processes, system_process_attributes):
9104 Add implementation for FreeBSD (Bug#5243).
9106 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9108 * lisp.mk (lisp): Update.
9110 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9112 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9113 It is never used otherwise.
9115 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9117 * print.c (print_preprocess): Only check print_depth if print-circle
9119 (print_object): Check for cycles even when print-circle is nil and
9120 print-gensym is t, but only check print_depth if print-circle is nil.
9122 2012-04-20 Chong Yidong <cyd@gnu.org>
9124 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9125 set the status to "failed" and ensure that sentinel is run.
9127 2012-04-20 Glenn Morris <rgm@gnu.org>
9129 * process.c (Fset_process_inherit_coding_system_flag)
9130 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9131 (Fmake_network_process, Fmake_serial_process): Doc fix.
9133 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9135 * xdisp.c (string_buffer_position_lim): Limit starting position to
9137 (set_cursor_from_row): If called for a mode-line or header-line
9138 row, return zero immediately.
9139 (try_cursor_movement): If inside continuation line, don't back up
9140 farther than the first row after the header line, if any.
9141 Don't consider the header-line row as "partially visible", even if
9142 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9144 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9146 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9149 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9150 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9152 configure: new option --enable-gcc-warnings (Bug#11207)
9153 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9154 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9155 (ALL_CFLAGS): Use new macros rather than old.
9156 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9157 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9158 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9159 -Wunused-result, -Wunused-variable. This should go away once
9160 the Emacs and Gnulib regex code is merged.
9161 (xmalloc, xrealloc): Now static.
9163 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9165 * dired.c (Fsystem_groups): Remove unused local.
9167 2012-04-17 Glenn Morris <rgm@gnu.org>
9169 * dired.c (Fsystem_users): Doc fix.
9171 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9173 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9174 (syms_of_dired): Add them.
9176 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9178 Fix minor alloc.c problems found by static checking.
9179 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9180 New extern decls, to avoid calling undeclared functions.
9181 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9182 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9183 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9184 (NEED_MEM_INSERT): New macro.
9185 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9186 Remove one incorrect comment and fix another.
9188 Fix minor ralloc.c problems found by static checking.
9189 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9190 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9191 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9192 (r_alloc_sbrk): Now static.
9194 Improve ralloc.c interface checking.
9195 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9196 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9197 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9198 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9199 [REL_ALLOC]: ... to here, to check interface.
9200 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9201 Remove decls. This fixes an "It stinks!".
9203 * alloc.c (which_symbols): Fix alignment issue / type clash.
9205 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9207 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9208 (struct Lisp_Misc_Any): Likewise.
9209 (struct Lisp_Free): Likewise.
9210 * alloc.c (union aligned_Lisp_Symbol): Define.
9211 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9212 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9213 (union aligned_Lisp_Misc): Define.
9214 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9215 aligned_Lisp_Misc instead of union Lisp_Misc.
9216 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9218 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9220 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9221 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9222 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9223 * s/netbsd.h, s/sol2-6.h:
9224 Remove definition of GC_MARK_STACK, since the default now works.
9225 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9226 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9227 no longer the default.
9228 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9230 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9232 * lread.c (lisp_file_lexically_bound_p):
9233 Fix hang at ";-*-\n" (bug#11238).
9235 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9237 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9238 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9240 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9242 * nsterm.m (constrainFrameRect): Always constrain when there is only
9243 one screen (Bug#10962).
9245 2012-04-13 Ken Brown <kbrown@cornell.edu>
9247 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9249 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9251 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9253 2012-04-11 Daniel Colascione <dancol@dancol.org>
9255 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9256 against is gone. It's better to use vfork now so that when Cygwin
9257 gains a new, working vfork, we use it automatically (bug#10398).
9259 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9261 * window.c (save_window_save): Obey window-point-insertion-type.
9263 2012-04-11 Glenn Morris <rgm@gnu.org>
9265 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9267 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9269 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9271 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9273 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9274 (force_quit_count): New var.
9275 (handle_interrupt): Use it.
9277 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9279 * w32.c (w32_delayed_load): Record the full path of the library
9280 being loaded (bug#10424).
9282 2012-04-09 Glenn Morris <rgm@gnu.org>
9284 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9285 not just in the obarray, before snarfing them. (Bug#11036)
9287 * Makefile.in ($(leimdir)/leim-list.el):
9288 Pass EMACS rather than BUILT_EMACS.
9290 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9292 * process.c (make_process):
9293 * process.h: Add integer `gnutls_handshakes_tried' member to
9296 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9297 Add convenience `GNUTLS_LOG2i' macro.
9299 * gnutls.c (gnutls_log_function2i): Convenience log function.
9300 (emacs_gnutls_read): Use new log functions,
9301 `gnutls_handshakes_tried' process member, and
9302 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9303 attempts per process (connection).
9305 2012-04-09 Chong Yidong <cyd@gnu.org>
9307 * eval.c (Fuser_variable_p, user_variable_p_eh)
9308 (lisp_indirect_variable): Functions deleted.
9309 (Fdefvar): Caller changed.
9311 * callint.c (Finteractive, Fcall_interactively):
9312 * minibuf.c (Fread_variable): Callers changed.
9314 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9316 * xdisp.c (set_cursor_from_row): If the display string appears in
9317 the buffer at position that is closer to point than the position
9318 after the display string, display the cursor on the first glyph of
9319 the display string. Fixes cursor display when a 'display' text
9320 property immediately follows invisible text. (Bug#11094)
9322 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9324 composite.c: use 'double' consistently
9325 * composite.c (get_composition_id): Use 'double' consistently
9326 instead of converting 'float' to 'double' and vice versa; this is
9327 easier to understand and avoids a GCC warning.
9329 2012-04-09 Glenn Morris <rgm@gnu.org>
9331 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9332 preparation for dumping it with emacs. (Bug#4789)
9333 (leimdir): New variable.
9334 ($(leimdir)/leim-list.el): New rule.
9335 (emacs$(EXEEXT)): Depend on leim-list.el.
9337 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9338 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9339 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9341 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9343 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9346 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9348 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9349 Remove unused local variable.
9351 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9353 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9354 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9355 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9356 objects, as mark_maybe_pointer will catch them otherwise.
9357 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9358 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9360 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9362 Fix typo that broke non-Windows builds.
9363 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9365 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9367 Support building on MS-Windows with libxml2.
9369 * makefile.w32-in (OBJ2): Add xml.$(O).
9370 (GLOBAL_SOURCES): Add xml.c.
9371 ($(BLD)/xml.$(O)): New dependency list.
9373 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9374 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9375 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9376 [!WINDOWSNT]: New macros.
9377 (init_libxml2_functions, libxml2_loaded_p): New functions.
9378 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9379 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9380 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9381 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9383 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9384 Call init_libxml2_functions before calling libxml2 functions.
9385 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9387 * emacs.c: Don't include libxml/parser.h.
9388 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9389 xmlCleanupParser directly.
9391 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9393 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9395 * indent.c (Fvertical_motion): If there is a display string at
9396 point, use it.vpos to compute how many lines to backtrack after
9397 move_it_to point. (Bug#11133)
9399 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9401 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9402 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9403 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9404 macros related to unification of CJK characters. For the details,
9405 see the discussion following the message here:
9406 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9408 2012-04-04 Chong Yidong <cyd@gnu.org>
9410 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9412 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9414 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9415 instead of alloca. (Bug#11138)
9417 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9419 * w32menu.c (is_simple_dialog): Properly check lisp types.
9422 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9424 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9425 position we get to after a call to move_it_to fails the
9426 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9427 only if we wind up in a string from display property. (Bug#11063)
9429 * window.c (Fdelete_other_windows_internal): Invalidate the row
9430 and column information about mouse highlight, so that redisplay
9431 restores it after reallocating the glyph matrices. (Bug#7464)
9433 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9434 string comes from a `display' text property, use the buffer
9435 position of that property as if we actually saw that position in
9437 (move_it_by_lines): Remove the assertion that
9438 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9439 violated when there's a before-string at the beginning of a line.
9442 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9444 * xdisp.c (append_space_for_newline): If the default face was
9445 remapped, use the remapped face for the appended newline.
9446 (extend_face_to_end_of_line): Use the remapped default face for
9447 extending the face to the end of the line.
9448 (display_line): Call extend_face_to_end_of_line when the default
9449 face was remapped. (Bug#11068)
9451 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9453 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9455 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9457 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9459 2012-03-27 Glenn Morris <rgm@gnu.org>
9461 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9464 2012-03-26 Kenichi Handa <handa@m17n.org>
9466 * dispextern.h (struct glyph): Fix previous change. Change the
9467 bit length of glyphless.ch to 25 (Bug#11082).
9469 2012-03-26 Chong Yidong <cyd@gnu.org>
9471 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9472 (command_loop_1): Use it; inhibit selection update for
9473 handle-select-window too (Bug#8996).
9475 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9477 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9479 2012-03-25 Kenichi Handa <handa@m17n.org>
9481 * dispextern.h (struct glyph): Change the bit length of
9482 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9484 2012-03-24 Eli Zaretskii <eliz@gnu.org>
9486 * s/ms-w32.h (tzname): Include time.h before redirecting to
9487 _tzname. Fixes the MSVC build. (Bug#9960)
9489 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9491 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9494 * xterm.c (XTread_socket): Only modify handling_signal if
9495 !SYNC_INPUT. (Bug#11080)
9497 2012-03-23 Eli Zaretskii <eliz@gnu.org>
9499 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9500 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9501 when fetching a multibyte character consumes more bytes than
9502 CHAR_BYTES returns, due to unification of CJK characters in
9503 string_char. (Bug#11073)
9505 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9507 * process.c (wait_reading_process_output): Handle pty disconnect
9508 by refraining from sending oneself a SIGCHLD (bug#10933).
9510 2012-03-22 Chong Yidong <cyd@gnu.org>
9512 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9514 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9515 Mark string as coming from a prefix property.
9516 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9517 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9519 2012-03-21 Chong Yidong <cyd@gnu.org>
9521 * xfaces.c (Vface_remapping_alist): Doc fix.
9523 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9525 * w32proc.c (Fw32_set_console_codepage)
9526 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9529 2012-03-20 Chong Yidong <cyd@gnu.org>
9531 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9532 to reflect default non-nil value of redisplay-dont-pause.
9534 2012-03-19 Kenichi Handa <handa@m17n.org>
9536 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9537 it fit in a valid range (Bug#11003).
9539 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9541 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9542 that is not from display property, accept the row as a "cursor
9543 row" if one of the string's character has a non-nil `cursor'
9544 property. Fixes cursor positioning when there are newlines in
9545 overlay strings, e.g. in icomplete.el. (Bug#11035)
9547 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9549 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9551 2012-03-12 Chong Yidong <cyd@gnu.org>
9553 * eval.c (inhibit_lisp_code): Rename from
9554 inhibit_window_configuration_change_hook; move from window.c.
9556 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9557 * window.c (run_window_configuration_change_hook)
9558 (syms_of_window): Callers changed.
9560 2012-03-11 Chong Yidong <cyd@gnu.org>
9562 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9564 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9566 2012-03-10 Chong Yidong <cyd@gnu.org>
9568 * frame.c (other_visible_frames): Don't assume the selected frame
9569 is visible (Bug#10955).
9571 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9573 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9575 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9577 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9578 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9581 2012-03-03 Glenn Morris <rgm@gnu.org>
9583 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9585 2012-03-02 Eli Zaretskii <eliz@gnu.org>
9587 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9588 position past the first glyph_row that ends at ZV. (Bug#10902)
9589 (redisplay_window, next_element_from_string): Fix typos in
9591 (redisplay_window): Pass to move_it_vertically the margin in
9592 pixels, not in screen lines.
9594 2012-03-02 Glenn Morris <rgm@gnu.org>
9596 * buffer.c (buffer-list-update-hook): Doc fix.
9598 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9600 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9601 push_it before setting up the iterator for the first overlay
9602 string, even if we have an empty string loaded.
9603 (next_overlay_string): If there's an empty string on the iterator
9604 stack, pop the stack. (Bug#10903)
9606 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9608 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9609 Suggested by Stefan Monnier in
9610 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9611 * alloc.c (widen_to_Lisp_Object): New static function.
9612 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9613 and widening them to Lisp_Objects. This would work even if
9614 USE_LSB_TAG is defined and wide integers are used, which might
9615 happen in a future version of Emacs.
9617 2012-02-25 Chong Yidong <cyd@gnu.org>
9619 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9622 * xselect.c (Fx_selection_exists_p): Doc fix.
9623 (x_clipboard_manager_save_all): Print an informative message
9624 before saving to clipboard manager.
9626 2012-02-24 Chong Yidong <cyd@gnu.org>
9628 * keyboard.c (process_special_events): Handle all X selection
9629 requests in kbd_buffer, not just the next one (Bug#8869).
9631 2012-02-23 Chong Yidong <cyd@gnu.org>
9633 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9634 call when setting menu-bar-lines and tool-bar-lines parameters.
9635 (unwind_create_frame_1): New helper function.
9637 * window.c (inhibit_window_configuration_change_hook): New var.
9638 (run_window_configuration_change_hook): Obey it.
9639 (syms_of_window): Initialize it.
9641 2012-02-22 Chong Yidong <cyd@gnu.org>
9643 * xterm.c (x_draw_image_relief): Add missing type check for
9644 Vtool_bar_button_margin (Bug#10743).
9646 2012-02-21 Chong Yidong <cyd@gnu.org>
9648 * fileio.c (Vfile_name_handler_alist): Doc fix.
9650 * buffer.c (Fget_file_buffer): Protect against invalid file
9651 handler return value.
9653 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9655 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9656 when computing $valmask.
9658 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9659 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9660 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9661 It's useless in that case, and it can cause problems on hosts
9662 that allocate halves of EMACS_INT values separately.
9663 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9664 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9665 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9666 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9667 it avoids undefined behavior on hosts where shifting right by more
9668 than the word width has undefined behavior.
9670 2012-02-19 Chong Yidong <cyd@gnu.org>
9672 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9673 (Funhandled_file_name_directory, Ffile_name_as_directory)
9674 (Fdirectory_file_name, Fexpand_file_name)
9675 (Fsubstitute_in_file_name): Protect against invalid file handler
9676 return values (Bug#10845).
9678 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9680 * .gdbinit (pitx): Fix incorrect references to fields of the
9683 2012-02-17 Chong Yidong <cyd@gnu.org>
9685 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9687 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9689 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9690 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9692 2012-02-15 Chong Yidong <cyd@gnu.org>
9694 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9695 marked as special. Also, starting docstrings with * is obsolete.
9697 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9699 * gnutls.c (emacs_gnutls_write): Fix last change.
9701 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9703 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9706 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9708 * keymap.c (Fsingle_key_description): Handle char ranges.
9710 2012-02-12 Chong Yidong <cyd@gnu.org>
9712 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9713 as that creates a dangerous corner case.
9715 * window.c (Fdelete_window_internal): Invalidate the mouse
9716 highlight (Bug#9904).
9718 2012-02-12 Glenn Morris <rgm@gnu.org>
9720 * xselect.c (Fx_own_selection_internal)
9721 (Fx_get_selection_internal, Fx_disown_selection_internal)
9722 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9723 * nsselect.m (Fx_own_selection_internal)
9724 (Fx_disown_selection_internal, Fx_selection_exists_p)
9725 (Fx_selection_owner_p, Fx_get_selection_internal):
9726 Sync docs and argument specs with the xselect.c versions.
9728 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9730 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9732 2012-02-11 Eli Zaretskii <eliz@gnu.org>
9734 * w32select.c (Fx_selection_exists_p): Sync doc string and
9735 argument list with xselect.c. (Bug#10783)
9737 * w16select.c (Fx_selection_exists_p): Sync doc string and
9738 argument list with xselect.c. (Bug#10783)
9740 2012-02-10 Glenn Morris <rgm@gnu.org>
9742 * fns.c (Fsecure_hash): Doc fix.
9744 2012-02-09 Kenichi Handa <handa@m17n.org>
9746 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9748 2012-02-07 Chong Yidong <cyd@gnu.org>
9750 * buffer.c (Fbuffer_local_variables)
9751 (buffer_lisp_local_variables): Handle unbound vars correctly;
9752 don't let Qunbound leak into Lisp.
9754 2012-02-07 Glenn Morris <rgm@gnu.org>
9756 * image.c (Fimagemagick_types): Doc fix.
9758 * image.c (imagemagick-render-type): Change it from a lisp object
9759 to an integer. Move the doc here from the lisp manual.
9760 Treat all values not equal to 0 the same.
9762 2012-02-06 Chong Yidong <cyd@gnu.org>
9764 * doc.c (store_function_docstring): Avoid applying docstring of
9765 alias to base function (Bug#2603).
9767 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9769 * .gdbinit (pp1, pv1): Remove redundant defines.
9772 2012-02-04 Chong Yidong <cyd@gnu.org>
9774 * nsterm.m: Declare a global (Bug#10694).
9776 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9778 * w32.c (get_emacs_configuration_options):
9779 Include --enable-checking, if specified, in the return value.
9781 2012-02-04 Martin Rudalics <rudalics@gmx.at>
9783 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9784 after rounding frame sizes. (Bug#9723)
9786 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9788 * keyboard.c (adjust_point_for_property): Don't position point
9789 before BEGV. (Bug#10696)
9791 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9793 Handle overflow when computing char display width (Bug#9496).
9794 * character.c (char_width): Return EMACS_INT, not int.
9795 (char_width, c_string_width): Check for overflow when
9796 computing the width; this is possible now that individual
9797 characters can have unbounded width. Problem introduced
9798 by merge from Emacs 23 on 2012-01-19.
9800 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
9802 * dbusbind.c (Fdbus_register_method): Mention the return value
9803 :ignore in the docstring.
9805 2012-02-02 Glenn Morris <rgm@gnu.org>
9807 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9809 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9810 Unconditionally set to t. (Bug#10673)
9811 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9812 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9813 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9815 2012-02-02 Kenichi Handa <handa@m17n.org>
9817 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9818 0, do not call append_composite_glyph.
9820 2012-02-02 Kenichi Handa <handa@m17n.org>
9822 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9824 (x_produce_glyphs): If the component of a composition is a null
9825 string, set it->pixel_width to 1 to avoid zero-width glyph.
9827 2012-02-01 Eli Zaretskii <eliz@gnu.org>
9829 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9830 first 2 arguments are identical. This makes inserting large
9831 output from a subprocess an order of magnitude faster on
9832 MS-Windows, where all sbrk'ed memory is always contiguous.
9834 2012-01-31 Glenn Morris <rgm@gnu.org>
9836 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9837 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9838 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9840 2012-01-29 Glenn Morris <rgm@gnu.org>
9842 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9844 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9846 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9848 2012-01-28 Chong Yidong <cyd@gnu.org>
9850 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9852 2012-01-26 Chong Yidong <cyd@gnu.org>
9854 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9856 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9857 repeat counts (Bug#10507).
9859 2012-01-26 Glenn Morris <rgm@gnu.org>
9861 * lread.c (syms_of_lread): Doc fix.
9863 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9865 * coding.c (encode_designation_at_bol): Change return value to
9868 2012-01-25 Chong Yidong <cyd@gnu.org>
9870 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9872 2012-01-21 Chong Yidong <cyd@gnu.org>
9874 * floatfns.c (Fcopysign): Make the second argument non-optional,
9875 since nil is not allowed anyway.
9877 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9879 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9880 (send_process): Likewise.
9882 2012-01-19 Martin Rudalics <rudalics@gmx.at>
9884 * window.c (save_window_save, Fcurrent_window_configuration)
9885 (Vwindow_persistent_parameters): Do not use Qstate.
9886 Rewrite doc-strings.
9888 2012-01-19 Kenichi Handa <handa@m17n.org>
9890 * character.c (char_width): New function.
9891 (Fchar_width, c_string_width, lisp_string_width):
9892 Use char_width (Bug#9496).
9894 2012-01-16 Martin Rudalics <rudalics@gmx.at>
9896 * window.c (Vwindow_persistent_parameters): New variable.
9897 (Fset_window_configuration, save_window_save): Handle persistent
9900 2012-01-14 Eli Zaretskii <eliz@gnu.org>
9902 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9903 thrashing the stack of the thread. (Bug#9087)
9905 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9907 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9909 2012-01-11 Eli Zaretskii <eliz@gnu.org>
9911 * xdisp.c (rows_from_pos_range): Handle the case where the
9912 highlight ends on a newline. (Bug#10464)
9913 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9914 he end column for display of highlight that ends on a newline
9917 2012-01-11 Glenn Morris <rgm@gnu.org>
9919 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9920 from load-path also when installation-directory is nil. (Bug#10208)
9922 2012-01-10 Glenn Morris <rgm@gnu.org>
9924 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9926 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9927 Update template values to be closer to their typical values these days.
9929 2012-01-09 Eli Zaretskii <eliz@gnu.org>
9931 * xdisp.c (rows_from_pos_range): Accept additional argument
9932 DISP_STRING, and accept any glyph in a row whose object is that
9933 string as eligible for mouse highlight. Fixes mouse highlight of
9934 display strings from overlays. (Bug#10464)
9936 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
9938 emacs: fix an auto-save permissions race condition (Bug#10400)
9939 * fileio.c (auto_saving_dir_umask): New static var.
9940 (Fmake_directory_internal): Use it.
9941 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9942 creating the directory. The old code temporarily assigns
9943 too-generous permissions to the directory.
9944 (do_auto_save_eh): Clear it.
9945 (Fdo_auto_save): Catch all errors, not just file errors, so
9946 that the var is always cleared.
9948 2012-01-07 Eli Zaretskii <eliz@gnu.org>
9950 * search.c (scan_buffer): Pass character positions to
9951 know_region_cache, not byte positions. (Bug#6540)
9953 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
9955 * w32.c (sys_rename): Report EXDEV when rename of a directory
9956 fails because the target is on another logical disk. (Bug#10284)
9958 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9960 * xterm.c (x_embed_request_focus): New function.
9962 * xterm.h: Add prototype.
9964 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9966 2012-01-05 Glenn Morris <rgm@gnu.org>
9968 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9970 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9972 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9973 Load gnutls_transport_set_lowat only if GnuTLS version is below
9975 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9976 GnuTLS versions below 2.11.1.
9978 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9980 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9981 to the doc string advising against its use for altering the way
9982 windows are scrolled.
9984 2011-12-28 Kenichi Handa <handa@m17n.org>
9986 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9987 coding-system ASCII compatible only when it does not produce BOM
9988 on encoding (Bug#10383).
9990 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9992 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9994 (create_and_show_popup_menu): Always use menu_position_func for
9997 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9999 * callint.c (Fcall_interactively): Don't truncate prompt string.
10001 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10003 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10004 property that ends at ZV, so that the bidi iteration could be
10005 resumed from there (after widening). (Bug#10360)
10007 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10009 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10011 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10013 * nsterm.m (x_free_frame_resources):
10014 Release f->output_data.ns->miniimage.
10015 (ns_index_color): Fix indentation. Do not retain
10016 color_table->colors[i].
10018 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10021 * nsfns.m (x_set_background_color): Assign return value from
10022 ns_index_color to face-background instead of NSColor*.
10023 (ns_implicitly_set_icon_type): Fix indentation.
10024 Change assignment in for loop to comparison.
10026 * emacs.c (ns_pool): New variable.
10027 (main): Assign ns_pool.
10028 (Fkill_emacs): Call ns_release_autorelease_pool.
10030 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10031 autorelease fdesc, release fdAttrs and tdict.
10032 (ns_get_covering_families): Release charset.
10033 (ns_findfonts): Release NSFontDescriptor created with new.
10034 (ns_uni_to_glyphs): Fix indentation.
10035 (setString): Release attrStr before assigning new value.
10037 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10039 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10041 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10042 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10044 2011-12-18 David Reitter <reitter@cmu.edu>
10046 * nsterm.m (ns_term_init): Subscribe for notifications
10047 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10048 to method trackingNotification in EmacsMenu.
10050 * nsmenu.m (trackingMenu): New variable.
10051 (trackingNotification): New method (from Aquamacs).
10052 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10053 from Aquamacs (Bug#7030).
10055 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10057 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10058 (symbol_to_nsstring): Fix indentation.
10059 (ns_symbol_to_pb): New function.
10060 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10061 (Fns_rotate_cut_buffers_internal): Remove.
10062 (Fns_store_selection_internal): Rename from
10063 Fns_store_cut_buffer_internal.
10064 (ns_get_foreign_selection, Fx_own_selection_internal)
10065 (Fx_disown_selection_internal, Fx_selection_exists_p)
10066 (Fns_get_selection_internal, Fns_store_selection_internal):
10067 Use ns_symbol_to_pb and check if return value is nil.
10068 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10069 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10070 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10071 renamed to Sns_store_selection_internal.
10072 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10073 and remove this function.
10074 (ns_handle_selection_clear): Remove, never used.
10075 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10078 2011-12-17 Ken Brown <kbrown@cornell.edu>
10080 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10081 GID is unknown (Bug#10257).
10083 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10085 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10086 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10087 which caused a build failure on GNU/Linux IA-64. This problem was
10088 introduced by my 2011-10-07 patch.
10090 2011-12-15 Juri Linkov <juri@jurta.org>
10092 * image.c (imagemagick_error): New function. (Bug#10112)
10093 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10094 Use `imagemagick_error' where ImageMagick functions return
10096 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10099 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10101 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10102 fill background (Bug#8992).
10104 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10106 * window.c (Vwindow_combination_resize)
10107 (Vwindow_combination_limit): Use t instead of non-nil in
10109 (Vrecenter_redisplay): Add first sentence of doc-string on
10111 (Frecenter): Fix doc-string typo.
10113 2011-12-11 Kenichi Handa <handa@m17n.org>
10115 * coding.c (Funencodable_char_position): Pay attention to the
10116 buffer text relocation (Bug#9389).
10118 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10120 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10121 gtk_init (Bug#10100).
10123 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10125 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10126 IT->string is nil. (Bug#10263)
10128 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10130 * nsterm.h (x_free_frame_resources): Declare.
10132 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10133 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10135 * nsterm.h (ns_get_defaults_value): Declare.
10137 * nsterm.m (ns_default): Call ns_get_defaults_value.
10139 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10141 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10144 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10146 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10147 that where the value of an _OBJC_* symbol points to is in the .bss
10148 section (Bug#10240).
10150 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10152 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10153 after the loop to call ccl_driver at least once (Bug#8619).
10155 2011-12-08 Kenichi Handa <handa@m17n.org>
10157 * ftfont.c (get_adstyle_property): Fix previous change
10160 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10162 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10163 dirs from the default value of EMACSLOADPATH (bug#10208).
10165 2011-12-07 Glenn Morris <rgm@gnu.org>
10167 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10168 installation and source directories as well. (Bug#10208)
10170 2011-12-06 Chong Yidong <cyd@gnu.org>
10172 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10174 2011-12-06 Glenn Morris <rgm@gnu.org>
10176 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10177 as an error, not just -1. (Bug#10217)
10179 2011-12-05 Chong Yidong <cyd@gnu.org>
10181 * keyboard.c (process_special_events): New function.
10182 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10184 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10186 * coding.c (encode_designation_at_bol): Don't use uninitialized
10187 local variable (Bug#9318).
10189 2011-12-05 Kenichi Handa <handa@m17n.org>
10191 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10192 return Qnil (Bug#8046, Bug#10193).
10194 2011-12-05 Kenichi Handa <handa@m17n.org>
10196 * coding.c (encode_designation_at_bol): New args charbuf_end and
10197 dst. Return the number of produced bytes. Callers changed.
10198 (coding_set_source): Return how many bytes coding->source was
10200 (coding_set_destination): Return how many bytes
10201 coding->destination was relocated.
10202 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10203 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10205 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10207 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10208 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10211 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10213 The following changes are to fix Bug#9318.
10215 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10216 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10217 (encode_coding_iso_2022, encode_coding_sjis)
10218 (encode_coding_big5, encode_coding_charset): Use the above macros.
10220 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10222 * lisp.h (process_quit_flag): Fix external declaration.
10224 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10226 Don't macro-inline non-performance-critical code.
10227 * eval.c (process_quit_flag): New function.
10228 * lisp.h (QUIT): Use it.
10230 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10232 * nsfns.m (get_geometry_from_preferences): New function.
10233 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10235 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10237 * emacs.c (Qkill_emacs): Define.
10238 (syms_of_emacs): Initialize it.
10239 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10240 Qquit_flag to `kill-emacs' instead.
10241 (quit_throw_to_read_char): Add parameter `from_signal'.
10242 All callers changed. Call Fkill_emacs if requested and safe.
10243 * lisp.h (QUIT): Call Fkill_emacs if requested.
10245 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10247 * widget.c (update_wm_hints): Return if wmshell is null.
10248 (widget_update_wm_size_hints): New function.
10250 * widget.h (widget_update_wm_size_hints): Declare.
10252 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10253 widget_update_wm_size_hints (Bug#10104).
10255 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10257 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10258 before a newline, prepare the bidi iterator for consuming the
10259 newline, and keep the current paragraph direction. (Bug#10183)
10260 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10262 2011-12-02 Juri Linkov <juri@jurta.org>
10264 * search.c (Fword_search_regexp): New Lisp function created from
10265 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10266 (Fword_search_backward, Fword_search_forward)
10267 (Fword_search_backward_lax, Fword_search_forward_lax):
10268 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10269 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10271 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10273 * fileio.c (Finsert_file_contents): Move after-change-function call
10274 to before the "handled:" label, since all "goto handled" appear in
10275 cases where the *-change-functions have already been properly called
10278 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10280 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10281 waiting for input. (Bug#10169)
10283 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10285 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10286 verifies glyph row's hash code--we have just reallocated the
10287 glyphs, so their contents can be complete garbage. (Bug#10164)
10289 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10291 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10293 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10295 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10296 attributes are tested _before_ calling verify_row_hash, to protect
10297 against GCC re-ordering of the tests. (Bug#10164)
10299 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10301 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10303 * xterm.c (handle_one_xevent): Only set async_visible and friends
10304 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10305 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10306 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10308 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10310 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10311 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10312 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10313 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10314 All uses changed to use GCPRO1 etc.
10315 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10316 Revert to old implementation (i.e., before 2011-03-11).
10318 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10320 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10321 of scroll runs so as to avoid assigning disabled bogus rows and
10322 unnecessary graphics copy operations.
10324 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10326 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10327 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10328 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10329 (malloc, free, realloc, calloc): Redirect to e_* only when
10332 * lisp.h (GCTYPEBITS): Move before first use.
10333 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10334 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10335 this macro definition.
10337 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10340 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10342 * gtkutil.c (xg_create_frame_widgets):
10343 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10344 present with Gtk+ 2.0.
10346 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10348 * fileio.c (Finsert_file_contents): Undo previous change; see
10349 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10351 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10353 Rename locals to avoid shadowing.
10354 * fileio.c (Finsert_file_contents):
10355 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10356 * process.c (wait_reading_process_output):
10357 Rename inner 'proc' to 'p' to avoid shadowing.
10358 Indent for consistency with usual Emacs style.
10360 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10362 * xdisp.c (redisplay_window): If cursor row is not fully visible
10363 after recentering, and scroll-conservatively is set to a large
10364 number, scroll window by a few more lines to make the cursor fully
10365 visible and out of scroll-margin. (Bug#10105)
10366 (start_display): Don't move to the next line if the display should
10367 start at a newline that is part of a display vector or an overlay
10368 string. (Bug#10119)
10370 2011-11-24 Juri Linkov <juri@jurta.org>
10372 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10373 after the `MagickPingImage' call. (Bug#10112)
10375 2011-11-23 Chong Yidong <cyd@gnu.org>
10377 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10379 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10381 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10382 making another buffer current. (Bug#10114)
10384 2011-11-23 Glenn Morris <rgm@gnu.org>
10386 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10388 2011-11-23 Chong Yidong <cyd@gnu.org>
10390 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10391 using it (Bug#5984).
10393 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10395 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10396 and header-lines, as they don't have one computed for them.
10399 * .gdbinit (prow): Make displayed values more self-explaining.
10400 Add row's hash code.
10402 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10404 * process.c (wait_reading_process_output): Fix asynchrounous
10405 GnuTLS socket handling on some versions of the GnuTLS library.
10406 (wait_reading_process_output): Add comment and URL.
10408 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10410 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10412 2011-11-21 Chong Yidong <cyd@gnu.org>
10414 * window.c (Fnext_window, Fprevious_window): Doc fix.
10416 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10418 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10420 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10422 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10424 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10426 * window.c (Fset_window_combination_limit): Rename argument
10428 (Vwindow_combination_limit): Remove "status" from doc-string.
10430 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10432 * m/ibms390.h: Remove.
10433 * m/ibms390x.h: Don't include "ibms390.h".
10435 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10437 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10438 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10440 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10442 * casetab.c (Fset_case_table):
10443 * charset.c (Fcharset_after): Fix typos.
10445 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10447 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10448 Otherwise, valgrind does not work on some platforms.
10449 Problem reported by Andreas Schwab in
10450 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10451 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10452 is set, removing the need for VIRT_ADDRESS_VARIES.
10453 (PURE_P): Use a more-efficient implementation that needs just one
10454 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10455 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10456 to 4 (xorl, subq, cmpq, setbe).
10457 * alloc.c (pure): Always extern now, since that's the
10458 VIRT_ADDR_VARIES behavior.
10459 (PURE_POINTER_P): Use a single comparison, not two, for
10460 consistency with the new puresize.h.
10461 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10462 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10463 Remove VIRT_ADDR_VARIES no longer needed.
10465 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10467 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10468 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10469 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10470 behave as if the cursor position were at the window margin.
10472 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10473 and the cursor position is out of bounds, behave as if the cursor
10474 position were at the window margin. (Bug#10075)
10476 2011-11-18 Chong Yidong <cyd@gnu.org>
10478 * window.c (Fwindow_combination_limit): Make first argument
10479 non-optional, since it is meaningless for live windows like the
10482 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10484 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10486 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10488 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10489 (graft_intervals_into_buffer): Simplify.
10491 2011-11-18 Eli Zaretskii <eliz@gnu.org>
10493 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10494 hash values of the two rows.
10495 (copy_row_except_pointers): Preserve the used[] arrays and the
10496 hash values of the two rows. (Bug#10035)
10497 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10499 * xdisp.c (row_hash): New function, body extracted from
10500 compute_line_metrics.
10501 (compute_line_metrics): Call row_hash, instead of computing the
10504 * dispnew.c (verify_row_hash): Call row_hash for computing the
10505 hash code of a row, instead of duplicating code from xdisp.c.
10507 * dispextern.h (row_hash): Add prototype.
10509 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10511 * frame.c (delete_frame): Don't delete the terminal when the last
10512 X frame is closed if emacs is built with GTK toolkit.
10514 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
10516 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10518 2011-11-17 Martin Rudalics <rudalics@gmx.at>
10520 * window.c (Vwindow_splits): Rename to
10521 Vwindow_combination_resize. Suggested by Juri Linkov.
10522 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10525 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10527 * nsfns.m (Fns_font_name):
10528 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10530 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10532 * window.h (window): Rename slot "nest" to "combination_limit".
10533 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10534 (Fset_window_nest): Rename to Fset_window_combination_limit.
10535 (Vwindow_nest): Rename to Vwindow_combination_limit.
10536 (recombine_windows, make_parent_window, make_window)
10537 (Fsplit_window_internal, saved_window)
10538 (Fset_window_configuration, save_window_save): Rename all
10539 occurrences of window_nest to window_combination_limit.
10541 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10543 * image.c (imagemagick_load_image): Fix typo.
10545 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10547 * xdisp.c (display_line): Move the call to
10548 highlight_trailing_whitespace before the call to
10549 compute_line_metrics, since the latter needs to see the final
10550 faces of all the glyphs to compute ROW's hash value.
10551 Fixes assertion violations in row_equal_p. (Bug#10035)
10553 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10555 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10556 just return (bug#10044).
10558 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10560 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10561 with user-defined heap size. Bump the default size of the temacs
10562 heap to 27MB, to avoid memory warning when running temacs.
10563 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10565 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10566 current_matrix and desired_matrix. (Bug#9990)
10567 (verify_row_hash) [XASSERTS]: New function.
10568 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10569 that the hash value of glyph rows is correct.
10571 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10573 * window.h (window): Remove splits slot.
10574 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10575 (Fdelete_other_windows_internal, make_parent_window)
10576 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10577 (Fset_window_configuration, save_window_save): Don't deal with
10578 split status of windows.
10579 (saved_window): Remove splits slot.
10580 (Vwindow_splits): Rewrite doc-string.
10582 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10584 * xfns.c (unwind_create_frame):
10585 * nsfns.m (unwind_create_frame):
10586 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10587 Vframe_list (Bug#9999).
10589 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10591 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10593 2011-11-11 Kenichi Handa <handa@m17n.org>
10595 * callproc.c (Fcall_process): Set the member dst_multibyte of
10598 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10600 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10601 avoid a crash (bug#9496).
10603 2011-11-09 Chong Yidong <cyd@gnu.org>
10605 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10606 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10608 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10610 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10612 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10614 Avoid some portability problems by eschewing 'extern inline' functions.
10615 The trivial performance wins aren't worth the portability hassles; see
10616 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10618 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10619 (window_box_width, window_box_left, window_box_left_offset)
10620 (window_box_right, window_box_right_offset): Undo previous change,
10621 by removing the "extern"s.
10622 * intervals.c (adjust_intervals_for_insertion)
10623 (adjust_intervals_for_deletion): Undo previous change,
10624 making these static again.
10625 (offset_intervals, temp_set_point_both, temp_set_point)
10626 (copy_intervals_to_string): No longer inline.
10627 * xdisp.c (window_text_bottom_y, window_box_width)
10628 (window_box_height, window_box_left_offset)
10629 (window_box_right_offset, window_box_left, window_box_right)
10630 (window_box): No longer inline.
10632 2011-11-08 Chong Yidong <cyd@gnu.org>
10634 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10635 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10636 Signal an error if not a live window.
10637 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10638 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10640 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
10642 * lisp.h (syms_of_abbrev): Remove declaration.
10643 Reported by CHENG Gao <chenggao@royau.me>.
10645 2011-11-07 Eli Zaretskii <eliz@gnu.org>
10647 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10648 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10649 of temacs in GUI mode.
10651 2011-11-07 Martin Rudalics <rudalics@gmx.at>
10653 * window.h: Declare delete_all_child_windows instead of
10654 delete_all_subwindows.
10655 * window.c (Fwindow_nest, Fset_window_nest)
10656 (Fset_window_new_total, Fset_window_new_normal)
10657 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10658 (delete_all_subwindows): Rename to delete_all_child_windows.
10659 (Fdelete_other_windows_internal, Fset_window_configuration):
10660 Call delete_all_child_windows instead of delete_all_subwindows.
10661 * frame.c (delete_frame): Call delete_all_child_windows instead
10662 of delete_all_subwindows.
10664 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10666 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10667 This is also needed for porting to any host where GC_MARK_STACK is
10668 not GC_MAKE_GCPROS_NOOPS.
10669 (which_symbols): Use it.
10671 2011-11-07 Kenichi Handa <handa@m17n.org>
10673 * coding.c (coding_set_destination): Check coding->src_pos only
10674 when coding->src_object is a buffer (bug#9910).
10676 * process.c (send_process): Set the member src_multibyte of coding
10677 to 0 (bug#9911) when sending a unibyte text.
10679 * callproc.c (Fcall_process): Set the member src_multibyte of
10680 process_coding to 0 (bug#9912).
10682 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10684 * xmenu.c (cleanup_widget_value_tree): New function.
10685 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10686 calling free_menubar_widget_value_tree directly (Bug#9830).
10688 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10690 Fix some portability problems with 'inline'.
10691 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10692 (window_box_width, window_box_left, window_box_left_offset)
10693 (window_box_right, window_box_right_offset): Declare extern.
10694 Otherwise, these inline functions do not conform to C99 and
10695 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10696 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10697 * intervals.c (adjust_intervals_for_insertion)
10698 (adjust_intervals_for_deletion): Now extern, because otherwise the
10699 extern inline functions 'offset_intervals' couldn't refer to it.
10700 (static_offset_intervals): Remove.
10701 (offset_intervals): Rewrite using the old contents of
10702 static_offset_intervals. The old version didn't conform to C99
10703 because an extern inline function contained a reference to an
10704 identifier with static linkage.
10706 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10708 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10711 2011-11-06 Eli Zaretskii <eliz@gnu.org>
10713 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10714 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10715 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10716 return Qleft_to_right.
10718 2011-11-06 Chong Yidong <cyd@gnu.org>
10720 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10721 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10722 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10723 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10724 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10725 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10726 (Fwindow_vscroll): Doc fix.
10727 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10728 argument, since it makes no sense to pass a live window and for
10729 consistency with window-child.
10731 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10733 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10736 2011-11-05 Jason Rumney <jasonr@gnu.org>
10738 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10739 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10741 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10742 bitwise arithmetic preventing use of unicode-sip and non-truetype
10745 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10747 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10750 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10751 initialization code to keep similarity to xfns.c after changes
10754 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10756 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10757 (unwind_create_frame): New function (Bug#9943).
10758 (Fx_create_frame): Restructure code to be more similar to the one in
10759 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10760 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10761 Move terminal->reference_count++ just before making the frame official
10764 * nsterm.m (x_free_frame_resources): New function.
10765 (x_destroy_window): Move code to x_free_frame_resources.
10767 * xfns.c (unwind_create_frame): Fix comment.
10768 (Fx_create_frame, x_create_tip_frame):
10769 Move terminal->reference_count++ just before making the frame
10770 official. Move initialization of image_cache_refcount and
10771 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10773 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10775 Support MSVC build with newer versions of Visual Studio.
10776 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10777 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10780 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10781 which are not supported by MSVC.
10782 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10783 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10785 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10786 types in bitfields.
10787 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10789 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10791 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
10793 Support MSVC build with newer versions of Visual Studio.
10794 * w32.c: Don't include w32api.h for MSVC.
10795 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10797 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10798 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10799 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10800 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10802 (alloca) [_MSC_VER]: Define to _alloca.
10804 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10806 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10808 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10810 * xdisp.c (note_mouse_highlight): If either of
10811 previous/next-single-property-change returns nil, treat that as
10812 the beginning or the end of the buffer. (Bug#9955)
10814 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10816 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10817 label is not null (Bug#9951).
10818 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10821 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10823 * window.c (Fwindow_body_size): Mention in the doc string that the
10824 return value is in frame's canonical units. (Bug#9949)
10826 2011-11-03 Eli Zaretskii <eliz@gnu.org>
10828 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10830 * w32fns.c (unwind_create_frame): If needed, free the glyph
10831 matrices of the partially constructed frame. (Bug#9943)
10832 * xfns.c (unwind_create_frame): Likewise.
10834 2011-11-01 Eli Zaretskii <eliz@gnu.org>
10836 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10837 Don't stop backward scan on the continuation glyph, even though
10838 its CHARPOS is positive.
10839 (mouse_face_from_buffer_pos, note_mouse_highlight):
10840 Rename cover_string to disp_string.
10842 2011-11-01 Martin Rudalics <rudalics@gmx.at>
10844 * window.c (temp_output_buffer_show): Don't use
10845 Vtemp_buffer_show_specifiers.
10846 (Vtemp_buffer_show_specifiers): Remove unused variable.
10848 2011-10-30 Eli Zaretskii <eliz@gnu.org>
10850 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10851 past the beginning of the current glyph matrix.
10853 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
10855 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10856 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10857 HAVE_GTK3 (Bug#9869).
10859 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10860 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10862 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10864 * xterm.c: Declare x_handle_net_wm_state to return int.
10865 (handle_one_xevent): Check if we are iconified but don't have
10866 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10867 (get_current_wm_state): Return non-zero if not hidden,
10868 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10869 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10870 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10871 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10873 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10875 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10876 so that this new function doesn't get optimized away by a
10877 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10879 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10881 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10883 2011-10-29 Eli Zaretskii <eliz@gnu.org>
10885 Fix the `xbytecode' command.
10886 * .gdbinit (xprintbytestr): New command.
10887 (xwhichsymbols): Rename from `which'; all callers changed.
10888 (xbytecode): Print the byte-code string as well.
10890 2011-10-29 Kim Storm <storm@cua.dk>
10892 * alloc.c (which_symbols): New function.
10894 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10896 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10899 2011-10-29 Glenn Morris <rgm@gnu.org>
10901 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10902 Not clear what it was for, and it causes various bugs. (Bug#9839)
10904 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10906 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10907 possible random value that matches one of those tested as
10908 condition to clear the mouse face.
10910 2011-10-28 Chong Yidong <cyd@gnu.org>
10912 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10914 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10916 * window.c (make_window): Initialize phys_cursor_on_p.
10918 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10920 * lisp.h (struct Lisp_Symbol): Update comments.
10922 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
10924 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10926 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10928 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10929 <oslsachem@gmail.com> for helping to debug this.
10931 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10932 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10933 (g_b_init_get_glyph_outline_w): New static variables.
10934 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10935 (GetGlyphOutlineW_Proc): New typedefs.
10936 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10937 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10939 (w32font_open_internal, compute_metrics):
10940 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10941 instead of calling the "wide" APIs directly.
10943 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10945 * w32.h (syms_of_w32font): Add prototype.
10947 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10949 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10950 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10951 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10952 (Fmove_to_window_line): Doc fix.
10954 2011-10-27 Chong Yidong <cyd@gnu.org>
10956 * process.c (make_process): Set gnutls_state to NULL.
10958 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10959 non-NULL, regardless of GNUTLS_INITSTAGE.
10960 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10961 an error. Set process slots as soon as we allocate them.
10963 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10965 2011-10-27 Chong Yidong <cyd@gnu.org>
10967 * gnutls.c (emacs_gnutls_deinit): New function.
10968 Deallocate credentials structures as well as calling gnutls_deinit.
10969 (Fgnutls_deinit, Fgnutls_boot): Use it.
10971 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10972 (deactivate_process): Call emacs_gnutls_deinit.
10974 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10976 * image.c (x_create_x_image_and_pixmap):
10977 * w32.c (sys_rename, w32_delayed_load):
10978 * w32font.c (fill_in_logfont):
10979 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10981 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10983 * w32fns.c (w32_default_color_map): New function,
10984 extracted from Fw32_default_color_map.
10985 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10987 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10989 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10991 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10993 * keyboard.c (test_undefined): New function (bug#9751).
10994 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10996 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10998 * sysdep.c (init_sys_modes): Fix the check for the controlling
10999 terminal (Bug#6649).
11001 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11003 * dispextern.h (struct bidi_it): New member next_en_type.
11005 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11006 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11007 current character, check also for next_en_type being WEAK_EN.
11008 (bidi_resolve_weak): Don't enter the expensive loop if the current
11009 position is before next_en_pos. Record the bidi type of the first
11010 non-ET, non-BN character we find, in addition to its position.
11011 (bidi_level_of_next_char): Invalidate next_en_type when
11012 next_en_pos is over-stepped.
11014 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11016 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11017 * editfns.c: Rewrite current-time-zone so that it invokes
11018 the equivalent of (format-time-string "%Z") to get the time zone name.
11019 This fixes a bug when the time zone name contains characters that
11020 need converting from the system time locale to Emacs internal format.
11021 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11022 that patch fixed format-time-string to do the conversion, but
11023 I forgot to fix current-time-zone.
11024 (format_time_string): New function, containing most of
11025 what Fformat_time_string used to contain.
11026 (Fformat_time_string): Rewrite in terms of format_time_string.
11027 This doesn't change this function's behavior.
11028 (current-time-zone): Rewrite to use format_time_string.
11029 This fixes the bug reported by Michael Schierl in
11030 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11031 Jason Rumney's 2007-06-07 change worked around this bug, but
11033 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11035 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11037 * xdisp.c (start_display): If the character at POS is displayed
11038 via a display vector, reset IT->current.dpvec_index to zero.
11039 (try_window_reusing_current_matrix): If a line ends in a display
11040 vector or the next line starts in a display vector, continue
11041 redrawing the window even though the character position of
11042 start_row was reached.
11045 2011-10-18 Chong Yidong <cyd@gnu.org>
11047 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11048 with nobreak-char-display too.
11050 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11052 Fix part 3 of bug#9771.
11053 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11054 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11055 non-neutral characters if the current character is a paragraph
11056 separator (a.k.a. Newline). This avoids running the same
11057 expensive loop twice, once when we consume the preceding newline
11058 and the other time when the line actually needs to be displayed.
11059 Avoid the loop when we see neutrals on the base embedding level
11060 following a character whose directionality is the same as the
11061 paragraph's. This avoids running the expensive loop when a line
11062 ends in a long sequence of neutrals, like control characters.
11063 Add assertion against STRONG_AL type. Slightly rearrange code
11064 that determines the type of a neutral given the first non-neutral
11066 (bidi_level_of_next_char): Set next_en_pos to zero when
11067 invalidating its info.
11069 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11071 * xdisp.c (push_display_prop): Determine whether to record string
11072 or buffer position by IT->string, not by IT->method. Allow
11073 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11074 (move_it_vertically_backward): Don't look for character position
11075 immediately after the newline when in a continuation line.
11078 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11080 * window.c (coordinates_in_window): Rewrite and delabelize
11081 vertical border check. (Bug#5357) (Bug#9618)
11083 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11085 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11086 errors in XSetWindowBorder (bug#9310).
11088 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11090 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11091 avoid crash when xmalloc overrun checking is enabled.
11093 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11095 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11096 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11097 cursor motion with <left> and <right> arrow keys.
11099 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11100 some callers set that themselves.
11102 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11104 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11105 display string and the previous row comes from the same string and
11106 is empty. (Bug#9739) (Bug#9738)
11108 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11110 * doc.c (get_doc_string): Encode file name (bug#9735).
11112 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11114 * bidi.c (bidi_level_of_next_char):
11115 * xdisp.c (get_visually_first_element): Remove old incorrect
11116 comments regarding the Unicode Line Separator character.
11118 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11120 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11122 * alloc.c (Fgc_status): Do not access beyond zombies array
11123 boundary if nzombies > MAX_ZOMBIES.
11124 * alloc.c (dump_zombies): Add missing format specifier.
11126 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11128 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11129 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11131 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11132 Some packages use them to denote characters with modifiers.
11134 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11136 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11137 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11138 matching a pp-number. Rename parameter var to var1.
11140 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11142 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11144 2011-10-08 Glenn Morris <rgm@gnu.org>
11146 * callint.c (Fcall_interactively): Give a more explicit error for the
11147 'c' case with a non-character input. (Bug#8479)
11149 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11151 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11153 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11154 lines that are hscrolled on the left.
11156 * dispnew.c (buffer_posn_from_coords): Account for a possible
11157 presence of header-line. (Bug#4426)
11159 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11161 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11162 Don't advertise functionality which we discourage or doesn't work.
11164 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11166 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11167 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11168 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11169 this makes Emacs dump core during garbage collection on rare
11170 occasions. sizeof is obviously inferior to offsetof here, so
11171 stick with offsetof.
11172 (GC_POINTER_ALIGNMENT): New macro.
11173 (mark_memory): Omit 3rd (offset) arg; caller changed.
11174 Don't assume EMACS_INT alignment is the same as pointer alignment.
11176 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11178 * keyboard.c (read_key_sequence_remapped): New var.
11179 (read_key_sequence): Compute remapping in the right buffer.
11180 (command_loop_1): Use read_key_sequence's remapping directly.
11182 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11184 * dired.c (file_name_completion): Don't expand file name.
11185 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11186 before checking file name handler.
11188 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11189 they've been requested explicitly (bug#9591).
11191 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11193 * keymap.c (Fsingle_key_description): Use make_specified_string
11194 instead of build_string to build string from push_key_description.
11197 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11199 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11200 This fixes a Y2038 bug on 64-bit hosts.
11201 * buffer.c (reset_buffer):
11202 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11203 (Fclear_buffer_auto_save_failure):
11204 Use 0, not -1, to represent an unset failure time, since time_t
11205 might not be signed.
11207 Remove dependency on glibc malloc internals.
11208 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11209 Move back here from lisp.h, but with their new implementations.
11210 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11211 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11212 * charset.c (charset_table_init): New static var.
11213 (syms_of_charset): Use it instead of xmalloc. This removes a
11214 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11215 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11216 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11217 Move back to alloc.c.
11218 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11219 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11221 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11223 * nsterm.m (windowDidResize): Call x_set_window_size only when
11224 ns_in_resize is true. Otherwise set pixelwidth/height and
11225 call change_frame_size (Bug#9628).
11227 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11229 Port --enable-checking=all to Fedora 14 x86-64.
11230 * charset.c (syms_of_charset): Also account for glibc malloc's
11231 internal overhead when calculating the initial malloc maximum.
11233 Port --enable-checking=all to Fedora 14 x86.
11234 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11236 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11237 (overrun_check_realloc, overrun_check_free):
11238 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11239 That way, xmalloc returns a properly-aligned pointer even if
11240 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11241 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11242 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11243 into account when calculating the initial malloc maximum.
11244 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11245 Move here from alloc.c, so that charset.c can use it too.
11246 Properly align; the old code wasn't right for common 32-bit hosts
11247 when configured with --enable-checking=all.
11248 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11249 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11251 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11253 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11256 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11258 * xdisp.c (compute_display_string_end): If there's no display
11259 string at CHARPOS, return -1.
11261 * bidi.c (bidi_fetch_char): When compute_display_string_end
11262 returns a negative value, treat the character as a normal
11263 character not covered by a display string. (Bug#9624)
11265 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11267 * lread.c (Fread_from_string): Fix typo in docstring.
11269 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11271 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11272 newline, reseat the iterator instead of bidi-iterating there one
11273 character at a time. (Bug#9610)
11274 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11275 TO_CHARPOS if the bidi iterator is at base embedding level.
11277 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11279 * lread.c (readevalloop): Use correct code for NBSP.
11280 (read1): Likewise. (Bug#9608)
11282 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11284 * dbusbind.c (Fdbus_register_signal): When service is not
11285 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11287 2011-09-25 Glenn Morris <rgm@gnu.org>
11289 * buffer.c (truncate-lines): Doc fix.
11291 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11293 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11294 (Fset_window_next_buffers): Doc fix.
11296 2011-09-24 Glenn Morris <rgm@gnu.org>
11298 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11300 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11302 Fix minor problems found by static checking.
11303 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11304 * indent.c (Fvertical_motion): Fix == vs = typo.
11306 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11308 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11309 Default value is now t. Doc fix.
11311 * indent.c (Fvertical_motion): Compute and apply the overshoot
11312 logic when moving up, not only when moving down. Fix the
11313 confusing name and values of the it_overshoot_expected variable;
11314 logic changes accordingly. (Bug#9254) (Bug#9549)
11316 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11317 CHARPOS is covered by a display string which includes newlines.
11318 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11319 is covered by a display string with embedded newlines.
11321 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11323 * dbusbind.c (Fdbus_register_signal): Add match rule to
11324 Vdbus_registered_objects_table. (Bug#9581)
11325 (Fdbus_register_method, Vdbus_registered_objects_table):
11328 2011-09-24 Jim Meyering <meyering@redhat.com>
11330 do not ignore write error for any output size
11331 The previous change was incomplete.
11332 While it makes emacs --batch detect the vast majority of stdout
11333 write failures, errors were still ignored whenever the output size is
11334 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11335 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11336 && echo FAIL: ignored write error
11337 FAIL: ignored write error
11338 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11339 && echo FAIL: ignored write error
11340 FAIL: ignored write error
11341 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11343 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11345 * emacs.c (Fkill_emacs): In noninteractive mode exit
11346 non-successfully if a write error occurred on stdout. (Bug#9574)
11348 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11350 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11353 * dispextern.h (struct it): Update the comment documenting what
11356 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11358 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11359 a display string, extend search for cursor position to end of row.
11360 (find_row_edges): If the row ends in a newline from a display
11361 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11362 Handle the case of a display string with multiple newlines.
11363 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11364 non-empty line. Fixes confusing cursor motion with arrow keys at
11365 the beginning of a line that starts with whitespace.
11367 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11369 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11372 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11374 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11375 boolean (Bug#9154).
11377 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11379 * xdisp.c (display_line): Record maximum and minimum buffer
11380 positions even if no glyphs were produced (e.g., by a zero-width
11381 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11382 buffer positions that will be removed from the glyph row because
11384 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11385 column is beyond frame width: don't subtract 1 "pixel" when
11386 computing width of the stretch.
11387 (reseat_at_next_visible_line_start): Undo the change made on
11388 2011-09-17 that saved paragraph information and restored it after
11389 the call to `reseat'. (Bug#9545)
11391 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11393 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11394 and turn window cursor on if cleared (Bug#9415).
11396 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11398 * search.c (boyer_moore): Take unibyte characters from pattern
11399 literally. (Bug#9458)
11401 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11403 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11405 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11407 Fix minor problem found by static checking.
11408 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11409 initialized, to pacify gcc -Wuninitialized.
11411 * fileio.c: Report proper errno when syscall falls.
11412 (Finsert_file_contents): Save and restore errno,
11413 so that report_file_error outputs the correct diagnostic.
11414 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11416 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11418 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11420 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11422 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11423 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11425 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11427 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11428 about the current paragraph and restore it after the call to reseat.
11430 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11431 (bidi_find_paragraph_start): Search back for paragraph beginning
11432 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11433 (bidi_move_to_visually_next): Only trigger paragraph-related
11434 computations when the last character is a newline or at EOB, not
11435 just any NEUTRAL_B. (Bug#9470)
11437 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11438 truncated lines if point is covered by a display string. (Bug#9524)
11440 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11442 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11443 (cons_to_x_long): New function.
11444 (lisp_data_to_selection_data): Use it. Correct the test for
11445 short-versus-long data; it was negated. Break out of vector
11446 loop, for efficiency, when a long datum is discovered.
11448 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11450 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11452 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11454 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11455 GCC PR/17406) by declaring this function with external scope.
11457 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11459 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11460 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11462 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11464 * editfns.c (Fformat): Correctly handle text properties on "%%".
11466 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11468 * xterm.c (x_draw_composite_glyph_string_foreground):
11469 * w32term.c (x_draw_composite_glyph_string_foreground):
11470 * term.c (encode_terminal_code):
11471 * composite.c (composition_update_it, get_composition_id):
11472 * xdisp.c (get_next_display_element)
11473 (fill_composite_glyph_string): Add comments about special meaning
11474 of TAB characters in a composition.
11476 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11478 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11479 This occurs when processing a multibyte format.
11480 Problem reported by Wolfgang Jenker.
11482 2011-09-15 Johan Bockgård <bojohan@gnu.org>
11484 * xdisp.c (try_cursor_movement): Only check for exact match if
11485 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11487 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11489 Remove unused external symbols.
11490 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11491 * xdisp.c (calc_pixel_width_or_height): Now static.
11492 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11493 * indent.c (check_display_width):
11494 * w32term.c: Fix comment to match code.
11495 * xterm.c, xterm.h (x_catching_errors): Remove.
11497 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11499 * xselect.c: Use signed conversions more consistently (Bug#9498).
11500 (selection_data_to_lisp_data): Assume incoming selection data are
11501 signed integers, not unsigned. This is to be consistent with
11502 outgoing selection data, which was modified to use signed integers
11503 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11504 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11505 expects long, not unsigned long.
11507 2011-09-14 Eli Zaretskii <eliz@gnu.org>
11509 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11510 computation of loop end. Reported by Johan Bockgård
11513 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
11515 * frame.c (Fother_visible_frames_p): Function deleted.
11517 2011-09-12 Eli Zaretskii <eliz@gnu.org>
11519 * indent.c (compute_motion): Process display vector front to back
11520 rather than the other way around. (Bug#2496)
11522 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11524 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11526 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11528 * minibuf.c (Fread_from_minibuffer): Doc fix.
11530 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11532 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11533 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11535 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11537 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11538 value for non-existent files.
11540 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11542 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11543 set its "size" to -1. This will set the modtime_size field of
11544 the corresponding buffer to -1, which is what
11545 verify-visited-file-modtime expects for files that do not exist.
11548 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11550 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11552 * lisp.h: ... from here. push_key_description is no longer
11553 defined in keyboard.c, so its declaration should not be in
11554 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11555 logically belongs with push_key_description.
11557 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11559 * buffer.h: Include <sys/types.h> instead of <time.h>.
11560 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11561 Problem reported by Herbert J. Skuhra.
11563 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11565 * xml.c (parse_region): Make the parsing work for
11566 non-comment-starting XML files again (bug#9144).
11568 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11570 * image.c (gif_load): Fix calculation of bottom and right corner.
11573 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11575 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11576 redisplay in small windows.
11578 2011-09-09 Eli Zaretskii <eliz@gnu.org>
11580 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11582 2011-09-08 Martin Rudalics <rudalics@gmx.at>
11584 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11585 Operate on live windows only.
11587 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
11589 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11591 2011-09-07 Eli Zaretskii <eliz@gnu.org>
11593 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11594 only under bidi iteration.
11596 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11598 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11600 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11602 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11603 Without this fix, the command to link temacs failed due to an
11604 undefined symbol __builtin_isnan. This is because
11605 /usr/include/iso/math_c99.h #defines isnan(x) to
11606 __builtin_isnan(x), but the bundled gcc, which identifies itself
11607 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11609 * floatfns.c (isnan): #undef, and then #define to a clone of
11611 (Fisnan): Always define, since it's always available now.
11612 (syms_of_floatfns): Always define isnan at the Lisp level.
11614 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11616 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11618 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11620 * fileio.c: Fix bugs with large file offsets (Bug#9428).
11621 The previous code assumed that file offsets (off_t values) fit in
11622 EMACS_INT variables, which is not true on typical 32-bit hosts.
11623 The code messed up by falsely reporting buffer overflow in cases
11624 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11625 when "big" contains more than 2**29 bytes, even though this
11626 inserts just one byte and does not overflow the buffer.
11627 (Finsert_file_contents): Store file offsets as off_t
11628 values, not as EMACS_INT values. Check for overflow when
11629 converting between EMACS_INT and off_t. When checking for
11630 buffer overflow or for overlap, take the offsets into account.
11631 Don't use EMACS_INT for small values where int suffices.
11632 When checking for overlap, fix a typo: ZV was used where
11633 ZV_BYTE was intended.
11634 (Fwrite_region): Don't assume off_t fits into 'long'.
11635 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11637 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
11639 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11641 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11643 sprintf-related integer and memory overflow issues (Bug#9412).
11645 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11646 (esprintf, exprintf, evxprintf): New functions.
11647 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11648 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11649 (modify_event_symbol): Do not assume that the length of
11650 name_alist_or_stem is safe to alloca and fits in int.
11651 (Fexecute_extended_command): Likewise for function name and binding.
11652 (Frecursion_depth): Wrap around reliably on integer overflow.
11653 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11654 since some callers pass EMACS_INT values.
11655 (Fsingle_key_description): Don't crash if symbol name contains more
11656 than MAX_ALLOCA bytes.
11657 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11658 (get_minibuffer): Arg is now EMACS_INT, not int.
11659 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11660 (esprintf, exprintf, evxprintf): New decls.
11661 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11663 * dbusbind.c (signature_cat): New function.
11664 (xd_signature, Fdbus_register_signal):
11665 Do not overrun buffer; instead, report string overflow.
11667 * dispnew.c (add_window_display_history): Don't overrun buffer.
11668 Truncate instead; this is OK since it's just a log.
11670 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11671 even if the time zone offset is outlandishly large.
11672 Don't mishandle offset == INT_MIN.
11674 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11675 when creating daemon; the previous buffer-overflow check was incorrect.
11677 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11678 which has the guts of the old verror function.
11680 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11681 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11683 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11684 (font_unparse_xlfd): Don't blindly alloca long strings.
11685 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11686 fits in int, when using sprintf. Use single snprintf to count
11687 length of string rather than counting it via multiple sprintfs;
11688 that's simpler and more reliable.
11689 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11690 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11691 sprintf, in case result does not fit in int.
11693 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11694 (fontset_from_font): Print it.
11696 * frame.c (tty_frame_count): Now printmax_t, not int.
11697 (make_terminal_frame, set_term_frame_name): Print it.
11698 (x_report_frame_params): In X, window IDs are unsigned long,
11699 not signed long, so print them as unsigned.
11700 (validate_x_resource_name): Check for implausibly long names,
11701 and don't assume name length fits in 'int'.
11702 (x_get_resource_string): Don't blindly alloca invocation name;
11703 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11706 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11707 (xg_check_special_colors, xg_set_geometry):
11708 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11710 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11711 Use esprintf, not sprintf, in case result does not fit in int.
11713 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11714 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11715 it as a large positive number.
11716 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11717 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11719 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11720 in case result does not fit in int.
11722 * print.c (float_to_string): Detect width overflow more reliably.
11723 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11724 buffer overrun. Don't assume list length fits in 'int'. Treat
11725 print length of 0 as 0, not as infinity; to be consistent with other
11726 uses of print length in this function. Don't overflow print length
11727 index. Don't assume hash table size fits in 'long', or that
11728 vectorlike size fits in 'unsigned long'.
11730 * process.c (make_process): Use printmax_t, not int, to format
11731 process-name gensyms.
11733 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11735 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11736 to avoid potential buffer overrun.
11738 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11739 if X resource line is longer than 512 bytes.
11741 * xfns.c (x_window): Make sprintf buffer a bit bigger
11742 to avoid potential buffer overrun.
11744 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11746 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11748 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11750 Integer overflow fixes for scrolling, etc.
11751 Without these, Emacs silently mishandles large integers sometimes.
11752 For example, "C-u 4294967297 M-x recenter" was treated as if
11753 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11755 * xdisp.c (try_window_id): Check Emacs fixnum range before
11756 converting to 'int'.
11758 * window.c (window_scroll_line_based, Frecenter):
11759 Check that an Emacs fixnum is in range before assigning it to 'int'.
11760 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11761 values converted from Emacs fixnums.
11762 (Frecenter): Don't wrap around a line count if it is out of 'int'
11763 range; instead, treat it as an extreme value.
11764 (Fset_window_configuration, compare_window_configurations):
11765 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11767 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11768 that can exceed INT_MAX. Check that EMACS_INT value is in range
11769 before assigning it to the (possibly-narrower) index.
11770 (match_limit): Don't assume that a fixnum can fit in 'int'.
11772 * print.c (print_object): Use ptrdiff_t, not int, for index that can
11775 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11776 (Fvertical_motion): Don't wrap around LINES values that don't fit
11777 in 'int'. Instead, treat them as extreme values. This is good
11778 enough for windows, which can't have more than INT_MAX lines anyway.
11780 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11782 * Require libxml/parser.h to avoid compilation warning.
11784 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11786 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11787 since this reportedly can destroy thread storage.
11789 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
11791 * syntax.c (find_defun_start): Update all cache variables if
11792 exiting early (Bug#9401).
11794 2011-08-30 Eli Zaretskii <eliz@gnu.org>
11796 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11798 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11799 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11800 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11802 * term.c (tty_append_glyph): New function.
11803 (produce_stretch_glyph): Static function and its prototype deleted.
11805 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11808 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11810 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11811 when checking :margin (Bug#9390).
11812 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11813 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11814 so that the name doesn't mislead. All uses changed.
11816 2011-08-28 Johan Bockgård <bojohan@gnu.org>
11818 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11821 2011-08-27 Eli Zaretskii <eliz@gnu.org>
11823 * xdisp.c (move_it_to): Don't bail out early when reaching
11824 position beyond to_charpos, if we are scanning backwards.
11825 (move_it_vertically_backward): When DY == 0, make sure we get to
11826 the first character in the line after the newline.
11828 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11830 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11831 (ccl_driver): Do not generate an out-of-range pointer.
11832 (Fccl_execute_on_string): Remove unnecessary check for
11833 integer overflow, noted by Stefan Monnier in
11834 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11835 Remove a FIXME that didn't need fixing.
11836 Simplify the newly-introduced buffer reallocation code.
11838 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
11840 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11842 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
11844 Integer and memory overflow issues (Bug#9196).
11846 * doc.c (get_doc_string): Rework so that
11847 get_doc_string_buffer_size is the actual buffer size, rather than
11848 being 1 less than the actual buffer size; this makes xpalloc more
11851 * image.c (x_allocate_bitmap_record, cache_image):
11852 * xselect.c (Fx_register_dnd_atom):
11853 Simplify previous changes by using xpalloc.
11855 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11856 since either will do and ptrdiff_t is convenient with xpalloc.
11858 * charset.c (charset_table_size)
11859 (struct charset_sort_data.priority): Now ptrdiff_t.
11860 (charset_compare): Don't overflow if priorities differ greatly.
11861 (Fsort_charsets): Don't assume list length fits in int.
11862 Check for size-calculation overflow when allocating sort data.
11863 (syms_of_charset): Allocate an initial charset table that is
11864 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11866 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11868 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11869 The actual value is always <= INT_MAX, and leaving it unsigned made
11870 overflow checking harder.
11872 * dispextern.h (struct glyph_matrix.rows_allocated)
11873 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11874 with xpalloc. The values are still always <= INT_MAX.
11876 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11878 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11879 (SAFE_NALLOCA): New macro.
11881 * region-cache.c (struct boundary.pos, find_cache_boundary)
11882 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11883 (set_cache_region, invalidate_region_cache)
11884 (revalidate_region_cache, know_region_cache, region_cache_forward)
11885 (region_cache_backward, pp_cache):
11886 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11887 so that ptrdiff_t * can be passed to xpalloc.
11888 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11889 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11890 (pp_cache): Don't assume cache_len fits in int.
11891 * region-cache.h: Adjust extern decls to match.
11893 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11894 EMACS_INT, since either will do, for xpalloc.
11896 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11897 (xnmalloc, xnrealloc, xpalloc): New functions.
11899 * bidi.c (bidi_shelve_header_size): New constant.
11900 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11901 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11903 * bidi.c (bidi_cache_shrink):
11904 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11906 Don't update size of array until after memory allocation succeeds,
11907 because xmalloc/xrealloc may not return.
11908 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11909 now that we have proper integer overflow checking.
11910 (record_overlay_string, overlay_strings): Catch overflows when
11911 calculating size of overlay_str_buf.
11913 * callproc.c (Fcall_process): Check for size overflow when
11914 calculating size of args2.
11915 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11916 Normally we prefer signed values, but sticking with ptrdiff_t would
11917 require adding more-complicated checks.
11919 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11920 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11921 Redo buffer-overflow calculations to avoid integer overflow.
11922 Add a FIXME comment where memory seems to be over-allocated.
11924 * character.c (Fstring): Check for size-calculation overflow.
11926 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11927 unnecessary integer overflow. Check for size overflow.
11928 (encode_coding_object): Don't update size until xmalloc succeeds.
11930 * composite.c (get_composition_id): Check for overflow in glyph
11931 length calculations.
11933 Integer and memory overflow fixes for display code.
11934 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11935 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11936 (scrolling_window): Check for overflow in size calculations.
11937 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11938 Don't assume glyph table len fits in int.
11939 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11940 (row_table_size): Now ptrdiff_t, not int.
11941 (scrolling_window): Avoid overflow in size calculations.
11942 Don't update size until allocation succeeds.
11943 * fns.c (concat): Check for overflow in size calculations.
11944 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11945 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11946 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11948 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11949 (get_doc_string): Check for size calculation overflow.
11950 Don't update size until allocation succeeds.
11951 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11952 EMACS_INT, where ptrdiff_t will do.
11953 (Fsubstitute_command_keys): Check for string overflow.
11955 * editfns.c (set_time_zone_rule): Don't assume environment length
11957 (message_length): Now ptrdiff_t, not int.
11958 (Fmessage_box): Don't update size until allocation succeeds.
11959 Don't assume message length fits in int.
11960 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11962 * emacs.c (main): Do not reallocate argv, since there is a null at
11963 the end that can be overwritten, and this way there's no need to
11964 worry about size-calculation overflow.
11965 (sort_args): Check for size-calculation overflow.
11967 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11969 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11971 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11972 (x_set_scroll_bar_width, x_figure_window_size):
11973 Check for integer overflow.
11974 (x_set_alpha): Do not assume XINT fits in int.
11976 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11977 This is for the members text_lines, text_cols, total_lines, total_cols,
11978 where the system imposes an 'int' limit.
11980 * fringe.c (Fdefine_fringe_bitmap):
11981 Don't update size until alloc works.
11983 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11984 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11986 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11987 Check for size-calculation overflow.
11988 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11989 do, as we prefer signed integers.
11990 (id_to_widget.max_size, id_to_widget.used)
11991 (xg_store_widget_in_map, xg_remove_widget_from_map)
11992 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11993 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11994 Use and return ptrdiff_t, not int.
11995 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11996 * gtkutil.h: Change prototypes to match the above.
11998 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11999 are duplicate now that they've been promoted to lisp.h.
12000 (x_allocate_bitmap_record, x_alloc_image_color)
12001 (make_image_cache, cache_image, xpm_load):
12002 Don't update size until alloc is done.
12003 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12005 Check for size calculation overflow.
12006 (ct_colors_allocated_max): New constant.
12007 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12010 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12011 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12012 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12013 Use ptrdiff_t, not int, to count maps.
12014 (read_char_minibuf_menu_prompt): Check for overflow in size
12015 calculations. Don't update size until allocation succeeds.
12016 Redo calculations to avoid overflow.
12017 * keyboard.h: Change prototypes to match the above.
12019 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12021 (current_minor_maps): Check for size calculation overflow.
12022 * keymap.h: Change prototypes to match the above.
12024 * lread.c (read1, init_obarray): Don't update size until alloc done.
12026 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12027 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12029 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12030 Now ptrdiff_t, not int.
12031 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12032 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12034 * process.c (Fnetwork_interface_list): Check for overflow
12035 in size calculation.
12037 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12039 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12040 overflow. Don't bother calling xmalloc when xrealloc will do.
12042 * search.c (Freplace_match): Check for size calculation overflow.
12043 (Fset_match_data): Don't assume list lengths fit in 'int'.
12045 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12046 for command line length. Do not attempt to address one before the
12047 beginning of an array, as that's not portable.
12049 * term.c (max_frame_lines): Remove; unused.
12050 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12052 (encode_terminal_code, calculate_costs): Check for size
12053 calculation overflow.
12054 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12055 table lengths and related sizes. Don't update size until alloc
12056 done. Redo calculations to avoid overflow.
12057 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12059 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12060 subtracting pointers.
12061 (gobble_line): Check for overflow more carefully. Don't update size
12064 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12065 Don't update size until alloc done.
12066 Redo size calculations to avoid overflow.
12067 Check for size calculation overflow.
12068 (main) [DEBUG]: Fix typo in invoking tparam1.
12070 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12071 Use ptrdiff_t, not int, for sizes.
12072 (store_mode_line_noprop_char): Don't update size until alloc done.
12074 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12075 Use ptrdiff_t, not int, for sizes.
12076 (Finternal_make_lisp_face, cache_face):
12077 Check for size calculation overflow.
12078 (cache_face): Treat size calculation overflows as if they were
12079 memory exhaustion (the usual treatment), rather than aborting.
12081 * xfns.c (x_encode_text, x_set_name_internal)
12082 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12083 sizes, since they can exceed INT_MAX in size. Check for size
12084 calculation overflow.
12086 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12087 (xg_select): Check for size calculation overflow.
12088 Don't update size until alloc done.
12090 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12091 as sprintf is limited to int lengths.
12093 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12094 (X_LONG_MIN): New macros.
12095 Use them to make the following changes clearer.
12096 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12097 This change doesn't affect the value now, but it may help remind
12098 future maintainers not to raise the value too much later.
12099 (SELECTION_QUANTUM): Remove, replacing with ...
12100 (selection_quantum): ... new function, which avoids overflow.
12102 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12103 assumption that selection length fits in 'int'.
12104 (x_reply_selection_request, x_handle_selection_request)
12105 (x_get_window_property, receive_incremental_selection)
12106 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12107 (lisp_data_to_selection_data, clean_local_selection_data):
12108 Use ptrdiff_t, not int, to record length of selection.
12109 (x_reply_selection_request, x_get_window_property)
12110 (receive_incremental_selection, x_property_data_to_lisp):
12111 Redo calculations to avoid overflow.
12112 (x_reply_selection_request): When sending hint, ceiling it at
12113 X_LONG_MAX rather than relying on wraparound overflow to send
12115 (x_get_window_property, receive_incremental_selection)
12116 (lisp_data_to_selection_data, x_property_data_to_lisp):
12117 Check for size-calculation overflow.
12118 (x_get_window_property, receive_incremental_selection)
12119 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12120 Don't store size until memory allocation succeeds.
12121 (x_get_window_property): Plug memory leak on memory exhaustion.
12122 Don't double-block input; malloc is safe here. Don't assume 2**34
12123 - 4 fits in unsigned long. Add an xassert to check
12124 XGetWindowProperty overflow. Be more careful about overflow
12125 calculations, and distinguish size from memory overflow better.
12126 (receive_incremental_selection): When tracing, don't assume
12127 unsigned int is less than INT_MAX.
12128 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12129 harmful) conversions of unsigned short to int.
12130 (lisp_data_to_selection_data): Don't assume that integers
12131 in the range -65535 through -1 fit in an X unsigned short.
12132 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12133 result parameters unless successful. Rely on cons_to_unsigned
12134 to report problems with elements; the old code wasn't right anyway.
12135 (x_check_property_data): Check for int overflow; we cannot use
12136 a wider type due to X limits.
12137 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12139 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12141 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12142 (x_term_init): Check for size calculation overflow.
12143 (x_color_cells): Don't store size until memory allocation succeeds.
12144 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12145 Don't assume alloca size is less than MAX_ALLOCA.
12146 (x_term_init): Don't assume length fits in int (sprintf is limited
12149 Use ptrdiff_t for composition IDs.
12150 * character.c (lisp_string_width):
12151 * composite.c (composition_table_size, n_compositions)
12152 (get_composition_id, composition_gstring_from_id):
12153 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12154 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12155 * window.c (Frecenter):
12156 Use ptrdiff_t, not int, for composition IDs.
12157 * composite.c (get_composition_id): Check for integer overflow.
12158 * composite.h: Adjust prototypes to match the above changes.
12160 Use ptrdiff_t for hash table indexes.
12161 * category.c (hash_get_category_set):
12162 * ccl.c (ccl_driver):
12163 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12164 * coding.c (coding_system_charset_list, detect_coding_system):
12165 * coding.h (struct coding_system.id):
12166 * composite.c (get_composition_id, gstring_lookup_cache):
12167 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12168 * image.c (xpm_get_color_table_h):
12169 * lisp.h (hash_lookup, hash_put):
12170 * minibuf.c (Ftest_completion):
12171 Use ptrdiff_t for hash table indexes, not int (which is too
12172 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12173 32-bit --with-wide-int hosts).
12175 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12176 Add a FIXME comment about memory leaks.
12177 (syms_of_charset): Don't assume xmalloc returns.
12179 Don't assume that stated character widths fit in int.
12180 * character.c (Fchar_width, c_string_width, lisp_string_width):
12181 * character.h (CHAR_WIDTH):
12182 * indent.c (MULTIBYTE_BYTES_WIDTH):
12183 Use sanitize_char_width to avoid undefined and/or bad behavior
12184 with outlandish widths.
12185 * character.h (sanitize_tab_width): Rename from sanitize_width,
12186 now that we have two such functions. All uses changed.
12187 (sanitize_char_width): New inline function.
12189 Don't assume that tab-width fits in int.
12190 * character.h (sanitize_width): New inline function.
12191 (SANE_TAB_WIDTH): New macro.
12192 (ASCII_CHAR_WIDTH): Use it.
12193 * indent.c (sane_tab_width): Remove. All uses replaced by
12194 SANE_TAB_WIDTH (current_buffer).
12195 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12197 * fileio.c: Integer overflow issues with file modes.
12198 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12200 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12201 Remove unreachable code.
12202 (read_hex, load_charset_map_from_file): Check for integer overflow.
12204 * xterm.c: Don't go over XClientMessageEvent limit.
12205 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12206 (x_send_scroll_bar_event): Likewise. Check that the size does not
12207 exceed limits imposed by XClientMessageEvent, as well as the usual
12208 ptrdiff_t and size_t limits.
12210 * keyboard.c: Overflow, signedness and related fixes.
12211 (make_lispy_movement): Use same integer type in forward decl
12212 that is used in the definition.
12213 (read_key_sequence, keyremap_step):
12214 Change bufsize argument back to int, undoing my 2011-03-30 change.
12215 We prefer signed types, and int is wide enough here.
12216 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12217 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12218 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12219 length, not size_t. Use ptrdiff_t for index, not int.
12220 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12221 possibility of integer overflow.
12223 Overflow, signedness and related fixes for images.
12225 * dispextern.h (struct it.stack[0].u.image.image_id)
12226 (struct_it.image_id, struct image.id, struct image_cache.size)
12227 (struct image_cache.used, struct image_cache.ref_count):
12228 * gtkutil.c (update_frame_tool_bar):
12229 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12230 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12231 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12232 * nsmenu.m (update_frame_tool_bar):
12233 * xdisp.c (calc_pixel_width_or_height):
12234 * xfns.c (image_cache_refcount):
12235 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12236 on typical 64-bit hosts.
12238 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12239 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12240 Omit unnecessary casts to int.
12241 (parse_image_spec): Check that integers fall into 'int' range
12242 when the callers expect that.
12243 (image_ascent): Redo ascent calculation to avoid int overflow.
12244 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12245 (lookup_image): Remove unnecessary tests.
12246 (xbm_image_p): Locals are now of int, not EMACS_INT,
12247 since parse_image_check makes sure they fit into int.
12248 (png_load, gif_load, svg_load_image):
12249 Prefer int to unsigned where either will do.
12250 (tiff_handler): New function, combining the cores of the
12251 old tiff_error_handler and tiff_warning_handler.
12252 This function is rewritten to use vsnprintf and thereby avoid
12253 stack buffer overflows. It uses only the features of vsnprintf
12254 that are common to both POSIX and native Microsoft.
12255 (tiff_error_handler, tiff_warning_handler): Use it.
12256 (tiff_load, gif_load, imagemagick_load_image):
12257 Don't assume :index value fits in 'int'.
12258 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12259 (imagemagick_load_image): Check that crop parameters fit into
12260 the integer types that MagickCropImage accepts. Don't assume
12261 Vimagemagick_render_type has a nonnegative value. Don't assume
12262 size_t fits in 'long'.
12263 (gs_load): Use printmax_t to print the widest integers possible.
12264 Check for integer overflow when computing image height and width.
12266 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12268 * xdisp.c (redisplay_window): Don't force window start if point
12269 will be invisible in the resulting window. (Bug#9324)
12271 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12273 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12274 the display spec is of the form `(space ...)'.
12275 (handle_display_spec): Return the value returned by
12276 handle_single_display_spec, not just 1 or zero.
12277 (handle_single_display_spec): If the display spec is of the form
12278 `(space ...)', and specifies display in the text area, return 2
12280 (try_cursor_movement): Check for the need to scroll more
12281 accurately, and prefer exact match for point under bidi.
12282 Don't advance `row' beyond the last row of the window.
12284 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12285 into disp_prop; all users changed.
12287 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12288 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12289 for the text covered by the display property.
12291 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12293 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12294 Change return value to nil.
12295 (Frecord_buffer): Delete unused function.
12297 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12299 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12300 buffers, return left-to-right.
12301 (set_cursor_from_row): Consider candidate row a win if its glyph
12302 represents a newline and point is on that newline. Fixes cursor
12303 positioning on the newline at EOL of R2L text within L2R
12304 paragraph, and vice versa.
12305 (try_cursor_movement): Check continued rows, in addition to
12306 continuation rows. Fixes unwarranted scroll when point enters a
12307 continued line of R2L text within an L2R paragraph, or vice versa.
12308 (cursor_row_p): Consider the case of point being equal to
12309 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12310 from the end of a short line to the beginning of a continued line
12311 of R2L text within L2R paragraph.
12312 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12313 composed characters.
12315 * bidi.c (bidi_check_type): Use xassert.
12316 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12319 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12321 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12324 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12326 * nsfont.m (ns_otf_to_script): Fix typo.
12328 2011-08-22 Kenichi Handa <handa@m17n.org>
12330 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12331 extra slot even if the purpose is char-code-property-table.
12333 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12335 * xdisp.c (redisplay_window): When computing centering_position,
12336 account for the height of the header line. (Bug#8874)
12338 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12339 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12340 candidate is selected by the mouse, and that candidate has a
12341 composed character under the mouse.
12343 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12344 coordinates reported by pos-visible-in-window-p for a composed
12345 character in column zero.
12347 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12349 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12351 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12353 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12354 consider it a hit if to_charpos is anywhere in the range of the
12355 composed buffer positions.
12357 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12359 * image.c (gif_load): Don't assume that each subimage has the same
12360 dimensions as the base image. Handle disposal method that is
12361 "undefined" by the gif spec (Bug#9335).
12363 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12365 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12366 (Fcondition_case): Document `debug' symbol in error handler.
12368 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12370 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12371 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12372 from an Org mode buffer to a Speedbar frame.
12374 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12375 a composition, take its buffer position from IT->cmp_it.charpos.
12376 Fixes cursor positioning at the beginning of a line that begins
12377 with a composed character.
12379 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12381 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12382 character bidirectional type, use STRONG_L instead. Fixes crashes
12383 in a buffer produced by `describe-categories'.
12385 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12386 members before the level stack, so they would be saved and
12387 restored when copying iterator state. Fixes incorrect reordering
12388 around TABs covered by display properties.
12390 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12392 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12394 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12396 * eval.c (internal_condition_case, internal_condition_case_1)
12397 (internal_condition_case_2, internal_condition_case_n):
12398 Remove unnecessary aborts (Bug#9081).
12400 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12402 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12403 has no `load' handler, try opening the file locally. (Bug#9311)
12405 2011-08-16 Ken Brown <kbrown@cornell.edu>
12407 * gmalloc.c: Expand comment.
12409 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12411 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12412 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12414 2011-08-16 Ken Brown <kbrown@cornell.edu>
12416 Fix memory allocation problems in Cygwin build (Bug#9273).
12418 * unexcw.c ( __malloc_initialized): Declare external variable.
12419 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12421 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12423 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12425 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12426 in the static heap.
12427 [CYGWIN] (special_realloc): New function.
12428 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12429 requests to realloc storage in the static heap.
12431 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12433 * bidi.c (bidi_initialize): Remove unused local.
12435 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12438 * biditype.h: Remove file.
12439 * makefile.w32-in ($(BLD)/bidi.$(O)):
12440 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12442 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12444 * chartab.c: Improve commentary for the uniprop_table API.
12446 * bidi.c (bidi_paragraph_init): Support zero value of
12447 bidi_ignore_explicit_marks_for_paragraph_level.
12448 (bidi_initialize): Use uniprop_table instead of including
12449 biditype.h and bidimirror.h.
12451 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12452 coordinates of the iterator when restoring from ppos_it.
12455 2011-08-14 Kenichi Handa <handa@m17n.org>
12457 * process.c (create_process): Call setup_process_coding_systems
12458 after the pid of the process is set to -1 (Bug#8162).
12460 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12462 * xdisp.c (move_it_in_display_line_to): Don't invoke
12463 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12464 ppos_it. Fixes vertical cursor motion when line beginning is
12465 covered by an image. (Bug#9296)
12467 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12469 * nsterm.h (ns_run_ascript): Declare.
12470 (NSAPP_DATA2_RUNASSCRIPT): Define.
12472 * nsfns.m (as_script, as_result, as_status): New static variables.
12473 (ns_run_ascript): New function.
12474 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12475 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12476 the event loop. Get status from as_status (Bug#7276).
12478 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12479 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12480 the event loop (Bug#7276).
12482 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12484 * gnutls.c (QCgnutls_bootprop_priority)
12485 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12486 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12487 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12488 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12489 (QCgnutls_bootprop_verify_hostname_error)
12490 (QCgnutls_bootprop_callbacks_verify): Rename from
12491 Qgnutls_bootprop_..., all uses changed.
12493 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12496 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12498 * xfaces.c (Qframe_set_background_mode): Now static.
12499 * dispextern.h (Qframe_set_background_mode): Remove decl.
12501 * process.c (Fnetwork_interface_info): Declare local only if needed.
12503 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12505 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12506 (Fnetwork_interface_list): Allocate in increments of bytes instead
12507 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12508 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12510 (struct ifflag_def): notrailers is smart on OSX.
12511 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12512 Get hardware address with getifaddrs if available.
12514 2011-08-12 Eli Zaretskii <eliz@gnu.org>
12516 * xdisp.c (iterate_out_of_display_property): xassert that
12517 IT->position is set to within IT->object's boundaries. Break from
12518 the loop as soon as EOB is reached; avoids infloops in redisplay
12519 when IT->position is set up wrongly due to some bug.
12520 Set IT->current to match the bidi iterator unconditionally.
12521 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12522 entry. Force push_it to save on the stack the current
12523 buffer/string position, to be restored by pop_it. Fix flags in
12524 the iterator structure wrt the object coming from a display
12525 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12526 properties. (Bug#9284)
12528 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12530 * fontset.c (fontset_get_font_group): Add proper type checks.
12533 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12535 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12536 and LC_VERSION_MIN_MACOSX.
12537 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12538 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12540 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12542 * xdisp.c (forward_to_next_line_start): Allow to use the
12543 no-display-properties-and-no-overlays under bidi display.
12544 Set disp_pos in the bidi iterator to avoid searches for display
12545 properties and overlays.
12547 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12549 * editfns.c (Fset_time_zone_rule): Document relationship with the
12552 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12553 the font entity extracted from the cache (Bug#8109).
12555 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12557 * composite.c (autocmp_chars): Don't reset point. That is done by
12558 restore_point_unwind (Bug#5984).
12560 2011-08-07 Juri Linkov <juri@jurta.org>
12562 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12563 to show the arg `TIME' instead of `TIMEVAL'.
12565 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12567 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12568 display property strides EOL and includes a newline, as in
12569 longlines-mode. (Bug#9254)
12570 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12571 word-wrap under bidirectional display. (Bug#9224)
12573 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12574 is non-zero, even if the data buffer is NULL. Fixes a crash in
12575 vertical-motion with longlines-mode. (Bug#9254)
12577 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12579 * bidi.c <bidi_cache_total_alloc>: Now static.
12580 (bidi_initialize): Initialize bidi_cache_total_alloc.
12582 * xdisp.c (display_line): Release buffer allocated for shelved bidi
12585 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12586 amount allocated this far in `bidi_cache_total_alloc'.
12587 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12588 non-zero, only free the data buffer without restoring the cache
12589 contents. All callers changed.
12591 * dispextern.h (bidi_unshelve_cache): Update prototype.
12593 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12594 (move_it_in_display_line, move_it_to)
12595 (move_it_vertically_backward, move_it_by_lines): Replace the call
12596 to xfree to an equivalent call to bidi_unshelve_cache.
12597 (move_it_in_display_line_to): Fix logic of returning
12598 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12600 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12602 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12603 came from a string character with a `cursor' property. (Bug#9229)
12605 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12607 * Makefile.in (LIB_PTHREAD): New variable.
12608 (LIBES): Add LIB_PTHREAD (Bug#9216).
12610 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12611 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12613 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12615 * regex.c (re_iswctype): Remove some redundant boolean conversions.
12617 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12619 * xterm.c (x_find_topmost_parent): New function.
12620 (x_set_frame_alpha): Find topmost parent window with
12621 x_find_topmost_parent and set the property there also (bug#9181).
12622 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12624 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12626 * callproc.c (Fcall_process): Avoid vfork clobbering
12627 the local vars buffer, coding_systems, current_dir.
12629 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12631 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12633 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12635 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12636 so that it is not optimized away.
12638 * xdisp.c (compute_display_string_pos): Remove unused local.
12640 2011-08-02 Eli Zaretskii <eliz@gnu.org>
12642 Fix slow cursor motion and scrolling in large buffers with
12643 selective display, like Org Mode buffers. (Bug#9218)
12645 * dispextern.h (struct bidi_it): New member disp_prop_p.
12647 * xdisp.c: Remove one-slot cache of display string positions.
12648 (compute_display_string_pos): Accept an additional argument
12649 DISP_PROP_P; callers changed. Scan at most 5K characters forward
12650 for a display string or property. If found, set DISP_PROP_P
12653 * bidi.c (bidi_fetch_char): Accept an additional argument
12654 DISP_PROP_P, and pass it to compute_display_string_pos.
12655 Only handle text covered by a display string if DISP_PROP_P is returned
12656 non-zero. All callers of bidi_fetch_char changed.
12658 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12660 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12662 2010-12-03 Don March <don@ohspite.net>
12664 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12665 last character M-[char] is translated to ESC [char] (bug#7541).
12667 2011-08-02 Kenichi Handa <handa@m17n.org>
12669 * lisp.h (uniprop_table): Extern it.
12671 * chartab.c (uniprop_table): Make it non-static.
12673 2011-08-01 Eli Zaretskii <eliz@gnu.org>
12675 * xdisp.c (forward_to_next_line_start): Accept additional argument
12676 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12678 (reseat_at_next_visible_line_start): Use the bidi iterator state
12679 returned by forward_to_next_line_start to restore the state of
12680 it->bidi_it after backing up to previous newline. (Bug#9212)
12682 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12684 * regex.c (re_comp): Protoize.
12685 (re_exec): Fix return type.
12686 (regexec): Fix type of `ret'. (Bug#9203)
12688 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12690 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12691 This is needed if max-image-size is a floating-point number.
12693 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12695 * print.c (print_object): Print empty symbol as ##.
12697 * lread.c (read1): Read ## as empty symbol.
12699 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12701 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12702 setting frame foreground color (Bug#9175).
12703 (x_set_background_color): Likewise.
12705 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12706 contents (Bug#9176).
12707 (EmacsTooltip -init): Remove bezels and add shadows to
12710 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12711 or scroll bar (Bug#8470).
12713 * nsfont.m (nsfont_open): Remove assignment to voffset and
12714 unnecessary vars hshink, expand, hd, full_height, min_height.
12715 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12717 * nsterm.h (nsfont_info): Remove voffset field.
12719 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12721 Implement strike-through and overline on NextStep (Bug#8863).
12723 * nsfont.m (nsfont_open): Use underline position provided by font,
12724 instead of hard-coded value of 2.
12725 (nsfont_draw): Call ns_draw_text_decoration instead.
12727 * nsterm.h: Add declaration for ns_draw_text_decoration.
12729 * nsterm.m (ns_draw_text_decoration): New function for drawing
12730 underline, overline, and strike-through.
12731 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12732 ns_draw_text_decoration. Change treatment of cursor drawing to
12733 accommodate underlining, etc.
12735 2011-07-28 Eli Zaretskii <eliz@gnu.org>
12737 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12740 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12742 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12743 Without this fix, if a signal arrives just after memory fills up,
12744 'malloc' might be invoked reentrantly.
12746 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12747 In other words, assume that every image size is allowed, on non-X
12748 hosts. This assumption is probably wrong, but it lets Emacs compile.
12750 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12752 * regex.c (re_iswctype): Convert return values to boolean.
12754 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12756 * xdisp.c (compute_display_string_pos): Don't use cached display
12757 string position if the buffer had its restriction changed.
12760 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12762 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12764 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12766 Integer signedness and overflow and related fixes. (Bug#9079)
12768 * bidi.c: Integer size and overflow fixes.
12769 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12770 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12771 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12772 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12773 (bidi_find_other_level_edge):
12774 Use ptrdiff_t instead of EMACS_INT where either will do.
12775 This works better on 32-bit hosts configured --with-wide-int.
12776 (bidi_cache_ensure_space): Check for size-calculation overflow.
12777 Use % rather than repeated addition, for better worst-case speed.
12778 Don't set bidi_cache_size until after xrealloc returns, because it
12780 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12781 (bidi_cache_ensure_space): Also check that the bidi cache size
12782 does not exceed that of the largest Lisp string or buffer. See Eli
12783 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12785 * alloc.c (__malloc_size_t): Remove.
12786 All uses replaced by size_t. See Andreas Schwab's note
12787 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12789 * image.c: Improve checking for integer overflow.
12790 (check_image_size): Assume that f is nonnull, since
12791 it is always nonnull in practice. This is one less thing to
12792 worry about when checking for integer overflow later.
12793 (x_check_image_size): New function, which checks for integer
12794 overflow issues inside X.
12795 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12796 This removes the need for a memory_full check.
12797 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12798 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12799 (xbm_read_bitmap_data): Change locals back to 'int', since
12800 their values must fit in 'int'.
12801 (xpm_load_image, png_load, tiff_load):
12802 Invoke x_create_x_image_and_pixmap earlier,
12803 to avoid much needless work if the image is too large.
12804 (tiff_load): Treat overly large images as if
12805 x_create_x_image_and_pixmap failed, not as malloc failures.
12806 (gs_load): Use x_check_image_size.
12808 * gtkutil.c: Omit integer casts.
12809 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12810 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12812 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12814 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12815 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12816 would wrongly return t on a 64-bit host.
12818 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12819 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12820 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12821 and therefore cause GCC to emit a bogus diagnostic in some cases.
12823 * image.c: Integer signedness and overflow and related fixes.
12824 This is not an exhaustive set of fixes, but it's time to
12825 record what I've got.
12826 (lookup_pixel_color, check_image_size): Remove redundant decls.
12827 (check_image_size): Don't assume that arbitrary EMACS_INT values
12828 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12829 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12830 (tiff_load, imagemagick_load_image):
12831 Check for overflow in size calculations.
12832 (x_create_x_image_and_pixmap): Remove unnecessary test for
12833 xmalloc returning NULL; that can't happen.
12834 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12835 (xpm_color_bucket): Use better integer hashing function.
12836 (xpm_cache_color): Don't possibly over-allocate memory.
12837 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12838 (gif_memory_source):
12839 Use ptrdiff_t, not int or size_t, to record sizes.
12840 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12841 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12842 either works, as we prefer signed integers.
12843 (tiff_read_from_memory, tiff_write_from_memory):
12844 Return tsize_t, not size_t, since that's what the TIFF API wants.
12845 (tiff_read_from_memory): Don't fail simply because the read would
12846 go past EOF; instead, return a short read.
12847 (tiff_load): Omit no-longer-needed casts.
12848 (Fimagemagick_types): Don't assume size fits into 'int'.
12850 Improve hashing quality when configured --with-wide-int.
12851 * fns.c (hash_string): New function, taken from sxhash_string.
12852 Do not discard information about ASCII character case; this
12853 discarding is no longer needed.
12854 (sxhash-string): Use it. Change sig to match it. Caller changed.
12855 * lisp.h: Declare it.
12856 * lread.c (hash_string): Remove, since we now use fns.c's version.
12857 The fns.c version returns a wider integer if --with-wide-int is
12858 specified, so this should help the quality of the hashing a bit.
12860 * emacs.c: Integer overflow minor fix.
12861 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12862 Define only if GNU_LINUX.
12863 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12865 * dispnew.c: Integer signedness and overflow fixes.
12866 Remove unnecessary forward decls, that were a maintenance hassle.
12867 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12869 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12870 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12871 (prepare_desired_row, line_draw_cost):
12872 Use int, not unsigned, where either works.
12873 (save_current_matrix, restore_current_matrix):
12874 Use ptrdiff_t, not size_t, where either works.
12875 (init_display): Check for overflow more accurately, and without
12876 relying on undefined behavior.
12878 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12879 Remove, replacing with the new symbols in lisp.h. All uses changed.
12880 * fileio.c (make_temp_name):
12881 * filelock.c (lock_file_1, lock_file):
12882 * xdisp.c (message_dolog):
12883 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12884 Use pMd etc. instead.
12885 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12886 replacing the pWIDE etc. symbols removed from editfns.c.
12888 * keyboard.h (num_input_events): Now uintmax_t.
12889 This is (very slightly) less likely to mess up due to wraparound.
12892 * buffer.c: Integer signedness fixes.
12893 (alloc_buffer_text, enlarge_buffer_text):
12894 Use ptrdiff_t rather than size_t when either will do, as we prefer
12897 * alloc.c: Integer signedness and overflow fixes.
12898 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12899 (__malloc_size_t): Default to size_t, not to int.
12900 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12901 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12902 Prefer ptrdiff_t to size_t when either would do, as we prefer
12904 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12905 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12906 Now const. Initialize with values that are in range even if char
12908 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12909 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12910 These functions do the right thing with sizes > 2**32.
12911 (check_depth): Now ptrdiff_t, not int.
12912 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12913 Adjust to new way of storing sizes. Check for size overflow bugs
12915 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12916 slightly wrong anyway, as it missed one instance of
12917 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12918 (refill_memory_reserve): Omit needless cast to size_t.
12919 (mark_object_loop_halt): Mark as externally visible.
12921 * xselect.c: Integer signedness and overflow fixes.
12922 (Fx_register_dnd_atom, x_handle_dnd_message):
12923 Use ptrdiff_t, not size_t, since we prefer signed.
12924 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12925 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12926 x_dnd_atoms_size and x_dnd_atoms_length.
12928 * doprnt.c: Prefer signed to unsigned when either works.
12930 * doprnt.c (doprnt):
12932 * xdisp.c (vmessage):
12933 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12934 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12935 prefer signed arithmetic to avoid comparison confusion.
12936 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12937 but is a bit tricky.
12939 Assume freestanding C89 headers, string.h, stdlib.h.
12940 * data.c, doprnt.c, floatfns.c, print.c:
12941 Include float.h unconditionally.
12942 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12943 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12944 * regex.c: Likewise for stddef.h, string.h.
12945 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12946 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12947 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12948 (STDC_HEADERS): Remove obsolete defines.
12949 * sysdep.c: Include limits.h unconditionally.
12951 Assume support for memcmp, memcpy, memmove, memset.
12952 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12953 * regex.c (memcmp, memcpy):
12954 Remove; we assume C89 now.
12956 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12957 (__malloc_safe_bcopy): Remove; no longer needed.
12959 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12960 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12961 well either way, and we prefer signed to unsigned.
12963 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12965 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12966 closes the connection while we're reading (bug#9182).
12968 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12970 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12971 are specified (Bug#9168).
12973 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12975 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12976 Found by GCC static checking and --with-wide-int on a 32-bit host.
12978 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12980 * xdisp.c (compute_display_string_pos): Fix logic of caching
12981 previous display string position. Initialize cached_prev_pos to
12982 -1. Fixes slow-down at the beginning of a buffer.
12984 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12986 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12987 for attrs[LFACE_FONTSET_INDEX].
12989 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12991 * xml.c (parse_region): Remove unused local
12992 that was recently introduced.
12994 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12996 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12997 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12999 * xdisp.c (move_it_in_display_line_to): Record the best matching
13000 position for TO_CHARPOS while scanning the line, and restore it on
13001 exit if none of the characters scanned was an exact match.
13002 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13003 when exact match is impossible due to invisible text, and the
13004 lines are truncated.
13006 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13008 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13011 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13013 Fix a significant slow-down of cursor motion with C-n, C-p,
13014 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13015 auto-repeat under bidi redisplay in fontified buffers.
13016 * xdisp.c (compute_stop_pos_backwards): New function.
13017 (next_element_from_buffer): Call compute_stop_pos_backwards to
13018 find a suitable prev_stop when we find ourselves before
13020 (reseat): Don't look for prev_stop, as that could mean a very long
13022 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13023 <cached_disp_overlay_modiff>: Cache for last found display string
13025 (compute_display_string_pos): Return the cached position if asked
13026 about the same buffer in the same area of character positions, and
13027 the buffer wasn't changed since the time the display string
13028 position was cached.
13030 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13032 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13033 is an integer, which is important for empty lines. (Bug#9149)
13035 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13037 * frame.c (Fmodify_frame_parameters): In tty case, update the
13038 default face if necessary (Bug#4238).
13040 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13042 * editfns.c (Fstring_to_char): No need to explain what a character
13043 is in the docstring (Bug#6576).
13045 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13047 * xml.c (parse_region): Make sure we always return a tree.
13049 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13051 * xml.c (parse_region): If a document contains only comments,
13054 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13056 * xml.c (make_dom): Return comments, too.
13058 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13061 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13062 and the surrounding thread.
13063 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13064 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13065 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13067 * s/openbsd.h (BROKEN_SIGIO): Define.
13068 * unexelf.c (unexec) [__OpenBSD__]:
13069 Don't update the .mdebug section of the Alpha COFF symbol table.
13071 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13073 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13076 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13078 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13079 This fixes some race conditions on the permissions of any newly
13082 * alloc.c (valid_pointer_p): Use pipe, not open.
13083 This fixes some permissions issues when debugging.
13085 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13086 If fchown fails to set both uid and gid, try to set just gid,
13087 as that is sometimes allowed. Adjust the file's mode to eliminate
13088 setuid or setgid bits that are inappropriate if fchown fails.
13090 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13092 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13093 to compare Lisp_Objects.
13094 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13095 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13096 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13098 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13100 * lread.c (read_integer): Unread even EOF character.
13101 (read1): Likewise. Properly record start position of symbol.
13103 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13104 symbol character follows.
13106 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13108 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13109 This works around a problem with the previous change to Fcopy_file.
13110 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13111 and without this change, GCC might complain about discarding
13112 fchown's return value.
13114 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13116 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13118 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13120 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13122 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13124 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13125 it's used from the C level.
13127 * process.c: Use the same condition for POLL_FOR_INPUT in both
13128 keyboard.c and process.c (bug#1858).
13130 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13132 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13133 (Fgnutls_boot): Use it.
13135 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13137 * doc.c (Fsubstitute_command_keys): Revert last change.
13139 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13141 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13142 quotes the next character, and doesn't affect other longer
13143 sequences (bug#8935).
13145 * lread.c (syms_of_lread): Clarify that is isn't only
13146 `eval-buffer' and `eval-defun' that's affected by
13147 `lexical-binding' (bug#8460).
13149 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13151 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13152 bidi redisplay when a line includes both an image and is truncated.
13154 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13156 Fix minor problems found by static checking.
13157 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13158 (elsz): Now a signed constant, not a size_t var. We prefer signed
13159 types to unsigned, to avoid integer comparison confusion. Without
13160 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13161 "cannot optimize loop, the loop counter may overflow", a symptom
13163 * indent.c (Fvertical_motion): Mark locals as initialized.
13164 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13166 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13168 * search.c (Fre_search_backward): Mention `case-fold-search' in
13169 all the re_search_* functions (bug#8138).
13171 * keyboard.c (Fopen_dribble_file): Document when the file is
13174 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13176 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13179 Support bidi reordering of display and overlay strings.
13180 * xdisp.c (compute_display_string_pos)
13181 (compute_display_string_end): Accept additional argument STRING.
13182 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13183 (reseat_to_string): Initialize bidi_it->string.s and
13184 bidi_it->string.schars.
13185 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13186 NULL (avoids a crash in bidi_paragraph_init).
13187 Initialize itb.string.lstring.
13188 (init_iterator): Call bidi_init_it only of a valid
13189 buffer position was specified. Initialize paragraph_embedding to
13191 (reseat_to_string): Initialize the bidi iterator.
13192 (display_string): If we need to ignore text properties of
13193 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13194 original value of -1 will not work with bidi.)
13195 (compute_display_string_pos): First arg is now struct
13196 `text_pos *'; all callers changed. Support display properties on
13198 (compute_display_string_end): Support display properties on Lisp
13200 (init_iterator, reseat_1, reseat_to_string): Initialize the
13201 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13202 when iterating on a string not from display properties).
13203 (compute_display_string_pos, compute_display_string_end):
13204 Fix calculation of the object to scan. Fixes an error when using
13206 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13207 base_level_stop; instead, set base_level_stop to BEGV.
13208 Fixes crashes in vertical-motion.
13209 (next_element_from_buffer): Improve commentary for when
13210 the iterator is before prev_stop.
13211 (init_iterator): Initialize bidi_p from the default value of
13212 bidi-display-reordering, not from buffer-local value. Use the
13213 buffer-local value only if initializing for buffer iteration.
13214 (handle_invisible_prop): Support invisible properties on strings
13215 that are being bidi-reordered.
13216 (set_iterator_to_next): Support bidi reordering of C strings and
13218 (next_element_from_string): Support bidi reordering of Lisp
13220 (handle_stop_backwards): Support Lisp strings as well.
13221 (display_string): Support display of R2L glyph rows.
13222 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13223 (init_iterator): Don't initialize it->bidi_p for strings
13225 (reseat_to_string): Initialize it->bidi_p for strings here.
13226 (next_element_from_string, next_element_from_c_string)
13227 (next_element_from_buffer): Add xassert's for correspondence
13228 between IT's object being iterated and it->bidi_it.string
13230 (face_before_or_after_it_pos): Support bidi iteration.
13231 (next_element_from_c_string): Handle the case of the first string
13232 character that is not the first one in the visual order.
13233 (get_visually_first_element): New function, refactored from common
13234 parts of next_element_from_buffer, next_element_from_string, and
13235 next_element_from_c_string.
13236 (tool_bar_lines_needed, redisplay_tool_bar)
13237 (display_menu_bar): Force left-to-right direction. Add a FIXME
13238 comment for making that be controlled by a user option.
13239 (push_it, pop_it): Save and restore the state of the
13240 bidi iterator. Save and restore the bidi_p flag.
13241 (pop_it): Iterate out of display property for string iteration as
13243 (iterate_out_of_display_property): Support iteration over strings.
13244 (handle_single_display_spec): Set up it->bidi_it for iteration
13245 over a display string, and call bidi_init_it.
13246 (handle_single_display_spec, next_overlay_string)
13247 (get_overlay_strings_1, push_display_prop): Set up the bidi
13248 iterator for displaying display or overlay strings.
13249 (forward_to_next_line_start): Don't use the shortcut if
13251 (back_to_previous_visible_line_start): If handle_display_prop
13252 pushed the iterator stack, restore the internal state of the bidi
13253 iterator by calling bidi_pop_it same number of times.
13254 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13255 and we are bidi-iterating, don't decrement the iterator position;
13256 instead, set the first_elt flag in the bidi iterator, to produce
13258 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13259 (push_display_prop): xassert that we are iterating a buffer.
13260 (push_it, pop_it): Save and restore paragraph_embedding member.
13261 (handle_single_display_spec, next_overlay_string)
13262 (get_overlay_strings_1, reseat_1, reseat_to_string)
13263 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13264 correctly. Don't assume unibyte strings are not bidi-reordered.
13265 (compute_display_string_pos)
13266 (compute_display_string_end): Fix handling the case of C string.
13267 (push_it, pop_it): Save and restore from_disp_prop_p.
13268 (handle_single_display_spec, push_display_prop): Set the
13269 from_disp_prop_p flag.
13270 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13271 (pop_it): Call iterate_out_of_display_property only if we are
13272 popping after iteration over a string that came from a display
13273 property. Fix a typo in popping stretch info. Add an assertion
13274 for verifying that the iterator position is in sync with the bidi
13276 (handle_single_display_spec, get_overlay_strings_1)
13277 (push_display_prop): Fix initialization of paragraph direction for
13278 string when that of the parent object is not yet determined.
13279 (reseat_1): Call bidi_init_it to resync the bidi
13280 iterator with IT's position. (Bug#7616)
13281 (find_row_edges): If ROW->start.pos gives position
13282 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13283 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13284 Reset the from_disp_prop_p flag.
13285 (SAVE_IT, RESTORE_IT): New macros.
13286 (pos_visible_p, face_before_or_after_it_pos)
13287 (back_to_previous_visible_line_start)
13288 (move_it_in_display_line_to, move_it_in_display_line)
13289 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13290 (try_scrolling, redisplay_window, display_line): Use them when
13291 saving a temporary copy of the iterator and restoring it back.
13292 (back_to_previous_visible_line_start, reseat_1)
13293 (init_iterator): Empty the bidi cache "stack".
13294 (move_it_in_display_line_to): If iterator ended up at
13295 EOL, but we never saw any buffer positions smaller than
13296 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13297 motion in bidi-reordered lines.
13298 (move_it_in_display_line_to): Record prev_method and prev_pos
13299 immediately before the call to set_iterator_to_next. Fixes cursor
13300 motion in bidi-reordered lines with stretch glyphs and strings
13301 displayed in margins. (Bug#8133) (Bug#8867)
13302 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13304 (pos_visible_p): Support positions in bidi-reordered lines.
13305 Save and restore bidi cache.
13307 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13308 (bidi_paragraph_info): Delete unused struct.
13309 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13310 (bidi_cache_start): New variable.
13311 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13313 (bidi_cache_fetch_state, bidi_cache_search)
13314 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13315 (bidi_cache_find, bidi_peek_at_next_level)
13316 (bidi_level_of_next_char, bidi_find_other_level_edge)
13317 (bidi_move_to_visually_next): Compare cache index with
13318 bidi_cache_start rather than with zero.
13319 (bidi_fetch_char): Accept new argument STRING; all callers
13320 changed. Support iteration over a string. Support strings with
13321 display properties. Support unibyte strings. Fix the type of
13322 `len' according to what STRING_CHAR_AND_LENGTH expects.
13323 (bidi_paragraph_init, bidi_resolve_explicit_1)
13324 (bidi_resolve_explicit, bidi_resolve_weak)
13325 (bidi_level_of_next_char, bidi_move_to_visually_next):
13326 Support iteration over a string.
13327 (bidi_set_sor_type, bidi_resolve_explicit_1)
13328 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13329 can now be zero (for strings); special values 0 and -1 were
13330 changed to -1 and -2, respectively.
13331 (bidi_char_at_pos): New function.
13332 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13333 Call it instead of FETCH_MULTIBYTE_CHAR.
13334 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13335 initialized to valid values.
13336 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13338 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13339 the test for valid cached positions. Fix the logic for looking up
13340 the sentinel state in the cache. GCPRO the Lisp string we are
13342 (bidi_push_it, bidi_pop_it): New functions.
13343 (bidi_initialize): Initialize the bidi cache start stack pointer.
13344 (bidi_cache_ensure_space): New function, refactored from part of
13345 bidi_cache_iterator_state. Don't assume the required size is just
13346 one BIDI_CACHE_CHUNK away.
13347 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13348 (bidi_count_bytes, bidi_char_at_pos): New functions.
13349 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13350 always valid if bidi_cache_idx is valid.
13351 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13352 is valid if it's going to be used.
13353 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13354 (bidi_cache_fetch_state, bidi_cache_search)
13355 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13356 (bidi_cache_iterator_state, bidi_cache_find)
13357 (bidi_find_other_level_edge, bidi_cache_start_stack):
13358 All variables related to cache indices are now EMACS_INT.
13360 * dispextern.h (struct bidi_string_data): New structure.
13361 (struct bidi_it): New member `string'. Make flag members be 1-bit
13362 fields, and put them last in the struct.
13363 (compute_display_string_pos, compute_display_string_end):
13365 (bidi_push_it, bidi_pop_it): Add prototypes.
13366 (struct iterator_stack_entry): New members bidi_p,
13367 paragraph_embedding, and from_disp_prop_p.
13368 (struct it): Member bidi_p is now a bit field 1 bit wide.
13369 (bidi_shelve_cache, bidi_unshelve_cache):
13370 Declare prototypes.
13372 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13373 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13374 and vector-like objects.
13376 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13377 cache around display iteration.
13379 * window.c (Fwindow_end, window_scroll_pixel_based)
13380 (displayed_window_lines, Frecenter): Save and restore the bidi
13381 cache around display iteration.
13383 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13385 * editfns.c (Fdelete_region): Clarify the use of the named
13386 parameters (bug#6788).
13388 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13390 * indent.c (Fvertical_motion): Set and restore w->pointm when
13391 saving and restoring the window's buffer (Bug#9006).
13393 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13395 * editfns.c (Fstring_to_char): Clarify just what is returned
13396 (bug#6576). Text by Eli Zaretskii.
13398 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13400 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13402 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13404 * buffer.c (mmap_find): Fix a typo.
13406 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13408 Fix execution of x selection hooks.
13409 * xselect.c (Qx_lost_selection_functions)
13410 (Qx_sent_selection_functions): New vars.
13411 (syms_of_xselect): DEFSYM them.
13412 (x_handle_selection_request): Pass Qx_sent_selection_functions
13413 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13414 (x_handle_selection_clear,x_clear_frame_selections):
13415 Pass Qx_lost_selection_functions rather than
13416 Vx_lost_selection_functions to Frun_hook_with_args.
13418 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13420 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13421 The old code sometimes used this field without initializing it.
13423 * alloc.c (gc_sweep): Don't read past end of array.
13424 In theory, the old code could also have corrupted Emacs internals,
13425 though it'd be very unlikely.
13427 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13429 * character.c (Fcharacterp): Don't advertise optional ignored
13430 argument. (Bug#4026)
13432 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13434 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13437 * window.c (Fset_window_start): Doc fix (bug#4199).
13438 (Fset_window_hscroll): Ditto.
13440 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13442 Fix minor new problems caught by GCC 4.6.1.
13443 * term.c (init_tty): Remove unused local.
13444 * xsettings.c (store_monospaced_changed): Define this function only
13445 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13446 not used otherwise.
13448 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13450 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13452 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13454 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13455 are the mini-buffer and the echo area (bug#3320).
13457 * term.c (init_tty): Remove support for supdup, c10 and perq
13458 terminals, which are no longer supported (bug#1482).
13460 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13462 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13464 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13466 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13467 for non-popups (Bug#3642).
13469 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13471 * alloc.c (reset_malloc_hooks): Protoize.
13472 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13473 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13474 * cm.c (losecursor): Likewise.
13475 * data.c (fmod): Likewise.
13476 * dispnew.c (swap_glyphs_in_rows): Likewise.
13477 * emacs.c (memory_warning_signal): Likewise.
13478 * floatfns.c (float_error): Likewise.
13479 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13480 (otf_open, font_otf_capability, generate_otf_features)
13481 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13483 * image.c (pbm_read_file): Likewise.
13484 * indent.c (string_display_width): Likewise.
13485 * intervals.c (check_for_interval, search_for_interval)
13486 (inc_interval_count, count_intervals, root_interval)
13487 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13488 * lread.c (defalias): Likewise.
13489 * ralloc.c (r_alloc_check): Likewise.
13490 * regex.c (set_image_of_range_1, set_image_of_range)
13491 (regex_grow_registers): Likewise.
13492 * sysdep.c (strerror): Likewise.
13493 * termcap.c (valid_filename_p, tprint, main): Likewise.
13494 * tparam.c (main): Likewise.
13495 * unexhp9k800.c (run_time_remap, save_data_space)
13496 (update_file_ptrs, read_header, write_header, calculate_checksum)
13497 (copy_file, copy_rest, display_header): Likewise.
13498 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13500 * xdisp.c (check_it): Likewise.
13501 * xfaces.c (register_color, unregister_color, unregister_colors):
13503 * xfns.c (print_fontset_result): Likewise.
13504 * xrdb.c (member, fatal, main): Likewise.
13506 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13508 Fix minor problems found by static checking (Bug#9031).
13509 * chartab.c (char_table_set_range, map_sub_char_table):
13510 Remove unused locals.
13511 (uniprop_table): Now static.
13512 * composite.c (_work_char): Remove unused static var.
13514 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
13516 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13518 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13520 * gtkutil.c (qttip_cb): Remove code without function.
13522 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13524 * w32.c (pthread_sigmask): New stub.
13526 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13528 Use pthread_sigmask, not sigprocmask (Bug#9010).
13529 sigprocmask is portable only for single-threaded applications, and
13530 Emacs can be multi-threaded when it uses GTK.
13531 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13533 * callproc.c (Fcall_process):
13534 * process.c (create_process):
13535 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13536 Use pthread_sigmask, not sigprocmask.
13538 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13540 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13541 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13544 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13546 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13547 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13548 (xg_hide_tooltip): Fix comment.
13550 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13551 in registerServicesMenuSendTypes.
13552 (validRequestorForSendType): Don't check ns_return_types.
13554 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13557 2011-07-08 Jason Rumney <jasonr@gnu.org>
13559 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13560 SH_SHOW for hidden windows (Bug#5482).
13562 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13563 frame struct members of non-existent frames (Bug#6284).
13565 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13567 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13568 variable firstTime not needed on OSX >= 10.6.
13569 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13570 >= 10.5. Use setKnobProportion, setDoubleValue.
13572 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13573 (MAC_OS_X_VERSION_10_5): Define if not defined.
13574 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13575 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13576 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13578 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13579 cString and lossyCString on OSX >= 10.4.
13581 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13582 sizeToFit on OSX >= 10.2.
13584 * nsimage.m (allocInitFromFile): Don't use deprecated method
13585 bestRepresentationForDevice on OSX >= 10.6.
13587 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13590 * emacs.c: Declare unexec_init_emacs_zone.
13592 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13594 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13596 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13597 on svcsMenu (Bug#8842).
13599 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13601 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13603 * nsterm.m (QUTF8_STRING): Declare.
13604 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13605 (validRequestorForSendType): Return type is (id).
13606 Change indexOfObjectIdenticalTo to indexOfObject.
13607 Check if we have local selection before returning self (Bug#8842).
13608 (writeSelectionToPasteboard): Put local selection into paste board
13609 if we have a local selection (Bug#8842).
13610 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13612 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13613 (ns_get_local_selection): Declare.
13615 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13617 * keymap.c (describe_map_tree): Don't insert a double newline at
13618 the end of the buffer (bug#1169) and return whether we inserted
13621 * callint.c (Fcall_interactively): Change "reading args" to
13622 "providing args" to try to clarify what it does (bug#1010).
13624 2011-07-07 Kenichi Handa <handa@m17n.org>
13626 * composite.c (composition_compute_stop_pos): Ignore a static
13627 composition starting before CHARPOS (Bug#8915).
13629 * xdisp.c (handle_composition_prop): Likewise.
13631 2011-07-07 Eli Zaretskii <eliz@gnu.org>
13633 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13636 2011-07-07 Kenichi Handa <handa@m17n.org>
13638 * character.h (unicode_category_t): New enum type.
13640 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13641 (Qchar_code_property_table): New variable.
13642 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13643 (UNIPROP_COMPRESSED_FORM_P): New macros.
13644 (char_table_ascii): Uncompress the compressed values.
13645 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13646 Uncompress the compressed values.
13647 (sub_char_table_ref_and_range): Likewise.
13648 (char_table_ref_and_range): Uncompress the compressed values.
13649 (sub_char_table_set): New arg is_uniprop. Callers changed.
13650 Uncompress the compressed values.
13651 (sub_char_table_set_range): Args changed. Callers changed.
13652 (char_table_set_range): Adjuted for the above change.
13653 (map_sub_char_table): Delete args default_val and parent. Add arg
13654 top. Give decoded values to a Lisp function.
13655 (map_char_table): Adjust for the above change. Give decoded
13656 values to a Lisp function. Gcpro more variables.
13657 (uniprop_table_uncompress)
13658 (uniprop_decode_value_run_length): New functions.
13659 (uniprop_decoder, uniprop_decoder_count): New variables.
13660 (uniprop_get_decoder, uniprop_encode_value_character)
13661 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13663 (uniprop_encoder, uniprop_encoder_count): New variables.
13664 (uniprop_get_encoder, uniprop_table)
13665 (Funicode_property_table_internal, Fget_unicode_property_internal)
13666 (Fput_unicode_property_internal): New functions.
13667 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13668 Sunicode_property_table_internal, Sget_unicode_property_internal,
13669 and Sput_unicode_property_internal. Defvar_lisp
13670 char-code-property-alist.
13672 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13673 Vunicode_category_table.
13675 * font.c (font_range): Adjust for the change of
13676 Vunicode_category_table.
13678 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13680 * m/iris4d.h: Remove file, move contents ...
13681 * s/irix6-5.h: ... here.
13683 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13685 Remove unportable assumption about struct layout (Bug#8884).
13686 * alloc.c (mark_buffer):
13687 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13688 (clone_per_buffer_values): Don't assume that
13689 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13690 This isn't true in general, and it's particularly not true
13691 if Emacs is configured with --with-wide-int.
13692 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13693 New macros, used in the buffer.c change.
13695 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13697 * xsettings.c: Use both GConf and GSettings if both are available.
13698 (store_config_changed_event): Add comment.
13699 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13700 (store_tool_bar_style_changed): New functions.
13701 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
13702 (struct xsettings): Move font inside HAVE_XFT.
13703 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13704 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13705 Move inside HAVE_XFT.
13706 (something_changed_gsettingsCB): Rename from something_changedCB.
13707 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13709 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13710 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
13711 (something_changed_gconfCB): Rename from something_changedCB.
13712 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13713 (parse_settings): Move check for font inside HAVE_XFT.
13714 (read_settings, apply_xft_settings): Add comment.
13715 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13716 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13717 call store_font_name_changed.
13718 (xft_settings_event): Add comment.
13719 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13720 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13721 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13722 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13723 (xsettings_initialize): Call init_gsettings last.
13724 (xsettings_get_system_font, xsettings_get_system_normal_font):
13727 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13729 Random fixes. E.g., (random) never returned negative values.
13730 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13731 subseconds part to the entropy, as that's a bit more random.
13732 Prefer signed to unsigned, since the signedness doesn't matter and
13733 in general we prefer signed. When given a limit, use a
13734 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13735 latter isn't right if USE_2_TAGS_FOR_INTS.
13736 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13737 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13739 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13741 * textprop.c (text_property_stickiness):
13742 Obey Vtext_property_default_nonsticky.
13743 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13744 * w32fns.c (syms_of_w32fns):
13745 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13747 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13749 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13750 This is more efficient than Ffile_directory_p and avoids a minor race.
13752 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13754 * buffer.c (Foverlay_put): Say what the return value is
13757 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13758 is a directory before asking whether to use the file name
13760 (barf_or_query_if_file_exists): Make the "File is a directory"
13761 error be more correct.
13763 * fns.c (Frequire): Remove the mention of the .gz files, since
13764 that's installation-specific, but keep the mention of
13765 `get-load-suffixes'.
13767 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13769 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13770 Report string overflow if the output is too long.
13772 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
13774 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13775 (syms_of_gnutls): Remove duplicate DEFSYM for
13776 Qgnutls_bootprop_verify_hostname_error, an error for
13777 Qgnutls_bootprop_verify_error (which is no longer used).
13779 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13780 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13781 Also (re)move comments that are misplaced or no longer relevant.
13783 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13785 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13787 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
13789 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13790 and background color parameters if they have been changed.
13792 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13794 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13796 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13798 * xsettings.c (SYSTEM_FONT): Define only when used.
13799 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13801 * keymap.c (access_keymap_1): Now static.
13803 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
13805 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13806 leave any prefix arg for the up event (Bug#1586).
13808 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13810 * lread.c (syms_of_lread): Mention single symbols defined by
13811 `defvar' or `defconst' (bug#7154).
13813 * fns.c (Frequire): Mention .el.gz files (bug#7314).
13814 (Frequire): Mention get-load-suffixes.
13816 2011-07-02 Martin Rudalics <rudalics@gmx.at>
13818 * window.h (window): Remove clone_number slot.
13819 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13821 (make_parent_window, make_window, saved_window)
13822 (Fset_window_configuration, save_window_save): Don't deal with
13824 * buffer.c (Qclone_number): Remove declaration.
13825 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13827 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13829 Add multiple inheritance to keymaps.
13830 * keymap.c (Fmake_composed_keymap): New function.
13831 (Fset_keymap_parent): Simplify.
13832 (fix_submap_inheritance): Remove.
13833 (access_keymap_1): New function extracted from access_keymap to handle
13834 embedded parents and handle lists of maps.
13835 (access_keymap): Use it.
13836 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13837 (Fcopy_keymap): Handle embedded parents.
13838 (Fcommand_remapping, define_as_prefix): Simplify.
13839 (Fkey_binding): Simplify.
13840 (syms_of_keymap): Move minibuffer-local-completion-map,
13841 minibuffer-local-filename-completion-map,
13842 minibuffer-local-must-match-map, and
13843 minibuffer-local-filename-must-match-map to Elisp.
13844 (syms_of_keymap): Defsubr make-composed-keymap.
13845 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13846 (parse_menu_item): Trivial simplification.
13848 2011-07-01 Glenn Morris <rgm@gnu.org>
13850 * Makefile.in (SETTINGS_LIBS): Fix typo.
13852 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13854 * coding.c (Fencode_coding_string): Record the last coding system
13855 used, as the function doc string says (bug#8738).
13857 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13859 * xsettings.c (store_monospaced_changed): Take new font as arg and
13860 check for change against current_mono_font.
13861 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13862 (emacs_settings_constructor, emacs_settings_get_property)
13863 (emacs_settings_set_property, emacs_settings_class_init)
13864 (emacs_settings_init, gsettings_obj): Remove.
13865 (something_changedCB): New function for HAVE_GSETTINGS.
13866 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13867 with value as argument.
13868 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13869 g_settings_new (Bug#8967). Do not create gsettings_obj.
13870 Remove calls to g_settings_bind. Connect something_changedCB to
13873 * xgselect.c: Add defined (HAVE_GSETTINGS).
13874 (xgselect_initialize): Ditto.
13876 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13877 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13880 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13882 * eval.c (struct backtrace): Simplify and port the data structure.
13883 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13884 signed bit field, as this assumption is not portable and it makes
13885 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13886 "char debug_on_exit : 1" as this is not portable either; instead,
13887 use the portable "unsigned int debug_on_exit : 1". Remove unused
13888 member evalargs. Remove obsolete comments about cc bombing out.
13890 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13892 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
13893 Let HAVE_GSETTINGS override HAVE_GCONF.
13894 (store_monospaced_changed): New function.
13895 (EMACS_SETTINGS): A new type derived from GObject to handle
13896 GSettings notifications.
13897 (emacs_settings_constructor, emacs_settings_get_property)
13898 (emacs_settings_set_property, emacs_settings_class_init):
13900 (gsettings_client, gsettings_obj): New variables.
13901 (GSETTINGS_SCHEMA): New define.
13902 (something_changedCB): Call store_monospaced_changed.
13903 (init_gsettings): New function.
13904 (xsettings_initialize): Call init_gsettings.
13905 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13908 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13911 2011-06-29 Martin Rudalics <rudalics@gmx.at>
13913 * window.c (resize_root_window, grow_mini_window)
13914 (shrink_mini_window): Rename Qresize_root_window to
13915 Qwindow_resize_root_window and Qresize_root_window_vertically to
13916 Qwindow_resize_root_window_vertically.
13918 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13920 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13922 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
13924 * makefile.w32-in: Redesign dependencies so they reflect more
13925 clearly which files are directly included by each source file,
13926 and not through other includes.
13928 2011-06-27 Martin Rudalics <rudalics@gmx.at>
13930 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13931 (sort_overlays, overlay_strings): When an overlay's clone number
13932 matches the window's clone number process the overlay even if
13933 the overlay's window property doesn't match the current window.
13935 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13936 (Fwindow_hchild): Rename to Fwindow_left_child.
13937 (Fwindow_next): Rename to Fwindow_next_sibling.
13938 (Fwindow_prev): Rename to Fwindow_prev_sibling.
13939 (resize_window_check): Rename to window_resize_check.
13940 (resize_window_apply): Rename to window_resize_apply.
13941 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13942 (Fdelete_other_windows_internal, resize_frame_windows)
13943 (Fsplit_window_internal, Fdelete_window_internal)
13944 (grow_mini_window, shrink_mini_window)
13945 (Fresize_mini_window_internal): Fix callers accordingly.
13947 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13949 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13950 (emacs_fixed_set_min_size): Remove.
13951 (emacs_fixed_new): Take frame as argument.
13953 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13954 (_EmacsFixedPrivate): Remove minwidth/height.
13955 Add struct frame *f.
13956 (emacs_fixed_init): Initialize priv->f.
13957 (get_parent_class, emacs_fixed_set_min_size): Remove.
13958 (emacs_fixed_new): Set priv->f to argument.
13959 (emacs_fixed_get_preferred_width)
13960 (emacs_fixed_get_preferred_height): Use min_width/height from
13961 frames size_hint to set minimum and natural (Bug#8919).
13962 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13963 and use min_width/height from frames size_hint to set
13964 min_width/height (Bug#8919).
13966 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13967 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13970 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13972 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13973 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13976 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13978 * process.c (wait_reading_process_output): Bypass select if
13979 waiting for a cell while ignoring keyboard input, and input is
13980 pending. Suggested by Jan Djärv (Bug#8869).
13982 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13984 Use gnulib's dup2 module instead of rolling our own.
13985 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13987 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13989 * dispnew.c (scrolling_window): Before scrolling, turn off a
13990 mouse-highlight in the window being scrolled.
13992 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13994 Move DEFSYM to lisp.h and use everywhere.
13996 * character.h (DEFSYM): Move declaration...
13997 * lisp.h (DEFSYM): ...here.
14003 * w32select.c: Don't include character.h.
14005 * alloc.c (syms_of_alloc):
14006 * buffer.c (syms_of_buffer):
14007 * bytecode.c (syms_of_bytecode):
14008 * callint.c (syms_of_callint):
14009 * casefiddle.c (syms_of_casefiddle):
14010 * casetab.c (init_casetab_once):
14011 * category.c (init_category_once, syms_of_category):
14012 * ccl.c (syms_of_ccl):
14013 * cmds.c (syms_of_cmds):
14014 * composite.c (syms_of_composite):
14015 * dbusbind.c (syms_of_dbusbind):
14016 * dired.c (syms_of_dired):
14017 * dispnew.c (syms_of_display):
14018 * doc.c (syms_of_doc):
14019 * editfns.c (syms_of_editfns):
14020 * emacs.c (syms_of_emacs):
14021 * eval.c (syms_of_eval):
14022 * fileio.c (syms_of_fileio):
14023 * fns.c (syms_of_fns):
14024 * frame.c (syms_of_frame):
14025 * fringe.c (syms_of_fringe):
14026 * insdel.c (syms_of_insdel):
14027 * keymap.c (syms_of_keymap):
14028 * lread.c (init_obarray, syms_of_lread):
14029 * macros.c (syms_of_macros):
14030 * msdos.c (syms_of_msdos):
14031 * print.c (syms_of_print):
14032 * process.c (syms_of_process):
14033 * search.c (syms_of_search):
14034 * sound.c (syms_of_sound):
14035 * syntax.c (init_syntax_once, syms_of_syntax):
14036 * terminal.c (syms_of_terminal):
14037 * textprop.c (syms_of_textprop):
14038 * undo.c (syms_of_undo):
14039 * w32.c (globals_of_w32):
14040 * window.c (syms_of_window):
14041 * xdisp.c (syms_of_xdisp):
14042 * xfaces.c (syms_of_xfaces):
14043 * xfns.c (syms_of_xfns):
14044 * xmenu.c (syms_of_xmenu):
14045 * xsettings.c (syms_of_xsettings):
14046 * xterm.c (syms_of_xterm): Use DEFSYM.
14048 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14050 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14052 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14054 Integer and buffer overflow fixes (Bug#8873).
14056 * print.c (printchar, strout): Check for string overflow.
14057 (PRINTPREPARE, printchar, strout):
14058 Don't set size unless allocation succeeds.
14060 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14061 for sizes. Check for string overflow more accurately.
14062 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14064 * macros.c: Integer and buffer overflow fixes.
14065 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14066 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14067 Use ptrdiff_t, not int, for sizes.
14068 Don't increment bufsize until after realloc succeeds.
14069 Check for size-calculation overflow.
14070 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14072 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14074 * lread.c: Integer overflow fixes.
14075 (read_integer): Radix is now EMACS_INT, not int,
14076 to improve quality of diagnostics for out-of-range radices.
14077 Calculate buffer size correctly for out-of-range radices.
14078 (read1): Check for integer overflow in radices, and in
14079 read-circle numbers.
14080 (read_escape): Avoid int overflow.
14081 (Fload, openp, read_buffer_size, read1)
14082 (substitute_object_recurse, read_vector, read_list, map_obarray):
14083 Use ptrdiff_t, not int, for sizes.
14084 (read1): Use EMACS_INT, not int, for sizes.
14085 Check for size overflow.
14087 * image.c (cache_image): Check for size arithmetic overflow.
14089 * lread.c: Integer overflow issues.
14090 (saved_doc_string_size, saved_doc_string_length)
14091 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14092 Now ptrdiff_t, not int.
14093 (read1): Don't assume doc string length fits in int. Check for
14094 out-of-range doc string lengths.
14095 (read_list): Don't assume file position fits in int.
14096 (read_escape): Check for hex character overflow.
14098 2011-06-22 Leo Liu <sdl.web@gmail.com>
14100 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14101 Move to minibuffer.el.
14103 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14105 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14106 The following patches are for when GLYPH_DEBUG && !XASSERT.
14107 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14108 * dispnew.c (flush_stdout):
14109 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14110 Mark as externally visible.
14111 * dispnew.c (check_window_matrix_pointers): Now static.
14112 * dispnew.c (window_to_frame_vpos):
14113 * xfns.c (unwind_create_frame):
14114 * xterm.c (x_check_font): Remove unused local.
14115 * scroll.c (CHECK_BOUNDS):
14116 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14117 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14118 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14119 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14120 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14122 (debug_method_add): Use va_list and vsprintf rather than relying
14123 on undefined behavior with wrong number of arguments.
14124 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14125 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14126 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14127 since we're not interested in debugging glyphs with old libraries.
14128 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14129 GCC 4.6.0's static checking.
14131 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14133 Integer overflow and signedness fixes (Bug#8873).
14134 A few related buffer overrun fixes, too.
14136 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14138 * dispextern.h (struct face.stipple):
14139 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14140 (x_bitmap_mask, x_allocate_bitmap_record)
14141 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14142 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14143 (x_create_bitmap_from_xpm_data):
14144 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14145 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14147 * xfaces.c (load_pixmap):
14148 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14149 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14150 (.bitmaps_last, struct x_output.icon_bitmap):
14151 Use ptrdiff_t, not int, for bitmap indexes.
14152 (x_allocate_bitmap_record): Check for size overflow.
14153 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14155 Use ptrdiff_t, not int, for overlay counts.
14156 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14157 * editfns.c (overlays_around, get_pos_property):
14158 * textprop.c (get_char_property_and_overlay):
14159 * xdisp.c (next_overlay_change, note_mouse_highlight):
14160 * xfaces.c (face_at_buffer_position):
14161 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14162 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14163 (Fnext_overlay_change, Fprevious_overlay_change)
14164 (mouse_face_overlay_overlaps, Foverlays_in):
14165 Use ptrdiff_t, not int, for sizes.
14166 (overlays_at, overlays_in): Check for size-calculation overflow.
14168 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14170 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14171 (x_session_initialize): Do not assume string length fits in int.
14173 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14174 This is unlikely, but can occur if DPI is outlandish.
14176 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14177 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14179 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14180 * xrdb.c (magic_file_p, search_magic_path):
14181 Omit last arg SUFFIX; it was always 0. All callers changed.
14182 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14184 * xfont.c (xfont_match): Avoid need for strlen.
14186 * xfns.c: Don't assume strlen fits in int.
14187 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14189 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14190 not unsigned long, as we prefer signed integers. All callers changed.
14191 Detect integer overflow in repeat count.
14192 (message_dolog): Don't assume print length fits in 39 bytes.
14193 (display_mode_element): Don't assume strlen fits in int.
14195 * termcap.c: Don't assume sizes fit in int and never overflow.
14196 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14197 (gobble_line): Check for size-calculation overflow.
14199 * minibuf.c (Fread_buffer):
14200 * lread.c (intern, intern_c_string):
14201 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14202 Don't assume string length fits in int.
14204 * keyboard.c (parse_tool_bar_item):
14205 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14207 * font.c: Don't assume string length fits in int.
14208 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14209 Use ptrdiff_t, not int.
14210 (font_intern_prop): Don't assume string length fits in int.
14211 Don't assume integer property fits in fixnum.
14212 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14214 * filelock.c: Fix some buffer overrun and integer overflow issues.
14215 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14216 Reformulate so as not to need the command string.
14217 Invoke gzip -cd rather than gunzip, as it's more portable.
14218 (lock_info_type, lock_file_1, lock_file):
14219 Don't assume pid_t and time_t fit in unsigned long.
14220 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14221 (current_lock_owner): Prefer signed type for sizes.
14222 Use memcpy, not strncpy, where memcpy is what is really wanted.
14223 Don't assume (via atoi) that time_t and pid_t fit in int.
14224 Check for time_t and/or pid_t out of range, e.g., via a network share.
14225 Don't alloca where an auto var works fine.
14227 * fileio.c: Fix some integer overflow issues.
14228 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14229 Don't assume string length fits in int.
14230 (directory_file_name): Don't assume string length fits in long.
14231 (make_temp_name): Don't assume pid fits in int, or that its print
14232 length is less than 20.
14234 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14236 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14238 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14240 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14241 We prefer signed integers, even for size calculations.
14243 * emacs.c: Don't assume string length fits in 'int'.
14244 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14245 (main): Don't invoke strlen when not needed.
14247 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14248 (XD_DEBUG_MESSAGE): Don't waste a byte.
14250 * callproc.c (getenv_internal_1, getenv_internal)
14251 (Fgetenv_internal):
14252 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14254 * lread.c (invalid_syntax): Omit length argument.
14255 All uses changed. This doesn't fix a bug, but it simplifies the
14256 code away from its former Hollerith-constant appearance, and it's
14257 one less 'int' to worry about when looking at integer-overflow issues.
14258 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14260 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14261 This didn't break anything, but it didn't help either.
14262 It's confusing to put a bogus integer in a place where the actual
14263 value does not matter.
14264 (LIST_END_P): Remove unused macro and its bogus comment.
14265 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14267 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14268 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14270 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14271 We prefer signed types, and the value cannot exceed the EMACS_INT
14272 range anyway (because otherwise the length would not be representable).
14273 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14274 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14275 This avoids a GCC warning when WIDE_EMACS_INT.
14277 * indent.c (sane_tab_width): New function.
14278 (current_column, scan_for_column, Findent_to, position_indentation)
14279 (compute_motion): Use it. This is just for clarity.
14280 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14282 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14284 * lisp.h (lint_assume): New macro.
14285 * composite.c (composition_gstring_put_cache):
14286 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14288 * editfns.c, insdel.c:
14289 Omit unnecessary forward decls, to simplify future changes.
14291 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14293 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14295 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14296 Use much-faster test for byte-length change.
14297 Don't assume string byte-length fits in 'int'.
14298 Check that character arg fits in 'int'.
14299 (mapcar1): Declare byte as byte, for clarity.
14301 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14303 * fns.c (concat): Catch string overflow earlier.
14304 Do not rely on integer wraparound.
14306 * dispextern.h (struct it.overlay_strings_charpos)
14307 (struct it.selective): Now EMACS_INT, not int.
14308 * xdisp.c (forward_to_next_line_start)
14309 (back_to_previous_visible_line_start)
14310 (reseat_at_next_visible_line_start, next_element_from_buffer):
14311 Don't arbitrarily truncate the value of 'selective' to int.
14313 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14315 * composite.c: Don't truncate sizes to 'int'.
14316 (composition_gstring_p, composition_reseat_it)
14317 (composition_adjust_point): Use EMACS_INT, not int.
14318 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14319 not EMACS_UINT, for indexes.
14321 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14323 * buffer.c: Include <verify.h>.
14324 (struct sortvec.priority, struct sortstr.priority):
14325 Now EMACS_INT, not int.
14326 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14327 (struct sortstr.size, record_overlay_string)
14328 (struct sortstrlist.size, struct sortlist.used):
14329 Don't truncate size to int.
14330 (record_overlay_string): Check for size-calculation overflow.
14331 (init_buffer_once): Check at compile-time, not run-time.
14333 2011-06-22 Jim Meyering <meyering@redhat.com>
14335 Don't leak an XBM-image-sized buffer
14336 * image.c (xbm_load): Free the image buffer after using it.
14338 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14341 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14342 that Sun C diagnosed.
14343 * fns.c (secure_hash): Fix pointer signedness issue.
14344 * intervals.c (static_offset_intervals): New function.
14345 (offset_intervals): Use it.
14347 2011-06-21 Leo Liu <sdl.web@gmail.com>
14350 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14353 * fns.c (secure_hash): Rename from crypto_hash_function and change
14354 the first arg to accept symbols.
14355 (Fsecure_hash): New primitive.
14356 (syms_of_fns): New symbols.
14358 2011-06-20 Deniz Dogan <deniz@dogan.se>
14360 * process.c (Fset_process_buffer): Clarify return value in
14363 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14365 * dispnew.c (add_window_display_history): Use BVAR.
14367 * xdisp.c (debug_method_add): Use BVAR.
14368 (check_window_end, dump_glyph_matrix, dump_glyph)
14369 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14371 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14374 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14375 check till after the cache is created in init_frame_faces.
14377 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14379 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14381 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14383 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14384 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14385 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14387 Improve buffer-overflow checking (Bug#8873).
14388 * fileio.c (Finsert_file_contents):
14389 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14390 Remove the old (too-loose) buffer overflow checks.
14391 They weren't needed, since make_gap checks for buffer overflow.
14392 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14393 The old code merely checked for Emacs fixnum overflow, and relied
14394 on undefined (wraparound) behavior. The new code avoids undefined
14395 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14397 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14398 Tune. Don't use wider integers than needed. Don't use alloca.
14399 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14401 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14403 * insdel.c, lisp.h (buffer_overflow): New function.
14404 (insert_from_buffer_1, replace_range, replace_range_2):
14405 * insdel.c (make_gap_larger):
14406 * editfns.c (Finsert_char):
14407 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14409 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14411 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14413 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14415 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14416 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14418 * fileio.c: Don't assume EMACS_INT fits in off_t.
14419 (emacs_lseek): New static function.
14420 (Finsert_file_contents, Fwrite_region): Use it.
14421 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14423 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14425 * fns.c: Don't overflow int when computing a list length.
14426 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14427 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14428 truncation on 64-bit hosts. Check for QUIT every
14429 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14430 faster and is responsive enough.
14431 (Flength): Report an error instead of overflowing an integer.
14432 (Fsafe_length): Return a float if the value is not representable
14433 as a fixnum. This shouldn't happen except in contrived situations.
14434 (Fnthcdr, Fsort): Don't assume list length fits in int.
14435 (Fcopy_sequence): Don't assume vector length fits in int.
14437 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14438 (header_size, word_size): New constants.
14439 (allocate_vectorlike): Don't check size overflow here.
14440 (allocate_vector): Check it here instead, since this is the only
14441 caller of allocate_vectorlike that could cause overflow.
14442 Check that the new vector's length is representable as a fixnum.
14444 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14445 The previous code was bogus. For example, next_almost_prime (32)
14446 returned 39, which is undesirable as it is a multiple of 3; and
14447 next_almost_prime (24) returned 25, which is a multiple of 5 so
14448 why was the code bothering to check for multiples of 7?
14450 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14452 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14454 Variadic C functions now count arguments with ptrdiff_t.
14455 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14456 Back then I didn't know that the Emacs coding style prefers signed int.
14457 Also, in the meantime I found a few more instances where arguments
14458 were being counted with int, which may truncate counts on 64-bit
14459 machines, or EMACS_INT, which may be unnecessarily wide.
14460 * lisp.h (struct Lisp_Subr.function.aMANY)
14461 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14462 Arg counts are now ptrdiff_t, not size_t.
14463 All variadic functions and their callers changed accordingly.
14464 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14465 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14466 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14467 * callint.c (Fcall_interactively): Check arg count for overflow,
14468 to avoid potential buffer overrun. Use signed char, not 'int',
14469 for 'varies' array, so that we needn't bother to check its size
14470 calculation for overflow.
14471 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14472 * eval.c (apply_lambda):
14473 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14474 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14475 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14477 * callint.c (Fcall_interactively): Don't use index var as event count.
14479 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14480 * mem-limits.h (SIZE): Remove; no longer used.
14482 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14484 Remove unnecessary casts.
14485 * xterm.c (x_term_init):
14486 * xfns.c (x_set_border_pixel):
14487 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14488 These aren't needed now that we assume ANSI C.
14490 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14491 It's more likely to cause problems (due to unsigned overflow)
14494 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14496 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14498 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14500 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14502 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14504 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14506 GLYPH_CODE_FACE returns EMACS_INT, not int.
14507 * dispextern.h (merge_faces):
14508 * xfaces.c (merge_faces):
14509 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14510 Don't assume EMACS_INT fits in int.
14512 * character.h (CHAR_VALID_P): Remove unused parameter.
14513 * fontset.c, lisp.h, xdisp.c: All uses changed.
14515 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14517 * fns.c (concat): Minor tuning based on overflow analysis.
14518 This doesn't fix any bugs. Use int to hold character, instead
14519 of constantly refetching from Emacs object. Use XFASTINT, not
14520 XINT, for value known to be a character. Don't bother comparing
14521 a single byte to 0400, as it's always less.
14523 * floatfns.c (Fexpt):
14524 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14526 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14529 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14531 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14532 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14533 incorrectly succeed when S was a string, because 4294967386 was
14534 truncated before it was used.
14536 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14537 Otherwise, an out-of-range integer could cause undefined behavior
14540 * composite.c: Use int, not EMACS_INT, for characters.
14541 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14542 EMACS_INT, for values that are known to be in character range.
14543 This doesn't fix any bugs but is the usual style inside Emacs and
14544 may generate better code on 32-bit machines.
14546 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14547 This is for reasons similar to the recent CHAR_STRING fix.
14548 * charset.c (Fencode_char): Check that character arg is actually
14549 a character. Pass an int to ENCODE_CHAR.
14550 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14551 wider than 'int', as a compile-time check to prevent future regressions
14554 * character.c (char_string): Remove unnecessary casts.
14556 Make sure a 64-bit char is never passed to CHAR_STRING.
14557 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14558 by silently ignoring the top 32 bits, allowing some values
14559 that were far too large to be valid characters.
14560 * character.h: Include <verify.h>.
14561 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14562 arguments are no wider than unsigned, as a compile-time check
14563 to prevent future regressions in this area.
14565 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14566 (Fsubst_char_in_region):
14568 * xdisp.c (decode_mode_spec_coding):
14569 Adjust to CHAR_STRING's new requirement.
14570 * editfns.c (Finsert_char, Fsubst_char_in_region):
14571 * fns.c (concat): Check that character args are actually
14572 characters. Without this test, these functions did the wrong
14573 thing with wildly out-of-range values on 64-bit hosts.
14575 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14576 These casts should not be needed on 32-bit hosts, either.
14577 * keyboard.c (read_char):
14578 * lread.c (Fload): Remove casts to unsigned.
14580 * lisp.h (UNSIGNED_CMP): New macro.
14581 This fixes comparison bugs on 64-bit hosts.
14582 (ASCII_CHAR_P): Use it.
14583 * casefiddle.c (casify_object):
14584 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14585 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14586 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14587 * dispextern.h (FACE_FROM_ID):
14588 * keyboard.c (read_char): Use UNSIGNED_CMP.
14590 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14591 not to EMACS_INT, to avoid GCC warning.
14593 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14595 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14596 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14597 isn't needed on 32-bit machines.
14599 * buffer.c (Fgenerate_new_buffer_name):
14600 Use EMACS_INT for count, not int.
14601 (advance_to_char_boundary): Return EMACS_INT, not int.
14603 * data.c (Qcompiled_function): Now static.
14605 * window.c (window_body_lines): Now static.
14607 * image.c (gif_load): Rename local to avoid shadowing.
14609 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14610 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14611 * alloc.c (make_save_value): Integer argument is now of type
14612 ptrdiff_t, not int.
14613 (mark_object): Use ptrdiff_t, not int.
14614 * lisp.h (pD): New macro.
14615 * print.c (print_object): Use it.
14617 * alloc.c: Use EMACS_INT, not int, to count objects.
14618 (total_conses, total_markers, total_symbols, total_vector_size)
14619 (total_free_conses, total_free_markers, total_free_symbols)
14620 (total_free_floats, total_floats, total_free_intervals)
14621 (total_intervals, total_strings, total_free_strings):
14622 Now EMACS_INT, not int. All uses changed.
14623 (Fgarbage_collect): Compute overall total using a double, so that
14624 integer overflow is less likely to be a problem. Check for overflow
14625 when converting back to an integer.
14626 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14627 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14628 These were 'int' variables that could overflow on 64-bit hosts;
14629 they were never used, so remove them instead of repairing them.
14630 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14631 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14632 Previously, this ceilinged at INT_MAX, but that doesn't work on
14634 (allocate_pseudovector): Don't use EMACS_INT when int would do.
14636 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14637 (allocate_vectorlike): Check for ptrdiff_t overflow.
14638 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14639 when a (possibly-narrower) signed value would do just as well.
14640 We prefer using signed arithmetic, to avoid comparison confusion.
14642 * alloc.c: Catch some string size overflows that we were missing.
14643 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14644 for convenience in STRING_BYTES_MAX.
14645 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14646 The definition here is exact; the one in lisp.h was approximate.
14647 (allocate_string_data): Check for string overflow. This catches
14648 some instances we weren't catching before. Also, it catches
14649 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14650 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14651 and ptrdiff_t and EMACS_INT are both 64 bits.
14653 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14654 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14655 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14657 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14659 * alloc.c (Fmake_string): Check for out-of-range init.
14661 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14663 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14665 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14667 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14668 xg_get_default_scrollbar_width.
14670 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14671 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14672 (style_changed_cb): Call update_theme_scrollbar_width and call
14673 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14674 all frames (Bug#8505).
14675 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14676 Call gtk_window_set_resizable if HAVE_GTK3.
14677 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14678 and height if HAVE_GTK3 (Bug#8505).
14679 (scroll_bar_width_for_theme): New variable.
14680 (update_theme_scrollbar_width): New function.
14681 (xg_get_default_scrollbar_width): Move code to
14682 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14683 (xg_initialize): Call update_theme_scrollbar_width.
14685 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14687 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14689 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14691 * frame.c (make_frame): Call other_buffer_safely instead of
14694 * window.c (temp_output_buffer_show): Call display_buffer with
14695 second argument Vtemp_buffer_show_specifiers and reset latter
14696 immediately after the call.
14697 (Vtemp_buffer_show_specifiers): New variable.
14698 (auto_window_vscroll_p, next_screen_context_lines)
14699 (Vscroll_preserve_screen_position): Remove leading asterisks from
14702 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
14704 Fix minor problems found by GCC 4.6.0 static checking.
14705 * buffer.c (Qclone_number): Remove for now, as it's unused.
14706 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14707 (record_buffer): Remove unused local.
14708 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14709 (set_frame_buffer_list): Remove; unused.
14710 * frame.h (other_visible_frames): Remove decl.
14711 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14712 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14713 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14715 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14716 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14717 Define only if HAVE_GPM.
14718 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14719 (update_hints_inhibit): Remove; never set. All uses removed.
14720 * widgetprv.h (emacsFrameClassRec): Remove decl.
14721 * window.c (delete_deletable_window): Now returns void, since it
14722 wasn't returning anything.
14723 (compare_window_configurations): Remove unused locals.
14724 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14725 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14726 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14727 the same widths as pointers. This follows up on the 2011-05-06 patch.
14728 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14729 * xterm.h: Likewise.
14730 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14732 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
14734 * makefile.w32-in: Update dependencies.
14735 (LISP_H): Add lib/intprops.h.
14737 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14739 * image.c (gif_load): Add animation frame delay to the metadata.
14740 (syms_of_image): Use DEFSYM. New symbol `delay'.
14742 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14744 * window.c (delete_deletable_window): Re-add.
14745 (Fset_window_configuration): Rewrite to handle dead buffers and
14746 consequently deletable windows.
14747 (window_tree, Fwindow_tree): Remove. Supply functionality in
14749 (compare_window_configurations): Simplify code.
14751 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14753 * image.c (imagemagick_load_image): Fix type mismatch.
14754 (Fimagemagick_types): Likewise.
14756 * window.h (replace_buffer_in_windows): Declare.
14758 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14760 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14761 Qclone_number. Remove external declaration of Qdelete_window.
14762 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14764 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14765 Run Qbuffer_list_update_hook if allowed.
14766 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14767 buffer list implementation.
14768 (other_buffer_safely): New function.
14769 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14770 calls to replace_buffer_in_windows and
14771 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14773 (record_buffer): Inhibit quitting and rewrite using quittable
14774 functions. Run Qbuffer_list_update_hook if allowed.
14775 (Frecord_buffer, Funrecord_buffer): New functions.
14776 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14777 Move switch-to-buffer to window.el.
14778 (bury-buffer): Move to window.el.
14779 (Vbuffer_list_update_hook): New variable.
14781 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14784 * window.h (resize_frame_windows): Move up in code.
14785 (Fwindow_frame): Remove EXFUN.
14786 (replace_buffer_in_all_windows): Remove prototype.
14787 (replace_buffer_in_windows_safely): Add prototype.
14789 * window.c: Declare Qdelete_window static again. Move down
14790 declaration of select_count.
14791 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14792 (Fother_window): Move to window.el.
14793 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14794 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14795 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14797 (replace_buffer_in_windows): Implement by calling
14798 Qreplace_buffer_in_windows.
14799 (replace_buffer_in_all_windows): Remove with some functionality
14800 moved into replace_buffer_in_windows_safely.
14801 (replace_buffer_in_windows_safely): New function.
14802 (select_window_norecord, select_frame_norecord): Move in front
14803 of run_window_configuration_change_hook. Remove now obsolete
14805 (Fset_window_buffer): Rewrite doc-string.
14806 Call Qrecord_window_buffer.
14807 (keys_of_window): Move binding for other-window to window.el.
14809 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14811 * dispextern.h (struct image): Replace data member, whose int_val
14812 and ptr_val fields were not used by anything, with a single
14815 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14816 (gif_clear_image, gif_load, imagemagick_load_image)
14817 (gs_clear_image, gs_load): Callers changed.
14819 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14821 * buffer.h: Include <time.h>, for time_t.
14822 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14824 Fix minor problems found by static checking.
14826 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14828 Make identifiers static if they are not used in other modules.
14829 * data.c (Qcompiled_function, Qframe, Qvector):
14830 * image.c (QimageMagick, Qsvg):
14831 * minibuf.c (Qmetadata):
14832 * window.c (resize_window_check, resize_root_window): Now static.
14833 * window.h (resize_window_check, resize_root_window): Remove decls.
14835 * window.c (window_deletion_count, delete_deletable_window):
14837 (window_body_lines): Now static.
14838 (Fdelete_other_windows_internal): Mark vars as initialized.
14839 Make sure 'resize_failed' is initialized.
14840 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14841 (resize_window_apply): Remove unused local.
14842 * window.h (delete_deletable_window): Remove decl.
14844 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14845 (imagemagick_load_image): Fix pointer signedness problem by changing
14846 last arg from unsigned char * to char *. All uses changed.
14847 Also, fix a local for similar reasons.
14848 Remove unused locals. Remove locals to avoid shadowing.
14849 (fn_rsvg_handle_free): Remove; unused.
14850 (svg_load, svg_load_image): Fix pointer signedness problem.
14851 (imagemagick_load_image): Don't use garbage pointer image_wand.
14853 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14855 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
14857 * image.c (gif_load): Fix omitted cast error introduced by
14860 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14862 * window.h (resize_proportionally, orig_total_lines)
14863 (orig_top_line): Remove from window structure.
14864 (set_window_height, set_window_width, change_window_heights)
14865 (Fdelete_window): Remove prototypes.
14866 (resize_frame_windows): Remove duplicate declaration.
14868 2011-06-10 Eli Zaretskii <eliz@gnu.org>
14870 * window.h (resize_frame_windows, resize_window_check)
14871 (delete_deletable_window, resize_root_window)
14872 (resize_frame_windows): Declare prototypes.
14874 * window.c (resize_window_apply): Make definition be "static" to
14875 match the prototype.
14877 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14879 * window.c: Remove declarations of Qwindow_size_fixed,
14880 window_min_size_1, window_min_size_2, window_min_size,
14881 size_window, window_fixed_size_p, enlarge_window, delete_window.
14882 Remove static from declaration of Qdelete_window, it's
14883 temporarily needed by Fbury_buffer.
14884 (replace_window): Don't assign orig_top_line and
14886 (Fdelete_window, delete_window): Remove. Window deletion is
14887 handled by window.el.
14888 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14889 Replace Fdelete_window calls with calls to Qdelete_window.
14890 (Fdelete_other_windows): Remove. Deleting other windows is
14891 handled by window.el.
14892 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14893 handled in window.el.
14894 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14895 Window minimum sizes are handled in window.el.
14896 (shrink_windows, size_window, set_window_height)
14897 (set_window_width, change_window_heights, window_height)
14898 (window_width, CURBEG, CURSIZE, enlarge_window)
14899 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14900 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14901 handled in window.el.
14902 (make_dummy_parent): Rename to make_parent_window and give it a
14903 second argument horflag.
14904 (make_window): Don't set resize_proportionally any more.
14905 (Fsplit_window): Remove. Windows are split in window.el.
14906 (save_restore_action, save_restore_orig_size)
14907 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14908 Resize mini windows in window.el.
14909 (grow_mini_window, shrink_mini_window): Implement by calling
14910 Qresize_root_window_vertically, resize_window_check and
14911 resize_window_apply.
14912 (saved_window, Fset_window_configuration, save_window_save):
14913 Do not handle orig_top_line, orig_total_lines, and
14914 resize_proportionally.
14915 (window_min_height, window_min_width): Move to window.el.
14916 (keys_of_window): Move bindings for delete-other-windows,
14917 split-window, delete-window and enlarge-window to window.el.
14919 * buffer.c: Temporarily extern Qdelete_window.
14920 (Fbury_buffer): Temporarily call Qdelete_window instead of
14921 Fdelete_window (Fbury_buffer will move to window.el soon).
14923 * frame.c (set_menu_bar_lines_1): Remove code handling
14924 orig_top_line and orig_total_lines.
14926 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14927 set_window_height but set heights directly.
14928 (change_frame_size_1): Use resize_frame_windows.
14930 * xdisp.c (init_xdisp): Don't use set_window_height but set
14933 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14934 Use resize_frame_windows instead of change_window_heights and run
14935 run_window_configuration_change_hook.
14937 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14938 instead of change_window_heights and run
14939 run_window_configuration_change_hook.
14941 2011-06-09 Martin Rudalics <rudalics@gmx.at>
14943 * window.c (replace_window): Rename second argument REPLACEMENT to
14944 NEW. New third argument SETFLAG. Rewrite.
14945 (delete_window, make_dummy_parent): Call replace_window with
14947 (window_list_1): Move down in code.
14948 (run_window_configuration_change_hook): Move set_buffer part
14949 before select_frame_norecord part in order to unwind correctly.
14950 Rename count1 to count.
14951 (recombine_windows, delete_deletable_window, resize_root_window)
14952 (Fdelete_other_windows_internal)
14953 (Frun_window_configuration_change_hook, make_parent_window)
14954 (resize_window_check, resize_window_apply, Fresize_window_apply)
14955 (resize_frame_windows, Fsplit_window_internal)
14956 (Fdelete_window_internal, Fresize_mini_window_internal):
14958 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14960 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14962 * window.h (window): Add some new members to window structure -
14963 normal_lines, normal_cols, new_total, new_normal, clone_number,
14964 splits, nest, prev_buffers, next_buffers.
14965 (WINDOW_TOTAL_SIZE): Move here from window.c.
14966 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14968 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14970 (make_dummy_parent): Set new members of windows structure.
14971 (make_window): Move down in code. Handle new members of window
14973 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14974 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14975 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14976 (Fset_window_prev_buffers, Fwindow_next_buffers)
14977 (Fset_window_next_buffers, Fset_window_clone_number):
14979 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14980 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14982 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14983 Argument WINDOW can be now internal window too.
14984 (Fwindow_use_time): Move up in code.
14985 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14986 Rewrite doc-string.
14987 (Fset_window_configuration, saved_window)
14988 (Fcurrent_window_configuration, save_window_save): Handle new
14989 members of window structure.
14990 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14991 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14992 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14993 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14994 Qget_mru_window, Qresize_root_window,
14995 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14996 Qauto_buffer_name; staticpro them.
14998 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15000 * window.c (Fwindow_total_size, Fwindow_left_column)
15001 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15002 (Fwindow_list_1): New functions.
15003 (window_box_text_cols): Replace with window_body_cols.
15004 (Fwindow_width, Fscroll_left, Fscroll_right):
15005 Use window_body_cols instead of window_box_text_cols.
15006 (delete_window, Fset_window_configuration):
15007 Call delete_all_subwindows with window as argument.
15008 (delete_all_subwindows): Take a window as argument and not a
15009 structure. Rewrite.
15010 (window_loop): Remove handling of GET_LRU_WINDOW and
15011 GET_LARGEST_WINDOW.
15012 (Fget_lru_window, Fget_largest_window): Move to window.el.
15014 * window.h: Extern window_body_cols instead of
15015 window_box_text_cols. delete_all_subwindows now takes a
15016 Lisp_Object as argument.
15018 * indent.c (compute_motion, Fcompute_motion):
15019 Use window_body_cols instead of window_box_text_cols.
15021 * frame.c (delete_frame): Call delete_all_subwindows with root
15022 window as argument.
15024 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15026 * fns.c (Fputhash): Document return value.
15028 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15030 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15032 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15034 Cons<->int and similar integer overflow fixes (Bug#8794).
15036 Check for overflow when converting integer to cons and back.
15037 * charset.c (Fdefine_charset_internal, Fdecode_char):
15038 Use cons_to_unsigned to catch overflow.
15039 (Fencode_char): Use INTEGER_TO_CONS.
15040 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15041 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15042 * data.c (long_to_cons, cons_to_long): Remove.
15043 (cons_to_unsigned, cons_to_signed): New functions.
15044 These signal an error for invalid or out-of-range values.
15045 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15046 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15047 * font.c (Ffont_variation_glyphs):
15048 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15049 * lisp.h: Include <intprops.h>.
15050 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15051 (cons_to_signed, cons_to_unsigned): New decls.
15052 (long_to_cons, cons_to_long): Remove decls.
15053 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15054 (Fprimitive_undo): Use CONS_TO_INTEGER.
15055 * xfns.c (Fx_window_property): Likewise.
15056 * xselect.c: Include <limits.h>.
15057 (x_own_selection, selection_data_to_lisp_data):
15058 Use INTEGER_TO_CONS.
15059 (x_handle_selection_request, x_handle_selection_clear)
15060 (x_get_foreign_selection, Fx_disown_selection_internal)
15061 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15062 (lisp_data_to_selection_data): Use cons_to_unsigned.
15063 (x_fill_property_data): Use cons_to_signed.
15064 Report values out of range.
15066 Check for buffer and string overflow more precisely.
15067 * buffer.h (BUF_BYTES_MAX): New macro.
15068 * lisp.h (STRING_BYTES_MAX): New macro.
15069 * alloc.c (Fmake_string):
15070 * character.c (string_escape_byte8):
15071 * coding.c (coding_alloc_by_realloc):
15072 * doprnt.c (doprnt):
15073 * editfns.c (Fformat):
15075 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15076 since they may not be the same number.
15077 * editfns.c (Finsert_char):
15078 * fileio.c (Finsert_file_contents):
15079 Likewise for BUF_BYTES_MAX.
15081 * image.c: Use ptrdiff_t, not int, for sizes.
15082 (slurp_file): Switch from int to ptrdiff_t.
15084 (slurp_file): Check that file size fits in both size_t (for
15085 malloc) and ptrdiff_t (for sanity and safety).
15087 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15088 if b->modtime has its maximal value.
15090 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15092 Don't assume time_t can fit into int.
15093 * buffer.h (struct buffer.modtime): Now time_t, not int.
15094 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15095 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15097 Minor fixes for signed vs unsigned integers.
15098 * character.h (MAYBE_UNIFY_CHAR):
15099 * charset.c (maybe_unify_char):
15100 * keyboard.c (read_char, reorder_modifiers):
15101 XINT -> XFASTINT, since the integer must be nonnegative.
15102 * ftfont.c (ftfont_spec_pattern):
15103 * keymap.c (access_keymap, silly_event_symbol_error):
15104 XUINT -> XFASTINT, since the integer must be nonnegative.
15105 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15106 since it makes no difference and we prefer signed.
15107 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15108 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15111 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15113 * window.h (Fwindow_frame): Declare.
15115 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15117 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15118 (SPARE_MEMORY): Always define.
15119 (LARGE_REQUEST): Remove.
15120 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15122 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15124 * lisp.h: Move EXFUNS for Fframe_root_window,
15125 Fframe_first_window and Fset_frame_selected_window to window.h.
15127 * window.h: Move EXFUNS for Fframe_root_window,
15128 Fframe_first_window and Fset_frame_selected_window here from
15131 * frame.c (Fwindow_frame, Fframe_first_window)
15132 (Fframe_root_window, Fframe_selected_window)
15133 (Fset_frame_selected_window): Move to window.c.
15134 (Factive_minibuffer_window): Move to minibuf.c.
15135 (Fother_visible_frames_p): New function.
15137 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15139 * window.c (decode_window, decode_any_window): Move up in code.
15140 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15141 (inhibit_frame_unsplittable): Remove unused variable.
15142 (Fwindow_buffer): Move up and rewrite doc-string.
15143 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15144 (Fwindow_prev): New functions.
15145 (Fwindow_frame): Move here from frame.c. Accept any window as
15147 (Fframe_root_window, Fframe_first_window)
15148 (Fframe_selected_window): Move here from frame.c. Accept frame
15149 or arbitrary window as argument. Update doc-strings.
15150 (Fminibuffer_window): Move up in code.
15151 (Fwindow_minibuffer_p): Move up in code and simplify.
15152 (Fset_frame_selected_window): Move here from frame.c.
15154 (Fselected_window, select_window, Fselect_window): Move up in
15155 code. Minor doc-string fixes.
15157 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15159 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15160 Do not assume that spare memory exists; that assumption is valid
15161 only if SYSTEM_MALLOC.
15162 (LARGE_REQUEST): New macro, so that the issue of large requests
15163 is separated from the issue of spare memory.
15165 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15167 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15170 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15172 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15175 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15177 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15179 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15181 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15182 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15184 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15186 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15188 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15190 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15191 (x_clipboard_manager_save): Add return value.
15192 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15193 New error handlers.
15194 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15195 Obey Vx_select_enable_clipboard_manager. Catch errors in
15196 x_clipboard_manager_save (Bug#8779).
15197 (Vx_select_enable_clipboard_manager): New variable.
15198 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15200 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15202 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15204 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15206 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15207 in the current matrix if keep_current_p is non-zero.
15209 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15211 * bidi.c (bidi_level_of_next_char): Fix last change.
15213 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15215 Support bidi reordering of text covered by display properties.
15217 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15218 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15219 (bidi_cache_search, bidi_cache_iterator_state)
15220 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15221 (bidi_level_of_next_char, bidi_move_to_visually_next):
15222 Support character positions inside a run of characters covered by a
15224 (bidi_paragraph_init, bidi_resolve_explicit_1)
15225 (bidi_level_of_next_char): Call bidi_fetch_char and
15226 bidi_fetch_char_advance instead of FETCH_CHAR and
15227 FETCH_CHAR_ADVANCE.
15228 (bidi_init_it): Initialize new members.
15229 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15231 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15232 instead of using explicit *_CHAR codes.
15233 (bidi_resolve_explicit, bidi_resolve_weak):
15234 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15235 bidirectional text is supported only in multibyte buffers.
15236 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15237 it to initialize the frame_window_p member of struct bidi_it.
15238 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15239 (bidi_resolve_explicit, bidi_resolve_weak)
15240 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15241 bidi_it->nchars is non-positive.
15242 (bidi_level_of_next_char): Don't try to lookup the cache for the
15243 next/previous character if nothing is cached there yet, or if we
15244 were just reseat()'ed to a new position.
15246 * xdisp.c (set_cursor_from_row): Set start and stop points
15247 according to the row's direction when priming the loop that looks
15248 for the glyph on which to display cursor.
15249 (single_display_spec_intangible_p): Function deleted.
15250 (display_prop_intangible_p): Reimplement to call
15251 handle_display_spec instead of single_display_spec_intangible_p.
15252 Accept 3 additional arguments needed by handle_display_spec.
15253 This fixes incorrect cursor motion across display property with complex
15254 values: lists, `(when COND...)' forms, etc.
15255 (single_display_spec_string_p): Support property values that are
15256 lists with the argument STRING its top-level element.
15257 (display_prop_string_p): Fix the condition for processing a
15258 property that is a list to be consistent with handle_display_spec.
15259 (handle_display_spec): New function, refactored from the
15260 last portion of handle_display_prop.
15261 (compute_display_string_pos): Accept additional argument
15262 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15263 value of a `display' property is a "replacing spec".
15264 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15265 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15266 the display property, but just return a value indicating whether
15267 the display property will replace the characters it covers.
15268 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15269 frame_window_p members of struct bidi_it.
15270 (compute_display_string_pos, compute_display_string_end):
15272 (push_it): Accept second argument POSITION, where pop_it should
15273 jump to continue iteration.
15274 (reseat_1): Initialize bidi_it.disp_pos.
15276 * keyboard.c (adjust_point_for_property): Adjust the call to
15277 display_prop_intangible_p to its new signature.
15279 * dispextern.h (struct bidi_it): New member frame_window_p.
15280 (bidi_init_it): Update prototypes.
15281 (display_prop_intangible_p): Update prototype.
15282 (compute_display_string_pos, compute_display_string_end):
15283 Declare prototypes.
15284 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15287 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15289 Malloc failure behavior now depends on size of allocation.
15290 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15291 * lisp.h: Change signatures accordingly.
15292 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15293 All callers changed. (Bug#8762)
15295 * gnutls.c: Use Emacs's memory allocators.
15296 Without this change, the gnutls library would invoke malloc etc.
15297 directly, which causes problems on non-SYNC_INPUT hosts, and which
15298 runs afoul of improving memory_full behavior. (Bug#8761)
15299 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15300 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15301 xfree instead of the default malloc, realloc, free.
15302 (Fgnutls_boot): No need to check for memory allocation failure,
15303 since xmalloc does that for us.
15305 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15306 * category.c (hash_get_category_set):
15307 * ccl.c (ccl_driver):
15308 * charset.c (Fdefine_charset_internal):
15309 * charset.h (struct charset.hash_index):
15310 * composite.c (get_composition_id, gstring_lookup_cache)
15311 (composition_gstring_put_cache):
15312 * composite.h (struct composition.hash_index):
15313 * dispextern.h (struct image.hash):
15314 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15315 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15316 (hashfn_equal, hashfn_user_defined, make_hash_table)
15317 (maybe_resize_hash_table, hash_lookup, hash_put)
15318 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15319 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15320 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15321 * image.c (make_image, search_image_cache, lookup_image)
15322 (xpm_put_color_table_h):
15323 * lisp.h (struct Lisp_Hash_Table):
15324 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15325 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15326 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15327 * alloc.c (allocate_vectorlike):
15328 Check for overflow in vector size calculations.
15329 * ccl.c (ccl_driver):
15330 Check for overflow when converting EMACS_INT to int.
15331 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15332 need to be updated by these changes.
15333 * fns.c (make_hash_table, maybe_resize_hash_table):
15334 Check for integer overflow with large hash tables.
15335 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15336 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15337 (SXHASH_REDUCE): New macro.
15338 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15339 Use it instead of discarding useful hash info with large hash values.
15340 (sxhash_float): New function.
15341 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15342 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15343 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15344 Rewrite to use FIXNUM_BITS, as this simplifies things.
15345 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15346 Adjust signatures to match updated version of code.
15347 (consing_since_gc): Now EMACS_INT, since a single hash table can
15348 use more than INT_MAX bytes.
15350 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15352 Make it possible to build with GCC-4.6+ -O2 -flto.
15354 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15356 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15358 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15359 Call minibuffer-inactive-mode.
15361 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15363 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15364 Update dependencies.
15366 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15368 * data.c (init_data): Remove code for UTS, this system is not
15371 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15373 Don't force ./temacs to start in terminal mode.
15375 * frame.c (make_initial_frame): Initialize faces in all cases, not
15376 only when CANNOT_DUMP is defined.
15377 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15379 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15381 * dispnew.c (add_window_display_history): Use const for the string
15382 pointer. Remove declaration, not needed.
15384 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15386 Use 'inline', not 'INLINE'.
15387 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15388 * alloc.c, fontset.c (INLINE): Remove.
15389 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15390 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15391 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15392 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15393 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15395 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15397 Make it possible to run ./temacs.
15399 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15400 syms_of_callproc does the same thing. Remove test for
15401 "initialized", do it in the caller.
15402 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15404 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15406 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15407 (read_minibuf): Use get_minibuffer.
15408 (syms_of_minibuf): Use DEFSYM.
15409 (Qmetadata): New var.
15410 * data.c (Qbuffer): Don't make it static.
15411 (syms_of_data): Use DEFSYM.
15413 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15415 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15416 (CCL_CODE_MIN): New macro.
15418 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15420 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15422 * eval.c (Qdebug): Now static.
15423 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15424 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15425 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15427 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15429 * image.c: Various fixes to ImageMagick code comments.
15430 (Fimagemagick_types): Doc fix.
15432 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15434 Minor fixes prompted by GCC 4.6.0 warnings.
15436 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15438 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15439 (x_clipboard_manager_save_all): Move extern decl to ...
15440 * xterm.h: ... here, so that it can be checked for consistency.
15442 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15444 * xselect.c (x_clipboard_manager_save_frame)
15445 (x_clipboard_manager_save_all): New functions.
15446 (Fx_clipboard_manager_save): Lisp function deleted.
15448 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15449 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15451 * xterm.h: Update prototype.
15453 2011-05-28 William Xu <william.xwl@gmail.com>
15455 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15456 exiting (Bug#8239).
15458 2011-05-28 Jim Meyering <meyering@redhat.com>
15460 Avoid a sign-extension bug in crypto_hash_function.
15461 * fns.c (to_uchar): Define.
15462 (crypto_hash_function): Use it to convert some newly-signed
15463 variables to unsigned, to avoid sign-extension bugs. For example,
15464 without this change, (md5 "truc") would evaluate to
15465 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15466 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15467 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15469 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15471 Integer overflow fixes.
15473 * dbusbind.c: Serial number integer overflow fixes.
15474 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15475 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15476 to hold a serial number that is too large for a fixnum.
15477 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15478 Check for serial numbers out of range. Decode any serial number
15479 that was so large that it became a float. (Bug#8722)
15481 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15482 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15483 Use XFASTINT rather than XUINT when numbers are nonnegative.
15484 (xd_append_arg, Fdbus_method_return_internal):
15485 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15486 arguments, check that Lisp number is nonnegative, rather than
15487 silently wrapping negative numbers around. (Bug#8722)
15488 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15491 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15493 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15495 ccl: Add integer overflow checks.
15496 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15497 (IN_INT_RANGE): New macros.
15498 (ccl_driver): Use them to check for integer overflow when
15499 decoding a CCL program. Many of the new checks are whether XINT (x)
15500 fits in int; it doesn't always, on 64-bit hosts. The new version
15501 doesn't catch all possible integer overflows, but it's an
15502 improvement. (Bug#8719)
15504 * alloc.c (make_event_array): Use XINT, not XUINT.
15505 There's no need for unsigned here.
15507 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15508 This follows up to the 2011-05-06 change that substituted uintptr_t
15509 for EMACS_INT. This case wasn't caught back then.
15511 Rework Fformat to avoid integer overflow issues.
15512 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15513 now (part of C89). Include <verify.h>.
15514 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15515 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15516 (Fformat): Avoid the prepass trying to compute sizes; it was only
15517 approximate and thus did not catch overflow reliably. Instead, walk
15518 through the format just once, formatting and computing sizes as we go,
15519 checking for integer overflow at every step, and allocating a larger
15520 buffer as needed. Keep track separately whether the format is
15521 multibyte. Keep only the most-recently calculated precision, rather
15522 than them all. Record whether each argument has been converted to
15523 string. Use EMACS_INT, not int, for byte and char and arg counts.
15524 Support field widths and precisions larger than INT_MAX. Avoid
15525 sprintf's undefined behavior with conversion specifications such as %#d
15526 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15527 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15528 formatting out-of-range floating point numbers with int
15529 formats. (Bug#8668)
15531 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15533 * data.c: Avoid integer truncation in expressions involving floats.
15534 * data.c: Include <intprops.h>.
15535 (arith_driver): When there's an integer overflow in an expression
15536 involving floating point, convert the integers to floating point
15537 so that the resulting value does not suffer from catastrophic
15538 integer truncation. For example, on a 64-bit host (* 4
15539 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15540 Do not rely on undefined behavior after integer overflow.
15542 merge count_size_as_multibyte, parse_str_to_multibyte
15543 * character.c, character.h (count_size_as_multibyte):
15544 Rename from parse_str_to_multibyte; all uses changed.
15545 Check for integer overflow.
15546 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15547 since it's now a duplicate of the other. This is more of
15548 a character than a buffer op, so better that it's in character.c.
15549 * fns.c, print.c: Adjust to above changes.
15551 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15553 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15555 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15557 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15558 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15559 (x_clipboard_manager_save): Now static.
15560 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15562 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15563 (crypto_hash_function): Now static.
15564 Fix pointer signedness problems. Avoid unnecessary initializations.
15566 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15568 * termhooks.h (Vselection_alist): Make it terminal-local.
15570 * terminal.c (create_terminal): Initialize it.
15572 * xselect.c: Support for clipboard managers.
15573 (Vselection_alist): Move to termhooks.h as terminal-local var.
15574 (LOCAL_SELECTION): New macro.
15575 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15576 (symbol_to_x_atom): Remove gratuitous arg.
15577 (x_handle_selection_request, lisp_data_to_selection_data)
15578 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15579 (x_own_selection, x_get_local_selection, x_convert_selection):
15580 New arg, specifying work frame. Use terminal-local Vselection_alist.
15581 (some_frame_on_display): Delete unused function.
15582 (Fx_own_selection_internal, Fx_get_selection_internal)
15583 (Fx_disown_selection_internal, Fx_selection_owner_p)
15584 (Fx_selection_exists_p): New optional frame arg.
15585 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15586 (x_handle_selection_clear): Don't treat other terminals with the
15587 same keyboard specially. Use the terminal-local Vselection_alist.
15588 (x_clear_frame_selections): Use Frun_hook_with_args.
15590 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15592 * xterm.h: Add support for those atoms.
15594 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
15596 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15597 (converted_selections, conversion_fail_tag): New global variables.
15598 (x_selection_request_lisp_error): Free the above.
15599 (x_get_local_selection): Remove unnecessary code.
15600 (x_reply_selection_request): Args changed; handle arbitrary array
15601 of converted selections stored in converted_selections.
15602 Separate the XChangeProperty and SelectionNotify steps.
15603 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15604 (x_convert_selection): New function.
15605 (x_handle_selection_event): Simplify.
15606 (x_get_foreign_selection): Don't ignore incoming requests while
15607 waiting for an answer; this will fail when we implement
15608 SAVE_TARGETS, and seems unnecessary anyway.
15609 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15610 (Vx_sent_selection_functions): Doc fix.
15612 2011-05-26 Leo Liu <sdl.web@gmail.com>
15614 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15616 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15618 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15620 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15621 for fringe update if it has periodic bitmap.
15622 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15623 and fringe_bitmap_periodic_p.
15625 * fringe.c (get_fringe_bitmap_data): New function.
15626 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15627 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15628 row. Mark glyph row for fringe update if periodicity changed.
15630 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15631 for fringe update unless it has periodic bitmap.
15633 2011-05-25 Kenichi Handa <handa@m17n.org>
15635 * xdisp.c (get_next_display_element): Set correct it->face_id for
15636 a static composition.
15638 2011-05-24 Leo Liu <sdl.web@gmail.com>
15641 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15643 * fns.c (crypto_hash_function, Fsha1): New function.
15644 (Fmd5): Use crypto_hash_function.
15645 (syms_of_fns): Add Ssha1.
15647 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15649 * gnutls.c: Remove unused macros.
15650 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15651 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15652 Remove macros that are defined and never used.
15653 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15655 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15657 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15658 (Fx_get_selection_internal): Minor cleanup.
15659 (Fx_own_selection_internal): Rename arguments for consistency with
15662 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15664 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15666 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15668 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15670 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15672 * dispnew.c (scrolling_window): Don't exclude the case that the
15673 last enabled row in the desired matrix touches the bottom boundary.
15675 2011-05-21 Glenn Morris <rgm@gnu.org>
15677 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15678 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15679 and add some more files.
15681 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15683 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15684 report_file_error introduced by the change from 2011-05-07.
15686 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15688 * systime.h (Time): Define only if emacs is defined.
15689 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15690 where the include path doesn't have X11/X.h by default. See
15691 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15693 2011-05-20 Kenichi Handa <handa@m17n.org>
15695 * composite.c (find_automatic_composition): Fix previous change.
15697 2011-05-20 Glenn Morris <rgm@gnu.org>
15699 * lisp.mk: New file, split from Makefile.in.
15700 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15701 (shortlisp): Remove.
15702 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15704 2011-05-19 Glenn Morris <rgm@gnu.org>
15706 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15707 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15708 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15709 (lisp): Set the order to that of loadup.el.
15710 (shortlisp): Make it a copy of $lisp.
15711 (SOME_MACHINE_LISP): Remove.
15712 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15713 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15715 2011-05-18 Kenichi Handa <handa@m17n.org>
15717 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15718 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15719 (find_automatic_composition): Mostly rewrite for efficiency.
15721 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
15723 * makefile.w32-in: Update dependencies.
15725 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15727 * menu.c: Include limits.h (fixes the MS-Windows build broken by
15728 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15730 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
15732 Fix some integer overflow issues, such as string length overflow.
15734 * insdel.c (count_size_as_multibyte): Check for string overflow.
15736 * character.c (lisp_string_width): Check for string overflow.
15737 Use EMACS_INT, not int, for string indexes and lengths; in
15738 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15739 the resulting string length overflows an EMACS_INT; instead,
15740 report a string overflow if no precision given. When checking for
15741 precision exhaustion, use a check that cannot possibly have
15742 integer overflow. (Bug#8675)
15743 * character.h (lisp_string_width): Adjust to new signature.
15745 * alloc.c (string_overflow): New function.
15746 (Fmake_string): Use it. This doesn't change behavior, but saves
15747 a few bytes and will simplify future changes.
15748 * character.c (string_escape_byte8): Likewise.
15749 * lisp.h (string_overflow): New decl.
15751 Fixups, following up to the user-interface timestamp change.
15752 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15753 for UI timestamps, instead of unsigned long.
15754 * msdos.c (mouse_get_pos): Likewise.
15755 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15756 * w32gui.h (Time): Define by including "systime.h" rather than by
15757 declaring it ourselves. (Bug#8664)
15759 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15760 * image.c (clear_image_cache): Likewise.
15762 * term.c (term_mouse_position): Don't assume time_t wraparound.
15764 Be more systematic about user-interface timestamps.
15765 Before, the code sometimes used 'Time', sometimes 'unsigned long',
15766 and sometimes 'EMACS_UINT', to represent these timestamps.
15767 This change causes it to use 'Time' uniformly, as that's what X uses.
15768 This makes the code easier to follow, and makes it easier to catch
15769 integer overflow bugs such as Bug#8664.
15770 * frame.c (Fmouse_position, Fmouse_pixel_position):
15771 Use Time, not unsigned long, for user-interface timestamps.
15772 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15773 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15774 * keyboard.h (last_event_timestamp): Likewise.
15775 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15776 * menu.h (xmenu_show): Likewise.
15777 * term.c (term_mouse_position): Likewise.
15778 * termhooks.h (struct input_event.timestamp): Likewise.
15779 (struct terminal.mouse_position_hook): Likewise.
15780 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15781 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15782 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15783 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15784 what it was before.
15785 * menu.h, termhooks.h: Include "systime.h", for Time.
15787 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15788 Don't assume that the difference between two unsigned long values
15789 can fit into an integer. At this point, we know button_down_time
15790 <= event->timestamp, so the difference must be nonnegative, so
15791 there's no need to cast the result if double-click-time is
15792 nonnegative, as it should be; check that it's nonnegative, just in
15793 case. This bug is triggered when events are more than 2**31 ms
15794 apart (about 25 days). (Bug#8664)
15796 * xselect.c (last_event_timestamp): Remove duplicate decl.
15797 (x_own_selection): Remove needless cast to unsigned long.
15799 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15800 that always fit in int. Use a sentinel instead of a counter, to
15801 avoid a temp and to allay GCC's concerns about possible int overflow.
15802 * frame.h (struct frame): Use int for menu_bar_items_used
15803 instead of EMACS_INT, since it always fits in int.
15805 * menu.c (grow_menu_items): Check for int overflow.
15807 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15809 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15810 Before, the code was not consistent. These values cannot exceed
15811 2**31 - 1 so there's no need to make them unsigned.
15812 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15813 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15814 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15816 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15818 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15819 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15820 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15821 presumably because the widths might not match.
15823 * window.c (size_window): Avoid needless test at loop start.
15825 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15827 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15829 2011-05-12 Drew Adams <drew.adams@oracle.com>
15831 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15833 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15835 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15836 `width' to `bar_area_x' and `bar_area_width', respectively.
15837 (x_scroll_run): Take account of fringe background extension.
15839 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15840 Rename local vars `left' and `width' to `bar_area_x' and
15841 `bar_area_width', respectively.
15842 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15843 background extension.
15845 2011-05-10 Jim Meyering <meyering@redhat.com>
15847 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15849 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
15851 * image.c (Finit_image_library): Return t for built-in image types,
15852 like pbm and xbm. (Bug#8640)
15854 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15856 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15858 2011-05-07 Eli Zaretskii <eliz@gnu.org>
15860 * w32console.c (Fset_screen_color): Doc fix.
15861 (Fget_screen_color): New function.
15862 (syms_of_ntterm): Defsubr it.
15864 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15865 unlink the temporary file if Fcall_process didn't create it in the
15867 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15868 child process will be redirected to a file specified with `:file'.
15869 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15870 cue to call_process_cleanup not to close that handle.
15872 2011-05-07 Ben Key <bkey76@gmail.com>
15874 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15875 one of two shell specific rules, either bootstrap-temacs-CMD or
15876 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15877 to the previous implementation of the bootstrap-temacs rule.
15878 The bootstrap-temacs-CMD rule is similar to the previous
15879 implementation of the bootstrap-temacs rule except that it
15880 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15883 These changes, along with some changes to nt/configure.bat,
15884 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15885 earlier fix to add support for --cflags and --ldflags options
15886 that include quotes so that it works whether make uses cmd or
15889 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
15891 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15892 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15894 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15895 a string. Handle both cases.
15896 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15897 (Fdbus_register_method): Use Qinvalid_function.
15899 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15901 * makefile.w32-in: Update dependencies.
15902 (LISP_H): Add inttypes.h and stdin.h.
15903 (PROCESS_H): Add unistd.h.
15905 2011-05-06 Eli Zaretskii <eliz@gnu.org>
15907 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15908 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15910 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
15912 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15914 * term.c (vfatal): Remove stray call to va_end.
15915 It's not needed and the C Standard doesn't allow it here anyway.
15917 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15918 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15920 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15923 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15925 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15927 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15929 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15931 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15933 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15934 * charset.c (Fdefine_charset_internal): Don't initialize
15935 charset.code_space[15]. The value was garbage, on hosts with
15936 32-bit int (Bug#8600).
15938 * lread.c (read_integer): Be more consistent with string-to-number.
15939 Use string_to_number to do the actual conversion; this avoids
15940 rounding errors and fixes some other screwups. Without this fix,
15941 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15942 (digit_to_number): Move earlier, for benefit of read_integer.
15943 Return -1 if the digit is out of range for the base, -2 if it is
15944 not a digit in any supported base. (Bug#8602)
15946 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15948 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15949 to match comment at start of function. This also removes a
15950 GCC warning about overflow in a 32+64-bit port.
15952 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15954 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15955 Reported by Stefan Monnier in
15956 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15957 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15958 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15960 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15961 (EMACS_UINTPTR): Likewise, with uintptr_t.
15963 * lisp.h: Prefer 64-bit EMACS_INT if available.
15964 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15965 on 32-bit hosts that have 64-bit int, so that they can access
15967 However, temporarily disable this change unless the temporary
15968 symbol WIDE_EMACS_INT is defined.
15970 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15972 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15973 This removes an assumption that EMACS_INT and long are the same
15974 width as pointers. The assumption is true for Emacs porting targets
15975 now, but we want to make other targets possible.
15976 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15977 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15978 In the rest of the code, change types of integers that hold casted
15979 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15980 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15981 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15982 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15983 No need to cast type when ORing.
15984 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15985 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15986 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15987 assume EMACS_INT is the same width as char *.
15988 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15989 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15990 Remove no-longer-needed casts.
15991 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15992 (xg_tool_bar_help_callback, xg_make_tool_item):
15993 Use EMACS_INTPTR to hold an integer
15994 that will be cast to void *; this can avoid a GCC warning
15995 if EMACS_INT is not the same width as void *.
15996 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15997 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15998 (current_message_1, set_message_1):
15999 Use a local to convert to proper width without a cast.
16000 * xmenu.c (dialog_selection_callback): Likewise.
16002 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16003 Also, don't assume VALBITS / RAND_BITS is less than 5,
16004 and don't rely on undefined behavior when shifting a 1 left into
16006 * lisp.h (get_random): Change signature to match.
16008 * lread.c (hash_string): Use size_t, not int, for hash computation.
16009 Normally we prefer signed values; but hashing is special, because
16010 it's better to use unsigned division on hash table sizes so that
16011 the remainder is nonnegative. Also, size_t is the natural width
16012 for hashing into memory. The previous code used 'int', which doesn't
16013 retain enough info to hash well into very large tables.
16014 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16016 * dbusbind.c: Don't possibly lose pointer info when converting.
16017 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16018 Use XPNTR rather than XHASH, so that the high-order bits of
16019 the pointer aren't lost when converting through void *.
16021 * eval.c (Fautoload): Don't double-shift a pointer.
16023 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16025 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16027 * gnutls.c (DEF_GNUTLS_FN):
16028 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16030 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16032 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16035 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16037 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16038 New version that can reserve upto 2GB of heap space.
16040 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16042 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16044 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16046 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16047 `gnutls_certificate_set_x509_key_file'.
16049 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16051 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16052 Update dependencies.
16054 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16056 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16057 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16058 Remove unused parameter `fildes'.
16059 * process.c (read_process_output, send_process): Don't pass it.
16061 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16063 Fix previous change: the library cache is defined in w32.c.
16064 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16065 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16067 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16069 Implement dynamic loading of GnuTLS on Windows.
16071 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16072 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16073 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16076 * gnutls.c (Qgnutls_dll): Define.
16077 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16078 (gnutls_*): Declare function pointers.
16079 (init_gnutls_functions): New function to initialize function pointers.
16080 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16081 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16082 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16083 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16084 (emacs_gnutls_write, emacs_gnutls_read)
16085 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16086 (Fgnutls_available_p): New function.
16087 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16088 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16089 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16091 * image.c: Include w32.h.
16092 (Vimage_type_cache): Delete.
16093 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16094 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16095 (w32_delayed_load): Move to w32.c.
16097 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16099 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16100 (w32_delayed_load): Move from image.c. When loading a library, record
16101 its filename in the :loaded-from property of the library id.
16102 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16103 Initialize and staticpro them.
16104 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16106 * process.c: Include lisp.h before w32.h, not after.
16107 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16108 instead of gnutls_record_check_pending.
16110 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16112 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16114 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16115 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16118 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16120 * xterm.c (x_set_frame_alpha): Do not set property on anything
16121 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16123 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16125 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16127 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16129 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16130 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16131 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16132 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16133 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16134 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16135 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16136 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16137 (Qgnutls_bootprop_callbacks_verify): Make static.
16139 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16141 * callproc.c: Indentation fixup.
16143 * sysdep.c (wait_for_termination_1): Make static.
16144 (wait_for_termination, interruptible_wait_for_termination):
16145 Move after wait_for_termination_1.
16147 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16149 * sysdep.c (interruptible_wait_for_termination): New function
16150 which is like wait_for_termination, but allows keyboard
16153 * callproc.c (Fcall_process): Add (:file "file") as an option for
16155 (Fcall_process_region): Ditto.
16157 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16159 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16160 rather than `XVECTOR (FOO)->size'.
16162 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16163 inttypes.h, as a gnulib replacement is used if it not available in
16166 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16168 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16169 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16170 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16172 * coding.c (coding_alloc_by_realloc): Error out if destination
16173 will grow beyond MOST_POSITIVE_FIXNUM.
16174 (decode_coding_emacs_mule): Abort if there isn't enough place in
16175 charbuf for the composition carryover bytes. Reserve an extra
16176 space for up to 2 characters produced in a loop.
16177 (decode_coding_iso_2022): Abort if there isn't enough place in
16178 charbuf for the composition carryover bytes.
16180 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16182 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16183 aborting when %lld or %lll format is passed.
16184 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16185 %llo or %llx format is passed. (Bug#8545)
16187 * window.c (window_scroll_line_based): Use a marker instead of
16188 simple variables to record original value of point. (Bug#7952)
16190 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16191 produced by %s or %c overflows available buffer space. (Bug#8545)
16193 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16195 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16196 (SIZE_MAX): Move defn after all includes, as they might #define it.
16198 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16200 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16202 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16204 * keyboard.c (Qdelayed_warnings_hook): Define.
16205 (command_loop_1): Run `delayed-warnings-hook'
16206 if Vdelayed_warnings_list is non-nil.
16207 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16208 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16210 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16212 * doprnt.c (doprnt): Don't return value smaller than the buffer
16213 size if the message was truncated. (Bug#8545).
16215 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16217 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16218 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16220 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16222 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16224 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16226 * makefile.w32-in: Update dependencies.
16228 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16230 Improve `doprnt' and its usage. (Bug#8545)
16231 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16232 `format_end'. Remove support for %l as a conversion specifier.
16233 Don't use xrealloc. Improve diagnostics when the %l size modifier
16234 is used. Update the commentary.
16236 * eval.c (verror): Simplify calculation of size_t.
16238 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16241 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16243 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16246 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16248 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16249 This makes this file independent of the recent pseudovector change.
16251 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16253 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16255 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16256 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16257 Remove unused local.
16258 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16260 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16261 GCC 4.6.0 optimizes based on type-based alias analysis.
16262 For example, if b is of type struct buffer * and v of type struct
16263 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16264 != &v->size, and therefore "v->size = 1; b->size = 2; return
16265 v->size;" must therefore return 1. This assumption is incorrect
16266 for Emacs, since it type-puns struct Lisp_Vector * with many other
16267 types. To fix this problem, this patch adds a new type struct
16268 vectorlike_header that documents the constraints on layout of vectors
16269 and pseudovectors, and helps optimizing compilers not get fooled
16270 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16271 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16272 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16274 (XSETPVECTYPE): Rewrite in terms of new macro.
16275 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16276 This is a bit clearer, and further avoids the possibility of
16277 undesirable aliasing.
16278 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16279 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16280 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16281 since Lisp_Subr is a special case (no "next" field).
16282 (ASIZE): Now uses header.size rather than size.
16283 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16284 to avoid the hassle of writing XVECTOR (foo)->header.size.
16285 (struct vectorlike_header): New type.
16286 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16287 object, to help avoid aliasing.
16288 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16289 (SUBRP): Likewise, since Lisp_Subr is a special case.
16290 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16291 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16292 (struct Lisp_Hash_Table): Combine first two members into a single
16293 struct vectorlike_header member. All uses of "size" and "next" members
16294 changed to be "header.size" and "header.next".
16295 * buffer.h (struct buffer): Likewise.
16296 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16297 * frame.h (struct frame): Likewise.
16298 * process.h (struct Lisp_Process): Likewise.
16299 * termhooks.h (struct terminal): Likewise.
16300 * window.c (struct save_window_data, struct saved_window): Likewise.
16301 * window.h (struct window): Likewise.
16302 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16303 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16304 * buffer.c (init_buffer_once): Likewise.
16305 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16307 * process.c (Fformat_network_address): Use local var for size,
16310 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16312 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16313 * data.c (atof): Remove decl; no longer used or needed.
16314 (digit_to_number): Move to lread.c.
16315 (Fstring_to_number): Use new string_to_number function, to be
16316 consistent with how the Lisp reader treats infinities and NaNs.
16317 Do not assume that floating-point numbers represent EMACS_INT
16318 without losing information; this is not true on most 64-bit hosts.
16319 Avoid double-rounding errors, by insisting on integers when
16320 parsing non-base-10 numbers, as the documentation specifies.
16321 * lisp.h (string_to_number): New decl, replacing ...
16322 (isfloat_string): Remove.
16323 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16324 (read1): Do not accept +. and -. as integers; this
16325 appears to have been a coding error. Similarly, do not accept
16326 strings like +-1e0 as floating point numbers. Do not report
16327 overflow for integer overflows unless the base is not 10 which
16328 means we have no simple and reliable way to continue.
16329 Break out the floating-point parsing into a new
16330 function string_to_number, so that Fstring_to_number parses
16331 floating point numbers consistently with the Lisp reader.
16332 (digit_to_number): Move here from data.c. Make it static inline.
16333 (E_CHAR, EXP_INT): Remove, replacing with ...
16334 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16335 (string_to_number): New function, replacing isfloat_string.
16336 This function checks for valid syntax and produces the resulting
16337 Lisp float number too. Rework it so that string-to-number
16338 no longer mishandles examples like "1.0e+". Use strtoumax,
16339 so that overflow for non-base-10 numbers is reported only when
16340 there's no portable and simple way to convert to floating point.
16342 * textprop.c (set_text_properties_1): Rewrite for clarity,
16343 and to avoid GCC warning about integer overflow.
16345 * intervals.h (struct interval): Use EMACS_INT for members
16346 where EMACS_UINT might cause problems. See
16347 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16348 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16349 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16351 (offset_intervals): Tell GCC not to worry about length overflow
16352 when negating a negative length.
16354 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16355 (overrun_check_free): Likewise.
16357 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16358 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16361 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16362 (gnutls_make_error): Rename local to avoid shadowing.
16363 (gnutls_emacs_global_deinit): ifdef out; not used.
16364 (Fgnutls_boot): Use const for pointer to readonly storage.
16365 Comment out unused local. Fix pointer signedness problems.
16367 * lread.c (openp): Don't stuff size_t into an 'int'.
16368 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16369 about possible signed overflow.
16371 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16372 (GDK_KEY_g): Don't define if already defined.
16373 (xg_prepare_tooltip): Avoid pointer signedness problem.
16374 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16376 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16377 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16379 * xfns.c (Fx_window_property): Simplify a bit,
16380 to make a bit faster and to avoid GCC 4.6.0 warning.
16381 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16383 * fns.c (internal_equal): Don't assume size_t fits in int.
16385 * alloc.c (compact_small_strings): Tighten assertion a little.
16387 Replace pEd with more-general pI, and fix some printf arg casts.
16388 * lisp.h (pI): New macro, generalizing old pEd macro to other
16389 conversion specifiers. For example, use "...%"pI"d..." rather
16390 than "...%"pEd"...".
16391 (pEd): Remove. All uses replaced with similar uses of pI.
16392 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16393 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16394 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16395 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16396 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16397 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16398 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16400 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16401 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16402 * print.c (safe_debug_print, print_object): Likewise.
16403 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16405 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16406 avoiding the 0 flag, which is not portable.
16407 * process.c (Fmake_network_process): Use pI to avoid cast.
16408 * region-cache.c (pp_cache): Likewise.
16409 * xdisp.c (decode_mode_spec): Likewise.
16410 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16411 behavior on 64-bit hosts with printf arg.
16412 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16413 (x_stop_queuing_selection_requests): Likewise.
16414 (x_get_window_property): Don't truncate byte count to an 'int'
16417 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16418 here, since it parses constructs like leading '-' and spaces,
16419 which are not wanted; and it overflows with large numbers.
16420 Instead, simply match F[0-9]+, which is what is wanted anyway.
16422 * alloc.c: Remove unportable assumptions about struct layout.
16423 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16424 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16425 (allocate_vectorlike, make_pure_vector): Use the new macros,
16426 plus offsetof, to remove unportable assumptions about struct layout.
16427 These assumptions hold on all porting targets that I know of, but
16428 they are not guaranteed, they're easy to remove, and removing them
16429 makes further changes easier.
16431 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16432 This doesn't fix a bug but makes the code clearer.
16433 (string_overrun_cookie): Now const. Use initializers that
16434 don't formally overflow signed char, to avoid warnings.
16435 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16436 can cause Emacs to crash when string overrun checking is enabled.
16437 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16438 multiple of sizeof (EMACS_INT); it need not be, if
16439 alignof(EMACS_INT) < sizeof (EMACS_INT).
16440 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16442 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16444 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16446 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16448 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16449 supposed to be handshaking. (Bug#8556)
16450 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16452 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16454 * lisp.h (Qdebug): List symbol.
16455 * eval.c (Qdebug): Restore global linkage.
16456 * keyboard.c (debug-on-event): New variable.
16457 (handle_user_signal): Break into debugger when debug-on-event
16458 matches the current signal symbol.
16460 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16462 * alloc.c (check_sblock, check_string_bytes)
16463 (check_string_free_list): Convert to standard C.
16465 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16467 * w32.c (emacs_gnutls_push): Fix typo.
16469 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16471 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16472 "cast to pointer from integer of different size".
16474 Improve doprnt and its use in verror. (Bug#8545)
16475 * doprnt.c (doprnt): Document the set of format control sequences
16476 supported by the function. Use SAFE_ALLOCA instead of always
16479 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16480 is one byte too soon. Don't use xrealloc; instead xfree and
16483 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16485 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16488 * gnutls.c: Renamed global_initialized to
16489 gnutls_global_initialized. Added internals for the
16490 :verify-hostname-error, :verify-error, and :verify-flags
16491 parameters of `gnutls-boot' and documented those parameters in the
16492 docstring. Start callback support.
16493 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16494 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16495 on error. Return error code.
16496 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16497 (emacs_gnutls_read): Likewise.
16498 (Fgnutls_boot): Return handshake error code.
16499 (emacs_gnutls_handle_error): New function.
16500 (wsaerror_to_errno): Likewise.
16502 * w32.h (emacs_gnutls_pull): Add prototype.
16503 (emacs_gnutls_push): Likewise.
16505 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16506 (emacs_gnutls_push): Likewise.
16508 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16510 * process.c (wait_reading_process_output): Check if GnuTLS
16511 buffered some data internally if no FDs are set for TLS
16514 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16515 (LIBS): Link to USER_LIBS.
16516 ($(BLD)/gnutls.$(0)): New target.
16518 2011-04-24 Eli Zaretskii <eliz@gnu.org>
16520 * xdisp.c (handle_single_display_spec): Rename the
16521 display_replaced_before_p argument into display_replaced_p, to
16522 make it consistent with the commentary. Fix typos in the
16525 * textprop.c (syms_of_textprop): Remove dead code.
16526 (copy_text_properties): Delete obsolete commentary about an
16527 interface that was deleted long ago. Fix typos in the description
16530 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16531 to changes in oldXMenu/XMenu.h from 2011-04-16.
16532 <menu_help_message, prev_menu_help_message>: Constify.
16533 (IT_menu_make_room): menu->help_text is now `const char **';
16536 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16537 to changes in oldXMenu/XMenu.h from 2011-04-16.
16538 (struct XMenu): Declare `help_text' `const char **'.
16540 * xfaces.c <Qunspecified>: Make extern again.
16542 * syntax.c: Include sys/types.h before including regex.h, as
16545 * doc.c (get_doc_string): Improve the format passed to `error'.
16547 * doprnt.c (doprnt): Improve commentary.
16549 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16551 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16554 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16555 changes in globals.h immediately force recompilation.
16556 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16557 $(CURDIR)/s/ms-w32.h.
16558 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16560 * character.c (Fchar_direction): Function deleted.
16561 (syms_of_character): Don't defsubr it.
16562 <char-direction-table>: Deleted.
16564 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16566 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16567 * doprnt.c: Include limits.h.
16568 (SIZE_MAX): New macro.
16569 (doprnt): Return a size_t value. 2nd arg is now size_t.
16570 Many local variables are now size_t instead of int or unsigned.
16571 Improve overflow protection. Support `l' modifier for integer
16572 conversions. Support %l conversion. Don't assume an EMACS_INT
16573 argument for integer conversions and for %c.
16575 * lisp.h (doprnt): Restore prototype.
16577 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16578 $(SRC)/character.h.
16580 * Makefile.in (base_obj): Add back doprnt.o.
16582 * deps.mk (doprnt.o): Add back prerequisites.
16583 (callint.o): Depend on character.h.
16585 * eval.c (internal_lisp_condition_case): Include the handler
16586 representation in the error message.
16587 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16588 when breaking from the loop.
16590 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16592 * callint.c (Fcall_interactively): When displaying error message
16593 about invalid control letter, pass the character's codepoint, not
16594 a pointer to its multibyte form. Improve display of the character
16595 in octal and display also its hex code.
16597 * character.c (char_string): Use %x to display the (unsigned)
16598 codepoint of an invalid character, to avoid displaying a bogus
16601 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16602 `error', not SYMBOL_NAME itself.
16604 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16605 character arguments to `error'.
16607 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16608 to `error' in error message about FINAL_CHAR argument. Make sure
16609 FINAL_CHAR is a character, and use %c when it is passed as
16610 argument to `error'.
16612 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16614 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16616 * w32.c: Include <time.h>.
16617 (sys_localtime): New function.
16619 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
16621 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16623 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16625 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
16627 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16628 zombies (Bug#8467).
16630 2011-04-19 Eli Zaretskii <eliz@gnu.org>
16632 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16633 gl_state.e_property when gl_state.object is Qt.
16635 * insdel.c (make_gap_larger): Remove limitation of buffer size
16638 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
16640 * xdisp.c (lookup_glyphless_char_display)
16641 (produce_glyphless_glyph): Handle cons cell entry in
16642 glyphless-char-display.
16643 (Vglyphless_char_display): Document it.
16645 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16646 glyphless-char-display.
16648 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
16650 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16652 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16654 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16655 definition for no-X builds.
16657 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
16659 Static checks with GCC 4.6.0 and non-default toolkits.
16661 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16663 * process.c (keyboard_bit_set): Define only if SIGIO.
16664 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16665 (send_process): Repair possible setjmp clobbering.
16667 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16669 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16671 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16673 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16674 Define only if needed.
16676 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16677 by pacifying GCC about it. Maybe it's time to retire it?
16678 * xfaces.c (USG, __TIMEVAL__): Likewise.
16680 * dispextern.h (struct redisplay_interface): Rename param
16681 to avoid shadowing.
16682 * termhooks.h (struct terminal): Likewise.
16683 * xterm.c (xembed_send_message): Likewise.
16685 * insdel.c (make_gap_smaller): Define only if
16686 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16688 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16691 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16692 so that we aren't warned about unused symbols.
16694 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16696 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16698 * xfns.c (x_real_positions): Mark locals as initialized.
16700 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16702 * xterm.c: Fix problems found by static analysis with other toolkits.
16703 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16704 (x_dispatch_event): Declare static if USE_GTK, and
16705 define if USE_GTK || USE_X_TOOLKIT.
16706 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16707 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16708 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16709 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16711 * xmenu.c (menu_help_callback): Pointer type fixes.
16712 Use const pointers when pointing at readonly data. Avoid pointer
16713 signedness clashes.
16714 (FALSE): Remove unused macro.
16715 (update_frame_menubar): Remove unused decl.
16717 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16719 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16720 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16721 (single_menu_item): Rename local to avoid shadowing.
16723 * keyboard.c (make_lispy_event): Remove unused local var.
16725 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16726 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16728 * bitmaps: Change bitmaps from unsigned char back to the X11
16729 compatible char. Avoid the old compiler warnings about
16730 out-of-range initializers by using, for example, '\xab' rather
16733 * xgselect.c (xgselect_initialize): Check vs interface
16734 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16736 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16738 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16739 to read-only memory.
16741 * fns.c (vector): Remove; this old hack is no longer needed.
16743 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16745 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16747 * xrdb.c (x_load_resources): Omit unused local.
16749 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16750 (x_window): Rename locals to avoid shadowing.
16751 (USG): Use the kludged USG macro, to pacify gcc.
16753 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16754 (x_term_init): Remove local to avoid shadowing.
16756 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16758 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16759 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16761 2011-04-16 Eli Zaretskii <eliz@gnu.org>
16763 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16765 Fix regex.c, syntax.c and friends for buffers > 2GB.
16766 * syntax.h (struct gl_state_s): Declare character position members
16769 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16771 * textprop.c (verify_interval_modification, interval_of):
16772 Declare arguments EMACS_INT.
16774 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16777 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16779 * indent.c (Fvertical_motion): Local variable it_start is now
16782 * regex.c (re_match, re_match_2, re_match_2_internal)
16783 (bcmp_translate, regcomp, regexec, print_double_string)
16784 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16785 (re_compile_pattern, re_exec): Declare arguments and local
16786 variables `size_t' and `ssize_t' and return values `regoff_t', as
16788 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16789 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16790 <compile_stack_type>: `size' and `avail' are now `size_t'.
16792 * regex.h <regoff_t>: Use ssize_t, not int.
16793 (re_search, re_search_2, re_match, re_match_2): Arguments that
16794 specify buffer/string position and length are now ssize_t and
16795 size_t. Return type is regoff_t.
16797 2011-04-16 Ben Key <bkey76@gmail.com>
16799 * nsfont.m: Fixed bugs in ns_get_family and
16800 ns_descriptor_to_entity that were caused by using free to
16801 deallocate memory blocks that were allocated by xmalloc (via
16802 xstrdup). This caused Emacs to crash when compiled with
16803 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16804 --enable-checking=xmallocoverrun). xfree is now used to
16805 deallocate these memory blocks.
16807 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
16809 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16811 emacs_write: Accept and return EMACS_INT for sizes.
16812 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16814 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16815 Accept and return EMACS_INT.
16816 (emacs_gnutls_write): Return the number of bytes written on
16818 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16819 (emacs_read, emacs_write): Remove check for negative size, as the
16820 Emacs source code has been audited now.
16821 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16822 (emacs_read, emacs_write): Use it.
16823 * process.c (send_process): Adjust to the new signatures of
16824 emacs_write and emacs_gnutls_write. Do not attempt to store
16825 a byte offset into an 'int'; it might overflow.
16826 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16828 * sound.c: Don't assume sizes fit in 'int'.
16829 (struct sound_device.period_size, alsa_period_size):
16830 Return EMACS_INT, not int.
16831 (struct sound_device.write, vox_write, alsa_write):
16832 Accept EMACS_INT, not int.
16833 (wav_play, au_play): Use EMACS_INT to store sizes and to
16834 record read return values.
16836 2011-04-15 Ben Key <bkey76@gmail.com>
16838 * keyboard.c (Qundefined): Don't declare static since it is used
16840 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16841 static since they are used in nsfont.m.
16843 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16845 * process.c (Qprocessp): Don't declare static.
16846 * lisp.h (Qprocessp): Declare again.
16848 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
16850 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16852 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16854 Improve C-level modularity by making more things 'static'.
16856 Don't publish debugger-only interfaces to other modules.
16857 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16858 (verify_bytepos, count_markers): Move decls to the only modules
16860 * region-cache.h (pp_cache): Likewise.
16861 * window.h (check_all_windows): Likewise.
16862 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16864 * sysdep.c (croak): Now static, if
16865 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16866 * syssignal.h (croak): Declare only if not static.
16868 * alloc.c (refill_memory_reserve): Now static if
16869 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16870 * lisp.h (refill_memory_reserve): Declare only if not static.
16872 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16873 Define only if USE_LUCID.
16875 * xrdb.c (x_customization_string, x_rm_string): Now static.
16877 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16878 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16880 * xdisp.c (draw_row_with_mouse_face): Now static.
16881 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16883 * window.h (check_all_windows): Mark externally visible.
16885 * window.c (window_deletion_count): Now static.
16887 * undo.c: Make symbols static if they're not exported.
16888 (last_undo_buffer, last_boundary_position, pending_boundary):
16891 * textprop.c (interval_insert_behind_hooks): Now static.
16892 (interval_insert_in_front_hooks): Likewise.
16894 * term.c: Make symbols static if they're not exported.
16895 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16896 (max_frame_lines, tty_set_terminal_modes):
16897 (tty_reset_terminal_modes, tty_turn_off_highlight):
16898 (get_tty_terminal): Now static.
16899 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16900 * termhooks.h (term_mouse_moveto): Do not declare if
16901 HAVE_WINDOW_SYSTEM.
16902 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16903 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16905 * sysdep.c: Make symbols static if they're not exported.
16906 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16908 (sigprocmask_set, full_mask): Remove; unused.
16909 (wait_debugging): Mark as visible.
16910 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16911 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16913 * syntax.c (syntax_temp): Define only if !__GNUC__.
16915 * sound.c (current_sound_device, current_sound): Now static.
16917 * search.c (searchbufs, searchbuf_head): Now static.
16919 * scroll.c (scroll_cost): Remove; unused.
16920 * dispextern.h (scroll_cost): Remove decl.
16922 * region-cache.h (pp_cache): Mark as externally visible.
16924 * process.c: Make symbols static if they're not exported.
16925 (process_tick, update_tick, create_process, chan_process):
16926 (Vprocess_alist, proc_buffered_char, datagram_access):
16927 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16928 (deactivate_process): Mark defn as static, as well as decl.
16929 * lisp.h (create_process): Remove decl.
16930 * process.h (chan_process, Vprocess_alist): Remove decls.
16932 * print.c: Make symbols static if they're not exported.
16933 (print_depth, new_backquote_output, being_printed, print_buffer):
16934 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16935 (print_interval, print_number_index, initial_stderr_stream):
16937 * lisp.h (Fprinc): Remove decl.
16938 (debug_output_compilation_hack): Mark as externally visible.
16940 * sysdep.c (croak): Move decl from here to syssignal.h.
16941 * syssignal.h (croak): Put it here, so the API can be checked when
16942 'croak' is called from dissociate_if_controlling_tty.
16944 * minibuf.c: Make symbols static if they're not exported.
16945 (minibuf_save_list, choose_minibuf_frame): Now static.
16946 * lisp.h (choose_minibuf_frame): Remove decl.
16948 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16950 * lread.c: Make symbols static if they're not exported.
16951 (read_objects, initial_obarray, oblookup_last_bucket_number):
16953 (make_symbol): Remove; unused.
16954 * lisp.h (initial_obarray, make_symbol): Remove decls.
16956 * keyboard.c: Make symbols static if they're not exported.
16957 (single_kboard, recent_keys_index, total_keys, recent_keys):
16958 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16959 (this_single_command_key_start, echoing, last_auto_save):
16960 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16961 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16962 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16963 (Vlispy_mouse_stem, double_click_count):
16965 (force_auto_save_soon): Define only if SIGDANGER.
16966 (ignore_mouse_drag_p): Now static if
16967 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16968 (print_help): Remove; unused.
16969 (stop_character, last_timer_event): Mark as externally visible.
16970 * keyboard.h (ignore_mouse_drag_p): Declare only if
16971 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16972 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16973 * lisp.h (echoing): Remove decl.
16974 (force_auto_save_soon): Declare only if SIGDANGER.
16975 * xdisp.c (redisplay_window): Simplify code, to make it more
16976 obvious that ignore_mouse_drag_p is not accessed if !defined
16977 USE_GTK && !defined HAVE_NS.
16979 * intervals.c: Make symbols static if they're not exported.
16980 (merge_properties_sticky, merge_interval_right, delete_interval):
16982 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16984 * insdel.c: Make symbols static if they're not exported.
16985 However, leave prepare_to_modify_buffer alone. It's never
16986 called from outside this function, but that appears to be a bug.
16987 (combine_after_change_list, combine_after_change_buffer):
16988 (adjust_after_replace, signal_before_change): Now static.
16989 (adjust_after_replace_noundo): Remove; unused.
16990 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16991 (signal_before_change): Remove decls.
16993 * indent.c (val_compute_motion, val_vmotion): Now static.
16995 * image.c: Make symbols static if they're not exported.
16996 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16998 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16999 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17001 * fringe.c (standard_bitmaps): Now static.
17002 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17004 * frame.c: Make symbols static if they're not exported.
17005 (x_report_frame_params, make_terminal_frame): Now static.
17006 (get_frame_param): Now static, unless HAVE_NS.
17007 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17008 (x_get_resource_string): Remove; not used.
17009 * frame.h (make_terminal_frame, x_report_frame_params):
17010 (x_get_resource_string); Remove decls.
17011 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17012 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17014 * font.c, fontset.c: Make symbols static if they're not exported.
17015 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17016 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17017 * font.c (font_close_object): Now static.
17018 * font.h (font_close_object): Remove.
17019 * fontset.c (FONTSET_OBJLIST): Remove.
17020 (free_realized_fontset) #if-0 the body, which does nothing.
17021 (face_suitable_for_char_p): #if-0, as it's never called.
17022 * fontset.h (face_suitable_for_char_p): Remove decl.
17023 * xfaces.c (face_at_string_position):
17024 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17025 since 0 is always ASCII.
17027 * fns.c (weak_hash_tables): Now static.
17029 * fileio.c: Make symbols static if they're not exported.
17030 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17031 (Vwrite_region_annotation_buffers): Now static.
17033 * eval.c: Make symbols static if they're not exported.
17034 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17035 * lisp.h (backtrace_list): Remove decl.
17037 * emacs.c: Make symbols static if they're not exported.
17038 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17039 (fatal_error_code, fatal_error_signal_hook, standard_args):
17041 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17042 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17043 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17044 * lisp.h (fatal_error_signal_hook): Remove decl.
17045 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17047 * editfns.c: Move a (normally-unused) function to its only use.
17048 * editfns.c, lisp.h (get_operating_system_release): Remove.
17049 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17050 worth the hassle of breaking this out.
17052 * xterm.c: Make symbols static if they're not exported.
17053 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17054 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17055 (x_destroy_window, x_delete_display):
17057 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17058 (x_mouse_leave): Remove; unused.
17059 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17060 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17061 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17063 (x_mouse_leave): Declare only if WINDOWSNT.
17064 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17065 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17068 * ftxfont.c: Make symbols static if they're not exported.
17069 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17071 * font.h (ftxfont_driver): Likewise.
17073 * xfns.c: Make symbols static if they're not exported.
17074 (x_last_font_name, x_display_info_for_name):
17075 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17076 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17077 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17078 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17079 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17080 (last_show_tip_args): Now static.
17081 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17082 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17083 (x_screen_planes): Remove; unused.
17084 * dispextern.h (x_screen_planes): Remove decl.
17086 * dispnew.c: Make symbols static if they're not exported.
17087 * dispextern.h (redraw_garbaged_frames, scrolling):
17088 (increment_row_positions): Remove.
17089 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17090 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17092 (redraw_garbaged_frames): Remove; unused.
17094 * xfaces.c: Make symbols static if they're not exported.
17095 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17097 * xterm.h (defined_color): Remove decls.
17098 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17099 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17100 (menu_face_changed_default, defined_color, free_realized_face):
17101 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17102 (ascii_face_of_lisp_face): Remove; unused.
17104 * xdisp.c: Make symbols static if they're not exported.
17105 * dispextern.h (scratch_glyph_row, window_box_edges):
17106 (glyph_to_pixel_coords, set_cursor_from_row):
17107 (get_next_display_element, set_iterator_to_next):
17108 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17109 (show_mouse_face): Remove decls
17110 * frame.h (message_buf_print): Likewise.
17111 * lisp.h (pop_message, set_message, check_point_in_composition):
17113 * xterm.h (set_vertical_scroll_bar): Likewise.
17114 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17115 (message_buf_print, scratch_glyph_row, displayed_buffer):
17116 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17117 (get_next_display_element, show_mouse_face, window_box_edges):
17118 (frame_to_window_pixel_xy, check_point_in_composition):
17119 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17120 (glyph_to_pixel_coords): Remove; unused.
17122 * dired.c (file_name_completion): Now static.
17124 * dbusbind.c (xd_in_read_queued_messages): Now static.
17126 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17127 * data.c (circular_list_error): Remove.
17129 * commands.h (last_point_position, last_point_position_buffer):
17130 (last_point_position_window): Remove decls.
17131 * keyboard.c: Make these variables static.
17133 * coding.h (coding, code_convert_region, encode_coding_gap):
17135 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17136 (iso_code_class, detect_coding, code_convert_region): Now static.
17137 (encode_coding_gap): Remove; unused.
17139 * chartab.c (chartab_chars, chartab_bits): Now static.
17141 * charset.h (charset_iso_8859_1): Remove decl.
17142 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17145 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17146 * ccl.c (Vccl_program_table): Now static.
17147 (check_ccl_update): Remove; unused.
17149 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17150 * category.h: ... from here.
17151 * category.c (check_category_table, set_category_set): Now static.
17153 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17154 * lisp.h: Remove these decls.
17156 * buffer.c (buffer_count): Remove unused var.
17158 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17159 so that it's not optimized away.
17160 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17161 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17162 exported only to the debugger.
17164 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17165 * atimer.h (run_all_atimers): Remove; not exported.
17167 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17168 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17169 was inaccessible from Lisp.
17170 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17171 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17173 alloc.c: Import and export fewer symbols, and remove unused items.
17174 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17176 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17177 it's not optimized away by whole-program optimization.
17178 (message_enable_multibyte, free_misc): Remove.
17179 (catchlist, handlerlist, mark_backtrace):
17180 Declare only if BYTE_MARK_STACK.
17181 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17182 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17183 (message_enable_multibyte): Remove decl.
17184 (free_misc, interval_free_list, float_block, float_block_index):
17185 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17186 (cons_free_list, last_marked_index):
17188 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17189 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17190 (mark_backtrace): Define only if BYTE_MARK_STACK.
17191 * xdisp.c (message_enable_multibyte): Now static.
17193 Declare Lisp_Object Q* variables to be 'static' if not exported.
17194 This makes it easier for human readers (and static analyzers)
17195 to see whether these variables are used from other modules.
17196 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17197 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17198 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17199 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17200 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17201 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17202 * xmenu.c, xselect.c:
17203 Declare Q* vars static if they are not used in other modules.
17204 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17205 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17206 Remove decls of unexported vars.
17207 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17209 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17211 Make Emacs functions such as Fatom 'static' by default.
17212 This makes it easier for human readers (and static analyzers)
17213 to see whether these functions can be called from other modules.
17214 DEFUN now defines a static function. To make the function external
17215 so that it can be used in other C modules, use the new macro DEFUE.
17216 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17217 (Finit_image_library):
17218 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17219 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17220 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17221 Remove decls, since these functions are now static.
17222 (Funintern, Fget_internal_run_time): New decls, since these functions
17223 were already external.
17225 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17226 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17227 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17228 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17229 * keyboard.c, keymap.c, lread.c:
17230 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17231 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17232 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17233 Mark functions with DEFUE instead of DEFUN,
17234 if they are used in other modules.
17235 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17236 decls for now-static functions.
17237 * buffer.h (Fdelete_overlay): Remove decl.
17238 * callproc.c (Fgetenv_internal): Mark as internal.
17239 * composite.c (Fremove_list_of_text_properties): Remove decl.
17240 (Fcomposition_get_gstring): New forward static decl.
17241 * composite.h (Fcomposite_get_gstring): Remove decl.
17242 * dired.c (Ffile_attributes): New forward static decl.
17243 * doc.c (Fdocumntation_property): New forward static decl.
17244 * eval.c (Ffetch_bytecode): New forward static decl.
17245 (Funintern): Remove extern decl; now in .h file where it belongs.
17246 * fileio.c (Fmake_symbolic_link): New forward static decl.
17247 * image.c (Finit_image_library): New forward static decl.
17248 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17249 * intervals.h (Fprevious_property_change):
17250 (Fremove_list_of_text_properties): Remove decls.
17251 * keyboard.c (Fthis_command_keys): Remove decl.
17252 (Fcommand_execute): New forward static decl.
17253 * keymap.c (Flookup_key): New forward static decl.
17254 (Fcopy_keymap): Now static.
17255 * keymap.h (Flookup_key): Remove decl.
17256 * process.c (Fget_process): New forward static decl.
17257 (Fprocess_datagram_address): Mark as internal.
17258 * syntax.c (Fsyntax_table_p): New forward static decl.
17259 (skip_chars): Remove duplicate decl.
17260 * textprop.c (Fprevious_property_change): New forward static decl.
17261 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17263 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17264 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17266 * editfns.c (Fformat): Remove unreachable code.
17268 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17270 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17273 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17275 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17276 when at ZV. (Bug#8487)
17278 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17280 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17282 * keyboard.c (parse_tool_bar_item): Likewise.
17283 * sound.c (sound_cleanup, alsa_close): Likewise.
17284 * termcap.c (tgetent): Likewise.
17285 * xfns.c (x_default_font_parameter): Likewise.
17286 * xsettings.c (read_and_apply_settings): Likewise.
17288 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17289 (overrun_check_free): Protoize.
17291 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17293 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17294 since callers should never pass a negative size.
17295 Change the signature to match that of plain 'read' and 'write'; see
17296 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17297 * lisp.h: Update prototypes of emacs_write and emacs_read.
17299 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17301 * xdisp.c (redisplay_window): Don't try to determine the character
17302 position of the scroll margin if the window start point w->startp
17303 is outside the buffer's accessible region. (Bug#8468)
17305 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17307 Fix write-region and its subroutines for buffers > 2GB.
17308 * fileio.c (a_write, e_write): Modify declaration of arguments and
17309 local variables to support buffers larger than 2GB.
17310 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17312 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17313 argument, local variables, and return value.
17315 * lisp.h: Update prototypes of emacs_write and emacs_read.
17317 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17319 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17321 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17323 Fix more problems found by GCC 4.6.0's static checks.
17325 * xdisp.c (vmessage): Use a better test for character truncation.
17327 * charset.c (load_charset_map): <, not <=, for optimization,
17328 and to avoid potential problems with integer overflow.
17329 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17330 * casetab.c (set_identity, shuffle): Likewise.
17331 * editfns.c (Fformat): Likewise.
17332 * syntax.c (skip_chars): Likewise.
17334 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17335 This also lets GCC 4.6.0 generate slightly better loop code.
17337 * callint.c (Fcall_interactively): <, not <=, for optimization.
17338 (Fcall_interactively): Count the number of arguments produced,
17339 not the number of arguments given. This is simpler and lets GCC
17340 4.6.0 generate slightly better code.
17342 * ftfont.c: Distingish more carefully between FcChar8 and char.
17343 The previous code passed unsigned char * to a functions like
17344 strlen and xstrcasecmp that expect char *, which does not
17345 conform to the C standard.
17346 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17347 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17348 char * when the C standard requires it.
17350 * keyboard.c (read_char): Remove unused var.
17352 * eval.c: Port to Windows vsnprintf (Bug#8435).
17353 Include <limits.h>.
17354 (SIZE_MAX): Define if the headers do not.
17355 (verror): Do not give up if vsnprintf returns a negative count.
17356 Instead, grow the buffer. This ports to Windows vsnprintf, which
17357 does not conform to C99. Problem reported by Eli Zaretskii.
17358 Also, simplify the allocation scheme, by avoiding the need for
17359 calling realloc, and removing the ALLOCATED variable.
17361 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17363 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17364 But keep the doprint source code for now, as we might revamp it
17365 and use it again (Bug#8435).
17366 * lisp.h (doprnt): Remove.
17367 * Makefile.in (base_obj): Remove doprnt.o.
17368 * deps.mk (doprnt.o): Remove.
17370 error: Print 32- and 64-bit integers portably (Bug#8435).
17371 Without this change, on typical 64-bit hosts error ("...%d...", N)
17372 was used to print both 32- and 64-bit integers N, which relied on
17373 undefined behavior.
17374 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17375 * lisp.h (error, verror): Mark as printf-like functions.
17376 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17377 Report overflow in size calculations when allocating printf buffer.
17378 Do not truncate output string at its first null byte.
17379 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17380 Truncate the output at a character boundary, since vsnprintf does not
17382 * charset.c (check_iso_charset_parameter): Convert internal
17383 character to string before calling 'error', since %c now has the
17385 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17386 overflow when computing char to be passed to 'error'. Do not
17387 pass Lisp_Object to 'error'; pass the integer instead.
17388 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17389 formatted with plain %d.
17391 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17393 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17395 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17397 * xterm.c (x_catch_errors): Remove duplicate declaration.
17399 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17401 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17403 2011-04-10 Jim Meyering <meyering@redhat.com>
17405 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17406 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17407 return ssize_t not "int", and use size_t as the buffer length.
17408 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17409 * gnutls.h: Update declarations.
17410 * process.c (read_process_output): Use ssize_t, to match.
17411 (send_process): Likewise.
17413 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17415 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17417 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17419 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17420 Use unsigned char, to match FcChar8 type definition.
17422 * xterm.c (handle_one_xevent):
17423 * xmenu.c (create_and_show_popup_menu):
17424 * xselect.c (x_decline_selection_request)
17425 (x_reply_selection_request): Avoid type-punned deref of X events.
17427 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17429 Fix some uses of `int' instead of EMACS_INT.
17430 * search.c (string_match_1, fast_string_match)
17431 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17432 (scan_buffer, find_next_newline_no_quit)
17433 (find_before_next_newline, search_command, Freplace_match)
17434 (Fmatch_data): Make some `int' variables be EMACS_INT.
17436 * xdisp.c (display_count_lines): 3rd argument and return value now
17437 EMACS_INT. All callers changed.
17438 (pint2hrstr): Last argument is now EMACS_INT.
17440 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17441 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17442 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17443 (decode_coding_utf_16, decode_coding_emacs_mule)
17444 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17445 (decode_coding_ccl, decode_coding_charset)
17446 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17447 (decode_coding_iso_2022, decode_coding_emacs_mule)
17448 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17449 <char_offset, last_offset>: Declare EMACS_INT.
17450 (encode_coding_utf_8, encode_coding_utf_16)
17451 (encode_coding_emacs_mule, encode_invocation_designation)
17452 (encode_designation_at_bol, encode_coding_iso_2022)
17453 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17454 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17456 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17457 (encode_invocation_designation): Last argument P_NCHARS is now
17459 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17460 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17462 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17465 * ccl.c (Fccl_execute_on_string): Declare some variables
17468 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17470 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17472 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17474 * process.c (Fformat_network_address): Doc fix.
17476 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17478 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17480 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
17482 * keyboard.c (read_char): Call Lisp function help-form-show,
17483 instead of using internal_with_output_to_temp_buffer.
17484 (Qhelp_form_show): New var.
17485 (syms_of_keyboard): Use DEFSYM macro.
17487 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17489 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17491 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
17493 * process.c (Flist_processes): Remove to Lisp.
17494 (list_processes_1): Delete.
17496 2011-04-06 Eli Zaretskii <eliz@gnu.org>
17498 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17500 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17502 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
17504 Fix more problems found by GCC 4.6.0's static checks.
17506 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17508 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17510 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17512 * xdisp.c (vmessage): Mark as a printf-like function.
17514 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17516 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17518 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17519 printf-like functions.
17520 (tiff_load): Add casts to remove these marks before passing them
17521 to system-supplied API.
17523 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17525 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17526 This avoids several warnings with gcc -Wstrict-overflow.
17527 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17528 directly, rather than having caller test rule sign. This avoids
17529 some unnecessary tests.
17530 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17531 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17532 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17534 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17535 (xfont_open): Avoid unnecessary tests.
17537 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17539 * composite.h, composite.c (composition_gstring_put_cache):
17540 Use EMACS_INT, not int, for length.
17542 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17543 breaking out part of COMPOSITION_DECODE_RULE.
17544 (COMPOSITION_DECODE_RULE): Use it.
17545 * composite.c (get_composition_id): Remove unused local vars,
17546 by using the new macro.
17548 * textprop.c (set_text_properties_1): Change while to do-while,
17549 since the condition is always true at first.
17551 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17552 (interval_deletion_adjustment): Return unsigned value.
17555 * process.c (list_processes_1, create_pty, read_process_output):
17556 (exec_sentinel): Remove vars that were set but not used.
17557 (create_pty): Remove unnecessary "volatile"s.
17558 (Fnetwork_interface_info): Avoid possibility of int overflow.
17559 (read_process_output): Do adaptive read buffering even if carryover.
17560 (read_process_output): Simplify nbytes computation if buffered.
17562 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17564 * syntax.c (scan_words): Remove var that was set but not used.
17565 (update_syntax_table): Use unsigned instead of int.
17567 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17568 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17569 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17571 * print.c (print_error_message): Avoid int overflow.
17573 * font.c (font_list_entities): Redo for clarity,
17574 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17576 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17577 (font_score): Avoid potential overflow in diff calculation.
17579 * fns.c (substring_both): Remove var that is set but not used.
17580 (sxhash): Redo loop for clarity and to avoid wraparound warning.
17582 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17584 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17585 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17586 can always succeed if overflow has undefined behavior.
17588 * search.c (boyer_moore, wordify): Remove vars set but not used.
17589 (wordify): Omit three unnecessary tests.
17591 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17592 All callers changed. This avoids the need for an unused var.
17594 * casefiddle.c (casify_region): Remove var that is set but not used.
17596 * dired.c (file_name_completion): Remove var that is set but not used.
17598 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17600 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17601 (Finsert_file_contents): Remove unnecessary code checking fd.
17603 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17604 Check for integer overflow on size calculations.
17606 * buffer.c (Fprevious_overlay_change): Remove var that is set
17609 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17610 Remove vars that are set but not used.
17611 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17612 (timer_check_2): Mark vars as initialized.
17614 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17616 * image.c (lookup_image): Remove var that is set but not used.
17617 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17619 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17620 that are set but not used.
17622 * xfns.c (make_invisible_cursor): Don't return garbage
17623 if XCreateBitmapFromData fails (Bug#8410).
17625 * xselect.c (x_get_local_selection, x_handle_property_notify):
17626 Remove vars that are set but not used.
17628 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17629 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17631 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17632 Remove var that is set but not used.
17633 (scroll_bar_windows_size): Now size_t, not int.
17634 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17635 Check for overflow.
17637 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17638 (map_tty_color) [!defined MSDOS]: Likewise.
17640 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17642 * coding.c: Remove vars that are set but not used.
17643 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17644 All callers changed.
17645 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17646 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17647 (decode_coding_charset): Remove vars that are set but not used.
17649 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17650 that is set but not used.
17652 * print.c (print_object): Remove var that is set but not used.
17654 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17655 The gnulib version avoids calling malloc in the usual case,
17656 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17657 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17658 * filelock.c (current_lock_owner): Likewise.
17659 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17660 * sysdep.c: Include allocator.h, careadlinkat.h.
17661 (emacs_no_realloc_allocator): New static constant.
17662 (emacs_readlink): New function.
17663 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17664 ../lib/careadlinkat.h.
17666 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17668 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17669 first non-nil return value).
17671 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17673 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17674 if not defined (Bug#8403).
17676 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17678 * xdisp.c (display_count_lines): Remove parameter `start',
17679 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17680 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17681 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17682 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17683 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17684 and thereabouts. All callers changed.
17685 (get_per_char_metric): Remove parameter `f', unused since
17686 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17688 2011-04-02 Jim Meyering <meyering@redhat.com>
17690 do not dereference NULL upon failed strdup
17691 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17692 (ns_get_family): Likewise.
17694 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17696 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17698 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17700 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17703 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17705 Add lexical binding.
17707 * window.c (Ftemp_output_buffer_show): New fun.
17708 (Fsave_window_excursion):
17709 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17711 * lread.c (lisp_file_lexically_bound_p): New function.
17712 (Fload): Bind Qlexical_binding.
17713 (readevalloop): Remove `evalfun' arg.
17714 Bind Qinternal_interpreter_environment.
17715 (Feval_buffer): Bind Qlexical_binding.
17716 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17718 (syms_of_lread): Declare `lexical-binding'.
17720 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17722 * keyboard.c (eval_dyn): New fun.
17723 (menu_item_eval_property): Use it.
17725 * image.c (parse_image_spec): Use Ffunctionp.
17727 * fns.c (concat, mapcar1): Accept byte-code-functions.
17729 * eval.c (Fsetq): Handle lexical vars.
17730 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17731 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17732 (FletX, Flet): Obey lexical binding.
17733 (Fcommandp): Handle closures.
17734 (Feval): New `lexical' arg.
17735 (eval_sub): New function extracted from Feval. Use it almost
17736 everywhere where Feval was used. Look up vars in lexical env.
17738 (Ffunctionp): Move from subr.el.
17739 (Ffuncall): Handle closures.
17740 (apply_lambda): Remove `eval_flags'.
17741 (funcall_lambda): Handle closures and new byte-code-functions.
17742 (Fspecial_variable_p): New function.
17743 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17744 but without exporting it to Lisp.
17746 * doc.c (Fdocumentation, store_function_docstring):
17747 * data.c (Finteractive_form): Handle closures.
17749 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17752 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17754 (exec_byte_code): New function extracted from Fbyte_code to handle new
17755 calling convention for byte-code-functions. Add new byte-codes.
17757 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17759 * alloc.c (Fmake_symbol): Init new `declared_special' field.
17761 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17763 * xdisp.c (redisplay_internal): Fix prototype.
17765 2011-03-31 Eli Zaretskii <eliz@gnu.org>
17767 * xdisp.c (SCROLL_LIMIT): New macro.
17768 (try_scrolling): Use it when setting scroll_limit.
17769 Limit scrolling to 100 screen lines.
17770 (redisplay_window): Even when falling back on "recentering",
17771 position point in the window according to scroll-conservatively,
17772 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17774 (try_scrolling): When point is above the window, allow searching
17775 as far as scroll_max, or one screenful, to compute vertical
17776 distance from PT to the scroll margin position. This prevents
17777 try_scrolling from unnecessarily failing when
17778 scroll-conservatively is set to a value slightly larger than the
17779 window height. Clean up the case of PT below the margin at bottom
17780 of window: scroll_max can no longer be INT_MAX. When aggressive
17781 scrolling is in use, don't let point enter the opposite scroll
17782 margin as result of the scroll.
17783 (syms_of_xdisp) <scroll-conservatively>: Document the
17784 threshold of 100 lines for never-recentering scrolling.
17786 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17788 * dispextern.h (move_it_by_lines):
17789 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17790 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17791 (message_log_check_duplicate): Remove parameters `prev_bol' and
17792 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17793 (redisplay_internal): Remove parameter `preserve_echo_area',
17794 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17796 * indent.c (Fvertical_motion):
17797 * window.c (window_scroll_pixel_based, Frecenter):
17798 Don't pass `need_y_p' to `move_it_by_lines'.
17800 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17802 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17803 steal a few bits to be more compact.
17804 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17805 Remove unneeded casts.
17807 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17809 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17811 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17812 binding" message (bug#7967).
17814 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17816 Fix more problems found by GCC 4.6.0's static checks.
17818 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17819 Remove unused local var.
17821 * editfns.c (Fmessage_box): Remove unused local var.
17823 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17824 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17825 Omit unused local vars.
17826 * window.c (shrink_windows): Omit unused local var.
17827 * menu.c (digest_single_submenu): Omit unused local var.
17828 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17829 Omit unused local var.
17831 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17832 Don't assume string length fits in int.
17833 (keyremap_step, read_key_sequence): Use size_t for sizes.
17834 (read_key_sequence): Don't check last_real_key_start redundantly.
17836 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17837 instead of alloca (Bug#8344).
17839 * eval.c (Fbacktrace): Don't assume nargs fits in int.
17840 (Fbacktrace_frame): Don't assume nframes fits in int.
17842 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17844 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17847 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17849 * cm.c (calccost): Turn while-do into do-while, for clarity.
17851 * keyboard.c (syms_of_keyboard): Use the same style as later
17852 in this function when indexing through an array. This also
17853 works around GCC bug 48267.
17855 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17857 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17859 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17860 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17862 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17863 This avoids undefined behavior on integer overflow, and is a bit
17864 more convenient anyway since it is compared to a size_t variable.
17866 Variadic C functions now count arguments with size_t, not int.
17867 This avoids an unnecessary limitation on 64-bit machines, which
17868 caused (substring ...) to crash on large vectors (Bug#8344).
17869 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17870 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
17871 All variadic functions and their callers changed accordingly.
17872 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17873 * data.c (arith_driver, float_arith_driver): Likewise.
17874 * editfns.c (general_insert_function): Likewise.
17875 * eval.c (struct backtrace.nargs, interactive_p)
17876 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17877 (funcall_lambda, mark_backtrace): Likewise.
17878 * fns.c (concat): Likewise.
17879 * frame.c (x_set_frame_parameters): Likewise.
17880 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17881 0 if not found, not -1. All callers changed.
17883 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17884 (stack_copy_size): Now size_t, not int.
17885 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17887 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17889 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17890 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17891 All callers changed.
17893 * lisp.h (multibyte_char_to_unibyte):
17894 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17895 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17896 * character.h (CHAR_TO_BYTE8):
17897 * cmds.c (internal_self_insert):
17898 * editfns.c (general_insert_function):
17899 * keymap.c (push_key_description):
17900 * search.c (Freplace_match):
17901 * xdisp.c (message_dolog, set_message_1): All callers changed.
17903 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17905 * keyboard.c (safe_run_hook_funcall): New function.
17906 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17907 don't set the hook to nil, but remove the offending function instead.
17908 (Qcommand_hook_internal): Remove, unused.
17909 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17910 Vcommand_hook_internal.
17912 * eval.c (enum run_hooks_condition): Remove.
17913 (funcall_nil, funcall_not): New functions.
17914 (run_hook_with_args): Call each function through a `funcall' argument.
17915 Remove `cond' argument, now redundant.
17916 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17917 (Frun_hook_with_args_until_failure): Adjust accordingly.
17918 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17920 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17922 * dispextern.h (string_buffer_position): Remove declaration.
17924 * print.c (strout): Remove parameter `multibyte', unused since
17925 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17927 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17928 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17929 All callers changed.
17931 * w32.c (_wsa_errlist): Use braces for struct initializers.
17933 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17934 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17935 All callers changed.
17936 (string_buffer_position): Likewise. Also, make static (it's never
17937 used outside xdisp.c).
17938 (cursor_row_p): Remove parameter `w', unused since
17939 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17940 (decode_mode_spec): Remove parameter `precision', introduced during
17941 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17942 All callers changed.
17944 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17946 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17948 2011-03-27 Anders Lindgren <andlind@gmail.com>
17950 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17951 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17952 (ns_update_auto_hide_menu_bar): New functions.
17953 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17954 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17955 ns_constrain_all_frames.
17956 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17957 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17959 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17961 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17963 2011-03-27 Glenn Morris <rgm@gnu.org>
17965 * syssignal.h: Replace RETSIGTYPE with void.
17966 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17967 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17968 Replace SIGTYPE with void everywhere.
17969 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17970 * s/template.h (SIGTYPE): Remove commented out definition.
17972 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17974 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17975 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17977 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17979 * w32.c (read_unc_volume): Use parameter `henum', instead of
17980 global variable `wget_enum_handle'.
17982 * keymap.c (describe_vector): Remove parameters `indices' and
17983 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17984 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17986 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17988 * keyboard.c (timer_check): Remove parameter `do_it_now',
17989 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17990 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17991 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17993 * keyboard.c (read_char):
17994 * w32menu.c (w32_menu_display_help):
17995 * xmenu.c (show_help_event, menu_help_callback):
17996 Adjust calls to `show_help_echo'.
17998 * gtkutil.c (xg_maybe_add_timer):
17999 * keyboard.c (readable_events):
18000 * process.c (wait_reading_process_output):
18001 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18003 * insdel.c (adjust_markers_gap_motion):
18004 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18005 (gap_left, gap_right): Don't call it.
18007 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18009 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18010 incurred during fontification.
18012 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18014 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18015 (DEFVAR_PER_BUFFER): Don't pass it.
18017 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18018 (scrolling_window): Don't pass it.
18020 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18022 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18024 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18026 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18027 of variables specific to SELinux and computation of `encoded_absname'.
18029 * image.c (XPutPixel): Remove unused variable `height'.
18031 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18033 * unexw32.c (get_section_info): Remove unused variable `section'.
18035 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18036 (system_process_attributes): Remove unused variable `sess'.
18037 (sys_read): Remove unused variable `err'.
18039 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18040 (w32_wnd_proc): Remove unused variable `isdead'.
18041 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18042 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18043 (x_create_tip_frame): Remove unused variable `tem'.
18045 * w32inevt.c (w32_console_read_socket):
18046 Remove unused variable `no_events'.
18048 * w32term.c (x_draw_composite_glyph_string_foreground):
18049 Remove unused variable `width'.
18051 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18053 * w32term.c (x_set_glyph_string_clipping):
18054 Don't pass uninitialized region to CombineRgn.
18056 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18058 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18059 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18060 (Fx_close_connection): Remove unused variable `i'.
18062 * w32font.c (w32font_draw): Return number of glyphs.
18063 (w32font_open_internal): Remove unused variable `i'.
18064 (w32font_driver): Add missing initializer.
18066 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18067 (fill_in_menu): Remove unused variable `items_added'.
18069 * w32term.c (last_mouse_press_frame): Remove static global variable.
18070 (w32_clip_to_row): Remove unused variable `f'.
18071 (x_delete_terminal): Remove unused variable `i'.
18073 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18074 (NOTHING): Remove unused static global variable.
18075 (uniscribe_check_otf): Remove unused variable `table'.
18076 (uniscribe_font_driver): Add missing initializers.
18078 2011-03-23 Julien Danjou <julien@danjou.info>
18080 * term.c (Fsuspend_tty, Fresume_tty):
18081 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18082 * window.c (temp_output_buffer_show):
18083 * insdel.c (signal_before_change):
18084 * frame.c (Fhandle_switch_frame):
18085 * fileio.c (Fdo_auto_save):
18086 * emacs.c (Fkill_emacs):
18087 * editfns.c (save_excursion_restore):
18088 * cmds.c (internal_self_insert):
18089 * callint.c (Fcall_interactively):
18090 * buffer.c (Fkill_all_local_variables):
18091 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18093 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18094 unconditionally since it does the check itself.
18096 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18098 Fix more problems found by GCC 4.5.2's static checks.
18100 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18101 the first time through the loop, since we know p0 < p1 then.
18102 This also avoids a gcc -Wstrict-overflow warning.
18104 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18105 leading to a memory leak, possible in functions like
18106 load_charset_map_from_file that can allocate an unbounded number
18107 of objects (Bug#8318).
18109 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18110 that could (at least in theory) be that large.
18112 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18113 This is less likely to overflow, and avoids undefined behavior if
18114 overflow does occur. All callers changed. Use strtoul to scan
18115 for the unsigned long integer.
18116 (pint2hrstr): Simplify and tune code slightly.
18117 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18119 * scroll.c (do_scrolling): Work around GCC bug 48228.
18120 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18122 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18123 This also avoids a warning with gcc -Wstrict-overflow.
18124 (validate_x_resource_name): Simplify count usage.
18125 This also avoids a warning with gcc -Wstrict-overflow.
18127 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18130 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18132 * process.c (Fmake_network_process): Use socklen_t, not int,
18133 where POSIX says socklen_t is required in portable programs.
18134 This fixes a porting bug on hosts like 64-bit HP-UX, where
18135 socklen_t is wider than int (Bug#8277).
18136 (Fmake_network_process, server_accept_connection):
18137 (wait_reading_process_output, read_process_output):
18140 * process.c: Rename or move locals to avoid shadowing.
18141 (list_processes_1, Fmake_network_process):
18142 (read_process_output_error_handler, exec_sentinel_error_handler):
18143 Rename or move locals.
18144 (Fmake_network_process): Define label "retry_connect" only if needed.
18145 (Fnetwork_interface_info): Fix pointer signedness.
18146 (process_send_signal): Add cast to avoid pointer signedness problem.
18147 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18148 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18150 Make tparam.h and terminfo.c consistent.
18151 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18152 Include tparam.h instead, since it declares them.
18153 * cm.h (PC): Remove extern decl; tparam.h now does this.
18154 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18155 * terminfo.c: Include tparam.h, to check interfaces.
18156 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18157 (tparam): Adjust signature to match interface in tparam.h;
18158 this removes some undefined behavior. Check that outstring and len
18159 are zero, which they always are with Emacs.
18160 * tparam.h (PC, BC, UP): New extern decls.
18162 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18163 (xftfont_open): Rename locals to avoid shadowing.
18165 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18166 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18167 (OTF_TAG_SYM): Omit macro if not needed.
18168 (ftfont_list): Remove unused local.
18169 (get_adstyle_property, ftfont_pattern_entity):
18170 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18171 Rename locals to avoid shadowing.
18173 * xfont.c (xfont_list_family): Mark var as initialized.
18175 * xml.c (make_dom): Now static.
18177 * composite.c (composition_compute_stop_pos): Rename local to
18179 (composition_reseat_it): Remove unused locals.
18180 (find_automatic_composition, composition_adjust_point): Likewise.
18181 (composition_update_it): Mark var as initialized.
18182 (find_automatic_composition): Mark vars as initialized,
18183 with a FIXME (Bug#8290).
18185 character.h: Rename locals to avoid shadowing.
18186 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18187 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18188 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18189 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18190 to avoid shadowing.
18192 * textprop.c (property_change_between_p): Remove; unused.
18194 * intervals.c (interval_start_pos): Now static.
18196 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18198 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18199 Rename locals to avoid shadowing.
18201 * sound.c (wav_play, au_play, Fplay_sound_internal):
18202 Fix pointer signedness.
18203 (alsa_choose_format): Remove unused local var.
18204 (wav_play): Initialize a variable to 0, to prevent undefined
18205 behavior (Bug#8278).
18207 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18209 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18211 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18212 clobbering (Bug#8298).
18213 * sysdep.c (sys_subshell): Likewise.
18214 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18216 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18217 This should get cleaned up, so that child_setup has the
18218 same signature on all platforms.
18220 * callproc.c (call_process_cleanup): Now static.
18221 (relocate_fd): Rename locals to avoid shadowing.
18223 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18225 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18226 not to be necessary, and produces flickering.
18228 2011-03-20 Glenn Morris <rgm@gnu.org>
18230 * config.in: Remove file.
18232 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18234 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18235 are now in src/globals.h.
18236 (syms_of_minibuf): Remove spurious & from previous change.
18238 2011-03-20 Leo Liu <sdl.web@gmail.com>
18240 * minibuf.c (completing-read-function): New variable.
18241 (completing-read-default): Rename from completing-read.
18242 (completing-read): Call completing-read-function.
18244 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18246 * xfaces.c (Fx_load_color_file):
18247 Read color file from absolute filename (bug#8250).
18249 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18251 * makefile.w32-in: Update dependencies.
18253 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18255 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18257 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18259 Fix more problems found by GCC 4.5.2's static checks.
18261 * process.c (make_serial_process_unwind, send_process_trap):
18262 (sigchld_handler): Now static.
18264 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18265 That way, the code declares only the vars that it needs.
18266 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18267 * s/cygwin.h (PTY_ITERATION): Likewise.
18268 * s/darwin.h (PTY_ITERATION): Likewise.
18269 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18271 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18272 * process.c (allocate_pty): Don't declare stb unless it's needed.
18274 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18275 (CONSTANTLIM): Remove; unused.
18276 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18277 Define only if needed.
18279 * unexelf.c (unexec): Name an expression,
18280 to avoid gcc -Wbad-function-cast warning.
18281 Use a different way to cause a compilation error if anyone uses
18282 n rather than nn, a way that does not involve shadowing.
18283 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18285 * deps.mk (unexalpha.o): Remove; unused.
18287 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18288 * unexec.h: New file.
18289 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18290 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18291 Depend on unexec.h.
18292 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18293 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18294 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18295 Change as necessary to match prototype in unexec.h.
18297 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18299 (back_comment, skip_chars): Mark vars as initialized.
18301 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18302 Rename locals to avoid shadowing.
18304 * lread.c (read1): Rewrite so as not to use empty "else".
18305 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18307 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18309 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18310 warning when compiling print.c.
18312 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18313 instead of using an uninitialized var.
18314 (font_sort_entities): Mark var as initialized.
18316 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18318 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18319 pointers to constants.
18320 (font_parse_fcname): Remove unused vars.
18321 (font_delete_unmatched): Now static.
18322 (font_get_spec): Remove; unused.
18323 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18324 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18325 Rename or move locals to avoid shadowing.
18327 * fns.c (require_nesting_list, require_unwind): Now static.
18328 (Ffillarray): Rename locals to avoid shadowing.
18330 * floatfns.c (domain_error2): Define only if needed.
18331 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18333 * alloc.c (mark_backtrace): Move decl from here ...
18334 * lisp.h: ... to here, so that it can be checked.
18336 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18337 (Fdefvar): Rewrite so as not to use empty "else".
18338 (lisp_indirect_variable): Name an expression,
18339 to avoid gcc -Wbad-function-cast warning.
18340 (Fdefvar): Rename locals to avoid shadowing.
18342 * callint.c (quotify_arg, quotify_args): Now static.
18343 (Fcall_interactively): Rename locals to avoid shadowing.
18344 Use const pointer when appropriate.
18346 * lisp.h (get_system_name, get_operating_system_release):
18347 Move decls here, to check interfaces.
18348 * process.c (get_operating_system_release): Move decl to lisp.h.
18349 * xrdb.c (get_system_name): Likewise.
18350 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18351 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18352 some of which prompt warnings from gcc -Wbad-function-cast.
18353 (Fformat_time_string, Fencode_time, Finsert_char):
18354 (Ftranslate_region_internal, Fformat):
18355 Rename or remove local vars to avoid shadowing.
18356 (Ftranslate_region_internal): Mark var as initialized.
18358 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18361 * lisp.h (eassert): Check that the argument compiles, even if
18362 ENABLE_CHECKING is not defined.
18364 * data.c (Findirect_variable): Name an expression, to avoid
18365 gcc -Wbad-function-cast warning.
18366 (default_value, arithcompare, arith_driver, arith_error): Now static.
18367 (store_symval_forwarding): Rename local to avoid shadowing.
18368 (Fmake_variable_buffer_local, Fmake_local_variable):
18369 Mark variables as initialized.
18370 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18372 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18373 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18374 Rename locals to avoid shadowing.
18375 (mark_stack): Move local variables into the #ifdef region where
18377 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18378 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18380 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18381 (GC_STRING_CHARS): Remove; not used.
18382 (Fmemory_limit): Cast sbrk's returned value to char *.
18384 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18385 avoids undefined behavior in theory.
18387 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18389 Use functions, not macros, for up- and down-casing (Bug#8254).
18390 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18391 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18392 to use the following functions instead of these macros.
18393 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18394 EMACS_INT, since callers assume the returned value fits in int.
18395 (upcase1): Likewise, for UPCASE_TABLE.
18396 (uppercasep, lowercasep, upcase): New static inline functions.
18397 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18398 the race-condition problem in the old DOWNCASE.
18400 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18401 Rename locals to avoid shadowing.
18402 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18403 (regex_compile, re_search_2, re_match_2_internal):
18404 Remove unused local vars.
18405 (FREE_VAR): Rewrite so as not to use empty "else",
18406 which gcc can warn about.
18407 (regex_compile, re_match_2_internal): Mark locals as initialized.
18408 (RETALLOC_IF): Define only if needed.
18409 (WORDCHAR_P): Likewise. This one is never needed, but is used
18410 only in a comment talking about a compiler bug, so put inside
18411 the #if 0 of that comment.
18412 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18413 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18416 * search.c (boyer_moore): Rename locals to avoid shadowing.
18417 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18418 (PREV_CHAR_BOUNDARY): Likewise.
18420 * search.c (simple_search): Remove unused var.
18422 * dired.c (compile_pattern): Move decl from here ...
18423 * lisp.h: ... to here, so that it can be checked.
18424 (struct re_registers): New forward decl.
18426 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18428 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18430 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18431 Rename locals to avoid shadowing.
18432 (Fvertical_motion): Mark locals as initialized.
18434 * casefiddle.c (casify_object, casify_region): Now static.
18435 (casify_region): Mark local as initialized.
18437 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18439 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18440 New macros, so that the caller can use some names other than
18441 gcpro1, gcpro2, etc.
18442 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18444 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18445 argument, for consistency with GCPRO2_VAR, etc: it is now the
18446 prefix of the variable, not the variable itself. All uses
18448 * dired.c (directory_files_internal, file_name_completion):
18449 Rename locals to avoid shadowing.
18451 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18452 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18453 dired.c's scmp function, had undefined behavior.
18454 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18455 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18456 * buffer.h: ... to here, because these macros use current_buffer,
18457 and the new implementation with inline functions needs to have
18458 current_buffer in scope now, rather than later when the macros
18460 (downcase, upcase1): New static inline functions.
18461 (DOWNCASE, UPCASE1): Reimplement using these functions.
18462 This avoids undefined behavior in expressions like
18463 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18464 from race conditions in accessing the global variables
18465 case_temp1 and case_temp2.
18466 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18467 * lisp.h (case_temp1, case_temp2): Remove their decls.
18468 * character.h (ASCII_CHAR_P): Move from here ...
18469 * lisp.h: ... to here, so that the inline functions mentioned
18470 above can use them.
18472 * dired.c (directory_files_internal_unwind): Now static.
18474 * fileio.c (file_name_as_directory, directory_file_name):
18475 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18477 (file_name_as_directory): Use const pointers when appropriate.
18478 (Fexpand_file_name): Likewise. In particular, newdir might
18479 point at constant storage, so make it a const pointer.
18480 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18481 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18483 (Fset_file_times, Finsert_file_contents, auto_save_error):
18484 Rename locals to avoid shadowing.
18486 * minibuf.c (choose_minibuf_frame_1): Now static.
18487 (Ftry_completion, Fall_completions): Rename or remove locals
18488 to avoid shadowing.
18490 * marker.c (bytepos_to_charpos): Remove; unused.
18492 * lisp.h (verify_bytepos, count_markers): New decls,
18493 so that gcc does not warn that these functions aren't declared.
18495 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18496 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18497 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18498 (copy_text): Remove unused local var.
18500 * filelock.c (within_one_second): Now static.
18501 (lock_file_1): Rename local to avoid shadowing.
18503 * buffer.c (fix_overlays_before): Mark locals as initialized.
18504 (fix_start_end_in_overlays): Likewise. This function should be
18505 simplified by using pointers-to-pointers, but that's a different
18507 (switch_to_buffer_1): Now static.
18508 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18509 (report_overlay_modification): Rename locals to avoid shadowing.
18511 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18512 Fix pointer signedness issue.
18513 (sys_subshell): Mark local as volatile if checking for lint,
18514 to suppress a gcc -Wclobbered warning that does not seem to be right.
18515 (MAXPATHLEN): Define only if needed.
18517 * process.c (serial_open, serial_configure): Move decls from here ...
18518 * systty.h: ... to here, so that they can be checked.
18520 * fns.c (get_random, seed_random): Move extern decls from here ...
18521 * lisp.h: ... to here, so that they can be checked.
18523 * sysdep.c (reset_io): Now static.
18524 (wait_for_termination_signal): Remove; unused.
18526 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18527 (copy_keymap_item, append_key, push_text_char_description):
18529 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18530 (DENSE_TABLE_SIZE): Remove; unused.
18531 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18532 (describe_map_tree):
18533 Rename locals to avoid shadowing.
18535 * keyboard.c: Declare functions static if they are not used elsewhere.
18536 (echo_char, echo_dash, cmd_error, top_level_2):
18537 (poll_for_input, handle_async_input): Now static.
18538 (read_char, kbd_buffer_get_event, make_lispy_position):
18539 (make_lispy_event, make_lispy_movement, apply_modifiers):
18540 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18541 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18542 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18543 (read_key_sequence, read_char): Mark locals as initialized.
18544 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18546 * keyboard.h (make_ctrl_char): New decl.
18547 (mark_kboards): Move decl here ...
18548 * alloc.c (mark_kboards): ... from here.
18550 * lisp.h (force_auto_save_soon): New decl.
18552 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18553 (DEFINE_DUMMY_FUNCTION): New macro.
18554 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18556 (main): Add casts to avoid warnings
18557 if GCC considers string literals to be constants.
18559 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18561 * dbusbind.c: Pointer signedness fixes.
18562 (xd_signature, xd_append_arg, xd_initialize):
18563 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18564 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18565 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18566 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18568 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18569 if GCC considers string literals to be constants.
18570 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18572 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18574 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18575 (print_preprocess, print_object): New macro to fix last change.
18577 * print.c (print_preprocess): Don't forget font objects.
18579 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
18581 * emacs.c (USAGE3): Doc fixes.
18583 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18585 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18588 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
18590 * lisp.h (VWindow_system, Qfile_name_history):
18591 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18592 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18593 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18595 * w32select.c: Don't #include "keyboard.h".
18596 (run_protected): Add extern declaration for waiting_for_input.
18598 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18599 * w32console.c (detect_input_pending, read_input_pending)
18600 (encode_terminal_code):
18601 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18602 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18603 (w32_system_caret_y, Qfile_name_history):
18604 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18605 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18606 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18607 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18608 * w32proc.c (Qlocal, report_file_error):
18609 * w32term.c (Vwindow_system, updating_frame):
18610 * w32uniscribe.c (initialized, uniscribe_font_driver):
18611 Remove unneeded extern declarations.
18613 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
18615 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18617 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
18619 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18620 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18621 These macros can no longer be used for assignment.
18623 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18624 Assign struct members directly, instead of using BUF_BEGV etc.
18625 (record_buffer_markers, fetch_buffer_markers): New functions for
18626 recording and fetching special buffer markers.
18627 (set_buffer_internal_1, set_buffer_temp): Use them.
18629 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18631 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18633 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18634 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18636 * xdisp.c (hscroll_window_tree):
18637 (reconsider_clip_changes): Use PT instead of BUF_PT.
18639 2011-03-13 Eli Zaretskii <eliz@gnu.org>
18641 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18642 $(EMACS_ROOT)/lib/intprops.h.
18644 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18646 Fix more problems found by GCC 4.5.2's static checks.
18648 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18649 to unsigned char * to avoid compiler diagnostic.
18650 (xg_free_frame_widgets): Make it clear that a local variable is
18651 needed only if USE_GTK_TOOLTIP.
18652 (gdk_window_get_screen): Make it clear that this macro is needed
18653 only if USE_GTK_TOOLTIP.
18654 (int_gtk_range_get_value): New function, which avoids a diagnostic
18655 from gcc -Wbad-function-cast.
18656 (xg_set_toolkit_scroll_bar_thumb): Use it.
18657 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18658 diagnostic from gcc -Wbad-function-cast.
18659 (get_utf8_string, xg_get_file_with_chooser):
18660 Rename locals to avoid shadowing.
18661 (create_dialog): Move locals to avoid shadowing.
18663 * xgselect.c (xg_select): Remove unused var.
18665 * image.c (four_corners_best): Mark locals as initialized.
18666 (gif_load): Initialize transparent_p to zero (Bug#8238).
18667 Mark another local as initialized.
18668 (my_png_error, my_error_exit): Mark with NO_RETURN.
18670 * image.c (clear_image_cache): Now static.
18671 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18672 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18673 (x_edge_detection): Remove unnecessary cast that
18674 gcc -Wbad-function-cast diagnoses.
18675 (gif_load): Fix pointer signedness.
18676 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18677 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18679 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18681 Improve quality of tests for time stamp overflow.
18682 For example, without this patch (encode-time 0 0 0 1 1
18683 1152921504606846976) returns the obviously-bogus value (-948597
18684 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18685 reports time overflow. See
18686 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18687 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18688 * editfns.c: Include limits.h and intprops.h.
18689 (TIME_T_MIN, TIME_T_MAX): New macros.
18690 (time_overflow): Move earlier, to before first use.
18691 (hi_time, lo_time): New functions, for an accurate test for
18692 out-of-range times.
18693 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18694 (Fget_internal_run_time): Don't assume time_t fits in int.
18695 (make_time): Use list2 instead of Fcons twice.
18696 (Fdecode_time): More accurate test for out-of-range times.
18697 (check_tm_member): New function.
18698 (Fencode_time): Use it, to test for out-of-range times.
18699 (lisp_time_argument): Don't rely on undefined left-shift and
18700 right-shift behavior when checking for time stamp overflow.
18702 * editfns.c (time_overflow): New function, refactoring common code.
18703 (Fformat_time_string, Fdecode_time, Fencode_time):
18704 (Fcurrent_time_string): Use it.
18706 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18707 * dired.c (make_time): Move to ...
18708 * editfns.c (make_time): ... here.
18709 * systime.h: Note the move.
18711 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18713 * fringe.c (update_window_fringes): Remove unused variables.
18715 * unexmacosx.c (copy_data_segment): Also copy __got section.
18718 2011-03-12 Eli Zaretskii <eliz@gnu.org>
18720 * termcap.c [MSDOS]: Include "msdos.h".
18721 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18722 Constify `char *' arguments and their references according to
18723 prototypes in tparam.h.
18725 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18727 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18728 Adapt all references accordingly.
18730 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18732 2011-03-11 Tom Tromey <tromey@redhat.com>
18734 * buffer.c (syms_of_buffer): Remove obsolete comment.
18736 2011-03-11 Eli Zaretskii <eliz@gnu.org>
18738 * termhooks.h (encode_terminal_code): Declare prototype.
18740 * msdos.c (encode_terminal_code): Don't declare prototype.
18742 * term.c (encode_terminal_code): Now external again, used by
18743 w32console.c and msdos.c.
18745 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18746 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18748 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
18750 Fix some minor problems found by GCC 4.5.2's static checks.
18752 * fringe.c (update_window_fringes): Mark locals as initialized
18754 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18756 * alloc.c (mark_fringe_data): Move decl from here ...
18757 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18758 to check its interface.
18759 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18761 * fontset.c (free_realized_fontset): Now static.
18762 (Fset_fontset_font): Rename local to avoid shadowing.
18763 (fontset_font): Mark local as initialized.
18764 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18766 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18768 * xselect.c (x_disown_buffer_selections): Remove; not used.
18769 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18770 (x_own_selection, Fx_disown_selection_internal): Rename locals
18771 to avoid shadowing.
18772 (x_handle_dnd_message): Remove local to avoid shadowing.
18774 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18775 so that the caller can use some name other than gcpro1.
18776 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18777 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18778 (Fx_backspace_delete_keys_p):
18779 Use them to avoid shadowing, and rename vars to avoid shadowing.
18780 (x_decode_color, x_set_name, x_window): Now static.
18781 (Fx_create_frame): Add braces to silence GCC warning.
18782 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18783 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18784 Remove unused locals.
18785 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18786 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18787 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18790 * xterm.h (x_mouse_leave): New decl.
18792 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18793 Remove unused functions.
18794 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18795 (x_calc_absolute_position): Now static.
18796 (XTread_socket): Don't define label "out" unless it's used.
18797 Don't declare local "event" unless it's used.
18798 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18799 unless they are used.
18800 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18801 (x_fatal_error_signal): Remove; not used.
18802 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18803 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18804 (x_error_catcher, x_connection_closed, x_error_handler):
18805 (x_error_quitter, xembed_send_message, x_iconify_frame):
18806 (my_log_handler): Rename locals to avoid shadowing.
18807 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18808 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18810 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18811 Rename or move locals to avoid shadowing.
18812 (tty_defined_color, merge_face_heights): Now static.
18813 (free_realized_faces_for_fontset): Remove; not used.
18814 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18815 does not deduce is never used uninitialized.
18816 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18817 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18819 * terminal.c (store_terminal_param): Now static.
18821 * xmenu.c (menu_highlight_callback): Now static.
18822 (set_frame_menubar): Remove unused local.
18823 (xmenu_show): Rename parameter to avoid shadowing.
18824 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18825 since they might point to immutable storage.
18826 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18827 since it's unused otherwise.
18829 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18830 Add a FIXME, since the code still doesn't look right. (Bug#8215)
18831 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18832 avoids a gcc -Wuninitialized diagnostic.
18833 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18834 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18835 does not deduce are never used uninitialized.
18837 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18839 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18840 * window.c (window_loop, size_window):
18841 (run_window_configuration_change_hook, enlarge_window): Likewise.
18843 * window.c (display_buffer): Now static.
18844 (size_window): Mark variables that gcc -Wuninitialized
18845 does not deduce are never used uninitialized.
18846 * window.h (check_all_windows): New decl, to forestall
18847 gcc -Wmissing-prototypes diagnostic.
18848 * dispextern.h (bidi_dump_cached_states): Likewise.
18850 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18852 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18853 Include <limits.h>.
18854 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18855 and to avoid gcc -Wuninitialized warning.
18856 (load_charset_map): Mark variables that gcc -Wuninitialized
18857 does not deduce are never used uninitialized.
18858 (load_charset): Abort instead of using uninitialized var (Bug#8229).
18860 * coding.c (coding_set_source, coding_set_destination):
18861 Use "else { /* comment */ }" rather than "else /* comment */;"
18862 for clarity, and to avoid gcc -Wempty-body warning.
18863 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18864 a block, when the outer 'i' will do.
18865 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18866 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18867 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18868 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18869 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18870 Rename locals to avoid shadowing.
18871 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
18872 * coding.c (emacs_mule_char, encode_invocation_designation):
18873 Now static, since they're not used elsewhere.
18874 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
18875 (decode_coding_object, encode_coding_object, detect_coding_system):
18876 (decode_coding_emacs_mule): Mark variables that gcc
18877 -Wuninitialized does not deduce are never used uninitialized.
18878 (detect_coding_iso_2022): Initialize a local variable that might
18879 be used uninitialized. Leave a FIXME because it's not clear that
18880 this initialization is needed. (Bug#8211)
18881 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18882 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18883 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18884 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18885 Remove unused macros.
18887 * category.c (hash_get_category_set): Remove unused local var.
18888 (copy_category_table): Now static, since it's not used elsewhere.
18889 * character.c (string_count_byte8): Likewise.
18891 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18892 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18894 * chartab.c (copy_sub_char_table): Now static, since it's not used
18896 (sub_char_table_ref_and_range, char_table_ref_and_range):
18897 Rename locals to avoid shadowing.
18898 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
18900 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18901 (BIDI_BOB): Remove unused macro.
18903 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18904 deduce are never used uninitialized.
18905 * term.c (encode_terminal_code): Likewise.
18907 * term.c (encode_terminal_code): Now static. Remove unused local.
18909 * tparam.h: New file.
18910 * term.c, tparam.h: Include it.
18911 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18912 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18913 Move these decls to tparam.h, and make them agree with what
18914 is actually in tparam.c. The previous trick of using incompatible
18915 decls in different modules does not conform to the C standard.
18916 All callers of tparam changed to use tparam's actual API.
18917 * tparam.c (tparam1, tparam, tgoto):
18918 Use const pointers where appropriate.
18920 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18921 * cm.h (struct cm): Likewise.
18922 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18923 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18924 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18925 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18926 (turn_on_face, init_tty): Likewise.
18927 * termchar.h (struct tty_display_info): Likewise.
18929 * term.c (term_mouse_position): Rename local to avoid shadowing.
18931 * alloc.c (mark_ttys): Move decl from here ...
18932 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18934 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18936 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18938 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
18940 * search.c (compile_pattern_1): Remove argument regp, unused since
18941 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18942 (compile_pattern): Don't pass it.
18944 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18946 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18947 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18949 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18951 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18953 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18954 gdk_window_get_screen, gdk_window_get_geometry,
18955 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18956 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18957 (xg_get_pixbuf_from_pixmap): New function.
18958 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18959 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18960 Call xg_get_pixbuf_from_pixmap instead of
18961 gdk_pixbuf_get_from_drawable.
18962 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18963 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18964 (xg_check_special_colors): Use GtkStyleContext and its functions
18966 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18967 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18968 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18969 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18970 Call gtk_widget_get_preferred_size.
18971 (xg_frame_resized): gdk_window_get_geometry only takes 5
18973 (xg_win_to_widget, xg_event_is_for_menubar):
18974 Call gdk_x11_window_lookup_for_display.
18975 (xg_set_widget_bg): New function.
18976 (delete_cb): New function.
18977 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18978 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18979 (xg_set_background_color): Call xg_set_widget_bg.
18980 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18981 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18982 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18983 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18985 (update_frame_tool_bar): Call gtk_widget_hide.
18986 (xg_initialize): Use GDK_KEY_g.
18988 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18990 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18992 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18993 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18994 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18996 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18998 * w32xfns.c (select_palette): Check success of RealizePalette against
18999 GDI_ERROR, not zero.
19001 See ChangeLog.11 for earlier changes.
19003 ;; Local Variables:
19007 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19009 This file is part of GNU Emacs.
19011 GNU Emacs is free software: you can redistribute it and/or modify
19012 it under the terms of the GNU General Public License as published by
19013 the Free Software Foundation, either version 3 of the License, or
19014 (at your option) any later version.
19016 GNU Emacs is distributed in the hope that it will be useful,
19017 but WITHOUT ANY WARRANTY; without even the implied warranty of
19018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19019 GNU General Public License for more details.
19021 You should have received a copy of the GNU General Public License
19022 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.