]> code.delx.au - gnu-emacs/blob - src/ChangeLog
* src/buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
[gnu-emacs] / src / ChangeLog
1 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4
5 * eval.c (Fautoload): Remember previous autoload status in load-history.
6
7 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
8
9 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
10 * lread.c (load_each_byte, new_backquote_flag, readchar)
11 (read_filtered_event, lisp_file_lexically_bound_p)
12 (safe_to_load_version, Fload, complete_filename_p, openp)
13 (build_load_history, readevalloop, read_escape, read1)
14 (string_to_number, read_vector, read_list):
15 * macros.c (Fstart_kbd_macro):
16 * marker.c (CONSIDER):
17 * menu.c (parse_single_submenu, digest_single_submenu)
18 (find_and_return_menu_selection, Fx_popup_menu):
19 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
20 (Ftry_completion):
21 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
22 (ns_menu_show):
23 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
24 (xmenu_show, xdialog_show):
25 Use bool for booleans.
26 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
27 as it's not a predicate. All uses changed. Omit unnecessary
28 buffer termination.
29
30 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
31
32 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
33 (save_excursion_restore): Do not restore mark if it was not saved.
34
35 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
36
37 * marker.c (cached_modiff): EMACS_INT, not int.
38
39 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
40 instead of having a wrong decl.
41 * nsmenu.m (waiting_for_input): Remove wrong decl.
42
43 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
44
45 keyboard.c, keymap.c: Use bool for booleans.
46 * dispnew.c (sit_for): Distinguish between 3-way display_option
47 and boolean do_display.
48 * keyboard.c (single_kboard, this_command_key_count_reset)
49 (waiting_for_input, echoing, immediate_quit, input_pending)
50 (interrupt_input, interrupts_deferred, pop_kboard)
51 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
52 (command_loop_1, adjust_point_for_property)
53 (safe_run_hooks_error, input_polling_used, read_char):
54 (help_char_p, readable_events, kbd_buffer_events_waiting)
55 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
56 (lucid_event_type_list_p, get_input_pending):
57 (gobble_input, menu_separator_name_p, menu_bar_item)
58 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
59 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
60 (keyremap_step, test_undefined, read_key_sequence)
61 (detect_input_pending, detect_input_pending_ignore_squeezables)
62 (detect_input_pending_run_timers, requeued_events_pending_p)
63 (quit_throw_to_read_char, Fset_input_interrupt_mode):
64 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
65 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
66 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
67 (accessible_keymaps_1, Fkey_description, push_key_description):
68 (shadow_lookup, struct where_is_internal_data)
69 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
70 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
71 (describe_map, describe_vector):
72 * menu.c (single_menu_item):
73 * nsmenu.m (ns_update_menubar):
74 * process.c (wait_reading_process_output):
75 * search.c (scan_buffer, scan_newline):
76 Use bool for boolean.
77 * keyboard.c (timers_run, swallow_events)
78 (detect_input_pending_run_timers):
79 * process.c (wait_reading_process_output):
80 Use unsigned for counter where wraparound-on-overflow is desired,
81 since unsigned is guaranteed to have that behavior and signed is not.
82 (read_char): Use ptrdiff_t for string length.
83 (get_input_pending): Remove first argument, since it was always
84 the same pointer-to-int (now pointer-to-boolean) &input_pending,
85 and behave as if it had that value. Return new value of
86 input_pending. All callers changed.
87 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
88 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
89 a string length.
90 * keymap.c (push_key_description): Omit last arg, which was always 1.
91 All callers changed.
92
93 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
94
95 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
96
97 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
98 ($(BLD)/term.$(O)): Update dependencies.
99
100 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
101
102 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
103 * lisp.h (enum pvec_type): Adjust comments and omit explicit
104 initializer for PVEC_NORMAL_VECTOR.
105
106 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
107
108 Clean out old termopts cruft.
109 * termopts.h (flow_control, meta_key): Remove unused decls.
110 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
111 Don't include termopts.h.
112
113 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
114
115 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
116
117 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
118
119 * commands.h (immediate_quit): Remove duplicate decl.
120
121 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
122
123 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
124 caching.
125 (nsfont_open): Remove setting of Vfonts_in_cache.
126 (syms_of_nsfont): Remove initialization of Vfonts_in_cache
127
128 2012-10-09 Eli Zaretskii <eliz@gnu.org>
129
130 * w32fns.c (w32_last_error): Change the return value to DWORD, to
131 match what GetLastError returns. Explain why the function is
132 needed.
133
134 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
135 'is_tooltip_frame', to avoid confusion with its global namesake.
136
137 2012-10-08 Daniel Colascione <dancol@dancol.org>
138
139 * xdisp.c (start_hourglass): Call w32_note_current_window when
140 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
141 build that caused Emacs to display the hourglass cursor forever.
142
143 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
144 which is broken under remote desktop, calculate the number of
145 colors available for a display based on the display's number of
146 planes and number of bits per pixel per plane. (bug#10397).
147
148 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
149
150 * nsfont.m (Vfonts_in_cache): New variable.
151 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
152 are used. Add cached fonts to Vfonts_in_cache.
153 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
154
155 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
156
157 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
158 in nt/config.nt.
159 (FONT_H): Define after FRAME_H.
160 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
161 Update dependencies.
162
163 * w32term.c: Remove leftover declaration of keyboard_codepage.
164
165 2012-10-08 Eli Zaretskii <eliz@gnu.org>
166
167 * makefile.w32-in (FONT_H): Add $(FRAME_H).
168 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
169 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
170 (GLOBAL_SOURCES): Add cygw32.c.
171 ($(BLD)/unexw32.$(O)):
172 ($(BLD)/w32.$(O)):
173 ($(BLD)/w32console.$(O)):
174 ($(BLD)/w32fns.$(O)):
175 ($(BLD)/w32heap.$(O)):
176 ($(BLD)/w32menu.$(O)):
177 ($(BLD)/w32proc.$(O)): Add w32common.h.
178
179 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
180 'const char *'.
181 (x_to_w32_color): Don't modify the argument, modify a copy instead.
182
183 2012-10-08 Daniel Colascione <dancol@dancol.org>
184
185 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
186 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
187 accidental message numbering hole. Change other messages to
188 match.
189
190 * w32select.h (HAVE_W32SELECT): Remove.
191
192 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
193 w32common.h instead of w32heap.h
194
195 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
196 (get_allocation_unit, get_processor_type, get_w32_major_version)
197 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
198 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
199 (OS_NT, os_subtype, cache_system_info): Move declarations to
200 w32common.
201
202 * w32heap.c: Include w32common.h.
203 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
204 (w32_minor_version, w32_build_number, w32_subtype): Remove
205 duplicate definitions.
206
207 * w32fns.c: Include w32common.h; include w32heap.h only in
208 WINDOWSNT.
209
210 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
211 Use `report_file_error' instead of `error' in order to better
212 inform users of what went wrong. Increase NTGUI_UNICODE file
213 dialog box file name length to 32k, the maximum allowed by the NT
214 kernel.
215
216 * w32common.h: New file.
217 (ROUND_UP, ROUND_DOWN, get_page_size)
218 (get_allocation_unit, get_processor_type, get_w32_major_version)
219 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
220 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
221 (OS_NT, os_subtype, cache_system_info): Move here.
222
223 * unexw32.c, unexcw.c: Include w32common.h.
224
225 * emacs.c (main): Use (defined (WINDOWSNT) || defined
226 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
227 to call syms_of_w32select.
228
229 * cygw32.h: Remove obsolete EXFUN declarations.
230
231 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
232
233 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
234 of w32inevt.o from SOME_MACHINE_OBJECTS.
235
236 2012-10-08 Daniel Colascione <dancol@dancol.org>
237
238 * image.c: Permanent fix for JPEG compilation issue --- limit
239 jpeglib `boolean' redefinition to Cygwin builds.
240
241 2012-10-08 Eli Zaretskii <eliz@gnu.org>
242
243 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
244
245 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
246 Cygwin.
247
248 2012-10-08 Daniel Colascione <dancol@dancol.org>
249
250 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
251 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
252 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
253 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
254 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
255 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
256 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
257 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
258 now a supported configuration.
259
260 * Makefile.in: consolidate image variables into LIBIMAGE; add
261 W32_OBJ and W32_LIBS. Compile new files.
262
263 * conf_post.h:
264 (_DebPrint) declare tracing facility for W32 debugging. We need
265 to unify tracing later.
266
267 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
268 unconditional use of W32 Unicode functions. Cygwin runs only on
269 100% Unicode operating systems.
270
271 * cygw32.c: New file. Define Cygwin-specific facilities.
272 (Fcygwin_convert_path_to_windows)
273 (Fcygwin_convert_path_from_windows): New user functions for
274 accessing Cygwin path-munging routines.
275
276 * cygw32.h: New file.
277 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
278 UTF-16LE strings temporarily inside non-Lisp-visible string
279 objects.
280
281 (w32_strerror): Just what it says on the tin.
282
283 * emacs.c: Make the NS fork-then-exec code for daemon-launching
284 also run for Cygwin; both systems have the same problem with using
285 GUI facilities in a forked child. Also call syms_of_cygw32,
286 syms_of_w32select in correct places.
287
288 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
289 needs fork-then-exec for daemon launching.
290
291 * font.h: Include frame.h.
292
293 * image.c: Use the image library cache machinery only when we're
294 compiling for native WINDOWSNT; Cygwin can use shared libraries
295 like any other Unixlike system.
296
297 * keyboard.c: Clarify a comment regarding the input loop.
298
299 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
300 functions directly instead of trying to detect at runtime that our
301 host operating system supports them. We make this change for two
302 reasons: Cygwin lacks support for the multibyte character
303 conversion functions used by the legacy menu code, and Cygwin
304 never needs to rely on non-Unicode APIs.
305
306 * unexw32.c (hinst): Declare extern.
307
308 * w32.c: Change header order;
309 (w32_strerror): Move to w32fns.c because we need it for
310 non-WINDOWSNT builds.
311
312 * w32.h: Add #error macro to make sure we don't include w32.h for
313 Cygwin builds. Remove w32select declarations.
314
315 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
316 w32fns.c. w32console.c is WINDOWSNT-only.
317
318 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
319 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
320 POSIXy alternative.
321 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
322 (w32_major_version, w32_minor_version, w32_build_number)
323 (os_subtype, sound_type): Define here
324 (w32_defined_color): Make color parameter const for consistency
325 with other _defined_color functions.
326 (w32_createwindow): Unconditionally call w32_init_class instead of
327 doing so only when hprevinst is non-NULL. Plumbing hprevinst
328 through the code is complex and unnecessary because class
329 registration is practically free.
330 (w32_name_of_message): New EMACSDEBUG-only function.
331 (Fset_message_beep): Move here
332 (Fx_open_connection): Require that the display name for Windows be
333 "w32" for consistency, emacsclient disambiguation, and maybe, one
334 day, multi-window-system support.
335 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
336 Cygwin files for W32 GUI facilities, since these clearly don't
337 expect Cygwin names.
338 (_DebPrint): Define.
339 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
340 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
341 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
342 (w32_last_error): Remove.
343
344 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
345
346 * w32heap.c (syspage_mask): Declare here.
347 (cache_system_info): Remove.
348
349 * w32inevt.c (faked_key): Define globally, not statically.
350 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
351 (w32_console_toggle_lock_key): Move to w32fns.c.
352
353 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
354
355 * w32proc.c (_DebPrint): Move to w32fns.c.
356 * w32select.c: Include string.h, stdio.h for Cygwin.
357 * w32select.h: New File.
358
359 * w32term.c: Include io.h for non-CYGWIN builds; needed for
360 get_osfhandle.
361 (w32_message_fd): New variable. Under Cygwin, holds the file
362 descriptor the system used to tell us about pending thread
363 messages.
364
365 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
366 that prevented compilation under non-WINDOWSNT systems.
367
368 (w32_initialize): Open /dev/windows and assign it to
369 w32_message_fd. Provide w32 feature.
370
371 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
372 (WM_EMACS_INPUT_READY): add.
373 (prepend_msg, w32_message_fd): Declare globally.
374
375 * w32xfns.c:
376 (keyboard_handle): Use only when WINDOWSNT.
377 (notify_msg_ready): New function. Posts a message to the main
378 thread's message queue under CYGWIN, which wakes up the main
379 thread from select(2) by making the /dev/windows file descriptor
380 ready. Under WINDOWSNT, it sets an event the same way the old
381 code did.
382
383 (post, prepend_msg): Actually call notify_msg_ready instead of
384 setting the input event directly.
385
386 2012-10-07 Eli Zaretskii <eliz@gnu.org>
387
388 * ralloc.c (relinquish): If a heap is ready to be relinquished,
389 but it still has blocs in it, don't return it to the system,
390 instead of aborting. (Bug#12402)
391
392 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
393
394 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
395
396 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
397 MAC_OS_X_VERSION_10_6.
398 (syms_of_nsterm): Remove comment about Panther and above for
399 ns-antialias-text.
400 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
401 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
402 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
403
404 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
405 MAC_OS_X_VERSION_10_4.
406
407 * nsmenu.m (fillWithWidgetValue:): Remove code for <
408 MAC_OS_X_VERSION_10_2.
409
410 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
411
412 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
413 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
414
415 * nsterm.m (ns_in_resize): Remove (Bug#12479).
416 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
417 (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove
418 ns_in_resize check.
419 (ns_clear_frame_area): Remove resize handle code.
420
421 * nsfns.m (ns_in_resize): Remove.
422 (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
423 ns_in_resize check.
424
425 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
426
427 Improve sys_siglist detection.
428 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
429 defined as a macro, as is done in Solaris.
430 (sys_siglist_entries): New macro.
431 (save_strsignal): Use it.
432 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
433 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
434
435 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
436
437 * nsfns.m (Fx_create_frame): Call x_default_parameter with
438 fullscreen/Fullscreen.
439
440 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
441 tobar_height is new.
442
443 * nsterm.m (x_make_frame_visible): Check for fullscreen.
444 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
445 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
446 (windowDidResize:): Check for correct window if old style fullscreen.
447 Capitalize word in comment. Remove incorrect comment.
448 (initFrameFromEmacs:): tbar_height renamed tibar_height.
449 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
450 error in drawing background.
451 (toggleFullScreen:): Remove comment. Rearrange calls.
452 Set toolbar values to zero, save old height in tobar_height.
453 Restore tool bar height when leaving fullscreen.
454 (canBecomeMainWindow): New function.
455
456 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
457
458 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
459
460 2012-10-05 Eli Zaretskii <eliz@gnu.org>
461
462 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
463
464 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
465 that time stamps of directories could also be changed. Don't
466 request the too broad GENERIC_WRITE, only the more restrictive
467 FILE_WRITE_ATTRIBUTES access rights.
468
469 * fileio.c (Fset_file_times): Special-case ignoring errors for
470 directories only on MSDOS, not on MS-Windows.
471
472 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
473
474 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
475
476 2012-10-04 Eli Zaretskii <eliz@gnu.org>
477
478 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
479 see whether CreateFile failed.
480
481 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
482
483 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
484 to avoid similar races.
485 * keyboard.c (pending_signals): Now bool, not int.
486
487 Port timers to OpenBSD, plus check for timer failures.
488 OpenBSD problem reported by Han Boetes.
489 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
490 and/or setitimer.
491 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
492 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
493 like OpenBSD, which has timer_settime but does not declare it.
494 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
495 whether to use itimerspec-related primitives. All uses of
496 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
497
498 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
499
500 * profiler.c (handle_profiler_signal): Fix a malloc race
501 that caused Emacs to hang on Fedora 17 when profiling Lisp.
502
503 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
504
505 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
506
507 2012-10-02 Eli Zaretskii <eliz@gnu.org>
508
509 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
510 consistent with the change in return value of 'safe_strsignal'.
511
512 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
513
514 Prefer plain 'static' to 'static inline' (Bug#12541).
515 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
516 (bidi_set_sor_type, bidi_push_embedding_level)
517 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
518 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
519 (bidi_cache_search, bidi_cache_ensure_space)
520 (bidi_cache_iterator_state, bidi_cache_find)
521 (bidi_peek_at_next_level, bidi_set_paragraph_end)
522 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
523 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
524 Now 'static', not 'static inline'.
525
526 Count overruns when profiling; change units to ns.
527 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
528 Give extra weight to samples after overruns, to attempt to count
529 the time more accurately.
530 (setup_cpu_timer): Change sampling interval units from ms to ns, since
531 the underlying primitives nominally do ns.
532 (Fprofiler_cpu_start): Document the change. Mention that
533 the sampling intervals are only approximate.
534
535 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
536
537 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
538
539 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
540 case for the special 0 coding-system.
541
542 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
543 (Fmake_overlay): Remove redundant tests.
544 (fix_start_end_in_overlays): Remove redundant recentering.
545
546 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
547
548 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
549 Update dependencies.
550
551 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
552
553 Fix a malloc race condition involving strsignal.
554 A signal can arrive in the middle of a malloc, and Emacs's signal
555 handler can invoke strsignal, which can invoke malloc, which is
556 not portable. This race condition bug makes Emacs hang on GNU/Linux.
557 Fix it by altering the signal handler so that it does not invoke
558 strsignal.
559 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
560 * process.c (status_message): Use const pointer, in case strsignal
561 is #defined to safe_strsignal.
562 * sysdep.c (sys_siglist, init_signals): Always define and
563 initialize a substitute sys_siglist if the system does not define
564 one, even if HAVE_STRSIGNAL.
565 (safe_strsignal): Rename from strsignal. Always define,
566 using sys_siglist. Return a const pointer.
567 * syssignal.h (safe_strsignal): New decl.
568 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
569
570 2012-10-01 Eli Zaretskii <eliz@gnu.org>
571
572 * w32proc.c (timer_loop): Fix code that waits for timer
573 expiration, to avoid high CPU usage.
574
575 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
576
577 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
578 (sweep_weak_table): Remove redundant prototypes.
579
580 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
581
582 * emacs.c: Move the inclusion of TERM_HEADER after including
583 windows.h on WINDOWSNT. This avoids compilation problems with
584 MSVC.
585
586 2012-10-01 Eli Zaretskii <eliz@gnu.org>
587
588 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
589 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
590 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
591 as the previous version used 'void *'.
592
593 * ralloc.c (ROUNDUP): Fix last change.
594 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
595 'size_t'.
596
597 * w32proc.c <disable_itimers>: New static flag.
598 (init_timers): Initialize it to zero, after creating the critical
599 sections used by the timer threads.
600 (term_timers): Set to 1 before deleting the critical sections.
601 (getitimer, setitimer): If disable_itimers is non-zero, return an
602 error indication without doing anything. Reported by Fabrice
603 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
604 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
605 return results.
606 [!HAVE_SETITIMER]: Behave as the previous version that didn't
607 support timers.
608
609 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
610 term_ntproc after all the other bookkeeping, to get timers working
611 as long as possible.
612
613 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
614
615 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
616 Suggested by Juri Linkov in
617 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
618
619 Prefer plain 'static' to 'static inline' (Bug#12541).
620 With static functions, modern compilers inline pretty well by
621 themselves; advice from programmers often hurts as much as it helps.
622 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
623 this change shrinks the text size of the Emacs executable by 1.1%
624 without affecting CPU significantly in my benchmark.
625 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
626 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
627 (mark_maybe_object, mark_maybe_pointer, bounded_number):
628 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
629 (bset_auto_fill_function, bset_auto_save_file_format)
630 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
631 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
632 (bset_cache_long_line_scans, bset_case_fold_search)
633 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
634 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
635 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
636 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
637 (bset_header_line_format, bset_indicate_buffer_boundaries)
638 (bset_indicate_empty_lines, bset_invisibility_spec)
639 (bset_left_fringe_width, bset_major_mode, bset_mark)
640 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
641 (bset_name, bset_overwrite_mode, bset_pt_marker)
642 (bset_right_fringe_width, bset_save_length)
643 (bset_scroll_bar_width, bset_scroll_down_aggressively)
644 (bset_scroll_up_aggressively, bset_selective_display)
645 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
646 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
647 (set_buffer_overlays_after):
648 * category.c (bset_category_table):
649 * charset.c (read_hex):
650 * coding.c (produce_composition, produce_charset)
651 (handle_composition_annotation, handle_charset_annotation)
652 (char_encodable_p):
653 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
654 (assign_row, set_frame_matrix_frame, make_current)
655 (add_row_entry):
656 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
657 * fns.c (maybe_resize_hash_table):
658 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
659 * gmalloc.c (register_heapinfo):
660 * image.c (lookup_image_type):
661 * intervals.c (set_interval_object, set_interval_left)
662 (set_interval_right, copy_interval_parent, rotate_right)
663 (rotate_left, balance_possible_root_interval):
664 * keyboard.c (kset_echo_string, kset_kbd_queue)
665 (kset_keyboard_translate_table, kset_last_prefix_arg)
666 (kset_last_repeatable_command, kset_local_function_key_map)
667 (kset_overriding_terminal_local_map, kset_real_last_command)
668 (kset_system_key_syms, clear_event, set_prop):
669 * lread.c (digit_to_number):
670 * marker.c (attach_marker, live_buffer, set_marker_internal):
671 * nsterm.m (ns_compute_glyph_string_overhangs):
672 * process.c (pset_buffer, pset_command)
673 (pset_decode_coding_system, pset_decoding_buf)
674 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
675 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
676 (pset_status, pset_tty_name, pset_type, pset_write_queue):
677 * syntax.c (bset_syntax_table, dec_bytepos):
678 * terminal.c (tset_param_alist):
679 * textprop.c (interval_has_some_properties)
680 (interval_has_some_properties_list):
681 * window.c (wset_combination_limit, wset_dedicated)
682 (wset_display_table, wset_hchild, wset_left_fringe_width)
683 (wset_left_margin_cols, wset_new_normal, wset_new_total)
684 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
685 (wset_right_fringe_width, wset_right_margin_cols)
686 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
687 (wset_vertical_scroll_bar_type, wset_window_parameters):
688 * xdisp.c (wset_base_line_number, wset_base_line_pos)
689 (wset_column_number_displayed, wset_region_showing)
690 (window_box_edges, run_window_scroll_functions)
691 (append_glyph_string_lists, prepend_glyph_string_lists)
692 (append_glyph_string, set_glyph_string_background_width)
693 (append_glyph, append_composite_glyph)
694 (take_vertical_position_into_account):
695 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
696 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
697 (lface_hash, lface_same_font_attributes_p, lookup_face):
698 * xml.c (libxml2_loaded_p):
699 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
700 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
701 Now 'static', not 'static inline'.
702
703 * bidi.c: Tune.
704 (bidi_copy_it): Do the whole copy with a single memcpy.
705 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
706
707 Revert the FOLLOW-SYMLINKS change for file-attributes.
708 Doing it right would require several changes to Tramp, and there's
709 not enough time to get that tested before the freeze today.
710 * dired.c (directory_files_internal, Ffile_attributes):
711 Undo last change.
712
713 * frame.c (x_report_frame_params): Port better to wider ints.
714 Do not assume that EMACS_UINT is the same width as uprintmax_t,
715 or that pointers can be printed in 15 decimal digits.
716 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
717
718 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
719
720 Support x64 build on MS-Windows.
721 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
722 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
723 compatibility with x64.
724 (x_get_focus_frame): Add prototype.
725
726 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
727 defining an XRectangle structure.
728
729 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
730 arithmetics for compatibility with x64.
731
732 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
733 compatibility with x64.
734
735 * w32heap.h: Adjust prototypes and declarations.
736
737 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
738 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
739 DWORD, long, and unsigned long, for compatibility with x64.
740 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
741 (sbrk): Argument is now of type ptrdiff_t.
742
743 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
744 less than 0x0500.
745 (w32_msg_pump): Use WPARAM type for 'result'.
746
747 * w32.c (init_environment, get_emacs_configuration): Support AMD64
748 architecture.
749 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
750 compatibility with x64.
751
752 * vm-limit.c (lim_data): Now size_t.
753 (check_memory_limits): Adjust prototypes of real_morecore and
754 __morecore to receive argument of type ptrdiff_t. Use size_t for
755 five_percent and data_size.
756
757 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
758 variables, for compatibility with x64.
759 (rva_to_section, offset_to_section, relocate_offset)
760 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
761 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
762 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
763 for compatibility with x64.
764
765 * sysdep.c (STDERR_FILENO): Define if not already defined.
766
767 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
768 (__morecore): Argument type is now ptrdiff_t.
769 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
770 (relinquish): Use ptrdiff_t type for 'excess'.
771 (r_alloc_sbrk): Argument type is now ptrdiff_t.
772
773 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
774 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
775 instead of a literal number.
776
777 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
778 (min): Define only if not already defined.
779
780 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
781 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
782 hosts.
783
784 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
785 'bitmaps' is a pointer.
786
787 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
788
789 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
790
791 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
792
793 file-attributes has a new optional arg FOLLOW-SYMLINKS.
794 * dired.c (directory_files_internal, Ffile_attributes):
795 New arg follow_symlinks. All uses changed.
796
797 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
798
799 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
800
801 2012-09-30 Eli Zaretskii <eliz@gnu.org>
802
803 Support atimers and CPU profiler via profile.c on MS-Windows.
804 * w32proc.c (sig_mask, crit_sig): New static variables.
805 (sys_signal): Support SIGALRM and SIGPROF.
806 (sigemptyset, sigaddset, sigfillset, sigprocmask)
807 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
808 sigfillset, and sigprocmask are no longer no-ops.
809 (sigismember): New function.
810 (struct itimer_data): New definition.
811 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
812 (crit_prof): New static variables.
813 (MAX_SINGLE_SLEEP): New definition.
814 (timer_loop, stop_timer_thread, term_timers, init_timers)
815 (start_timer_thread, getitimer, setitimer): New functions.
816 (alarm): No longer a no-op, calls setitimer.
817
818 * w32.c (term_ntproc): Call term_timers.
819 (init_ntproc): Make sure all signals are unblocked at startup, to
820 erase any traces of dumping. Call init_timers.
821
822 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
823 Windows-specific code to display the hourglass mouse pointer is no
824 longer used.
825 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
826 to hourglass timer expiration.
827 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
828 Remove, no longer used.
829 (w32_note_current_window, show_hourglass, hide_hourglass):
830 New functions, in support of hourglass cursor display similar to other
831 window systems.
832 (syms_of_w32fns): Don't initialize hourglass_timer.
833
834 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
835 WINDOWSNT as well.
836 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
837
838 * w32.h (init_timers, term_timers): Add prototypes.
839
840 2012-09-30 Kenichi Handa <handa@gnu.org>
841
842 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
843 to the buffer relocation which may be caused by ccl_driver.
844
845 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
846
847 * xfns.c (Fx_file_dialog): Update comment.
848
849 * w32fns.c (Fx_file_dialog): Update comment.
850
851 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
852 Initialize panel name field if OSX >= 10.6.
853
854 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
855
856 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
857
858 * nsterm.m (NEW_STYLE_FS): New define.
859 (ns_fullscreen_hook, windowWillEnterFullScreen)
860 (windowDidEnterFullScreen, windowWillExitFullScreen)
861 (windowDidExitFullScreen, toggleFullScreen, handleFS)
862 (setFSValue): New functions.
863 (EmacsFSWindow): New implementation.
864 (canBecomeKeyWindow): New function for EmacsFSWindow.
865 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
866 (dealloc): Release nonfs_window if in fullscreen.
867 (updateFrameSize:): Call windowDidMove to update top/left.
868 (windowWillResize:toSize:): Check if frame is still maximized.
869 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
870 next_maximized, maximized_width, maximized_height and nonfs_window.
871 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
872 tbar_height.
873 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
874 fullscreen. Set maximized_width/height. Act on next_maximized.
875
876 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
877 (EmacsView): Add variables for fullscreen.
878 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
879 (EmacsFSWindow): New interface for fullscreen.
880
881 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
882
883 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
884
885 2012-09-30 Chong Yidong <cyd@gnu.org>
886
887 * fns.c (Frandom): Doc fix.
888
889 2012-09-30 Martin Rudalics <rudalics@gmx.at>
890
891 * window.c (Vwindow_combination_limit): New default value.
892 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
893
894 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
895
896 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
897 Suggested by Eli Zaretskii in
898 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
899
900 2012-09-30 Eli Zaretskii <eliz@gnu.org>
901
902 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
903 HAVE_TIMER_SETTIME is defined.
904
905 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
906
907 Profiler improvements: more-accurate timers, overflow checks.
908 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
909 signal.h, setjmp.h. Include systime.h instead.
910 (saturated_add): New function.
911 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
912 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
913 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
914 New static vars.
915 (enum profiler_cpu_running): New enum.
916 (profiler_cpu_running): Now of that enum type, not bool.
917 All uses changed to store the new value.
918 (handle_profiler_signal): Rename from sigprof_handler_1,
919 for consistency with other handlers. Do not check whether
920 cpu_log is a hash-table if garbage collecting, since it
921 doesn't matter in that case.
922 (deliver_profiler_signal): Rename from sigprof_handler,
923 for consistency with other handlers.
924 (setup_cpu_timer): New function, with much of what used to be in
925 Fprofiler_cpu_start. Check for out-of-range argument.
926 Prefer timer_settime if available, and prefer
927 thread cputime clocks, then process cputime clocks, then
928 monotonic clocks, to the old realtime clock. Use make_timeval
929 to round more-correctly when falling back to setitimer.
930 (Fprofiler_cpu_start): Use it.
931 (Fprofiler_cpu_stop): Prefer timer_settime if available.
932 Don't assume that passing NULL as the 2nd argument of setitimer
933 is the same as passing a pointer to all-zero storage.
934 Ignore SIGPROF afterwards.
935 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
936 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
937 non-fatal signal handlers. Ignore SIGPROF on startup.
938 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
939 in profiler.c, since sysdep.c now uses it.
940
941 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
942 Suggested by Eli Zaretskii in
943 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
944
945 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
946
947 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
948
949 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
950
951 * lisp.h (struct backtrace): Remove indirection for `function' field.
952 * xdisp.c (redisplay_internal):
953 * profiler.c (record_backtrace, sigprof_handler_1):
954 * alloc.c (Fgarbage_collect):
955 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
956 (Fbacktrace_frame): Adjust accordingly.
957
958 2012-09-28 Glenn Morris <rgm@gnu.org>
959
960 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
961 (Frun_hook_with_args_until_failure): Doc fixes.
962
963 2012-09-28 Eli Zaretskii <eliz@gnu.org>
964
965 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
966 Qautomatic_redisplay and change the symbol name. All users changed.
967
968 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
969
970 * profiler.c (sigprof_handler): Fix race condition.
971
972 2012-09-28 Glenn Morris <rgm@gnu.org>
973
974 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
975
976 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
977
978 Check more robustly for timer_settime.
979 * Makefile.in (LIB_TIMER_TIME): New macro.
980 (LIBES): Add it.
981 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
982 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
983 call timer_settime.
984
985 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
986
987 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
988
989 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
990
991 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
992
993 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
994
995 * character.h (MAYBE_UNIFY_CHAR): Remove.
996 * charset.c, charset.h (maybe_unify_char): Now static.
997 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
998 Since this stuff is now private to charset.c, there's no need for
999 a public macro and no need to inline by hand.
1000
1001 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1002 Stefan Monnier <monnier@iro.umontreal.ca>
1003 Juanma Barranquero <lekktu@gmail.com>
1004
1005 * profiler.c: New file.
1006 * Makefile.in (base_obj): Add profiler.o.
1007 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1008 ($(BLD)/profiler.$(O)): New target.
1009 * emacs.c (main): Call syms_of_profiler.
1010 * alloc.c (Qautomatic_gc): New constant.
1011 (MALLOC_PROBE): New macro.
1012 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1013 (total_bytes_of_live_objects): New function.
1014 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1015 Call malloc_probe for the memory profiler.
1016 (syms_of_alloc): Define Qautomatic_gc.
1017 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1018 race condition.
1019 (struct backtrace): Move definition...
1020 * lisp.h (struct backtrace): ..here.
1021 (Qautomatic_gc, profiler_memory_running): Declare vars.
1022 (malloc_probe, syms_of_profiler): Declare functions.
1023 * xdisp.c (Qautomatic_redisplay): New constant.
1024 (redisplay_internal): Record itself in backtrace_list.
1025 (syms_of_xdisp): Define Qautomatic_redisplay.
1026
1027 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1028 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1029
1030 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1031
1032 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1033
1034 Prefer POSIX timers if available.
1035 They avoid a race if the timer is too close to the current time.
1036 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1037 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1038 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1039
1040 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1041
1042 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1043 CHAR_STRING_ADVANCE.
1044 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1045 STRING_CHAR_ADVANCE.
1046
1047 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1048
1049 Move Vlibrary_cache to emacs.c and reset before dumping.
1050
1051 * lisp.h (reset_image_types): Declare.
1052 [WINDOWSNT] (Vlibrary_cache): Declare.
1053
1054 * image.c (reset_image_types): New function.
1055
1056 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1057 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1058 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1059
1060 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1061 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1062
1063 * w32.h (Vlibrary_cache): Do not declare.
1064
1065 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1066
1067 * w32proc.c (sys_signal): Handle all signals defined by the
1068 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1069 handlers for signals supported by Windows. Don't override
1070 term_ntproc as the handler for SIGABRT.
1071 (sigaction): Rewrite to call sys_signal instead of duplicating its
1072 code.
1073 (sys_kill): Improve commentary.
1074
1075 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1076 consistency with a signature of a signal handler. All callers
1077 changed.
1078 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1079 install term_ntproc as a signal handler for SIGABRT, as that
1080 should be done by the dumped Emacs.
1081
1082 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1083
1084 * w32select.c (term_w32select): Protect against repeated
1085 invocation by setting clipboard_owner to NULL after calling
1086 DestroyWindow.
1087
1088 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1089 and term_ntproc to their modified signatures.
1090
1091 * character.c (char_string, string_char): Remove calls to
1092 MAYBE_UNIFY_CHAR. See the discussion starting at
1093 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1094 for the details.
1095
1096 2012-09-25 Chong Yidong <cyd@gnu.org>
1097
1098 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1099
1100 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1101
1102 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1103 when encountering an unknown bytecode.
1104
1105 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1106
1107 image.c, indent.c: Use bool for booleans.
1108 * dispextern.h (struct image_type): Members valid_p, load, init
1109 now return bool, not int. All uses changed.
1110 * image.c: Omit unnecessary static decls.
1111 (x_create_bitmap_mask, x_build_heuristic_mask):
1112 Return void, not int, since callers don't care about the return value.
1113 (x_create_bitmap_mask, define_image_type, valid_image_p)
1114 (struct image_keyword, parse_image_spec, image_spec_value)
1115 (check_image_size, image_background)
1116 (image_background_transparent, x_clear_image_1)
1117 (postprocess_image, lookup_image, x_check_image_size)
1118 (x_create_x_image_and_pixmap, xbm_image_p)
1119 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1120 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1121 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1122 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1123 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1124 (png_image_p, init_png_functions, png_load_body, png_load)
1125 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1126 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1127 (init_gif_functions, gif_load, imagemagick_image_p)
1128 (imagemagick_load_image, imagemagick_load, svg_image_p)
1129 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1130 (gs_load):
1131 * nsimage.m (ns_load_image):
1132 * nsterm.m (ns_defined_color):
1133 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1134 * xfns.c (x_defined_color):
1135 * xterm.c (x_alloc_lighter_color_for_widget)
1136 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1137 (x_alloc_lighter_color):
1138 * indent.c (disptab_matches_widthtab, current_column)
1139 (scan_for_column, string_display_width, indented_beyond_p)
1140 (compute_motion, vmotion, Fvertical_motion):
1141 Use bool for booleans.
1142
1143 2012-09-24 Chong Yidong <cyd@gnu.org>
1144
1145 * chartab.c (Fset_char_table_default): Obsolete function removed.
1146
1147 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1148
1149 Move pid_t related decls out of lisp.h.
1150 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1151 (interruptible_wait_for_termination):
1152 Move these decls from lisp.h to syswait.h, since they use pid_t.
1153 Needed on FreeBSD; see Herbert J. Skuhra in
1154 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1155 * callproc.c: Include syswait.h.
1156
1157 gnutls.c, gtkutil.c: Use bool for boolean.
1158 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1159 (emacs_gnutls_handle_error):
1160 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1161 (xg_hide_tooltip, xg_create_frame_widgets)
1162 (create_dialog, xg_uses_old_file_dialog)
1163 (xg_get_file_with_chooser, xg_get_file_with_selection)
1164 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1165 (xg_item_label_same_p, xg_update_menubar)
1166 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1167 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1168 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1169 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1170 (update_frame_tool_bar, free_frame_tool_bar):
1171 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1172 * nsmenu.m (ns_update_menubar):
1173 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1174 * xfns.c (Fx_show_tip) [USE_GTK]:
1175 Use bool for boolean.
1176 * gtkutil.c (xg_update_frame_menubar):
1177 * xmenu.c (update_frame_menubar):
1178 Return void, not int, since caller ignores return value.
1179 * gtkutil.c (xg_change_toolbar_position):
1180 Return void, not 1.
1181
1182 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1183
1184 * makefile.w32-in (BLOCKINPUT_H): Remove.
1185 (SYSSIGNAL_H): New macro.
1186 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1187 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1188 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1189 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1190 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1191 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1192 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1193 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1194 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1195 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1196 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1197 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1198 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1199 ($(BLD)/w32xfns.$(O)): Update dependencies.
1200
1201 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1202
1203 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1204 fatal_error_backtrace.
1205
1206 * w32proc.c (sys_kill): Undo last change: don't do anything when
1207 invoked to deliver SIGABRT to our own process. This is now
1208 handled by emacs_raise.
1209
1210 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1211
1212 * w32term.c (w32_read_socket): Remove leftover reference to
1213 interrupt_input_pending.
1214
1215 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1216
1217 Do not use SA_NODEFER.
1218 Problem reported by Dani Moncayo in
1219 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1220 * alloc.c (die):
1221 * sysdep.c (emacs_abort): Do not reset signal handler.
1222 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1223 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1224 wanted even on POSIXish hosts, and it doesn't work on Windows.
1225
1226 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1227
1228 * xterm.c (x_term_init): Call fixup_locale before and after calling
1229 gtk_init (Bug#12392).
1230
1231 2012-09-23 Chong Yidong <cyd@gnu.org>
1232
1233 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1234 Vdynamic_library_alist.
1235
1236 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1237 (Fgnutls_available_p): Caller changed.
1238
1239 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1240 (Flibxml_parse_xml_region): Likewise.
1241
1242 * dispextern.h (struct image_type): Remove arg from init function.
1243
1244 * image.c (Finit_image_library, lookup_image_type)
1245 (define_image_type): Remove now-unneeded second arg.
1246 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1247 (init_tiff_functions, init_gif_functions, init_svg_functions):
1248 Arglist and w32_delayed_load calling convention changed.
1249 (gs_type): Remove init_gs_functions; there is no such function.
1250 (valid_image_p, make_image): Fix caller to lookup_image_type.
1251
1252 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1253
1254 Simplify and avoid signal-handling races (Bug#12471).
1255 * alloc.c (die):
1256 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1257 Avoid recursive loop if there's a fatal error in the function itself.
1258 * atimer.c (pending_atimers):
1259 * blockinput.h: Don't include "atimer.h"; no longer needed.
1260 (interrupt_input_pending): Remove. All uses removed.
1261 pending_signals now counts both atimers and ordinary interrupts.
1262 This is less racy than having three separate pending-signal flags.
1263 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1264 (input_blocked_p):
1265 Rename from their upper-case counterparts BLOCK_INPUT,
1266 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1267 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1268 This makes it easier to access volatile variables more accurately.
1269 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1270 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1271 that's more reliable if the code is buggy and sets
1272 interrupt_input_blocked to a negative value. All uses changed.
1273 * atimer.c (deliver_alarm_signal):
1274 Remove. No need to deliver this to the parent; any thread can
1275 handle this signal now. All uses replaced by underlying handler.
1276 * atimer.c (turn_on_atimers):
1277 * dispnew.c (handle_window_change_signal):
1278 * emacs.c (handle_danger_signal):
1279 * keyboard.c (kbd_buffer_get_event):
1280 Don't reestablish signal handler; not needed with sigaction.
1281 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1282 (UNBLOCK_INPUT_TO):
1283 Rework to avoid unnecessary accesses to volatile variables.
1284 (UNBLOCK_INPUT_TO): Now a function.
1285 (totally_unblock_input, unblock_input): New decls.
1286 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1287 (init_data): Remove. Necessary stuff now done in init_signal.
1288 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1289 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1290 (fatal_error_code): Remove; no longer needed.
1291 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1292 it doesn't always backtrace. All uses changed. No need to reset
1293 signal to default, since sigaction and/or die does that for us now.
1294 Use emacs_raise (FOO), not kill (getpid (), FOO).
1295 (main): Check more-accurately whether we're dumping.
1296 Move fatal-error setup to sysdep.c
1297 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1298 * gtkutil.c (xg_get_file_name, xg_get_font):
1299 Remove no-longer-needed signal-mask manipulation.
1300 * keyboard.c, process.c (POLL_FOR_INPUT):
1301 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1302 * keyboard.c (read_avail_input): Remove.
1303 All uses replaced by gobble_input.
1304 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1305 (kbd_buffer_store_event_hold, gobble_input):
1306 (record_asynch_buffer_change) [USABLE_SIGIO]:
1307 (store_user_signal_events):
1308 No need to mess with signal mask.
1309 (gobble_input): If blocking input and there are terminals, simply
1310 set pending_signals to 1 and return. All hooks changed to not
1311 worry about whether input is blocked.
1312 (process_pending_signals): Clear pending_signals before processing
1313 them, in case a signal comes in while we're processing.
1314 By convention callers now test pending_signals before calling us.
1315 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1316 New functions, to support changes to blockinput.h.
1317 (handle_input_available_signal): Now extern.
1318 (reinvoke_input_signal): Remove. All uses replaced by
1319 handle_async_input.
1320 (quit_count): Now volatile, since a signal handler uses it.
1321 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1322 All callers changed. Block SIGINT only if not already blocked.
1323 Clear sigmask reliably, even if Fsignal returns, which it can.
1324 Omit unnecessary accesses to volatile var.
1325 (quit_throw_to_read_char): No need to restore sigmask.
1326 * keyboard.c (gobble_input, handle_user_signal):
1327 * process.c (wait_reading_process_output):
1328 Call signal-handling code rather than killing ourselves.
1329 * lisp.h: Include <float.h>, for...
1330 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1331 (pending_signals): Now volatile.
1332 (syms_of_data): Now const if IEEE floating point.
1333 (handle_input_available_signal) [USABLE_SIGIO]:
1334 (terminate_due_to_signal, record_child_status_change): New decls.
1335 * process.c (create_process): Avoid disaster if memory is exhausted
1336 while we're processing a vfork, by tightening the critical section
1337 around the vfork.
1338 (send_process_frame, process_sent_to, handle_pipe_signal)
1339 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1340 ignores SIGPIPE.
1341 (send_process): No need for setjmp/longjmp any more, since the
1342 SIGPIPE stuff is now gone. Instead, report an error if errno
1343 is EPIPE.
1344 (record_child_status_change): Now extern. PID and W are now args.
1345 Return void, not bool. All callers changed.
1346 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1347 Remove. All uses removed. This bug should be fixed now in a
1348 different way.
1349 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1350 and record the child status change directly. This avoids the
1351 need to futz with the signal mask.
1352 (process_fatal_action): Move here from emacs.c.
1353 (emacs_sigaction_flags): New function, containing
1354 much of what used to be in emacs_sigaction_init.
1355 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1356 caught by emacs, to make races less likely.
1357 (deliver_process_signal): Rename from handle_on_main_thread.
1358 All uses changed.
1359 (BACKTRACE_LIMIT_MAX): Now at top level.
1360 (thread_backtrace_buffer, threadback_backtrace_pointers):
1361 New static vars.
1362 (deliver_thread_signal, deliver_fatal_thread_signal):
1363 New functions, for more-accurate delivery of thread-specific signals.
1364 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1365 (deliver_arith_signal): Handle in this thread, not
1366 in the main thread, since it's triggered by this thread.
1367 (maybe_fatal_sig): New function.
1368 (init_signals): New arg DUMPING so that we can be more accurate
1369 about whether we're dumping. Caller changed.
1370 Treat thread-specific signals differently from process-general signals.
1371 Block all signals while handling fatal error; that's safer.
1372 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1373 on IEEE hosts.
1374 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1375 Ignore SIGPIPE unless batch.
1376 (emacs_backtrace): Output backtrace for the appropriate thread,
1377 which is not necessarily the main thread.
1378 * syssignal.h: Include <stdbool.h>.
1379 (emacs_raise): New macro.
1380 * xterm.c (x_connection_signal): Remove; no longer needed
1381 now that we use sigaction.
1382 (x_connection_closed): No need to mess with sigmask now.
1383 (x_initialize): No need to reset SIGPIPE handler here, since
1384 init_signals does this for us now.
1385
1386 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1387
1388 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1389 background rect may be larger (Bug#12245).
1390
1391 2012-09-23 Chong Yidong <cyd@gnu.org>
1392
1393 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1394
1395 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1396
1397 * .gdbinit: Just stop at fatal_error_backtrace.
1398 See Stefan Monnier's request in
1399 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1400 Remove no-longer-used query of system type.
1401
1402 2012-09-22 Chong Yidong <cyd@gnu.org>
1403
1404 * search.c (Freplace_match): Doc fix (Bug#12325).
1405
1406 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1407
1408 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1409 (Fline_end_position): Doc fix.
1410
1411 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1412
1413 2012-09-22 Chong Yidong <cyd@gnu.org>
1414
1415 * dispextern.h (struct image_type): Add new slot, storing a type
1416 initialization function.
1417
1418 * image.c (define_image_type): Call the image initializer function
1419 if it is defined. Arguments and return value changed.
1420 (valid_image_p, make_image): Callers changed.
1421 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1422 (gif_type, imagemagick_type, svg_type, gs_type):
1423 Add initialization functions.
1424 (Finit_image_library): Call lookup_image_type.
1425 (CHECK_LIB_AVAILABLE): Macro deleted.
1426 (lookup_image_type): Call define_image_type here, rather than via
1427 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1428 (syms_of_image): Move define_image_type calls for xbm_type and
1429 pbm_type to lookup_image_type.
1430
1431 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1432
1433 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1434 'idle_timers' from here ...
1435 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1436 lists, to avoid infloops when the timer does something stupid,
1437 like reinvoke itself with the same or smaller time-out.
1438 (Bug#12447)
1439
1440 2012-09-22 Martin Rudalics <rudalics@gmx.at>
1441
1442 * window.c (Fsplit_window_internal): Handle only Qt value of
1443 Vwindow_combination_limit separately.
1444 (Qtemp_buffer_resize): New symbol.
1445 (Vwindow_combination_limit): New default value.
1446 Rewrite doc-string.
1447
1448 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1449
1450 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1451 the new overlay string. (Bug#10159)
1452
1453 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1454
1455 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1456 or that fprintf is async-signal-safe. POSIX doesn't require
1457 either assumption.
1458
1459 2012-09-22 Chong Yidong <cyd@gnu.org>
1460
1461 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1462 (Bug#8207).
1463
1464 2012-09-22 Kenichi Handa <handa@gnu.org>
1465
1466 * composite.c (composition_reseat_it): Handle the case that a
1467 grapheme cluster is not covered by a single font (Bug#12352).
1468
1469 2012-09-21 Chong Yidong <cyd@gnu.org>
1470
1471 * image.c (define_image_type): Avoid adding duplicate types to
1472 image_types (Bug#12463). Suggested by Jörg Walter.
1473
1474 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1475
1476 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1477 (print_load_command_name): Add case LC_DATA_IN_CODE.
1478 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1479
1480 2012-09-21 Glenn Morris <rgm@gnu.org>
1481
1482 * eval.c (Frun_hook_with_args_until_success)
1483 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1484
1485 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1486
1487 * fileio.c (Ffile_selinux_context): Only call freecon when
1488 lgetfilecon succeeded.
1489 (Fset_file_selinux_context): Likewise. (Bug#12444)
1490
1491 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1492
1493 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1494 reordering, locate the cursor by calling set_cursor_from_row; if
1495 that fails, clear the desired glyph matrix before returning a
1496 failure indication to the caller. Fixes leaving garbled display
1497 when fast scrolling with a down-key. (Bug#12403)
1498 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1499 scrolling through multibyte text.
1500
1501 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1502
1503 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1504 calling mark_vectorlike since that's the one that marks the window.
1505 (mark_discard_killed_buffers): Mark the final cdr.
1506 * window.h (struct window): Move prev/next_buffers to the
1507 non-standard fields.
1508 * window.c (make_window): Initialize prev/next_buffers manually.
1509
1510 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1511
1512 Omit unused arg EXPECTED from socket hooks.
1513 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1514 * nsterm.m (ns_term_init):
1515 * termhooks.h (struct terminal.read_socket_hook):
1516 * w32inevt.c (w32_console_read_socket):
1517 * w32term.c (w32_read_socket):
1518 * xterm.c (XTread_socket):
1519 Omit unused arg EXPECTED. All callers changed.
1520 (store_user_signal_events): Return void, not int, since callers no
1521 longer care about the return value. All uses changed.
1522
1523 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
1524
1525 * w32gui.h (XParseGeometry): Do not declare.
1526
1527 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1528
1529 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1530 Ignore 'expected'. See Eli Zaretskii in
1531 <http://bugs.gnu.org/12471#8> (last line).
1532
1533 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1534 (XParseGeometry): Now static. Substitute extremal values for
1535 values that are out of range.
1536
1537 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1538
1539 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1540
1541 * nsfns.m (XParseGeometry): Remove.
1542 (Fx_create_frame): Call x_set_offset to correctly interpret
1543 top_pos in geometry.
1544
1545 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1546 (Fx_parse_geometry): If there is a space in string, call
1547 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1548
1549 2012-09-17 Eli Zaretskii <eliz@gnu.org>
1550
1551 * search.c (scan_buffer): Use character positions in calls to
1552 region_cache_forward and region_cache_backward, not byte
1553 positions. (Bug#12196)
1554
1555 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1556 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1557
1558 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1559 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1560 emacs_blocked_malloc, now deleted.
1561
1562 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1563
1564 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1565 The workaround was for improving performance on Solaris 2.4, but
1566 is getting in the way now. Emacs will still work if someone is
1567 still running Solaris 2.4 in a museum somewhere; Sun dropped
1568 support for Solaris 2.4 in 2003.
1569 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1570 * process.c (create_process) [HAVE_WORKING_VFORK]:
1571 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1572 since Emacs no longer uses vfork on that platform.
1573
1574 2012-09-17 Glenn Morris <rgm@gnu.org>
1575
1576 * emacs.c: Use COPYRIGHT.
1577
1578 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1579
1580 Remove configure's --without-sync-input option (Bug#12450).
1581 When auditing signal-handling in preparation for cleaning it up,
1582 I found that SYNC_INPUT has race conditions and would be a real
1583 pain to fix. Since it's an undocumented and deprecated
1584 configure-time option, now seems like a good time to remove it.
1585 Also see <http://bugs.gnu.org/11080#16>.
1586 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1587 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1588 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1589 (malloc_hysteresis):
1590 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1591 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1592 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1593 (dont_register_blocks, bytes_used_when_reconsidered)
1594 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1595 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1596 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1597 Remove. All uses removed.
1598 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1599 implementation, one that depends on whether the new macro
1600 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1601 is defined.
1602 * atimer.c (run_timers, handle_alarm_signal):
1603 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1604 (handle_async_input, process_pending_signals)
1605 (handle_input_available_signal, init_keyboard):
1606 * nsterm.m (ns_read_socket):
1607 * process.c (wait_reading_process_output):
1608 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1609 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1610 (emacs_write):
1611 * xterm.c (XTread_socket):
1612 Assume SYNC_INPUT.
1613 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1614 * eval.c (handling_signal): Remove. All uses removed.
1615 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1616 All uses replaced with the SYNC_INPUT version.
1617 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1618 Remove decls.
1619 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1620 Now static.
1621
1622 * font.c (Ffont_shape_gstring): Remove unused local.
1623
1624 2012-09-16 Glenn Morris <rgm@gnu.org>
1625
1626 * Makefile.in (clean): No longer run nextstep's clean.
1627
1628 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1629 (ns_frag): Remove.
1630 (ns-app): Move here from ns.mk, and simplify.
1631 (clean): Simplify nextstep entry.
1632 * ns.mk: Remove file.
1633
1634 2012-09-17 Kenichi Handa <handa@gnu.org>
1635
1636 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1637 not covert the last few charactes.
1638
1639 2012-09-16 Kenichi Handa <handa@gnu.org>
1640
1641 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1642 here, but just check the validity of glyphs in the glyph-string.
1643
1644 2012-09-16 Martin Rudalics <rudalics@gmx.at>
1645
1646 * window.c (Fwindow_parameter, Fset_window_parameter):
1647 Accept any window as argument (Bug#12452).
1648
1649 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1650
1651 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1652 to ns_term_init to avoid memory leak.
1653
1654 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1655 explicit retain/release.
1656 (ns_term_init): Only allow one display. Initialize outerpool and
1657 ns_*_types.
1658
1659 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1660
1661 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1662 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1663 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1664 the Microsoft problem in a different way, by altering ../nt/config.nt.
1665
1666 2012-09-15 Eli Zaretskii <eliz@gnu.org>
1667
1668 * w32xfns.c:
1669 * w32uniscribe.c:
1670 * w32term.c:
1671 * w32select.c:
1672 * w32reg.c:
1673 * w32proc.c:
1674 * w32menu.c:
1675 * w32inevt.c:
1676 * w32heap.c:
1677 * w32font.c:
1678 * w32fns.c:
1679 * w32console.c:
1680 * w32.c:
1681 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1682 by lisp.h. This completes removal of setjmp.h inclusion
1683 erroneously announced in the previous commit. (Bug#12446)
1684
1685 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1686 more accurate.
1687
1688 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1689 not defined as a macro. The latter happens on MS-Windows.
1690 (Bug#12446)
1691
1692 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1693
1694 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1695 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1696 Some instances of '#include <setjmp.h>' removed, if the
1697 only reason for the instance was because "lisp.h" was included.
1698 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1699 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1700 and _longjmp with the new symbols. Emacs already uses _setjmp if
1701 available, so this change affects only POSIXish hosts that have
1702 sigsetjmp but not _setjmp, such as some versions of Solaris and
1703 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1704 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1705 (png_load_body) [HAVE_PNG]:
1706 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1707 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1708 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1709 since PNG requires jmp_buf. This is the only exception to the
1710 general rule that we now use sys_setjmp and sys_longjmp.
1711 This exception is OK since this code does not change the signal
1712 mask or longjmp out of a signal handler.
1713
1714 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1715
1716 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1717 Include "syssignal.h", for 'main_thread'.
1718
1719 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1720
1721 Avoid out-of-range marker position (Bug#12426).
1722 * insdel.c (replace_range, replace_range_2):
1723 Adjust markers before overlays, as suggested by comments.
1724 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1725 Remove redundant check before calling offset_intervals.
1726
1727 2012-09-14 Martin Rudalics <rudalics@gmx.at>
1728
1729 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1730 current buffer (Bug#12387).
1731
1732 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
1733
1734 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1735
1736 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1737
1738 Use a more backwards-compatible timer format (Bug#12430).
1739 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1740 vector element, not from the 4th, since PSECS is now at the end.
1741 (Fcurrent_idle_time): Doc fix.
1742
1743 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1744
1745 Function to mark objects and remove killed buffers at once.
1746 * alloc.c (discard_killed_buffers): Rename to ...
1747 (mark_discard_killed buffers) ... new name. Add marking
1748 of remaining objects. Fix comment. Adjust users.
1749 (mark_object): Do not touch frame buffer lists here.
1750 * frame.c (delete_frame): Reset frame buffer lists here.
1751
1752 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1753
1754 Better workaround for GNOME bug when --enable-gcc-warnings.
1755 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1756 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1757 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1758
1759 Simplify SIGIO usage (Bug#12408).
1760 The code that dealt with SIGIO was crufty and confusing, e.g., it
1761 played tricks like "#undef SIGIO" but these tricks were not used
1762 consistently. Simplify mostly by not #undeffing standard symbols,
1763 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1764 or not as we please) rather than "defined SIGIO" (standard symbol
1765 that we probably shouldn't #undef).
1766 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1767 Modules that need it can include it.
1768 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1769 * dispextern.h (ignore_sigio): New decl.
1770 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1771 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1772 * emacs.c (shut_down_emacs):
1773 * keyboard.c (kbd_buffer_store_event_hold):
1774 Use ignore_sigio rather than invoking 'signal' directly.
1775 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1776 for FIONREAD.
1777 (FIONREAD, SIGIO): Do not #undef.
1778 (tty_read_avail_input): Use #error rather than a syntax error.
1779 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1780 for I_PIPE, used by SETUP_SLAVE_PTY.
1781 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1782 * sysdep.c (croak): Remove; no longer needed. This bit of
1783 temporary code, with Fred N. Fish's comment that it's temporary,
1784 has been in Emacs since at least 1992!
1785 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1786 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1787 * syssignal.h (croak): Remove decl.
1788 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1789 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1790 now that we're termios-only.
1791 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1792 * term.c (dissociate_if_controlling_tty): Use #error rather than
1793 a run-time error.
1794
1795 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1796 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1797 to work around GNOME bug 683906.
1798 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1799 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1800 This works around GCC bug 54561.
1801
1802 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1803
1804 More fixes for 'volatile' and setjmp/longjmp.
1805 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1806 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1807 (png_load_body) [HAVE_PNG]:
1808 (jpeg_load_body) [HAVE_JPEG]:
1809 New function, with most of the old parent function's body.
1810 (png_load) [HAVE_PNG]:
1811 (jpeg_load) [HAVE_JPEG]:
1812 Invoke the new function, to avoid longjmp munging our locals.
1813 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1814 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1815 longjmp is passed 2, as the C standard doesn't guarantee this.
1816 Instead, store the failure code into mgr->failure_code.
1817
1818 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1819
1820 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1821 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1822 (syms_of_keyboard): Remove support for unread-command-char.
1823
1824 2012-09-12 Eli Zaretskii <eliz@gnu.org>
1825
1826 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1827 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1828 violation. (Bug#12426)
1829
1830 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1831
1832 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1833
1834 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1835
1836 * eval.c: Add `inhibit-debugger'.
1837 (Qinhibit_debugger): New symbol.
1838 (call_debugger): Bind it instead of Qdebug_on_error.
1839 (maybe_call_debugger): Test Vinhibit_debugger.
1840 (syms_of_eval): Define inhibit-debugger.
1841 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1842 (syms_of_xdisp): Remove inhibit-debug-on-message.
1843
1844 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1845
1846 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1847 If a nonvolatile local variable is written before a _longjmp to
1848 the frame containing the variable, and is read after the _longjmp,
1849 the value read is indeterminate. Some local variables of type
1850 'struct handler' and 'struct catchtag' are used in this way, so
1851 mark each of their slots as volatile if the slot can be set before
1852 _longjmp and read afterwards.
1853 * lisp.h (struct handler): var and chosen_clause are now volatile.
1854 (struct catchtag): val, next, and pdlcount are now volatile.
1855
1856 * bidi.c (bidi_push_it, bidi_pop_it):
1857 * fns.c (copy_hash_table):
1858 * image.c (define_image_type):
1859 * keyboard.c (kbd_buffer_store_event_hold):
1860 * process.c (Fprocess_send_eof):
1861 * xfaces.c (x_create_gc) [HAVE_NS]:
1862 * xgselect.c (xg_select):
1863 Prefer assignment to memcpy when either will do.
1864
1865 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1866 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1867 time an item is removed. No need to mark this function 'inline';
1868 the compiler knows better than we do.
1869
1870 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1871
1872 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1873 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1874 to change_frame_size (Bug#12388).
1875 (windowDidResize:): Pass YES to updateFrameSize.
1876
1877 * nsterm.h: Add delay parameter to updateFrameSize.
1878
1879 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1880
1881 Discard killed buffers from deleted window and frame objects.
1882 This reduces an amount of references to killed buffers and
1883 helps GC to reclaim them faster.
1884 * alloc.c (discard_killed_buffers): New function.
1885 (mark_object): Use it for deleted windows and frames.
1886 (mark_object): If symbol's value is set up for a killed buffer
1887 or deleted frame, restore it's global binding.
1888 * data.c (swap_in_global_binding): Add GC notice.
1889 (swap_in_symval_forwarding): Use convenient set_blv_where.
1890 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1891 * window.h: ... to here.
1892
1893 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1894
1895 Convenient macro to check whether the buffer is live.
1896 * buffer.h (BUFFER_LIVE_P): New macro.
1897 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1898 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1899
1900 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1901
1902 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1903 composition cases (Bug#12364).
1904
1905 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1906 overhang of succeeding glyphs overlapping box cursor.
1907
1908 * w32term.c (x_draw_glyph_string): Likewise.
1909
1910 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1911
1912 Simplify, document, and port floating-point (Bug#12381).
1913 The porting part of this patch fixes bugs on non-IEEE platforms
1914 with frexp, ldexp, logb.
1915 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1916 Now static.
1917 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1918 support, by removing commented-out code and briefly listing the
1919 C89 functions excluded. The commented-out stuff was confusing
1920 maintenance, e.g., we thought we needed cbrt but it was commented out.
1921 (logb): Remove decl; no longer needed.
1922 (isfinite): New macro, if not already supplied.
1923 (isnan): Don't replace any existing macro.
1924 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1925 are present on all C89 platforms.
1926 (Ffrexp): Do not special-case zero, as frexp does the right thing
1927 for that case.
1928 (Flogb): Do not use logb, as it doesn't have the desired meaning
1929 on hosts that use non-base-2 floating point. Instead, stick with
1930 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1931 frexp, to avoid getting an unspecified result.
1932
1933 * xdisp.c (Qinhibit_debug_on_message): Now static.
1934
1935 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1936
1937 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1938 NSBezierPath (Bug#12131).
1939
1940 2012-09-10 Chong Yidong <cyd@gnu.org>
1941
1942 * fns.c (Fdelq, Fdelete): Doc fix.
1943
1944 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1945
1946 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1947 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1948
1949 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1950
1951 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1952 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1953 Use it.
1954
1955 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1956
1957 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1958 left fringe if the window has a left margin. This avoids leaving
1959 traces of the cursor because its leftmost pixel is not drawn over.
1960
1961 * dispnew.c (update_window_line): When the left margin area of a
1962 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1963 that screen line. (Bug#12277)
1964
1965 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1966
1967 Assume C89 or later for math functions (Bug#12381).
1968 This simplifies the code, and makes it a bit smaller and faster,
1969 and (most important) makes it easier to clean up signal handling
1970 since we can stop worring about floating-point exceptions in
1971 library code. That was a problem before C89, but the problem
1972 went away many years ago on all practical Emacs targets.
1973 * data.c, image.c, lread.c, print.c:
1974 Don't include <math.h>; no longer needed.
1975 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1976 might be autoconfigured, as that never happens.
1977 * data.c (fmod):
1978 * doprnt.c (DBL_MAX_10_EXP):
1979 * print.c (DBL_DIG):
1980 Remove. C89 or later always defines these.
1981 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1982 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1983 (arith_error, domain_error, domain_error2):
1984 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1985 no longer needed -- we simply return what C returns. All uses removed.
1986 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1987 the wrapped code.
1988 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1989 Remove. All uses expanded, as these macros are no longer used
1990 more than once and are now more trouble than they're worth.
1991 (Ftan): Use tan, not sin / cos.
1992 (Flogb): Assume C89 frexp.
1993 (fmod_float): Assume C89 fmod.
1994 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1995 (init_floatfns): Remove. All uses removed.
1996
1997 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1998
1999 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2000 compositeToPoint for OSX < 10.6 (Bug#12390).
2001
2002 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2003
2004 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2005 This produces more-accurate results.
2006
2007 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2008
2009 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2010 changes (Bug#12088).
2011
2012 2012-09-08 Chong Yidong <cyd@gnu.org>
2013
2014 * syntax.c (Fstring_to_syntax): Doc fix.
2015
2016 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2017
2018 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2019 in the internal border.
2020 (x_set_window_size): Remove static variables and their usage.
2021 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2022 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2023 Remove fringe/internal border adjustment (Bug#11052).
2024 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2025 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2026 (ns_fix_rect_ibw): Remove.
2027 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2028 (ns_dumpglyphs_box_or_relief): Ditto.
2029 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2030 adjustment.
2031 (ns_dumpglyphs_image): Ditto.
2032 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2033 border adjustment.
2034 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2035 their usage. Add fringe_extended_p and its use as in other terms.
2036 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2037 scroll bar was removed.
2038 (updateFrameSize): New function.
2039 (windowDidResize): Move code to updateFrameSize and call it.
2040
2041 * nsterm.h (EmacsView): Add updateFrameSize.
2042
2043 2012-09-07 Chong Yidong <cyd@gnu.org>
2044
2045 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2046
2047 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2048
2049 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2050
2051 More signal-handler cleanup (Bug#12327).
2052 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2053 Problem introduced when merging patches. Noted by Eli Zaretskii in
2054 <http://bugs.gnu.org/12327#67>.
2055 * floatfns.c: Comment fix.
2056 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2057 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2058 and anyway the declaration is harmless even if SIGDANGER is not defined.
2059 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2060 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2061 source files not surprisingly expected syssignal.h to define, or
2062 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2063 Include <sys/ioctl.h>, for FIONREAD.
2064 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2065 This eliminates a problem whereby other files mysteriously had
2066 to include "syssignal.h" before including "systty.h" if they
2067 wanted to use "#ifdef SIGIO".
2068
2069 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2070
2071 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2072
2073 * w32.c (sigemptyset): Empty the set.
2074 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2075
2076 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2077
2078 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2079
2080 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2081 (mark_object): Likewise for frame objects.
2082
2083 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2084
2085 * syssignal.h (handle_on_main_thread): Always declare,
2086 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2087 This ports to platforms without HAVE_PTHREAD.
2088
2089 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2090
2091 Signal-handler cleanup (Bug#12327).
2092 Emacs's signal handlers were written in the old 4.2BSD style with
2093 sigblock and sigmask and so forth, and this led to some
2094 inefficiencies and confusion. Rewrite these to use
2095 pthread_sigmask etc. without copying signal sets around. Also,
2096 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2097 'signal', and instead use functions that do not attempt to take
2098 over the system name space. This patch causes Emacs's text
2099 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2100 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2101 Do not include <signal.h> or "syssignal.h", as these
2102 modules do not use signals.
2103 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2104 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2105 Do not include <signal.h>, as "syssignal.h" does that for us now.
2106 * atimer.c (sigmask_atimers): New function.
2107 (block_atimers, unblock_atimers): New functions,
2108 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2109 All uses replaced.
2110 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2111 no longer needed here.
2112 * emacs.c (main): Inspect existing signal handler with sigaction,
2113 so that there's no need to block and unblock SIGHUP.
2114 * sysdep.c (struct save_signal): New member 'action', replacing
2115 old member 'handler'.
2116 (save_signal_handlers, restore_signal_handlers):
2117 Use sigaction instead of 'signal' to save and restore.
2118 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2119 New function. All users of 'signal' modified to use set_sighandler
2120 if they're writeonly, and to use sys_signal if they're read+write.
2121 (emacs_sigaction_init, forwarded_signal): New functions.
2122 (sys_signal): Remove. All uses replaced by calls to sigaction
2123 and emacs_sigaction_init, or by direct calls to 'signal'.
2124 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2125 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2126 all uses replaced by pthread_sigmask etc. calls.
2127 * syssignal.h: Include <signal.h>.
2128 (emacs_sigaction_init, forwarded_signal): New decls.
2129 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2130 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2131 (sigmask, sys_sigmask): Remove; no longer needed.
2132 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2133 (sigblock, sigunblock, sigfree):
2134 (sigsetmask) [!defined sigsetmask]:
2135 Remove. All uses replaced by pthread_sigmask.
2136 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2137 no longer need to be replaced, and its typical old uses
2138 are now done via emacs_sigaction_init and sigaction.
2139 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2140 (sys_sigdel): Remove; unused.
2141 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2142
2143 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2144
2145 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2146 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2147
2148 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2149
2150 Explicitly mark buffer_defaults and buffer_local_symbols.
2151 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2152 mark_local_symbols here.
2153 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2154 since special buffers aren't marked here any more.
2155 (allocate_buffer): Chain new buffer with all_buffers here...
2156 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2157 not here.
2158 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2159 (syms_of_buffer): Remove staticpro of the above.
2160 (init_buffer_once): Set names for buffer_defaults and
2161 buffer_local_symbols.
2162
2163 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2164
2165 Use bool for booleans in font-related modules.
2166 * font.c (font_intern_prop, font_style_to_value)
2167 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2168 (generate_otf_features, font_check_otf_features, font_check_otf)
2169 (font_match_p, font_list_entities, font_at):
2170 * fontset.c (fontset_id_valid_p, reorder_font_vector
2171 (fontset_find_font, Fset_fontset_font)
2172 (face_suitable_for_char_p) [0]:
2173 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2174 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2175 (m17n_flt_initialized, ftfont_shape_by_flt):
2176 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2177 * nsfont.m (nsfont_draw):
2178 * w32font.c (w32font_draw):
2179 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2180 Use bool for booleans.
2181 * font.h: Adjust to above API changes.
2182 (struct font, struct font_driver, struct font_driver_list):
2183 Use bool for booleans.
2184 (struct font): Remove useless member encoding_type.
2185 All users removed.
2186 * fontset.c, xftfont.c: Omit unnecessary static decls.
2187
2188 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2189
2190 * alloc.c (mark_object): Revert window marking code
2191 since it's unsafe for the Fset_window_configuration.
2192
2193 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2194
2195 Fix race conditions with signal handlers and errno (Bug#12327).
2196 Be more systematic about preserving errno whenever a signal
2197 handler returns, even if it's not in the main thread. Do this by
2198 renaming signal handlers to distinguish between signal delivery
2199 and signal handling. All uses changed.
2200 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2201 * data.c (deliver_arith_signal): Rename from arith_error.
2202 * dispnew.c (deliver_window_change_signal): Rename from
2203 window_change_signal.
2204 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2205 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2206 * keyboard.c (deliver_input_available_signal): Rename from
2207 input_available_signal.
2208 (deliver_user_signal): Rename from handle_user_signal.
2209 (deliver_interrupt_signal): Rename from interrupt_signal.
2210 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2211 (deliver_child_signal): Rename from sigchld_handler.
2212 * atimer.c (handle_alarm_signal):
2213 * data.c (handle_arith_signal):
2214 * dispnew.c (handle_window_change_signal):
2215 * emacs.c (handle_fatal_signal, handle_danger_signal):
2216 * keyboard.c (handle_input_available_signal):
2217 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2218 * process.c (handle_pipe_signal, handle_child_signal):
2219 New functions, with the actual signal-handling code taken from the
2220 original respective signal handlers, sans the sporadic attempts to
2221 preserve errno, since that's now done by handle_on_main_thread.
2222 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2223 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2224 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2225 Move to sysdep.c.
2226 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2227 Move initialization of main_thread to sysdep.c's init_signals.
2228 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2229 our usage, and simplifies the mainline code.
2230 (record_child_status_change): New static function, as a helper
2231 for handle_child_signal, and with most of the old child handler's
2232 contents.
2233 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2234 (handle_child_signal): Use the above.
2235 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2236 Moved here from emacs.c.
2237 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2238 code moved here from emacs.c's main function.
2239 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2240 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2241 This lets callers save and restore errno properly.
2242
2243 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2244
2245 Remove redundant or unused things here and there.
2246 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2247 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2248 * editfns.c (Fcompare_buffer_substrings): Likewise.
2249 * frame.h (struct terminal, struct font_driver_list):
2250 Remove redundant declarations.
2251 * window.h (Qleft, Qright): Likewise.
2252
2253 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2254
2255 Do not mark objects from deleted buffers, windows and frames.
2256 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2257 (mark_object): Likewise for windows and frames.
2258
2259 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2260
2261 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2262 buffer_defaults and buffer_local_symbols as valid objects.
2263 Return special value to denote them.
2264
2265 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2266
2267 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2268 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2269 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2270 (file_name_absolute_p, Fsubstitute_in_file_name):
2271 (check_executable, check_writable, Ffile_accessible_directory_p)
2272 (Fset_file_selinux_context, Fdefault_file_modes)
2273 (Finsert_file_contents, choose_write_coding_system)
2274 (Fwrite_region, build_annotations, a_write, e_write)
2275 (Fdo_auto_save):
2276 * filelock.c (boot_time_initialized, get_boot_time)
2277 (get_boot_time_1, lock_file_1, within_one_second):
2278 * floatfns.c (in_float):
2279 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2280 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2281 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2282 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2283 * window.c (compare_window_configurations):
2284 Use bool for booleans.
2285 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2286 (Fdefault_file_modes): Now mode_t, not int, for modes.
2287 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2288 (internal_delete_file): Now returns void, not a (boolean) int,
2289 since nobody was looking at the return value.
2290 * lisp.h, window.h: Adjust to above API changes.
2291
2292 * xdisp.c (set_message): Simplify and reindent last change.
2293
2294 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2295
2296 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2297
2298 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2299
2300 * eval.c (call_debugger): Make the function non-static so that we
2301 can call it from set_message.
2302
2303 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2304 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2305
2306 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2307
2308 Give more-useful info on a fatal error (Bug#12328).
2309 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2310 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2311 of doing the work ourselves.
2312 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2313 do most of the work.
2314 (fatal_error_backtrace): New function, taken from the guts
2315 of the old fatal_error_signal, but with a new option to output
2316 a backtrace.
2317 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2318 info about the signal than just its number.
2319 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2320 * sysdep.c: Include <execinfo.h>
2321 (emacs_backtrace): New function, taken partly from the previous
2322 code of the 'die' function.
2323 (emacs_abort): Call fatal_error_backtrace rather than abort.
2324
2325 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2326
2327 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2328 eager (load-time) macro-expansion.
2329 * lisp.mk (lisp): Add macroexp.
2330
2331 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2332
2333 Simplify redefinition of 'abort' (Bug#12316).
2334 Do not try to redefine the 'abort' function. Instead, redo
2335 the code so that it calls 'emacs_abort' rather than 'abort'.
2336 This removes the need for the NO_ABORT configure-time macro
2337 and makes it easier to change the abort code to do a backtrace.
2338 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2339 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2340 Remove; sysdep.c's emacs_abort now takes its place.
2341 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2342 'abort' changed to use 'emacs_abort'.
2343 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2344 (abort) [!defined abort]: Rename to ...
2345 (emacs_abort): ... new name.
2346 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2347 the place of the old 'abort' in emacs.c.
2348 * w32.c, w32fns.c (abort): Do not #undef.
2349 * w32.c (emacs_abort): Rename from w32_abort.
2350
2351 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2352
2353 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2354 offsets[j].dv, since the y axis of the screen coordinates points
2355 down, while the y axis of the font definition coordinates points
2356 up. This fixes display of Arabic diacritics such as KASRA and
2357 KASRATAN. (Bug#11860)
2358
2359 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2360
2361 Be more systematic about _setjmp vs setjmp.
2362 * alloc.c (test_setjmp, mark_stack):
2363 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2364 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2365 (png_load, my_error_exit, jpeg_load):
2366 * process.c (send_process_trap, send_process):
2367 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2368 The underscored versions are up to 30x faster on some hosts.
2369 Formerly, the code used setjmp+longjmp sometimes and
2370 _setjmp+_longjmp at other times, with no particular reason to
2371 prefer setjmp+longjmp.
2372
2373 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2374
2375 Fix minor problem found by static checking.
2376 * buffer.c (Fdelete_all_overlays): Return nil.
2377
2378 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2379
2380 * buffer.c (Fdelete_all_overlays): New function.
2381
2382 2012-09-03 Chong Yidong <cyd@gnu.org>
2383
2384 * gtkutil.c: Add extern decl for Qxft.
2385
2386 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2387
2388 * emacs.c, eval.c: Use bool for boolean.
2389 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2390 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2391 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2392 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2393 (main, decode_env_path, Fdaemon_initialized):
2394 * eval.c (call_debugger, Finteractive_p, interactive_p):
2395 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2396 (maybe_call_debugger, Fbacktrace):
2397 * process.c (read_process_output, exec_sentinel):
2398 Use bool for booleans.
2399 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2400 All callers changed.
2401 * eval.c (interactive_p): Omit always-true boolean argument
2402 EXCLUDE_SUBRS_P. All callers changed.
2403 * dispextern.h, lisp.h: Reflect above API changes.
2404 * firstfile.c (dummy): Use the address of 'main', whose signature
2405 won't change, instead of the address of 'initialize', whose
2406 signature just changed from int to bool.
2407 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2408 * msdos.c (fatal_error_in_progress): ... from here.
2409 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2410 of incrementing it.
2411 (redisplay_internal, unwind_redisplay): Simply clear
2412 REDISPLAYING_P when unwinding, instead of saving its previous,
2413 always-false value and then restoring it.
2414
2415 Clean up some extern decls.
2416 Mostly, this hoists extern decls out of .c files and into .h files.
2417 That way, we're more likely to catch errors if the interfaces change.
2418 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2419 declare xg_mark_data.
2420 * dispextern.h (x_frame_parm_handlers):
2421 * font.h (Qxft):
2422 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2423 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2424 (Qultra_bold, Qoblique, Qitalic):
2425 Move extern decl here from .c file.
2426 * alloc.c (xg_mark_data) [USE_GTK]:
2427 * doc.c (Qclosure):
2428 * eval.c (Qlexical_binding):
2429 * fns.c (time) [!HAVE_UNISTD_H]:
2430 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2431 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2432 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2433 * lread.c (Qinternal_interpreter_environment):
2434 * minibuf.c (Qbuffer):
2435 * process.c (QCfamily, QCfilter):
2436 * widget.c (free_frame_faces):
2437 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2438 * xfont.c (x_clear_errors):
2439 * xterm.c (x_frame_parm_handlers):
2440 Remove now-redundant extern decls.
2441 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2442 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2443 Now static.
2444 * xfaces.c: Remove unnecessary static decls.
2445 * xterm.c (updating_frame): Remove decl of nonexistent object.
2446
2447 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2448 when building globals.h, as the objects that are not built on
2449 this host are not needed to compile C files on this host.
2450
2451 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2452
2453 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2454
2455 * frame.h: Add missing prototype for x_wm_set_size_hint.
2456
2457 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2458
2459 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2460 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2461 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2462 (Fsubstitute_command_keys):
2463 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2464 (save_excursion_save, save_excursion_restore)
2465 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2466 (format_time_string, general_insert_function)
2467 (make_buffer_string, make_buffer_string_both)
2468 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2469 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2470 (copy_text, insert_1, insert_1_both, insert_from_string)
2471 (insert_from_string_before_markers, insert_from_string_1)
2472 (insert_from_buffer, insert_from_buffer_1, replace_range)
2473 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2474 (del_range_2, modify_region):
2475 * intervals.c (intervals_equal, balance_possible_root_interval)
2476 (adjust_intervals_for_insertion, merge_properties_sticky)
2477 (graft_intervals_into_buffer, lookup_char_property)
2478 (adjust_for_invis_intang, set_point_both)
2479 (get_property_and_range, compare_string_intervals)
2480 (set_intervals_multibyte_1, set_intervals_multibyte):
2481 * keyboard.c (decode_timer):
2482 Use bool for boolean.
2483 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2484 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2485
2486 2012-09-02 Chong Yidong <cyd@gnu.org>
2487
2488 * keymap.c (push_key_description): Print M-TAB as C-M-i
2489 (Bug#11758).
2490
2491 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2492
2493 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2494 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2495 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2496 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2497 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2498 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2499 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2500
2501 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2502
2503 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2504 more than one grapheme cluster passed to the shaper: compute the
2505 offset adjustment values separately for each cluster. (Bug#11860)
2506
2507 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2508 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2509 about implicit conversions from integer to pointer.
2510
2511 2012-09-01 Daniel Colascione <dancol@dancol.org>
2512
2513 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2514 system used too early.
2515
2516 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2517
2518 Better seed support for (random).
2519 * emacs.c (main): Call init_random.
2520 * fns.c (Frandom): Set the seed from a string argument, if given.
2521 Remove long-obsolete Gentzel cruft.
2522 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2523 (init_random): New function.
2524
2525 2012-09-01 Daniel Colascione <dancol@dancol.org>
2526
2527 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2528 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2529 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2530 x_wm_set_size_hint, x_query_colors, x_real_positions,
2531 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2532 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2533 all of which have been moved to common code.
2534
2535 * xfaces.c: Include TERM_HEADER instead of listing all possible
2536 window-system headers.
2537
2538 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2539 to match header.
2540
2541 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2542 directly accessing frame internals.
2543
2544 * w32font.h: Include font.h. Define syms_of_w32font and
2545 globals_of_w32font.
2546
2547 * process.c: Include TERM_HEADER instead of listing all possible
2548 window-system headers.
2549
2550 * nsterm.h: Remove declarations now in frame.h.
2551 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2552
2553 * menu.c: Include TERM_HEADER instead of listing all possible
2554 window-system headers.
2555
2556 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2557 window system.
2558
2559 * keyboard.c: Include TERM_HEADER instead of listing all possible
2560 window-system headers.
2561
2562 * image.c: Include TERM_HEADER instead of listing all possible
2563 window-system headers. Declare Vlibrary_cache when compiling for
2564 Windows.
2565
2566 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2567 window system declarations.
2568
2569 * frame.h: Move common functions here: set_frame_menubar,
2570 x_set_window_size, x_sync, x_get_focus_frame,
2571 x_set_mouse_position, x_set_mouse_pixel_position,
2572 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2573 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2574 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2575 x_activate_menubar, x_real_positions, x_bitmap_icon,
2576 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2577 and x_query_colors.
2578
2579 * frame.c: Include TERM_HEADER instead of listing all possible
2580 window-system headers.
2581
2582 * font.c: Include TERM_HEADER instead of listing all possible
2583 window-system headers.
2584
2585 * emacs.c: Include TERM_HEADER.
2586
2587 * dispnew.c: Include TERM_HEADER instead of listing all possible
2588 window-system headers.
2589
2590 * ccl.h: Include character.h.
2591
2592 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2593 the current window system; include in list of objects to link into
2594 Emacs.
2595
2596 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2597
2598 Remove mark_ttys function and fix tty_display_info initialization.
2599 * lisp.h (mark_ttys): Remove prototype.
2600 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2601 to mark_ttys because all possible values of 'top_frame' slot are
2602 the frames which are reachable from Vframe_list.
2603 * term.c (mark_ttys): Remove.
2604 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2605
2606 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2607
2608 Change struct frame bitfields from unsigned char to unsigned.
2609 * frame.h (struct frame): Change type of 'display_preempted',
2610 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2611 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2612 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2613 bitfields from unsigned char to unsigned.
2614
2615 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2616
2617 Remove unused member of struct x_output and struct w32_output.
2618 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2619 * w32term.h (struct w32_output): Likewise.
2620
2621 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2622
2623 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2624 does not become zero (Bug#12234).
2625
2626 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2627
2628 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2629 for GCC 4.7.1 x86-64.
2630
2631 2012-08-30 Glenn Morris <rgm@gnu.org>
2632
2633 * lread.c (init_lread): For out-of-tree builds, only add the
2634 source directory's site-lisp dir to the load-path if it exists,
2635 consistent with in-tree builds. (Bug#12302)
2636
2637 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2638
2639 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2640 button_values to NULL. Call setStykeMask so dialogs get a close button.
2641 (windowShouldClose:): Set window_closed.
2642 (dealloc): New member, free button_values.
2643 (process_dialog:): Make member function. Remove window argument,
2644 replace window with self. Count buttons and allocate and store values
2645 in button_values.
2646 (addButton:value:row:): value is int with the name tag. Call setTag
2647 with tag. Remove return self, declare return value as void.
2648 (addString:row:): Remove return self, declare return value as void.
2649 (addSplit): Remove return self, declare return value as void.
2650 (clicked:): Remove return self, declare return value as void.
2651 Set dialog_return to button_values[seltag]. Code formatting change.
2652 (initFromContents:isQuestion:): Adjust call to process_dialog.
2653 Code formatting change.
2654 (timeout_handler:): Set timer_fired to YES.
2655 (runDialogAt:): Set timer_fired to NO.
2656 Handle click on close button as quit.
2657
2658 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2659 Add window_closed and button_values. Add void as return value for
2660 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2661 Add process_dialog as new member.
2662
2663 2012-08-28 Eli Zaretskii <eliz@gnu.org>
2664
2665 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2666 is not one of the heaps we manage. (Bug#12242)
2667
2668 2012-08-28 Glenn Morris <rgm@gnu.org>
2669
2670 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2671
2672 2012-08-28 Martin Rudalics <rudalics@gmx.at>
2673
2674 * window.c (Fset_window_configuration): Remove handling of
2675 auto-buffer-name window parameter. Install revision of reverted
2676 fix.
2677
2678 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2679
2680 Do not allow to set major mode for a dead buffer.
2681 * buffer.c (Fset_buffer_major_mode): Signal an error
2682 if the buffer is dead.
2683 (Fother_buffer, other_buffer_safely): Remove redundant
2684 nested declaration.
2685
2686 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2687
2688 Always use set_buffer_if_live to restore original buffer at unwind.
2689 * buffer.h (record_unwind_current_buffer): New function.
2690 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2691 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2692 * undo.c, window.c: Adjust users.
2693 * buffer.c (set_buffer_if_live): Fix comment.
2694
2695 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2696
2697 Fix usage of set_buffer_internal.
2698 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2699 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2700 * coding.c (decode_coding): Omit redundant test.
2701 * fileio.c (decide_coding_unwind): Likewise.
2702 * fns.c (secure_hash): Likewise.
2703 * insdel.c (modify_region): Likewise.
2704 * keyboard.c (command_loop_1): Likewise.
2705 * print.c (PRINTFINISH): Likewise.
2706 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2707
2708 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2709
2710 * dispnew.c: Use bool for boolean.
2711 (frame_garbaged, display_completed, delayed_size_change)
2712 (fonts_changed_p, add_window_display_history)
2713 (add_frame_display_history, verify_row_hash)
2714 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2715 (row_equal_p, realloc_glyph_pool)
2716 (allocate_matrices_for_frame_redisplay)
2717 (showing_window_margins_p)
2718 (adjust_frame_glyphs_for_frame_redisplay)
2719 (build_frame_matrix_from_leaf_window, make_current)
2720 (mirrored_line_dance, mirror_line_dance, update_frame)
2721 (update_window_tree, update_single_window)
2722 (check_current_matrix_flags, update_window, update_text_area)
2723 (update_window_line, set_window_update_flags, scrolling_window)
2724 (update_frame_1, scrolling, buffer_posn_from_coords)
2725 (do_pending_window_change, change_frame_size)
2726 (change_frame_size_1, sit_for):
2727 Use bool for boolean.
2728 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2729 and remove last int (actually boolean) argument, which was always 0.
2730 All callers changed.
2731 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2732 * dispextern.h (struct composition_it): Use bool for boolean.
2733 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2734 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2735 * dired.c (file_name_completion):
2736 Use bool for boolean. (This was missed in an earlier change.)
2737
2738 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2739
2740 * window.c (Fset_window_configuration): Revert first part of
2741 last change.
2742
2743 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2744
2745 * nsterm.h (NSPanel): New class variable dialog_return.
2746
2747 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2748 Initialize dialog_return.
2749 (windowShouldClose:): Use stop instead of stopModalWithCode.
2750 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2751 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2752 event.
2753 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2754 modal loop returns.
2755
2756 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2757
2758 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2759 * composite.c (find_composition, composition_gstring_p)
2760 (composition_reseat_it, find_automatic_composition):
2761 * data.c (let_shadows_buffer_binding_p)
2762 (let_shadows_global_binding_p, set_internal, make_blv)
2763 (Fmake_variable_buffer_local, Fmake_local_variable)
2764 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2765 (cons_to_signed, arith_driver):
2766 * dbusbind.c (xd_in_read_queued_messages):
2767 * dired.c (directory_files_internal, file_name_completion):
2768 Use bool for booleans.
2769 * dired.c (file_name_completion):
2770 * process.h (fd_callback):
2771 Omit int (actually boolean) argument. It wasn't being used.
2772 All uses changed.
2773 * composite.h, lisp.h: Reflect above API changes.
2774
2775 * cmds.c, coding.c: Use bool for booleans.
2776 * cmds.c (move_point, Fself_insert_command):
2777 * coding.h (struct composition status, struct coding_system):
2778 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2779 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2780 (emacs_mule_char, decode_coding_emacs_mule)
2781 (encode_coding_emacs_mule, detect_coding_iso_2022)
2782 (decode_coding_iso_2022, encode_invocation_designation)
2783 (encode_designation_at_bol, encode_coding_iso_2022)
2784 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2785 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2786 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2787 (encode_coding_raw_text, detect_coding_charset)
2788 (decode_coding_charset, encode_coding_charset, detect_eol)
2789 (detect_coding, get_translation_table, produce_chars)
2790 (consume_chars, reused_workbuf_in_use)
2791 (make_conversion_work_buffer, code_conversion_save)
2792 (decode_coding_object, encode_coding_object)
2793 (detect_coding_system, char_encodable_p)
2794 (Funencodable_char_position, code_convert_region)
2795 (code_convert_string, code_convert_string_norecord)
2796 (Fset_coding_system_priority):
2797 * fileio.c (Finsert_file_contents):
2798 Use bool for booleans.
2799 * coding.h, lisp.h: Reflect above API changes.
2800 * coding.c: Remove unnecessary static function decls.
2801 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2802 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2803 not a boolean 'int', since callers never look at the return value.
2804 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2805 * coding.h (decoding_buffer_size, encoding_buffer_size)
2806 (emacs_mule_string_char): Remove unused extern decls.
2807 (struct iso_2022_spec, struct coding_system):
2808 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2809 (struct emacs_mule_spec): Remove unused field 'full_support'.
2810 All initializations removed.
2811 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2812
2813 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2814
2815 Fix spare memory change (Bug#12286).
2816 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2817 (valid_lisp_object_p): Likewise.
2818
2819 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2820
2821 * window.c (Fset_window_configuration): Record any window's old
2822 buffer if it's replaced (see Bug#8789). If the new current
2823 buffer doesn't appear in the selected window, go to its old
2824 point (Bug#12208).
2825
2826 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2827
2828 Special MEM_TYPE_SPARE to denote reserved memory.
2829 * alloc.c (enum mem_type): New memory type.
2830 (refill_memory_reserve): Use new type for spare memory.
2831 This prevents live_cons_p and live_string_p from incorrect
2832 detection of uninitialized objects from spare memory as live.
2833
2834 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2835
2836 Spelling fixes.
2837 * Makefile.in (.PHONY): versioclean -> versionclean.
2838
2839 Remove unused external symbols.
2840 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2841 * window.c (Qwindow_valid_p, decode_valid_window):
2842 Now static, not extern.
2843 * data.c (Qinterval): Remove; unused.
2844 (syms_of_data): Do not define 'interval'.
2845 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2846 * window.h (decode_valid_window):
2847 Remove decls.
2848
2849 * character.c, charset.c, chartab.c: Use bool for booleans.
2850 * character.c (lisp_string_width, string_count_byte8)
2851 (string_escape_byte8):
2852 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2853 (load_charset_map_from_file, map_charset_chars)
2854 (Fdefine_charset_internal, define_charset_internal)
2855 (Fdeclare_equiv_charset, find_charsets_in_text)
2856 (Ffind_charset_region, char_charset, Fiso_charset):
2857 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2858 (sub_char_table_set, sub_char_table_set_range)
2859 (char_table_set_range, optimize_sub_char_table)
2860 (map_sub_char_table):
2861 Use bool for boolean.
2862 * character.c (str_to_unibyte): Omit last boolean argument; it was
2863 always 0. All callers changed.
2864 * character.h, charset.h: Adjust to match previous changes.
2865 * character.h (char_printable_p): Remove decl of nonexistent function.
2866 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2867 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2868 are all boolean, so make them single-bit bitfields.
2869
2870 * lisp.h (ASET): Remove attempt to detect side effects.
2871 It was meant to be temporary and it often doesn't work,
2872 because when IDX has side effects the behavior of IDX==IDX
2873 is undefined. See Stefan Monnier in
2874 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2875
2876 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2877
2878 * lisp.h (functionp): New function (extracted from Ffunctionp).
2879 (FUNCTIONP): Use it.
2880 * eval.c (Ffunctionp): Use it.
2881
2882 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2883
2884 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2885 as that's faster and simpler than static storage. Don't bother
2886 with the g_main_context_query overhead if g_main_context_pending
2887 says no events are pending.
2888 (gfds, gfds_size): Remove these static vars.
2889 (xgselect_initialize): Remove; no longer needed.
2890 All uses and decls removed.
2891
2892 * emacs.c (fatal_error_signal_hook): Remove.
2893 All uses removed. This leftover from old code was always 0.
2894
2895 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2896 * casefiddle.c (casify_object, casify_region):
2897 * casetab.c (set_case_table):
2898 * category.c, category.h (word_boundary_p):
2899 * category.h (CHAR_HAS_CATEGORY):
2900 Use bool for booleans, instead of int.
2901
2902 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2903
2904 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2905
2906 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2907
2908 On assertion failure, print backtrace if available.
2909 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2910 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2911 * Makefile.in (LIB_EXECINFO): New macro.
2912 (LIBES): Use it.
2913
2914 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2915 * bytecode.c (exec_byte_code):
2916 * callint.c (check_mark, Fcall_interactively):
2917 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2918 (getenv_internal, sync_process_alive, call_process_exited):
2919 * lisp.h (USE_SAFE_ALLOCA):
2920 Use bool for booleans, instead of int.
2921 * lisp.h, process.h: Adjust prototypes to match above changes.
2922 * callint.c (Fcall_interactively): Don't assume the mark's
2923 offset fits in 'int'.
2924
2925 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2926
2927 * buffer.c, buffer.h: Use bool for boolean.
2928 * buffer.c (reset_buffer_local_variables)
2929 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2930 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2931 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2932 (overlay_touches_p, overlay_strings, Foverlay_put)
2933 (report_overlay_modification, call_overlay_mod_hooks):
2934 (mmap_enlarge, mmap_set_vars):
2935 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2936 Use bool for booleans, instead of int.
2937 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2938 since the 1-or-0 return value is always ignored anyway.
2939 (mmap_initialized_p):
2940 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2941 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2942
2943 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2944
2945 * bidi.c: Use bool for boolean.
2946 This is a bit more readable, and makes the text segment of bidi.o
2947 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2948 Presumably it's faster too.
2949 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2950 Now bool.
2951 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2952 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2953 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2954 (bidi_explicit_dir_char, bidi_level_of_next_char)
2955 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2956 Use bool for booleans, instead of int.
2957 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2958 (bidi_unshelve_cache): Adjust decls to match code.
2959
2960 2012-08-23 Martin Rudalics <rudalics@gmx.at>
2961
2962 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2963 argument.
2964
2965 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2966
2967 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2968 * atimer.h: Include <stdbool.h>.
2969
2970 2012-08-22 Dan Nicolaescu <dann@gnu.org>
2971
2972 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2973 compile time tests instead of run time tests on systems that do
2974 not use them.
2975 (FRAME_MAC_P): Remove leftover from deleted code.
2976 * frame.c (syms_of_frame): Remove leftover from deleted code.
2977
2978 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2979
2980 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2981
2982 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2983
2984 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2985 Otherwise, the compiler complains about (A?B:C) where B is void
2986 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2987 (fontset_add): Return void, for FONTSET_ADD.
2988
2989 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2990
2991 * alloc.c: Use bool for booleans.
2992 (gc_in_progress, abort_on_gc)
2993 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2994 (dont_register_blocks) [GC_MALLOC_CHECK]:
2995 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2996 (check_string_bytes, make_specified_string, memory_full)
2997 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2998 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2999 (mark_stack, valid_pointer_p, make_pure_string)
3000 (Fgarbage_collect, survives_gc_p, gc_sweep):
3001 Use bool for booleans, instead of int.
3002 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3003 Remove unused local.
3004 * alloc.c (PURE_POINTER_P):
3005 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3006 * editfns.c (Fformat):
3007 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3008 (Fdo_auto_save):
3009 * fns.c (sweep_weak_table):
3010 * lisp.h (suppress_checking, push_message, survives_gc_p)
3011 (make_pure_string, gc_in_progress, abort_on_gc):
3012 * lread.c (readchar, read1):
3013 * print.c (Fprin1_to_string):
3014 * xdisp.c (push_message):
3015 Use bool for booleans affected directly or indirectly by
3016 alloc.c's changes.
3017
3018 Make recently-introduced setters macros.
3019 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3020 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3021 (set_fontset_default, set_fontset_fallback): Rename from their
3022 upper-case counterparts, and make them functions rather than macros.
3023 This is more consistent with the other recently-introduced setters.
3024 These don't need to be inline, since they're local.
3025
3026 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3027
3028 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3029 the loop (Bug#12247).
3030
3031 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3032
3033 * lisp.h (vcopy): Use memcpy rather than our own loop.
3034 This fixes a performance regression introduced by the recent
3035 addition of vcopy. This means 'vcopy' will need to be modified
3036 for a copying collector, but that's OK. Also, tighten the
3037 checking in the assertion.
3038
3039 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3040
3041 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3042 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3043 non-base glyph for the width of the base character, according to
3044 what x_draw_composite_glyph_string_foreground expects.
3045 Generate WADJUST value according to composition_gstring_width's
3046 expectations, to produce correct width of the composed character.
3047 Reverse the sign of the DU offset produced by ScriptPlace.
3048
3049 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3050
3051 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3052
3053 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3054
3055 Avoid direct writes to contents member of struct Lisp_Vector.
3056 * lisp.h (vcopy): New function to copy data into vector.
3057 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3058 * fns.c (Ffillarray): Use ASET.
3059 * keyboard.c (timer_check_2): Use AREF and ASET.
3060 (append_tool_bar_item, Frecent_keys): Use vcopy.
3061 * lread.c (read_vector): Use ASET.
3062 * msdos.c (Frecent_doskeys): Use vcopy.
3063 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3064 (Finternal_merge_in_global_face): Use ASET and vcopy.
3065 * xfont.c (xfont_list_pattern): Likewise.
3066
3067 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3068
3069 * window.c (Fwindow_point): For the selected window always return
3070 the position of its buffer's point.
3071 (Fset_window_point): For the selected window always go in its
3072 buffer to the specified position.
3073
3074 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3075
3076 Setter macros for fontsets.
3077 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3078 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3079 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3080 Adjust users.
3081
3082 2012-08-20 Glenn Morris <rgm@gnu.org>
3083
3084 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3085 Don't assume that `ln -f' works.
3086
3087 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3088
3089 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3090 and later about non-assignments with no effect. See discussion at
3091 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3092 details.
3093
3094 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3095
3096 Inline setter functions for Lisp_Objects slots of struct specbinding.
3097 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3098 Adjust users.
3099
3100 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3101
3102 * window.c (select_window): Always make selected window's buffer
3103 current.
3104
3105 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3106
3107 Use AREF and ASET for docstrings of category tables.
3108 * category.h (CATEGORY_DOCSTRING): Use AREF.
3109 (SET_CATEGORY_DOCSTRING): Use ASET.
3110 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3111
3112 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3113
3114 Inline setter functions for hash table members.
3115 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3116 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3117 (set_hash_key_and_value, set_hash_index, set_hash_next)
3118 (set_hash_hash): New functions.
3119 * charset.c, fns.c: Adjust users.
3120
3121 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3122
3123 Inline getter and setter functions for per-buffer values.
3124 * buffer.h (per_buffer_default, set_per_buffer_default)
3125 (per_buffer_value, set_per_buffer_value): New functions.
3126 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3127 * buffer.c, data.c: Adjust users.
3128
3129 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3130
3131 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3132
3133 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3134
3135 Rely on <config.h> + <unistd.h> to declare 'environ',
3136 as gnulib does this if the system doesn't.
3137 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3138 Remove declaration. MS-Windows declares it on stdlib.h which is
3139 included by conf_post.h.
3140 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3141 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3142 * vm-limit.c: Include <unistd.h>, for 'environ'.
3143
3144 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3145 (start_of_data): Remove decl; mem-limits.h provides it.
3146
3147 * xdisp.c (handle_invisible_prop): Make it a bit faster
3148 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3149
3150 2012-08-19 Chong Yidong <cyd@gnu.org>
3151
3152 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3153 ends (Bug#3874).
3154
3155 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3156
3157 * .gdbinit: Use call instead of set when calling a function in the
3158 inferior.
3159
3160 * data.c (set_internal): Don't use set_blv_found.
3161 (Fkill_local_variable): Likewise.
3162
3163 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3164
3165 * nsfont.m (ns_ascii_average_width): Ensure the string
3166 ascii_printable is initialized with a null-terminated character
3167 array. Otherwise, it can contain undesired extra characters.
3168
3169 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3170
3171 port new setting code to Sun C 5.8 2005/10/13
3172 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3173 Return void, not Lisp_Object. Otherwise, the compiler
3174 complains about (A?B:C) where B is void and C is Lisp_Object
3175 when compiling CHAR_TABLE_SET, due to the recent change to
3176 the API of sub_char_table_set_contents.
3177
3178 2012-08-18 Chong Yidong <cyd@gnu.org>
3179
3180 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3181 for the string case (Bug#3874).
3182
3183 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3184
3185 * buffer.h (BSET): Remove (Bug#12215).
3186 Replace all uses with calls to new setter functions.
3187 (bset_bidi_paragraph_direction, bset_case_canon_table)
3188 (bset_case_eqv_table, bset_directory, bset_display_count)
3189 (bset_display_time, bset_downcase_table)
3190 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3191 (bset_last_selected_window, bset_local_var_alist)
3192 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3193 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3194 (bset_width_table):
3195 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3196 (bset_auto_fill_function, bset_auto_save_file_format)
3197 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3198 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3199 (bset_cache_long_line_scans, bset_case_fold_search)
3200 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3201 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3202 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3203 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3204 (bset_header_line_format, bset_indicate_buffer_boundaries)
3205 (bset_indicate_empty_lines, bset_invisibility_spec)
3206 (bset_left_fringe_width, bset_major_mode, bset_mark)
3207 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3208 (bset_name, bset_overwrite_mode, bset_pt_marker)
3209 (bset_right_fringe_width, bset_save_length)
3210 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3211 (bset_scroll_up_aggressively, bset_selective_display)
3212 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3213 (bset_word_wrap, bset_zv_marker):
3214 * category.c (bset_category_table):
3215 * syntax.c (bset_syntax_table):
3216 New setter functions.
3217
3218 * process.h (PSET): Remove (Bug#12215).
3219 Replace all uses with calls to new setter functions.
3220 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3221 (PROCESS_INLINE): New macro.
3222 (pset_childp): New setter function.
3223 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3224 * process.c (PROCESS_INLINE):
3225 Define to EXTERN_INLINE, so that the corresponding functions
3226 are compiled into code.
3227 (pset_buffer, pset_command, pset_decode_coding_system)
3228 (pset_decoding_buf, pset_encode_coding_system)
3229 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3230 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3231 (pset_type, pset_write_queue): New setter functions.
3232
3233 * window.h (WSET): Remove (Bug#12215).
3234 Replace all uses with calls to new setter functions.
3235 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3236 (WINDOW_INLINE): New macro.
3237 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3238 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3239 (wset_total_lines, wset_vertical_scroll_bar)
3240 (wset_window_end_pos, wset_window_end_valid)
3241 (wset_window_end_vpos): New setter functions.
3242 * window.c (WINDOW_INLINE):
3243 Define to EXTERN_INLINE, so that the corresponding functions
3244 are compiled into code.
3245 (wset_combination_limit, wset_dedicated, wset_display_table)
3246 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3247 (wset_new_normal, wset_new_total, wset_next_buffers)
3248 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3249 (wset_prev_buffers, wset_right_fringe_width)
3250 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3251 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3252 (wset_window_parameters):
3253 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3254 (wset_column_number_displayed, wset_region_showing):
3255 New setter functions.
3256
3257 * termhooks.h (TSET): Remove (Bug#12215).
3258 Replace all uses with calls to new setter functions.
3259 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3260 (TERMHOOKS_INLINE): New macro.
3261 (tset_charset_list, tset_selection_alist): New setter functions.
3262 * terminal.c (TERMHOOKS_INLINE):
3263 Define to EXTERN_INLINE, so that the corresponding functions
3264 are compiled into code.
3265 (tset_param_alist): New setter function.
3266
3267 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3268
3269 * keyboard.h (KSET): Remove (Bug#12215).
3270 Replace all uses with calls to new setter functions.
3271 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3272 (KEYBOARD_INLINE): New macro.
3273 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3274 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3275 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3276 New setter functions.
3277 * keyboard.c (KEYBOARD_INLINE):
3278 Define to EXTERN_INLINE, so that the corresponding functions
3279 are compiled into code.
3280 (kset_echo_string, kset_kbd_queue)
3281 (kset_keyboard_translate_table, kset_last_prefix_arg)
3282 (kset_last_repeatable_command, kset_local_function_key_map)
3283 (kset_overriding_terminal_local_map, kset_real_last_command)
3284 (kset_system_key_syms): New setter functions.
3285
3286 * frame.h (FSET): Remove (Bug#12215).
3287 Replace all uses with calls to new setter functions.
3288 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3289 (FRAME_INLINE): New macro.
3290 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3291 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3292 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3293 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3294 (fset_param_alist, fset_root_window, fset_scroll_bars)
3295 (fset_selected_window, fset_title, fset_tool_bar_items)
3296 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3297 * frame.c (FRAME_INLINE):
3298 Define to EXTERN_INLINE, so that the corresponding functions
3299 are compiled into code.
3300 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3301
3302 A few more naming-convention fixes for getters and setters.
3303 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3304 and rename from buffer_overlays_set_before.
3305 (set_buffer_overlays_after): Move here from buffer.h, and rename
3306 from buffer_overlays_set_after.
3307 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3308 All uses changed.
3309 (set_buffer_intervals): Rename from buffer_set_intervals.
3310 * intervals.c (set_interval_object): Move here from intervals.h,
3311 and rename from interval_set_object.
3312 (set_interval_left): Move here from intervals.h, and rename from
3313 interval_set_left.
3314 (set_interval_right): Move here from intervals.h, and rename from
3315 interval_set_right.
3316 (copy_interval_parent): Move here from intervals.h, and rename from
3317 interval_copy_parent.
3318 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3319 (set_interval_plist): Rename from interval_set_plist.
3320 Return void, not Lisp_Object, since no caller uses the result.
3321 * lisp.h (string_intervals): Rename from string_get_intervals.
3322 (set_string_intervals): Rename from string_set_intervals.
3323
3324 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3325 (set_char_table_contents): Rename from char_table_set_contents.
3326 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3327 All uses changed. See the end of
3328 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3329
3330 * lisp.h (CSET): Remove (Bug#12215).
3331 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3332 (set_char_table_purpose): New functions,
3333 replacing CSET. All uses changed. For example, replace
3334 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3335 "set_char_table_parent (char_table, parent);".
3336 The old version was confusing because it used the same name
3337 'parent' for two different things.
3338
3339 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3340
3341 Functions to get and set Lisp_Object fields of buffer-local variables.
3342 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3343 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3344 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3345 * data.c, eval.c, frame.c: Adjust users.
3346
3347 2012-08-17 Chong Yidong <cyd@gnu.org>
3348
3349 * xfaces.c (merge_face_vectors): If the target font specfies a
3350 font spec, make the font's attributes take precedence over
3351 directly-specified attributes.
3352 (merge_face_ref): Recognize :font.
3353
3354 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3355
3356 Do not use memcpy for copying intervals.
3357 * intervals.c (reproduce_interval): New function.
3358 (reproduce_tree, reproduce_tree_obj): Use it.
3359 (reproduce_tree_obj): Remove prototype.
3360
3361 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3362
3363 * lisp.h (duration_to_sec_usec): Remove unused decl.
3364
3365 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3366
3367 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3368 to an allocated instance of NSString, not to the class itself.
3369
3370 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3371
3372 * makefile.w32-in (C_CTYPE_H): New macro.
3373 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3374 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3375 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3376
3377 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3378
3379 Use ASCII tests for character types.
3380 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3381 * xfns.c, xterm.c:
3382 Don't include <ctype.h>; was not needed.
3383 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3384 * sysdep.c, xfaces.c:
3385 Include <c-ctype.h> instead of <ctype.h>.
3386 * nsterm.m: Include <c-ctype.h>.
3387 * charset.c (read_hex):
3388 * doc.c (Fsnarf_documentation):
3389 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3390 (DRIVE_LETTER) [DOS_NT]:
3391 (Ffile_name_directory, Fexpand_file_name)
3392 (Fsubstitute_in_file_name):
3393 * font.c (font_parse_xlfd, font_parse_fcname):
3394 * frame.c (x_set_font_backend):
3395 * gtkutil.c (xg_get_font):
3396 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3397 * nsimage.m (hexchar):
3398 * nsterm.m (ns_xlfd_to_fontname):
3399 * sysdep.c (system_process_attributes):
3400 * xfaces.c (hash_string_case_insensitive):
3401 Use C-locale tests instead of locale-specific tests for character
3402 types, since we want the ASCII interpretation here, not the
3403 interpretation suitable for whatever happens to be the current locale.
3404
3405 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3406
3407 Consistently check windows for validity/liveness
3408 (Bug#11984, Bug#12025, Bug#12026).
3409 * lisp.h (CHECK_VALID_WINDOW): New macro.
3410 * window.c (decode_window): Rename to decode_live_window.
3411 (decode_valid_window, Fwindow_valid_p): New functions.
3412 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3413 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3414 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3415 (Fwindow_prev_sibling, Fwindow_combination_limit)
3416 (Fset_window_combination_limit, Fwindow_use_time)
3417 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3418 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3419 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3420 (Fwindow_hscroll, Fset_window_hscroll)
3421 (Fwindow_redisplay_end_trigger)
3422 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3423 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3424 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3425 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3426 (Fwindow_end, Fset_window_point, Fset_window_start)
3427 (Fpos_visible_in_window_p, Fwindow_line_height)
3428 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3429 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3430 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3431 (Fset_window_parameter, Fwindow_display_table)
3432 (Fset_window_display_table, Fdelete_other_windows_internal)
3433 (Fset_window_buffer, Fset_window_new_total)
3434 (Fset_window_new_normal, Fdelete_window_internal)
3435 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3436 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3437 (Fwindow_scroll_bars): Check whether argument window is a valid or
3438 live window. Update doc-strings.
3439 (syms_of_window): New symbol Qwindow_valid_p.
3440 * keyboard.c (Fposn_at_x_y): Check whether argument
3441 frame_or_window denotes a valid window.
3442
3443 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3444
3445 Fix previous char table change.
3446 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3447 * chartab.c (optimize_sub_char_table): Likewise.
3448
3449 2012-08-16 Chong Yidong <cyd@gnu.org>
3450
3451 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3452
3453 * xfont.c (xfont_open):
3454 * xftfont.c (xftfont_open): Set the font's max_width field.
3455
3456 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3457 min_width to space_width and average_width to the average over
3458 printable ASCII characters.
3459 (ns_char_width): Code cleanup.
3460 (ns_ascii_average_width): New utility function.
3461
3462 * font.h (struct font): Update comments.
3463
3464 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3465
3466 Simple interface to set Lisp_Object fields of character tables.
3467 * lisp.h (CSET): New macro.
3468 (char_table_set_extras, char_table_set_contents)
3469 (sub_char_table_set_contents): New function.
3470 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3471 * syntax.c: Adjust users.
3472
3473 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3474
3475 * eval.c (eval_sub): Bind lexical-binding.
3476 * lread.c (Qlexical_binding): Make non-static.
3477
3478 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3479
3480 * nsmenu.m (popupSession): Remove.
3481 (pop_down_menu): Remove endModalSession.
3482 (timeout_handler:): New method.
3483 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3484 Call runModalForWindow. Check timer_fired when it returns.
3485 If not set, cancel timer and break out of loop.
3486 Otherwise loop again, with a new timeout.
3487
3488 * nsterm.m: Include fcntl.h if present.
3489 (fd_entry, t_readfds, inNsSelect): Remove.
3490 (select_writefds, select_valid, select_timeout, selfds)
3491 (select_mutex, apploopnr): Add.
3492 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3493 Otherwise call kbd_buffer_store_event.
3494 (ns_send_appdefined): Remove release of fd_entry.
3495 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3496 Increment and decrement apploopnr.
3497 (ns_select): If no file descriptors, just do a NSTimer.
3498 Otherwise copy read/write masks and start select thread (fd_handler).
3499 Start main loop and wait for application defined event.
3500 Inform select thread to stop selecting after main loop is exited.
3501 (ns_term_init): Create selfds pipe and set non-blocking.
3502 Initialize select_mutex. Start the select thread (fd_handler).
3503 (fd_handler:): Loop forever, wait for info from the main thread
3504 to either start or stop selecting. When select returns, send
3505 and appdefined event.
3506 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3507 If not call kbd_buffer_store_event.
3508
3509 * nsterm.h (EmacsApp): fd_handler takes id argument.
3510 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3511
3512 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3513
3514 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3515
3516 * region-cache.c (move_cache_gap): Update gap_len using the actual
3517 growth of the boundaries array. Do not change cache_len.
3518 (Bug#12196)
3519
3520 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3521
3522 Generalize and cleanup font subsystem checks.
3523 * font.h (FONT_DEBUG, font_assert): Remove.
3524 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3525 Change font_assert to eassert. Use eassert where appropriate.
3526
3527 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3528
3529 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3530
3531 2012-08-15 Chong Yidong <cyd@gnu.org>
3532
3533 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3534 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3535 extract the font descriptor instead of just the font name.
3536 In that case, return a font spec instead of a string.
3537 (x_last_font_name): Move to this file from xfns.c.
3538
3539 * xfns.c (Fx_select_font): The return value can also be a font
3540 spec. Move x_last_font_name management to gtkutil.c.
3541
3542 * xfaces.c: Make font weight and style symbols non-static.
3543
3544 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3545
3546 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3547 (bug#12117).
3548
3549 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3550
3551 * alloc.c (Fgarbage_collect): Use plural form consistently.
3552
3553 2012-08-14 Eli Zaretskii <eliz@gnu.org>
3554
3555 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3556 iteration through the command loop. Fixes a problem whereby mouse
3557 movements are ignored until the first mouse click.
3558
3559 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3560
3561 Use bool, not int, for Lisp booleans.
3562 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3563 makes Emacs a bit smaller and presumably a bit faster.
3564 * lisp.h: Include <stdbool.h>.
3565 (struct Lisp_Boolfwd, defvar_bool):
3566 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3567 * regex.c [!emacs]: Include <stdbool.h>.
3568 (false, true): Remove; <stdbool.h> does this for us now.
3569
3570 2012-08-14 Chong Yidong <cyd@gnu.org>
3571
3572 * character.c (Fcharacterp): Doc fix (Bug#12076).
3573
3574 * data.c (Findirect_variable): Doc fix (Bug#11040).
3575
3576 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3577
3578 * editfns.c (Fformat): Doc fix (Bug#12059).
3579 (Fsave_current_buffer): Doc fix (Bug#11542).
3580
3581 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3582
3583 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3584 (bug#12022).
3585
3586 2012-08-14 Martin Rudalics <rudalics@gmx.at>
3587
3588 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3589 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3590 * minibuf.c (choose_minibuf_frame, read_minibuf):
3591 * w32fns.c (x_create_tip_frame):
3592 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3593 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3594
3595 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3596
3597 * intervals.c (offset_intervals): Remove obsolete comment.
3598
3599 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3600
3601 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3602
3603 2012-08-14 Gergely Risko <gergely@risko.hu>
3604
3605 * coding.c (decode_coding): Record buffer modification before
3606 disabling undo_list (Bug#11773).
3607
3608 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3609
3610 Revert and cleanup some recent overlay changes.
3611 * buffer.h (enum overlay_type): Remove.
3612 (buffer_get_overlays, buffer_set_overlays): Likewise.
3613 (buffer_set_overlays_before, buffer_set_overlays_after):
3614 New function. Adjust users.
3615 (unchain_both): Add eassert.
3616
3617 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3618
3619 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3620
3621 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3622
3623 * gtkutil.c (xg_mark_data): Don't assume C99.
3624
3625 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3626
3627 * gtkutil.c (xg_frame_tb_info): New struct.
3628 (TB_INFO_KEY): New define.
3629 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3630 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3631 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3632 if not present.
3633 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3634 is up to date. Otherwise store new data.
3635 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3636
3637 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3638
3639 Use KSET for write access to Lisp_Object members of struct kboard.
3640 * keyboard.h (KSET): New macro.
3641 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3642 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3643 * xterm.c: Adjust users.
3644
3645 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3646
3647 Use BSET for write access to Lisp_Object members of struct buffer.
3648 * buffer.h (BSET): New macro.
3649 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3650 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3651 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3652 * window.c, xdisp.c, xfns.c: Adjust users.
3653
3654 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3655
3656 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3657
3658 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3659
3660 * nsterm.m (not_in_argv): New function.
3661 (application:openFile, application:openTempFile:):
3662 (application:openFileWithoutUI:, application:openFiles:): Open file
3663 if not_in_argv returns non-zero (bug#12171).
3664
3665 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3666 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3667 Define for Gtk+ versions less than 3.2.
3668 (xg_get_font_name): Use those functions/macros here.
3669 Reported by Frans Oilinki <moilinki@gmail.com>.
3670
3671 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3672
3673 * unexmacosx.c (copy_data_segment): Copy initialized data in
3674 statically linked libraries from input file rather than memory.
3675
3676 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3677 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3678 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3679
3680 2012-08-10 Glenn Morris <rgm@gnu.org>
3681
3682 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3683 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3684
3685 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3686
3687 Fix last change to allow compilation with low optimization levels.
3688 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3689 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3690
3691 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3692
3693 Use common inline syntax in intervals.h.
3694 * intervals.h (INTERVALS_INLINE): New macro.
3695 Change all users from LISP_INLINE.
3696
3697 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3698
3699 Define Qnone once for all platforms.
3700 * frame.c (Qnone): Define here.
3701 (syms_of_frame): DEFSYM it.
3702 * lisp.h (Qnone): New declaration.
3703 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3704 * xfns.c: Remove duplication. Adjust users.
3705
3706 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3707
3708 Remove unused macros from intervals.h.
3709 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3710 * intervals.c: Adjust comment.
3711
3712 2012-08-10 Eli Zaretskii <eliz@gnu.org>
3713
3714 * w32fns.c <w32_unicode_gui>: New static variable.
3715 (globals_of_w32fns): Initialize it according to os_subtype.
3716 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3717 testing os_subtype.
3718
3719 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
3720 Eli Zaretskii <eliz@gnu.org>
3721
3722 Fix bug #10299 with Unicode characters sent by customized
3723 keyboards created by MSKLC.
3724 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3725 (w32_init_class): Use it to initialize the Emacs class with either
3726 ANSI or Unicode API calls.
3727 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3728 later.
3729 (w32_wnd_proc): If the character code sent by WM_CHAR or
3730 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3731 original message. Call DefWindowProcW on NT and later.
3732
3733 2012-08-10 Glenn Morris <rgm@gnu.org>
3734
3735 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3736
3737 * lisp.h (DIRECTORY_SEP): Let configure set it.
3738
3739 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3740
3741 Use TSET for write access to Lisp_Object slots of struct terminal.
3742 * termhooks.h (TSET): New macro.
3743 * coding.c, terminal.c, xselect.c: Adjust users.
3744
3745 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3746
3747 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3748 the failing expression, include them in the error message.
3749 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3750 * lisp.h (internal_condition_case_n): Update declaration.
3751
3752 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3753
3754 Inline functions to examine and change buffer overlays.
3755 * buffer.c (unchain_both): New function.
3756 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3757 (buffer_has_overlays): New function.
3758 (enum overlay_type): New enum.
3759 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3760 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3761
3762 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3763
3764 Inline functions to examine and change buffer intervals.
3765 * alloc.c (mark_interval_tree): Remove.
3766 (MARK_INTERVAL_TREE): Simplify.
3767 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3768 * intervals.c (buffer_balance_intervals): New function.
3769 (graft_intervals_into_buffer): Adjust indentation.
3770 (set_intervals_multibyte): Simplify.
3771 * buffer.h (BUF_INTERVALS): Remove.
3772 (buffer_get_intervals, buffer_set_intervals): New function.
3773 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3774 * intervals.c, textprop.c: Adjust users.
3775
3776 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3777
3778 Inline functions to examine and change string intervals.
3779 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3780 (string_get_intervals, string_set_intervals): New function.
3781 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3782 * lread.c, print.c, textprop.c: Adjust users.
3783
3784 2012-08-08 Glenn Morris <rgm@gnu.org>
3785
3786 * lisp.mk (lisp): Remove language/persian.elc.
3787
3788 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3789
3790 Cleanup intervals.
3791 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3792 (NULL_INTERVAL_P): Likewise. Adjust users.
3793 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3794 Adjust comment. Move under #if 0.
3795 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3796 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3797
3798 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3799
3800 Check total length of intervals with eassert.
3801 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3802 * intervals.c: Change all users to eassert.
3803
3804 2012-08-07 Eli Zaretskii <eliz@gnu.org>
3805
3806 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3807 Rename fields to match removal of FGET and WGET and disuse of
3808 INTERNAL_FIELD in Lisp_Cons.
3809
3810 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3811
3812 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3813 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3814 name since all xname users are fixed long time ago. Do not
3815 use INTERNAL_FIELD.
3816 (set_symbol_name, set_symbol_function, set_symbol_plist):
3817 (set_symbol_next, set_overlay_plist): New function.
3818 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3819 (struct Lisp_Overlay): Likewise.
3820 (CVAR, MVAR, SVAR): Remove.
3821 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3822 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3823 * xterm.c: Adjust users.
3824 * .gdbinit: Change to use name field of struct Lisp_Symbol
3825 where appropriate.
3826
3827 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3828
3829 Basic functions to set Lisp_Object and pointer slots of intervals.
3830 * intervals.h (interval_set_parent, interval_set_object):
3831 (interval_set_left, interval_set_right, interval_set_plist):
3832 (interval_copy_parent): New function.
3833 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
3834 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3835 Adjust indentation.
3836 (INTERVAL_SIZE): Remove. Adjust users.
3837 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3838
3839 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3840
3841 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3842 * process.h (PGET): Remove.
3843 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3844 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3845
3846 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3847
3848 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3849 * window.h (WGET): Remove.
3850 (struct window): Do not use INTERNAL_FIELD.
3851 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3852 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3853 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3854 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3855 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3856 Adjust users.
3857
3858 2012-08-07 Chong Yidong <cyd@gnu.org>
3859
3860 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3861 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3862 (Fdelete_window_internal): Signal an error if the window is not on
3863 a live frame (Bug#12025).
3864
3865 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3866
3867 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3868 * frame.h (FGET): Remove.
3869 (struct frame): Do not use INTERNAL_FIELD.
3870 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3871 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3872 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3873 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3874
3875 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
3876
3877 * w32.c: Silence compiler warnings.
3878 (map_w32_filename): Remove unused variable `is_fat'.
3879 (chase_symlinks): Add parentheses around expression.
3880
3881 2012-08-06 Glenn Morris <rgm@gnu.org>
3882
3883 * sysdep.c: Respect BROKEN_GETWD.
3884
3885 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3886 Let configure handle it.
3887 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3888
3889 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3890
3891 Use GCALIGNMENT where appropriate.
3892 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3893 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3894 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3895
3896 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3897
3898 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3899 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3900
3901 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3902
3903 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3904 that should be sufficient for everyone.
3905
3906 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3907
3908 * keyboard.c (timer_check_2): Add break so timer_check returns next
3909 timeout.
3910
3911 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3912
3913 Fix Windows build errors introduced after converting to WGET and WSET.
3914 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3915 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3916
3917 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3918
3919 * nsterm.m (ns_frame_rehighlight): Use FSET.
3920
3921 * nsmenu.m (ns_update_menubar): Use FSET.
3922
3923 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3924
3925 Separate read and write access to Lisp_Object slots of Lisp_Process.
3926 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3927 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3928
3929 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3930
3931 Separate read and write access to Lisp_Object slots of struct window.
3932 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3933 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3934 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3935 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3936 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3937 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3938 Adjust users.
3939
3940 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3941
3942 Fix Windows build errors introduced after converting to FGET and FSET.
3943 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3944 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3945 (w32_judge_scroll_bars): Change to use FSET.
3946 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3947
3948 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3949
3950 Fix replacement typo.
3951 * window.c (replace_window): Set root_window instead of
3952 selected_window. This fixes a total window subsystem
3953 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3954
3955 2012-08-06 Glenn Morris <rgm@gnu.org>
3956
3957 * lisp.mk (lisp): Add language/persian.elc.
3958
3959 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3960
3961 Separate read and write access to Lisp_Object slots of struct frame.
3962 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3963 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3964 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3965 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3966 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3967
3968 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3969
3970 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3971
3972 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3973
3974 Generalize common compile-time constants.
3975 * lisp.h (header_size, bool_header_size, word_size): Now here.
3976 (struct Lisp_Vector): Add comment.
3977 (struct Lisp_Bool_Vector): Move up to define handy constants.
3978 (VECSIZE, PSEUDOVECSIZE): Simplify.
3979 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3980 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3981 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3982 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3983 * xfont.c, xmenu.c: Use word_size where appropriate.
3984
3985 2012-08-05 Lawrence Mitchell <wence@gmx.li>
3986
3987 * search.c (Freplace_match): Treat \? in the replacement text
3988 literally (Bug#8161).
3989
3990 2012-08-05 Chong Yidong <cyd@gnu.org>
3991
3992 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3993 * frame.c (Vdelete_frame_functions):
3994 * emacs.c (Vkill_emacs_hook): Doc fix.
3995
3996 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3997
3998 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3999 --with-x-toolkit=no builds.
4000 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4001
4002 2012-08-04 Chong Yidong <cyd@gnu.org>
4003
4004 * syntax.c (Fmodify_syntax_entry): Doc fix.
4005
4006 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4007
4008 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4009 * w32.c (init_environment): Change the default values of many
4010 environment variables in dflt_envvars[] to NULL, to avoid pushing
4011 them into environment when they were not already defined.
4012 Remove the code that deletes site-lisp subdirectories from the default
4013 value of EMACSLOADPATH, as it is no longer needed.
4014 (check_windows_init_file): Now external, not static.
4015 Use Vload_path as is, without adding anything, as this function is now
4016 called when Vload_path is already set up.
4017
4018 * w32.h (check_windows_init_file): Add prototype.
4019
4020 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4021 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4022 compatibility with Posix platforms.
4023 (main): Move the call to check_windows_init_file to here from
4024 w32.c.
4025 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4026 any, in the DEFALT argument into the root of the Emacs build or
4027 installation tree, as appropriate.
4028
4029 * callproc.c (init_callproc_1): Call decode_env_path instead of
4030 doing its equivalent by hand.
4031 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4032 the code that sets Vexec_path run on MS-Windows.
4033
4034 * lread.c (init_lread): Add comments to #ifdef's.
4035
4036 * msdos.c (dos_set_window_size, IT_update_begin)
4037 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4038 instead of direct references.
4039
4040 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4041
4042 Export DEFAULT_REHASH_* to GDB.
4043 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4044 Now constants, not macros.
4045
4046 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4047
4048 Remove unnecessary casts involving pointers.
4049 These casts are no longer needed now that we assume C89 or later,
4050 since they involve casting to or from void *.
4051 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4052 (make_pure_float, make_pure_vector):
4053 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4054 * macros.c (Fstart_kbd_macro):
4055 * menu.c (find_and_return_menu_selection):
4056 * minibuf.c (read_minibuf_noninteractive):
4057 * sysdep.c (closedir):
4058 * xdisp.c (x_produce_glyphs):
4059 * xfaces.c (compare_fonts_by_sort_order):
4060 * xfns.c (x_real_positions, select_visual):
4061 * xselect.c (x_stop_queuing_selection_requests)
4062 (x_get_window_property, x_get_window_property_as_lisp_data):
4063 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4064 Remove unnecessary pointer casts.
4065 * alloc.c (record_xmalloc): New function.
4066 * lisp.h (record_xmalloc): New decl.
4067 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4068 more like a function. This is because the pointer cast is not
4069 needed. All uses changed.
4070 * print.c (print_string, print_error_message): Avoid length recalc.
4071
4072 Improve fix for macroexp crash with debugging (Bug#12118).
4073 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4074 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4075 not supposed to be invoked from the garbage collector.
4076 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4077 (gc_aset): New function, which is like ASET but can be
4078 used in the garbage collector.
4079 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4080 (set_hash_index): Use it instead of ASET.
4081
4082 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4083
4084 Support symlinks on latest versions of MS-Windows.
4085 * w32.c: Include winioctl.h and aclapi.h.
4086 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4087 (revert_to_self): Forward declarations of static functions.
4088 <static BOOL g_b_init_get_security_info>:
4089 <g_b_init_create_symbolic_link>: New static flags.
4090 (globals_of_w32): Initialize them to zero.
4091 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4092 (map_w32_filename): Improve commentary. Simplify switch.
4093 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4094 headers (most versions of MinGW w32api don't).
4095 (get_security_info, create_symbolic_link)
4096 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4097 New functions.
4098 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4099 in the argument file name.
4100 (sys_access): Call unc_volume_file_attributes only if
4101 GetFileAttributes fails with network-related error codes.
4102 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4103 have the required privileges.
4104 (get_file_security_desc_by_name): Rename from
4105 get_file_security_desc.
4106 (stat_worker): New function, with most of the guts of 'stat', and
4107 with addition of handling of symlinks and support for 'lstat'.
4108 If possible, get file's attributes and security information by
4109 handle, not by name. Produce S_IFLNK bit for symlinks, when
4110 called from 'lstat'.
4111 (stat, lstat): New functions, call 'stat_worker'.
4112 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4113 symlinks when the underlying filesystem supports them.
4114
4115 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4116
4117 Fix macroexp crash on Windows with debugging (Bug#12118).
4118 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4119 checking subscripts; problem introduced with the recent
4120 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4121 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4122 since it's used in non-static inline functions now.
4123
4124 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4125 Don't assume buffer size fits in 'int'. Remove unused local.
4126
4127 Use C99-style 'extern inline' if available.
4128 * buffer.h (BUFFER_INLINE):
4129 * category.h (CATEGORY_INLINE):
4130 * character.h (CHARACTER_INLINE):
4131 * charset.h (CHARSET_INLINE):
4132 * composite.h (COMPOSITE_INLINE):
4133 * dispextern.h (DISPEXTERN_INLINE):
4134 * lisp.h (LISP_INLINE):
4135 * systime.h (SYSTIME_INLINE):
4136 New macro, replacing 'static inline' in this header.
4137 * buffer.h, category.h, character.h, charset.h, composite.h:
4138 * dispextern.h, lisp.h, systime.h:
4139 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4140 * alloc.c (LISP_INLINE):
4141 * buffer.c (BUFFER_INLINE):
4142 * category.c (CATEGORY_INLINE):
4143 * character.c (CHARACTER_INLINE):
4144 * charset.c (CHARSET_INLINE):
4145 * composite.c (COMPOSITE_INLINE):
4146 * dispnew.c (DISPEXTERN_INLINE):
4147 * sysdep.c (SYSTIME_INLINE):
4148 Define to EXTERN_INLINE, so that the corresponding functions
4149 are compiled into code.
4150 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4151 (INLINE_HEADER_END): New macros.
4152 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4153 since it's used in non-static inline functions now.
4154 (VALMASK) [!USE_LSB_TAG]: Likewise.
4155
4156 2012-08-02 Glenn Morris <rgm@gnu.org>
4157
4158 * s/: Remove empty directory.
4159
4160 * s/ms-w32.h: Move to ../nt/inc.
4161 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4162 Update for new ms-w32.h location.
4163
4164 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4165
4166 Port to Solaris 8.
4167 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4168
4169 2012-08-02 Glenn Morris <rgm@gnu.org>
4170
4171 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4172 hard-coding the path separator.
4173
4174 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4175
4176 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4177 This how ASET and AREF are supposed to work, and makes
4178 it easier to think about future improvements. See
4179 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4180 * charset.h (set_charset_attr): New function.
4181 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4182 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4183 (aref_addr): New function. All uses of &AREF(...) changed.
4184 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4185 (set_hash_index): New functions. All lvalue-style uses of
4186 HASH_KEY etc. changed.
4187 * keyboard.c (set_prop): New function. All lvalue-style uses
4188 of PROP changed.
4189
4190 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4191
4192 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4193 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4194 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4195 * nsfns.m (ns_set_name_as_filename): Likewise.
4196 * nsmenu.m (ns_update_menubar): Likewise.
4197 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4198
4199 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4200
4201 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4202 Adapt to latest changes in field names of the corresponding Lisp
4203 objects.
4204
4205 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4206
4207 2012-08-01 Glenn Morris <rgm@gnu.org>
4208
4209 * s/msdos.h: Remove file.
4210 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4211 * Makefile.in (S_FILE): Remove.
4212 (config_h): Remove S_FILE.
4213
4214 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4215
4216 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4217 Remove; moved to nt/config.nt.
4218
4219 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4220
4221 Use INTERNAL_FIELD for conses and overlays.
4222 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4223 Remove obsolete comment.
4224 (MVAR): New macro.
4225 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4226 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4227
4228 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4229
4230 Use INTERNAL_FIELD for symbols.
4231 * lisp.h (SVAR): New macro. Adjust users.
4232 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4233 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4234
4235 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4236
4237 Use INTERNAL_FIELD for processes.
4238 * process.h (PVAR): New macro. Adjust style.
4239 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4240 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4241
4242 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4243
4244 Use INTERNAL_FIELD for windows.
4245 * window.h (WVAR): New macro.
4246 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4247 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4248 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4249 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4250 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4251 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4252
4253 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4254
4255 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4256
4257 2012-08-01 Glenn Morris <rgm@gnu.org>
4258
4259 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4260 Move to configure.ac.
4261
4262 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4263
4264 * makefile.w32-in (CONFIG_H): Update dependencies.
4265 (CONF_POST_H): New macro.
4266
4267 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4268
4269 2012-07-31 Glenn Morris <rgm@gnu.org>
4270
4271 * Makefile.in (S_FILE): No longer set by configure.
4272
4273 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4274 is available.
4275 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4276
4277 * process.h (NULL_DEVICE):
4278 * emacs.c (SEPCHAR):
4279 * editfns.c (USER_FULL_NAME): Let configure set them.
4280
4281 * s/README, s/template.h: Remove files.
4282
4283 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4284
4285 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4286 Move to configure.ac.
4287
4288 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4289
4290 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4291 resulting renaming of 'struct frame' members.
4292
4293 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4294
4295 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4296 after introduction of FVAR.
4297
4298 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4299
4300 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4301
4302 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4303 instead of compositeToPoint.
4304 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4305
4306 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4307
4308 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4309
4310 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4311 * lisp.h (INTERNAL_FIELD): New macro.
4312 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4313 (BVAR): Change to use INTERNAL_FIELD.
4314 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4315 (KVAR): Change to use INTERNAL_FIELD.
4316 * frame.h (FVAR): New macro.
4317 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4318 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4319 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4320 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4321 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4322
4323 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4324
4325 Miscellaneous fixes for non-default X toolkits.
4326 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4327 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4328 Move under #ifdef USE_LUCID.
4329 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4330 definition and usage to avoid warnings.
4331
4332 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4333
4334 * nsterm.m (openFiles): Fix previous checkin.
4335
4336 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4337
4338 * indent.c (compute_motion): Remove unused local.
4339
4340 2012-07-31 Glenn Morris <rgm@gnu.org>
4341
4342 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4343
4344 * conf_post.h [USG5_4]:
4345 Move remaining contents of s/usg5-4-common.h here.
4346 * s/usg5-4-common.h: Remove file.
4347
4348 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4349 * s/irix6-5.h: Remove file.
4350
4351 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4352 * s/darwin.h: Remove file.
4353
4354 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4355 * s/hpux10-20.h: Remove file, which is now empty.
4356
4357 2012-07-30 Glenn Morris <rgm@gnu.org>
4358
4359 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4360 * Makefile.in (config_h): Add conf_post.h.
4361 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4362
4363 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4364
4365 * nsterm.m (ns_do_open_file): New variable.
4366 (ns_term_init): Set ns_do_open_file to YES after run returns.
4367 (openFile, openTempFile, openFileWithoutUI, openFiles):
4368 Open files only if ns_do_open_file.
4369
4370 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4371
4372 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4373 This no-op macro hasn't been needed for many years.
4374 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4375
4376 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4377 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4378 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4379 gdb_make_enums_visible.
4380 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4381 (DIRECTORY_SEP): Now a constant, not a macro.
4382
4383 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4384
4385 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4386 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4387
4388 * w32term.c <w32_keyboard_codepage>: Renamed from
4389 keyboard_codepage and now external. All users changed.
4390
4391 * w32term.h: Add declaration of w32_keyboard_codepage.
4392
4393 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4394 the codepage to translate keys to Unicode. If this argument is
4395 -1, use the value returned by GetConsoleCP. All callers changed.
4396
4397 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4398
4399 Update .PHONY listings in makefiles.
4400 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4401 bootstrap-clean, distclean, maintainer-clean, versioclean,
4402 extraclean, frc.
4403
4404 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4405 This is a bit clearer. Fix some commentary typos.
4406
4407 2012-07-30 Glenn Morris <rgm@gnu.org>
4408
4409 * s/netbsd.h: Let configure include signal.h if needed.
4410 Remove file, which is now empty.
4411
4412 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4413 Let configure set them.
4414 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4415 No more need to undefine.
4416
4417 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4418
4419 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4420 non-single-byte char when adding meta modifier. (Bug#12090)
4421
4422 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4423
4424 Convert safe_call to use variable number of arguments.
4425 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4426 (safe_call2): Fix comment.
4427 * lisp.h (safe_call): Adjust prototype.
4428 * coding.c (encode_coding_object): Change to use safe_call2.
4429 * xfaces.c (merge_face_heights): Change to use safe_call1.
4430
4431 2012-07-30 Glenn Morris <rgm@gnu.org>
4432
4433 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4434 does that unconditionally. Remove file, which is now empty.
4435
4436 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4437 Remove empty files.
4438
4439 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4440
4441 Export to GDB most of lisp.h's remaining object-like macros.
4442 * lisp.h (min, max): Move earlier, because they're used earlier now.
4443 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4444 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4445 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4446 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4447 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4448 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4449 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4450 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4451 Now constants, for GDB. They need not be macros.
4452 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4453 Now constants, for GDB, as well as macros, for static initializers.
4454 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4455 Move to after the definition of struct Lisp_Char_Table,
4456 since the former now needs that type defined.
4457 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4458 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4459 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4460 New enums, for gdb_make_enums_visible.
4461 (GLYPH_MODE_LINE_FACE): Remove; unused.
4462 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4463 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4464 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4465 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4466 enum maxargs, enum MAX_ALLOCA.
4467 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4468 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4469 no longer needed, now that they are done in lisp.h.
4470
4471 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4472
4473 Cleanup string bytes checking.
4474 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4475 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4476 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4477 (check_sblock, compact_small_strings): Simplify.
4478
4479 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4480
4481 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4482 These macros are confusing and no longer need to be defined, as
4483 the enum values now suffice. All uses replaced with definiens.
4484 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4485
4486 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4487
4488 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4489 ($(BLD)/w32console.$(O)): Update dependencies.
4490
4491 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4492
4493 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4494 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4495 time. Adjust users.
4496 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4497
4498 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4499
4500 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4501 setting sitelisp (Bug#12010).
4502
4503 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4504
4505 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4506
4507 * w32heap.c (cache_system_info):
4508 * w32.c (sys_rename):
4509 * w32proc.c (find_child_console, sys_kill): All users changed.
4510
4511 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4512
4513 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4514
4515 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4516
4517 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4518
4519 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4520
4521 Cleanup statistics calculation in Fgarbage_collect.
4522 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4523 Fix zombies percentage calculation. Simplify elapsed time calculation.
4524
4525 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4526
4527 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4528 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4529 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4530 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4531 (replace_range, replace_range_2, del_range_2): Change to eassert.
4532 * marker.c (byte_char_debug_check): Adjust style.
4533
4534 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4535
4536 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4537 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4538 long-ago-commented-out code that talks about "WIN32".
4539 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4540 All uses changed.
4541
4542 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4543
4544 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4545 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4546 Simplify by using alignof.
4547 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4548 * lisp.h: Include <stdalign.h>.
4549 (GCALIGNMENT): New macro and constant.
4550 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4551 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4552 (stdalign): New macro, if not already defined.
4553
4554 2012-07-28 Eli Zaretskii <eliz@gnu.org>
4555
4556 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4557 * w32inevt.c: Include w32inevt.h.
4558 (w32_read_console_input): New inline function, calls either
4559 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4560 w32_console_unicode_input.
4561 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4562 (w32_kbd_patch_key, key_event): Use the codepage returned by
4563 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4564 (key_event): use uChar.UnicodeChar only if
4565 w32_console_unicode_input is non-zero.
4566
4567 * w32console.c: Include w32heap.h.
4568 <w32_console_unicode_input>: New global variable.
4569 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4570 family of Windows, zero otherwise.
4571
4572 * w32inevt.h: Declare w32_console_unicode_input.
4573
4574 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4575 --without-x. (Bug#11742)
4576
4577 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4578
4579 Adjust GDB to reflect pvec_type changes (Bug#12036).
4580 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4581 2012-07-04 changes to pseudovector representation.
4582 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4583
4584 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
4585
4586 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4587 bus address.
4588 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4589
4590 2012-07-27 Eli Zaretskii <eliz@gnu.org>
4591
4592 * alloc.c (listn): Fix the order the arguments are consed onto the
4593 list.
4594
4595 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4596 enumeration constants, as PURE and HEAP are too general, and clash
4597 with other headers and sources, such as gmalloc.c and the
4598 MS-Windows system headers. All users changed.
4599
4600 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4601
4602 Revert last save_excursion_save and save_excursion_restore changes.
4603 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4604 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4605
4606 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4607
4608 Fix recently-introduced typos in Windows port.
4609 Reported by Martin Rudalics <rudalics@gmx.at>.
4610 * w32.c (init_environment): Replace comma with semicolon.
4611 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4612
4613 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4614
4615 Improve GDB symbol export (Bug#12036).
4616 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4617 arms of an 'if', not using conditional expressions; otherwise GDB
4618 complains about the types in the unevaluated arm when the argument
4619 is an integer literal.
4620 (xgetint): Simplify expression.
4621 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4622 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4623 Zaretskii in <http://bugs.gnu.org/12036#13>.
4624 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4625 needed now that we have gdb_make_enums_visible.
4626 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4627 (enum enum_USE_LSB_TAG):
4628 New enum types, packaging up enums that need to be exported to GDB.
4629
4630 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4631
4632 Utility function to make a list from specified amount of objects.
4633 * lisp.h (enum constype): New datatype.
4634 (listn): New prototype.
4635 * alloc.c (listn): New function.
4636 (Fmemory_use_count, syms_of_alloc): Use it.
4637 * buffer.c (syms_of_buffer): Likewise.
4638 * callint.c (syms_of_callint): Likewise.
4639 * charset.c (define_charset_internal): Likewise.
4640 * coding.c (syms_of_coding): Likewise.
4641 * keymap.c (syms_of_keymap): Likewise.
4642 * search.c (syms_of_search): Likewise.
4643 * syntax.c (syms_of_syntax): Likewise.
4644 * w32.c (init_environment): Likewise.
4645 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4646 * xdisp.c (syms_of_xdisp): Likewise.
4647 * xfns.c (syms_of_xfns): Likewise.
4648
4649 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4650
4651 Fast save_excursion_save and save_excursion_restore.
4652 * lisp.h (struct Lisp_Excursion): New data type.
4653 (PVEC_EXCURSION): New pseudovector type.
4654 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4655 to deal with it. Adjust comments.
4656 (init_marker, attach_marker): New prototype.
4657 (unchain_marker): Adjust prototype.
4658 * marker.c (attach_marker): Change to global.
4659 (init_marker): New function.
4660 * alloc.c (Fmake_marker, build_marker): Use it.
4661 (build_marker): More easserts.
4662 (mark_object): Handle struct Lisp_Excursion.
4663 * editfns.c (save_excursion_save, save_excursion_restore):
4664 Reimplement to use struct Lisp_Excursion. Add comments.
4665
4666 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4667
4668 Fix export of symbols to GDB (Bug#12036).
4669 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4670 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4671 emacs.c, as this is a more-suitable home. Had this been done earlier
4672 the fix for 12036 would have avoided some of the problems noted in
4673 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4674 would have been more obvious.
4675 * emacs.c: Do not include <verify.h>; no longer needed.
4676 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4677 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4678 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4679 Remove; now done in lisp.h.
4680 * lisp.h (PUBLISH_TO_GDB): New macro.
4681 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4682 (DATA_SEG_BITS): Use it.
4683 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4684 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4685 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4686 not be usable in #if. This simplifies things.
4687
4688 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
4689
4690 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4691
4692 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4693
4694 Simplify export of symbols to GDB (Bug#12036).
4695 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4696 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4697 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4698 Adjust to changes in lisp.h and emacs.c, by using
4699 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4700 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4701 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4702 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4703 instead of gdb_valbits.
4704 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4705 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4706 instead of gdb_array_mark_flag.
4707 (xboolvector): Get size from $->size, not $->header.size.
4708 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4709 (xreload, hook-run, hookpost-run): Remove.
4710 * emacs.c: Include <verify.h>.
4711 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4712 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4713 Remove.
4714 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4715 (gdb_USE_LSB_TAG): New enum constants.
4716 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4717 Also define these as enum constants, so they're visible to GDB.
4718 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4719 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4720 as constants, so they're visible to GDB.
4721 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4722 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4723 Now enum constants, not macros, so they're visible to GDB.
4724 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4725 more convenient now. All uses changed.
4726 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4727 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4728
4729 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4730
4731 Explicitly free restriction data that are not needed anymore.
4732 * editfns.c (save_restriction_restore): Free restriction data.
4733
4734 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4735
4736 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4737 add argument, tune behavior, and adjust all callers.
4738
4739 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4740
4741 Use typedef for EMACS_INT, EMACS_UINT.
4742 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4743 than macros. This simplifies debugging in the usual case, since
4744 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4745 and it allows expressions involving EMACS_INT casts.
4746 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4747
4748 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4749
4750 * nsterm.m (ns_read_socket): Return early if there is a modal
4751 window (Bug#12043).
4752
4753 2012-07-25 Martin Rudalics <rudalics@gmx.at>
4754
4755 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4756 that FOCUS-FRAME can be omitted.
4757
4758 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4759
4760 Adjust buffer text indirection counters at the end of Fkill_buffer.
4761 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4762 buffer is definitely dead. This should really fix an issue reported
4763 by Christoph Scholtes again. (Bug#12007).
4764 (init_buffer_once): Initialize indirection counters of
4765 buffer_defaults and buffer_local_symbols (for sanity and safety).
4766
4767 2012-07-24 Eli Zaretskii <eliz@gnu.org>
4768
4769 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4770 and continuation glyphs on tooltip frames, leave them at zero.
4771 Avoids continued lines in tooltips. (Bug#11832)
4772
4773 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4774
4775 Simplify copy_overlay.
4776 * buffer.c (copy_overlay): Simplify. Use build_marker.
4777 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4778
4779 2012-07-23 Eli Zaretskii <eliz@gnu.org>
4780
4781 * print.c (print_object): Don't crash when a frame's name is nil
4782 or invalid. (Bug#12025)
4783
4784 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4785 it signals an error when a tooltip frame is being created.
4786
4787 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4788
4789 Cleanup miscellaneous objects allocation and initialization.
4790 * alloc.c (allocate_misc): Change to static. Add argument to
4791 specify the subtype. Adjust comment and users.
4792 (build_overlay): New function.
4793 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4794 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4795 (allocate_misc): Remove prototype.
4796 (build_overlay): Add prototype.
4797
4798 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4799
4800 Swap buffer text indirection counters in Fbuffer_swap_text.
4801 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4802 This avoids crash reported by Christoph Scholtes at
4803 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4804
4805 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4806
4807 * nsmenu.m (Popdown_data): New struct.
4808 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4809 free Popdown_data.
4810 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4811 (initWithContentRect): Make imgView and contentView non-static
4812 and autorelease them. Also autorelease img and matrix (Bug#12005).
4813 (dealloc): Remove (Bug#12005).
4814
4815 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4816
4817 Adjust consing_since_gc when objects are explicitly freed.
4818 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4819 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4820 (free_cons, free_misc): Subtract object size from consing_since_gc.
4821
4822 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4823
4824 Simplify and cleanup markers positioning code.
4825 * marker.c (attach_marker): More useful eassert.
4826 (live_buffer, set_marker_internal): New function.
4827 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4828 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4829
4830 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4831
4832 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4833 as it's limited by the amount of memory, not by INT_MAX.
4834
4835 2012-07-21 Eli Zaretskii <eliz@gnu.org>
4836
4837 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4838 in special-event-map. See the discussion at
4839 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4840 for the reasons.
4841
4842 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4843 info.dwItemData. Fixes crashes on 64-bit Windows.
4844 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4845
4846 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4847
4848 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4849 (conversationIdentifier): Return value is NSInteger.
4850 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4851
4852 2012-07-21 Chong Yidong <cyd@gnu.org>
4853
4854 * window.c (decode_any_window): Signal an error if the window is
4855 on a dead frame (Bug#11984).
4856
4857 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4858
4859 Add indirection counting to speed up Fkill_buffer.
4860 * buffer.h (struct buffer): New member.
4861 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4862 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4863 base buffer indirection counter.
4864 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4865 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4866 through buffer list if indirection counter is 0.
4867
4868 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4869
4870 Extend the value returned by Fgarbage_collect with heap statistics.
4871 * alloc.c (Qheap): New symbol.
4872 (syms_of_alloc): DEFSYM it.
4873 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4874 (Fmemory_free): Remove.
4875 (syms_of_alloc): Don't defsubr it.
4876 * buffer.c (Fcompact_buffer): Remove.
4877 (syms_of_buffer): Don't defsubr it.
4878
4879 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4880
4881 Make maybe_gc inline.
4882 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4883 * lisp.h (consing_since_gc, gc_relative_threshold)
4884 (memory_full_cons_threshold): Revert declaration.
4885 (maybe_gc): Remove prototype, define as inline.
4886 * alloc.c: Remove old commented-out code.
4887 (consing_since_gc, gc_relative_threshold)
4888 (memory_full_cons_threshold): Revert to global.
4889 (maybe_gc): Remove.
4890
4891 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4892
4893 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4894 * lisp.h (build_unibyte_string): New function.
4895 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4896 * sysdep.c, w32fns.c, xfns.c: Use it.
4897 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4898 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4899 Adjust users accordingly.
4900 * font.h (font_open_by_name): Adjust prototype.
4901
4902 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4903
4904 Cleanup calls to Fgarbage_collect.
4905 * lisp.h (maybe_gc): New prototype.
4906 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4907 Remove declarations.
4908 * alloc.c (maybe_gc): New function.
4909 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4910 Make them static.
4911 * bytecode.c (MAYBE_GC): Use maybe_gc.
4912 * eval.c (eval_sub, Ffuncall): Likewise.
4913 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4914 to avoid dependency from auto-save feature.
4915
4916 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4917
4918 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4919 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4920 'for_each_per_buffer_object_at'.
4921 All uses changed. It's better to use upper-case for macros that
4922 cannot be implemented as functions, to give the reader a clue
4923 that they're special.
4924
4925 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4926
4927 * alloc.c (Fgarbage_collect): Tweak docstring.
4928
4929 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4930
4931 Tweak the value returned from Fgarbage_collect again.
4932 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4933 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4934 Adjust documentation.
4935 (total_vector_bytes): Rename to total_vector_slots, adjust
4936 accounting.
4937 (total_free_vector_bytes): Rename to total_free_vector_slots,
4938 adjust accounting.
4939 (Qstring_bytes, Qvector_slots): New symbols.
4940 (syms_of_alloc): DEFSYM them.
4941
4942 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4943
4944 Buffer compaction primitive which may be used from Lisp.
4945 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4946 (syms_of_buffer): Register Fcompact_buffer.
4947 * alloc.c (Fgarbage_collect): Use compact_buffer.
4948 * buffer.h (compact_buffer): New prototype.
4949 (struct buffer_text): New member.
4950
4951 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4952
4953 New macro to iterate over all buffers, miscellaneous cleanups.
4954 * lisp.h (all_buffers): Remove declaration.
4955 * buffer.h (all_buffers): Add declaration, with comment.
4956 (for_each_buffer): New macro.
4957 * alloc.c (Fgarbage_collect, mark_object): Use it.
4958 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4959 (init_buffer): Likewise.
4960 * data.c (Fset_default): Likewise.
4961 * coding.c (code_conversion_restore): Remove redundant check
4962 for dead buffer.
4963 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4964
4965 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4966
4967 Fix bug that created negative-length intervals.
4968 * intervals.c (merge_interval_right, merge_interval_left):
4969 Do not zero out this interval if it is absorbed by its children,
4970 as this interval's total length doesn't change in that case. See
4971 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4972
4973 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4974
4975 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4976 when invoking (make-bool-vector N t) and N is a positive
4977 multiple of 8 -- the last 8 bits were mistakenly cleared.
4978
4979 Remove some struct layout assumptions in bool vectors.
4980 * alloc.c (bool_header_size): New constant.
4981 (header_size, word_size): Move earlier, as they're now used earlier.
4982 Use 'word_size' in a few more places, where it's appropriate.
4983 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4984 padding before the data member of a bool vector.
4985 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4986 than doing the check by hand with an abort ().
4987
4988 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4989
4990 * eval.c (Fdefvar): Don't check constants since we only set the var if
4991 it's not yet defined anyway (bug#11904).
4992
4993 * lisp.h (last_undo_boundary): Declare new var.
4994 * keyboard.c (command_loop_1): Set it.
4995 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4996 were auto-added by the command loop (bug#11774).
4997
4998 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4999
5000 * w32font.c (Qsymbol): Remove local definition.
5001 (syms_of_w32font): Don't DEFSYM it.
5002
5003 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5004
5005 Fix sweep_vectors to handle large bool vectors correctly.
5006 * alloc.c (sweep_vectors): Account total_vector_bytes for
5007 bool vectors larger than VBLOCK_BYTES_MAX.
5008
5009 2012-07-18 Chong Yidong <cyd@gnu.org>
5010
5011 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5012 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5013
5014 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5015
5016 Return more descriptive data from Fgarbage_collect.
5017 Suggested by Stefan Monnier in
5018 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5019 * alloc.c (bounded_number): New function.
5020 (total_buffers, total_vectors): New variable.
5021 (total_string_size): Rename to total_string_bytes, adjust users.
5022 (total_vector_size): Rename to total_vector_bytes, adjust users.
5023 (sweep_vectors): Account total_vectors and total_vector_bytes.
5024 (Fgarbage_collect): New return value. Adjust documentation.
5025 (gc_sweep): Account total_buffers.
5026 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5027 (VECTOR_SIZE): Remove.
5028 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5029 (Qinterval, Qmisc): New symbols.
5030 (syms_of_data): Initialize them.
5031 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5032 (Qcons, Qbuffer): New declarations.
5033
5034 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5035
5036 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5037 Round up, not down. Improve doc.
5038
5039 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5040
5041 Restore old code in allocate_string_data to avoid Faset breakage.
5042 Reported by Julien Danjou <julien@danjou.info> in
5043 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5044 * alloc.c (allocate_string_data): Restore old code with minor
5045 adjustments, fix comment to explain this subtle issue.
5046
5047 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5048
5049 Remove FILE_SYSTEM_CASE.
5050 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5051
5052 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5053 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5054 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5055 call-process-region passes it through expand-file-name.
5056
5057 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5058
5059 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5060
5061 Fix crash when creating indirect buffer (Bug#11917)
5062 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5063 Don't handle unbound variables specially if non-zero.
5064 (Fbuffer_local_variables): Pass zero.
5065 (clone_per_buffer_values): Pass non-zero.
5066
5067 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5068
5069 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5070 to make the loop interruptible.
5071
5072 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5073
5074 * gnutls.c (emacs_gnutls_handshake): Only retry if
5075 GNUTLS_E_INTERRUPTED.
5076
5077 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5078
5079 Cleanup and convert miscellaneous checks to eassert.
5080 * alloc.c (mark_interval): Fix comment, partially rephrase
5081 old comment from intervals.h (see below).
5082 * intervals.c (find_interval, adjust_intervals_for_insertion)
5083 (delete_interval, adjust_intervals_for_deletion)
5084 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5085 Convert to eassert.
5086 (adjust_intervals_for_insertion, make_new_interval):
5087 Remove obsolete and unused code.
5088 * intervals.h (struct interval): Remove obsolete comment.
5089 * textprotp.c (erase_properties): Remove unused code.
5090 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5091 (Fremove_list_of_text_properties): Convert to eassert.
5092
5093 2012-07-17 Chong Yidong <cyd@gnu.org>
5094
5095 * editfns.c (Finsert_char): Doc fix.
5096
5097 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5098
5099 Fix previous change to make Fmemory_free always accurate.
5100 * alloc.c (make_interval): Update total_free_intervals.
5101 (make_float): Likewise for total_free_floats.
5102 (free_cons, Fcons): Likewise for total_free_conses.
5103 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5104 Likewise for total_free_vector_bytes.
5105 (Fmake_symbol): Likewise for total_free_symbols.
5106 (bytes_free): Remove.
5107
5108 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5109
5110 Simple free memory accounting feature.
5111 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5112 (sweep_vectors): Accumulate size of free vectors.
5113 (Fgarbage_collect): Setup bytes_free.
5114 (Fmemory_free): New function.
5115 (syms_of_alloc): Register it.
5116
5117 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5118
5119 Cleanup overlays checking.
5120 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5121 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5122 eassert and OVERLAYP.
5123 (sort_overlays): Change to use OVERLAYP.
5124
5125 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5126
5127 * editfns.c (Finsert_char): Make it interactive, and make the
5128 second arg optional. Copy interactive spec and docstring from
5129 ucs-insert.
5130
5131 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5132
5133 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5134 Unlike the other wrapped functions, fabs has an unspecified
5135 effect on errno.
5136
5137 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5138
5139 * nsterm.m (keyDown): Interpret flags without left/right bits
5140 as the left key (Bug#11670).
5141
5142 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5143
5144 Remove empty and useless init functions.
5145 * lisp.h (init_character_once, init_fns, init_image)
5146 (init_filelock, init_sound): Remove prototype.
5147 * character.c (init_character_once): Remove.
5148 * filelock.c (init_filelock): Likewise.
5149 * fns.c (init_fns): Likewise.
5150 * image.c (init_image): Likewise.
5151 * sound.c (init_sound): Likewise.
5152 * emacs.c (main): Adjust accordingly.
5153
5154 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5155
5156 * gtkutil.h: Tiny cleanups.
5157 (use_old_gtk_file_dialog): Remove useless declaration.
5158 (xg_uses_old_file_dialog): Add suggested const attribute.
5159
5160 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5161
5162 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5163 (bidi_paragraph_init): Use it to limit search forward for a strong
5164 directional character in abnormally large paragraphs full of
5165 neutral or weak characters. (Bug#11943)
5166
5167 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5168
5169 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5170 the toolbar (Bug#9451).
5171 (xg_make_tool_item): Give the widget event box a transparent
5172 background.
5173
5174 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5175
5176 Cleanup basic allocation variables and functions.
5177 * alloc.c (ignore_warnings, init_intervals, init_float)
5178 (init_cons, init_symbol, init_marker): Remove.
5179 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5180 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5181 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5182 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5183 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5184 (staticidx, init_alloc_once, init_strings, free_ablock):
5185 Remove redundant initialization.
5186 * fns.c (init_weak_hash_tables): Remove.
5187 * lisp.h (init_weak_hash_tables): Remove prototype.
5188
5189 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5190
5191 Use zero_vector where appropriate.
5192 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5193 accordingly.
5194 * lisp.h (zero_vector): New declaration.
5195 * font.c (null_vector): Remove.
5196 (syms_of_font): Remove initialization and staticpro.
5197 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5198 * keymap.c (Faccessible_keymaps): Likewise.
5199
5200 2012-07-15 Leo Liu <sdl.web@gmail.com>
5201
5202 * fringe.c: Fix typo in comments.
5203
5204 2012-07-14 Leo Liu <sdl.web@gmail.com>
5205
5206 * fringe.c: Add a new bitmap exclamation-mark.
5207
5208 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5209
5210 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5211
5212 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5213 (HAVE_MENUS): Don't define, defined by editing config.in with
5214 msdos/sed2v2.inp.
5215 (GMALLOC_INHIBIT_VALLOC): Don't define.
5216 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5217
5218 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5219
5220 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5221
5222 2012-07-14 Glenn Morris <rgm@gnu.org>
5223
5224 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5225 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5226 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5227
5228 2012-07-13 Glenn Morris <rgm@gnu.org>
5229
5230 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5231
5232 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5233 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5234
5235 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5236
5237 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5238 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5239 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5240 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5241 where appropriate.
5242 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5243 as boolean expression.
5244 (x_set_window_size): Remove unused variable toolbar.
5245 (ns_get_color_default, ns_mod_to_lisp): Remove.
5246 (ns_mouse_position): Remove unused variables xchar and ychar.
5247 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5248 (ns_set_vertical_scroll_bar): Remove unused variable count.
5249 (ns_delete_terminal): Remove unused variable i.
5250 (ns_term_init): Remove unused variables r, g and b.
5251 (mouseDown): Remove unused variable window.
5252 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5253 (initFrameFromEmacs): Remove unused variable vbextra.
5254 (mouseEntered): Remove unused variables p and dpyinfo.
5255 (mouseExited): Remove unused variables p and r.
5256 (ns_define_frame_cursor, ns_clear_frame_area)
5257 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5258 (menuDown): Assign [sender tag] to variable and cast the variable.
5259
5260 * nsterm.h (menuDown): Add id as type to argument sender.
5261 (ns_display_info_for_name): Add Lisp_Object argument.
5262 (ns_term_init): Add Lisp_Object argument.
5263 (ns_map_event_to_object): Add void argument.
5264 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5265 prototype with arguments and only declare if __OBJC__.
5266 (nxatoms_of_nsselect): Add void argument.
5267 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5268 (ns_alloc_autorelease_pool): Add void argument.
5269 (ns_release_autorelease_pool): Add void* argument.
5270 (ns_get_defaults_value): Add const char* argument.
5271
5272 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5273 (initFromContents): Use SSDATA where appropriate.
5274 (ns_update_menubar): Add braces to ambigous if-else.
5275 (initWithTitle): Put () around assignment in if statement.
5276 (ns_menu_show): Remove unused variables window and keymap.
5277 (update_frame_tool_bar): Remove unused variable selected_p.
5278 (initWithContentRect): Remove unused variable this_cmd_name.
5279
5280 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5281 appropriate.
5282 (setXBMColor): Remove unused variable len.
5283 (setPixmapData): Put () around assignment in loop statement.
5284
5285 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5286 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5287 where appropriate.
5288 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5289 around assignment in loop statement.
5290 (nsfont_open): Remove unused variable i.
5291 (nsfont_open): Remove unused variable len.
5292 (nsfont_draw): Remove unused variable cs.
5293
5294 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5295 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5296 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5297 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5298 (Fns_font_name, Fns_perform_service)
5299 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5300 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5301 (ns_set_name): Remove unused variable view.
5302 (x_set_menu_bar_lines): Remove unused variable olines.
5303 (x_set_tool_bar_lines): Remove unused variable root_window.
5304 (Fns_list_colors): Put () around assignment in while statement.
5305 (Fns_perform_service): Remove unused variable len.
5306 (Fns_display_usable_bounds): Remove unused variable top.
5307 (syms_of_nsfns): Remove unused variable i.
5308
5309 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5310 memcpy (Bug#11907).
5311
5312 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5313
5314 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5315 and free it with DestroyExceptionInfo (Bug#11558).
5316
5317 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5318
5319 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5320 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5321 Set here, not in nt/config.nt.
5322
5323 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5324
5325 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5326 cursor overflow into the last glyph on display line when the right
5327 fringe is off. (Bug#11832)
5328
5329 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5330
5331 * xdisp.c (produce_special_glyphs): Now static.
5332 * dispextern.h (produce_special_glyphs): Remove decl.
5333
5334 2012-07-13 Glenn Morris <rgm@gnu.org>
5335
5336 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5337 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5338
5339 * s/usg5-4-common.h (USG, USG5):
5340 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5341 * s/sol2-6.h (SOLARIS2):
5342 * s/irix6-5.h (IRIX6_5):
5343 * s/hpux10-20.h (USG, USG5, HPUX):
5344 * s/gnu-linux.h (USG, GNU_LINUX):
5345 * s/freebsd.h (BSD_SYSTEM):
5346 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5347 * s/cygwin.h (CYGWIN):
5348 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5349 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5350
5351 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5352
5353 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5354
5355 2012-07-13 Glenn Morris <rgm@gnu.org>
5356
5357 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5358
5359 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5360
5361 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5362 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5363
5364 2012-07-12 Glenn Morris <rgm@gnu.org>
5365
5366 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5367
5368 * process.c (init_process_emacs): Rename from init_process.
5369 The old name is also the name of a Mach system call.
5370 * lisp.h, emacs.c: Update for this name change.
5371 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5372 longer needed.
5373
5374 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5375
5376 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5377 memmove call that removes glyphs covered by the left truncation
5378 glyph. Improve commentary.
5379 (display_line): Fix display of continuation glyphs on GUI frames
5380 when the right fringe is turned off and variable-size fonts are
5381 used in the window. Move the code that appends a stretch glyph to
5382 produce_special_glyphs, so that it could be used for truncation
5383 and continuation glyphs alike.
5384 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5385 glyph of a suitably computed width, to align the special glyphs at
5386 the window margin. Code moved from display_line. (Bug#11832)
5387
5388 2012-07-12 Glenn Morris <rgm@gnu.org>
5389
5390 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5391
5392 * s/gnu-linux.h, s/hpux10-20.h:
5393 Do not unconditionally define HAVE_XRMSETDATABASE.
5394
5395 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5396
5397 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5398
5399 Fix typos that broke OS X build.
5400 Reported by Randal L. Schwartz in
5401 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5402 * nsterm.m (ns_timeout): Add missing local decl.
5403 (ns_get_color): snprintf -> sprintf, to fix typo.
5404
5405 2012-07-12 Glenn Morris <rgm@gnu.org>
5406
5407 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5408 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5409 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5410 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5411
5412 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5413 Move PTY_OPEN to configure.
5414
5415 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5416 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5417 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5418
5419 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5420
5421 Use empty_unibyte_string where applicable.
5422 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5423 * lread.c (read1): Likewise.
5424 * xsettings.c (syms_of_xsettings): Likewise.
5425
5426 2012-07-12 Glenn Morris <rgm@gnu.org>
5427
5428 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5429 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5430 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5431 * s/hpux10-20.h (RUN_TIME_REMAP):
5432 * s/bsd-common.h (TABDLY): Move to configure.
5433
5434 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5435
5436 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5437
5438 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5439 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5440
5441 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5442
5443 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5444 * s/template.h: Move NARROWPROTO to configure.
5445
5446 2012-07-11 Glenn Morris <rgm@gnu.org>
5447
5448 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5449 unused since 2011-01-17 change to systty.h.
5450
5451 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5452 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5453 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5454
5455 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5456
5457 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5458
5459 2012-07-11 Glenn Morris <rgm@gnu.org>
5460
5461 * s/darwin.h, s/gnu-linux.h, s/template.h:
5462 Move INTERRUPT_INPUT to configure.
5463
5464 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5465
5466 Minor adjustments to interning code.
5467 * lisp.h (intern, intern_c_string): Redefine as static inline
5468 wrappers for intern_1 and intern_c_string_1, respectively.
5469 (intern_1, intern_c_string_1): Rename prototypes.
5470 * lread.c (intern_1, intern_c_string_1, oblookup):
5471 Simplify Vobarray checking.
5472 * font.c (font_intern_prop): Likewise. Adjust comment.
5473 * w32font.c (intern_font_name): Likewise.
5474
5475 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5476
5477 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5478
5479 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5480 of Fcar/Fcdr if possible.
5481 * font.c (check_otf_features): Likewise.
5482 * fontset.c (Fnew_fontset): Likewise.
5483 * gnutls.c (Fgnutls_boot): Likewise.
5484 * minibuf.c (read_minibuf): Likewise.
5485 * msdos.c (IT_set_frame_parameters): Likewise.
5486 * xmenu.c (Fx_popup_dialog): Likewise.
5487 * w32menu.c (Fx_popup_dialog): Likewise.
5488
5489 2012-07-11 Glenn Morris <rgm@gnu.org>
5490
5491 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5492 since nothing has defined it on these platforms.
5493
5494 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5495 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5496
5497 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5498 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5499 Move CLASH_DETECTION to configure.
5500
5501 * s/gnu.h: Remove file, which is now empty.
5502
5503 * s/gnu.h, s/gnu-linux.h:
5504 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5505
5506 2012-07-11 John Wiegley <johnw@newartisans.com>
5507
5508 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5509 function attribute, so we only use it if it exists in the
5510 compiler.
5511
5512 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5513
5514 Avoid call to strlen in fast_c_string_match_ignore_case.
5515 * search.c (fast_c_string_match_ignore_case): Change to use
5516 length argument. Adjust users accordingly.
5517 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5518
5519 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5520
5521 Assume mkdir, rmdir.
5522 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5523 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5524
5525 Assume rename.
5526 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5527
5528 Assume perror.
5529 * s/hpux10-20.h (HAVE_PERROR): Remove.
5530 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5531 Remove dummy definition, as this problem was obsolete long ago.
5532
5533 Assume strerror.
5534 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5535
5536 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5537
5538 Avoid calls to strlen in font processing functions.
5539 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5540 (font_open_by_name): Change to use length argument.
5541 Adjust users accordingly.
5542 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5543 Adjust prototypes.
5544 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5545 Change to return ptrdiff_t.
5546 (xfont_list_pattern, xfont_match): Use length returned by
5547 xfont_decode_coding_xlfd.
5548 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5549
5550 2012-07-11 Glenn Morris <rgm@gnu.org>
5551
5552 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5553 Move DONT_REOPEN_PTY to configure.
5554
5555 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5556 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5557
5558 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5559
5560 Remove "#define unix" that is no longer needed (Bug#11905).
5561 * s/aix4-2.h (unix): Remove; no longer needed.
5562
5563 EMACS_TIME simplification (Bug#11875).
5564 This replaces macros (which typically do not work in GDB)
5565 with functions, typedefs and enums, making the code easier to debug.
5566 The functional style also makes code easier to read and maintain.
5567 * systime.h: Include <sys/time.h> on all hosts, not just if
5568 WINDOWSNT, since 'struct timeval' is needed in general.
5569 (EMACS_TIME): Now a typedef, not a macro.
5570 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5571 not macros.
5572 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5573 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5574 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5575 (EMACS_TIME_LE): Now functions, not macros.
5576 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5577 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5578 which are not functions. All uses rewritten to use:
5579 (make_emacs_time): New function.
5580 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5581 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5582 not functions. All uses rewritten to use the following, respectively:
5583 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5584 (add_emacs_time, sub_emacs_time): New functions.
5585 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5586 * fileio.c (Fcopy_file):
5587 * xterm.c (XTflash): Get the current time closer to when it's used.
5588 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5589
5590 * bytecode.c (targets): Suppress -Woverride-init warnings.
5591
5592 Simplify by avoiding confusing use of strncpy etc.
5593 * doc.c (Fsnarf_documentation):
5594 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5595 * frame.c (Fmake_terminal_frame):
5596 * gtkutil.c (get_utf8_string):
5597 * lread.c (openp):
5598 * nsmenu.m (ns_update_menubar):
5599 * regex.c (regerror):
5600 Prefer memcpy to strncpy and strncat when either will do.
5601 * fileio.c (Fsubstitute_in_file_name):
5602 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5603 (menu_separator_name_p):
5604 * nsmenu.m (ns_update_menubar):
5605 Prefer memcmp to strncmp when either will do.
5606 * nsterm.m: Include <ftoastr.h>.
5607 (ns_get_color):
5608 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5609 Prefer snprintf to strncpy.
5610 * nsterm.m (ns_term_init):
5611 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5612 * nsterm.m (ns_term_init):
5613 Avoid the need for strncpy, by using build_string or
5614 make_unibyte_string directly. Use dtoastr, not snprintf.
5615 * process.c (Fmake_network_process): Diagnose service names that
5616 are too long, rather than silently truncating them or creating
5617 non-null-terminated names.
5618 (Fnetwork_interface_info): Likewise, for interface names.
5619 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5620 Prefer sprintf to strncat.
5621 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5622 Prefer vsnprintf to vsprintf + strncpy.
5623
5624 2012-07-10 Glenn Morris <rgm@gnu.org>
5625
5626 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5627 Clarify fallback case.
5628
5629 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5630
5631 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5632 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5633 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5634 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5635 where argument type is known to be a Lisp_Cons.
5636
5637 2012-07-10 Tom Tromey <tromey@redhat.com>
5638
5639 * bytecode.c (BYTE_CODE_THREADED): New macro.
5640 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5641 (enum byte_code_op): New type.
5642 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5643 (exec_byte_code): Use them. Use token threading when applicable.
5644
5645 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5646
5647 Optimize pure C strings initialization.
5648 * lisp.h (make_pure_string): Fix prototype.
5649 (build_pure_c_string): New function, defined as static inline. This
5650 provides a better opportunity to optimize away calls to strlen when
5651 the function is called with compile-time constant argument.
5652 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5653 argument, adjust users accordingly. Use build_pure_c_string where
5654 appropriate.
5655 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5656 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5657 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5658
5659 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5660
5661 Avoid calls to strlen in miscellaneous functions.
5662 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5663 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5664 * lread.c (openp): Likewise.
5665
5666 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5667
5668 Avoid calls to strlen in path processing functions.
5669 * fileio.c (file_name_as_directory): Add comment. Change to add
5670 srclen argument and return the length of result. Adjust users
5671 accordingly.
5672 (directory_file_name): Fix comment. Change to add srclen argument,
5673 swap 1st and 2nd arguments to obey the common convention.
5674 Adjust users accordingly.
5675 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5676
5677 2012-07-10 Glenn Morris <rgm@gnu.org>
5678
5679 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5680 Move PENDING_OUTPUT_COUNT definition to configure.
5681
5682 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5683 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5684 * s/gnu.h (DATA_START): Move definitions to configure.
5685
5686 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5687 We include usg5-4-common.h, which defines them both.
5688
5689 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5690 O_RDONLY already includes it).
5691
5692 Stop ns builds setting the EMACSLOADPATH environment variable.
5693 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5694 Now it does not set EMACSLOADPATH, just returns the load-path string.
5695 * nsterm.h: Update accordingly.
5696 * lread.c [HAVE_NS]: Include nsterm.h.
5697 (init_lread) [HAVE_NS]: Use ns_load_path.
5698 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5699
5700 2012-07-09 Glenn Morris <rgm@gnu.org>
5701
5702 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5703 since the included bsd-common.h does so.
5704
5705 Stop ns builds setting the EMACSPATH environment variable.
5706 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5707 (ns_init_paths): Do not set EMACSPATH.
5708 * nsterm.h (ns_exec_path): Add it.
5709 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5710 Use ns_exec_path.
5711
5712 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5713
5714 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5715
5716 * process.c (wait_reading_process_output): 'waitchannels' was unset
5717 when read_kbd || !NILP (wait_for_cell); fix this.
5718
5719 Add GCC-style 'const' attribute to functions that can use it.
5720 * character.h (char_resolve_modifier_mask):
5721 * keyboard.h (make_ctrl_char):
5722 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5723 (init_character_once, next_almost_prime, init_fns, init_image)
5724 (flush_pending_output, init_sound):
5725 * mem-limits.h (start_of_data):
5726 * menu.h (finish_menu_items):
5727 Add ATTRIBUTE_CONST.
5728 * emacs.c (DEFINE_DUMMY_FUNCTION):
5729 Declare the dummy function with ATTRIBUTE_CONST.
5730 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5731 Add decls with ATTRIBUTE_CONST.
5732
5733 Minor improvements to make_formatted_string.
5734 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5735 where int is good enough, as vsprintf returns an int.
5736 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5737
5738 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5739
5740 Use make_formatted_string to avoid double length calculation.
5741 * lisp.h (make_formatted_string): New prototype.
5742 * alloc.c (make_formatted_string): New function.
5743 * buffer.c (Fgenerate_new_buffer_name): Use it.
5744 * dbus.c (syms_of_dbusbind): Likewise.
5745 * editfns.c (Fcurrent_time_zone): Likewise.
5746 * filelock.c (get_boot_time): Likewise.
5747 * frame.c (make_terminal_frame, set_term_frame_name)
5748 (x_report_frame_params): Likewise.
5749 * image.c (gs_load): Likewise.
5750 * minibuf.c (get_minibuffer): Likewise.
5751 * msdos.c (dos_set_window_size): Likewise.
5752 * process.c (make_process): Likewise.
5753 * xdisp.c (ensure_echo_area_buffers): Likewise.
5754 * xsettings.c (apply_xft_settings): Likewise.
5755
5756 2012-07-09 Glenn Morris <rgm@gnu.org>
5757
5758 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5759 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5760 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5761 * nsterm.h (ns_etc_directory): Add it.
5762 * callproc.c [HAVE_NS]: Include nsterm.h.
5763 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5764
5765 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5766
5767 Move marker debugging code under MARKER_DEBUG.
5768 * marker.c (MARKER_DEBUG): Move marker debugging code under
5769 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5770 for bootstrap with --enable-checking (~3x slowdown reported
5771 by Juanma Barranquero <lekktu@gmail.com>).
5772 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5773
5774 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5775
5776 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5777 See <http://bugs.gnu.org/11825#29>.
5778
5779 2012-07-08 Eli Zaretskii <eliz@gnu.org>
5780
5781 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5782 has no font, use the frame's font. (Bug#11813)
5783 (display_line): Add commentary about displaying truncation glyphs
5784 on GUI frames.
5785 (produce_special_glyphs): Move here from term.c.
5786
5787 * term.c (produce_special_glyphs): Move to xdisp.c.
5788
5789 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5790 section.
5791
5792 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5793
5794 * xdisp.c (display_line): Avoid warning about implicit declaration
5795 of FRAME_FONT.
5796
5797 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5798
5799 * lisp.h: Remove empty conditional.
5800
5801 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5802
5803 * lread.c (load_path_check): Now static.
5804
5805 Fix some minor --with-ns problems found by static checking.
5806 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5807 (x_set_font) [!HAVE_X_WINDOWS]:
5808 * image.c (xpm_load_image) [HAVE_NS]:
5809 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5810 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5811 Remove unused local.
5812 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5813 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5814 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5815 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5816 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5817 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5818 Fix pointer signedness problem.
5819 * xfaces.c (FRAME_X_FONT_TABLE):
5820 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5821
5822 2012-07-07 Glenn Morris <rgm@gnu.org>
5823
5824 * lread.c (load_path_check): New function, split from init_lread.
5825 (init_lread): Reorganize. Motivation:
5826 If EMACSLOADPATH is set, check/warn about that rather than the
5827 defaults, which we are not going to use. Hence we can remove
5828 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5829 Don't warn if site-lisp directories are missing.
5830 If not installed, start from a blank load-path, since
5831 PATH_LOADSEARCH refers to the eventual installation directories.
5832
5833 2012-07-07 Eli Zaretskii <eliz@gnu.org>
5834
5835 Support truncation and continuation glyphs on GUI frames, when
5836 fringes are disabled. (Bug#11832)
5837 * xdisp.c (init_iterator): Get dimensions of truncation and
5838 continuation glyphs even if on GUI frames.
5839 Adjust it->last_visible_x on GUI frames when the left or right fringes,
5840 or both, are absent.
5841 (start_display, move_it_in_display_line_to): Handle the case of a
5842 GUI frame without a fringe to display continuation or truncation
5843 glyphs.
5844 (insert_left_trunc_glyphs): Support GUI frames: make sure
5845 truncation glyphs overwrite enough glyphs from the current line to
5846 have sufficient space in pixels.
5847 (display_line): Support truncation and continuation glyphs on GUI
5848 frames. If some spare pixels are left on the line after inserting
5849 the truncation glyphs, fill that space with a stretch glyph of a
5850 suitably computed width.
5851
5852 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5853 produce_glyphs, to support GUI sessions.
5854
5855 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5856
5857 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5858
5859 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5860
5861 Do not require float-time's arg to fit in time_t (Bug#11825).
5862 This works better on hosts where time_t is unsigned, and where
5863 float-time is applied to the (negative) difference between two times.
5864 * editfns.c (decode_time_components): Last arg is now double *,
5865 not int *, and means to store all the result as a double, without
5866 worrying about whether the seconds part fits in time_t.
5867 All callers changed.
5868 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5869 All callers changed.
5870 (Ffloat_time): Do not fail merely because the specified time falls
5871 outside of time_t range.
5872
5873 2012-07-07 Glenn Morris <rgm@gnu.org>
5874
5875 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5876 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5877 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5878
5879 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
5880
5881 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5882 Update dependencies.
5883
5884 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5885
5886 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5887
5888 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5889 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5890 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5891 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5892 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5893 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5894
5895 * xfont.c (compare_font_names): Redo to omit the need for casts.
5896
5897 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5898
5899 * xfns.c (Fx_change_window_property): Doc fix.
5900 * w32fns.c (Fx_change_window_property): Doc fix.
5901
5902 * w32fns.c (Fx_window_property): Accept the same arguments as the
5903 X Windows version. Doc fix.
5904 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5905
5906 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5907 Eli Zaretskii <eliz@gnu.org>
5908
5909 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5910 Windows-specific code from nt/config.nt moved here.
5911 Obsolete settings removed.
5912
5913 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5914
5915 * process.c: Avoid unnecessary calls to gettime.
5916 (wait_reading_process_output): Don't get the time of day
5917 when gobbling data immediately and not waiting, as there's no need
5918 for it in that case. This removes a FIXME.
5919
5920 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5921
5922 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5923 is defined (Bug#11768).
5924
5925 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5926
5927 Fix marker debugging code.
5928 * marker.c (byte_char_debug_check): Do not perform the check
5929 if buffer is not multibyte.
5930 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5931 Call byte_char_debug_check with correct arguments.
5932
5933 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5934
5935 Compile marker debugging code only if ENABLE_CHECKING is defined.
5936 * marker.c (byte_char_debug_check, count_markers):
5937 Use only if ENABLE_CHECKING is defined.
5938 (byte_debug_flag): Remove.
5939 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5940 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5941
5942 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5943
5944 Avoid code repetition in marker-related functions.
5945 * marker.c (attach_marker): New function.
5946 (Fset_marker, set_marker_restricted, set_marker_both)
5947 (set_marker_restricted_both): Use it.
5948 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5949 Consistently rename charno to charpos.
5950 (marker_position): Add eassert.
5951 (marker_byte_position): Convert to eassert.
5952
5953 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5954
5955 Simplify list operations in unchain_overlay and unchain_marker.
5956 * buffer.c (unchain_overlay): Simplify. Add comment.
5957 * marker.c (unchain_marker): Simplify. Fix comments.
5958
5959 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5960
5961 Introduce fast path for the widely used marker operation.
5962 * alloc.c (build_marker): New function.
5963 * lisp.h (build_marker): New prototype.
5964 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5965 * composite.c (autocmp_chars): Likewise.
5966 * editfns.c (buildmark): Remove.
5967 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5968 (save_restriction_save): Use build_marker.
5969 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5970 * window.c (save_window_save): Likewise.
5971
5972 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5973
5974 Do not use Fdelete_overlay in delete_all_overlays
5975 to avoid redundant calls to unchain_overlay.
5976 * buffer.c (drop_overlay): New function.
5977 (delete_all_overlays, Fdelete_overlay): Use it.
5978 * minibuf.c (get_minibuffer): Fix comment.
5979
5980 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5981
5982 Port to OpenBSD 5.1 amd64.
5983 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5984 This is needed for OpenBSD, and should be harmless on all BSD systems.
5985 Also, include <sys/sysctl.h>, as it should be available on all
5986 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5987 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5988 use p_pid member, not kp_proc.pid.
5989
5990 2012-07-06 Glenn Morris <rgm@gnu.org>
5991
5992 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5993
5994 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5995
5996 More xmalloc and related cleanup.
5997 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5998 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5999 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6000 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6001 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6002 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6003 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6004 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6005 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6006 * xterm.c:
6007 Omit needless casts involving void * pointers and allocation.
6008 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6009 as the former is more robust if P's type is changed.
6010 Prefer xzalloc to xmalloc + memset 0.
6011 Simplify malloc-or-realloc to realloc.
6012 Don't worry about xmalloc returning a null pointer.
6013 Prefer xstrdup to xmalloc + strcpy.
6014 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6015 growing it.
6016 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6017 alloca of a constant.
6018
6019 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6020
6021 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6022 hscroll is larger than the line width. Fixes long and futile
6023 looping inside extend_face_to_end_of_line (on a TTY) producing
6024 glyphs that are not needed and thrown away.
6025
6026 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6027
6028 * marker.c (set_marker_restricted_both): Simplify by using
6029 clip_to_bounds.
6030
6031 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6032
6033 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6034
6035 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6036
6037 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6038 not defined (Bug#11768).
6039 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6040 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6041 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6042 followed by gtk_box_set_homogeneous (Bug#11768).
6043 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6044 (update_theme_scrollbar_width, xg_create_scroll_bar):
6045 Use gtk_scrollbar_new (Bug#11768).
6046 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6047 (is_box_type): New function (Bug#11768).
6048 (xg_tool_item_stale_p): Call is_box_type.
6049 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6050 with default display (Bug#11768).
6051
6052 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6053
6054 * xdisp.c (window_hscroll_limited): New function.
6055 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6056 coordinates when window's hscroll is set to insanely large
6057 values. (Bug#11857)
6058
6059 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6060
6061 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6062 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6063
6064 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6065
6066 Cleanup xmalloc.
6067 * lisp.h (xzalloc): New prototype. Omit needless casts.
6068 * alloc.c (xzalloc): New function. Omit needless casts.
6069 * charset.c: Omit needless casts. Convert all calls to
6070 xmalloc with following memset to xzalloc.
6071 * dispnew.c: Likewise.
6072 * fringe.c: Likewise.
6073 * image.c: Likewise.
6074 * sound.c: Likewise.
6075 * term.c: Likewise.
6076 * w32fns.c: Likewise.
6077 * w32font.c: Likewise.
6078 * w32term.c: Likewise.
6079 * xfaces.c: Likewise.
6080 * xfns.c: Likewise.
6081 * xterm.c: Likewise.
6082 * atimer.c: Omit needless casts.
6083 * buffer.c: Likewise.
6084 * callproc.c: Likewise.
6085 * ccl.c: Likewise.
6086 * coding.c: Likewise.
6087 * composite.c: Likewise.
6088 * doc.c: Likewise.
6089 * doprnt.c: Likewise.
6090 * editfns.c: Likewise.
6091 * emacs.c: Likewise.
6092 * eval.c: Likewise.
6093 * filelock.c: Likewise.
6094 * fns.c: Likewise.
6095 * gtkutil.c: Likewise.
6096 * keyboard.c: Likewise.
6097 * lisp.h: Likewise.
6098 * lread.c: Likewise.
6099 * minibuf.c: Likewise.
6100 * msdos.c: Likewise.
6101 * print.c: Likewise.
6102 * process.c: Likewise.
6103 * region-cache.c: Likewise.
6104 * search.c: Likewise.
6105 * sysdep.c: Likewise.
6106 * termcap.c: Likewise.
6107 * terminal.c: Likewise.
6108 * tparam.c: Likewise.
6109 * w16select.c: Likewise.
6110 * w32.c: Likewise.
6111 * w32reg.c: Likewise.
6112 * w32select.c: Likewise.
6113 * w32uniscribe.c: Likewise.
6114 * widget.c: Likewise.
6115 * xdisp.c: Likewise.
6116 * xmenu.c: Likewise.
6117 * xrdb.c: Likewise.
6118 * xselect.c: Likewise.
6119
6120 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6121
6122 * fileio.c (time_error_value): Check the right error number.
6123 Problem reported by Troels Nielsen in
6124 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6125
6126 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6127
6128 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6129 This should be fixed in a better way; see Eli Zaretskii in
6130 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6131 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6132
6133 * fileio.c (time_error_value): Rename from special_mtime.
6134 The old name's problems were noted by Eli Zaretskii in
6135 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6136
6137 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6138 This variable's comment says Emacs needs at least one GDB-visible
6139 symbol of type enum pvec_type, to work around GDB problems.
6140 The symbol's value doesn't matter.
6141
6142 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6143 that causes compilation to fail on pre-C99 compilers.
6144
6145 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6146
6147 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6148 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6149
6150 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6151
6152 * buffer.c (init_buffer_once): Fix initialization of
6153 headers for buffer_defaults and buffer_local_symbols.
6154 Reported by Juanma Barranquero <lekktu@gmail.com>.
6155
6156 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6157
6158 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6159 * lisp.h (enum pvec_type): Use fewer bits.
6160 (PSEUDOVECTOR_SIZE_BITS): New constant.
6161 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6162 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6163 change in pvec_type.
6164 (PSEUDOVECTOR_TYPEP): New macro.
6165 (TYPED_PSEUDOVECTORP): Use it.
6166 * fns.c (internal_equal): Adapt code to extract pvectype.
6167 * emacs.c (gdb_pvec_type): Update type.
6168 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6169 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6170 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6171 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6172 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6173 abusing vector->header.next.nbytes.
6174 (live_vector_p): Use PVEC_TYPE.
6175 (mark_object): Adapt code to extract pvectype. Use switch.
6176
6177 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6178
6179 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6180 Tighten new eassert a bit.
6181
6182 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6183
6184 Fix compilation with --enable-gcc-warnings and -O1
6185 optimization level.
6186 * doprnt.c (doprnt): Change type of tem to int, initialize
6187 to avoid compiler warning. Add eassert.
6188 * search.c (simple_search): Initialize match_byte to avoid
6189 compiler warning. Add eassert.
6190
6191 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6192
6193 Avoid weird behavior with large horizontal scrolls.
6194 Without this change, for example, large hscroll values would
6195 mess up Emacs's display on Fedora 15 x86, presumably due to
6196 overflows in int calculations in the display code.
6197 Also, if buffers had long lines, Emacs would freeze.
6198 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6199 (set_window_hscroll): New function, containing the old guts of
6200 Fset_window_hscroll. Return the clipped value.
6201 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6202 This avoids the need to check against PTRDIFF_MAX.
6203
6204 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6205
6206 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6207
6208 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6209
6210 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6211
6212 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6213 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6214 since GCC 4.4.6 issues a bogus warning for them.
6215
6216 Fix bugs in file timestamp newness comparisons.
6217 * fileio.c (Ffile_newer_than_file_p):
6218 * lread.c (Fload): Use full timestamp resolution of files,
6219 not just the 1-second resolution, so that files that are only
6220 slightly newer still count as newer.
6221 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6222 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6223
6224 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6225
6226 * fileio.c: Improve handling of file time marker. (Bug#11852)
6227 (special_mtime): New function.
6228 (Finsert_file_contents, Fverify_visited_file_modtime):
6229 Use it to set special mtime values consistently.
6230
6231 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6232
6233 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6234 marker for non-existing file. (Bug#11852)
6235
6236 2012-07-03 Glenn Morris <rgm@gnu.org>
6237
6238 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6239 and did not make it into globals.h).
6240
6241 2012-07-03 Tom Tromey <tromey@redhat.com>
6242
6243 * window.c (Fset_window_margins, Fset_window_fringes)
6244 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6245 * textprop.c (Fprevious_property_change): No longer static.
6246 * syntax.c (Fsyntax_table_p): No longer static.
6247 * process.c (Fget_process, Fprocess_datagram_address): No longer
6248 static.
6249 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6250 * keyboard.c (Fcommand_execute): No longer static.
6251 Remove EXFUN.
6252 * insdel.c (Fcombine_after_change_execute): No longer static.
6253 * image.c (Finit_image_library): No longer static.
6254 * fileio.c (Fmake_symbolic_link): No longer static.
6255 * eval.c (Ffetch_bytecode): No longer static.
6256 * editfns.c (Fuser_full_name): No longer static.
6257 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6258 No longer static.
6259 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6260 static.
6261 * dired.c (Ffile_attributes): No longer static.
6262 * composite.c (Fcomposition_get_gstring): No longer static.
6263 * callproc.c (Fgetenv_internal): No longer static.
6264
6265 * ccl.h: Remove EXFUNs.
6266 * buffer.h: Remove EXFUNs.
6267 * dispextern.h: Remove EXFUNs.
6268 * intervals.h: Remove EXFUNs.
6269 * fontset.h: Remove EXFUN.
6270 * font.h: Remove EXFUNs.
6271 * dosfns.c (system_process_attributes): Remove EXFUN.
6272 * keymap.h: Remove EXFUNs.
6273 * lisp.h: Remove EXFUNs.
6274 * w32term.h: Remove EXFUNs.
6275 * window.h: Remove EXFUNs.
6276 * xsettings.h: Remove EXFUN.
6277 * xterm.h: Remove EXFUN.
6278
6279 2012-07-03 Glenn Morris <rgm@gnu.org>
6280
6281 * lisp.h (Frandom): Make it visible to C.
6282 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6283 buffer for invisible buffers. (Bug#1229)
6284
6285 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6286
6287 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6288 values which aren't power of 2.
6289 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6290 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
6291 accordingly.
6292
6293 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6294
6295 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6296
6297 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6298
6299 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6300
6301 * alloc.c (allocate_vector_block): Remove redundant
6302 calls to mallopt if DOUG_LEA_MALLOC is defined.
6303 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6304 avoid calls to mallopt if zero_vector is returned.
6305
6306 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6307
6308 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6309 is enabled, avoid dereferencing NULL current_sblock if
6310 running undumped.
6311
6312 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6313
6314 Cleanup basic buffer management.
6315 * buffer.h (struct buffer): Change layout to use generic vector
6316 marking code. Fix some comments. Change type of 'clip_changed'
6317 to bitfield. Remove unused #ifndef old.
6318 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6319 (GET_OVERLAYS_AT): Fix indentation.
6320 (for_each_per_buffer_object_at): New macro.
6321 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6322 (Fbuffer_local_variables): Use it.
6323 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6324 * alloc.c (allocate_buffer): Adjust to match new layout of
6325 struct buffer. Fix comment.
6326 (mark_overlay): New function.
6327 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6328 Lisp area of struct buffer.
6329 (mark_object): Use it. Adjust marking of misc objects
6330 and related comments.
6331
6332 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6333
6334 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6335 wrapper that is not needed because the wrapped code is a no-op (zero
6336 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6337 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6338
6339 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6340
6341 * alloc.c (mark_buffer): Simplify. Remove prototype.
6342 (mark_object): Add comment. Reorganize marking of vector-like
6343 objects. Use CHECK_LIVE for all vector-like objects except buffers
6344 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6345 Avoid redundant calls to mark_vectorlike for bool vectors.
6346
6347 2012-06-30 Glenn Morris <rgm@gnu.org>
6348
6349 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6350
6351 * epaths.in (PATH_SITELOADSEARCH): New.
6352 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6353 This is rather than relying on --enable-locallisppath elements
6354 having "site-lisp" in their names. (Bug#10208#25, 11658)
6355
6356 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6357
6358 * w32proc.c (sys_select): Accept and ignore one more argument.
6359
6360 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6361
6362 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6363 (pselect) [!MS_DOS]: Redirect to sys_select.
6364
6365 * sysdep.c: Don't include dos.h and dosfns.h.
6366
6367 * process.c (sys_select):
6368 * msdos.c (sys_select): Accept one more argument and ignore it.
6369
6370 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6371 adapt data types and code to that.
6372
6373 * dosfns.c:
6374 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6375 which clashes with the gnulib function of the same name.
6376
6377 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6378
6379 * font.c (font_style_to_value, font_style_symbolic)
6380 (font_prop_validate_style): Add type checks for values in
6381 font_style_table.
6382
6383 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6384 argument.
6385 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6386 uses.
6387
6388 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6389
6390 * xdisp.c (try_window_id): Undo last change.
6391
6392 * w32.c (getwd): Adjust commentary about startup_dir.
6393 (init_environment): Always call sys_access, even in non-MSVC
6394 builds. Don't chdir to the directory of the Emacs executable.
6395 This undoes code from 1997 which was justified by the need to
6396 "avoid conflicts when removing and renaming directories". But its
6397 downside was that every relative file name was being interpreted
6398 relative to the directory of the Emacs executable, which can never
6399 be TRT. In particular, it broke sys_access when called with
6400 relative file names.
6401 (sys_access): Map GetLastError to errno.
6402
6403 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6404
6405 * window.h (struct window): Change type of 'fringes_outside_margins'
6406 to bitfield. Fix comment. Adjust users accordingly.
6407 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6408 Adjust comment.
6409 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6410 to ptrdiff_t.
6411
6412 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6413
6414 * gnutls.c (emacs_gnutls_handshake):
6415 Add QUIT to make the loop interruptible.
6416
6417 2012-06-29 Glenn Morris <rgm@gnu.org>
6418
6419 * charset.c (init_charset): Make lack of etc/charsets fatal.
6420
6421 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6422
6423 * editfns.c (region_limit): Fix type mismatch.
6424
6425 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6426
6427 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6428 undefined. Convert from xassert to eassert.
6429 * nsmenu.m: Convert from xassert to eassert.
6430 * nsterm.m: Likewise.
6431
6432 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6433
6434 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6435
6436 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6437
6438 Avoid integer overflow on scroll-left and scroll-right.
6439 * window.c (HSCROLL_MAX): New macro.
6440 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6441 overflow when requested scroll falls outside ptrdiff_t range.
6442
6443 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6444
6445 * window.h (struct window): Change type of 'hscroll',
6446 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6447 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6448 Adjust users accordingly.
6449 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6450 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6451 from EMACS_INT to ptrdiff_t.
6452 (make_window): Omit redundant initialization.
6453
6454 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
6455
6456 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6457
6458 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6459
6460 * window.h (struct window): Change type of 'use_time' and
6461 'sequence_number' from Lisp_Object to int.
6462 * frame.c (make_frame): Adjust users accordingly.
6463 * print.c (print_object): Likewise.
6464 * window.c (select_window, Fwindow_use_time, make_parent_window)
6465 (make_window): Likewise.
6466
6467 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6468
6469 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6470 enabled with --enable-checking=[all,glyphs] configure option.
6471 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6472 adjust comments accordingly.
6473 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6474 undefined, adjust comments accordingly.
6475 * image.c: Likewise.
6476 * scroll.c: Likewise.
6477 * w32fns.c: Likewise.
6478 * w32term.c: Likewise.
6479 * xdisp.c: Likewise.
6480 * xfaces.c: Likewise.
6481 * xfns.c: Likewise.
6482 * xterm.c: Likewise.
6483
6484 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6485
6486 Generalize run-time debugging checks.
6487 * dispextern.h (XASSERTS): Remove.
6488 * fontset.c (xassert): Remove.
6489 Convert from xassert to eassert.
6490 * alloc.c: Convert from xassert to eassert.
6491 * bidi.c: Likewise.
6492 * dispnew.c: Likewise.
6493 * fns.c: Likewise.
6494 * fringe.c: Likewise.
6495 * ftfont.c: Likewise.
6496 * gtkutil.c: Likewise.
6497 * image.c: Likewise.
6498 * keyboard.c: Likewise.
6499 * menu.c: Likewise.
6500 * process.c: Likewise.
6501 * scroll.c: Likewise.
6502 * sound.c: Likewise.
6503 * term.c: Likewise.
6504 * w32console.c: Likewise.
6505 * w32fns.c: Likewise.
6506 * w32term.c: Likewise.
6507 * window.c: Likewise.
6508 * xdisp.c: Likewise.
6509 * xfaces.c: Likewise.
6510 * xfns.c: Likewise.
6511 * xselect.c: Likewise.
6512 * xterm.c: Likewise.
6513
6514 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6515
6516 * fns.c (maybe_resize_hash_table): Output message when growing the
6517 purify-hashtable.
6518
6519 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6520
6521 * alloc.c (allocate_string_data): Remove dead code.
6522 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6523 avoid GCC warning about unused macro.
6524
6525 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6526
6527 * alloc.c (allocate_string): Omit intervals initialization.
6528 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6529 as in make_pure_string and make_pure_c_string.
6530
6531 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6532
6533 * alloc.c (allocate_string): Fix last change.
6534
6535 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6536
6537 * alloc.c (allocate_string): Remove two redundant calls
6538 to memset, add explicit initialization where appropriate.
6539
6540 2012-06-27 Glenn Morris <rgm@gnu.org>
6541
6542 * lisp.mk (lisp): Remove paths.elc.
6543
6544 2012-06-27 Chong Yidong <cyd@gnu.org>
6545
6546 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6547
6548 2012-06-26 John Wiegley <johnw@newartisans.com>
6549
6550 * unexmacosx.c (copy_data_segment): Add two section names used
6551 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6552
6553 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6554 when building with Clang.
6555
6556 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6557
6558 * eval.c (Fapply): Allow calling it with a single argument.
6559
6560 2012-06-26 Eli Zaretskii <eliz@gnu.org>
6561
6562 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6563 _stricmp and _strnicmp.
6564 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6565
6566 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6567
6568 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6569 allocated window.
6570 (allocate_process): Likewise for new process.
6571 (allocate_terminal): Change to use offsetof.
6572 (allocate_frame): Likewise.
6573 * frame.c (make_frame): Omit redundant initialization.
6574 * window.c (make_parent_window): Use memset.
6575 (make_window): Omit redundant initialization.
6576 * process.c (make_process): Omit redundant initialization.
6577 * terminal.c (create_terminal): Likewise.
6578
6579 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6580
6581 * term.c (delete_tty): Remove redundant call to memset.
6582
6583 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6584
6585 * alloc.c: Remove build_string.
6586 * lisp.h: Define build_string as static inline. This provides
6587 a better opportunity to optimize away calls to strlen when the
6588 function is called with compile-time constant argument.
6589 * image.c (imagemagick_error): Convert to build_string.
6590 * w32proc.c (sys_spawnve): Likewise.
6591 * xterm.c (x_term_init): Likewise.
6592
6593 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6594
6595 Use sprintf return value instead of invoking strlen on result.
6596 In the old days this wasn't portable, since some sprintf
6597 implementations returned char *. But they died out years ago and
6598 Emacs already assumes sprintf returns int.
6599 Similarly for float_to_string.
6600 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6601 * ccl.c (ccl_driver):
6602 * character.c (string_escape_byte8):
6603 * data.c (Fnumber_to_string):
6604 * doprnt.c (doprnt):
6605 * print.c (print_object):
6606 * xdisp.c (message_dolog):
6607 * xfns.c (syms_of_xfns):
6608 Use sprintf or float_to_string result to avoid need to call strlen.
6609 * data.c (Fnumber_to_string):
6610 Use make_unibyte_string, since the string must be ASCII.
6611 * lisp.h, print.c (float_to_string): Now returns int length.
6612 * term.c (produce_glyphless_glyph):
6613 Use sprintf result rather than recomputing it.
6614
6615 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6616 * Makefile.in (ALL_CFLAGS):
6617 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6618 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6619
6620 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6621
6622 * dispextern.h (xstrcasecmp): Define to library function
6623 strcasecmp if available.
6624 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6625
6626 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6627
6628 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6629 Avoid comma operator.
6630 * menu.c (push_submenu_start, push_submenu_end)
6631 (push_left_right_boundary, push_menu_pane): Likewise.
6632 * msdos.c (dos_rawgetc): Likewise.
6633
6634 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6635
6636 * xfns.c (xic_create_fontsetname): Remove redundant calls
6637 to memset.
6638
6639 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6640
6641 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6642 sprintf already null-terminates its output.
6643
6644 * xfns.c (x_window): Remove redundant cast.
6645
6646 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6647
6648 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6649 `const char *' to `char *' to avoid compiler warning.
6650
6651 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6652
6653 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6654 instead of truncating it to 63 (admittedly a generous limit).
6655
6656 * process.c: Fix spelling and caps in comments.
6657
6658 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6659
6660 * emacs.c (setpgrp): Remove definition, unused.
6661 * sysdep.c (setpgrp): Remove definition, not used in this file.
6662
6663 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
6664
6665 * makefile.w32-in: Update dependencies.
6666
6667 2012-06-24 Eli Zaretskii <eliz@gnu.org>
6668
6669 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6670 (SYSTIME_H): Add nt/inc/sys/time.h.
6671
6672 * systime.h [WINDOWSNT]: Include sys/time.h.
6673
6674 * s/ms-w32.h (struct timespec): Definition moved from
6675 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6676
6677 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6678
6679 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6680 * buffer.h (buffer_slot_type_mismatch):
6681 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6682 * eval.c (unwind_to_catch):
6683 * image.c (my_png_error, my_error_exit):
6684 * keyboard.c (quit_throw_to_read_char, user_error)
6685 (Fexit_recursive_edit, Fabort_recursive_edit):
6686 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6687 (wrong_type_argument, buffer_overflow, __executable_start)
6688 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6689 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6690 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6691 (fatal):
6692 (child_setup) [!DOS_NT]:
6693 * lread.c (end_of_file_error, invalid_syntax):
6694 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6695 * puresize.h (pure_write_error):
6696 * search.c (matcher_overflow):
6697 * sound.c (sound_perror, alsa_sound_perror):
6698 * sysdep.c, syssignal.h (croak):
6699 * term.c (maybe_fatal, vfatal):
6700 * textprop.c (text_read_only):
6701 * undo.c (user_error):
6702 * unexmacosx.c (unexec_error):
6703 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6704 Use _Noreturn rather than NO_RETURN.
6705 No need for separate decl merely because of _Noreturn.
6706 * sound.c (sound_warning, parse_sound):
6707 Remove unnecessary forward decls.
6708
6709 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6710
6711 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6712 * lisp.h (WAIT_READING_MAX): New macro.
6713 * dispnew.c (Fsleep_for, sit_for):
6714 * keyboard.c (kbd_buffer_get_event):
6715 * process.c (Faccept_process_output):
6716 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6717 This improves on the previous patch, which introduced a bug
6718 when time_t is unsigned and as wide as intmax_t.
6719 See <http://bugs.gnu.org/9000#51>.
6720
6721 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6722
6723 * dispnew.c (sit_for, Fsleep_for):
6724 * keyboard.c (kbd_buffer_get_event):
6725 * process.c (Faccept_process_output): Avoid compiler warnings when
6726 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6727
6728 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
6729
6730 * makefile.w32-in: Update dependencies.
6731
6732 * w32.c (ltime): Add return type and declare static.
6733 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6734
6735 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6736
6737 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6738 Privately reported by Herbert J. Skuhra.
6739 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6740 All uses changed.
6741 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6742 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6743
6744 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6745
6746 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6747 last argument of make_unibyte_string.
6748
6749 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6750 language ID in the event parameters.
6751
6752 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6753 event.code, not the obscure "character set ID".
6754
6755 2012-06-23 Chong Yidong <cyd@gnu.org>
6756
6757 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6758
6759 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6760
6761 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6762 * w32.c (fdutimens): New function.
6763
6764 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6765
6766 * s/ms-w32.h (pselect): Redirect to sys_select.
6767
6768 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6769
6770 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6771 in the logic of incrementing and decrementing the value of
6772 use_relocatable_buffers.
6773
6774 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6775
6776 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6777 Privately reported by Herbert J. Skuhra.
6778 [__FreeBSD__]: Remove "*/" typo after "#include".
6779 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6780 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6781 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6782 Don't assume EMACS_TIME and struct timeval are the same type.
6783
6784 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6785
6786 Support higher-resolution time stamps (Bug#9000).
6787 The time stamps are only nanosecond-resolution at the C level,
6788 since that's the best that any real-world system supports now.
6789 But they are picosecond-resolution at the Lisp level, as that's
6790 easy, and leaves room for future OS improvements.
6791
6792 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6793 (LIBES): Use it.
6794
6795 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6796 Don't get current time unless it's needed.
6797
6798 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6799 now provides it if it's absent.
6800 (start_atimer): Port to higher-res time stamps.
6801 Check for time stamp overflow. Don't get current time more
6802 often than is needed.
6803
6804 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6805 Include systime.h, not time.h.
6806 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6807
6808 * dired.c: Include stat-time.h.
6809 (Ffile-attributes): File times now have higher resolution.
6810
6811 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6812 (struct image): Timestamp now has higher resolution.
6813
6814 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6815 has at least microseconds now. All uses removed.
6816 (update_frame, update_single_window, update_window, update_frame_1)
6817 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
6818 (duration_to_sec_usec): Remove; no longer needed.
6819
6820 * editfns.c (time_overflow): Now extern.
6821 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6822 (float-time, Fformat_time_string, Fcurrent_time_string)
6823 (Fcurrent_time_zone): Accept and generate higher-resolution
6824 time stamps.
6825 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6826 (decode_time_components, lisp_seconds_argument): New functions.
6827 (make_time): Now static.
6828 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6829 Report an error if the time is invalid, rather than having the caller
6830 do that.
6831
6832 * fileio.c: Include <stat-time.h>
6833 (Fcopy_file): Copy higher-resolution time stamps.
6834 Prefer to set the time stamp via a file descriptor if that works.
6835 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6836 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6837 (Fvisited_file_modtime, Fset_visited_file_modtime):
6838 Support higher-resolution time stamps.
6839
6840 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6841
6842 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6843
6844 * image.c (prepare_image_for_display, clear_image_cache)
6845 (lookup_image): Port to higer-resolution time stamps.
6846
6847 * keyboard.c (start_polling, bind_polling_period):
6848 Check for time stamp overflow.
6849 (read_char, kbd_buffer_get_event, timer_start_idle)
6850 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6851 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6852 Port to higher-resolution time stamps. Do not assume time_t is signed.
6853 (decode_timer): New function. Timers are now vectors of length 9,
6854 not 8, to accommodate the picosecond component.
6855 (timer_check_2): Use it.
6856
6857 * nsterm.m (select_timeout, timeval_subtract): Remove.
6858 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6859 as they're a bit more accurate and handle overflow better.
6860 (ns_select): Change prototype to be compatible with pselect.
6861 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6862 * nsterm.h (ns_select): Adjust prototype.
6863
6864 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6865 us-resolution time stamps.
6866 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6867
6868 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6869
6870 * lisp.h (time_overflow): New decl.
6871 (wait_reading_process_output): First arg is now intmax_t, not int,
6872 to accommodate larger waits.
6873
6874 * process.h (struct Lisp_Process.read_output_delay):
6875 Now counts nanoseconds, not microseconds.
6876 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6877 EMACS_HAS_USECS.
6878 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6879 (wait_reading_process_output):
6880 Port to ns-resolution time stamps.
6881 (Faccept_process_output, wait_reading_process_output):
6882 Check for time stamp overflow. Do not assume time_t is signed.
6883 (select_wrapper): Remove; we now use pselect.
6884 (Fprocess_attributes): Now generates ns-resolution time stamps.
6885
6886 * sysdep.c: Include utimens.h. Don't include utime.h
6887 or worry about struct utimbuf; gnulib does that for us now.
6888 (gettimeofday): Remove; gnulib provides a substitute.
6889 (make_timeval): New function.
6890 (set_file_times): Now sets ns-resolution time stamps.
6891 New arg FD; all uses changed.
6892 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6893 (system_process_attributes):
6894 Now returns ns-resolution time stamp. All uses changed.
6895 Check for time stamp overflow.
6896
6897 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6898 provides a substitute now.
6899
6900 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6901 since it guarantees struct timespec.
6902 (EMACS_TIME): Now struct timespec, so that we can support
6903 ns-resolution time stamps.
6904 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6905 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6906 (EMACS_USECS): Remove.
6907 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6908 so multiply the arg by 1000 before storing it.
6909 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6910 New macros.
6911 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6912 Port to ns-resolution time stamps.
6913 (EMACS_TIME_NEG_P): Remove; replaced by....
6914 (EMACS_TIME_SIGN): New macro.
6915 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6916 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6917 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6918 (make_timeval, make_lisp_time, decode_time_components): New decls.
6919 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6920 that it mishandled time_t overflow. You can't compare by subtracting!
6921 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6922 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6923
6924 * term.c: Include <sys/time.h>.
6925 (timeval_to_Time): New function, for proper overflow wraparound.
6926 (term_mouse_position, term_mouse_click): Use it.
6927
6928 * undo.c (record_first_change): Support higher-resolution time stamps
6929 in the undo buffer.
6930 (Fprimitive_undo): Use them when restoring time stamps.
6931
6932 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6933 (w32_get_internal_run_time):
6934 Port to higher-resolution Emacs time stamps.
6935 (ltime): Now accepts single 64-bit integer, as that's more convenient
6936 for callers.
6937
6938 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6939
6940 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6941 for compatibility with pselect. Support ns-resolution time stamps.
6942
6943 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6944
6945 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6946 Check for time stamp overflow, and support ns-resolution time stamps.
6947
6948 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6949 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6950 (timeval_subtract): Remove; no longer needed.
6951 (XTflash, XTring_bell, x_wait_for_event):
6952 Port to ns-resolution time stamps. Don't assume time_t is signed.
6953
6954 2012-06-22 Chong Yidong <cyd@gnu.org>
6955
6956 * xdisp.c (x_consider_frame_title): Revert last change.
6957
6958 2012-06-22 Eli Zaretskii <eliz@gnu.org>
6959
6960 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6961 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6962 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6963 staticidx goes up to 1597 out of 1600 = 0x640.)
6964
6965 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6966
6967 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6968 Otherwise, the umask might be mistakenly 0 while handling input signals.
6969
6970 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6971
6972 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6973
6974 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6975
6976 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6977 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6978 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6979 access to `contents' member of Lisp_Vector objects with AREF and ASET
6980 where appropriate.
6981
6982 2012-06-19 Chong Yidong <cyd@gnu.org>
6983
6984 * frame.c (delete_frame): When selecting a frame on a different
6985 text terminal, do not alter the terminal's top-frame.
6986
6987 * xdisp.c (format_mode_line_unwind_data): Record the target
6988 frame's selected window and its terminal's top-frame.
6989 (unwind_format_mode_line): Restore them.
6990 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6991 Callers changed.
6992 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6993 since tty frames can be explicitly named.
6994 (prepare_menu_bars): Likewise.
6995
6996 * term.c (Ftty_top_frame): New function.
6997
6998 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6999
7000 Port byte-code-meter to modern targets.
7001 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7002 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7003 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7004 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7005 (METER_1, METER_2): Simplify.
7006
7007 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7008
7009 * data.c (Fdefalias): Return `symbol' (bug#11686).
7010
7011 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7012
7013 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7014 gets killed during executing of this function (Bug#11665).
7015 Try to always return Qt when the buffer has been actually killed.
7016 (Vkill_buffer_query_functions): In doc-string say that functions
7017 run by this hook should not change the current buffer.
7018
7019 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7020
7021 Fix recently-introduced process.c problems found by static checking.
7022 * process.c (write_queue_push, write_queue_pop, send_process):
7023 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7024 (write_queue_pop): Fix pointer signedness problem.
7025 (send_process): Remove unused local.
7026
7027 2012-06-17 Chong Yidong <cyd@gnu.org>
7028
7029 * xdisp.c (redisplay_internal): No need to redisplay terminal
7030 frames that are not on top.
7031
7032 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7033
7034 * process.c (make_process): Initialize write_queue.
7035 (write_queue_push, write_queue_pop): New functions.
7036 (send_process): Use them to maintain correct ordering of process
7037 writes (Bug#10815).
7038
7039 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7040
7041 * lisp.h (eassert): Assume C89 or later.
7042 This removes the need for CHECK.
7043 (CHECK): Remove. Its comments about always evaluating its
7044 argument were confusing, as 'eassert' typically does not evaluate
7045 its argument.
7046
7047 * coding.c (produce_chars): Use ptrdiff_t, not int.
7048
7049 * xterm.c (x_draw_underwave): Check for integer overflow.
7050 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7051
7052 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7053
7054 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7055 referenced (Bug#11583).
7056
7057 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7058
7059 Implement wave-style variant of underlining.
7060 * dispextern.h (face_underline_type): New enum.
7061 (face): Add field for underline type.
7062 * nsterm.m (ns_draw_underwave): New function.
7063 (ns_draw_text_decoration): Use it.
7064 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7065 New functions.
7066 (x_draw_glyph_string): Use them.
7067 * xfaces.c (Qline, Qwave): New Lisp objects.
7068 (check_lface_attrs, merge_face_ref)
7069 (Finternal_set_lisp_face_attribute, realize_x_face):
7070 Handle wave-style underline face attributes.
7071 * xterm.c (x_draw_underwave): New function.
7072 (x_draw_glyph_string): Use it.
7073
7074 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7075
7076 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7077 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7078 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7079 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7080 ($(BLD)/w32select.$(O)): Update dependencies.
7081
7082 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7083
7084 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7085 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7086 * character.c (_fetch_multibyte_char_p): Remove.
7087 * alloc.c: Include "character.h" before "buffer.h".
7088 * bidi.c: Likewise.
7089 * buffer.c: Likewise.
7090 * bytecode.c: Likewise.
7091 * callint.c: Likewise.
7092 * callproc.c: Likewise.
7093 * casefiddle.c: Likewise.
7094 * casetab.c: Likewise.
7095 * category.c: Likewise.
7096 * cmds.c: Likewise.
7097 * coding.c: Likewise.
7098 * composite.c: Likewise.
7099 * dired.c: Likewise.
7100 * dispnew.c: Likewise.
7101 * doc.c: Likewise.
7102 * dosfns.c: Likewise.
7103 * editfns.c: Likewise.
7104 * emacs.c: Likewise.
7105 * fileio.c: Likewise.
7106 * filelock.c: Likewise.
7107 * font.c: Likewise.
7108 * fontset.c: Likewise.
7109 * fringe.c: Likewise.
7110 * indent.c: Likewise.
7111 * insdel.c: Likewise.
7112 * intervals.c: Likewise.
7113 * keyboard.c: Likewise.
7114 * keymap.c: Likewise.
7115 * lread.c: Likewise.
7116 * macros.c: Likewise.
7117 * marker.c: Likewise.
7118 * minibuf.c: Likewise.
7119 * nsfns.m: Likewise.
7120 * nsmenu.m: Likewise.
7121 * print.c: Likewise.
7122 * process.c: Likewise.
7123 * regex.c: Likewise.
7124 * region-cache.c: Likewise.
7125 * search.c: Likewise.
7126 * syntax.c: Likewise.
7127 * term.c: Likewise.
7128 * textprop.c: Likewise.
7129 * undo.c: Likewise.
7130 * unexsol.c: Likewise.
7131 * w16select.c: Likewise.
7132 * w32fns.c: Likewise.
7133 * w32menu.c: Likewise.
7134 * window.c: Likewise.
7135 * xdisp.c: Likewise.
7136 * xfns.c: Likewise.
7137 * xmenu.c: Likewise.
7138 * xml.c: Likewise.
7139 * xselect.c: Likewise.
7140
7141 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7142
7143 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7144 If all the glyphs of the glyph row came from strings, and we have no
7145 cursor positioning clues, put the cursor on the first glyph of the
7146 row.
7147 (handle_face_prop): Use chunk-relative overlay string index when
7148 indexing into it->string_overlays array. (Bug#11653)
7149 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7150 the rightmost. (Bug#11720)
7151
7152 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7153
7154 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7155 (CATEGORY_MEMBER): Enforce 1/0 value.
7156 * category.c (_temp_category_set): Remove.
7157
7158 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7159
7160 * window.c (Fdelete_other_windows_internal)
7161 (Fdelete_window_internal): Don't access frame's mouse highlight
7162 info of the initial frame. (Bug#11677)
7163
7164 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7165
7166 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7167 Assume USE_2_TAGS_FOR_INTS.
7168 (xreload): Adjust $tagmask width to match recent lisp.h change.
7169
7170 Simplify lisp.h in minor ways that should not affect code.
7171 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7172 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7173 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7174 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7175 (INTTYPEBITS): New macro, for clarity.
7176 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7177 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7178 Simplify now that USE_LSB_TAG is always defined.
7179 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7180 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7181
7182 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7183
7184 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7185
7186 2012-06-13 Glenn Morris <rgm@gnu.org>
7187
7188 * s/bsd-common.h (BSD4_3):
7189 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7190
7191 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7192
7193 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7194 instead of union.
7195 (XLI, XIL): Define.
7196 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7197 Use them.
7198 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7199 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7200 * alloc.c (widen_to_Lisp_Object): Remove.
7201 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7202 * frame.c (delete_frame): Remove outdated comment.
7203 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7204 USE_LISP_UNION_TYPE.
7205 (Fw32_unregister_hot_key): Likewise.
7206 (Fw32_toggle_lock_key): Likewise.
7207 * w32menu.c (add_menu_item): Likewise.
7208 (w32_menu_display_help): Use XIL instead of checking
7209 USE_LISP_UNION_TYPE.
7210 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7211 (init_heap): Likewise.
7212 * w32term.c (w32_read_socket): Update comment.
7213
7214 2012-06-13 Glenn Morris <rgm@gnu.org>
7215
7216 * s/usg5-4-common.h, src/s/unixware.h:
7217 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7218
7219 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7220
7221 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7222
7223 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7224 * alloc.c (make_number) [!defined make_number]:
7225 Remove, as lisp.h always defines this now.
7226 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7227 (roundup_size): Verify that it is a power of 2.
7228 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7229 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7230 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7231 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7232 USE_LSB_TAG now is always defined to be either 0 or 1.
7233 All uses changed.
7234 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7235 code works fine either way, and efficiency is not a concern here,
7236 as the union type is for debugging, not for production.
7237 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7238 Use an inline function on all platforms when using the union type,
7239 since this is simpler and 'static inline' can be used portably
7240 within Emacs now.
7241 (LISP_INITIALLY_ZERO): New macro.
7242 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7243 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7244
7245 2012-06-12 Glenn Morris <rgm@gnu.org>
7246
7247 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7248
7249 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7250
7251 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7252 Move BROKEN_SIGIO to configure.
7253
7254 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7255 Move NO_TERMIO to configure.
7256
7257 2012-06-12 Chong Yidong <cyd@gnu.org>
7258
7259 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7260 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7261 MagickExportImagePixels is undefined.
7262
7263 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7264
7265 * image.c (imagemagick_load_image): Remove unused label.
7266
7267 2012-06-11 Glenn Morris <rgm@gnu.org>
7268
7269 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7270 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7271 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7272 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7273
7274 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7275
7276 * alloc.c (make_byte_code): New function.
7277 (Fmake_byte_code): Use it. Don't purify here.
7278 * lread.c (read1): Use it as well to avoid extra allocation.
7279
7280 2012-06-11 Chong Yidong <cyd@gnu.org>
7281
7282 * image.c (imagemagick_load_image): Implement transparency.
7283
7284 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7285
7286 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7287 account for preceding backslashes. (Bug#11663)
7288
7289 2012-06-09 Chong Yidong <cyd@gnu.org>
7290
7291 * term.c: Support italics in capable terminals (Bug#9652).
7292 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7293 (turn_on_face): Output using TS_enter_italic_mode if available.
7294 Don't handle unused blinking and alt-charset cases.
7295 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7296 and tty_alt_charset_p cases.
7297 (tty_capable_p, init_tty): Support italics.
7298
7299 * termchar.h (struct tty_display_info): Add field for italics.
7300 Remove unused blink field.
7301
7302 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7303 Handle slant.
7304
7305 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7306 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7307 tty_alt_charset_p. Add tty_italic_p.
7308
7309 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7310
7311 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7312 dbus_type_is_basic if available.
7313 (xd_extract_signed, xd_extract_unsigned): Rename from
7314 extract_signed and extract_unsigned, respectively. Adapt callers.
7315
7316 2012-06-09 Chong Yidong <cyd@gnu.org>
7317
7318 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7319
7320 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7321 case (Bug#9752).
7322
7323 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7324
7325 * xdisp.c (vmessage): Treat frame message as multibyte.
7326 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7327 would generate the diagnostic "Making \302\247 buffer-local while
7328 let-bound!".
7329
7330 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7331
7332 * dispnew.c (showing_window_margins_p): Undo last change, which
7333 was done due to an inadvertent commit.
7334 (adjust_frame_glyphs_for_frame_redisplay): Do call
7335 showing_window_margins_p.
7336
7337 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7338
7339 * eval.c (Fmake_var_non_special): New primitive.
7340 (syms_of_eval): Defsubr it.
7341 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7342
7343 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7344
7345 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7346 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7347
7348 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7349
7350 * alloc.c (allocate_vectorlike): Fix last change.
7351
7352 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7353
7354 Block-based vector allocation of small vectors.
7355 * lisp.h (struct vectorlike_header): New field `nbytes',
7356 adjust comment accordingly.
7357 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7358 to denote vector blocks. Adjust users (live_vector_p,
7359 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7360 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7361 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7362 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7363 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7364 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7365 (roundup_size): New constant.
7366 (struct vector_block): New data type.
7367 (vector_blocks, vector_free_lists, zero_vector): New variables.
7368 (all_vectors): Rename to `large_vectors'.
7369 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7370 (sweep_vectors): New functions.
7371 (allocate_vectorlike): Return `zero_vector' as the only vector of
7372 0 items. Allocate new vector from block if vector size is less than
7373 or equal to VBLOCK_BYTES_MAX.
7374 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7375 (init_alloc_once): Add call to init_vectors.
7376
7377 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7378
7379 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7380
7381 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7382
7383 * doprnt.c (doprnt): Truncate multibyte char correctly.
7384 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7385 would mishandle a string argument "Xc" if X was a multibyte
7386 character of length 2: it would truncate after X's first byte
7387 rather than including all of X.
7388
7389 2012-06-06 Chong Yidong <cyd@gnu.org>
7390
7391 * buffer.c (word_wrap): Doc fix.
7392
7393 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7394
7395 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7396
7397 2012-06-03 Glenn Morris <rgm@gnu.org>
7398
7399 * xdisp.c (tool-bar-style): Doc fix.
7400
7401 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7402
7403 * Makefile.in (PAXCTL): Define.
7404 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7405 binary via PaX flags if the paxctl utility is available.
7406 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7407 Restore PaX flags to their default. (Bug#11398)
7408
7409 2012-06-03 Chong Yidong <cyd@gnu.org>
7410
7411 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7412 buffer (Bug#11226).
7413
7414 2012-06-03 Chong Yidong <cyd@gnu.org>
7415
7416 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7417 (note_mode_line_or_margin_highlight): If there is no help echo,
7418 use mode-line-default-help-echo. Handle the case where the mouse
7419 position is past the end of the mode line string.
7420
7421 * buffer.c (buffer_local_value_1): New function, split from
7422 Fbuffer_local_value; can return Qunbound.
7423 (Fbuffer_local_value): Use it.
7424 (Vmode_line_format): Docstring tweaks.
7425
7426 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7427
7428 * sysdep.c (system_process_attributes): Improve comment.
7429
7430 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7431
7432 * keyboard.c: Export real-this-command to Elisp.
7433 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7434 and DEFVAR it. Update all users.
7435
7436 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7437
7438 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7439
7440 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7441 Convert pctcpu and pctmem to Lisp float properly.
7442 Let the compiler fold better, as 100.0/0x8000 is exact.
7443
7444 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7445
7446 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7447 cons_block.
7448
7449 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7450
7451 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7452
7453 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7454
7455 For a 'struct window', replace some Lisp_Object fields to
7456 bitfields where appropriate, remove unused fields.
7457 * window.h (struct window): Remove unused 'last_mark_x' and
7458 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7459 change it's type from Lisp_Object to bitfield.
7460 Change type of 'force_start', 'optional_new_start',
7461 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7462 fields from Lisp_Object to bitfield. Adjust users accordingly.
7463
7464 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7465
7466 Pacify gcc -Wdouble-precision when using Xaw.
7467 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7468 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7469 Use 'float' consistently, rather than 'float' in most places
7470 and 'double' in a couple of places.
7471
7472 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7473
7474 * xdisp.c (handle_stop): Detect whether we have overlay strings
7475 loaded by testing it->current.overlay_string_index to be
7476 non-negative, instead of checking whether n_overlay_strings is
7477 positive. (Bug#11587)
7478
7479 2012-05-31 Chong Yidong <cyd@gnu.org>
7480
7481 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7482
7483 * doc.c (Fsubstitute_command_keys): Doc fix.
7484
7485 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7486
7487 * search.c (search_buffer): Remove calls to
7488 r_alloc_inhibit_buffer_relocation, as it is now called by
7489 maybe_unify_char, which was the cause of relocation of buffer text
7490 in bug#11519.
7491
7492 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7493
7494 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7495 for the duration of call to load_charset, to avoid problems with
7496 callers of maybe_unify_char that access buffer text through C
7497 pointers.
7498
7499 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7500 decrement the inhibition flag, instead of just setting or
7501 resetting it.
7502
7503 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7504
7505 Remove obsolete '#define static' cruft.
7506 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7507 This #undef was "temporary" in 2000; it is no longer needed
7508 now that '#define static' has gone away.
7509 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7510 (gray_bitmap_bits): Remove; no longer needed.
7511 All uses replaced with definiens.
7512 * xterm.c: Include "bitmaps/gray.xbm".
7513
7514 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7515
7516 Clean up __executable_start, monstartup when --enable-profiling.
7517 The following changes affect the code only when profiling.
7518 * dispnew.c (__executable_start): Rename from safe_bcopy.
7519 Define only on platforms that need it.
7520 * emacs.c: Include <sys/gmon.h> when profiling.
7521 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7522 (__executable_start): Remove decl, since lisp.h does it now.
7523 (safe_bcopy): Remove decl; no longer has that name.
7524 (main): Coalesce #if into single bit of code, for simplicity.
7525 Cast pointers to uintptr_t, since standard libraries want integers
7526 and not pointers.
7527 * lisp.h (__executable_start): New decl.
7528
7529 2012-05-31 Glenn Morris <rgm@gnu.org>
7530
7531 * image.c (Fimagemagick_types): Doc fix.
7532
7533 2012-05-30 Jim Meyering <meyering@redhat.com>
7534
7535 * callproc.c (Fcall_process_region): Include directory component
7536 in mkstemp error message (Bug#11586).
7537
7538 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7539
7540 * alloc.c, lisp.h (make_pure_vector): Now static.
7541
7542 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7543
7544 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7545 Move to byte-run.el.
7546 (Fautoload): Do the hash-doc more carefully.
7547 * data.c (Fdefalias): Purify definition, except for keymaps.
7548 (Qdefun): Move from eval.c.
7549 * lisp.h (Qdefun): Remove.
7550 * lread.c (read1): Tiny simplification.
7551
7552 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
7553
7554 Do not create empty overlays with the evaporate property (Bug#9642).
7555 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7556 Bug#9642, but explicitly check that the buffer the overlay would
7557 be moved to is live and rearrange lines to make sure that errors
7558 will not put the overlay in an inconsistent state.
7559 (Fdelete_overlay): Cosmetics.
7560
7561 2012-05-28 Eli Zaretskii <eliz@gnu.org>
7562
7563 * w32term.c (my_bring_window_to_top): New function.
7564 (x_raise_frame): Use handle returned by DeferWindowPos, which
7565 could be different from the original one.
7566 Call my_bring_window_to_top instead of my_set_foreground_window.
7567 (Bug#11513)
7568
7569 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7570 by calling BringWindowToTop.
7571
7572 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7573 (WM_EMACS_END): Increase by one.
7574
7575 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7576
7577 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7578 This avoids undefined behavior that might cause the eassert
7579 to not catch an out-of-range value.
7580
7581 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
7582
7583 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7584 Update dependencies.
7585
7586 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7587
7588 * bidi.c (bidi_mirror_char): Fix last change.
7589
7590 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7591
7592 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7593 when referring to sectname field in printf format.
7594
7595 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7596
7597 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7598 Only r_alloc_inhibit_buffer_relocation needed to be added;
7599 the others were already declared.
7600
7601 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7602 before checking whether it's out of range. Put the check inside
7603 eassert. See
7604 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7605
7606 2012-05-27 Ken Brown <kbrown@cornell.edu>
7607
7608 * callproc.c (Fcall_process): Restore a line that was accidentally
7609 commented out in the 2011-02-13 change (bug#11547).
7610
7611 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7612
7613 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7614 defined on ralloc.c.
7615
7616 * buffer.c [REL_ALLOC]: Remove prototypes of
7617 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7618 they are now on lisp.h.
7619
7620 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7621
7622 * search.c (search_buffer): Use it to inhibit relocation of buffer
7623 text while re_search_2 is doing its job, because re_search_2 is
7624 passed C pointers to buffer text. (Bug#11519)
7625
7626 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7627 Update value to 24.
7628
7629 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7630 state after an additional call to move_it_in_display_line_to, keep
7631 the values of it->max_ascent and it->max_descent found for the
7632 entire line.
7633 (pos_visible_p): Revert the comparison against bottom_y to what it
7634 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7635 (Bug#11464)
7636
7637 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7638
7639 Fix coding-related core dumps with gcc -ftrapv.
7640 The code was computing A - B, where A and B are pointers, and B is
7641 random garbage. This can lead to core dumps on platforms that
7642 have special pointer registers, and it also leads to core dumps on
7643 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7644 A - B only when B is initialized properly.
7645 * coding.c (coding_set_source, coding_set_destination): Return void.
7646 (coding_change_source, coding_change_destinations): New functions,
7647 with the old behaviors of coding_set_source and coding_set_destination.
7648 All callers that need an offset changed to use these new functions.
7649
7650 2012-05-26 Glenn Morris <rgm@gnu.org>
7651
7652 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7653
7654 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7655
7656 Extend mouse support on W32 text-mode console.
7657 * xdisp.c (draw_row_with_mouse_face):
7658 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7659
7660 * w32console.c: Include window.h.
7661 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7662 New functions.
7663 (initialize_w32_display): Initialize mouse-highlight data.
7664
7665 * w32inevt.c: Include termchar.h and window.h.
7666 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7667 moves, call note_mouse_highlight. If help_echo changed, call
7668 gen_help_event to produce help-echo message in the echo area.
7669 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7670 highlight info.
7671
7672 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7673
7674 * lread.c (read1): Simplify slightly to avoid an overflow warning
7675 with GCC 4.7.0 on x86-64.
7676
7677 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7678
7679 * bidi.c (bidi_mirror_char): Revert last change: an int is
7680 definitely wide enough here.
7681
7682 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
7683
7684 Fix integer width and related bugs (Bug#9874).
7685 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7686 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7687 (string_bytes, check_sblock, allocate_string_data):
7688 (compact_small_strings, Fmake_bool_vector, make_string)
7689 (make_unibyte_string, make_multibyte_string)
7690 (make_string_from_bytes, make_specified_string)
7691 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7692 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7693 (mark_vectorlike):
7694 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7695 (allocate_pseudovector):
7696 Use int, not EMACS_INT, where int is wide enough.
7697 (inhibit_garbage_collection, Fgarbage_collect):
7698 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7699 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7700 int might not be wide enough.
7701 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7702 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7703 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7704 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7705 (bidi_level_of_next_char, bidi_move_to_visually_next):
7706 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7707 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7708 (Fkill_buffer, Fset_buffer_major_mode)
7709 (advance_to_char_boundary, Fbuffer_swap_text)
7710 (Fset_buffer_multibyte, overlays_at, overlays_in)
7711 (overlay_touches_p, struct sortvec, record_overlay_string)
7712 (overlay_strings, recenter_overlay_lists)
7713 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7714 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7715 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7716 (Foverlay_recenter, last_overlay_modification_hooks_used)
7717 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7718 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7719 (validate_region): Omit unnecessary test for b <= e,
7720 since that's guaranteed by the previous test.
7721 (adjust_overlays_for_delete): Avoid pos + length overflow.
7722 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7723 (report_overlay_modification):
7724 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7725 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7726 Omit pointer cast, which isn't needed anyway, and doesn't work
7727 after the EMACS_INT -> ptrdiff_t change.
7728 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7729 * buffer.h: Adjust decls to match defn changes elsewhere.
7730 (struct buffer_text, struct buffer):
7731 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7732 Use EMACS_INT, not int, where int might not be wide enough.
7733 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7734 not int, to avoid needless 32-bit limit on 64-bit hosts.
7735 (exec_byte_code): Use tighter memory-full test, one that checks
7736 for alloca overflow. Don't compute the address of the object just
7737 before an array, as that's not portable. Use EMACS_INT, not
7738 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7739 * callint.c (Fcall_interactively):
7740 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7741 * callproc.c (call_process_kill, Fcall_process):
7742 Don't assume pid_t fits into an Emacs fixnum.
7743 (call_process_cleanup, Fcall_process, child_setup):
7744 Don't assume pid_t fits into int.
7745 (call_process_cleanup, Fcall_process, delete_temp_file)
7746 (Fcall_process_region):
7747 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7748 (Fcall_process): Simplify handling of volatile integers.
7749 Use int, not EMACS_INT, where int will do.
7750 * casefiddle.c (casify_object, casify_region, operate_on_word)
7751 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7752 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7753 (casify_object): Avoid integer overflow when overallocating buffer.
7754 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7755 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
7756 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7757 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7758 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7759 integers are now checked earlier. All uses replaced with XINT.
7760 (ccl_driver):
7761 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7762 For CCL_MapSingle, check that content and value are in int range.
7763 (ccl_driver, Fregister_code_conversion_map):
7764 Check that Vcode_version_map_vector is a vector.
7765 (resolve_symbol_ccl_program): Check that vector header is in range.
7766 Always copy the vector, so that we can check its contents reliably
7767 now rather than having to recheck each instruction as it's being
7768 executed. Check that vector words fit in 'int'.
7769 (ccl_get_compiled_code, Fregister_ccl_program)
7770 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7771 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7772 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7773 contents are in range.
7774 (Fccl_execute_on_string): Check that status is in range.
7775 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7776 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7777 Accept and return EMACS_INT, not int, because callers can pass values
7778 out of 'int' range.
7779 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7780 (multibyte_chars_in_text, parse_str_as_multibyte)
7781 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7782 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7783 (string_escape_byte8, Fget_byte):
7784 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7785 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7786 avoid mishandling large integers.
7787 * character.h: Adjust decls to match defn changes elsewhere.
7788 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7789 (Ffind_charset_region):
7790 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7791 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7792 (load_charset_map_from_vector, Fdefine_charset_internal):
7793 Don't assume fixnum fits in int.
7794 (load_charset_map_from_vector, Fmap_charset_chars):
7795 Remove now-unnecessary CHECK_NATNUMs.
7796 (Fdefine_charset_internal): Check ranges here, more carefully.
7797 Don't rely on undefined behavior with signed left shift overflow.
7798 Don't assume unsigned int fits into fixnum, or that fixnum fits
7799 into unsigned int. Don't require max_code to be a valid fixnum;
7800 that's not true for gb10830 4-byte on a 32-bit host. Allow
7801 invalid_code to be a cons, for the same reason. Require code_offset
7802 to be a character. Avoid int overflow if max_char is close
7803 to INT_MAX.
7804 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7805 this is intended anyway and avoids some undefined behavior.
7806 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7807 INDEX_TO_CODE_POINT, as that's what it expects.
7808 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
7809 * charset.h (DECODE_CHAR): Return int, not unsigned;
7810 this is what was intended anyway, and it avoids undefined behavior.
7811 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7812 integer-overflow issues.
7813 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7814 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7815 where the argument is EMACS_INT, and this behavior is not intended.
7816 * chartab.c (Fmake_char_table, Fset_char_table_range)
7817 (uniprop_get_decoder, uniprop_get_encoder):
7818 Don't assume fixnum fits in int.
7819 * cmds.c (move_point): New function, that does the gist of
7820 Fforward_char and Fbackward_char, but does so while checking
7821 for integer overflow more accurately.
7822 (Fforward_char, Fbackward_char): Use it.
7823 (Fforward_line, Fend_of_line, internal_self_insert)
7824 (internal_self_insert):
7825 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7826 Fix a FIXME, by checking for integer overflow when calculating
7827 target_clm and actual_clm.
7828 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
7829 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
7830 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7831 (coding_alloc_by_making_gap, alloc_destination)
7832 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7833 (encode_coding_utf_16, detect_coding_emacs_mule)
7834 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7835 (detect_coding_iso_2022, decode_coding_iso_2022)
7836 (encode_invocation_designation, encode_designation_at_bol)
7837 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7838 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7839 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7840 (encode_coding_ccl, encode_coding_raw_text)
7841 (detect_coding_charset, decode_coding_charset)
7842 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7843 (produce_composition, produce_charset, produce_annotation)
7844 (decode_coding, handle_composition_annotation)
7845 (handle_charset_annotation, consume_chars, decode_coding_gap)
7846 (decode_coding_object, encode_coding_object, detect_coding_system)
7847 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7848 (code_convert_region, code_convert_string)
7849 (Fdefine_coding_system_internal)
7850 (coding_set_source, coding_set_destination):
7851 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7852 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7853 (Fdefine_coding_system_internal):
7854 Don't assume fixnums fit in int.
7855 (decode_coding_gap, decode_coding_object, encode_coding_object)
7856 (Fread_coding_system, Fdetect_coding_region)
7857 (Funencodable_char_position, Fcheck_coding_systems_region)
7858 (get_translation, handle_composition_annotation, consume_chars):
7859 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7860 (consume_chars): Rewrite to not calculate an address outside buffer.
7861 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7862 Don't access memory outside of the args array.
7863 (Fdefine_coding_system_internal): Check for charset-id overflow.
7864 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7865 result of ENCODE_CHAR.
7866 * coding.h: Adjust decls to match defn changes elsewhere.
7867 (struct coding_system):
7868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7869 * composite.c (get_composition_id, find_composition)
7870 (run_composition_function, update_compositions)
7871 (compose_text, composition_gstring_put_cache)
7872 (composition_gstring_p, composition_gstring_width)
7873 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7874 (composition_compute_stop_pos, composition_reseat_it)
7875 (composition_update_it, struct position_record)
7876 (find_automatic_composition, composition_adjust_point)
7877 (Fcomposition_get_gstring, Ffind_composition_internal):
7878 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7879 (update_compositions):
7880 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7881 * composite.h: Adjust decls to match defn changes elsewhere.
7882 (struct composition):
7883 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7884 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7885 Do not attempt to compute the address of the object just before a
7886 buffer; this is not portable.
7887 (Faref, Faset):
7888 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7889 (Faset): Use int, not EMACS_INT, where int is wide enough.
7890 (Fstring_to_number): Don't assume fixnums fit in int.
7891 (Frem): Don't assume arg is nonnegative.
7892 * dbusbind.c (xd_append_arg): Check for integers out of range.
7893 (Fdbus_call_method): Don't overflow the timeout int.
7894 (extract_signed, extract_unsigned): New functions.
7895 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7896 (xd_get_connection_references): Return ptrdiff_t, not int.
7897 All uses changed.
7898 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7899 (xd_read_message_1):
7900 Use int, not unsigned, where the dbus API uses int.
7901 (Fdbus_message_internal): Don't overflow mtype.
7902 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7903 * dired.c (directory_files_internal, file_name_completion, scmp)
7904 (file_name_completion_stat):
7905 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7906 (file_name_completion): Don't overflow matchcount.
7907 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7908 * dispextern.h: Adjust decls to match defn changes elsewhere.
7909 (struct text_pos, struct glyph, struct bidi_saved_info)
7910 (struct bidi_string_data, struct bidi_it, struct composition_it)
7911 (struct it):
7912 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7913 (struct display_pos, struct composition_it, struct it):
7914 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7915 * dispnew.c (increment_matrix_positions)
7916 (increment_row_positions, mode_line_string)
7917 (marginal_area_string):
7918 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7919 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7920 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7921 (duration_to_sec_usec): New function, to check for overflow better.
7922 (Fsleep_for, sit_for): Use it.
7923 * doc.c (get_doc_string, store_function_docstring):
7924 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7925 (get_doc_string, Fsnarf_documentation):
7926 Use int, not EMACS_INT, where int is wide enough.
7927 (get_doc_string):
7928 Use SAFE_ALLOCA, not alloca.
7929 Check for overflow when converting EMACS_INT to off_t.
7930 * doprnt.c (doprnt):
7931 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7932 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7933 Don't assume uid_t fits into fixnum.
7934 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7935 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7936 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7937 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7938 (general_insert_function)
7939 (Finsert_char, make_buffer_string, make_buffer_string_both)
7940 (update_buffer_properties, Fbuffer_substring)
7941 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7942 (Fsubst_char_in_region, check_translation)
7943 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7944 (transpose_markers, Ftranspose_regions):
7945 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7946 (clip_to_bounds): Move to lisp.h as an inline function).
7947 (Fconstrain_to_field): Don't assume integers are nonnegative.
7948 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7949 (Fsubst_char_in_region, Fsave_restriction):
7950 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7951 (Femacs_pid): Don't assume pid_t fits into fixnum.
7952 (lo_time): Use int, not EMACS_INT, when int suffices.
7953 (lisp_time_argument): Check for usec out of range.
7954 (Fencode_time): Don't assume fixnum fits in int.
7955 (Fuser_login_name, Fuser_full_name): Signal an error
7956 if a uid argument is out of range, rather than relying on
7957 undefined behavior.
7958 (Fformat_time_string): Remove now-unnecessary check.
7959 lisp_time_argument checks for out-of-range usec now.
7960 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7961 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7962 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7963 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7964 (init_cmdargs, Fdump_emacs):
7965 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7966 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7967 the bottom (typically) 32 bits of the fixnum.
7968 * eval.c (specpdl_size, call_debugger):
7969 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7970 (when_entered_debugger, Fbacktrace_debug):
7971 Don't assume fixnum can fit in int.
7972 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7973 the object just before a buffer; this is not portable.
7974 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7975 (grow_specpdl, unbind_to):
7976 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7977 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7978 (grow_specpdl): Simplify allocation by using xpalloc.
7979 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7980 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7981 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7982 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7983 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7984 (a_write, e_write):
7985 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7986 (Fcopy_file, non_regular_nbytes, read_non_regular)
7987 (Finsert_file_contents):
7988 Use int, not EMACS_INT, where int is wide enough.
7989 (READ_BUF_SIZE): Verify that it fits in int.
7990 (Finsert_file_contents): Check that counts are in proper range,
7991 rather than assuming fixnums fit into ptrdiff_t etc.
7992 Don't assume fixnums fit into int.
7993 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7994 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7995 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7996 (string_char_to_byte, string_byte_to_char)
7997 (string_make_multibyte, string_to_multibyte)
7998 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7999 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8000 (substring_both, Fdelete, internal_equal, Ffillarray)
8001 (Fclear_string, mapcar1)
8002 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8003 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8004 (larger_vector, make_hash_table, maybe_resize_hash_table)
8005 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8006 (Fmaphash, secure_hash):
8007 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8008 (concat): Check for string index and length overflow.
8009 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8010 (Frequire):
8011 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8012 (larger_vector): New API (vec, incr_min, size_max) replaces old
8013 one (vec, new_size, init). This catches size overflow.
8014 INIT was removed because it was always Qnil.
8015 All callers changed.
8016 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8017 the upper bound on a hash table index size.
8018 (make_hash_table, maybe_resize_hash_table): Use it.
8019 (secure_hash): Computer start_byte and end_byte only after
8020 they're known to be in ptrdiff_t range.
8021 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8022 (Ffont_get_glyphs, Ffont_at):
8023 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8024 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8025 (Flist_fonts, Fopen_font):
8026 Don't assume fixnum can fit in int.
8027 (check_gstring): Don't assume index can fit in int.
8028 (font_match_p): Check that fixnum is a character, not a nonnegative
8029 fixnum, since the later code needs to stuff it into an int.
8030 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8031 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8032 conversion overflow issues.
8033 (Fopen_font): Check for integer out of range.
8034 (Ffont_get_glyphs): Don't assume index can fit in int.
8035 * font.h: Adjust decls to match defn changes elsewhere.
8036 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8037 integer overflow.
8038 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8039 printmax_t, where ptrdiff_t is wide enough.
8040 (Finternal_char_font):
8041 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8042 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8043 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8044 (Fset_frame_position, x_set_frame_parameters)
8045 (x_set_line_spacing, x_set_border_width)
8046 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8047 Check that fixnums are in proper range for system types.
8048 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8049 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8050 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8051 Use SAFE_ALLOCA_LISP, not alloca.
8052 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8053 intptr_t is wide enough.
8054 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8055 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8056 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8057 Check for fixnum out of range.
8058 * ftfont.c (ftfont_list): Don't assume index fits in int.
8059 Check that fixnums are in proper range for system types.
8060 (ftfont_shape_by_flt):
8061 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8062 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8063 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8064 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8065 Check that fixnums are in proper range for system types.
8066 * gnutls.h: Adjust decls to match defn changes elsewhere.
8067 * gtkutil.c (xg_dialog_run):
8068 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8069 (update_frame_tool_bar):
8070 Check that fixnums are in proper range for system types.
8071 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8072 (lookup_image): Check that fixnums are in range for system types.
8073 * indent.c (last_known_column, last_known_column_point):
8074 (current_column_bol_cache):
8075 (skip_invisible, current_column, check_display_width):
8076 (check_display_width, scan_for_column, current_column_1)
8077 (Findent_to, Fcurrent_indentation, position_indentation)
8078 (indented_beyond_p, Fmove_to_column, compute_motion):
8079 (Fcompute_motion, Fvertical_motion):
8080 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8081 (last_known_column_modified): Use EMACS_INT, not int.
8082 (check_display_width):
8083 (Fcompute_motion):
8084 Check that fixnums and floats are in proper range for system types.
8085 (compute_motion): Don't assume index or fixnum fits in int.
8086 (compute_motion, Fcompute_motion):
8087 Use int, not EMACS_INT, when it is wide enough.
8088 (vmotion): Omit local var start_hpos that is always 0; that way
8089 we don't need to worry about overflow in expressions involving it.
8090 * indent.h: Adjust decls to match defn changes elsewhere.
8091 (struct position):
8092 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8093 Use int, not EMACS_INT, where int is wide enough.
8094 Remove unused members ovstring_chars_done and tab_offset;
8095 all uses removed.
8096 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8097 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8098 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8099 (make_gap, copy_text, insert, insert_and_inherit)
8100 (insert_before_markers, insert_before_markers_and_inherit)
8101 (insert_1, count_combining_before, count_combining_after)
8102 (insert_1_both, insert_from_string)
8103 (insert_from_string_before_markers, insert_from_string_1)
8104 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8105 (adjust_after_replace, adjust_after_insert, replace_range)
8106 (replace_range_2, del_range, del_range_1, del_range_byte)
8107 (del_range_both, del_range_2, modify_region)
8108 (prepare_to_modify_buffer, signal_before_change)
8109 (signal_after_change, Fcombine_after_change_execute):
8110 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8111 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8112 (balance_an_interval, split_interval_right, split_interval_left)
8113 (find_interval, next_interval, update_interval)
8114 (adjust_intervals_for_insertion, delete_node, delete_interval)
8115 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8116 (static_offset_intervals, offset_intervals)
8117 (merge_interval_right, merge_interval_left, make_new_interval)
8118 (graft_intervals_into_buffer, temp_set_point_both)
8119 (temp_set_point, set_point, adjust_for_invis_intang)
8120 (set_point_both, move_if_not_intangible, get_property_and_range)
8121 (get_local_map, copy_intervals, copy_intervals_to_string)
8122 (compare_string_intervals, set_intervals_multibyte_1):
8123 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8124 * intervals.h: Adjust decls to match defn changes elsewhere.
8125 (struct interval):
8126 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8127 * keyboard.c (this_command_key_count, this_single_command_key_start)
8128 (before_command_key_count, before_command_echo_length, echo_now)
8129 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8130 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8131 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8132 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8133 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8134 (last_non_minibuf_size, last_point_position, echo_truncate)
8135 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8136 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8137 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8138 (stuff_buffered_input):
8139 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8140 (last_auto_save, command_loop_1, read_char):
8141 Use EMACS_INT, not int, to avoid integer overflow.
8142 (record_char): Avoid overflow in total_keys computation.
8143 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8144 * keyboard.h: Adjust decls to match defn changes elsewhere.
8145 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8146 (Fkey_description, Fdescribe_vector, Flookup_key):
8147 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8148 (click_position): New function, to check that positions are in range.
8149 (Fcurrent_active_maps):
8150 (describe_command):
8151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8152 (Faccessible_keymaps, Fkey_description):
8153 (preferred_sequence_p):
8154 Don't assume fixnum can fit into int.
8155 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8156 Check for integer overflow in size calculations.
8157 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8158 avoid mishandling large integers.
8159 * lisp.h: Adjust decls to match defn changes elsewhere.
8160 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8161 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8162 (struct Lisp_Marker):
8163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8164 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8165 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8166 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8167 All callers changed.
8168 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8169 Assume the arg has valid form, since it always does.
8170 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8171 unsigned integer system type.
8172 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8173 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8174 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8175 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8176 (duration_to_sec_usec): New decl.
8177 * lread.c (read_from_string_index, read_from_string_index_byte)
8178 (read_from_string_limit, readchar, unreadchar, openp)
8179 (read_internal_start, read1, oblookup):
8180 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8181 (Fload, readevalloop, Feval_buffer, Feval_region):
8182 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8183 (openp): Check for out-of-range argument to 'access'.
8184 (read1): Use int, not EMACS_INT, where int is wide enough.
8185 Don't assume fixnum fits into int.
8186 Fix off-by-one error that can read outside a buffer.
8187 (read_filtered_event): Use duration_to_sec_usec
8188 to do proper overflow checking on durations.
8189 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8190 in size calculation.
8191 (Fexecute_kbd_macro):
8192 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8193 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8194 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8195 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8196 (set_marker_both, set_marker_restricted_both, marker_position)
8197 (marker_byte_position, Fbuffer_has_markers_at):
8198 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8199 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8200 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8201 It now merely ensures that the menu is large enough, without
8202 necessarily growing it, as this avoids some integer overflow issues.
8203 All callers changed.
8204 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8205 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8206 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8207 Use SAFE_ALLOCA_LISP, not alloca.
8208 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8209 to EMACS_INT. Check that fixnums are in proper range for system types.
8210 * minibuf.c (minibuf_prompt_width, string_to_object)
8211 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8212 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8214 (get_minibuffer, read_minibuf_unwind):
8215 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8216 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8217 this simplifies overflow checking. All callers changed.
8218 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8219 (Ftest_completion):
8220 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8221 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8222 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8223 Check that fixnums are in proper range for system types.
8224 (Fx_create_frame, Fx_show_tip):
8225 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8226 * nsfont.m (ns_findfonts, nsfont_list_family):
8227 Don't assume fixnum fits in long.
8228 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8229 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8230 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8231 wide enough.
8232 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8233 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8234 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8235 (PRINTDECLARE, PRINTPREPARE):
8236 (strout, print_string):
8237 (print, print_preprocess, print_check_string_charset_prop)
8238 (print_object):
8239 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8240 (PRINTDECLARE):
8241 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8242 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8243 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8244 (printchar, strout): Use xpalloc to catch size calculation overflow.
8245 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8246 (print_error_message): Use SAFE_ALLOCA, not alloca.
8247 (print_object): Use int, not EMACS_INT, where int is wide enough.
8248 (print_depth, new_backquote_output, print_number_index):
8249 Use ptrdiff_t, not int, where int might not be wide enough.
8250 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8251 (Fset_process_window_size, Fformat_network_address)
8252 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8253 (sigchld_handler):
8254 Check that fixnums are in proper range for system types.
8255 (Fsignal_process): Simplify by avoiding a goto.
8256 Check for process-ids out of pid_t range rather than relying on
8257 undefined behavior.
8258 (process_tick, update_tick): Use EMACS_INT, not int.
8259 (Fformat_network_address, read_process_output, send_process)
8260 (Fprocess_send_region, status_notify):
8261 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8262 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8263 (wait_reading_process_output, read_process_output, exec_sentinel):
8264 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8265 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8266 (Faccept_process_output): Use duration_to_sec_usec to do proper
8267 overflow checking on durations.
8268 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8269 Don't assume pid_t fits in int.
8270 * process.h (struct Lisp_Process): Members tick and update_tick
8271 are now of type EMACS_INT, not int.
8272 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8273 configured --with-wide-int.
8274 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8275 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8276 * search.c (looking_at_1, string_match_1):
8277 (fast_string_match, fast_c_string_match_ignore_case)
8278 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8279 (scan_newline, find_before_next_newline, search_command)
8280 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8281 (set_search_regs, wordify):
8282 (Freplace_match):
8283 (Fmatch_data):
8284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8285 (string_match_1, search_buffer, set_search_regs):
8286 (Fmatch_data):
8287 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8288 (wordify): Check for overflow in size calculation.
8289 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8290 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8291 Check that fixnums are in proper range for system types.
8292 * sound.c (struct sound_device)
8293 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8294 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8295 (Fplay_sound_internal):
8296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8297 * syntax.c (struct lisp_parse_state, find_start_modiff)
8298 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8299 (Fparse_partial_sexp):
8300 Don't assume fixnums can fit in int.
8301 (struct lisp_parse_state, find_start_pos, find_start_value)
8302 (find_start_value_byte, find_start_begv)
8303 (update_syntax_table, char_quoted, dec_bytepos)
8304 (find_defun_start, prev_char_comend_first, back_comment):
8305 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8306 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8307 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8308 (Finternal_describe_syntax_value): Check that match_lisp is a
8309 character, not an integer, since the code stuffs it into int.
8310 (scan_words, scan_sexps_forward):
8311 Check that fixnums are in proper range for system types.
8312 (Fforward_word):
8313 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8314 (scan_sexps_forward):
8315 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8316 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8317 * syntax.h: Adjust decls to match defn changes elsewhere.
8318 (struct gl_state_s):
8319 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8320 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8321 MOST_POSITIVE_FIXNUM.
8322 * sysdep.c (wait_for_termination_1, wait_for_termination)
8323 (interruptible_wait_for_termination, mkdir):
8324 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8325 (emacs_read, emacs_write):
8326 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8327 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8328 and double all fit in int.
8329 * term.c (set_tty_color_mode):
8330 Check that fixnums are in proper range for system types.
8331 * termhooks.h (struct input_event):
8332 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8333 * textprop.c (validate_interval_range, interval_of)
8334 (Fadd_text_properties, set_text_properties_1)
8335 (Fremove_text_properties, Fremove_list_of_text_properties)
8336 (Ftext_property_any, Ftext_property_not_all)
8337 (copy_text_properties, text_property_list, extend_property_ranges)
8338 (verify_interval_modification):
8339 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8340 (Fnext_single_char_property_change)
8341 (Fprevious_single_char_property_change):
8342 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8343 (copy_text_properties):
8344 Check for integer overflow in index calculation.
8345 * undo.c (last_boundary_position, record_point, record_insert)
8346 (record_delete, record_marker_adjustment, record_change)
8347 (record_property_change):
8348 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8349 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8350 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8351 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8352 (Fx_hide_tip, Fx_file_dialog):
8353 * w32menu.c (set_frame_menubar):
8354 Use ptrdiff_t, not int, for consistency with rest of code.
8355 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8356 (select_window, Fdelete_other_windows_internal)
8357 (window_scroll_pixel_based, window_scroll_line_based)
8358 (Frecenter, Fset_window_configuration):
8359 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8360 (Fset_window_hscroll, run_window_configuration_change_hook)
8361 (set_window_buffer, temp_output_buffer_show, scroll_command)
8362 (Fscroll_other_window, Frecenter):
8363 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8364 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8365 Don't assume fixnum fits in int.
8366 (Fset_window_scroll_bars):
8367 Check that fixnums are in proper range for system types.
8368 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8369 (string_pos, c_string_pos, number_of_chars, init_iterator)
8370 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8371 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8372 (compute_display_string_end, handle_face_prop)
8373 (face_before_or_after_it_pos, handle_invisible_prop)
8374 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8375 (display_prop_intangible_p, string_buffer_position_lim)
8376 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8377 (get_overlay_strings_1, get_overlay_strings)
8378 (iterate_out_of_display_property, forward_to_next_line_start)
8379 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8380 (get_next_display_element, set_iterator_to_next)
8381 (get_visually_first_element, compute_stop_pos_backwards)
8382 (handle_stop_backwards, next_element_from_buffer)
8383 (move_it_in_display_line_to, move_it_in_display_line)
8384 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8385 (add_to_log, message_dolog, message_log_check_duplicate)
8386 (message2, message2_nolog, message3, message3_nolog
8387 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8388 (current_message_1, truncate_echo_area, truncate_message_1)
8389 (set_message, set_message_1, store_mode_line_noprop)
8390 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8391 (text_outside_line_unchanged_p, check_point_in_composition)
8392 (reconsider_clip_changes)
8393 (redisplay_internal, set_cursor_from_row, try_scrolling)
8394 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8395 (redisplay_window, find_last_unchanged_at_beg_row)
8396 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8397 (trailing_whitespace_p, find_row_edges, display_line)
8398 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8399 (display_mode_element, store_mode_line_string)
8400 (pint2str, pint2hrstr, decode_mode_spec)
8401 (display_count_lines, display_string, draw_glyphs)
8402 (x_produce_glyphs, x_insert_glyphs)
8403 (rows_from_pos_range, mouse_face_from_buffer_pos)
8404 (fast_find_string_pos, mouse_face_from_string_pos)
8405 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8407 (safe_call, init_from_display_pos, handle_fontified_prop)
8408 (handle_single_display_spec, load_overlay_strings)
8409 (with_echo_area_buffer, setup_echo_area_for_printing)
8410 (display_echo_area, echo_area_display)
8411 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8412 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8413 (redisplay_window, dump_glyph_row, display_mode_line)
8414 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8415 (handle_display_spec, display_prop_string_p):
8416 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8417 (handle_single_display_spec, build_desired_tool_bar_string)
8418 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8419 (get_specified_cursor_type):
8420 Check that fixnums are in proper range for system types.
8421 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8422 (Flookup_image_map):
8423 Don't assume fixnums fit in int.
8424 (compare_overlay_entries):
8425 Avoid mishandling comparisons due to subtraction overflow.
8426 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8427 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8428 (handle_tool_bar_click):
8429 Use int, not unsigned, since we prefer signed and the signedness
8430 doesn't matter here.
8431 (get_next_display_element, next_element_from_display_vector):
8432 Use int, not EMACS_INT, when int is wide enough.
8433 (start_hourglass): Use duration_to_sec_usec to do proper
8434 overflow checking on durations.
8435 * xfaces.c (Fbitmap_spec_p):
8436 Check that fixnums are in proper range for system types.
8437 (compare_fonts_by_sort_order):
8438 Avoid mishandling comparisons due to subtraction overflow.
8439 (Fx_family_fonts, realize_basic_faces):
8440 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8441 (Fx_family_fonts):
8442 Don't assume fixnum fits in int.
8443 Use SAFE_ALLOCA_LISP, not alloca.
8444 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8445 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8446 (face_at_buffer_position, face_for_overlay_string)
8447 (face_at_string_position):
8448 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8449 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8450 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8451 (Fx_show_tip):
8452 Check that fixnums are in proper range for system types.
8453 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8454 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8455 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8456 (Fx_change_window_property): Don't assume fixnums fit in int.
8457 * xfont.c (xfont_chars_supported):
8458 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8459 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8460 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8461 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8462 * xml.c (parse_region):
8463 * xrdb.c (magic_file_p):
8464 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8465 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8466 (x_get_local_selection, x_reply_selection_request)
8467 (x_handle_selection_request, wait_for_property_change):
8468 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8469 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8470 short is wide enough.
8471 (x_send_client_event): Don't assume fixnum fits in int.
8472 * xterm.c (x_x_to_emacs_modifiers):
8473 Don't assume EMACS_INT overflows nicely into int.
8474 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8475 may come from Lisp.
8476 (handle_one_xevent): NATNUMP can eval its arg twice.
8477 (x_connection_closed):
8478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8479 * xterm.h: Adjust decls to match defn changes elsewhere.
8480 (struct scroll_bar): Use struct vectorlike_header
8481 rather than rolling our own approximation.
8482 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8483
8484 2012-05-25 Glenn Morris <rgm@gnu.org>
8485
8486 * lisp.mk (lisp): Update for more files being compiled now.
8487
8488 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8489
8490 * lread.c: Remove `read_pure' which makes no difference.
8491 (read_pure): Remove var.
8492 (unreadpure): Remove function.
8493 (readevalloop): Don't call read_list with -1 flag.
8494 (read1, read_vector): Don't test read_pure any more.
8495 (read_list): Simplify.
8496
8497 * fileio.c, character.h: Minor style tweaks.
8498
8499 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8500
8501 * window.h (clip_changed): Remove useless declaration.
8502
8503 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8504
8505 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8506 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8507
8508 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8509
8510 Remove src/m/*.
8511 This directory predates autoconf and is no longer needed nowadays.
8512 Move its few remaining bits of functionality to where they're needed.
8513 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8514 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8515 * m/template.h: Remove.
8516 * Makefile.in (M_FILE): Remove. All uses removed.
8517 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8518 * lisp.h (USE_LSB_TAG):
8519 * mem-limits.h (EXCEEDS_LISP_PTR):
8520 Use VAL_MAX, not VALBITS, in #if.
8521 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8522 (EMACS_UINT): Define unconditionally now.
8523 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8524 (BITS_PER_EMACS_INT): New constants, replacing
8525 what used to be in config.h, but not useful in #if.
8526 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8527 define them any more.
8528 (VAL_MAX): New macro.
8529 (VALMASK): Use it.
8530 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8531 BITS_PER_EMACS_INT, in #if.
8532 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8533 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8534 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8535 * s/ms-w32.h (DATA_START):
8536 Move here from removed file m/intel386.h.
8537 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8538 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8539
8540 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8541
8542 Assume C89 or later.
8543 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8544 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8545 (xrealloc):
8546 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8547 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8548 * textprop.c, tparam.c (NULL): Remove.
8549 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8550 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8551 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8552 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8553 * xterm.c (input_signal_count): Assume volatile works.
8554
8555 2012-05-21 Ken Brown <kbrown@cornell.edu>
8556
8557 * xgselect.c (xg_select): Fix first argument in call to 'select'
8558 (bug#11508).
8559
8560 2012-05-20 Ken Brown <kbrown@cornell.edu>
8561
8562 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8563 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8564
8565 2012-05-19 Ken Brown <kbrown@cornell.edu>
8566
8567 * xfns.c (x_in_use): Remove `static' qualifier.
8568 * xterm.h (x_in_use): Declare.
8569 * xgselect.c: Include xterm.h.
8570 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8571 and `display_arg' (bug#9754).
8572
8573 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8574
8575 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8576
8577 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8578 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8579
8580 2012-05-18 Eli Zaretskii <eliz@gnu.org>
8581
8582 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8583
8584 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8585 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8586
8587 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8588 reference to image_cache->refcount.
8589 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8590
8591 2012-05-17 Juri Linkov <juri@jurta.org>
8592
8593 * search.c (Fword_search_regexp, Fword_search_backward)
8594 (Fword_search_forward, Fword_search_backward_lax)
8595 (Fword_search_forward_lax): Move functions to isearch.el
8596 (bug#10145, bug#11381).
8597
8598 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8599
8600 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8601
8602 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8603
8604 * lread.c (init_obarray): Declare Qt and Qnil as special.
8605
8606 2012-05-14 Glenn Morris <rgm@gnu.org>
8607
8608 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8609 Put "libexec" before "bin", for the sake of init_callproc_1.
8610
8611 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8612
8613 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8614
8615 * unexaix.c: Port to more-recent AIX compilers.
8616 (report_error, report_error_1, make_hdr, copy_sym)
8617 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8618 Make arguments const char *, not char *, to avoid violations of C
8619 standard and to fix some AIX warnings reported by Gilles Pion.
8620
8621 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8622
8623 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8624 already have overlays loaded.
8625 (handle_single_display_spec): Before returning without displaying
8626 fringe bitmap, synchronize the bidi iterator with the main display
8627 iterator, by calling iterate_out_of_display_property.
8628 (iterate_out_of_display_property): Detect buffer iteration by
8629 testing that it->string is a Lisp string.
8630 (get_next_display_element): When the current object is exhausted,
8631 and there's something on it->stack, call set_iterator_to_next to
8632 proceed with what's on the stack, instead of returning zero.
8633 (set_iterator_to_next): If called at the end of a Lisp string,
8634 proceed to consider_string_end without incrementing string
8635 position. Don't increment display vector index past the end of
8636 the display vector. (Bug#11417)
8637 (pos_visible_p): Don't report a position visible when move_it_to
8638 stopped at the last line of window, which happens to be scanned
8639 backwards by the bidi iteration. (Bug#11464)
8640
8641 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8642
8643 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8644 and right-margin display specs even if the spec is invalid or we
8645 are on a TTY, and thus unable to display on the fringes.
8646 That's because the text with the property will not be displayed anyway,
8647 so we need to signal to the caller that this is a "replacing"
8648 display spec. This fixes display when the spec is invalid or we
8649 are on a TTY.
8650
8651 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8652
8653 * unexaix.c (make_hdr): Fix typo in prototype.
8654 This bug broke the build on AIX. Problem reported by Gilles Pion.
8655
8656 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
8657
8658 * keyboard.c (kbd_buffer_get_event): Read special events also in
8659 batch mode. (Bug#11415)
8660
8661 2012-05-12 Glenn Morris <rgm@gnu.org>
8662
8663 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8664
8665 2012-05-12 Eli Zaretskii <eliz@gnu.org>
8666
8667 * lisp.mk (lisp): Add newcomment.elc.
8668
8669 2012-05-12 Glenn Morris <rgm@gnu.org>
8670
8671 * Makefile.in (MKDIR_P): New, set by configure.
8672 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8673
8674 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8675
8676 Remove unused function hourglass_started.
8677 * dispextern.h (hourglass_started):
8678 * w32fns.c (hourglass_started):
8679 * xdisp.c (hourglass_started): Remove.
8680
8681 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
8682
8683 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8684 Update dependencies.
8685
8686 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8687
8688 * xgselect.c (xg_select): Put maxfds+1 into a var.
8689 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8690
8691 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8692
8693 2012-05-10 Dave Abrahams <dave@boostpro.com>
8694
8695 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8696 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8697
8698 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
8699
8700 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8701 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8702 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8703 Initialize xd_registered_buses.
8704
8705 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8706
8707 Untag more efficiently if USE_LSB_TAG.
8708 This is based on a proposal by YAMAMOTO Mitsuharu in
8709 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8710 For an admittedly artificial (nth 8000 longlist) benchmark on
8711 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8712 Emacs's overall text size by 1%.
8713 * lisp.h (XUNTAG): New macro.
8714 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8715 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8716 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8717 * eval.c (Fautoload):
8718 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8719 * frame.h (XFRAME): Use XUNTAG.
8720
8721 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8722 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8723 Remove unportable assumptions about print widths of types like
8724 dbus_uint32_t.
8725 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8726 intptr_t when converting between pointer and integer, to avoid GCC
8727 warnings about wrong width.
8728
8729 2012-05-09 Eli Zaretskii <eliz@gnu.org>
8730
8731 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8732 stack for each reader_thread, instead of defaulting to 8MB
8733 determined by the linker. This avoids failures in creating
8734 subprocesses on Windows 7, see the discussion in this thread:
8735 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8736
8737 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8738
8739 Fix up display of the *Minibuf-0* buffer in the mini window.
8740 * keyboard.c (read_char): Don't clear the echo area if there's no
8741 message to clear.
8742 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8743 contents of *Minibuf-0*) if there's no message displayed in its stead.
8744
8745 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
8746
8747 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8748 batch mode.
8749
8750 2012-05-06 Chong Yidong <cyd@gnu.org>
8751
8752 * lisp.mk (lisp): Update.
8753
8754 2012-05-05 Jim Meyering <meyering@redhat.com>
8755
8756 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8757
8758 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8759
8760 * data.c (PUT_ERROR): New macro.
8761 (syms_of_data): Use it. Add new error type `user-error'.
8762 * undo.c (user_error): New function.
8763 (Fprimitive_undo): Use it.
8764 * print.c (print_error_message): Adjust print style for `user-error'.
8765 * keyboard.c (user_error): New function.
8766 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8767
8768 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8769
8770 Do not limit current-time-string to years 1000..9999.
8771 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8772 (Fcurrent_time_string): Support any year that is supported by the
8773 underlying localtime representation. Don't use asctime, as it
8774 has undefined behavior for years outside the range -999..9999.
8775
8776 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8777
8778 Fix race conditions involving setenv, gmtime, localtime, asctime.
8779 Without this fix, interrupts could mess up code that uses these
8780 nonreentrant functions, since setting TZ invalidates existing
8781 tm_zone or tzname values, and since most of these functions return
8782 pointers to static storage.
8783 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8784 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8785 Grow the critical sections to include not just invoking
8786 localtime/gmtime, but also accessing these functions' results
8787 including their tm_zone values if any, and any related TZ setting.
8788 (format_time_string): Last arg is now struct tm *, not struct tm **,
8789 so that the struct tm is saved in the critical section.
8790 All callers changed. Simplify allocation of initial buffer, partly
8791 motivated by the fact that memory allocation needs to be outside
8792 the critical section.
8793
8794 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8795
8796 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8797 with RESET_INTERVAL.
8798
8799 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8800 Remove duplicated buffer name initialization.
8801
8802 2012-05-02 Jim Meyering <jim@meyering.net>
8803
8804 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8805
8806 * xfns.c (x_window): Use xstrdup (Bug#11375).
8807
8808 2012-05-02 Eli Zaretskii <eliz@gnu.org>
8809
8810 * xdisp.c (pos_visible_p): If already at a newline from the
8811 display string before the 'while' loop, don't walk back the glyphs
8812 from it3.glyph_row. Solves assertion violation when the display
8813 string begins with a newline (egg.el). (Bug#11367)
8814
8815 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8816
8817 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8818 Move to simple.el.
8819
8820 2012-05-01 Glenn Morris <rgm@gnu.org>
8821
8822 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8823 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8824 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8825 All were removed before 23.1.
8826
8827 * dispnew.c: Remove HAVE_LIBNCURSES test;
8828 it is always true on relevant platforms.
8829
8830 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8831 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8832
8833 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8834
8835 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8836
8837 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8838 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8839 Remove.
8840
8841 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8842
8843 Do not avoid creating empty evaporating overlays (Bug#9642).
8844 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8845 That is, do not delete an evaporating overlay if it becomes
8846 empty after its bounds are adjusted to fit within its buffer.
8847 This fix caused other problems, and I'm reverting it until we get
8848 to the bottom of them.
8849
8850 2012-04-27 Chong Yidong <cyd@gnu.org>
8851
8852 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8853
8854 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8855
8856 * xdisp.c (pos_visible_p): If the window start position is beyond
8857 ZV, start the display from buffer beginning. Prevents assertion
8858 violation in init_iterator when the minibuffer window is scrolled
8859 via the scroll bar.
8860
8861 * window.c (window_scroll_pixel_based): Likewise.
8862
8863 2012-04-27 Chong Yidong <cyd@gnu.org>
8864
8865 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8866
8867 2012-04-27 Glenn Morris <rgm@gnu.org>
8868
8869 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8870 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8871
8872 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8873
8874 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8875 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
8876
8877 2012-04-26 Eli Zaretskii <eliz@gnu.org>
8878
8879 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8880 display element, check also the underlying string or buffer
8881 character. (Bug#11341)
8882
8883 * w32menu.c: Include w32heap.h.
8884 (add_menu_item): If the call to AppendMenuW (via
8885 unicode_append_menu) fails, disable Unicode menus only if we are
8886 running on Windows 9X/Me.
8887
8888 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8889
8890 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8891 (xgetint): Add missing shift for LSB tags.
8892
8893 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8894
8895 * keyboard.c (read_char): Don't wipe echo area for select window
8896 events: These might get delayed via `mouse-autoselect-window'
8897 (Bug#11304).
8898
8899 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8900
8901 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8902 manipulation of :loaded-from data.
8903
8904 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8905
8906 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8907 now a cons (bug#11311).
8908
8909 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8910
8911 Do not create empty overlays with the evaporate property (Bug#9642).
8912 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8913 if it becomes empty after its bounds are adjusted to fit within
8914 its buffer. Without this fix, in a nonempty buffer (let ((o
8915 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8916 yields an empty overlay that has the evaporate property, which is
8917 not supposed to happen.
8918
8919 Fix minor GTK3 problems found by static checking.
8920 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8921 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8922 (struct _EmacsFixedClass, emacs_fixed_get_type):
8923 Move decls here from emacsgtkfixed.h, since they needn't be public.
8924 (emacs_fixed_get_type): Now static.
8925 (emacs_fixed_class_init): Omit unused local.
8926 (emacs_fixed_child_type): Remove; unused.
8927 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8928 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8929 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8930 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8931 (EMACS_FIXED_GET_CLASS): Remove; unused.
8932 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8933
8934 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8935 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8936
8937 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8938
8939 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8940 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8941 (__malloc_size_t, __malloc_ptrdiff_t):
8942 Remove. All uses removed, replaced by the definiens if needed,
8943 since we can assume C89 or better now.
8944 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8945 (protect_malloc_state, align, get_contiguous_space)
8946 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8947 (malloc_atfork_handler_child, malloc_enable_thread)
8948 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8949 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8950 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8951 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8952 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8953 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8954 Define using prototypes, not old style.
8955 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8956 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8957 (align): Don't assume that signed integer overflow wraps around.
8958 Omit unused local var.
8959 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8960 (_free_internal_nolock, memalign, mallochook, reallochook):
8961 Omit no-longer-needed casts.
8962 (valloc): Use getpagesize, not __getpagesize.
8963 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8964 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8965
8966 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8967
8968 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
8969
8970 Move functions from C to Lisp. Make non-blocking method calls
8971 the default. Implement further D-Bus standard interfaces.
8972
8973 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8974 (QCdbus_request_name_allow_replacement)
8975 (QCdbus_request_name_replace_existing)
8976 (QCdbus_request_name_do_not_queue)
8977 (QCdbus_request_name_reply_primary_owner)
8978 (QCdbus_request_name_reply_in_queue)
8979 (QCdbus_request_name_reply_exists)
8980 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8981 (QCdbus_registered_serial, QCdbus_registered_method)
8982 (QCdbus_registered_signal): New Lisp objects.
8983 (XD_DEBUG_MESSAGE): Use sizeof.
8984 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8985 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8986 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8987 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8988 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8989 (xd_signature, xd_append_arg): Allow float for integer types.
8990 (xd_get_connection_references): New function.
8991 (xd_get_connection_address): Rename from xd_initialize.
8992 Return cached address.
8993 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8994 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8995 level.
8996 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8997 Return number of refcounts.
8998 (Fdbus_get_unique_name): Make stronger parameter check.
8999 (Fdbus_message_internal): New defun.
9000 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9001 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9002 (Fdbus_send_signal, Fdbus_register_service)
9003 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9004 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9005 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9006 (Vdbus_compiled_version, Vdbus_runtime_version)
9007 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9008 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9009 (Vdbus_message_type_signal): New defvars.
9010 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9011 Adapt docstring.
9012
9013 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9014
9015 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9016 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9017 Do not assume ptrdiff_t is the same width as 'int'.
9018
9019 * alloc.c: Handle unusual debugging option combinations.
9020 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9021 since the two debugging options are incompatible.
9022 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9023 is defined.
9024 (mem_init, mem_insert, mem_insert_fixup):
9025 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9026 (NEED_MEM_INSERT): Remove; no longer needed.
9027
9028 2012-04-22 Leo Liu <sdl.web@gmail.com>
9029
9030 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9031
9032 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9033
9034 * sysdep.c [__FreeBSD__]: Minor cleanups.
9035 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9036 Use Emacs indenting style more consistently. Avoid some casts.
9037 Use 'double' consistently rather than mixing 'float' and 'double'.
9038
9039 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9040
9041 * sysdep.c (list_system_processes, system_process_attributes):
9042 Add implementation for FreeBSD (Bug#5243).
9043
9044 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9045
9046 * lisp.mk (lisp): Update.
9047
9048 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9049
9050 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9051 It is never used otherwise.
9052
9053 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9054
9055 * print.c (print_preprocess): Only check print_depth if print-circle
9056 is nil.
9057 (print_object): Check for cycles even when print-circle is nil and
9058 print-gensym is t, but only check print_depth if print-circle is nil.
9059
9060 2012-04-20 Chong Yidong <cyd@gnu.org>
9061
9062 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9063 set the status to "failed" and ensure that sentinel is run.
9064
9065 2012-04-20 Glenn Morris <rgm@gnu.org>
9066
9067 * process.c (Fset_process_inherit_coding_system_flag)
9068 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9069 (Fmake_network_process, Fmake_serial_process): Doc fix.
9070
9071 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9072
9073 * xdisp.c (string_buffer_position_lim): Limit starting position to
9074 BEGV.
9075 (set_cursor_from_row): If called for a mode-line or header-line
9076 row, return zero immediately.
9077 (try_cursor_movement): If inside continuation line, don't back up
9078 farther than the first row after the header line, if any.
9079 Don't consider the header-line row as "partially visible", even if
9080 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9081
9082 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9083
9084 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9085 (bug#11238).
9086
9087 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9088 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9089
9090 configure: new option --enable-gcc-warnings (Bug#11207)
9091 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9092 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9093 (ALL_CFLAGS): Use new macros rather than old.
9094 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9095 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9096 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9097 -Wunused-result, -Wunused-variable. This should go away once
9098 the Emacs and Gnulib regex code is merged.
9099 (xmalloc, xrealloc): Now static.
9100
9101 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9102
9103 * dired.c (Fsystem_groups): Remove unused local.
9104
9105 2012-04-17 Glenn Morris <rgm@gnu.org>
9106
9107 * dired.c (Fsystem_users): Doc fix.
9108
9109 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9110
9111 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9112 (syms_of_dired): Add them.
9113
9114 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9115
9116 Fix minor alloc.c problems found by static checking.
9117 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9118 New extern decls, to avoid calling undeclared functions.
9119 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9120 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9121 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9122 (NEED_MEM_INSERT): New macro.
9123 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9124 Remove one incorrect comment and fix another.
9125
9126 Fix minor ralloc.c problems found by static checking.
9127 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9128 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9129 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9130 (r_alloc_sbrk): Now static.
9131
9132 Improve ralloc.c interface checking.
9133 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9134 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9135 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9136 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9137 [REL_ALLOC]: ... to here, to check interface.
9138 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9139 Remove decls. This fixes an "It stinks!".
9140
9141 * alloc.c (which_symbols): Fix alignment issue / type clash.
9142
9143 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9144
9145 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9146 (struct Lisp_Misc_Any): Likewise.
9147 (struct Lisp_Free): Likewise.
9148 * alloc.c (union aligned_Lisp_Symbol): Define.
9149 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9150 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9151 (union aligned_Lisp_Misc): Define.
9152 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9153 aligned_Lisp_Misc instead of union Lisp_Misc.
9154 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9155
9156 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9157
9158 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9159 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9160 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9161 * s/netbsd.h, s/sol2-6.h:
9162 Remove definition of GC_MARK_STACK, since the default now works.
9163 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9164 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9165 no longer the default.
9166 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9167
9168 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9169
9170 * lread.c (lisp_file_lexically_bound_p):
9171 Fix hang at ";-*-\n" (bug#11238).
9172
9173 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9174
9175 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9176 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9177
9178 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9179
9180 * nsterm.m (constrainFrameRect): Always constrain when there is only
9181 one screen (Bug#10962).
9182
9183 2012-04-13 Ken Brown <kbrown@cornell.edu>
9184
9185 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9186
9187 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9188
9189 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9190
9191 2012-04-11 Daniel Colascione <dancol@dancol.org>
9192
9193 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9194 against is gone. It's better to use vfork now so that when Cygwin
9195 gains a new, working vfork, we use it automatically (bug#10398).
9196
9197 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9198
9199 * window.c (save_window_save): Obey window-point-insertion-type.
9200
9201 2012-04-11 Glenn Morris <rgm@gnu.org>
9202
9203 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9204
9205 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9206
9207 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9208
9209 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9210
9211 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9212 (force_quit_count): New var.
9213 (handle_interrupt): Use it.
9214
9215 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9216
9217 * w32.c (w32_delayed_load): Record the full path of the library
9218 being loaded (bug#10424).
9219
9220 2012-04-09 Glenn Morris <rgm@gnu.org>
9221
9222 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9223 not just in the obarray, before snarfing them. (Bug#11036)
9224
9225 * Makefile.in ($(leimdir)/leim-list.el):
9226 Pass EMACS rather than BUILT_EMACS.
9227
9228 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9229
9230 * process.c (make_process):
9231 * process.h: Add integer `gnutls_handshakes_tried' member to
9232 process struct.
9233
9234 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9235 Add convenience `GNUTLS_LOG2i' macro.
9236
9237 * gnutls.c (gnutls_log_function2i): Convenience log function.
9238 (emacs_gnutls_read): Use new log functions,
9239 `gnutls_handshakes_tried' process member, and
9240 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9241 attempts per process (connection).
9242
9243 2012-04-09 Chong Yidong <cyd@gnu.org>
9244
9245 * eval.c (Fuser_variable_p, user_variable_p_eh)
9246 (lisp_indirect_variable): Functions deleted.
9247 (Fdefvar): Caller changed.
9248
9249 * callint.c (Finteractive, Fcall_interactively):
9250 * minibuf.c (Fread_variable): Callers changed.
9251
9252 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9253
9254 * xdisp.c (set_cursor_from_row): If the display string appears in
9255 the buffer at position that is closer to point than the position
9256 after the display string, display the cursor on the first glyph of
9257 the display string. Fixes cursor display when a 'display' text
9258 property immediately follows invisible text. (Bug#11094)
9259
9260 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9261
9262 composite.c: use 'double' consistently
9263 * composite.c (get_composition_id): Use 'double' consistently
9264 instead of converting 'float' to 'double' and vice versa; this is
9265 easier to understand and avoids a GCC warning.
9266
9267 2012-04-09 Glenn Morris <rgm@gnu.org>
9268
9269 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9270 preparation for dumping it with emacs. (Bug#4789)
9271 (leimdir): New variable.
9272 ($(leimdir)/leim-list.el): New rule.
9273 (emacs$(EXEEXT)): Depend on leim-list.el.
9274
9275 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9276 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9277 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9278
9279 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9280
9281 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9282 proper alignment.
9283
9284 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9285
9286 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9287 Remove unused local variable.
9288
9289 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9290
9291 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9292 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9293 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9294 objects, as mark_maybe_pointer will catch them otherwise.
9295 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9296 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9297
9298 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9299
9300 Fix typo that broke non-Windows builds.
9301 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9302
9303 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9304
9305 Support building on MS-Windows with libxml2.
9306
9307 * makefile.w32-in (OBJ2): Add xml.$(O).
9308 (GLOBAL_SOURCES): Add xml.c.
9309 ($(BLD)/xml.$(O)): New dependency list.
9310
9311 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9312 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9313 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9314 [!WINDOWSNT]: New macros.
9315 (init_libxml2_functions, libxml2_loaded_p): New functions.
9316 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9317 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9318 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9319 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9320 linked in).
9321 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9322 Call init_libxml2_functions before calling libxml2 functions.
9323 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9324
9325 * emacs.c: Don't include libxml/parser.h.
9326 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9327 xmlCleanupParser directly.
9328
9329 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9330
9331 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9332
9333 * indent.c (Fvertical_motion): If there is a display string at
9334 point, use it.vpos to compute how many lines to backtrack after
9335 move_it_to point. (Bug#11133)
9336
9337 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9338
9339 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9340 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9341 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9342 macros related to unification of CJK characters. For the details,
9343 see the discussion following the message here:
9344 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9345
9346 2012-04-04 Chong Yidong <cyd@gnu.org>
9347
9348 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9349
9350 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9351
9352 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9353 instead of alloca. (Bug#11138)
9354
9355 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9356
9357 * w32menu.c (is_simple_dialog): Properly check lisp types.
9358 (Bug#11141)
9359
9360 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9361
9362 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9363 position we get to after a call to move_it_to fails the
9364 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9365 only if we wind up in a string from display property. (Bug#11063)
9366
9367 * window.c (Fdelete_other_windows_internal): Invalidate the row
9368 and column information about mouse highlight, so that redisplay
9369 restores it after reallocating the glyph matrices. (Bug#7464)
9370
9371 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9372 string comes from a `display' text property, use the buffer
9373 position of that property as if we actually saw that position in
9374 the row's glyphs.
9375 (move_it_by_lines): Remove the assertion that
9376 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9377 violated when there's a before-string at the beginning of a line.
9378 (Bug#11063)
9379
9380 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9381
9382 * xdisp.c (append_space_for_newline): If the default face was
9383 remapped, use the remapped face for the appended newline.
9384 (extend_face_to_end_of_line): Use the remapped default face for
9385 extending the face to the end of the line.
9386 (display_line): Call extend_face_to_end_of_line when the default
9387 face was remapped. (Bug#11068)
9388
9389 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9390
9391 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9392
9393 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9394
9395 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9396
9397 2012-03-27 Glenn Morris <rgm@gnu.org>
9398
9399 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9400 Doc fixes.
9401
9402 2012-03-26 Kenichi Handa <handa@m17n.org>
9403
9404 * dispextern.h (struct glyph): Fix previous change. Change the
9405 bit length of glyphless.ch to 25 (Bug#11082).
9406
9407 2012-03-26 Chong Yidong <cyd@gnu.org>
9408
9409 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9410 (command_loop_1): Use it; inhibit selection update for
9411 handle-select-window too (Bug#8996).
9412
9413 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9414
9415 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9416
9417 2012-03-25 Kenichi Handa <handa@m17n.org>
9418
9419 * dispextern.h (struct glyph): Change the bit length of
9420 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9421
9422 2012-03-24 Eli Zaretskii <eliz@gnu.org>
9423
9424 * s/ms-w32.h (tzname): Include time.h before redirecting to
9425 _tzname. Fixes the MSVC build. (Bug#9960)
9426
9427 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9428
9429 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9430 characters.
9431
9432 * xterm.c (XTread_socket): Only modify handling_signal if
9433 !SYNC_INPUT. (Bug#11080)
9434
9435 2012-03-23 Eli Zaretskii <eliz@gnu.org>
9436
9437 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9438 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9439 when fetching a multibyte character consumes more bytes than
9440 CHAR_BYTES returns, due to unification of CJK characters in
9441 string_char. (Bug#11073)
9442
9443 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9444
9445 * process.c (wait_reading_process_output): Handle pty disconnect
9446 by refraining from sending oneself a SIGCHLD (bug#10933).
9447
9448 2012-03-22 Chong Yidong <cyd@gnu.org>
9449
9450 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9451
9452 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9453 Mark string as coming from a prefix property.
9454 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9455 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9456
9457 2012-03-21 Chong Yidong <cyd@gnu.org>
9458
9459 * xfaces.c (Vface_remapping_alist): Doc fix.
9460
9461 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9462
9463 * w32proc.c (Fw32_set_console_codepage)
9464 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9465 Doc fixes.
9466
9467 2012-03-20 Chong Yidong <cyd@gnu.org>
9468
9469 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9470 to reflect default non-nil value of redisplay-dont-pause.
9471
9472 2012-03-19 Kenichi Handa <handa@m17n.org>
9473
9474 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9475 it fit in a valid range (Bug#11003).
9476
9477 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9478
9479 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9480 that is not from display property, accept the row as a "cursor
9481 row" if one of the string's character has a non-nil `cursor'
9482 property. Fixes cursor positioning when there are newlines in
9483 overlay strings, e.g. in icomplete.el. (Bug#11035)
9484
9485 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9486
9487 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9488
9489 2012-03-12 Chong Yidong <cyd@gnu.org>
9490
9491 * eval.c (inhibit_lisp_code): Rename from
9492 inhibit_window_configuration_change_hook; move from window.c.
9493
9494 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9495 * window.c (run_window_configuration_change_hook)
9496 (syms_of_window): Callers changed.
9497
9498 2012-03-11 Chong Yidong <cyd@gnu.org>
9499
9500 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9501
9502 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9503
9504 2012-03-10 Chong Yidong <cyd@gnu.org>
9505
9506 * frame.c (other_visible_frames): Don't assume the selected frame
9507 is visible (Bug#10955).
9508
9509 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9510
9511 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9512
9513 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9514
9515 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9516 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9517 zero (Bug#10954).
9518
9519 2012-03-03 Glenn Morris <rgm@gnu.org>
9520
9521 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9522
9523 2012-03-02 Eli Zaretskii <eliz@gnu.org>
9524
9525 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9526 position past the first glyph_row that ends at ZV. (Bug#10902)
9527 (redisplay_window, next_element_from_string): Fix typos in
9528 comments.
9529 (redisplay_window): Pass to move_it_vertically the margin in
9530 pixels, not in screen lines.
9531
9532 2012-03-02 Glenn Morris <rgm@gnu.org>
9533
9534 * buffer.c (buffer-list-update-hook): Doc fix.
9535
9536 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9537
9538 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9539 push_it before setting up the iterator for the first overlay
9540 string, even if we have an empty string loaded.
9541 (next_overlay_string): If there's an empty string on the iterator
9542 stack, pop the stack. (Bug#10903)
9543
9544 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9545
9546 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9547 Suggested by Stefan Monnier in
9548 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9549 * alloc.c (widen_to_Lisp_Object): New static function.
9550 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9551 and widening them to Lisp_Objects. This would work even if
9552 USE_LSB_TAG is defined and wide integers are used, which might
9553 happen in a future version of Emacs.
9554
9555 2012-02-25 Chong Yidong <cyd@gnu.org>
9556
9557 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9558 Doc fix.
9559
9560 * xselect.c (Fx_selection_exists_p): Doc fix.
9561 (x_clipboard_manager_save_all): Print an informative message
9562 before saving to clipboard manager.
9563
9564 2012-02-24 Chong Yidong <cyd@gnu.org>
9565
9566 * keyboard.c (process_special_events): Handle all X selection
9567 requests in kbd_buffer, not just the next one (Bug#8869).
9568
9569 2012-02-23 Chong Yidong <cyd@gnu.org>
9570
9571 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9572 call when setting menu-bar-lines and tool-bar-lines parameters.
9573 (unwind_create_frame_1): New helper function.
9574
9575 * window.c (inhibit_window_configuration_change_hook): New var.
9576 (run_window_configuration_change_hook): Obey it.
9577 (syms_of_window): Initialize it.
9578
9579 2012-02-22 Chong Yidong <cyd@gnu.org>
9580
9581 * xterm.c (x_draw_image_relief): Add missing type check for
9582 Vtool_bar_button_margin (Bug#10743).
9583
9584 2012-02-21 Chong Yidong <cyd@gnu.org>
9585
9586 * fileio.c (Vfile_name_handler_alist): Doc fix.
9587
9588 * buffer.c (Fget_file_buffer): Protect against invalid file
9589 handler return value.
9590
9591 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9592
9593 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9594 when computing $valmask.
9595
9596 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9597 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9598 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9599 It's useless in that case, and it can cause problems on hosts
9600 that allocate halves of EMACS_INT values separately.
9601 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9602 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9603 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9604 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9605 it avoids undefined behavior on hosts where shifting right by more
9606 than the word width has undefined behavior.
9607
9608 2012-02-19 Chong Yidong <cyd@gnu.org>
9609
9610 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9611 (Funhandled_file_name_directory, Ffile_name_as_directory)
9612 (Fdirectory_file_name, Fexpand_file_name)
9613 (Fsubstitute_in_file_name): Protect against invalid file handler
9614 return values (Bug#10845).
9615
9616 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9617
9618 * .gdbinit (pitx): Fix incorrect references to fields of the
9619 iterator stack.
9620
9621 2012-02-17 Chong Yidong <cyd@gnu.org>
9622
9623 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9624
9625 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9626
9627 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9628 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9629
9630 2012-02-15 Chong Yidong <cyd@gnu.org>
9631
9632 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9633 marked as special. Also, starting docstrings with * is obsolete.
9634
9635 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9636
9637 * gnutls.c (emacs_gnutls_write): Fix last change.
9638
9639 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9640
9641 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9642 send_process.
9643
9644 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9645
9646 * keymap.c (Fsingle_key_description): Handle char ranges.
9647
9648 2012-02-12 Chong Yidong <cyd@gnu.org>
9649
9650 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9651 as that creates a dangerous corner case.
9652
9653 * window.c (Fdelete_window_internal): Invalidate the mouse
9654 highlight (Bug#9904).
9655
9656 2012-02-12 Glenn Morris <rgm@gnu.org>
9657
9658 * xselect.c (Fx_own_selection_internal)
9659 (Fx_get_selection_internal, Fx_disown_selection_internal)
9660 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9661 * nsselect.m (Fx_own_selection_internal)
9662 (Fx_disown_selection_internal, Fx_selection_exists_p)
9663 (Fx_selection_owner_p, Fx_get_selection_internal):
9664 Sync docs and argument specs with the xselect.c versions.
9665
9666 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9667
9668 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9669
9670 2012-02-11 Eli Zaretskii <eliz@gnu.org>
9671
9672 * w32select.c (Fx_selection_exists_p): Sync doc string and
9673 argument list with xselect.c. (Bug#10783)
9674
9675 * w16select.c (Fx_selection_exists_p): Sync doc string and
9676 argument list with xselect.c. (Bug#10783)
9677
9678 2012-02-10 Glenn Morris <rgm@gnu.org>
9679
9680 * fns.c (Fsecure_hash): Doc fix.
9681
9682 2012-02-09 Kenichi Handa <handa@m17n.org>
9683
9684 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9685
9686 2012-02-07 Chong Yidong <cyd@gnu.org>
9687
9688 * buffer.c (Fbuffer_local_variables)
9689 (buffer_lisp_local_variables): Handle unbound vars correctly;
9690 don't let Qunbound leak into Lisp.
9691
9692 2012-02-07 Glenn Morris <rgm@gnu.org>
9693
9694 * image.c (Fimagemagick_types): Doc fix.
9695
9696 * image.c (imagemagick-render-type): Change it from a lisp object
9697 to an integer. Move the doc here from the lisp manual.
9698 Treat all values not equal to 0 the same.
9699
9700 2012-02-06 Chong Yidong <cyd@gnu.org>
9701
9702 * doc.c (store_function_docstring): Avoid applying docstring of
9703 alias to base function (Bug#2603).
9704
9705 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9706
9707 * .gdbinit (pp1, pv1): Remove redundant defines.
9708 (pr): Use pp.
9709
9710 2012-02-04 Chong Yidong <cyd@gnu.org>
9711
9712 * nsterm.m: Declare a global (Bug#10694).
9713
9714 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9715
9716 * w32.c (get_emacs_configuration_options):
9717 Include --enable-checking, if specified, in the return value.
9718
9719 2012-02-04 Martin Rudalics <rudalics@gmx.at>
9720
9721 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9722 after rounding frame sizes. (Bug#9723)
9723
9724 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9725
9726 * keyboard.c (adjust_point_for_property): Don't position point
9727 before BEGV. (Bug#10696)
9728
9729 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9730
9731 Handle overflow when computing char display width (Bug#9496).
9732 * character.c (char_width): Return EMACS_INT, not int.
9733 (char_width, c_string_width): Check for overflow when
9734 computing the width; this is possible now that individual
9735 characters can have unbounded width. Problem introduced
9736 by merge from Emacs 23 on 2012-01-19.
9737
9738 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
9739
9740 * dbusbind.c (Fdbus_register_method): Mention the return value
9741 :ignore in the docstring.
9742
9743 2012-02-02 Glenn Morris <rgm@gnu.org>
9744
9745 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9746
9747 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9748 Unconditionally set to t. (Bug#10673)
9749 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9750 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9751 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9752
9753 2012-02-02 Kenichi Handa <handa@m17n.org>
9754
9755 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9756 0, do not call append_composite_glyph.
9757
9758 2012-02-02 Kenichi Handa <handa@m17n.org>
9759
9760 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9761 NULL (Bug#6988).
9762 (x_produce_glyphs): If the component of a composition is a null
9763 string, set it->pixel_width to 1 to avoid zero-width glyph.
9764
9765 2012-02-01 Eli Zaretskii <eliz@gnu.org>
9766
9767 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9768 first 2 arguments are identical. This makes inserting large
9769 output from a subprocess an order of magnitude faster on
9770 MS-Windows, where all sbrk'ed memory is always contiguous.
9771
9772 2012-01-31 Glenn Morris <rgm@gnu.org>
9773
9774 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9775 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9776 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9777
9778 2012-01-29 Glenn Morris <rgm@gnu.org>
9779
9780 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9781
9782 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9783
9784 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9785
9786 2012-01-28 Chong Yidong <cyd@gnu.org>
9787
9788 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9789
9790 2012-01-26 Chong Yidong <cyd@gnu.org>
9791
9792 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9793
9794 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9795 repeat counts (Bug#10507).
9796
9797 2012-01-26 Glenn Morris <rgm@gnu.org>
9798
9799 * lread.c (syms_of_lread): Doc fix.
9800
9801 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9802
9803 * coding.c (encode_designation_at_bol): Change return value to
9804 EMACS_INT.
9805
9806 2012-01-25 Chong Yidong <cyd@gnu.org>
9807
9808 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9809
9810 2012-01-21 Chong Yidong <cyd@gnu.org>
9811
9812 * floatfns.c (Fcopysign): Make the second argument non-optional,
9813 since nil is not allowed anyway.
9814
9815 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9816
9817 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9818 (send_process): Likewise.
9819
9820 2012-01-19 Martin Rudalics <rudalics@gmx.at>
9821
9822 * window.c (save_window_save, Fcurrent_window_configuration)
9823 (Vwindow_persistent_parameters): Do not use Qstate.
9824 Rewrite doc-strings.
9825
9826 2012-01-19 Kenichi Handa <handa@m17n.org>
9827
9828 * character.c (char_width): New function.
9829 (Fchar_width, c_string_width, lisp_string_width):
9830 Use char_width (Bug#9496).
9831
9832 2012-01-16 Martin Rudalics <rudalics@gmx.at>
9833
9834 * window.c (Vwindow_persistent_parameters): New variable.
9835 (Fset_window_configuration, save_window_save): Handle persistent
9836 window parameters.
9837
9838 2012-01-14 Eli Zaretskii <eliz@gnu.org>
9839
9840 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9841 thrashing the stack of the thread. (Bug#9087)
9842
9843 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9844
9845 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9846
9847 2012-01-11 Eli Zaretskii <eliz@gnu.org>
9848
9849 * xdisp.c (rows_from_pos_range): Handle the case where the
9850 highlight ends on a newline. (Bug#10464)
9851 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9852 he end column for display of highlight that ends on a newline
9853 before a R2L line.
9854
9855 2012-01-11 Glenn Morris <rgm@gnu.org>
9856
9857 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9858 from load-path also when installation-directory is nil. (Bug#10208)
9859
9860 2012-01-10 Glenn Morris <rgm@gnu.org>
9861
9862 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9863
9864 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9865 Update template values to be closer to their typical values these days.
9866
9867 2012-01-09 Eli Zaretskii <eliz@gnu.org>
9868
9869 * xdisp.c (rows_from_pos_range): Accept additional argument
9870 DISP_STRING, and accept any glyph in a row whose object is that
9871 string as eligible for mouse highlight. Fixes mouse highlight of
9872 display strings from overlays. (Bug#10464)
9873
9874 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
9875
9876 emacs: fix an auto-save permissions race condition (Bug#10400)
9877 * fileio.c (auto_saving_dir_umask): New static var.
9878 (Fmake_directory_internal): Use it.
9879 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9880 creating the directory. The old code temporarily assigns
9881 too-generous permissions to the directory.
9882 (do_auto_save_eh): Clear it.
9883 (Fdo_auto_save): Catch all errors, not just file errors, so
9884 that the var is always cleared.
9885
9886 2012-01-07 Eli Zaretskii <eliz@gnu.org>
9887
9888 * search.c (scan_buffer): Pass character positions to
9889 know_region_cache, not byte positions. (Bug#6540)
9890
9891 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
9892
9893 * w32.c (sys_rename): Report EXDEV when rename of a directory
9894 fails because the target is on another logical disk. (Bug#10284)
9895
9896 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9897
9898 * xterm.c (x_embed_request_focus): New function.
9899
9900 * xterm.h: Add prototype.
9901
9902 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9903
9904 2012-01-05 Glenn Morris <rgm@gnu.org>
9905
9906 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9907
9908 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9909
9910 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9911 Load gnutls_transport_set_lowat only if GnuTLS version is below
9912 2.11.1.
9913 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9914 GnuTLS versions below 2.11.1.
9915
9916 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9917
9918 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9919 to the doc string advising against its use for altering the way
9920 windows are scrolled.
9921
9922 2011-12-28 Kenichi Handa <handa@m17n.org>
9923
9924 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9925 coding-system ASCII compatible only when it does not produce BOM
9926 on encoding (Bug#10383).
9927
9928 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9929
9930 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9931 can scroll.
9932 (create_and_show_popup_menu): Always use menu_position_func for
9933 Gtk3 (Bug#10361).
9934
9935 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9936
9937 * callint.c (Fcall_interactively): Don't truncate prompt string.
9938
9939 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9940
9941 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9942 property that ends at ZV, so that the bidi iteration could be
9943 resumed from there (after widening). (Bug#10360)
9944
9945 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9946
9947 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9948
9949 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9950
9951 * nsterm.m (x_free_frame_resources):
9952 Release f->output_data.ns->miniimage.
9953 (ns_index_color): Fix indentation. Do not retain
9954 color_table->colors[i].
9955
9956 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9957 before returning.
9958
9959 * nsfns.m (x_set_background_color): Assign return value from
9960 ns_index_color to face-background instead of NSColor*.
9961 (ns_implicitly_set_icon_type): Fix indentation.
9962 Change assignment in for loop to comparison.
9963
9964 * emacs.c (ns_pool): New variable.
9965 (main): Assign ns_pool.
9966 (Fkill_emacs): Call ns_release_autorelease_pool.
9967
9968 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9969 autorelease fdesc, release fdAttrs and tdict.
9970 (ns_get_covering_families): Release charset.
9971 (ns_findfonts): Release NSFontDescriptor created with new.
9972 (ns_uni_to_glyphs): Fix indentation.
9973 (setString): Release attrStr before assigning new value.
9974
9975 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9976
9977 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9978 and NS_IMPL_COCOA.
9979 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9980 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9981
9982 2011-12-18 David Reitter <reitter@cmu.edu>
9983
9984 * nsterm.m (ns_term_init): Subscribe for notifications
9985 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9986 to method trackingNotification in EmacsMenu.
9987
9988 * nsmenu.m (trackingMenu): New variable.
9989 (trackingNotification): New method (from Aquamacs).
9990 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9991 from Aquamacs (Bug#7030).
9992
9993 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9994
9995 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9996 (symbol_to_nsstring): Fix indentation.
9997 (ns_symbol_to_pb): New function.
9998 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9999 (Fns_rotate_cut_buffers_internal): Remove.
10000 (Fns_store_selection_internal): Rename from
10001 Fns_store_cut_buffer_internal.
10002 (ns_get_foreign_selection, Fx_own_selection_internal)
10003 (Fx_disown_selection_internal, Fx_selection_exists_p)
10004 (Fns_get_selection_internal, Fns_store_selection_internal):
10005 Use ns_symbol_to_pb and check if return value is nil.
10006 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10007 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10008 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10009 renamed to Sns_store_selection_internal.
10010 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10011 and remove this function.
10012 (ns_handle_selection_clear): Remove, never used.
10013 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10014 here.
10015
10016 2011-12-17 Ken Brown <kbrown@cornell.edu>
10017
10018 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10019 GID is unknown (Bug#10257).
10020
10021 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10022
10023 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10024 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10025 which caused a build failure on GNU/Linux IA-64. This problem was
10026 introduced by my 2011-10-07 patch.
10027
10028 2011-12-15 Juri Linkov <juri@jurta.org>
10029
10030 * image.c (imagemagick_error): New function. (Bug#10112)
10031 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10032 Use `imagemagick_error' where ImageMagick functions return
10033 `MagickFalse'.
10034 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10035 proper order.
10036
10037 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10038
10039 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10040 fill background (Bug#8992).
10041
10042 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10043
10044 * window.c (Vwindow_combination_resize)
10045 (Vwindow_combination_limit): Use t instead of non-nil in
10046 doc-strings.
10047 (Vrecenter_redisplay): Add first sentence of doc-string on
10048 separate line.
10049 (Frecenter): Fix doc-string typo.
10050
10051 2011-12-11 Kenichi Handa <handa@m17n.org>
10052
10053 * coding.c (Funencodable_char_position): Pay attention to the
10054 buffer text relocation (Bug#9389).
10055
10056 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10057
10058 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10059 gtk_init (Bug#10100).
10060
10061 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10062
10063 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10064 IT->string is nil. (Bug#10263)
10065
10066 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10067
10068 * nsterm.h (x_free_frame_resources): Declare.
10069
10070 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10071 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10072
10073 * nsterm.h (ns_get_defaults_value): Declare.
10074
10075 * nsterm.m (ns_default): Call ns_get_defaults_value.
10076
10077 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10078
10079 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10080 (Bug#10170)
10081
10082 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10083
10084 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10085 that where the value of an _OBJC_* symbol points to is in the .bss
10086 section (Bug#10240).
10087
10088 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10089
10090 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10091 after the loop to call ccl_driver at least once (Bug#8619).
10092
10093 2011-12-08 Kenichi Handa <handa@m17n.org>
10094
10095 * ftfont.c (get_adstyle_property): Fix previous change
10096 (Bug#10233).
10097
10098 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10099
10100 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10101 dirs from the default value of EMACSLOADPATH (bug#10208).
10102
10103 2011-12-07 Glenn Morris <rgm@gnu.org>
10104
10105 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10106 installation and source directories as well. (Bug#10208)
10107
10108 2011-12-06 Chong Yidong <cyd@gnu.org>
10109
10110 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10111
10112 2011-12-06 Glenn Morris <rgm@gnu.org>
10113
10114 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10115 as an error, not just -1. (Bug#10217)
10116
10117 2011-12-05 Chong Yidong <cyd@gnu.org>
10118
10119 * keyboard.c (process_special_events): New function.
10120 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10121
10122 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10123
10124 * coding.c (encode_designation_at_bol): Don't use uninitialized
10125 local variable (Bug#9318).
10126
10127 2011-12-05 Kenichi Handa <handa@m17n.org>
10128
10129 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10130 return Qnil (Bug#8046, Bug#10193).
10131
10132 2011-12-05 Kenichi Handa <handa@m17n.org>
10133
10134 * coding.c (encode_designation_at_bol): New args charbuf_end and
10135 dst. Return the number of produced bytes. Callers changed.
10136 (coding_set_source): Return how many bytes coding->source was
10137 relocated.
10138 (coding_set_destination): Return how many bytes
10139 coding->destination was relocated.
10140 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10141 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10142
10143 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10144
10145 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10146 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10147 macro (Bug#9318).
10148
10149 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10150
10151 The following changes are to fix Bug#9318.
10152
10153 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10154 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10155 (encode_coding_iso_2022, encode_coding_sjis)
10156 (encode_coding_big5, encode_coding_charset): Use the above macros.
10157
10158 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10159
10160 * lisp.h (process_quit_flag): Fix external declaration.
10161
10162 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10163
10164 Don't macro-inline non-performance-critical code.
10165 * eval.c (process_quit_flag): New function.
10166 * lisp.h (QUIT): Use it.
10167
10168 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10169
10170 * nsfns.m (get_geometry_from_preferences): New function.
10171 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10172
10173 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10174
10175 * emacs.c (Qkill_emacs): Define.
10176 (syms_of_emacs): Initialize it.
10177 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10178 Qquit_flag to `kill-emacs' instead.
10179 (quit_throw_to_read_char): Add parameter `from_signal'.
10180 All callers changed. Call Fkill_emacs if requested and safe.
10181 * lisp.h (QUIT): Call Fkill_emacs if requested.
10182
10183 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10184
10185 * widget.c (update_wm_hints): Return if wmshell is null.
10186 (widget_update_wm_size_hints): New function.
10187
10188 * widget.h (widget_update_wm_size_hints): Declare.
10189
10190 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10191 widget_update_wm_size_hints (Bug#10104).
10192
10193 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10194
10195 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10196 before a newline, prepare the bidi iterator for consuming the
10197 newline, and keep the current paragraph direction. (Bug#10183)
10198 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10199
10200 2011-12-02 Juri Linkov <juri@jurta.org>
10201
10202 * search.c (Fword_search_regexp): New Lisp function created from
10203 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10204 (Fword_search_backward, Fword_search_forward)
10205 (Fword_search_backward_lax, Fword_search_forward_lax):
10206 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10207 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10208
10209 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10210
10211 * fileio.c (Finsert_file_contents): Move after-change-function call
10212 to before the "handled:" label, since all "goto handled" appear in
10213 cases where the *-change-functions have already been properly called
10214 (bug#10117).
10215
10216 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10217
10218 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10219 waiting for input. (Bug#10169)
10220
10221 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10222
10223 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10224 verifies glyph row's hash code--we have just reallocated the
10225 glyphs, so their contents can be complete garbage. (Bug#10164)
10226
10227 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10228
10229 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10230
10231 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10232
10233 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10234 attributes are tested _before_ calling verify_row_hash, to protect
10235 against GCC re-ordering of the tests. (Bug#10164)
10236
10237 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10238
10239 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10240
10241 * xterm.c (handle_one_xevent): Only set async_visible and friends
10242 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10243 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10244 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10245
10246 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10247
10248 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10249 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10250 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10251 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10252 All uses changed to use GCPRO1 etc.
10253 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10254 Revert to old implementation (i.e., before 2011-03-11).
10255
10256 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10257
10258 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10259 of scroll runs so as to avoid assigning disabled bogus rows and
10260 unnecessary graphics copy operations.
10261
10262 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10263
10264 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10265 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10266 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10267 (malloc, free, realloc, calloc): Redirect to e_* only when
10268 compiling Emacs.
10269
10270 * lisp.h (GCTYPEBITS): Move before first use.
10271 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10272 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10273 this macro definition.
10274
10275 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10276 _MSC_VER.
10277
10278 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10279
10280 * gtkutil.c (xg_create_frame_widgets):
10281 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10282 present with Gtk+ 2.0.
10283
10284 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10285
10286 * fileio.c (Finsert_file_contents): Undo previous change; see
10287 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10288
10289 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10290
10291 Rename locals to avoid shadowing.
10292 * fileio.c (Finsert_file_contents):
10293 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10294 * process.c (wait_reading_process_output):
10295 Rename inner 'proc' to 'p' to avoid shadowing.
10296 Indent for consistency with usual Emacs style.
10297
10298 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10299
10300 * xdisp.c (redisplay_window): If cursor row is not fully visible
10301 after recentering, and scroll-conservatively is set to a large
10302 number, scroll window by a few more lines to make the cursor fully
10303 visible and out of scroll-margin. (Bug#10105)
10304 (start_display): Don't move to the next line if the display should
10305 start at a newline that is part of a display vector or an overlay
10306 string. (Bug#10119)
10307
10308 2011-11-24 Juri Linkov <juri@jurta.org>
10309
10310 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10311 after the `MagickPingImage' call. (Bug#10112)
10312
10313 2011-11-23 Chong Yidong <cyd@gnu.org>
10314
10315 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10316
10317 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10318
10319 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10320 making another buffer current. (Bug#10114)
10321
10322 2011-11-23 Glenn Morris <rgm@gnu.org>
10323
10324 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10325
10326 2011-11-23 Chong Yidong <cyd@gnu.org>
10327
10328 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10329 using it (Bug#5984).
10330
10331 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10332
10333 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10334 and header-lines, as they don't have one computed for them.
10335 (Bug#10098)
10336
10337 * .gdbinit (prow): Make displayed values more self-explaining.
10338 Add row's hash code.
10339
10340 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10341
10342 * process.c (wait_reading_process_output): Fix asynchrounous
10343 GnuTLS socket handling on some versions of the GnuTLS library.
10344 (wait_reading_process_output): Add comment and URL.
10345
10346 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10347
10348 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10349
10350 2011-11-21 Chong Yidong <cyd@gnu.org>
10351
10352 * window.c (Fnext_window, Fprevious_window): Doc fix.
10353
10354 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10355
10356 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10357
10358 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10359
10360 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10361
10362 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10363
10364 * window.c (Fset_window_combination_limit): Rename argument
10365 STATUS to LIMIT.
10366 (Vwindow_combination_limit): Remove "status" from doc-string.
10367
10368 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10369
10370 * m/ibms390.h: Remove.
10371 * m/ibms390x.h: Don't include "ibms390.h".
10372
10373 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10374
10375 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10376 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10377
10378 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10379
10380 * casetab.c (Fset_case_table):
10381 * charset.c (Fcharset_after): Fix typos.
10382
10383 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10384
10385 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10386 Otherwise, valgrind does not work on some platforms.
10387 Problem reported by Andreas Schwab in
10388 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10389 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10390 is set, removing the need for VIRT_ADDRESS_VARIES.
10391 (PURE_P): Use a more-efficient implementation that needs just one
10392 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10393 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10394 to 4 (xorl, subq, cmpq, setbe).
10395 * alloc.c (pure): Always extern now, since that's the
10396 VIRT_ADDR_VARIES behavior.
10397 (PURE_POINTER_P): Use a single comparison, not two, for
10398 consistency with the new puresize.h.
10399 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10400 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10401 Remove VIRT_ADDR_VARIES no longer needed.
10402
10403 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10404
10405 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10406 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10407 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10408 behave as if the cursor position were at the window margin.
10409
10410 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10411 and the cursor position is out of bounds, behave as if the cursor
10412 position were at the window margin. (Bug#10075)
10413
10414 2011-11-18 Chong Yidong <cyd@gnu.org>
10415
10416 * window.c (Fwindow_combination_limit): Make first argument
10417 non-optional, since it is meaningless for live windows like the
10418 selected window.
10419
10420 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10421
10422 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10423
10424 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10425
10426 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10427 (graft_intervals_into_buffer): Simplify.
10428
10429 2011-11-18 Eli Zaretskii <eliz@gnu.org>
10430
10431 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10432 hash values of the two rows.
10433 (copy_row_except_pointers): Preserve the used[] arrays and the
10434 hash values of the two rows. (Bug#10035)
10435 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10436
10437 * xdisp.c (row_hash): New function, body extracted from
10438 compute_line_metrics.
10439 (compute_line_metrics): Call row_hash, instead of computing the
10440 hash code inline.
10441
10442 * dispnew.c (verify_row_hash): Call row_hash for computing the
10443 hash code of a row, instead of duplicating code from xdisp.c.
10444
10445 * dispextern.h (row_hash): Add prototype.
10446
10447 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10448
10449 * frame.c (delete_frame): Don't delete the terminal when the last
10450 X frame is closed if emacs is built with GTK toolkit.
10451
10452 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
10453
10454 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10455
10456 2011-11-17 Martin Rudalics <rudalics@gmx.at>
10457
10458 * window.c (Vwindow_splits): Rename to
10459 Vwindow_combination_resize. Suggested by Juri Linkov.
10460 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10461 of Vwindow_splits.
10462
10463 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10464
10465 * nsfns.m (Fns_font_name):
10466 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10467
10468 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10469
10470 * window.h (window): Rename slot "nest" to "combination_limit".
10471 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10472 (Fset_window_nest): Rename to Fset_window_combination_limit.
10473 (Vwindow_nest): Rename to Vwindow_combination_limit.
10474 (recombine_windows, make_parent_window, make_window)
10475 (Fsplit_window_internal, saved_window)
10476 (Fset_window_configuration, save_window_save): Rename all
10477 occurrences of window_nest to window_combination_limit.
10478
10479 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10480
10481 * image.c (imagemagick_load_image): Fix typo.
10482
10483 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10484
10485 * xdisp.c (display_line): Move the call to
10486 highlight_trailing_whitespace before the call to
10487 compute_line_metrics, since the latter needs to see the final
10488 faces of all the glyphs to compute ROW's hash value.
10489 Fixes assertion violations in row_equal_p. (Bug#10035)
10490
10491 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10492
10493 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10494 just return (bug#10044).
10495
10496 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10497
10498 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10499 with user-defined heap size. Bump the default size of the temacs
10500 heap to 27MB, to avoid memory warning when running temacs.
10501 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10502
10503 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10504 current_matrix and desired_matrix. (Bug#9990)
10505 (verify_row_hash) [XASSERTS]: New function.
10506 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10507 that the hash value of glyph rows is correct.
10508
10509 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10510
10511 * window.h (window): Remove splits slot.
10512 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10513 (Fdelete_other_windows_internal, make_parent_window)
10514 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10515 (Fset_window_configuration, save_window_save): Don't deal with
10516 split status of windows.
10517 (saved_window): Remove splits slot.
10518 (Vwindow_splits): Rewrite doc-string.
10519
10520 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10521
10522 * xfns.c (unwind_create_frame):
10523 * nsfns.m (unwind_create_frame):
10524 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10525 Vframe_list (Bug#9999).
10526
10527 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10528
10529 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10530
10531 2011-11-11 Kenichi Handa <handa@m17n.org>
10532
10533 * callproc.c (Fcall_process): Set the member dst_multibyte of
10534 process_coding.
10535
10536 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10537
10538 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10539 avoid a crash (bug#9496).
10540
10541 2011-11-09 Chong Yidong <cyd@gnu.org>
10542
10543 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10544 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10545
10546 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10547
10548 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10549
10550 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10551
10552 Avoid some portability problems by eschewing 'extern inline' functions.
10553 The trivial performance wins aren't worth the portability hassles; see
10554 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10555 et seq.
10556 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10557 (window_box_width, window_box_left, window_box_left_offset)
10558 (window_box_right, window_box_right_offset): Undo previous change,
10559 by removing the "extern"s.
10560 * intervals.c (adjust_intervals_for_insertion)
10561 (adjust_intervals_for_deletion): Undo previous change,
10562 making these static again.
10563 (offset_intervals, temp_set_point_both, temp_set_point)
10564 (copy_intervals_to_string): No longer inline.
10565 * xdisp.c (window_text_bottom_y, window_box_width)
10566 (window_box_height, window_box_left_offset)
10567 (window_box_right_offset, window_box_left, window_box_right)
10568 (window_box): No longer inline.
10569
10570 2011-11-08 Chong Yidong <cyd@gnu.org>
10571
10572 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10573 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10574 Signal an error if not a live window.
10575 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10576 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10577
10578 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
10579
10580 * lisp.h (syms_of_abbrev): Remove declaration.
10581 Reported by CHENG Gao <chenggao@royau.me>.
10582
10583 2011-11-07 Eli Zaretskii <eliz@gnu.org>
10584
10585 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10586 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10587 of temacs in GUI mode.
10588
10589 2011-11-07 Martin Rudalics <rudalics@gmx.at>
10590
10591 * window.h: Declare delete_all_child_windows instead of
10592 delete_all_subwindows.
10593 * window.c (Fwindow_nest, Fset_window_nest)
10594 (Fset_window_new_total, Fset_window_new_normal)
10595 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10596 (delete_all_subwindows): Rename to delete_all_child_windows.
10597 (Fdelete_other_windows_internal, Fset_window_configuration):
10598 Call delete_all_child_windows instead of delete_all_subwindows.
10599 * frame.c (delete_frame): Call delete_all_child_windows instead
10600 of delete_all_subwindows.
10601
10602 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10603
10604 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10605 This is also needed for porting to any host where GC_MARK_STACK is
10606 not GC_MAKE_GCPROS_NOOPS.
10607 (which_symbols): Use it.
10608
10609 2011-11-07 Kenichi Handa <handa@m17n.org>
10610
10611 * coding.c (coding_set_destination): Check coding->src_pos only
10612 when coding->src_object is a buffer (bug#9910).
10613
10614 * process.c (send_process): Set the member src_multibyte of coding
10615 to 0 (bug#9911) when sending a unibyte text.
10616
10617 * callproc.c (Fcall_process): Set the member src_multibyte of
10618 process_coding to 0 (bug#9912).
10619
10620 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10621
10622 * xmenu.c (cleanup_widget_value_tree): New function.
10623 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10624 calling free_menubar_widget_value_tree directly (Bug#9830).
10625
10626 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10627
10628 Fix some portability problems with 'inline'.
10629 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10630 (window_box_width, window_box_left, window_box_left_offset)
10631 (window_box_right, window_box_right_offset): Declare extern.
10632 Otherwise, these inline functions do not conform to C99 and
10633 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10634 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10635 * intervals.c (adjust_intervals_for_insertion)
10636 (adjust_intervals_for_deletion): Now extern, because otherwise the
10637 extern inline functions 'offset_intervals' couldn't refer to it.
10638 (static_offset_intervals): Remove.
10639 (offset_intervals): Rewrite using the old contents of
10640 static_offset_intervals. The old version didn't conform to C99
10641 because an extern inline function contained a reference to an
10642 identifier with static linkage.
10643
10644 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10645
10646 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10647 GC.
10648
10649 2011-11-06 Eli Zaretskii <eliz@gnu.org>
10650
10651 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10652 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10653 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10654 return Qleft_to_right.
10655
10656 2011-11-06 Chong Yidong <cyd@gnu.org>
10657
10658 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10659 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10660 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10661 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10662 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10663 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10664 (Fwindow_vscroll): Doc fix.
10665 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10666 argument, since it makes no sense to pass a live window and for
10667 consistency with window-child.
10668
10669 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10670
10671 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10672 support MSVC.
10673
10674 2011-11-05 Jason Rumney <jasonr@gnu.org>
10675
10676 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10677 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10678 fonts (Bug#6029).
10679 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10680 bitwise arithmetic preventing use of unicode-sip and non-truetype
10681 opentype fonts.
10682
10683 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10684
10685 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10686 "emacs"-only part.
10687
10688 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10689 initialization code to keep similarity to xfns.c after changes
10690 from 2011-11-05.
10691
10692 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10693
10694 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10695 (unwind_create_frame): New function (Bug#9943).
10696 (Fx_create_frame): Restructure code to be more similar to the one in
10697 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10698 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10699 Move terminal->reference_count++ just before making the frame official
10700 (Bug#9943).
10701
10702 * nsterm.m (x_free_frame_resources): New function.
10703 (x_destroy_window): Move code to x_free_frame_resources.
10704
10705 * xfns.c (unwind_create_frame): Fix comment.
10706 (Fx_create_frame, x_create_tip_frame):
10707 Move terminal->reference_count++ just before making the frame
10708 official. Move initialization of image_cache_refcount and
10709 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10710
10711 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10712
10713 Support MSVC build with newer versions of Visual Studio.
10714 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10715 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10716 nt/gmake.defs.
10717
10718 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10719 which are not supported by MSVC.
10720 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10721 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10722 bitfields.
10723 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10724 types in bitfields.
10725 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10726
10727 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10728
10729 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
10730
10731 Support MSVC build with newer versions of Visual Studio.
10732 * w32.c: Don't include w32api.h for MSVC.
10733 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10734
10735 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10736 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10737 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10738 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10739 e_* cousins.
10740 (alloca) [_MSC_VER]: Define to _alloca.
10741
10742 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10743
10744 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10745
10746 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10747
10748 * xdisp.c (note_mouse_highlight): If either of
10749 previous/next-single-property-change returns nil, treat that as
10750 the beginning or the end of the buffer. (Bug#9955)
10751
10752 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10753
10754 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10755 label is not null (Bug#9951).
10756 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10757 may be NULL.
10758
10759 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10760
10761 * window.c (Fwindow_body_size): Mention in the doc string that the
10762 return value is in frame's canonical units. (Bug#9949)
10763
10764 2011-11-03 Eli Zaretskii <eliz@gnu.org>
10765
10766 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10767
10768 * w32fns.c (unwind_create_frame): If needed, free the glyph
10769 matrices of the partially constructed frame. (Bug#9943)
10770 * xfns.c (unwind_create_frame): Likewise.
10771
10772 2011-11-01 Eli Zaretskii <eliz@gnu.org>
10773
10774 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10775 Don't stop backward scan on the continuation glyph, even though
10776 its CHARPOS is positive.
10777 (mouse_face_from_buffer_pos, note_mouse_highlight):
10778 Rename cover_string to disp_string.
10779
10780 2011-11-01 Martin Rudalics <rudalics@gmx.at>
10781
10782 * window.c (temp_output_buffer_show): Don't use
10783 Vtemp_buffer_show_specifiers.
10784 (Vtemp_buffer_show_specifiers): Remove unused variable.
10785
10786 2011-10-30 Eli Zaretskii <eliz@gnu.org>
10787
10788 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10789 past the beginning of the current glyph matrix.
10790
10791 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
10792
10793 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10794 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10795 HAVE_GTK3 (Bug#9869).
10796
10797 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10798 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10799
10800 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10801
10802 * xterm.c: Declare x_handle_net_wm_state to return int.
10803 (handle_one_xevent): Check if we are iconified but don't have
10804 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10805 (get_current_wm_state): Return non-zero if not hidden,
10806 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10807 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10808 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10809 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10810
10811 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10812
10813 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10814 so that this new function doesn't get optimized away by a
10815 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10816
10817 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10818
10819 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10820
10821 2011-10-29 Eli Zaretskii <eliz@gnu.org>
10822
10823 Fix the `xbytecode' command.
10824 * .gdbinit (xprintbytestr): New command.
10825 (xwhichsymbols): Rename from `which'; all callers changed.
10826 (xbytecode): Print the byte-code string as well.
10827
10828 2011-10-29 Kim Storm <storm@cua.dk>
10829
10830 * alloc.c (which_symbols): New function.
10831
10832 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10833
10834 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10835 line. (Bug#9903)
10836
10837 2011-10-29 Glenn Morris <rgm@gnu.org>
10838
10839 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10840 Not clear what it was for, and it causes various bugs. (Bug#9839)
10841
10842 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10843
10844 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10845 possible random value that matches one of those tested as
10846 condition to clear the mouse face.
10847
10848 2011-10-28 Chong Yidong <cyd@gnu.org>
10849
10850 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10851
10852 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10853
10854 * window.c (make_window): Initialize phys_cursor_on_p.
10855
10856 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10857
10858 * lisp.h (struct Lisp_Symbol): Update comments.
10859
10860 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
10861
10862 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10863
10864 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10865
10866 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10867 <oslsachem@gmail.com> for helping to debug this.
10868
10869 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10870 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10871 (g_b_init_get_glyph_outline_w): New static variables.
10872 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10873 (GetGlyphOutlineW_Proc): New typedefs.
10874 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10875 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10876 New functions.
10877 (w32font_open_internal, compute_metrics):
10878 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10879 instead of calling the "wide" APIs directly.
10880
10881 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10882
10883 * w32.h (syms_of_w32font): Add prototype.
10884
10885 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10886
10887 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10888 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10889 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10890 (Fmove_to_window_line): Doc fix.
10891
10892 2011-10-27 Chong Yidong <cyd@gnu.org>
10893
10894 * process.c (make_process): Set gnutls_state to NULL.
10895
10896 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10897 non-NULL, regardless of GNUTLS_INITSTAGE.
10898 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10899 an error. Set process slots as soon as we allocate them.
10900
10901 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10902
10903 2011-10-27 Chong Yidong <cyd@gnu.org>
10904
10905 * gnutls.c (emacs_gnutls_deinit): New function.
10906 Deallocate credentials structures as well as calling gnutls_deinit.
10907 (Fgnutls_deinit, Fgnutls_boot): Use it.
10908
10909 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10910 (deactivate_process): Call emacs_gnutls_deinit.
10911
10912 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10913
10914 * image.c (x_create_x_image_and_pixmap):
10915 * w32.c (sys_rename, w32_delayed_load):
10916 * w32font.c (fill_in_logfont):
10917 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10918
10919 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10920
10921 * w32fns.c (w32_default_color_map): New function,
10922 extracted from Fw32_default_color_map.
10923 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10924
10925 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10926
10927 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10928
10929 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10930
10931 * keyboard.c (test_undefined): New function (bug#9751).
10932 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10933
10934 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10935
10936 * sysdep.c (init_sys_modes): Fix the check for the controlling
10937 terminal (Bug#6649).
10938
10939 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10940
10941 * dispextern.h (struct bidi_it): New member next_en_type.
10942
10943 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10944 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10945 current character, check also for next_en_type being WEAK_EN.
10946 (bidi_resolve_weak): Don't enter the expensive loop if the current
10947 position is before next_en_pos. Record the bidi type of the first
10948 non-ET, non-BN character we find, in addition to its position.
10949 (bidi_level_of_next_char): Invalidate next_en_type when
10950 next_en_pos is over-stepped.
10951
10952 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10953
10954 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10955 * editfns.c: Rewrite current-time-zone so that it invokes
10956 the equivalent of (format-time-string "%Z") to get the time zone name.
10957 This fixes a bug when the time zone name contains characters that
10958 need converting from the system time locale to Emacs internal format.
10959 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10960 that patch fixed format-time-string to do the conversion, but
10961 I forgot to fix current-time-zone.
10962 (format_time_string): New function, containing most of
10963 what Fformat_time_string used to contain.
10964 (Fformat_time_string): Rewrite in terms of format_time_string.
10965 This doesn't change this function's behavior.
10966 (current-time-zone): Rewrite to use format_time_string.
10967 This fixes the bug reported by Michael Schierl in
10968 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10969 Jason Rumney's 2007-06-07 change worked around this bug, but
10970 didn't fix it.
10971 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10972
10973 2011-10-19 Eli Zaretskii <eliz@gnu.org>
10974
10975 * xdisp.c (start_display): If the character at POS is displayed
10976 via a display vector, reset IT->current.dpvec_index to zero.
10977 (try_window_reusing_current_matrix): If a line ends in a display
10978 vector or the next line starts in a display vector, continue
10979 redrawing the window even though the character position of
10980 start_row was reached.
10981 (Bug#9771, part 2)
10982
10983 2011-10-18 Chong Yidong <cyd@gnu.org>
10984
10985 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10986 with nobreak-char-display too.
10987
10988 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10989
10990 Fix part 3 of bug#9771.
10991 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10992 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10993 non-neutral characters if the current character is a paragraph
10994 separator (a.k.a. Newline). This avoids running the same
10995 expensive loop twice, once when we consume the preceding newline
10996 and the other time when the line actually needs to be displayed.
10997 Avoid the loop when we see neutrals on the base embedding level
10998 following a character whose directionality is the same as the
10999 paragraph's. This avoids running the expensive loop when a line
11000 ends in a long sequence of neutrals, like control characters.
11001 Add assertion against STRONG_AL type. Slightly rearrange code
11002 that determines the type of a neutral given the first non-neutral
11003 that follows it.
11004 (bidi_level_of_next_char): Set next_en_pos to zero when
11005 invalidating its info.
11006
11007 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11008
11009 * xdisp.c (push_display_prop): Determine whether to record string
11010 or buffer position by IT->string, not by IT->method. Allow
11011 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11012 (move_it_vertically_backward): Don't look for character position
11013 immediately after the newline when in a continuation line.
11014 (Bug#9771, part 1)
11015
11016 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11017
11018 * window.c (coordinates_in_window): Rewrite and delabelize
11019 vertical border check. (Bug#5357) (Bug#9618)
11020
11021 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11022
11023 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11024 errors in XSetWindowBorder (bug#9310).
11025
11026 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11027
11028 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11029 avoid crash when xmalloc overrun checking is enabled.
11030
11031 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11032
11033 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11034 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11035 cursor motion with <left> and <right> arrow keys.
11036
11037 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11038 some callers set that themselves.
11039
11040 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11041
11042 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11043 display string and the previous row comes from the same string and
11044 is empty. (Bug#9739) (Bug#9738)
11045
11046 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11047
11048 * doc.c (get_doc_string): Encode file name (bug#9735).
11049
11050 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11051
11052 * bidi.c (bidi_level_of_next_char):
11053 * xdisp.c (get_visually_first_element): Remove old incorrect
11054 comments regarding the Unicode Line Separator character.
11055
11056 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11057
11058 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11059
11060 * alloc.c (Fgc_status): Do not access beyond zombies array
11061 boundary if nzombies > MAX_ZOMBIES.
11062 * alloc.c (dump_zombies): Add missing format specifier.
11063
11064 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11065
11066 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11067 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11068
11069 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11070 Some packages use them to denote characters with modifiers.
11071
11072 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11073
11074 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11075 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11076 matching a pp-number. Rename parameter var to var1.
11077
11078 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11079
11080 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11081
11082 2011-10-08 Glenn Morris <rgm@gnu.org>
11083
11084 * callint.c (Fcall_interactively): Give a more explicit error for the
11085 'c' case with a non-character input. (Bug#8479)
11086
11087 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11088
11089 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11090 lines.
11091 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11092 lines that are hscrolled on the left.
11093
11094 * dispnew.c (buffer_posn_from_coords): Account for a possible
11095 presence of header-line. (Bug#4426)
11096
11097 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11098
11099 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11100 Don't advertise functionality which we discourage or doesn't work.
11101
11102 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11103
11104 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11105 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11106 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11107 this makes Emacs dump core during garbage collection on rare
11108 occasions. sizeof is obviously inferior to offsetof here, so
11109 stick with offsetof.
11110 (GC_POINTER_ALIGNMENT): New macro.
11111 (mark_memory): Omit 3rd (offset) arg; caller changed.
11112 Don't assume EMACS_INT alignment is the same as pointer alignment.
11113
11114 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11115
11116 * keyboard.c (read_key_sequence_remapped): New var.
11117 (read_key_sequence): Compute remapping in the right buffer.
11118 (command_loop_1): Use read_key_sequence's remapping directly.
11119
11120 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11121
11122 * dired.c (file_name_completion): Don't expand file name.
11123 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11124 before checking file name handler.
11125
11126 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11127 they've been requested explicitly (bug#9591).
11128
11129 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11130
11131 * keymap.c (Fsingle_key_description): Use make_specified_string
11132 instead of build_string to build string from push_key_description.
11133 (Bug#5193)
11134
11135 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11136
11137 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11138 This fixes a Y2038 bug on 64-bit hosts.
11139 * buffer.c (reset_buffer):
11140 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11141 (Fclear_buffer_auto_save_failure):
11142 Use 0, not -1, to represent an unset failure time, since time_t
11143 might not be signed.
11144
11145 Remove dependency on glibc malloc internals.
11146 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11147 Move back here from lisp.h, but with their new implementations.
11148 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11149 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11150 * charset.c (charset_table_init): New static var.
11151 (syms_of_charset): Use it instead of xmalloc. This removes a
11152 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11153 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11154 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11155 Move back to alloc.c.
11156 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11157 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11158
11159 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11160
11161 * nsterm.m (windowDidResize): Call x_set_window_size only when
11162 ns_in_resize is true. Otherwise set pixelwidth/height and
11163 call change_frame_size (Bug#9628).
11164
11165 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11166
11167 Port --enable-checking=all to Fedora 14 x86-64.
11168 * charset.c (syms_of_charset): Also account for glibc malloc's
11169 internal overhead when calculating the initial malloc maximum.
11170
11171 Port --enable-checking=all to Fedora 14 x86.
11172 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11173 Move to lisp.h.
11174 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11175 (overrun_check_realloc, overrun_check_free):
11176 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11177 That way, xmalloc returns a properly-aligned pointer even if
11178 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11179 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11180 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11181 into account when calculating the initial malloc maximum.
11182 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11183 Move here from alloc.c, so that charset.c can use it too.
11184 Properly align; the old code wasn't right for common 32-bit hosts
11185 when configured with --enable-checking=all.
11186 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11187 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11188
11189 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11190
11191 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11192 use EDOM.
11193
11194 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11195
11196 * xdisp.c (compute_display_string_end): If there's no display
11197 string at CHARPOS, return -1.
11198
11199 * bidi.c (bidi_fetch_char): When compute_display_string_end
11200 returns a negative value, treat the character as a normal
11201 character not covered by a display string. (Bug#9624)
11202
11203 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11204
11205 * lread.c (Fread_from_string): Fix typo in docstring.
11206
11207 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11208
11209 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11210 newline, reseat the iterator instead of bidi-iterating there one
11211 character at a time. (Bug#9610)
11212 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11213 TO_CHARPOS if the bidi iterator is at base embedding level.
11214
11215 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11216
11217 * lread.c (readevalloop): Use correct code for NBSP.
11218 (read1): Likewise. (Bug#9608)
11219
11220 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11221
11222 * dbusbind.c (Fdbus_register_signal): When service is not
11223 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11224
11225 2011-09-25 Glenn Morris <rgm@gnu.org>
11226
11227 * buffer.c (truncate-lines): Doc fix.
11228
11229 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11230
11231 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11232 (Fset_window_next_buffers): Doc fix.
11233
11234 2011-09-24 Glenn Morris <rgm@gnu.org>
11235
11236 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11237
11238 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11239
11240 Fix minor problems found by static checking.
11241 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11242 * indent.c (Fvertical_motion): Fix == vs = typo.
11243
11244 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11245
11246 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11247 Default value is now t. Doc fix.
11248
11249 * indent.c (Fvertical_motion): Compute and apply the overshoot
11250 logic when moving up, not only when moving down. Fix the
11251 confusing name and values of the it_overshoot_expected variable;
11252 logic changes accordingly. (Bug#9254) (Bug#9549)
11253
11254 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11255 CHARPOS is covered by a display string which includes newlines.
11256 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11257 is covered by a display string with embedded newlines.
11258
11259 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11260
11261 * dbusbind.c (Fdbus_register_signal): Add match rule to
11262 Vdbus_registered_objects_table. (Bug#9581)
11263 (Fdbus_register_method, Vdbus_registered_objects_table):
11264 Fix docstring.
11265
11266 2011-09-24 Jim Meyering <meyering@redhat.com>
11267
11268 do not ignore write error for any output size
11269 The previous change was incomplete.
11270 While it makes emacs --batch detect the vast majority of stdout
11271 write failures, errors were still ignored whenever the output size is
11272 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11273 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11274 && echo FAIL: ignored write error
11275 FAIL: ignored write error
11276 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11277 && echo FAIL: ignored write error
11278 FAIL: ignored write error
11279 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11280
11281 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11282
11283 * emacs.c (Fkill_emacs): In noninteractive mode exit
11284 non-successfully if a write error occurred on stdout. (Bug#9574)
11285
11286 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11287
11288 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11289 the xassert test.
11290
11291 * dispextern.h (struct it): Update the comment documenting what
11292 can it->OBJECT be.
11293
11294 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11295
11296 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11297 a display string, extend search for cursor position to end of row.
11298 (find_row_edges): If the row ends in a newline from a display
11299 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11300 Handle the case of a display string with multiple newlines.
11301 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11302 non-empty line. Fixes confusing cursor motion with arrow keys at
11303 the beginning of a line that starts with whitespace.
11304
11305 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11306
11307 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11308 (bug#9493).
11309
11310 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11311
11312 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11313 boolean (Bug#9154).
11314
11315 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11316
11317 * xdisp.c (display_line): Record maximum and minimum buffer
11318 positions even if no glyphs were produced (e.g., by a zero-width
11319 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11320 buffer positions that will be removed from the glyph row because
11321 they don't fit.
11322 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11323 column is beyond frame width: don't subtract 1 "pixel" when
11324 computing width of the stretch.
11325 (reseat_at_next_visible_line_start): Undo the change made on
11326 2011-09-17 that saved paragraph information and restored it after
11327 the call to `reseat'. (Bug#9545)
11328
11329 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11330
11331 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11332 and turn window cursor on if cleared (Bug#9415).
11333
11334 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11335
11336 * search.c (boyer_moore): Take unibyte characters from pattern
11337 literally. (Bug#9458)
11338
11339 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11340
11341 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11342
11343 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11344
11345 Fix minor problem found by static checking.
11346 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11347 initialized, to pacify gcc -Wuninitialized.
11348
11349 * fileio.c: Report proper errno when syscall falls.
11350 (Finsert_file_contents): Save and restore errno,
11351 so that report_file_error outputs the correct diagnostic.
11352 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11353
11354 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11355
11356 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11357
11358 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11359
11360 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11361 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11362
11363 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11364
11365 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11366 about the current paragraph and restore it after the call to reseat.
11367
11368 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11369 (bidi_find_paragraph_start): Search back for paragraph beginning
11370 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11371 (bidi_move_to_visually_next): Only trigger paragraph-related
11372 computations when the last character is a newline or at EOB, not
11373 just any NEUTRAL_B. (Bug#9470)
11374
11375 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11376 truncated lines if point is covered by a display string. (Bug#9524)
11377
11378 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11379
11380 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11381 (cons_to_x_long): New function.
11382 (lisp_data_to_selection_data): Use it. Correct the test for
11383 short-versus-long data; it was negated. Break out of vector
11384 loop, for efficiency, when a long datum is discovered.
11385
11386 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11387
11388 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11389
11390 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11391
11392 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11393 GCC PR/17406) by declaring this function with external scope.
11394
11395 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11396
11397 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11398 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11399
11400 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11401
11402 * editfns.c (Fformat): Correctly handle text properties on "%%".
11403
11404 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11405
11406 * xterm.c (x_draw_composite_glyph_string_foreground):
11407 * w32term.c (x_draw_composite_glyph_string_foreground):
11408 * term.c (encode_terminal_code):
11409 * composite.c (composition_update_it, get_composition_id):
11410 * xdisp.c (get_next_display_element)
11411 (fill_composite_glyph_string): Add comments about special meaning
11412 of TAB characters in a composition.
11413
11414 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11415
11416 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11417 This occurs when processing a multibyte format.
11418 Problem reported by Wolfgang Jenker.
11419
11420 2011-09-15 Johan Bockgård <bojohan@gnu.org>
11421
11422 * xdisp.c (try_cursor_movement): Only check for exact match if
11423 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11424
11425 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11426
11427 Remove unused external symbols.
11428 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11429 * xdisp.c (calc_pixel_width_or_height): Now static.
11430 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11431 * indent.c (check_display_width):
11432 * w32term.c: Fix comment to match code.
11433 * xterm.c, xterm.h (x_catching_errors): Remove.
11434
11435 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11436
11437 * xselect.c: Use signed conversions more consistently (Bug#9498).
11438 (selection_data_to_lisp_data): Assume incoming selection data are
11439 signed integers, not unsigned. This is to be consistent with
11440 outgoing selection data, which was modified to use signed integers
11441 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11442 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11443 expects long, not unsigned long.
11444
11445 2011-09-14 Eli Zaretskii <eliz@gnu.org>
11446
11447 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11448 computation of loop end. Reported by Johan Bockgård
11449 <bojohan@gnu.org>.
11450
11451 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
11452
11453 * frame.c (Fother_visible_frames_p): Function deleted.
11454
11455 2011-09-12 Eli Zaretskii <eliz@gnu.org>
11456
11457 * indent.c (compute_motion): Process display vector front to back
11458 rather than the other way around. (Bug#2496)
11459
11460 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11461
11462 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11463
11464 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11465
11466 * minibuf.c (Fread_from_minibuffer): Doc fix.
11467
11468 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11469
11470 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11471 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11472
11473 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11474
11475 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11476 value for non-existent files.
11477
11478 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11479
11480 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11481 set its "size" to -1. This will set the modtime_size field of
11482 the corresponding buffer to -1, which is what
11483 verify-visited-file-modtime expects for files that do not exist.
11484 (Bug#9139)
11485
11486 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11487
11488 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11489 here ...
11490 * lisp.h: ... from here. push_key_description is no longer
11491 defined in keyboard.c, so its declaration should not be in
11492 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11493 logically belongs with push_key_description.
11494
11495 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11496
11497 * buffer.h: Include <sys/types.h> instead of <time.h>.
11498 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11499 Problem reported by Herbert J. Skuhra.
11500
11501 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11502
11503 * xml.c (parse_region): Make the parsing work for
11504 non-comment-starting XML files again (bug#9144).
11505
11506 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11507
11508 * image.c (gif_load): Fix calculation of bottom and right corner.
11509 (Bug#9468)
11510
11511 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11512
11513 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11514 redisplay in small windows.
11515
11516 2011-09-09 Eli Zaretskii <eliz@gnu.org>
11517
11518 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11519
11520 2011-09-08 Martin Rudalics <rudalics@gmx.at>
11521
11522 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11523 Operate on live windows only.
11524
11525 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
11526
11527 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11528
11529 2011-09-07 Eli Zaretskii <eliz@gnu.org>
11530
11531 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11532 only under bidi iteration.
11533
11534 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11535
11536 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11537
11538 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11539
11540 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11541 Without this fix, the command to link temacs failed due to an
11542 undefined symbol __builtin_isnan. This is because
11543 /usr/include/iso/math_c99.h #defines isnan(x) to
11544 __builtin_isnan(x), but the bundled gcc, which identifies itself
11545 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11546 a __builtin_isnan.
11547 * floatfns.c (isnan): #undef, and then #define to a clone of
11548 what's in data.c.
11549 (Fisnan): Always define, since it's always available now.
11550 (syms_of_floatfns): Always define isnan at the Lisp level.
11551
11552 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11553
11554 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11555
11556 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11557
11558 * fileio.c: Fix bugs with large file offsets (Bug#9428).
11559 The previous code assumed that file offsets (off_t values) fit in
11560 EMACS_INT variables, which is not true on typical 32-bit hosts.
11561 The code messed up by falsely reporting buffer overflow in cases
11562 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11563 when "big" contains more than 2**29 bytes, even though this
11564 inserts just one byte and does not overflow the buffer.
11565 (Finsert_file_contents): Store file offsets as off_t
11566 values, not as EMACS_INT values. Check for overflow when
11567 converting between EMACS_INT and off_t. When checking for
11568 buffer overflow or for overlap, take the offsets into account.
11569 Don't use EMACS_INT for small values where int suffices.
11570 When checking for overlap, fix a typo: ZV was used where
11571 ZV_BYTE was intended.
11572 (Fwrite_region): Don't assume off_t fits into 'long'.
11573 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11574
11575 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
11576
11577 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11578
11579 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11580
11581 sprintf-related integer and memory overflow issues (Bug#9412).
11582
11583 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11584 (esprintf, exprintf, evxprintf): New functions.
11585 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11586 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11587 (modify_event_symbol): Do not assume that the length of
11588 name_alist_or_stem is safe to alloca and fits in int.
11589 (Fexecute_extended_command): Likewise for function name and binding.
11590 (Frecursion_depth): Wrap around reliably on integer overflow.
11591 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11592 since some callers pass EMACS_INT values.
11593 (Fsingle_key_description): Don't crash if symbol name contains more
11594 than MAX_ALLOCA bytes.
11595 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11596 (get_minibuffer): Arg is now EMACS_INT, not int.
11597 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11598 (esprintf, exprintf, evxprintf): New decls.
11599 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11600
11601 * dbusbind.c (signature_cat): New function.
11602 (xd_signature, Fdbus_register_signal):
11603 Do not overrun buffer; instead, report string overflow.
11604
11605 * dispnew.c (add_window_display_history): Don't overrun buffer.
11606 Truncate instead; this is OK since it's just a log.
11607
11608 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11609 even if the time zone offset is outlandishly large.
11610 Don't mishandle offset == INT_MIN.
11611
11612 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11613 when creating daemon; the previous buffer-overflow check was incorrect.
11614
11615 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11616 which has the guts of the old verror function.
11617
11618 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11619 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11620
11621 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11622 (font_unparse_xlfd): Don't blindly alloca long strings.
11623 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11624 fits in int, when using sprintf. Use single snprintf to count
11625 length of string rather than counting it via multiple sprintfs;
11626 that's simpler and more reliable.
11627 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11628 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11629 sprintf, in case result does not fit in int.
11630
11631 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11632 (fontset_from_font): Print it.
11633
11634 * frame.c (tty_frame_count): Now printmax_t, not int.
11635 (make_terminal_frame, set_term_frame_name): Print it.
11636 (x_report_frame_params): In X, window IDs are unsigned long,
11637 not signed long, so print them as unsigned.
11638 (validate_x_resource_name): Check for implausibly long names,
11639 and don't assume name length fits in 'int'.
11640 (x_get_resource_string): Don't blindly alloca invocation name;
11641 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11642 not fit in int.
11643
11644 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11645 (xg_check_special_colors, xg_set_geometry):
11646 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11647
11648 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11649 Use esprintf, not sprintf, in case result does not fit in int.
11650
11651 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11652 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11653 it as a large positive number.
11654 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11655 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11656
11657 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11658 in case result does not fit in int.
11659
11660 * print.c (float_to_string): Detect width overflow more reliably.
11661 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11662 buffer overrun. Don't assume list length fits in 'int'. Treat
11663 print length of 0 as 0, not as infinity; to be consistent with other
11664 uses of print length in this function. Don't overflow print length
11665 index. Don't assume hash table size fits in 'long', or that
11666 vectorlike size fits in 'unsigned long'.
11667
11668 * process.c (make_process): Use printmax_t, not int, to format
11669 process-name gensyms.
11670
11671 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11672
11673 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11674 to avoid potential buffer overrun.
11675
11676 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11677 if X resource line is longer than 512 bytes.
11678
11679 * xfns.c (x_window): Make sprintf buffer a bit bigger
11680 to avoid potential buffer overrun.
11681
11682 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11683
11684 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11685
11686 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11687
11688 Integer overflow fixes for scrolling, etc.
11689 Without these, Emacs silently mishandles large integers sometimes.
11690 For example, "C-u 4294967297 M-x recenter" was treated as if
11691 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11692
11693 * xdisp.c (try_window_id): Check Emacs fixnum range before
11694 converting to 'int'.
11695
11696 * window.c (window_scroll_line_based, Frecenter):
11697 Check that an Emacs fixnum is in range before assigning it to 'int'.
11698 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11699 values converted from Emacs fixnums.
11700 (Frecenter): Don't wrap around a line count if it is out of 'int'
11701 range; instead, treat it as an extreme value.
11702 (Fset_window_configuration, compare_window_configurations):
11703 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11704
11705 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11706 that can exceed INT_MAX. Check that EMACS_INT value is in range
11707 before assigning it to the (possibly-narrower) index.
11708 (match_limit): Don't assume that a fixnum can fit in 'int'.
11709
11710 * print.c (print_object): Use ptrdiff_t, not int, for index that can
11711 exceed INT_MAX.
11712
11713 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11714 (Fvertical_motion): Don't wrap around LINES values that don't fit
11715 in 'int'. Instead, treat them as extreme values. This is good
11716 enough for windows, which can't have more than INT_MAX lines anyway.
11717
11718 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11719
11720 * Require libxml/parser.h to avoid compilation warning.
11721
11722 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11723
11724 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11725 since this reportedly can destroy thread storage.
11726
11727 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
11728
11729 * syntax.c (find_defun_start): Update all cache variables if
11730 exiting early (Bug#9401).
11731
11732 2011-08-30 Eli Zaretskii <eliz@gnu.org>
11733
11734 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11735
11736 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11737 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11738 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11739
11740 * term.c (tty_append_glyph): New function.
11741 (produce_stretch_glyph): Static function and its prototype deleted.
11742
11743 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11744 Add prototypes.
11745
11746 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11747
11748 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11749 when checking :margin (Bug#9390).
11750 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11751 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11752 so that the name doesn't mislead. All uses changed.
11753
11754 2011-08-28 Johan Bockgård <bojohan@gnu.org>
11755
11756 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11757 set_tty_hooks.
11758
11759 2011-08-27 Eli Zaretskii <eliz@gnu.org>
11760
11761 * xdisp.c (move_it_to): Don't bail out early when reaching
11762 position beyond to_charpos, if we are scanning backwards.
11763 (move_it_vertically_backward): When DY == 0, make sure we get to
11764 the first character in the line after the newline.
11765
11766 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11767
11768 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11769 (ccl_driver): Do not generate an out-of-range pointer.
11770 (Fccl_execute_on_string): Remove unnecessary check for
11771 integer overflow, noted by Stefan Monnier in
11772 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11773 Remove a FIXME that didn't need fixing.
11774 Simplify the newly-introduced buffer reallocation code.
11775
11776 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
11777
11778 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11779
11780 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
11781
11782 Integer and memory overflow issues (Bug#9196).
11783
11784 * doc.c (get_doc_string): Rework so that
11785 get_doc_string_buffer_size is the actual buffer size, rather than
11786 being 1 less than the actual buffer size; this makes xpalloc more
11787 convenient.
11788
11789 * image.c (x_allocate_bitmap_record, cache_image):
11790 * xselect.c (Fx_register_dnd_atom):
11791 Simplify previous changes by using xpalloc.
11792
11793 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11794 since either will do and ptrdiff_t is convenient with xpalloc.
11795
11796 * charset.c (charset_table_size)
11797 (struct charset_sort_data.priority): Now ptrdiff_t.
11798 (charset_compare): Don't overflow if priorities differ greatly.
11799 (Fsort_charsets): Don't assume list length fits in int.
11800 Check for size-calculation overflow when allocating sort data.
11801 (syms_of_charset): Allocate an initial charset table that is
11802 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11803
11804 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11805
11806 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11807 The actual value is always <= INT_MAX, and leaving it unsigned made
11808 overflow checking harder.
11809
11810 * dispextern.h (struct glyph_matrix.rows_allocated)
11811 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11812 with xpalloc. The values are still always <= INT_MAX.
11813
11814 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11815
11816 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11817 (SAFE_NALLOCA): New macro.
11818
11819 * region-cache.c (struct boundary.pos, find_cache_boundary)
11820 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11821 (set_cache_region, invalidate_region_cache)
11822 (revalidate_region_cache, know_region_cache, region_cache_forward)
11823 (region_cache_backward, pp_cache):
11824 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11825 so that ptrdiff_t * can be passed to xpalloc.
11826 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11827 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11828 (pp_cache): Don't assume cache_len fits in int.
11829 * region-cache.h: Adjust extern decls to match.
11830
11831 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11832 EMACS_INT, since either will do, for xpalloc.
11833
11834 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11835 (xnmalloc, xnrealloc, xpalloc): New functions.
11836
11837 * bidi.c (bidi_shelve_header_size): New constant.
11838 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11839 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11840
11841 * bidi.c (bidi_cache_shrink):
11842 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11843 (overlay_strings):
11844 Don't update size of array until after memory allocation succeeds,
11845 because xmalloc/xrealloc may not return.
11846 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11847 now that we have proper integer overflow checking.
11848 (record_overlay_string, overlay_strings): Catch overflows when
11849 calculating size of overlay_str_buf.
11850
11851 * callproc.c (Fcall_process): Check for size overflow when
11852 calculating size of args2.
11853 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11854 Normally we prefer signed values, but sticking with ptrdiff_t would
11855 require adding more-complicated checks.
11856
11857 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11858 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11859 Redo buffer-overflow calculations to avoid integer overflow.
11860 Add a FIXME comment where memory seems to be over-allocated.
11861
11862 * character.c (Fstring): Check for size-calculation overflow.
11863
11864 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11865 unnecessary integer overflow. Check for size overflow.
11866 (encode_coding_object): Don't update size until xmalloc succeeds.
11867
11868 * composite.c (get_composition_id): Check for overflow in glyph
11869 length calculations.
11870
11871 Integer and memory overflow fixes for display code.
11872 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11873 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11874 (scrolling_window): Check for overflow in size calculations.
11875 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11876 Don't assume glyph table len fits in int.
11877 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11878 (row_table_size): Now ptrdiff_t, not int.
11879 (scrolling_window): Avoid overflow in size calculations.
11880 Don't update size until allocation succeeds.
11881 * fns.c (concat): Check for overflow in size calculations.
11882 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11883 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11884 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11885
11886 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11887 (get_doc_string): Check for size calculation overflow.
11888 Don't update size until allocation succeeds.
11889 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11890 EMACS_INT, where ptrdiff_t will do.
11891 (Fsubstitute_command_keys): Check for string overflow.
11892
11893 * editfns.c (set_time_zone_rule): Don't assume environment length
11894 fits in int.
11895 (message_length): Now ptrdiff_t, not int.
11896 (Fmessage_box): Don't update size until allocation succeeds.
11897 Don't assume message length fits in int.
11898 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11899
11900 * emacs.c (main): Do not reallocate argv, since there is a null at
11901 the end that can be overwritten, and this way there's no need to
11902 worry about size-calculation overflow.
11903 (sort_args): Check for size-calculation overflow.
11904
11905 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11906 alloc succeeds.
11907 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11908
11909 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11910 (x_set_scroll_bar_width, x_figure_window_size):
11911 Check for integer overflow.
11912 (x_set_alpha): Do not assume XINT fits in int.
11913
11914 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11915 This is for the members text_lines, text_cols, total_lines, total_cols,
11916 where the system imposes an 'int' limit.
11917
11918 * fringe.c (Fdefine_fringe_bitmap):
11919 Don't update size until alloc works.
11920
11921 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11922 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11923
11924 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11925 Check for size-calculation overflow.
11926 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11927 do, as we prefer signed integers.
11928 (id_to_widget.max_size, id_to_widget.used)
11929 (xg_store_widget_in_map, xg_remove_widget_from_map)
11930 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11931 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11932 Use and return ptrdiff_t, not int.
11933 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11934 * gtkutil.h: Change prototypes to match the above.
11935
11936 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11937 are duplicate now that they've been promoted to lisp.h.
11938 (x_allocate_bitmap_record, x_alloc_image_color)
11939 (make_image_cache, cache_image, xpm_load):
11940 Don't update size until alloc is done.
11941 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11942 (x_detect_edges):
11943 Check for size calculation overflow.
11944 (ct_colors_allocated_max): New constant.
11945 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11946 overflow.
11947
11948 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11949 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11950 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11951 Use ptrdiff_t, not int, to count maps.
11952 (read_char_minibuf_menu_prompt): Check for overflow in size
11953 calculations. Don't update size until allocation succeeds.
11954 Redo calculations to avoid overflow.
11955 * keyboard.h: Change prototypes to match the above.
11956
11957 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11958 to count maps.
11959 (current_minor_maps): Check for size calculation overflow.
11960 * keymap.h: Change prototypes to match the above.
11961
11962 * lread.c (read1, init_obarray): Don't update size until alloc done.
11963
11964 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11965 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11966
11967 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11968 Now ptrdiff_t, not int.
11969 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11970 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11971
11972 * process.c (Fnetwork_interface_list): Check for overflow
11973 in size calculation.
11974
11975 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11976
11977 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11978 overflow. Don't bother calling xmalloc when xrealloc will do.
11979
11980 * search.c (Freplace_match): Check for size calculation overflow.
11981 (Fset_match_data): Don't assume list lengths fit in 'int'.
11982
11983 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11984 for command line length. Do not attempt to address one before the
11985 beginning of an array, as that's not portable.
11986
11987 * term.c (max_frame_lines): Remove; unused.
11988 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11989 not int.
11990 (encode_terminal_code, calculate_costs): Check for size
11991 calculation overflow.
11992 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11993 table lengths and related sizes. Don't update size until alloc
11994 done. Redo calculations to avoid overflow.
11995 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11996
11997 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11998 subtracting pointers.
11999 (gobble_line): Check for overflow more carefully. Don't update size
12000 until alloc done.
12001
12002 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12003 Don't update size until alloc done.
12004 Redo size calculations to avoid overflow.
12005 Check for size calculation overflow.
12006 (main) [DEBUG]: Fix typo in invoking tparam1.
12007
12008 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12009 Use ptrdiff_t, not int, for sizes.
12010 (store_mode_line_noprop_char): Don't update size until alloc done.
12011
12012 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12013 Use ptrdiff_t, not int, for sizes.
12014 (Finternal_make_lisp_face, cache_face):
12015 Check for size calculation overflow.
12016 (cache_face): Treat size calculation overflows as if they were
12017 memory exhaustion (the usual treatment), rather than aborting.
12018
12019 * xfns.c (x_encode_text, x_set_name_internal)
12020 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12021 sizes, since they can exceed INT_MAX in size. Check for size
12022 calculation overflow.
12023
12024 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12025 (xg_select): Check for size calculation overflow.
12026 Don't update size until alloc done.
12027
12028 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12029 as sprintf is limited to int lengths.
12030
12031 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12032 (X_LONG_MIN): New macros.
12033 Use them to make the following changes clearer.
12034 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12035 This change doesn't affect the value now, but it may help remind
12036 future maintainers not to raise the value too much later.
12037 (SELECTION_QUANTUM): Remove, replacing with ...
12038 (selection_quantum): ... new function, which avoids overflow.
12039 All uses changed.
12040 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12041 assumption that selection length fits in 'int'.
12042 (x_reply_selection_request, x_handle_selection_request)
12043 (x_get_window_property, receive_incremental_selection)
12044 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12045 (lisp_data_to_selection_data, clean_local_selection_data):
12046 Use ptrdiff_t, not int, to record length of selection.
12047 (x_reply_selection_request, x_get_window_property)
12048 (receive_incremental_selection, x_property_data_to_lisp):
12049 Redo calculations to avoid overflow.
12050 (x_reply_selection_request): When sending hint, ceiling it at
12051 X_LONG_MAX rather than relying on wraparound overflow to send
12052 something.
12053 (x_get_window_property, receive_incremental_selection)
12054 (lisp_data_to_selection_data, x_property_data_to_lisp):
12055 Check for size-calculation overflow.
12056 (x_get_window_property, receive_incremental_selection)
12057 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12058 Don't store size until memory allocation succeeds.
12059 (x_get_window_property): Plug memory leak on memory exhaustion.
12060 Don't double-block input; malloc is safe here. Don't assume 2**34
12061 - 4 fits in unsigned long. Add an xassert to check
12062 XGetWindowProperty overflow. Be more careful about overflow
12063 calculations, and distinguish size from memory overflow better.
12064 (receive_incremental_selection): When tracing, don't assume
12065 unsigned int is less than INT_MAX.
12066 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12067 harmful) conversions of unsigned short to int.
12068 (lisp_data_to_selection_data): Don't assume that integers
12069 in the range -65535 through -1 fit in an X unsigned short.
12070 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12071 result parameters unless successful. Rely on cons_to_unsigned
12072 to report problems with elements; the old code wasn't right anyway.
12073 (x_check_property_data): Check for int overflow; we cannot use
12074 a wider type due to X limits.
12075 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12076
12077 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12078
12079 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12080 (x_term_init): Check for size calculation overflow.
12081 (x_color_cells): Don't store size until memory allocation succeeds.
12082 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12083 Don't assume alloca size is less than MAX_ALLOCA.
12084 (x_term_init): Don't assume length fits in int (sprintf is limited
12085 to int size).
12086
12087 Use ptrdiff_t for composition IDs.
12088 * character.c (lisp_string_width):
12089 * composite.c (composition_table_size, n_compositions)
12090 (get_composition_id, composition_gstring_from_id):
12091 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12092 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12093 * window.c (Frecenter):
12094 Use ptrdiff_t, not int, for composition IDs.
12095 * composite.c (get_composition_id): Check for integer overflow.
12096 * composite.h: Adjust prototypes to match the above changes.
12097
12098 Use ptrdiff_t for hash table indexes.
12099 * category.c (hash_get_category_set):
12100 * ccl.c (ccl_driver):
12101 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12102 * coding.c (coding_system_charset_list, detect_coding_system):
12103 * coding.h (struct coding_system.id):
12104 * composite.c (get_composition_id, gstring_lookup_cache):
12105 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12106 * image.c (xpm_get_color_table_h):
12107 * lisp.h (hash_lookup, hash_put):
12108 * minibuf.c (Ftest_completion):
12109 Use ptrdiff_t for hash table indexes, not int (which is too
12110 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12111 32-bit --with-wide-int hosts).
12112
12113 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12114 Add a FIXME comment about memory leaks.
12115 (syms_of_charset): Don't assume xmalloc returns.
12116
12117 Don't assume that stated character widths fit in int.
12118 * character.c (Fchar_width, c_string_width, lisp_string_width):
12119 * character.h (CHAR_WIDTH):
12120 * indent.c (MULTIBYTE_BYTES_WIDTH):
12121 Use sanitize_char_width to avoid undefined and/or bad behavior
12122 with outlandish widths.
12123 * character.h (sanitize_tab_width): Rename from sanitize_width,
12124 now that we have two such functions. All uses changed.
12125 (sanitize_char_width): New inline function.
12126
12127 Don't assume that tab-width fits in int.
12128 * character.h (sanitize_width): New inline function.
12129 (SANE_TAB_WIDTH): New macro.
12130 (ASCII_CHAR_WIDTH): Use it.
12131 * indent.c (sane_tab_width): Remove. All uses replaced by
12132 SANE_TAB_WIDTH (current_buffer).
12133 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12134
12135 * fileio.c: Integer overflow issues with file modes.
12136 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12137
12138 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12139 Remove unreachable code.
12140 (read_hex, load_charset_map_from_file): Check for integer overflow.
12141
12142 * xterm.c: Don't go over XClientMessageEvent limit.
12143 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12144 (x_send_scroll_bar_event): Likewise. Check that the size does not
12145 exceed limits imposed by XClientMessageEvent, as well as the usual
12146 ptrdiff_t and size_t limits.
12147
12148 * keyboard.c: Overflow, signedness and related fixes.
12149 (make_lispy_movement): Use same integer type in forward decl
12150 that is used in the definition.
12151 (read_key_sequence, keyremap_step):
12152 Change bufsize argument back to int, undoing my 2011-03-30 change.
12153 We prefer signed types, and int is wide enough here.
12154 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12155 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12156 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12157 length, not size_t. Use ptrdiff_t for index, not int.
12158 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12159 possibility of integer overflow.
12160
12161 Overflow, signedness and related fixes for images.
12162
12163 * dispextern.h (struct it.stack[0].u.image.image_id)
12164 (struct_it.image_id, struct image.id, struct image_cache.size)
12165 (struct image_cache.used, struct image_cache.ref_count):
12166 * gtkutil.c (update_frame_tool_bar):
12167 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12168 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12169 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12170 * nsmenu.m (update_frame_tool_bar):
12171 * xdisp.c (calc_pixel_width_or_height):
12172 * xfns.c (image_cache_refcount):
12173 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12174 on typical 64-bit hosts.
12175
12176 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12177 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12178 Omit unnecessary casts to int.
12179 (parse_image_spec): Check that integers fall into 'int' range
12180 when the callers expect that.
12181 (image_ascent): Redo ascent calculation to avoid int overflow.
12182 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12183 (lookup_image): Remove unnecessary tests.
12184 (xbm_image_p): Locals are now of int, not EMACS_INT,
12185 since parse_image_check makes sure they fit into int.
12186 (png_load, gif_load, svg_load_image):
12187 Prefer int to unsigned where either will do.
12188 (tiff_handler): New function, combining the cores of the
12189 old tiff_error_handler and tiff_warning_handler.
12190 This function is rewritten to use vsnprintf and thereby avoid
12191 stack buffer overflows. It uses only the features of vsnprintf
12192 that are common to both POSIX and native Microsoft.
12193 (tiff_error_handler, tiff_warning_handler): Use it.
12194 (tiff_load, gif_load, imagemagick_load_image):
12195 Don't assume :index value fits in 'int'.
12196 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12197 (imagemagick_load_image): Check that crop parameters fit into
12198 the integer types that MagickCropImage accepts. Don't assume
12199 Vimagemagick_render_type has a nonnegative value. Don't assume
12200 size_t fits in 'long'.
12201 (gs_load): Use printmax_t to print the widest integers possible.
12202 Check for integer overflow when computing image height and width.
12203
12204 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12205
12206 * xdisp.c (redisplay_window): Don't force window start if point
12207 will be invisible in the resulting window. (Bug#9324)
12208
12209 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12210
12211 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12212 the display spec is of the form `(space ...)'.
12213 (handle_display_spec): Return the value returned by
12214 handle_single_display_spec, not just 1 or zero.
12215 (handle_single_display_spec): If the display spec is of the form
12216 `(space ...)', and specifies display in the text area, return 2
12217 rather than 1.
12218 (try_cursor_movement): Check for the need to scroll more
12219 accurately, and prefer exact match for point under bidi.
12220 Don't advance `row' beyond the last row of the window.
12221
12222 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12223 into disp_prop; all users changed.
12224
12225 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12226 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12227 for the text covered by the display property.
12228
12229 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12230
12231 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12232 Change return value to nil.
12233 (Frecord_buffer): Delete unused function.
12234
12235 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12236
12237 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12238 buffers, return left-to-right.
12239 (set_cursor_from_row): Consider candidate row a win if its glyph
12240 represents a newline and point is on that newline. Fixes cursor
12241 positioning on the newline at EOL of R2L text within L2R
12242 paragraph, and vice versa.
12243 (try_cursor_movement): Check continued rows, in addition to
12244 continuation rows. Fixes unwarranted scroll when point enters a
12245 continued line of R2L text within an L2R paragraph, or vice versa.
12246 (cursor_row_p): Consider the case of point being equal to
12247 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12248 from the end of a short line to the beginning of a continued line
12249 of R2L text within L2R paragraph.
12250 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12251 composed characters.
12252
12253 * bidi.c (bidi_check_type): Use xassert.
12254 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12255 members.
12256
12257 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12258
12259 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12260 a character.
12261
12262 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12263
12264 * nsfont.m (ns_otf_to_script): Fix typo.
12265
12266 2011-08-22 Kenichi Handa <handa@m17n.org>
12267
12268 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12269 extra slot even if the purpose is char-code-property-table.
12270
12271 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12272
12273 * xdisp.c (redisplay_window): When computing centering_position,
12274 account for the height of the header line. (Bug#8874)
12275
12276 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12277 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12278 candidate is selected by the mouse, and that candidate has a
12279 composed character under the mouse.
12280
12281 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12282 coordinates reported by pos-visible-in-window-p for a composed
12283 character in column zero.
12284
12285 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12286
12287 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12288
12289 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12290
12291 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12292 consider it a hit if to_charpos is anywhere in the range of the
12293 composed buffer positions.
12294
12295 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12296
12297 * image.c (gif_load): Don't assume that each subimage has the same
12298 dimensions as the base image. Handle disposal method that is
12299 "undefined" by the gif spec (Bug#9335).
12300
12301 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12302
12303 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12304 (Fcondition_case): Document `debug' symbol in error handler.
12305
12306 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12307
12308 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12309 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12310 from an Org mode buffer to a Speedbar frame.
12311
12312 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12313 a composition, take its buffer position from IT->cmp_it.charpos.
12314 Fixes cursor positioning at the beginning of a line that begins
12315 with a composed character.
12316
12317 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12318
12319 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12320 character bidirectional type, use STRONG_L instead. Fixes crashes
12321 in a buffer produced by `describe-categories'.
12322
12323 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12324 members before the level stack, so they would be saved and
12325 restored when copying iterator state. Fixes incorrect reordering
12326 around TABs covered by display properties.
12327
12328 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12329
12330 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12331
12332 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12333
12334 * eval.c (internal_condition_case, internal_condition_case_1)
12335 (internal_condition_case_2, internal_condition_case_n):
12336 Remove unnecessary aborts (Bug#9081).
12337
12338 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12339
12340 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12341 has no `load' handler, try opening the file locally. (Bug#9311)
12342
12343 2011-08-16 Ken Brown <kbrown@cornell.edu>
12344
12345 * gmalloc.c: Expand comment.
12346
12347 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12348
12349 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12350 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12351
12352 2011-08-16 Ken Brown <kbrown@cornell.edu>
12353
12354 Fix memory allocation problems in Cygwin build (Bug#9273).
12355
12356 * unexcw.c ( __malloc_initialized): Declare external variable.
12357 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12358
12359 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12360 New variables.
12361 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12362 dumped emacs.
12363 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12364 in the static heap.
12365 [CYGWIN] (special_realloc): New function.
12366 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12367 requests to realloc storage in the static heap.
12368
12369 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12370
12371 * bidi.c (bidi_initialize): Remove unused local.
12372
12373 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12374
12375 * bidimirror.h:
12376 * biditype.h: Remove file.
12377 * makefile.w32-in ($(BLD)/bidi.$(O)):
12378 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12379
12380 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12381
12382 * chartab.c: Improve commentary for the uniprop_table API.
12383
12384 * bidi.c (bidi_paragraph_init): Support zero value of
12385 bidi_ignore_explicit_marks_for_paragraph_level.
12386 (bidi_initialize): Use uniprop_table instead of including
12387 biditype.h and bidimirror.h.
12388
12389 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12390 coordinates of the iterator when restoring from ppos_it.
12391 (Bug#9296)
12392
12393 2011-08-14 Kenichi Handa <handa@m17n.org>
12394
12395 * process.c (create_process): Call setup_process_coding_systems
12396 after the pid of the process is set to -1 (Bug#8162).
12397
12398 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12399
12400 * xdisp.c (move_it_in_display_line_to): Don't invoke
12401 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12402 ppos_it. Fixes vertical cursor motion when line beginning is
12403 covered by an image. (Bug#9296)
12404
12405 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12406
12407 * nsterm.h (ns_run_ascript): Declare.
12408 (NSAPP_DATA2_RUNASSCRIPT): Define.
12409
12410 * nsfns.m (as_script, as_result, as_status): New static variables.
12411 (ns_run_ascript): New function.
12412 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12413 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12414 the event loop. Get status from as_status (Bug#7276).
12415
12416 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12417 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12418 the event loop (Bug#7276).
12419
12420 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12421
12422 * gnutls.c (QCgnutls_bootprop_priority)
12423 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12424 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12425 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12426 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12427 (QCgnutls_bootprop_verify_hostname_error)
12428 (QCgnutls_bootprop_callbacks_verify): Rename from
12429 Qgnutls_bootprop_..., all uses changed.
12430
12431 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12432 uses changed.
12433
12434 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12435
12436 * xfaces.c (Qframe_set_background_mode): Now static.
12437 * dispextern.h (Qframe_set_background_mode): Remove decl.
12438
12439 * process.c (Fnetwork_interface_info): Declare local only if needed.
12440
12441 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12442
12443 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12444 (Fnetwork_interface_list): Allocate in increments of bytes instead
12445 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12446 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12447 sockaddr.
12448 (struct ifflag_def): notrailers is smart on OSX.
12449 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12450 Get hardware address with getifaddrs if available.
12451
12452 2011-08-12 Eli Zaretskii <eliz@gnu.org>
12453
12454 * xdisp.c (iterate_out_of_display_property): xassert that
12455 IT->position is set to within IT->object's boundaries. Break from
12456 the loop as soon as EOB is reached; avoids infloops in redisplay
12457 when IT->position is set up wrongly due to some bug.
12458 Set IT->current to match the bidi iterator unconditionally.
12459 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12460 entry. Force push_it to save on the stack the current
12461 buffer/string position, to be restored by pop_it. Fix flags in
12462 the iterator structure wrt the object coming from a display
12463 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12464 properties. (Bug#9284)
12465
12466 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12467
12468 * fontset.c (fontset_get_font_group): Add proper type checks.
12469 (Bug#9172)
12470
12471 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12472
12473 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12474 and LC_VERSION_MIN_MACOSX.
12475 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12476 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12477
12478 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12479
12480 * xdisp.c (forward_to_next_line_start): Allow to use the
12481 no-display-properties-and-no-overlays under bidi display.
12482 Set disp_pos in the bidi iterator to avoid searches for display
12483 properties and overlays.
12484
12485 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12486
12487 * editfns.c (Fset_time_zone_rule): Document relationship with the
12488 setenv function.
12489
12490 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12491 the font entity extracted from the cache (Bug#8109).
12492
12493 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12494
12495 * composite.c (autocmp_chars): Don't reset point. That is done by
12496 restore_point_unwind (Bug#5984).
12497
12498 2011-08-07 Juri Linkov <juri@jurta.org>
12499
12500 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12501 to show the arg `TIME' instead of `TIMEVAL'.
12502
12503 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12504
12505 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12506 display property strides EOL and includes a newline, as in
12507 longlines-mode. (Bug#9254)
12508 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12509 word-wrap under bidirectional display. (Bug#9224)
12510
12511 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12512 is non-zero, even if the data buffer is NULL. Fixes a crash in
12513 vertical-motion with longlines-mode. (Bug#9254)
12514
12515 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12516
12517 * bidi.c <bidi_cache_total_alloc>: Now static.
12518 (bidi_initialize): Initialize bidi_cache_total_alloc.
12519
12520 * xdisp.c (display_line): Release buffer allocated for shelved bidi
12521 cache. (Bug#9221)
12522
12523 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12524 amount allocated this far in `bidi_cache_total_alloc'.
12525 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12526 non-zero, only free the data buffer without restoring the cache
12527 contents. All callers changed.
12528
12529 * dispextern.h (bidi_unshelve_cache): Update prototype.
12530
12531 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12532 (move_it_in_display_line, move_it_to)
12533 (move_it_vertically_backward, move_it_by_lines): Replace the call
12534 to xfree to an equivalent call to bidi_unshelve_cache.
12535 (move_it_in_display_line_to): Fix logic of returning
12536 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12537
12538 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12539
12540 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12541 came from a string character with a `cursor' property. (Bug#9229)
12542
12543 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12544
12545 * Makefile.in (LIB_PTHREAD): New variable.
12546 (LIBES): Add LIB_PTHREAD (Bug#9216).
12547
12548 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12549 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12550
12551 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12552
12553 * regex.c (re_iswctype): Remove some redundant boolean conversions.
12554
12555 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12556
12557 * xterm.c (x_find_topmost_parent): New function.
12558 (x_set_frame_alpha): Find topmost parent window with
12559 x_find_topmost_parent and set the property there also (bug#9181).
12560 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12561
12562 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12563
12564 * callproc.c (Fcall_process): Avoid vfork clobbering
12565 the local vars buffer, coding_systems, current_dir.
12566
12567 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12568
12569 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12570
12571 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12572
12573 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12574 so that it is not optimized away.
12575
12576 * xdisp.c (compute_display_string_pos): Remove unused local.
12577
12578 2011-08-02 Eli Zaretskii <eliz@gnu.org>
12579
12580 Fix slow cursor motion and scrolling in large buffers with
12581 selective display, like Org Mode buffers. (Bug#9218)
12582
12583 * dispextern.h (struct bidi_it): New member disp_prop_p.
12584
12585 * xdisp.c: Remove one-slot cache of display string positions.
12586 (compute_display_string_pos): Accept an additional argument
12587 DISP_PROP_P; callers changed. Scan at most 5K characters forward
12588 for a display string or property. If found, set DISP_PROP_P
12589 non-zero.
12590
12591 * bidi.c (bidi_fetch_char): Accept an additional argument
12592 DISP_PROP_P, and pass it to compute_display_string_pos.
12593 Only handle text covered by a display string if DISP_PROP_P is returned
12594 non-zero. All callers of bidi_fetch_char changed.
12595
12596 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12597
12598 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12599
12600 2010-12-03 Don March <don@ohspite.net>
12601
12602 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12603 last character M-[char] is translated to ESC [char] (bug#7541).
12604
12605 2011-08-02 Kenichi Handa <handa@m17n.org>
12606
12607 * lisp.h (uniprop_table): Extern it.
12608
12609 * chartab.c (uniprop_table): Make it non-static.
12610
12611 2011-08-01 Eli Zaretskii <eliz@gnu.org>
12612
12613 * xdisp.c (forward_to_next_line_start): Accept additional argument
12614 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12615 on the newline.
12616 (reseat_at_next_visible_line_start): Use the bidi iterator state
12617 returned by forward_to_next_line_start to restore the state of
12618 it->bidi_it after backing up to previous newline. (Bug#9212)
12619
12620 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12621
12622 * regex.c (re_comp): Protoize.
12623 (re_exec): Fix return type.
12624 (regexec): Fix type of `ret'. (Bug#9203)
12625
12626 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12627
12628 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12629 This is needed if max-image-size is a floating-point number.
12630
12631 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12632
12633 * print.c (print_object): Print empty symbol as ##.
12634
12635 * lread.c (read1): Read ## as empty symbol.
12636
12637 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12638
12639 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12640 setting frame foreground color (Bug#9175).
12641 (x_set_background_color): Likewise.
12642
12643 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12644 contents (Bug#9176).
12645 (EmacsTooltip -init): Remove bezels and add shadows to
12646 tooltip windows.
12647
12648 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12649 or scroll bar (Bug#8470).
12650
12651 * nsfont.m (nsfont_open): Remove assignment to voffset and
12652 unnecessary vars hshink, expand, hd, full_height, min_height.
12653 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12654
12655 * nsterm.h (nsfont_info): Remove voffset field.
12656
12657 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12658
12659 Implement strike-through and overline on NextStep (Bug#8863).
12660
12661 * nsfont.m (nsfont_open): Use underline position provided by font,
12662 instead of hard-coded value of 2.
12663 (nsfont_draw): Call ns_draw_text_decoration instead.
12664
12665 * nsterm.h: Add declaration for ns_draw_text_decoration.
12666
12667 * nsterm.m (ns_draw_text_decoration): New function for drawing
12668 underline, overline, and strike-through.
12669 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12670 ns_draw_text_decoration. Change treatment of cursor drawing to
12671 accommodate underlining, etc.
12672
12673 2011-07-28 Eli Zaretskii <eliz@gnu.org>
12674
12675 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12676 default.
12677
12678 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12679
12680 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12681 Without this fix, if a signal arrives just after memory fills up,
12682 'malloc' might be invoked reentrantly.
12683
12684 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12685 In other words, assume that every image size is allowed, on non-X
12686 hosts. This assumption is probably wrong, but it lets Emacs compile.
12687
12688 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12689
12690 * regex.c (re_iswctype): Convert return values to boolean.
12691
12692 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12693
12694 * xdisp.c (compute_display_string_pos): Don't use cached display
12695 string position if the buffer had its restriction changed.
12696 (Bug#9184)
12697
12698 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12699
12700 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12701
12702 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12703
12704 Integer signedness and overflow and related fixes. (Bug#9079)
12705
12706 * bidi.c: Integer size and overflow fixes.
12707 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12708 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12709 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12710 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12711 (bidi_find_other_level_edge):
12712 Use ptrdiff_t instead of EMACS_INT where either will do.
12713 This works better on 32-bit hosts configured --with-wide-int.
12714 (bidi_cache_ensure_space): Check for size-calculation overflow.
12715 Use % rather than repeated addition, for better worst-case speed.
12716 Don't set bidi_cache_size until after xrealloc returns, because it
12717 might not return.
12718 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12719 (bidi_cache_ensure_space): Also check that the bidi cache size
12720 does not exceed that of the largest Lisp string or buffer. See Eli
12721 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12722
12723 * alloc.c (__malloc_size_t): Remove.
12724 All uses replaced by size_t. See Andreas Schwab's note
12725 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12726
12727 * image.c: Improve checking for integer overflow.
12728 (check_image_size): Assume that f is nonnull, since
12729 it is always nonnull in practice. This is one less thing to
12730 worry about when checking for integer overflow later.
12731 (x_check_image_size): New function, which checks for integer
12732 overflow issues inside X.
12733 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12734 This removes the need for a memory_full check.
12735 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12736 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12737 (xbm_read_bitmap_data): Change locals back to 'int', since
12738 their values must fit in 'int'.
12739 (xpm_load_image, png_load, tiff_load):
12740 Invoke x_create_x_image_and_pixmap earlier,
12741 to avoid much needless work if the image is too large.
12742 (tiff_load): Treat overly large images as if
12743 x_create_x_image_and_pixmap failed, not as malloc failures.
12744 (gs_load): Use x_check_image_size.
12745
12746 * gtkutil.c: Omit integer casts.
12747 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12748 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12749
12750 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12751
12752 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12753 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12754 would wrongly return t on a 64-bit host.
12755
12756 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12757 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12758 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12759 and therefore cause GCC to emit a bogus diagnostic in some cases.
12760
12761 * image.c: Integer signedness and overflow and related fixes.
12762 This is not an exhaustive set of fixes, but it's time to
12763 record what I've got.
12764 (lookup_pixel_color, check_image_size): Remove redundant decls.
12765 (check_image_size): Don't assume that arbitrary EMACS_INT values
12766 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12767 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12768 (tiff_load, imagemagick_load_image):
12769 Check for overflow in size calculations.
12770 (x_create_x_image_and_pixmap): Remove unnecessary test for
12771 xmalloc returning NULL; that can't happen.
12772 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12773 (xpm_color_bucket): Use better integer hashing function.
12774 (xpm_cache_color): Don't possibly over-allocate memory.
12775 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12776 (gif_memory_source):
12777 Use ptrdiff_t, not int or size_t, to record sizes.
12778 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12779 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12780 either works, as we prefer signed integers.
12781 (tiff_read_from_memory, tiff_write_from_memory):
12782 Return tsize_t, not size_t, since that's what the TIFF API wants.
12783 (tiff_read_from_memory): Don't fail simply because the read would
12784 go past EOF; instead, return a short read.
12785 (tiff_load): Omit no-longer-needed casts.
12786 (Fimagemagick_types): Don't assume size fits into 'int'.
12787
12788 Improve hashing quality when configured --with-wide-int.
12789 * fns.c (hash_string): New function, taken from sxhash_string.
12790 Do not discard information about ASCII character case; this
12791 discarding is no longer needed.
12792 (sxhash-string): Use it. Change sig to match it. Caller changed.
12793 * lisp.h: Declare it.
12794 * lread.c (hash_string): Remove, since we now use fns.c's version.
12795 The fns.c version returns a wider integer if --with-wide-int is
12796 specified, so this should help the quality of the hashing a bit.
12797
12798 * emacs.c: Integer overflow minor fix.
12799 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12800 Define only if GNU_LINUX.
12801 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12802
12803 * dispnew.c: Integer signedness and overflow fixes.
12804 Remove unnecessary forward decls, that were a maintenance hassle.
12805 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12806 All uses changed.
12807 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12808 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12809 (prepare_desired_row, line_draw_cost):
12810 Use int, not unsigned, where either works.
12811 (save_current_matrix, restore_current_matrix):
12812 Use ptrdiff_t, not size_t, where either works.
12813 (init_display): Check for overflow more accurately, and without
12814 relying on undefined behavior.
12815
12816 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12817 Remove, replacing with the new symbols in lisp.h. All uses changed.
12818 * fileio.c (make_temp_name):
12819 * filelock.c (lock_file_1, lock_file):
12820 * xdisp.c (message_dolog):
12821 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12822 Use pMd etc. instead.
12823 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12824 replacing the pWIDE etc. symbols removed from editfns.c.
12825
12826 * keyboard.h (num_input_events): Now uintmax_t.
12827 This is (very slightly) less likely to mess up due to wraparound.
12828 All uses changed.
12829
12830 * buffer.c: Integer signedness fixes.
12831 (alloc_buffer_text, enlarge_buffer_text):
12832 Use ptrdiff_t rather than size_t when either will do, as we prefer
12833 signed integers.
12834
12835 * alloc.c: Integer signedness and overflow fixes.
12836 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12837 (__malloc_size_t): Default to size_t, not to int.
12838 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12839 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12840 Prefer ptrdiff_t to size_t when either would do, as we prefer
12841 signed integers.
12842 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12843 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12844 Now const. Initialize with values that are in range even if char
12845 is signed.
12846 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12847 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12848 These functions do the right thing with sizes > 2**32.
12849 (check_depth): Now ptrdiff_t, not int.
12850 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12851 Adjust to new way of storing sizes. Check for size overflow bugs
12852 in rest of code.
12853 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12854 slightly wrong anyway, as it missed one instance of
12855 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12856 (refill_memory_reserve): Omit needless cast to size_t.
12857 (mark_object_loop_halt): Mark as externally visible.
12858
12859 * xselect.c: Integer signedness and overflow fixes.
12860 (Fx_register_dnd_atom, x_handle_dnd_message):
12861 Use ptrdiff_t, not size_t, since we prefer signed.
12862 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12863 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12864 x_dnd_atoms_size and x_dnd_atoms_length.
12865
12866 * doprnt.c: Prefer signed to unsigned when either works.
12867 * eval.c (verror):
12868 * doprnt.c (doprnt):
12869 * lisp.h (doprnt):
12870 * xdisp.c (vmessage):
12871 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12872 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12873 prefer signed arithmetic to avoid comparison confusion.
12874 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12875 but is a bit tricky.
12876
12877 Assume freestanding C89 headers, string.h, stdlib.h.
12878 * data.c, doprnt.c, floatfns.c, print.c:
12879 Include float.h unconditionally.
12880 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12881 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12882 * regex.c: Likewise for stddef.h, string.h.
12883 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12884 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12885 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12886 (STDC_HEADERS): Remove obsolete defines.
12887 * sysdep.c: Include limits.h unconditionally.
12888
12889 Assume support for memcmp, memcpy, memmove, memset.
12890 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12891 * regex.c (memcmp, memcpy):
12892 Remove; we assume C89 now.
12893
12894 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12895 (__malloc_safe_bcopy): Remove; no longer needed.
12896
12897 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12898 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12899 well either way, and we prefer signed to unsigned.
12900
12901 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12902
12903 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12904 closes the connection while we're reading (bug#9182).
12905
12906 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12907
12908 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12909 are specified (Bug#9168).
12910
12911 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12912
12913 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12914 Found by GCC static checking and --with-wide-int on a 32-bit host.
12915
12916 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12917
12918 * xdisp.c (compute_display_string_pos): Fix logic of caching
12919 previous display string position. Initialize cached_prev_pos to
12920 -1. Fixes slow-down at the beginning of a buffer.
12921
12922 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12923
12924 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12925 for attrs[LFACE_FONTSET_INDEX].
12926
12927 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12928
12929 * xml.c (parse_region): Remove unused local
12930 that was recently introduced.
12931
12932 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12933
12934 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12935 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12936
12937 * xdisp.c (move_it_in_display_line_to): Record the best matching
12938 position for TO_CHARPOS while scanning the line, and restore it on
12939 exit if none of the characters scanned was an exact match.
12940 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12941 when exact match is impossible due to invisible text, and the
12942 lines are truncated.
12943
12944 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12945
12946 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12947 for OSX >= 10.7.
12948
12949 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12950
12951 Fix a significant slow-down of cursor motion with C-n, C-p,
12952 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12953 auto-repeat under bidi redisplay in fontified buffers.
12954 * xdisp.c (compute_stop_pos_backwards): New function.
12955 (next_element_from_buffer): Call compute_stop_pos_backwards to
12956 find a suitable prev_stop when we find ourselves before
12957 base_level_stop.
12958 (reseat): Don't look for prev_stop, as that could mean a very long
12959 run.
12960 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12961 <cached_disp_overlay_modiff>: Cache for last found display string
12962 position.
12963 (compute_display_string_pos): Return the cached position if asked
12964 about the same buffer in the same area of character positions, and
12965 the buffer wasn't changed since the time the display string
12966 position was cached.
12967
12968 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12969
12970 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12971 is an integer, which is important for empty lines. (Bug#9149)
12972
12973 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
12974
12975 * frame.c (Fmodify_frame_parameters): In tty case, update the
12976 default face if necessary (Bug#4238).
12977
12978 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
12979
12980 * editfns.c (Fstring_to_char): No need to explain what a character
12981 is in the docstring (Bug#6576).
12982
12983 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12984
12985 * xml.c (parse_region): Make sure we always return a tree.
12986
12987 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12988
12989 * xml.c (parse_region): If a document contains only comments,
12990 return that, too.
12991
12992 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12993
12994 * xml.c (make_dom): Return comments, too.
12995
12996 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12997
12998 Port to OpenBSD.
12999 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13000 and the surrounding thread.
13001 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13002 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13003 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13004 timer goes off.
13005 * s/openbsd.h (BROKEN_SIGIO): Define.
13006 * unexelf.c (unexec) [__OpenBSD__]:
13007 Don't update the .mdebug section of the Alpha COFF symbol table.
13008
13009 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13010
13011 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13012 (bug#8460).
13013
13014 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13015
13016 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13017 This fixes some race conditions on the permissions of any newly
13018 created file.
13019
13020 * alloc.c (valid_pointer_p): Use pipe, not open.
13021 This fixes some permissions issues when debugging.
13022
13023 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13024 If fchown fails to set both uid and gid, try to set just gid,
13025 as that is sometimes allowed. Adjust the file's mode to eliminate
13026 setuid or setgid bits that are inappropriate if fchown fails.
13027
13028 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13029
13030 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13031 to compare Lisp_Objects.
13032 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13033 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13034 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13035
13036 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13037
13038 * lread.c (read_integer): Unread even EOF character.
13039 (read1): Likewise. Properly record start position of symbol.
13040
13041 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13042 symbol character follows.
13043
13044 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13045
13046 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13047 This works around a problem with the previous change to Fcopy_file.
13048 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13049 and without this change, GCC might complain about discarding
13050 fchown's return value.
13051
13052 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13053
13054 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13055
13056 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13057
13058 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13059
13060 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13061
13062 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13063 it's used from the C level.
13064
13065 * process.c: Use the same condition for POLL_FOR_INPUT in both
13066 keyboard.c and process.c (bug#1858).
13067
13068 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13069
13070 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13071 (Fgnutls_boot): Use it.
13072
13073 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13074
13075 * doc.c (Fsubstitute_command_keys): Revert last change.
13076
13077 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13078
13079 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13080 quotes the next character, and doesn't affect other longer
13081 sequences (bug#8935).
13082
13083 * lread.c (syms_of_lread): Clarify that is isn't only
13084 `eval-buffer' and `eval-defun' that's affected by
13085 `lexical-binding' (bug#8460).
13086
13087 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13088
13089 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13090 bidi redisplay when a line includes both an image and is truncated.
13091
13092 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13093
13094 Fix minor problems found by static checking.
13095 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13096 (elsz): Now a signed constant, not a size_t var. We prefer signed
13097 types to unsigned, to avoid integer comparison confusion. Without
13098 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13099 "cannot optimize loop, the loop counter may overflow", a symptom
13100 of the confusion.
13101 * indent.c (Fvertical_motion): Mark locals as initialized.
13102 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13103
13104 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13105
13106 * search.c (Fre_search_backward): Mention `case-fold-search' in
13107 all the re_search_* functions (bug#8138).
13108
13109 * keyboard.c (Fopen_dribble_file): Document when the file is
13110 closed (bug#8056).
13111
13112 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13113
13114 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13115 bidi_cache_idx.
13116
13117 Support bidi reordering of display and overlay strings.
13118 * xdisp.c (compute_display_string_pos)
13119 (compute_display_string_end): Accept additional argument STRING.
13120 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13121 (reseat_to_string): Initialize bidi_it->string.s and
13122 bidi_it->string.schars.
13123 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13124 NULL (avoids a crash in bidi_paragraph_init).
13125 Initialize itb.string.lstring.
13126 (init_iterator): Call bidi_init_it only of a valid
13127 buffer position was specified. Initialize paragraph_embedding to
13128 L2R.
13129 (reseat_to_string): Initialize the bidi iterator.
13130 (display_string): If we need to ignore text properties of
13131 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13132 original value of -1 will not work with bidi.)
13133 (compute_display_string_pos): First arg is now struct
13134 `text_pos *'; all callers changed. Support display properties on
13135 Lisp strings.
13136 (compute_display_string_end): Support display properties on Lisp
13137 strings.
13138 (init_iterator, reseat_1, reseat_to_string): Initialize the
13139 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13140 when iterating on a string not from display properties).
13141 (compute_display_string_pos, compute_display_string_end):
13142 Fix calculation of the object to scan. Fixes an error when using
13143 arrow keys.
13144 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13145 base_level_stop; instead, set base_level_stop to BEGV.
13146 Fixes crashes in vertical-motion.
13147 (next_element_from_buffer): Improve commentary for when
13148 the iterator is before prev_stop.
13149 (init_iterator): Initialize bidi_p from the default value of
13150 bidi-display-reordering, not from buffer-local value. Use the
13151 buffer-local value only if initializing for buffer iteration.
13152 (handle_invisible_prop): Support invisible properties on strings
13153 that are being bidi-reordered.
13154 (set_iterator_to_next): Support bidi reordering of C strings and
13155 Lisp strings.
13156 (next_element_from_string): Support bidi reordering of Lisp
13157 strings.
13158 (handle_stop_backwards): Support Lisp strings as well.
13159 (display_string): Support display of R2L glyph rows.
13160 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13161 (init_iterator): Don't initialize it->bidi_p for strings
13162 here.
13163 (reseat_to_string): Initialize it->bidi_p for strings here.
13164 (next_element_from_string, next_element_from_c_string)
13165 (next_element_from_buffer): Add xassert's for correspondence
13166 between IT's object being iterated and it->bidi_it.string
13167 structure.
13168 (face_before_or_after_it_pos): Support bidi iteration.
13169 (next_element_from_c_string): Handle the case of the first string
13170 character that is not the first one in the visual order.
13171 (get_visually_first_element): New function, refactored from common
13172 parts of next_element_from_buffer, next_element_from_string, and
13173 next_element_from_c_string.
13174 (tool_bar_lines_needed, redisplay_tool_bar)
13175 (display_menu_bar): Force left-to-right direction. Add a FIXME
13176 comment for making that be controlled by a user option.
13177 (push_it, pop_it): Save and restore the state of the
13178 bidi iterator. Save and restore the bidi_p flag.
13179 (pop_it): Iterate out of display property for string iteration as
13180 well.
13181 (iterate_out_of_display_property): Support iteration over strings.
13182 (handle_single_display_spec): Set up it->bidi_it for iteration
13183 over a display string, and call bidi_init_it.
13184 (handle_single_display_spec, next_overlay_string)
13185 (get_overlay_strings_1, push_display_prop): Set up the bidi
13186 iterator for displaying display or overlay strings.
13187 (forward_to_next_line_start): Don't use the shortcut if
13188 bidi-iterating.
13189 (back_to_previous_visible_line_start): If handle_display_prop
13190 pushed the iterator stack, restore the internal state of the bidi
13191 iterator by calling bidi_pop_it same number of times.
13192 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13193 and we are bidi-iterating, don't decrement the iterator position;
13194 instead, set the first_elt flag in the bidi iterator, to produce
13195 the same effect.
13196 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13197 (push_display_prop): xassert that we are iterating a buffer.
13198 (push_it, pop_it): Save and restore paragraph_embedding member.
13199 (handle_single_display_spec, next_overlay_string)
13200 (get_overlay_strings_1, reseat_1, reseat_to_string)
13201 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13202 correctly. Don't assume unibyte strings are not bidi-reordered.
13203 (compute_display_string_pos)
13204 (compute_display_string_end): Fix handling the case of C string.
13205 (push_it, pop_it): Save and restore from_disp_prop_p.
13206 (handle_single_display_spec, push_display_prop): Set the
13207 from_disp_prop_p flag.
13208 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13209 (pop_it): Call iterate_out_of_display_property only if we are
13210 popping after iteration over a string that came from a display
13211 property. Fix a typo in popping stretch info. Add an assertion
13212 for verifying that the iterator position is in sync with the bidi
13213 iterator.
13214 (handle_single_display_spec, get_overlay_strings_1)
13215 (push_display_prop): Fix initialization of paragraph direction for
13216 string when that of the parent object is not yet determined.
13217 (reseat_1): Call bidi_init_it to resync the bidi
13218 iterator with IT's position. (Bug#7616)
13219 (find_row_edges): If ROW->start.pos gives position
13220 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13221 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13222 Reset the from_disp_prop_p flag.
13223 (SAVE_IT, RESTORE_IT): New macros.
13224 (pos_visible_p, face_before_or_after_it_pos)
13225 (back_to_previous_visible_line_start)
13226 (move_it_in_display_line_to, move_it_in_display_line)
13227 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13228 (try_scrolling, redisplay_window, display_line): Use them when
13229 saving a temporary copy of the iterator and restoring it back.
13230 (back_to_previous_visible_line_start, reseat_1)
13231 (init_iterator): Empty the bidi cache "stack".
13232 (move_it_in_display_line_to): If iterator ended up at
13233 EOL, but we never saw any buffer positions smaller than
13234 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13235 motion in bidi-reordered lines.
13236 (move_it_in_display_line_to): Record prev_method and prev_pos
13237 immediately before the call to set_iterator_to_next. Fixes cursor
13238 motion in bidi-reordered lines with stretch glyphs and strings
13239 displayed in margins. (Bug#8133) (Bug#8867)
13240 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13241 TO_CHARPOS.
13242 (pos_visible_p): Support positions in bidi-reordered lines.
13243 Save and restore bidi cache.
13244
13245 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13246 (bidi_paragraph_info): Delete unused struct.
13247 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13248 (bidi_cache_start): New variable.
13249 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13250 to zero.
13251 (bidi_cache_fetch_state, bidi_cache_search)
13252 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13253 (bidi_cache_find, bidi_peek_at_next_level)
13254 (bidi_level_of_next_char, bidi_find_other_level_edge)
13255 (bidi_move_to_visually_next): Compare cache index with
13256 bidi_cache_start rather than with zero.
13257 (bidi_fetch_char): Accept new argument STRING; all callers
13258 changed. Support iteration over a string. Support strings with
13259 display properties. Support unibyte strings. Fix the type of
13260 `len' according to what STRING_CHAR_AND_LENGTH expects.
13261 (bidi_paragraph_init, bidi_resolve_explicit_1)
13262 (bidi_resolve_explicit, bidi_resolve_weak)
13263 (bidi_level_of_next_char, bidi_move_to_visually_next):
13264 Support iteration over a string.
13265 (bidi_set_sor_type, bidi_resolve_explicit_1)
13266 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13267 can now be zero (for strings); special values 0 and -1 were
13268 changed to -1 and -2, respectively.
13269 (bidi_char_at_pos): New function.
13270 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13271 Call it instead of FETCH_MULTIBYTE_CHAR.
13272 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13273 initialized to valid values.
13274 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13275 values.
13276 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13277 the test for valid cached positions. Fix the logic for looking up
13278 the sentinel state in the cache. GCPRO the Lisp string we are
13279 iterating.
13280 (bidi_push_it, bidi_pop_it): New functions.
13281 (bidi_initialize): Initialize the bidi cache start stack pointer.
13282 (bidi_cache_ensure_space): New function, refactored from part of
13283 bidi_cache_iterator_state. Don't assume the required size is just
13284 one BIDI_CACHE_CHUNK away.
13285 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13286 (bidi_count_bytes, bidi_char_at_pos): New functions.
13287 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13288 always valid if bidi_cache_idx is valid.
13289 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13290 is valid if it's going to be used.
13291 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13292 (bidi_cache_fetch_state, bidi_cache_search)
13293 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13294 (bidi_cache_iterator_state, bidi_cache_find)
13295 (bidi_find_other_level_edge, bidi_cache_start_stack):
13296 All variables related to cache indices are now EMACS_INT.
13297
13298 * dispextern.h (struct bidi_string_data): New structure.
13299 (struct bidi_it): New member `string'. Make flag members be 1-bit
13300 fields, and put them last in the struct.
13301 (compute_display_string_pos, compute_display_string_end):
13302 Update prototypes.
13303 (bidi_push_it, bidi_pop_it): Add prototypes.
13304 (struct iterator_stack_entry): New members bidi_p,
13305 paragraph_embedding, and from_disp_prop_p.
13306 (struct it): Member bidi_p is now a bit field 1 bit wide.
13307 (bidi_shelve_cache, bidi_unshelve_cache):
13308 Declare prototypes.
13309
13310 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13311 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13312 and vector-like objects.
13313
13314 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13315 cache around display iteration.
13316
13317 * window.c (Fwindow_end, window_scroll_pixel_based)
13318 (displayed_window_lines, Frecenter): Save and restore the bidi
13319 cache around display iteration.
13320
13321 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13322
13323 * editfns.c (Fdelete_region): Clarify the use of the named
13324 parameters (bug#6788).
13325
13326 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13327
13328 * indent.c (Fvertical_motion): Set and restore w->pointm when
13329 saving and restoring the window's buffer (Bug#9006).
13330
13331 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13332
13333 * editfns.c (Fstring_to_char): Clarify just what is returned
13334 (bug#6576). Text by Eli Zaretskii.
13335
13336 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13337
13338 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13339
13340 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13341
13342 * buffer.c (mmap_find): Fix a typo.
13343
13344 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13345
13346 Fix execution of x selection hooks.
13347 * xselect.c (Qx_lost_selection_functions)
13348 (Qx_sent_selection_functions): New vars.
13349 (syms_of_xselect): DEFSYM them.
13350 (x_handle_selection_request): Pass Qx_sent_selection_functions
13351 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13352 (x_handle_selection_clear,x_clear_frame_selections):
13353 Pass Qx_lost_selection_functions rather than
13354 Vx_lost_selection_functions to Frun_hook_with_args.
13355
13356 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13357
13358 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13359 The old code sometimes used this field without initializing it.
13360
13361 * alloc.c (gc_sweep): Don't read past end of array.
13362 In theory, the old code could also have corrupted Emacs internals,
13363 though it'd be very unlikely.
13364
13365 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13366
13367 * character.c (Fcharacterp): Don't advertise optional ignored
13368 argument. (Bug#4026)
13369
13370 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13371
13372 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13373 key" (bug#4257).
13374
13375 * window.c (Fset_window_start): Doc fix (bug#4199).
13376 (Fset_window_hscroll): Ditto.
13377
13378 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13379
13380 Fix minor new problems caught by GCC 4.6.1.
13381 * term.c (init_tty): Remove unused local.
13382 * xsettings.c (store_monospaced_changed): Define this function only
13383 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13384 not used otherwise.
13385
13386 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13387
13388 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13389
13390 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13391
13392 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13393 are the mini-buffer and the echo area (bug#3320).
13394
13395 * term.c (init_tty): Remove support for supdup, c10 and perq
13396 terminals, which are no longer supported (bug#1482).
13397
13398 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13399
13400 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13401
13402 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13403
13404 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13405 for non-popups (Bug#3642).
13406
13407 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13408
13409 * alloc.c (reset_malloc_hooks): Protoize.
13410 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13411 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13412 * cm.c (losecursor): Likewise.
13413 * data.c (fmod): Likewise.
13414 * dispnew.c (swap_glyphs_in_rows): Likewise.
13415 * emacs.c (memory_warning_signal): Likewise.
13416 * floatfns.c (float_error): Likewise.
13417 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13418 (otf_open, font_otf_capability, generate_otf_features)
13419 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13420 Likewise.
13421 * image.c (pbm_read_file): Likewise.
13422 * indent.c (string_display_width): Likewise.
13423 * intervals.c (check_for_interval, search_for_interval)
13424 (inc_interval_count, count_intervals, root_interval)
13425 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13426 * lread.c (defalias): Likewise.
13427 * ralloc.c (r_alloc_check): Likewise.
13428 * regex.c (set_image_of_range_1, set_image_of_range)
13429 (regex_grow_registers): Likewise.
13430 * sysdep.c (strerror): Likewise.
13431 * termcap.c (valid_filename_p, tprint, main): Likewise.
13432 * tparam.c (main): Likewise.
13433 * unexhp9k800.c (run_time_remap, save_data_space)
13434 (update_file_ptrs, read_header, write_header, calculate_checksum)
13435 (copy_file, copy_rest, display_header): Likewise.
13436 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13437 Likewise.
13438 * xdisp.c (check_it): Likewise.
13439 * xfaces.c (register_color, unregister_color, unregister_colors):
13440 Likewise.
13441 * xfns.c (print_fontset_result): Likewise.
13442 * xrdb.c (member, fatal, main): Likewise.
13443
13444 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13445
13446 Fix minor problems found by static checking (Bug#9031).
13447 * chartab.c (char_table_set_range, map_sub_char_table):
13448 Remove unused locals.
13449 (uniprop_table): Now static.
13450 * composite.c (_work_char): Remove unused static var.
13451
13452 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
13453
13454 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13455
13456 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13457
13458 * gtkutil.c (qttip_cb): Remove code without function.
13459
13460 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13461
13462 * w32.c (pthread_sigmask): New stub.
13463
13464 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13465
13466 Use pthread_sigmask, not sigprocmask (Bug#9010).
13467 sigprocmask is portable only for single-threaded applications, and
13468 Emacs can be multi-threaded when it uses GTK.
13469 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13470 (LIBES): Use it.
13471 * callproc.c (Fcall_process):
13472 * process.c (create_process):
13473 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13474 Use pthread_sigmask, not sigprocmask.
13475
13476 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13477
13478 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13479 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13480 wrong (Bug#8591).
13481
13482 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13483
13484 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13485 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13486 (xg_hide_tooltip): Fix comment.
13487
13488 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13489 in registerServicesMenuSendTypes.
13490 (validRequestorForSendType): Don't check ns_return_types.
13491
13492 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13493 ns_return_type.
13494
13495 2011-07-08 Jason Rumney <jasonr@gnu.org>
13496
13497 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13498 SH_SHOW for hidden windows (Bug#5482).
13499
13500 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13501 frame struct members of non-existent frames (Bug#6284).
13502
13503 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13504
13505 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13506 variable firstTime not needed on OSX >= 10.6.
13507 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13508 >= 10.5. Use setKnobProportion, setDoubleValue.
13509
13510 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13511 (MAC_OS_X_VERSION_10_5): Define if not defined.
13512 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13513 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13514 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13515
13516 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13517 cString and lossyCString on OSX >= 10.4.
13518
13519 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13520 sizeToFit on OSX >= 10.2.
13521
13522 * nsimage.m (allocInitFromFile): Don't use deprecated method
13523 bestRepresentationForDevice on OSX >= 10.6.
13524
13525 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13526 to avoid warning.
13527
13528 * emacs.c: Declare unexec_init_emacs_zone.
13529
13530 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13531
13532 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13533
13534 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13535 on svcsMenu (Bug#8842).
13536
13537 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13538 ns_return_types.
13539 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13540
13541 * nsterm.m (QUTF8_STRING): Declare.
13542 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13543 (validRequestorForSendType): Return type is (id).
13544 Change indexOfObjectIdenticalTo to indexOfObject.
13545 Check if we have local selection before returning self (Bug#8842).
13546 (writeSelectionToPasteboard): Put local selection into paste board
13547 if we have a local selection (Bug#8842).
13548 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13549
13550 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13551 (ns_get_local_selection): Declare.
13552
13553 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13554
13555 * keymap.c (describe_map_tree): Don't insert a double newline at
13556 the end of the buffer (bug#1169) and return whether we inserted
13557 something.
13558
13559 * callint.c (Fcall_interactively): Change "reading args" to
13560 "providing args" to try to clarify what it does (bug#1010).
13561
13562 2011-07-07 Kenichi Handa <handa@m17n.org>
13563
13564 * composite.c (composition_compute_stop_pos): Ignore a static
13565 composition starting before CHARPOS (Bug#8915).
13566
13567 * xdisp.c (handle_composition_prop): Likewise.
13568
13569 2011-07-07 Eli Zaretskii <eliz@gnu.org>
13570
13571 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13572 (Bug#9015)
13573
13574 2011-07-07 Kenichi Handa <handa@m17n.org>
13575
13576 * character.h (unicode_category_t): New enum type.
13577
13578 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13579 (Qchar_code_property_table): New variable.
13580 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13581 (UNIPROP_COMPRESSED_FORM_P): New macros.
13582 (char_table_ascii): Uncompress the compressed values.
13583 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13584 Uncompress the compressed values.
13585 (sub_char_table_ref_and_range): Likewise.
13586 (char_table_ref_and_range): Uncompress the compressed values.
13587 (sub_char_table_set): New arg is_uniprop. Callers changed.
13588 Uncompress the compressed values.
13589 (sub_char_table_set_range): Args changed. Callers changed.
13590 (char_table_set_range): Adjuted for the above change.
13591 (map_sub_char_table): Delete args default_val and parent. Add arg
13592 top. Give decoded values to a Lisp function.
13593 (map_char_table): Adjust for the above change. Give decoded
13594 values to a Lisp function. Gcpro more variables.
13595 (uniprop_table_uncompress)
13596 (uniprop_decode_value_run_length): New functions.
13597 (uniprop_decoder, uniprop_decoder_count): New variables.
13598 (uniprop_get_decoder, uniprop_encode_value_character)
13599 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13600 New functions.
13601 (uniprop_encoder, uniprop_encoder_count): New variables.
13602 (uniprop_get_encoder, uniprop_table)
13603 (Funicode_property_table_internal, Fget_unicode_property_internal)
13604 (Fput_unicode_property_internal): New functions.
13605 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13606 Sunicode_property_table_internal, Sget_unicode_property_internal,
13607 and Sput_unicode_property_internal. Defvar_lisp
13608 char-code-property-alist.
13609
13610 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13611 Vunicode_category_table.
13612
13613 * font.c (font_range): Adjust for the change of
13614 Vunicode_category_table.
13615
13616 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13617
13618 * m/iris4d.h: Remove file, move contents ...
13619 * s/irix6-5.h: ... here.
13620
13621 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13622
13623 Remove unportable assumption about struct layout (Bug#8884).
13624 * alloc.c (mark_buffer):
13625 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13626 (clone_per_buffer_values): Don't assume that
13627 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13628 This isn't true in general, and it's particularly not true
13629 if Emacs is configured with --with-wide-int.
13630 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13631 New macros, used in the buffer.c change.
13632
13633 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13634
13635 * xsettings.c: Use both GConf and GSettings if both are available.
13636 (store_config_changed_event): Add comment.
13637 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13638 (store_tool_bar_style_changed): New functions.
13639 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
13640 (struct xsettings): Move font inside HAVE_XFT.
13641 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13642 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13643 Move inside HAVE_XFT.
13644 (something_changed_gsettingsCB): Rename from something_changedCB.
13645 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13646 also.
13647 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13648 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
13649 (something_changed_gconfCB): Rename from something_changedCB.
13650 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13651 (parse_settings): Move check for font inside HAVE_XFT.
13652 (read_settings, apply_xft_settings): Add comment.
13653 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13654 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13655 call store_font_name_changed.
13656 (xft_settings_event): Add comment.
13657 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13658 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13659 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13660 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13661 (xsettings_initialize): Call init_gsettings last.
13662 (xsettings_get_system_font, xsettings_get_system_normal_font):
13663 Add comment.
13664
13665 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13666
13667 Random fixes. E.g., (random) never returned negative values.
13668 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13669 subseconds part to the entropy, as that's a bit more random.
13670 Prefer signed to unsigned, since the signedness doesn't matter and
13671 in general we prefer signed. When given a limit, use a
13672 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13673 latter isn't right if USE_2_TAGS_FOR_INTS.
13674 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13675 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13676
13677 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13678
13679 * textprop.c (text_property_stickiness):
13680 Obey Vtext_property_default_nonsticky.
13681 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13682 * w32fns.c (syms_of_w32fns):
13683 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13684
13685 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13686
13687 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13688 This is more efficient than Ffile_directory_p and avoids a minor race.
13689
13690 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13691
13692 * buffer.c (Foverlay_put): Say what the return value is
13693 (bug#7835).
13694
13695 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13696 is a directory before asking whether to use the file name
13697 (bug#7564).
13698 (barf_or_query_if_file_exists): Make the "File is a directory"
13699 error be more correct.
13700
13701 * fns.c (Frequire): Remove the mention of the .gz files, since
13702 that's installation-specific, but keep the mention of
13703 `get-load-suffixes'.
13704
13705 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13706
13707 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13708 Report string overflow if the output is too long.
13709
13710 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
13711
13712 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13713 (syms_of_gnutls): Remove duplicate DEFSYM for
13714 Qgnutls_bootprop_verify_hostname_error, an error for
13715 Qgnutls_bootprop_verify_error (which is no longer used).
13716
13717 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13718 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13719 Also (re)move comments that are misplaced or no longer relevant.
13720
13721 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13722
13723 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13724
13725 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
13726
13727 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13728 and background color parameters if they have been changed.
13729
13730 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13731
13732 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13733
13734 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13735
13736 * xsettings.c (SYSTEM_FONT): Define only when used.
13737 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13738
13739 * keymap.c (access_keymap_1): Now static.
13740
13741 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
13742
13743 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13744 leave any prefix arg for the up event (Bug#1586).
13745
13746 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13747
13748 * lread.c (syms_of_lread): Mention single symbols defined by
13749 `defvar' or `defconst' (bug#7154).
13750
13751 * fns.c (Frequire): Mention .el.gz files (bug#7314).
13752 (Frequire): Mention get-load-suffixes.
13753
13754 2011-07-02 Martin Rudalics <rudalics@gmx.at>
13755
13756 * window.h (window): Remove clone_number slot.
13757 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13758 Remove.
13759 (make_parent_window, make_window, saved_window)
13760 (Fset_window_configuration, save_window_save): Don't deal with
13761 clone numbers.
13762 * buffer.c (Qclone_number): Remove declaration.
13763 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13764
13765 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13766
13767 Add multiple inheritance to keymaps.
13768 * keymap.c (Fmake_composed_keymap): New function.
13769 (Fset_keymap_parent): Simplify.
13770 (fix_submap_inheritance): Remove.
13771 (access_keymap_1): New function extracted from access_keymap to handle
13772 embedded parents and handle lists of maps.
13773 (access_keymap): Use it.
13774 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13775 (Fcopy_keymap): Handle embedded parents.
13776 (Fcommand_remapping, define_as_prefix): Simplify.
13777 (Fkey_binding): Simplify.
13778 (syms_of_keymap): Move minibuffer-local-completion-map,
13779 minibuffer-local-filename-completion-map,
13780 minibuffer-local-must-match-map, and
13781 minibuffer-local-filename-must-match-map to Elisp.
13782 (syms_of_keymap): Defsubr make-composed-keymap.
13783 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13784 (parse_menu_item): Trivial simplification.
13785
13786 2011-07-01 Glenn Morris <rgm@gnu.org>
13787
13788 * Makefile.in (SETTINGS_LIBS): Fix typo.
13789
13790 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13791
13792 * coding.c (Fencode_coding_string): Record the last coding system
13793 used, as the function doc string says (bug#8738).
13794
13795 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13796
13797 * xsettings.c (store_monospaced_changed): Take new font as arg and
13798 check for change against current_mono_font.
13799 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13800 (emacs_settings_constructor, emacs_settings_get_property)
13801 (emacs_settings_set_property, emacs_settings_class_init)
13802 (emacs_settings_init, gsettings_obj): Remove.
13803 (something_changedCB): New function for HAVE_GSETTINGS.
13804 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13805 with value as argument.
13806 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13807 g_settings_new (Bug#8967). Do not create gsettings_obj.
13808 Remove calls to g_settings_bind. Connect something_changedCB to
13809 "changed".
13810
13811 * xgselect.c: Add defined (HAVE_GSETTINGS).
13812 (xgselect_initialize): Ditto.
13813
13814 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13815 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13816 xg_select.
13817
13818 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13819
13820 * eval.c (struct backtrace): Simplify and port the data structure.
13821 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13822 signed bit field, as this assumption is not portable and it makes
13823 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13824 "char debug_on_exit : 1" as this is not portable either; instead,
13825 use the portable "unsigned int debug_on_exit : 1". Remove unused
13826 member evalargs. Remove obsolete comments about cc bombing out.
13827
13828 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13829
13830 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
13831 Let HAVE_GSETTINGS override HAVE_GCONF.
13832 (store_monospaced_changed): New function.
13833 (EMACS_SETTINGS): A new type derived from GObject to handle
13834 GSettings notifications.
13835 (emacs_settings_constructor, emacs_settings_get_property)
13836 (emacs_settings_set_property, emacs_settings_class_init):
13837 New functions.
13838 (gsettings_client, gsettings_obj): New variables.
13839 (GSETTINGS_SCHEMA): New define.
13840 (something_changedCB): Call store_monospaced_changed.
13841 (init_gsettings): New function.
13842 (xsettings_initialize): Call init_gsettings.
13843 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13844 to NULL.
13845
13846 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13847 GCONF_CFLAGS/LIBS.
13848
13849 2011-06-29 Martin Rudalics <rudalics@gmx.at>
13850
13851 * window.c (resize_root_window, grow_mini_window)
13852 (shrink_mini_window): Rename Qresize_root_window to
13853 Qwindow_resize_root_window and Qresize_root_window_vertically to
13854 Qwindow_resize_root_window_vertically.
13855
13856 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13857
13858 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13859
13860 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
13861
13862 * makefile.w32-in: Redesign dependencies so they reflect more
13863 clearly which files are directly included by each source file,
13864 and not through other includes.
13865
13866 2011-06-27 Martin Rudalics <rudalics@gmx.at>
13867
13868 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13869 (sort_overlays, overlay_strings): When an overlay's clone number
13870 matches the window's clone number process the overlay even if
13871 the overlay's window property doesn't match the current window.
13872
13873 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13874 (Fwindow_hchild): Rename to Fwindow_left_child.
13875 (Fwindow_next): Rename to Fwindow_next_sibling.
13876 (Fwindow_prev): Rename to Fwindow_prev_sibling.
13877 (resize_window_check): Rename to window_resize_check.
13878 (resize_window_apply): Rename to window_resize_apply.
13879 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13880 (Fdelete_other_windows_internal, resize_frame_windows)
13881 (Fsplit_window_internal, Fdelete_window_internal)
13882 (grow_mini_window, shrink_mini_window)
13883 (Fresize_mini_window_internal): Fix callers accordingly.
13884
13885 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13886
13887 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13888 (emacs_fixed_set_min_size): Remove.
13889 (emacs_fixed_new): Take frame as argument.
13890
13891 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13892 (_EmacsFixedPrivate): Remove minwidth/height.
13893 Add struct frame *f.
13894 (emacs_fixed_init): Initialize priv->f.
13895 (get_parent_class, emacs_fixed_set_min_size): Remove.
13896 (emacs_fixed_new): Set priv->f to argument.
13897 (emacs_fixed_get_preferred_width)
13898 (emacs_fixed_get_preferred_height): Use min_width/height from
13899 frames size_hint to set minimum and natural (Bug#8919).
13900 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13901 and use min_width/height from frames size_hint to set
13902 min_width/height (Bug#8919).
13903
13904 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13905 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13906 Fix indentation.
13907
13908 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13909
13910 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13911 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13912 called at ZV.
13913
13914 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13915
13916 * process.c (wait_reading_process_output): Bypass select if
13917 waiting for a cell while ignoring keyboard input, and input is
13918 pending. Suggested by Jan Djärv (Bug#8869).
13919
13920 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13921
13922 Use gnulib's dup2 module instead of rolling our own.
13923 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13924
13925 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13926
13927 * dispnew.c (scrolling_window): Before scrolling, turn off a
13928 mouse-highlight in the window being scrolled.
13929
13930 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13931
13932 Move DEFSYM to lisp.h and use everywhere.
13933
13934 * character.h (DEFSYM): Move declaration...
13935 * lisp.h (DEFSYM): ...here.
13936
13937 * gnutls.c:
13938 * minibuf.c:
13939 * w32menu.c:
13940 * w32proc.c:
13941 * w32select.c: Don't include character.h.
13942
13943 * alloc.c (syms_of_alloc):
13944 * buffer.c (syms_of_buffer):
13945 * bytecode.c (syms_of_bytecode):
13946 * callint.c (syms_of_callint):
13947 * casefiddle.c (syms_of_casefiddle):
13948 * casetab.c (init_casetab_once):
13949 * category.c (init_category_once, syms_of_category):
13950 * ccl.c (syms_of_ccl):
13951 * cmds.c (syms_of_cmds):
13952 * composite.c (syms_of_composite):
13953 * dbusbind.c (syms_of_dbusbind):
13954 * dired.c (syms_of_dired):
13955 * dispnew.c (syms_of_display):
13956 * doc.c (syms_of_doc):
13957 * editfns.c (syms_of_editfns):
13958 * emacs.c (syms_of_emacs):
13959 * eval.c (syms_of_eval):
13960 * fileio.c (syms_of_fileio):
13961 * fns.c (syms_of_fns):
13962 * frame.c (syms_of_frame):
13963 * fringe.c (syms_of_fringe):
13964 * insdel.c (syms_of_insdel):
13965 * keymap.c (syms_of_keymap):
13966 * lread.c (init_obarray, syms_of_lread):
13967 * macros.c (syms_of_macros):
13968 * msdos.c (syms_of_msdos):
13969 * print.c (syms_of_print):
13970 * process.c (syms_of_process):
13971 * search.c (syms_of_search):
13972 * sound.c (syms_of_sound):
13973 * syntax.c (init_syntax_once, syms_of_syntax):
13974 * terminal.c (syms_of_terminal):
13975 * textprop.c (syms_of_textprop):
13976 * undo.c (syms_of_undo):
13977 * w32.c (globals_of_w32):
13978 * window.c (syms_of_window):
13979 * xdisp.c (syms_of_xdisp):
13980 * xfaces.c (syms_of_xfaces):
13981 * xfns.c (syms_of_xfns):
13982 * xmenu.c (syms_of_xmenu):
13983 * xsettings.c (syms_of_xsettings):
13984 * xterm.c (syms_of_xterm): Use DEFSYM.
13985
13986 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13987
13988 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13989
13990 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13991
13992 Integer and buffer overflow fixes (Bug#8873).
13993
13994 * print.c (printchar, strout): Check for string overflow.
13995 (PRINTPREPARE, printchar, strout):
13996 Don't set size unless allocation succeeds.
13997
13998 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13999 for sizes. Check for string overflow more accurately.
14000 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14001
14002 * macros.c: Integer and buffer overflow fixes.
14003 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14004 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14005 Use ptrdiff_t, not int, for sizes.
14006 Don't increment bufsize until after realloc succeeds.
14007 Check for size-calculation overflow.
14008 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14009
14010 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14011
14012 * lread.c: Integer overflow fixes.
14013 (read_integer): Radix is now EMACS_INT, not int,
14014 to improve quality of diagnostics for out-of-range radices.
14015 Calculate buffer size correctly for out-of-range radices.
14016 (read1): Check for integer overflow in radices, and in
14017 read-circle numbers.
14018 (read_escape): Avoid int overflow.
14019 (Fload, openp, read_buffer_size, read1)
14020 (substitute_object_recurse, read_vector, read_list, map_obarray):
14021 Use ptrdiff_t, not int, for sizes.
14022 (read1): Use EMACS_INT, not int, for sizes.
14023 Check for size overflow.
14024
14025 * image.c (cache_image): Check for size arithmetic overflow.
14026
14027 * lread.c: Integer overflow issues.
14028 (saved_doc_string_size, saved_doc_string_length)
14029 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14030 Now ptrdiff_t, not int.
14031 (read1): Don't assume doc string length fits in int. Check for
14032 out-of-range doc string lengths.
14033 (read_list): Don't assume file position fits in int.
14034 (read_escape): Check for hex character overflow.
14035
14036 2011-06-22 Leo Liu <sdl.web@gmail.com>
14037
14038 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14039 Move to minibuffer.el.
14040
14041 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14042
14043 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14044 The following patches are for when GLYPH_DEBUG && !XASSERT.
14045 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14046 * dispnew.c (flush_stdout):
14047 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14048 Mark as externally visible.
14049 * dispnew.c (check_window_matrix_pointers): Now static.
14050 * dispnew.c (window_to_frame_vpos):
14051 * xfns.c (unwind_create_frame):
14052 * xterm.c (x_check_font): Remove unused local.
14053 * scroll.c (CHECK_BOUNDS):
14054 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14055 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14056 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14057 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14058 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14059 Now static.
14060 (debug_method_add): Use va_list and vsprintf rather than relying
14061 on undefined behavior with wrong number of arguments.
14062 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14063 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14064 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14065 since we're not interested in debugging glyphs with old libraries.
14066 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14067 GCC 4.6.0's static checking.
14068
14069 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14070
14071 Integer overflow and signedness fixes (Bug#8873).
14072 A few related buffer overrun fixes, too.
14073
14074 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14075
14076 * dispextern.h (struct face.stipple):
14077 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14078 (x_bitmap_mask, x_allocate_bitmap_record)
14079 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14080 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14081 (x_create_bitmap_from_xpm_data):
14082 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14083 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14084 (.bitmaps_last):
14085 * xfaces.c (load_pixmap):
14086 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14087 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14088 (.bitmaps_last, struct x_output.icon_bitmap):
14089 Use ptrdiff_t, not int, for bitmap indexes.
14090 (x_allocate_bitmap_record): Check for size overflow.
14091 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14092
14093 Use ptrdiff_t, not int, for overlay counts.
14094 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14095 * editfns.c (overlays_around, get_pos_property):
14096 * textprop.c (get_char_property_and_overlay):
14097 * xdisp.c (next_overlay_change, note_mouse_highlight):
14098 * xfaces.c (face_at_buffer_position):
14099 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14100 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14101 (Fnext_overlay_change, Fprevious_overlay_change)
14102 (mouse_face_overlay_overlaps, Foverlays_in):
14103 Use ptrdiff_t, not int, for sizes.
14104 (overlays_at, overlays_in): Check for size-calculation overflow.
14105
14106 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14107
14108 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14109 (x_session_initialize): Do not assume string length fits in int.
14110
14111 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14112 This is unlikely, but can occur if DPI is outlandish.
14113
14114 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14115 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14116
14117 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14118 * xrdb.c (magic_file_p, search_magic_path):
14119 Omit last arg SUFFIX; it was always 0. All callers changed.
14120 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14121
14122 * xfont.c (xfont_match): Avoid need for strlen.
14123
14124 * xfns.c: Don't assume strlen fits in int.
14125 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14126
14127 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14128 not unsigned long, as we prefer signed integers. All callers changed.
14129 Detect integer overflow in repeat count.
14130 (message_dolog): Don't assume print length fits in 39 bytes.
14131 (display_mode_element): Don't assume strlen fits in int.
14132
14133 * termcap.c: Don't assume sizes fit in int and never overflow.
14134 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14135 (gobble_line): Check for size-calculation overflow.
14136
14137 * minibuf.c (Fread_buffer):
14138 * lread.c (intern, intern_c_string):
14139 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14140 Don't assume string length fits in int.
14141
14142 * keyboard.c (parse_tool_bar_item):
14143 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14144
14145 * font.c: Don't assume string length fits in int.
14146 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14147 Use ptrdiff_t, not int.
14148 (font_intern_prop): Don't assume string length fits in int.
14149 Don't assume integer property fits in fixnum.
14150 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14151
14152 * filelock.c: Fix some buffer overrun and integer overflow issues.
14153 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14154 Reformulate so as not to need the command string.
14155 Invoke gzip -cd rather than gunzip, as it's more portable.
14156 (lock_info_type, lock_file_1, lock_file):
14157 Don't assume pid_t and time_t fit in unsigned long.
14158 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14159 (current_lock_owner): Prefer signed type for sizes.
14160 Use memcpy, not strncpy, where memcpy is what is really wanted.
14161 Don't assume (via atoi) that time_t and pid_t fit in int.
14162 Check for time_t and/or pid_t out of range, e.g., via a network share.
14163 Don't alloca where an auto var works fine.
14164
14165 * fileio.c: Fix some integer overflow issues.
14166 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14167 Don't assume string length fits in int.
14168 (directory_file_name): Don't assume string length fits in long.
14169 (make_temp_name): Don't assume pid fits in int, or that its print
14170 length is less than 20.
14171
14172 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14173
14174 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14175
14176 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14177
14178 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14179 We prefer signed integers, even for size calculations.
14180
14181 * emacs.c: Don't assume string length fits in 'int'.
14182 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14183 (main): Don't invoke strlen when not needed.
14184
14185 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14186 (XD_DEBUG_MESSAGE): Don't waste a byte.
14187
14188 * callproc.c (getenv_internal_1, getenv_internal)
14189 (Fgetenv_internal):
14190 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14191
14192 * lread.c (invalid_syntax): Omit length argument.
14193 All uses changed. This doesn't fix a bug, but it simplifies the
14194 code away from its former Hollerith-constant appearance, and it's
14195 one less 'int' to worry about when looking at integer-overflow issues.
14196 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14197
14198 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14199 This didn't break anything, but it didn't help either.
14200 It's confusing to put a bogus integer in a place where the actual
14201 value does not matter.
14202 (LIST_END_P): Remove unused macro and its bogus comment.
14203 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14204
14205 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14206 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14207 implementation.
14208 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14209 We prefer signed types, and the value cannot exceed the EMACS_INT
14210 range anyway (because otherwise the length would not be representable).
14211 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14212 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14213 This avoids a GCC warning when WIDE_EMACS_INT.
14214
14215 * indent.c (sane_tab_width): New function.
14216 (current_column, scan_for_column, Findent_to, position_indentation)
14217 (compute_motion): Use it. This is just for clarity.
14218 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14219
14220 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14221
14222 * lisp.h (lint_assume): New macro.
14223 * composite.c (composition_gstring_put_cache):
14224 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14225
14226 * editfns.c, insdel.c:
14227 Omit unnecessary forward decls, to simplify future changes.
14228
14229 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14230
14231 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14232
14233 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14234 Use much-faster test for byte-length change.
14235 Don't assume string byte-length fits in 'int'.
14236 Check that character arg fits in 'int'.
14237 (mapcar1): Declare byte as byte, for clarity.
14238
14239 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14240
14241 * fns.c (concat): Catch string overflow earlier.
14242 Do not rely on integer wraparound.
14243
14244 * dispextern.h (struct it.overlay_strings_charpos)
14245 (struct it.selective): Now EMACS_INT, not int.
14246 * xdisp.c (forward_to_next_line_start)
14247 (back_to_previous_visible_line_start)
14248 (reseat_at_next_visible_line_start, next_element_from_buffer):
14249 Don't arbitrarily truncate the value of 'selective' to int.
14250
14251 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14252
14253 * composite.c: Don't truncate sizes to 'int'.
14254 (composition_gstring_p, composition_reseat_it)
14255 (composition_adjust_point): Use EMACS_INT, not int.
14256 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14257 not EMACS_UINT, for indexes.
14258
14259 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14260
14261 * buffer.c: Include <verify.h>.
14262 (struct sortvec.priority, struct sortstr.priority):
14263 Now EMACS_INT, not int.
14264 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14265 (struct sortstr.size, record_overlay_string)
14266 (struct sortstrlist.size, struct sortlist.used):
14267 Don't truncate size to int.
14268 (record_overlay_string): Check for size-calculation overflow.
14269 (init_buffer_once): Check at compile-time, not run-time.
14270
14271 2011-06-22 Jim Meyering <meyering@redhat.com>
14272
14273 Don't leak an XBM-image-sized buffer
14274 * image.c (xbm_load): Free the image buffer after using it.
14275
14276 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14277
14278 Port to Sun C.
14279 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14280 that Sun C diagnosed.
14281 * fns.c (secure_hash): Fix pointer signedness issue.
14282 * intervals.c (static_offset_intervals): New function.
14283 (offset_intervals): Use it.
14284
14285 2011-06-21 Leo Liu <sdl.web@gmail.com>
14286
14287 * deps.mk (fns.o):
14288 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14289 sha512.h.
14290
14291 * fns.c (secure_hash): Rename from crypto_hash_function and change
14292 the first arg to accept symbols.
14293 (Fsecure_hash): New primitive.
14294 (syms_of_fns): New symbols.
14295
14296 2011-06-20 Deniz Dogan <deniz@dogan.se>
14297
14298 * process.c (Fset_process_buffer): Clarify return value in
14299 docstring.
14300
14301 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14302
14303 * dispnew.c (add_window_display_history): Use BVAR.
14304
14305 * xdisp.c (debug_method_add): Use BVAR.
14306 (check_window_end, dump_glyph_matrix, dump_glyph)
14307 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14308
14309 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14310 Likewise.
14311
14312 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14313 check till after the cache is created in init_frame_faces.
14314
14315 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14316
14317 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14318
14319 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14320
14321 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14322 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14323 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14324
14325 Improve buffer-overflow checking (Bug#8873).
14326 * fileio.c (Finsert_file_contents):
14327 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14328 Remove the old (too-loose) buffer overflow checks.
14329 They weren't needed, since make_gap checks for buffer overflow.
14330 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14331 The old code merely checked for Emacs fixnum overflow, and relied
14332 on undefined (wraparound) behavior. The new code avoids undefined
14333 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14334
14335 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14336 Tune. Don't use wider integers than needed. Don't use alloca.
14337 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14338
14339 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14340
14341 * insdel.c, lisp.h (buffer_overflow): New function.
14342 (insert_from_buffer_1, replace_range, replace_range_2):
14343 * insdel.c (make_gap_larger):
14344 * editfns.c (Finsert_char):
14345 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14346
14347 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14348
14349 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14350
14351 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14352
14353 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14354 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14355
14356 * fileio.c: Don't assume EMACS_INT fits in off_t.
14357 (emacs_lseek): New static function.
14358 (Finsert_file_contents, Fwrite_region): Use it.
14359 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14360
14361 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14362
14363 * fns.c: Don't overflow int when computing a list length.
14364 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14365 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14366 truncation on 64-bit hosts. Check for QUIT every
14367 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14368 faster and is responsive enough.
14369 (Flength): Report an error instead of overflowing an integer.
14370 (Fsafe_length): Return a float if the value is not representable
14371 as a fixnum. This shouldn't happen except in contrived situations.
14372 (Fnthcdr, Fsort): Don't assume list length fits in int.
14373 (Fcopy_sequence): Don't assume vector length fits in int.
14374
14375 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14376 (header_size, word_size): New constants.
14377 (allocate_vectorlike): Don't check size overflow here.
14378 (allocate_vector): Check it here instead, since this is the only
14379 caller of allocate_vectorlike that could cause overflow.
14380 Check that the new vector's length is representable as a fixnum.
14381
14382 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14383 The previous code was bogus. For example, next_almost_prime (32)
14384 returned 39, which is undesirable as it is a multiple of 3; and
14385 next_almost_prime (24) returned 25, which is a multiple of 5 so
14386 why was the code bothering to check for multiples of 7?
14387
14388 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14389
14390 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14391
14392 Variadic C functions now count arguments with ptrdiff_t.
14393 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14394 Back then I didn't know that the Emacs coding style prefers signed int.
14395 Also, in the meantime I found a few more instances where arguments
14396 were being counted with int, which may truncate counts on 64-bit
14397 machines, or EMACS_INT, which may be unnecessarily wide.
14398 * lisp.h (struct Lisp_Subr.function.aMANY)
14399 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14400 Arg counts are now ptrdiff_t, not size_t.
14401 All variadic functions and their callers changed accordingly.
14402 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14403 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14404 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14405 * callint.c (Fcall_interactively): Check arg count for overflow,
14406 to avoid potential buffer overrun. Use signed char, not 'int',
14407 for 'varies' array, so that we needn't bother to check its size
14408 calculation for overflow.
14409 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14410 * eval.c (apply_lambda):
14411 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14412 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14413 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14414
14415 * callint.c (Fcall_interactively): Don't use index var as event count.
14416
14417 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14418 * mem-limits.h (SIZE): Remove; no longer used.
14419
14420 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14421
14422 Remove unnecessary casts.
14423 * xterm.c (x_term_init):
14424 * xfns.c (x_set_border_pixel):
14425 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14426 These aren't needed now that we assume ANSI C.
14427
14428 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14429 It's more likely to cause problems (due to unsigned overflow)
14430 than to cure them.
14431
14432 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14433
14434 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14435
14436 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14437
14438 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14439
14440 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14441
14442 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14443
14444 GLYPH_CODE_FACE returns EMACS_INT, not int.
14445 * dispextern.h (merge_faces):
14446 * xfaces.c (merge_faces):
14447 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14448 Don't assume EMACS_INT fits in int.
14449
14450 * character.h (CHAR_VALID_P): Remove unused parameter.
14451 * fontset.c, lisp.h, xdisp.c: All uses changed.
14452
14453 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14454
14455 * fns.c (concat): Minor tuning based on overflow analysis.
14456 This doesn't fix any bugs. Use int to hold character, instead
14457 of constantly refetching from Emacs object. Use XFASTINT, not
14458 XINT, for value known to be a character. Don't bother comparing
14459 a single byte to 0400, as it's always less.
14460
14461 * floatfns.c (Fexpt):
14462 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14463
14464 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14465 for characters.
14466
14467 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14468
14469 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14470 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14471 incorrectly succeed when S was a string, because 4294967386 was
14472 truncated before it was used.
14473
14474 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14475 Otherwise, an out-of-range integer could cause undefined behavior
14476 on a 64-bit host.
14477
14478 * composite.c: Use int, not EMACS_INT, for characters.
14479 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14480 EMACS_INT, for values that are known to be in character range.
14481 This doesn't fix any bugs but is the usual style inside Emacs and
14482 may generate better code on 32-bit machines.
14483
14484 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14485 This is for reasons similar to the recent CHAR_STRING fix.
14486 * charset.c (Fencode_char): Check that character arg is actually
14487 a character. Pass an int to ENCODE_CHAR.
14488 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14489 wider than 'int', as a compile-time check to prevent future regressions
14490 in this area.
14491
14492 * character.c (char_string): Remove unnecessary casts.
14493
14494 Make sure a 64-bit char is never passed to CHAR_STRING.
14495 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14496 by silently ignoring the top 32 bits, allowing some values
14497 that were far too large to be valid characters.
14498 * character.h: Include <verify.h>.
14499 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14500 arguments are no wider than unsigned, as a compile-time check
14501 to prevent future regressions in this area.
14502 * data.c (Faset):
14503 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14504 (Fsubst_char_in_region):
14505 * fns.c (concat):
14506 * xdisp.c (decode_mode_spec_coding):
14507 Adjust to CHAR_STRING's new requirement.
14508 * editfns.c (Finsert_char, Fsubst_char_in_region):
14509 * fns.c (concat): Check that character args are actually
14510 characters. Without this test, these functions did the wrong
14511 thing with wildly out-of-range values on 64-bit hosts.
14512
14513 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14514 These casts should not be needed on 32-bit hosts, either.
14515 * keyboard.c (read_char):
14516 * lread.c (Fload): Remove casts to unsigned.
14517
14518 * lisp.h (UNSIGNED_CMP): New macro.
14519 This fixes comparison bugs on 64-bit hosts.
14520 (ASCII_CHAR_P): Use it.
14521 * casefiddle.c (casify_object):
14522 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14523 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14524 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14525 * dispextern.h (FACE_FROM_ID):
14526 * keyboard.c (read_char): Use UNSIGNED_CMP.
14527
14528 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14529 not to EMACS_INT, to avoid GCC warning.
14530
14531 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14532
14533 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14534 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14535 isn't needed on 32-bit machines.
14536
14537 * buffer.c (Fgenerate_new_buffer_name):
14538 Use EMACS_INT for count, not int.
14539 (advance_to_char_boundary): Return EMACS_INT, not int.
14540
14541 * data.c (Qcompiled_function): Now static.
14542
14543 * window.c (window_body_lines): Now static.
14544
14545 * image.c (gif_load): Rename local to avoid shadowing.
14546
14547 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14548 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14549 * alloc.c (make_save_value): Integer argument is now of type
14550 ptrdiff_t, not int.
14551 (mark_object): Use ptrdiff_t, not int.
14552 * lisp.h (pD): New macro.
14553 * print.c (print_object): Use it.
14554
14555 * alloc.c: Use EMACS_INT, not int, to count objects.
14556 (total_conses, total_markers, total_symbols, total_vector_size)
14557 (total_free_conses, total_free_markers, total_free_symbols)
14558 (total_free_floats, total_floats, total_free_intervals)
14559 (total_intervals, total_strings, total_free_strings):
14560 Now EMACS_INT, not int. All uses changed.
14561 (Fgarbage_collect): Compute overall total using a double, so that
14562 integer overflow is less likely to be a problem. Check for overflow
14563 when converting back to an integer.
14564 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14565 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14566 These were 'int' variables that could overflow on 64-bit hosts;
14567 they were never used, so remove them instead of repairing them.
14568 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14569 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14570 Previously, this ceilinged at INT_MAX, but that doesn't work on
14571 64-bit machines.
14572 (allocate_pseudovector): Don't use EMACS_INT when int would do.
14573
14574 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14575 (allocate_vectorlike): Check for ptrdiff_t overflow.
14576 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14577 when a (possibly-narrower) signed value would do just as well.
14578 We prefer using signed arithmetic, to avoid comparison confusion.
14579
14580 * alloc.c: Catch some string size overflows that we were missing.
14581 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14582 for convenience in STRING_BYTES_MAX.
14583 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14584 The definition here is exact; the one in lisp.h was approximate.
14585 (allocate_string_data): Check for string overflow. This catches
14586 some instances we weren't catching before. Also, it catches
14587 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14588 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14589 and ptrdiff_t and EMACS_INT are both 64 bits.
14590
14591 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14592 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14593 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14594
14595 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14596
14597 * alloc.c (Fmake_string): Check for out-of-range init.
14598
14599 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14600
14601 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14602
14603 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14604
14605 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14606 xg_get_default_scrollbar_width.
14607
14608 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14609 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14610 (style_changed_cb): Call update_theme_scrollbar_width and call
14611 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14612 all frames (Bug#8505).
14613 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14614 Call gtk_window_set_resizable if HAVE_GTK3.
14615 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14616 and height if HAVE_GTK3 (Bug#8505).
14617 (scroll_bar_width_for_theme): New variable.
14618 (update_theme_scrollbar_width): New function.
14619 (xg_get_default_scrollbar_width): Move code to
14620 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14621 (xg_initialize): Call update_theme_scrollbar_width.
14622
14623 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14624
14625 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14626
14627 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14628
14629 * frame.c (make_frame): Call other_buffer_safely instead of
14630 other_buffer.
14631
14632 * window.c (temp_output_buffer_show): Call display_buffer with
14633 second argument Vtemp_buffer_show_specifiers and reset latter
14634 immediately after the call.
14635 (Vtemp_buffer_show_specifiers): New variable.
14636 (auto_window_vscroll_p, next_screen_context_lines)
14637 (Vscroll_preserve_screen_position): Remove leading asterisks from
14638 doc-strings.
14639
14640 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
14641
14642 Fix minor problems found by GCC 4.6.0 static checking.
14643 * buffer.c (Qclone_number): Remove for now, as it's unused.
14644 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14645 (record_buffer): Remove unused local.
14646 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14647 (set_frame_buffer_list): Remove; unused.
14648 * frame.h (other_visible_frames): Remove decl.
14649 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14650 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14651 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14652 if HAVE_GPM.
14653 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14654 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14655 Define only if HAVE_GPM.
14656 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14657 (update_hints_inhibit): Remove; never set. All uses removed.
14658 * widgetprv.h (emacsFrameClassRec): Remove decl.
14659 * window.c (delete_deletable_window): Now returns void, since it
14660 wasn't returning anything.
14661 (compare_window_configurations): Remove unused locals.
14662 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14663 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14664 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14665 the same widths as pointers. This follows up on the 2011-05-06 patch.
14666 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14667 * xterm.h: Likewise.
14668 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14669
14670 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
14671
14672 * makefile.w32-in: Update dependencies.
14673 (LISP_H): Add lib/intprops.h.
14674
14675 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14676
14677 * image.c (gif_load): Add animation frame delay to the metadata.
14678 (syms_of_image): Use DEFSYM. New symbol `delay'.
14679
14680 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14681
14682 * window.c (delete_deletable_window): Re-add.
14683 (Fset_window_configuration): Rewrite to handle dead buffers and
14684 consequently deletable windows.
14685 (window_tree, Fwindow_tree): Remove. Supply functionality in
14686 window.el.
14687 (compare_window_configurations): Simplify code.
14688
14689 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14690
14691 * image.c (imagemagick_load_image): Fix type mismatch.
14692 (Fimagemagick_types): Likewise.
14693
14694 * window.h (replace_buffer_in_windows): Declare.
14695
14696 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14697
14698 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14699 Qclone_number. Remove external declaration of Qdelete_window.
14700 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14701 code.
14702 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14703 Run Qbuffer_list_update_hook if allowed.
14704 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14705 buffer list implementation.
14706 (other_buffer_safely): New function.
14707 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14708 calls to replace_buffer_in_windows and
14709 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14710 if allowed.
14711 (record_buffer): Inhibit quitting and rewrite using quittable
14712 functions. Run Qbuffer_list_update_hook if allowed.
14713 (Frecord_buffer, Funrecord_buffer): New functions.
14714 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14715 Move switch-to-buffer to window.el.
14716 (bury-buffer): Move to window.el.
14717 (Vbuffer_list_update_hook): New variable.
14718
14719 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14720 section.
14721
14722 * window.h (resize_frame_windows): Move up in code.
14723 (Fwindow_frame): Remove EXFUN.
14724 (replace_buffer_in_all_windows): Remove prototype.
14725 (replace_buffer_in_windows_safely): Add prototype.
14726
14727 * window.c: Declare Qdelete_window static again. Move down
14728 declaration of select_count.
14729 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14730 (Fother_window): Move to window.el.
14731 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14732 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14733 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14734 window.el.
14735 (replace_buffer_in_windows): Implement by calling
14736 Qreplace_buffer_in_windows.
14737 (replace_buffer_in_all_windows): Remove with some functionality
14738 moved into replace_buffer_in_windows_safely.
14739 (replace_buffer_in_windows_safely): New function.
14740 (select_window_norecord, select_frame_norecord): Move in front
14741 of run_window_configuration_change_hook. Remove now obsolete
14742 declarations.
14743 (Fset_window_buffer): Rewrite doc-string.
14744 Call Qrecord_window_buffer.
14745 (keys_of_window): Move binding for other-window to window.el.
14746
14747 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14748
14749 * dispextern.h (struct image): Replace data member, whose int_val
14750 and ptr_val fields were not used by anything, with a single
14751 lisp_val object.
14752
14753 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14754 (gif_clear_image, gif_load, imagemagick_load_image)
14755 (gs_clear_image, gs_load): Callers changed.
14756
14757 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14758
14759 * buffer.h: Include <time.h>, for time_t.
14760 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14761
14762 Fix minor problems found by static checking.
14763
14764 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14765
14766 Make identifiers static if they are not used in other modules.
14767 * data.c (Qcompiled_function, Qframe, Qvector):
14768 * image.c (QimageMagick, Qsvg):
14769 * minibuf.c (Qmetadata):
14770 * window.c (resize_window_check, resize_root_window): Now static.
14771 * window.h (resize_window_check, resize_root_window): Remove decls.
14772
14773 * window.c (window_deletion_count, delete_deletable_window):
14774 Remove; unused.
14775 (window_body_lines): Now static.
14776 (Fdelete_other_windows_internal): Mark vars as initialized.
14777 Make sure 'resize_failed' is initialized.
14778 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14779 (resize_window_apply): Remove unused local.
14780 * window.h (delete_deletable_window): Remove decl.
14781
14782 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14783 (imagemagick_load_image): Fix pointer signedness problem by changing
14784 last arg from unsigned char * to char *. All uses changed.
14785 Also, fix a local for similar reasons.
14786 Remove unused locals. Remove locals to avoid shadowing.
14787 (fn_rsvg_handle_free): Remove; unused.
14788 (svg_load, svg_load_image): Fix pointer signedness problem.
14789 (imagemagick_load_image): Don't use garbage pointer image_wand.
14790
14791 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14792
14793 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
14794
14795 * image.c (gif_load): Fix omitted cast error introduced by
14796 2011-06-06 change.
14797
14798 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14799
14800 * window.h (resize_proportionally, orig_total_lines)
14801 (orig_top_line): Remove from window structure.
14802 (set_window_height, set_window_width, change_window_heights)
14803 (Fdelete_window): Remove prototypes.
14804 (resize_frame_windows): Remove duplicate declaration.
14805
14806 2011-06-10 Eli Zaretskii <eliz@gnu.org>
14807
14808 * window.h (resize_frame_windows, resize_window_check)
14809 (delete_deletable_window, resize_root_window)
14810 (resize_frame_windows): Declare prototypes.
14811
14812 * window.c (resize_window_apply): Make definition be "static" to
14813 match the prototype.
14814
14815 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14816
14817 * window.c: Remove declarations of Qwindow_size_fixed,
14818 window_min_size_1, window_min_size_2, window_min_size,
14819 size_window, window_fixed_size_p, enlarge_window, delete_window.
14820 Remove static from declaration of Qdelete_window, it's
14821 temporarily needed by Fbury_buffer.
14822 (replace_window): Don't assign orig_top_line and
14823 orig_total_lines.
14824 (Fdelete_window, delete_window): Remove. Window deletion is
14825 handled by window.el.
14826 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14827 Replace Fdelete_window calls with calls to Qdelete_window.
14828 (Fdelete_other_windows): Remove. Deleting other windows is
14829 handled by window.el.
14830 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14831 handled in window.el.
14832 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14833 Window minimum sizes are handled in window.el.
14834 (shrink_windows, size_window, set_window_height)
14835 (set_window_width, change_window_heights, window_height)
14836 (window_width, CURBEG, CURSIZE, enlarge_window)
14837 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14838 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14839 handled in window.el.
14840 (make_dummy_parent): Rename to make_parent_window and give it a
14841 second argument horflag.
14842 (make_window): Don't set resize_proportionally any more.
14843 (Fsplit_window): Remove. Windows are split in window.el.
14844 (save_restore_action, save_restore_orig_size)
14845 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14846 Resize mini windows in window.el.
14847 (grow_mini_window, shrink_mini_window): Implement by calling
14848 Qresize_root_window_vertically, resize_window_check and
14849 resize_window_apply.
14850 (saved_window, Fset_window_configuration, save_window_save):
14851 Do not handle orig_top_line, orig_total_lines, and
14852 resize_proportionally.
14853 (window_min_height, window_min_width): Move to window.el.
14854 (keys_of_window): Move bindings for delete-other-windows,
14855 split-window, delete-window and enlarge-window to window.el.
14856
14857 * buffer.c: Temporarily extern Qdelete_window.
14858 (Fbury_buffer): Temporarily call Qdelete_window instead of
14859 Fdelete_window (Fbury_buffer will move to window.el soon).
14860
14861 * frame.c (set_menu_bar_lines_1): Remove code handling
14862 orig_top_line and orig_total_lines.
14863
14864 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14865 set_window_height but set heights directly.
14866 (change_frame_size_1): Use resize_frame_windows.
14867
14868 * xdisp.c (init_xdisp): Don't use set_window_height but set
14869 heights directly.
14870
14871 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14872 Use resize_frame_windows instead of change_window_heights and run
14873 run_window_configuration_change_hook.
14874
14875 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14876 instead of change_window_heights and run
14877 run_window_configuration_change_hook.
14878
14879 2011-06-09 Martin Rudalics <rudalics@gmx.at>
14880
14881 * window.c (replace_window): Rename second argument REPLACEMENT to
14882 NEW. New third argument SETFLAG. Rewrite.
14883 (delete_window, make_dummy_parent): Call replace_window with
14884 third argument 1.
14885 (window_list_1): Move down in code.
14886 (run_window_configuration_change_hook): Move set_buffer part
14887 before select_frame_norecord part in order to unwind correctly.
14888 Rename count1 to count.
14889 (recombine_windows, delete_deletable_window, resize_root_window)
14890 (Fdelete_other_windows_internal)
14891 (Frun_window_configuration_change_hook, make_parent_window)
14892 (resize_window_check, resize_window_apply, Fresize_window_apply)
14893 (resize_frame_windows, Fsplit_window_internal)
14894 (Fdelete_window_internal, Fresize_mini_window_internal):
14895 New functions.
14896 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14897
14898 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14899
14900 * window.h (window): Add some new members to window structure -
14901 normal_lines, normal_cols, new_total, new_normal, clone_number,
14902 splits, nest, prev_buffers, next_buffers.
14903 (WINDOW_TOTAL_SIZE): Move here from window.c.
14904 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14905
14906 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14907 Remove.
14908 (make_dummy_parent): Set new members of windows structure.
14909 (make_window): Move down in code. Handle new members of window
14910 structure.
14911 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14912 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14913 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14914 (Fset_window_prev_buffers, Fwindow_next_buffers)
14915 (Fset_window_next_buffers, Fset_window_clone_number):
14916 New functions.
14917 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14918 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14919 Doc-string fixes.
14920 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14921 Argument WINDOW can be now internal window too.
14922 (Fwindow_use_time): Move up in code.
14923 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14924 Rewrite doc-string.
14925 (Fset_window_configuration, saved_window)
14926 (Fcurrent_window_configuration, save_window_save): Handle new
14927 members of window structure.
14928 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14929 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14930 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14931 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14932 Qget_mru_window, Qresize_root_window,
14933 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14934 Qauto_buffer_name; staticpro them.
14935
14936 2011-06-07 Martin Rudalics <rudalics@gmx.at>
14937
14938 * window.c (Fwindow_total_size, Fwindow_left_column)
14939 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14940 (Fwindow_list_1): New functions.
14941 (window_box_text_cols): Replace with window_body_cols.
14942 (Fwindow_width, Fscroll_left, Fscroll_right):
14943 Use window_body_cols instead of window_box_text_cols.
14944 (delete_window, Fset_window_configuration):
14945 Call delete_all_subwindows with window as argument.
14946 (delete_all_subwindows): Take a window as argument and not a
14947 structure. Rewrite.
14948 (window_loop): Remove handling of GET_LRU_WINDOW and
14949 GET_LARGEST_WINDOW.
14950 (Fget_lru_window, Fget_largest_window): Move to window.el.
14951
14952 * window.h: Extern window_body_cols instead of
14953 window_box_text_cols. delete_all_subwindows now takes a
14954 Lisp_Object as argument.
14955
14956 * indent.c (compute_motion, Fcompute_motion):
14957 Use window_body_cols instead of window_box_text_cols.
14958
14959 * frame.c (delete_frame): Call delete_all_subwindows with root
14960 window as argument.
14961
14962 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14963
14964 * fns.c (Fputhash): Document return value.
14965
14966 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
14967
14968 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14969
14970 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14971
14972 Cons<->int and similar integer overflow fixes (Bug#8794).
14973
14974 Check for overflow when converting integer to cons and back.
14975 * charset.c (Fdefine_charset_internal, Fdecode_char):
14976 Use cons_to_unsigned to catch overflow.
14977 (Fencode_char): Use INTEGER_TO_CONS.
14978 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14979 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14980 * data.c (long_to_cons, cons_to_long): Remove.
14981 (cons_to_unsigned, cons_to_signed): New functions.
14982 These signal an error for invalid or out-of-range values.
14983 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14984 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14985 * font.c (Ffont_variation_glyphs):
14986 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14987 * lisp.h: Include <intprops.h>.
14988 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14989 (cons_to_signed, cons_to_unsigned): New decls.
14990 (long_to_cons, cons_to_long): Remove decls.
14991 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14992 (Fprimitive_undo): Use CONS_TO_INTEGER.
14993 * xfns.c (Fx_window_property): Likewise.
14994 * xselect.c: Include <limits.h>.
14995 (x_own_selection, selection_data_to_lisp_data):
14996 Use INTEGER_TO_CONS.
14997 (x_handle_selection_request, x_handle_selection_clear)
14998 (x_get_foreign_selection, Fx_disown_selection_internal)
14999 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15000 (lisp_data_to_selection_data): Use cons_to_unsigned.
15001 (x_fill_property_data): Use cons_to_signed.
15002 Report values out of range.
15003
15004 Check for buffer and string overflow more precisely.
15005 * buffer.h (BUF_BYTES_MAX): New macro.
15006 * lisp.h (STRING_BYTES_MAX): New macro.
15007 * alloc.c (Fmake_string):
15008 * character.c (string_escape_byte8):
15009 * coding.c (coding_alloc_by_realloc):
15010 * doprnt.c (doprnt):
15011 * editfns.c (Fformat):
15012 * eval.c (verror):
15013 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15014 since they may not be the same number.
15015 * editfns.c (Finsert_char):
15016 * fileio.c (Finsert_file_contents):
15017 Likewise for BUF_BYTES_MAX.
15018
15019 * image.c: Use ptrdiff_t, not int, for sizes.
15020 (slurp_file): Switch from int to ptrdiff_t.
15021 All uses changed.
15022 (slurp_file): Check that file size fits in both size_t (for
15023 malloc) and ptrdiff_t (for sanity and safety).
15024
15025 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15026 if b->modtime has its maximal value.
15027
15028 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15029
15030 Don't assume time_t can fit into int.
15031 * buffer.h (struct buffer.modtime): Now time_t, not int.
15032 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15033 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15034
15035 Minor fixes for signed vs unsigned integers.
15036 * character.h (MAYBE_UNIFY_CHAR):
15037 * charset.c (maybe_unify_char):
15038 * keyboard.c (read_char, reorder_modifiers):
15039 XINT -> XFASTINT, since the integer must be nonnegative.
15040 * ftfont.c (ftfont_spec_pattern):
15041 * keymap.c (access_keymap, silly_event_symbol_error):
15042 XUINT -> XFASTINT, since the integer must be nonnegative.
15043 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15044 since it makes no difference and we prefer signed.
15045 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15046 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15047 nonnegative.
15048
15049 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15050
15051 * window.h (Fwindow_frame): Declare.
15052
15053 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15054
15055 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15056 (SPARE_MEMORY): Always define.
15057 (LARGE_REQUEST): Remove.
15058 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15059
15060 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15061
15062 * lisp.h: Move EXFUNS for Fframe_root_window,
15063 Fframe_first_window and Fset_frame_selected_window to window.h.
15064
15065 * window.h: Move EXFUNS for Fframe_root_window,
15066 Fframe_first_window and Fset_frame_selected_window here from
15067 lisp.h.
15068
15069 * frame.c (Fwindow_frame, Fframe_first_window)
15070 (Fframe_root_window, Fframe_selected_window)
15071 (Fset_frame_selected_window): Move to window.c.
15072 (Factive_minibuffer_window): Move to minibuf.c.
15073 (Fother_visible_frames_p): New function.
15074
15075 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15076
15077 * window.c (decode_window, decode_any_window): Move up in code.
15078 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15079 (inhibit_frame_unsplittable): Remove unused variable.
15080 (Fwindow_buffer): Move up and rewrite doc-string.
15081 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15082 (Fwindow_prev): New functions.
15083 (Fwindow_frame): Move here from frame.c. Accept any window as
15084 argument.
15085 (Fframe_root_window, Fframe_first_window)
15086 (Fframe_selected_window): Move here from frame.c. Accept frame
15087 or arbitrary window as argument. Update doc-strings.
15088 (Fminibuffer_window): Move up in code.
15089 (Fwindow_minibuffer_p): Move up in code and simplify.
15090 (Fset_frame_selected_window): Move here from frame.c.
15091 Marginal rewrite.
15092 (Fselected_window, select_window, Fselect_window): Move up in
15093 code. Minor doc-string fixes.
15094
15095 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15096
15097 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15098 Do not assume that spare memory exists; that assumption is valid
15099 only if SYSTEM_MALLOC.
15100 (LARGE_REQUEST): New macro, so that the issue of large requests
15101 is separated from the issue of spare memory.
15102
15103 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15104
15105 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15106 format. (Bug#8806)
15107
15108 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15109
15110 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15111 before statements.
15112
15113 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15114
15115 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15116
15117 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15118
15119 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15120 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15121
15122 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15123
15124 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15125
15126 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15127
15128 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15129 (x_clipboard_manager_save): Add return value.
15130 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15131 New error handlers.
15132 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15133 Obey Vx_select_enable_clipboard_manager. Catch errors in
15134 x_clipboard_manager_save (Bug#8779).
15135 (Vx_select_enable_clipboard_manager): New variable.
15136 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15137
15138 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15139
15140 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15141
15142 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15143
15144 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15145 in the current matrix if keep_current_p is non-zero.
15146
15147 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15148
15149 * bidi.c (bidi_level_of_next_char): Fix last change.
15150
15151 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15152
15153 Support bidi reordering of text covered by display properties.
15154
15155 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15156 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15157 (bidi_cache_search, bidi_cache_iterator_state)
15158 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15159 (bidi_level_of_next_char, bidi_move_to_visually_next):
15160 Support character positions inside a run of characters covered by a
15161 display string.
15162 (bidi_paragraph_init, bidi_resolve_explicit_1)
15163 (bidi_level_of_next_char): Call bidi_fetch_char and
15164 bidi_fetch_char_advance instead of FETCH_CHAR and
15165 FETCH_CHAR_ADVANCE.
15166 (bidi_init_it): Initialize new members.
15167 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15168 definitions.
15169 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15170 instead of using explicit *_CHAR codes.
15171 (bidi_resolve_explicit, bidi_resolve_weak):
15172 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15173 bidirectional text is supported only in multibyte buffers.
15174 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15175 it to initialize the frame_window_p member of struct bidi_it.
15176 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15177 (bidi_resolve_explicit, bidi_resolve_weak)
15178 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15179 bidi_it->nchars is non-positive.
15180 (bidi_level_of_next_char): Don't try to lookup the cache for the
15181 next/previous character if nothing is cached there yet, or if we
15182 were just reseat()'ed to a new position.
15183
15184 * xdisp.c (set_cursor_from_row): Set start and stop points
15185 according to the row's direction when priming the loop that looks
15186 for the glyph on which to display cursor.
15187 (single_display_spec_intangible_p): Function deleted.
15188 (display_prop_intangible_p): Reimplement to call
15189 handle_display_spec instead of single_display_spec_intangible_p.
15190 Accept 3 additional arguments needed by handle_display_spec.
15191 This fixes incorrect cursor motion across display property with complex
15192 values: lists, `(when COND...)' forms, etc.
15193 (single_display_spec_string_p): Support property values that are
15194 lists with the argument STRING its top-level element.
15195 (display_prop_string_p): Fix the condition for processing a
15196 property that is a list to be consistent with handle_display_spec.
15197 (handle_display_spec): New function, refactored from the
15198 last portion of handle_display_prop.
15199 (compute_display_string_pos): Accept additional argument
15200 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15201 value of a `display' property is a "replacing spec".
15202 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15203 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15204 the display property, but just return a value indicating whether
15205 the display property will replace the characters it covers.
15206 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15207 frame_window_p members of struct bidi_it.
15208 (compute_display_string_pos, compute_display_string_end):
15209 New functions.
15210 (push_it): Accept second argument POSITION, where pop_it should
15211 jump to continue iteration.
15212 (reseat_1): Initialize bidi_it.disp_pos.
15213
15214 * keyboard.c (adjust_point_for_property): Adjust the call to
15215 display_prop_intangible_p to its new signature.
15216
15217 * dispextern.h (struct bidi_it): New member frame_window_p.
15218 (bidi_init_it): Update prototypes.
15219 (display_prop_intangible_p): Update prototype.
15220 (compute_display_string_pos, compute_display_string_end):
15221 Declare prototypes.
15222 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15223 EMACS_INT.
15224
15225 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15226
15227 Malloc failure behavior now depends on size of allocation.
15228 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15229 * lisp.h: Change signatures accordingly.
15230 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15231 All callers changed. (Bug#8762)
15232
15233 * gnutls.c: Use Emacs's memory allocators.
15234 Without this change, the gnutls library would invoke malloc etc.
15235 directly, which causes problems on non-SYNC_INPUT hosts, and which
15236 runs afoul of improving memory_full behavior. (Bug#8761)
15237 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15238 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15239 xfree instead of the default malloc, realloc, free.
15240 (Fgnutls_boot): No need to check for memory allocation failure,
15241 since xmalloc does that for us.
15242
15243 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15244 * category.c (hash_get_category_set):
15245 * ccl.c (ccl_driver):
15246 * charset.c (Fdefine_charset_internal):
15247 * charset.h (struct charset.hash_index):
15248 * composite.c (get_composition_id, gstring_lookup_cache)
15249 (composition_gstring_put_cache):
15250 * composite.h (struct composition.hash_index):
15251 * dispextern.h (struct image.hash):
15252 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15253 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15254 (hashfn_equal, hashfn_user_defined, make_hash_table)
15255 (maybe_resize_hash_table, hash_lookup, hash_put)
15256 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15257 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15258 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15259 * image.c (make_image, search_image_cache, lookup_image)
15260 (xpm_put_color_table_h):
15261 * lisp.h (struct Lisp_Hash_Table):
15262 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15263 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15264 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15265 * alloc.c (allocate_vectorlike):
15266 Check for overflow in vector size calculations.
15267 * ccl.c (ccl_driver):
15268 Check for overflow when converting EMACS_INT to int.
15269 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15270 need to be updated by these changes.
15271 * fns.c (make_hash_table, maybe_resize_hash_table):
15272 Check for integer overflow with large hash tables.
15273 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15274 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15275 (SXHASH_REDUCE): New macro.
15276 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15277 Use it instead of discarding useful hash info with large hash values.
15278 (sxhash_float): New function.
15279 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15280 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15281 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15282 Rewrite to use FIXNUM_BITS, as this simplifies things.
15283 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15284 Adjust signatures to match updated version of code.
15285 (consing_since_gc): Now EMACS_INT, since a single hash table can
15286 use more than INT_MAX bytes.
15287
15288 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15289
15290 Make it possible to build with GCC-4.6+ -O2 -flto.
15291
15292 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15293
15294 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15295
15296 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15297 Call minibuffer-inactive-mode.
15298
15299 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15300
15301 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15302 Update dependencies.
15303
15304 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15305
15306 * data.c (init_data): Remove code for UTS, this system is not
15307 supported anymore.
15308
15309 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15310
15311 Don't force ./temacs to start in terminal mode.
15312
15313 * frame.c (make_initial_frame): Initialize faces in all cases, not
15314 only when CANNOT_DUMP is defined.
15315 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15316
15317 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15318
15319 * dispnew.c (add_window_display_history): Use const for the string
15320 pointer. Remove declaration, not needed.
15321
15322 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15323
15324 Use 'inline', not 'INLINE'.
15325 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15326 * alloc.c, fontset.c (INLINE): Remove.
15327 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15328 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15329 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15330 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15331 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15332
15333 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15334
15335 Make it possible to run ./temacs.
15336
15337 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15338 syms_of_callproc does the same thing. Remove test for
15339 "initialized", do it in the caller.
15340 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15341
15342 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15343
15344 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15345 (read_minibuf): Use get_minibuffer.
15346 (syms_of_minibuf): Use DEFSYM.
15347 (Qmetadata): New var.
15348 * data.c (Qbuffer): Don't make it static.
15349 (syms_of_data): Use DEFSYM.
15350
15351 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15352
15353 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15354 (CCL_CODE_MIN): New macro.
15355
15356 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15357
15358 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15359
15360 * eval.c (Qdebug): Now static.
15361 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15362 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15363 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15364
15365 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15366
15367 * image.c: Various fixes to ImageMagick code comments.
15368 (Fimagemagick_types): Doc fix.
15369
15370 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15371
15372 Minor fixes prompted by GCC 4.6.0 warnings.
15373
15374 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15375
15376 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15377 (x_clipboard_manager_save_all): Move extern decl to ...
15378 * xterm.h: ... here, so that it can be checked for consistency.
15379
15380 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15381
15382 * xselect.c (x_clipboard_manager_save_frame)
15383 (x_clipboard_manager_save_all): New functions.
15384 (Fx_clipboard_manager_save): Lisp function deleted.
15385
15386 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15387 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15388
15389 * xterm.h: Update prototype.
15390
15391 2011-05-28 William Xu <william.xwl@gmail.com>
15392
15393 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15394 exiting (Bug#8239).
15395
15396 2011-05-28 Jim Meyering <meyering@redhat.com>
15397
15398 Avoid a sign-extension bug in crypto_hash_function.
15399 * fns.c (to_uchar): Define.
15400 (crypto_hash_function): Use it to convert some newly-signed
15401 variables to unsigned, to avoid sign-extension bugs. For example,
15402 without this change, (md5 "truc") would evaluate to
15403 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15404 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15405 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15406
15407 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15408
15409 Integer overflow fixes.
15410
15411 * dbusbind.c: Serial number integer overflow fixes.
15412 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15413 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15414 to hold a serial number that is too large for a fixnum.
15415 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15416 Check for serial numbers out of range. Decode any serial number
15417 that was so large that it became a float. (Bug#8722)
15418
15419 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15420 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15421 Use XFASTINT rather than XUINT when numbers are nonnegative.
15422 (xd_append_arg, Fdbus_method_return_internal):
15423 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15424 arguments, check that Lisp number is nonnegative, rather than
15425 silently wrapping negative numbers around. (Bug#8722)
15426 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15427 (Bug#8722)
15428
15429 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15430
15431 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15432
15433 ccl: Add integer overflow checks.
15434 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15435 (IN_INT_RANGE): New macros.
15436 (ccl_driver): Use them to check for integer overflow when
15437 decoding a CCL program. Many of the new checks are whether XINT (x)
15438 fits in int; it doesn't always, on 64-bit hosts. The new version
15439 doesn't catch all possible integer overflows, but it's an
15440 improvement. (Bug#8719)
15441
15442 * alloc.c (make_event_array): Use XINT, not XUINT.
15443 There's no need for unsigned here.
15444
15445 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15446 This follows up to the 2011-05-06 change that substituted uintptr_t
15447 for EMACS_INT. This case wasn't caught back then.
15448
15449 Rework Fformat to avoid integer overflow issues.
15450 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15451 now (part of C89). Include <verify.h>.
15452 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15453 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15454 (Fformat): Avoid the prepass trying to compute sizes; it was only
15455 approximate and thus did not catch overflow reliably. Instead, walk
15456 through the format just once, formatting and computing sizes as we go,
15457 checking for integer overflow at every step, and allocating a larger
15458 buffer as needed. Keep track separately whether the format is
15459 multibyte. Keep only the most-recently calculated precision, rather
15460 than them all. Record whether each argument has been converted to
15461 string. Use EMACS_INT, not int, for byte and char and arg counts.
15462 Support field widths and precisions larger than INT_MAX. Avoid
15463 sprintf's undefined behavior with conversion specifications such as %#d
15464 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15465 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15466 formatting out-of-range floating point numbers with int
15467 formats. (Bug#8668)
15468
15469 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15470
15471 * data.c: Avoid integer truncation in expressions involving floats.
15472 * data.c: Include <intprops.h>.
15473 (arith_driver): When there's an integer overflow in an expression
15474 involving floating point, convert the integers to floating point
15475 so that the resulting value does not suffer from catastrophic
15476 integer truncation. For example, on a 64-bit host (* 4
15477 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15478 Do not rely on undefined behavior after integer overflow.
15479
15480 merge count_size_as_multibyte, parse_str_to_multibyte
15481 * character.c, character.h (count_size_as_multibyte):
15482 Rename from parse_str_to_multibyte; all uses changed.
15483 Check for integer overflow.
15484 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15485 since it's now a duplicate of the other. This is more of
15486 a character than a buffer op, so better that it's in character.c.
15487 * fns.c, print.c: Adjust to above changes.
15488
15489 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15490
15491 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15492
15493 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15494
15495 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15496 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15497 (x_clipboard_manager_save): Now static.
15498 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15499
15500 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15501 (crypto_hash_function): Now static.
15502 Fix pointer signedness problems. Avoid unnecessary initializations.
15503
15504 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15505
15506 * termhooks.h (Vselection_alist): Make it terminal-local.
15507
15508 * terminal.c (create_terminal): Initialize it.
15509
15510 * xselect.c: Support for clipboard managers.
15511 (Vselection_alist): Move to termhooks.h as terminal-local var.
15512 (LOCAL_SELECTION): New macro.
15513 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15514 (symbol_to_x_atom): Remove gratuitous arg.
15515 (x_handle_selection_request, lisp_data_to_selection_data)
15516 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15517 (x_own_selection, x_get_local_selection, x_convert_selection):
15518 New arg, specifying work frame. Use terminal-local Vselection_alist.
15519 (some_frame_on_display): Delete unused function.
15520 (Fx_own_selection_internal, Fx_get_selection_internal)
15521 (Fx_disown_selection_internal, Fx_selection_owner_p)
15522 (Fx_selection_exists_p): New optional frame arg.
15523 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15524 (x_handle_selection_clear): Don't treat other terminals with the
15525 same keyboard specially. Use the terminal-local Vselection_alist.
15526 (x_clear_frame_selections): Use Frun_hook_with_args.
15527
15528 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15529
15530 * xterm.h: Add support for those atoms.
15531
15532 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
15533
15534 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15535 (converted_selections, conversion_fail_tag): New global variables.
15536 (x_selection_request_lisp_error): Free the above.
15537 (x_get_local_selection): Remove unnecessary code.
15538 (x_reply_selection_request): Args changed; handle arbitrary array
15539 of converted selections stored in converted_selections.
15540 Separate the XChangeProperty and SelectionNotify steps.
15541 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15542 (x_convert_selection): New function.
15543 (x_handle_selection_event): Simplify.
15544 (x_get_foreign_selection): Don't ignore incoming requests while
15545 waiting for an answer; this will fail when we implement
15546 SAVE_TARGETS, and seems unnecessary anyway.
15547 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15548 (Vx_sent_selection_functions): Doc fix.
15549
15550 2011-05-26 Leo Liu <sdl.web@gmail.com>
15551
15552 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15553
15554 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15555
15556 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15557
15558 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15559 for fringe update if it has periodic bitmap.
15560 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15561 and fringe_bitmap_periodic_p.
15562
15563 * fringe.c (get_fringe_bitmap_data): New function.
15564 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15565 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15566 row. Mark glyph row for fringe update if periodicity changed.
15567
15568 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15569 for fringe update unless it has periodic bitmap.
15570
15571 2011-05-25 Kenichi Handa <handa@m17n.org>
15572
15573 * xdisp.c (get_next_display_element): Set correct it->face_id for
15574 a static composition.
15575
15576 2011-05-24 Leo Liu <sdl.web@gmail.com>
15577
15578 * deps.mk (fns.o):
15579 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15580
15581 * fns.c (crypto_hash_function, Fsha1): New function.
15582 (Fmd5): Use crypto_hash_function.
15583 (syms_of_fns): Add Ssha1.
15584
15585 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15586
15587 * gnutls.c: Remove unused macros.
15588 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15589 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15590 Remove macros that are defined and never used.
15591 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15592
15593 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15594
15595 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15596 (Fx_get_selection_internal): Minor cleanup.
15597 (Fx_own_selection_internal): Rename arguments for consistency with
15598 select.el.
15599
15600 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15601
15602 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15603
15604 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15605
15606 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15607
15608 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15609
15610 * dispnew.c (scrolling_window): Don't exclude the case that the
15611 last enabled row in the desired matrix touches the bottom boundary.
15612
15613 2011-05-21 Glenn Morris <rgm@gnu.org>
15614
15615 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15616 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15617 and add some more files.
15618
15619 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15620
15621 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15622 report_file_error introduced by the change from 2011-05-07.
15623
15624 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15625
15626 * systime.h (Time): Define only if emacs is defined.
15627 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15628 where the include path doesn't have X11/X.h by default. See
15629 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15630
15631 2011-05-20 Kenichi Handa <handa@m17n.org>
15632
15633 * composite.c (find_automatic_composition): Fix previous change.
15634
15635 2011-05-20 Glenn Morris <rgm@gnu.org>
15636
15637 * lisp.mk: New file, split from Makefile.in.
15638 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15639 (shortlisp): Remove.
15640 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15641
15642 2011-05-19 Glenn Morris <rgm@gnu.org>
15643
15644 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15645 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15646 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15647 (lisp): Set the order to that of loadup.el.
15648 (shortlisp): Make it a copy of $lisp.
15649 (SOME_MACHINE_LISP): Remove.
15650 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15651 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15652
15653 2011-05-18 Kenichi Handa <handa@m17n.org>
15654
15655 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15656 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15657 (find_automatic_composition): Mostly rewrite for efficiency.
15658
15659 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
15660
15661 * makefile.w32-in: Update dependencies.
15662
15663 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15664
15665 * menu.c: Include limits.h (fixes the MS-Windows build broken by
15666 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15667
15668 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
15669
15670 Fix some integer overflow issues, such as string length overflow.
15671
15672 * insdel.c (count_size_as_multibyte): Check for string overflow.
15673
15674 * character.c (lisp_string_width): Check for string overflow.
15675 Use EMACS_INT, not int, for string indexes and lengths; in
15676 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15677 the resulting string length overflows an EMACS_INT; instead,
15678 report a string overflow if no precision given. When checking for
15679 precision exhaustion, use a check that cannot possibly have
15680 integer overflow. (Bug#8675)
15681 * character.h (lisp_string_width): Adjust to new signature.
15682
15683 * alloc.c (string_overflow): New function.
15684 (Fmake_string): Use it. This doesn't change behavior, but saves
15685 a few bytes and will simplify future changes.
15686 * character.c (string_escape_byte8): Likewise.
15687 * lisp.h (string_overflow): New decl.
15688
15689 Fixups, following up to the user-interface timestamp change.
15690 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15691 for UI timestamps, instead of unsigned long.
15692 * msdos.c (mouse_get_pos): Likewise.
15693 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15694 * w32gui.h (Time): Define by including "systime.h" rather than by
15695 declaring it ourselves. (Bug#8664)
15696
15697 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15698 * image.c (clear_image_cache): Likewise.
15699
15700 * term.c (term_mouse_position): Don't assume time_t wraparound.
15701
15702 Be more systematic about user-interface timestamps.
15703 Before, the code sometimes used 'Time', sometimes 'unsigned long',
15704 and sometimes 'EMACS_UINT', to represent these timestamps.
15705 This change causes it to use 'Time' uniformly, as that's what X uses.
15706 This makes the code easier to follow, and makes it easier to catch
15707 integer overflow bugs such as Bug#8664.
15708 * frame.c (Fmouse_position, Fmouse_pixel_position):
15709 Use Time, not unsigned long, for user-interface timestamps.
15710 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15711 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15712 * keyboard.h (last_event_timestamp): Likewise.
15713 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15714 * menu.h (xmenu_show): Likewise.
15715 * term.c (term_mouse_position): Likewise.
15716 * termhooks.h (struct input_event.timestamp): Likewise.
15717 (struct terminal.mouse_position_hook): Likewise.
15718 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15719 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15720 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15721 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15722 what it was before.
15723 * menu.h, termhooks.h: Include "systime.h", for Time.
15724
15725 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15726 Don't assume that the difference between two unsigned long values
15727 can fit into an integer. At this point, we know button_down_time
15728 <= event->timestamp, so the difference must be nonnegative, so
15729 there's no need to cast the result if double-click-time is
15730 nonnegative, as it should be; check that it's nonnegative, just in
15731 case. This bug is triggered when events are more than 2**31 ms
15732 apart (about 25 days). (Bug#8664)
15733
15734 * xselect.c (last_event_timestamp): Remove duplicate decl.
15735 (x_own_selection): Remove needless cast to unsigned long.
15736
15737 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15738 that always fit in int. Use a sentinel instead of a counter, to
15739 avoid a temp and to allay GCC's concerns about possible int overflow.
15740 * frame.h (struct frame): Use int for menu_bar_items_used
15741 instead of EMACS_INT, since it always fits in int.
15742
15743 * menu.c (grow_menu_items): Check for int overflow.
15744
15745 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15746
15747 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15748 Before, the code was not consistent. These values cannot exceed
15749 2**31 - 1 so there's no need to make them unsigned.
15750 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15751 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15752 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15753 as modifiers.
15754 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15755
15756 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15757 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15758 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15759 presumably because the widths might not match.
15760
15761 * window.c (size_window): Avoid needless test at loop start.
15762
15763 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15764
15765 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15766
15767 2011-05-12 Drew Adams <drew.adams@oracle.com>
15768
15769 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15770
15771 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15772
15773 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15774 `width' to `bar_area_x' and `bar_area_width', respectively.
15775 (x_scroll_run): Take account of fringe background extension.
15776
15777 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15778 Rename local vars `left' and `width' to `bar_area_x' and
15779 `bar_area_width', respectively.
15780 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15781 background extension.
15782
15783 2011-05-10 Jim Meyering <meyering@redhat.com>
15784
15785 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15786
15787 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
15788
15789 * image.c (Finit_image_library): Return t for built-in image types,
15790 like pbm and xbm. (Bug#8640)
15791
15792 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15793
15794 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15795
15796 2011-05-07 Eli Zaretskii <eliz@gnu.org>
15797
15798 * w32console.c (Fset_screen_color): Doc fix.
15799 (Fget_screen_color): New function.
15800 (syms_of_ntterm): Defsubr it.
15801
15802 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15803 unlink the temporary file if Fcall_process didn't create it in the
15804 first place.
15805 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15806 child process will be redirected to a file specified with `:file'.
15807 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15808 cue to call_process_cleanup not to close that handle.
15809
15810 2011-05-07 Ben Key <bkey76@gmail.com>
15811
15812 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15813 one of two shell specific rules, either bootstrap-temacs-CMD or
15814 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15815 to the previous implementation of the bootstrap-temacs rule.
15816 The bootstrap-temacs-CMD rule is similar to the previous
15817 implementation of the bootstrap-temacs rule except that it
15818 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15819 variable.
15820
15821 These changes, along with some changes to nt/configure.bat,
15822 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15823 earlier fix to add support for --cflags and --ldflags options
15824 that include quotes so that it works whether make uses cmd or
15825 sh as the shell.
15826
15827 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
15828
15829 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15830 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15831 is a constant.
15832 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15833 a string. Handle both cases.
15834 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15835 (Fdbus_register_method): Use Qinvalid_function.
15836
15837 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15838
15839 * makefile.w32-in: Update dependencies.
15840 (LISP_H): Add inttypes.h and stdin.h.
15841 (PROCESS_H): Add unistd.h.
15842
15843 2011-05-06 Eli Zaretskii <eliz@gnu.org>
15844
15845 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15846 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15847
15848 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
15849
15850 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15851
15852 * term.c (vfatal): Remove stray call to va_end.
15853 It's not needed and the C Standard doesn't allow it here anyway.
15854
15855 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15856 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15857
15858 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15859 bytes.
15860
15861 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15862
15863 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15864
15865 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15866
15867 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15868
15869 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15870
15871 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15872 * charset.c (Fdefine_charset_internal): Don't initialize
15873 charset.code_space[15]. The value was garbage, on hosts with
15874 32-bit int (Bug#8600).
15875
15876 * lread.c (read_integer): Be more consistent with string-to-number.
15877 Use string_to_number to do the actual conversion; this avoids
15878 rounding errors and fixes some other screwups. Without this fix,
15879 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15880 (digit_to_number): Move earlier, for benefit of read_integer.
15881 Return -1 if the digit is out of range for the base, -2 if it is
15882 not a digit in any supported base. (Bug#8602)
15883
15884 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15885
15886 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15887 to match comment at start of function. This also removes a
15888 GCC warning about overflow in a 32+64-bit port.
15889
15890 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15891
15892 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15893 Reported by Stefan Monnier in
15894 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15895 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15896 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15897
15898 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15899 (EMACS_UINTPTR): Likewise, with uintptr_t.
15900
15901 * lisp.h: Prefer 64-bit EMACS_INT if available.
15902 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15903 on 32-bit hosts that have 64-bit int, so that they can access
15904 large files.
15905 However, temporarily disable this change unless the temporary
15906 symbol WIDE_EMACS_INT is defined.
15907
15908 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15909
15910 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15911 This removes an assumption that EMACS_INT and long are the same
15912 width as pointers. The assumption is true for Emacs porting targets
15913 now, but we want to make other targets possible.
15914 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15915 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15916 In the rest of the code, change types of integers that hold casted
15917 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15918 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15919 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15920 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15921 No need to cast type when ORing.
15922 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15923 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15924 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15925 assume EMACS_INT is the same width as char *.
15926 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15927 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15928 Remove no-longer-needed casts.
15929 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15930 (xg_tool_bar_help_callback, xg_make_tool_item):
15931 Use EMACS_INTPTR to hold an integer
15932 that will be cast to void *; this can avoid a GCC warning
15933 if EMACS_INT is not the same width as void *.
15934 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15935 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15936 (current_message_1, set_message_1):
15937 Use a local to convert to proper width without a cast.
15938 * xmenu.c (dialog_selection_callback): Likewise.
15939
15940 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15941 Also, don't assume VALBITS / RAND_BITS is less than 5,
15942 and don't rely on undefined behavior when shifting a 1 left into
15943 the sign bit.
15944 * lisp.h (get_random): Change signature to match.
15945
15946 * lread.c (hash_string): Use size_t, not int, for hash computation.
15947 Normally we prefer signed values; but hashing is special, because
15948 it's better to use unsigned division on hash table sizes so that
15949 the remainder is nonnegative. Also, size_t is the natural width
15950 for hashing into memory. The previous code used 'int', which doesn't
15951 retain enough info to hash well into very large tables.
15952 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15953
15954 * dbusbind.c: Don't possibly lose pointer info when converting.
15955 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15956 Use XPNTR rather than XHASH, so that the high-order bits of
15957 the pointer aren't lost when converting through void *.
15958
15959 * eval.c (Fautoload): Don't double-shift a pointer.
15960
15961 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15962
15963 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15964
15965 * gnutls.c (DEF_GNUTLS_FN):
15966 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15967
15968 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15969
15970 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15971 marker. (Bug#8610)
15972
15973 2011-05-05 Eli Zaretskii <eliz@gnu.org>
15974
15975 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15976 New version that can reserve upto 2GB of heap space.
15977
15978 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
15979
15980 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15981
15982 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15983
15984 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15985 `gnutls_certificate_set_x509_key_file'.
15986
15987 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
15988
15989 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15990 Update dependencies.
15991
15992 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15993
15994 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15995 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15996 Remove unused parameter `fildes'.
15997 * process.c (read_process_output, send_process): Don't pass it.
15998
15999 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16000
16001 Fix previous change: the library cache is defined in w32.c.
16002 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16003 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16004
16005 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16006
16007 Implement dynamic loading of GnuTLS on Windows.
16008
16009 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16010 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16011 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16012 Declare.
16013
16014 * gnutls.c (Qgnutls_dll): Define.
16015 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16016 (gnutls_*): Declare function pointers.
16017 (init_gnutls_functions): New function to initialize function pointers.
16018 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16019 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16020 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16021 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16022 (emacs_gnutls_write, emacs_gnutls_read)
16023 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16024 (Fgnutls_available_p): New function.
16025 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16026 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16027 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16028
16029 * image.c: Include w32.h.
16030 (Vimage_type_cache): Delete.
16031 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16032 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16033 (w32_delayed_load): Move to w32.c.
16034
16035 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16036
16037 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16038 (w32_delayed_load): Move from image.c. When loading a library, record
16039 its filename in the :loaded-from property of the library id.
16040 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16041 Initialize and staticpro them.
16042 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16043
16044 * process.c: Include lisp.h before w32.h, not after.
16045 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16046 instead of gnutls_record_check_pending.
16047
16048 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16049
16050 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16051
16052 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16053 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16054 as passed in.
16055
16056 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16057
16058 * xterm.c (x_set_frame_alpha): Do not set property on anything
16059 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16060
16061 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16062
16063 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16064
16065 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16066
16067 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16068 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16069 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16070 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16071 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16072 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16073 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16074 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16075 (Qgnutls_bootprop_callbacks_verify): Make static.
16076
16077 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16078
16079 * callproc.c: Indentation fixup.
16080
16081 * sysdep.c (wait_for_termination_1): Make static.
16082 (wait_for_termination, interruptible_wait_for_termination):
16083 Move after wait_for_termination_1.
16084
16085 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16086
16087 * sysdep.c (interruptible_wait_for_termination): New function
16088 which is like wait_for_termination, but allows keyboard
16089 interruptions.
16090
16091 * callproc.c (Fcall_process): Add (:file "file") as an option for
16092 the STDOUT buffer.
16093 (Fcall_process_region): Ditto.
16094
16095 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16096
16097 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16098 rather than `XVECTOR (FOO)->size'.
16099
16100 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16101 inttypes.h, as a gnulib replacement is used if it not available in
16102 system headers.
16103
16104 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16105
16106 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16107 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16108 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16109
16110 * coding.c (coding_alloc_by_realloc): Error out if destination
16111 will grow beyond MOST_POSITIVE_FIXNUM.
16112 (decode_coding_emacs_mule): Abort if there isn't enough place in
16113 charbuf for the composition carryover bytes. Reserve an extra
16114 space for up to 2 characters produced in a loop.
16115 (decode_coding_iso_2022): Abort if there isn't enough place in
16116 charbuf for the composition carryover bytes.
16117
16118 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16119
16120 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16121 aborting when %lld or %lll format is passed.
16122 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16123 %llo or %llx format is passed. (Bug#8545)
16124
16125 * window.c (window_scroll_line_based): Use a marker instead of
16126 simple variables to record original value of point. (Bug#7952)
16127
16128 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16129 produced by %s or %c overflows available buffer space. (Bug#8545)
16130
16131 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16132
16133 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16134 (SIZE_MAX): Move defn after all includes, as they might #define it.
16135
16136 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16137
16138 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16139
16140 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16141
16142 * keyboard.c (Qdelayed_warnings_hook): Define.
16143 (command_loop_1): Run `delayed-warnings-hook'
16144 if Vdelayed_warnings_list is non-nil.
16145 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16146 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16147
16148 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16149
16150 * doprnt.c (doprnt): Don't return value smaller than the buffer
16151 size if the message was truncated. (Bug#8545).
16152
16153 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16154
16155 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16156 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16157
16158 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16159
16160 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16161
16162 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16163
16164 * makefile.w32-in: Update dependencies.
16165
16166 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16167
16168 Improve `doprnt' and its usage. (Bug#8545)
16169 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16170 `format_end'. Remove support for %l as a conversion specifier.
16171 Don't use xrealloc. Improve diagnostics when the %l size modifier
16172 is used. Update the commentary.
16173
16174 * eval.c (verror): Simplify calculation of size_t.
16175
16176 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16177 messages.
16178
16179 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16180
16181 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16182 change.
16183
16184 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16185
16186 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16187 This makes this file independent of the recent pseudovector change.
16188
16189 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16190
16191 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16192
16193 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16194 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16195 Remove unused local.
16196 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16197
16198 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16199 GCC 4.6.0 optimizes based on type-based alias analysis.
16200 For example, if b is of type struct buffer * and v of type struct
16201 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16202 != &v->size, and therefore "v->size = 1; b->size = 2; return
16203 v->size;" must therefore return 1. This assumption is incorrect
16204 for Emacs, since it type-puns struct Lisp_Vector * with many other
16205 types. To fix this problem, this patch adds a new type struct
16206 vectorlike_header that documents the constraints on layout of vectors
16207 and pseudovectors, and helps optimizing compilers not get fooled
16208 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16209 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16210 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16211 the size member.
16212 (XSETPVECTYPE): Rewrite in terms of new macro.
16213 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16214 This is a bit clearer, and further avoids the possibility of
16215 undesirable aliasing.
16216 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16217 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16218 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16219 since Lisp_Subr is a special case (no "next" field).
16220 (ASIZE): Now uses header.size rather than size.
16221 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16222 to avoid the hassle of writing XVECTOR (foo)->header.size.
16223 (struct vectorlike_header): New type.
16224 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16225 object, to help avoid aliasing.
16226 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16227 (SUBRP): Likewise, since Lisp_Subr is a special case.
16228 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16229 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16230 (struct Lisp_Hash_Table): Combine first two members into a single
16231 struct vectorlike_header member. All uses of "size" and "next" members
16232 changed to be "header.size" and "header.next".
16233 * buffer.h (struct buffer): Likewise.
16234 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16235 * frame.h (struct frame): Likewise.
16236 * process.h (struct Lisp_Process): Likewise.
16237 * termhooks.h (struct terminal): Likewise.
16238 * window.c (struct save_window_data, struct saved_window): Likewise.
16239 * window.h (struct window): Likewise.
16240 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16241 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16242 * buffer.c (init_buffer_once): Likewise.
16243 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16244 special case.
16245 * process.c (Fformat_network_address): Use local var for size,
16246 for brevity.
16247
16248 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16249
16250 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16251 * data.c (atof): Remove decl; no longer used or needed.
16252 (digit_to_number): Move to lread.c.
16253 (Fstring_to_number): Use new string_to_number function, to be
16254 consistent with how the Lisp reader treats infinities and NaNs.
16255 Do not assume that floating-point numbers represent EMACS_INT
16256 without losing information; this is not true on most 64-bit hosts.
16257 Avoid double-rounding errors, by insisting on integers when
16258 parsing non-base-10 numbers, as the documentation specifies.
16259 * lisp.h (string_to_number): New decl, replacing ...
16260 (isfloat_string): Remove.
16261 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16262 (read1): Do not accept +. and -. as integers; this
16263 appears to have been a coding error. Similarly, do not accept
16264 strings like +-1e0 as floating point numbers. Do not report
16265 overflow for integer overflows unless the base is not 10 which
16266 means we have no simple and reliable way to continue.
16267 Break out the floating-point parsing into a new
16268 function string_to_number, so that Fstring_to_number parses
16269 floating point numbers consistently with the Lisp reader.
16270 (digit_to_number): Move here from data.c. Make it static inline.
16271 (E_CHAR, EXP_INT): Remove, replacing with ...
16272 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16273 (string_to_number): New function, replacing isfloat_string.
16274 This function checks for valid syntax and produces the resulting
16275 Lisp float number too. Rework it so that string-to-number
16276 no longer mishandles examples like "1.0e+". Use strtoumax,
16277 so that overflow for non-base-10 numbers is reported only when
16278 there's no portable and simple way to convert to floating point.
16279
16280 * textprop.c (set_text_properties_1): Rewrite for clarity,
16281 and to avoid GCC warning about integer overflow.
16282
16283 * intervals.h (struct interval): Use EMACS_INT for members
16284 where EMACS_UINT might cause problems. See
16285 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16286 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16287 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16288 All uses changed.
16289 (offset_intervals): Tell GCC not to worry about length overflow
16290 when negating a negative length.
16291
16292 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16293 (overrun_check_free): Likewise.
16294
16295 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16296 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16297 word size.
16298
16299 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16300 (gnutls_make_error): Rename local to avoid shadowing.
16301 (gnutls_emacs_global_deinit): ifdef out; not used.
16302 (Fgnutls_boot): Use const for pointer to readonly storage.
16303 Comment out unused local. Fix pointer signedness problems.
16304
16305 * lread.c (openp): Don't stuff size_t into an 'int'.
16306 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16307 about possible signed overflow.
16308
16309 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16310 (GDK_KEY_g): Don't define if already defined.
16311 (xg_prepare_tooltip): Avoid pointer signedness problem.
16312 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16313
16314 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16315 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16316
16317 * xfns.c (Fx_window_property): Simplify a bit,
16318 to make a bit faster and to avoid GCC 4.6.0 warning.
16319 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16320
16321 * fns.c (internal_equal): Don't assume size_t fits in int.
16322
16323 * alloc.c (compact_small_strings): Tighten assertion a little.
16324
16325 Replace pEd with more-general pI, and fix some printf arg casts.
16326 * lisp.h (pI): New macro, generalizing old pEd macro to other
16327 conversion specifiers. For example, use "...%"pI"d..." rather
16328 than "...%"pEd"...".
16329 (pEd): Remove. All uses replaced with similar uses of pI.
16330 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16331 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16332 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16333 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16334 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16335 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16336 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16337 64-bit hosts.
16338 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16339 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16340 * print.c (safe_debug_print, print_object): Likewise.
16341 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16342 to int.
16343 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16344 avoiding the 0 flag, which is not portable.
16345 * process.c (Fmake_network_process): Use pI to avoid cast.
16346 * region-cache.c (pp_cache): Likewise.
16347 * xdisp.c (decode_mode_spec): Likewise.
16348 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16349 behavior on 64-bit hosts with printf arg.
16350 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16351 (x_stop_queuing_selection_requests): Likewise.
16352 (x_get_window_property): Don't truncate byte count to an 'int'
16353 when tracing.
16354
16355 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16356 here, since it parses constructs like leading '-' and spaces,
16357 which are not wanted; and it overflows with large numbers.
16358 Instead, simply match F[0-9]+, which is what is wanted anyway.
16359
16360 * alloc.c: Remove unportable assumptions about struct layout.
16361 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16362 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16363 (allocate_vectorlike, make_pure_vector): Use the new macros,
16364 plus offsetof, to remove unportable assumptions about struct layout.
16365 These assumptions hold on all porting targets that I know of, but
16366 they are not guaranteed, they're easy to remove, and removing them
16367 makes further changes easier.
16368
16369 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16370 This doesn't fix a bug but makes the code clearer.
16371 (string_overrun_cookie): Now const. Use initializers that
16372 don't formally overflow signed char, to avoid warnings.
16373 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16374 can cause Emacs to crash when string overrun checking is enabled.
16375 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16376 multiple of sizeof (EMACS_INT); it need not be, if
16377 alignof(EMACS_INT) < sizeof (EMACS_INT).
16378 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16379
16380 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16381
16382 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16383
16384 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16385
16386 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16387 supposed to be handshaking. (Bug#8556)
16388 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16389
16390 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16391
16392 * lisp.h (Qdebug): List symbol.
16393 * eval.c (Qdebug): Restore global linkage.
16394 * keyboard.c (debug-on-event): New variable.
16395 (handle_user_signal): Break into debugger when debug-on-event
16396 matches the current signal symbol.
16397
16398 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16399
16400 * alloc.c (check_sblock, check_string_bytes)
16401 (check_string_free_list): Convert to standard C.
16402
16403 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16404
16405 * w32.c (emacs_gnutls_push): Fix typo.
16406
16407 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16408
16409 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16410 "cast to pointer from integer of different size".
16411
16412 Improve doprnt and its use in verror. (Bug#8545)
16413 * doprnt.c (doprnt): Document the set of format control sequences
16414 supported by the function. Use SAFE_ALLOCA instead of always
16415 using `alloca'.
16416
16417 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16418 is one byte too soon. Don't use xrealloc; instead xfree and
16419 xmalloc anew.
16420
16421 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16422
16423 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16424 callbacks stage.
16425
16426 * gnutls.c: Renamed global_initialized to
16427 gnutls_global_initialized. Added internals for the
16428 :verify-hostname-error, :verify-error, and :verify-flags
16429 parameters of `gnutls-boot' and documented those parameters in the
16430 docstring. Start callback support.
16431 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16432 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16433 on error. Return error code.
16434 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16435 (emacs_gnutls_read): Likewise.
16436 (Fgnutls_boot): Return handshake error code.
16437 (emacs_gnutls_handle_error): New function.
16438 (wsaerror_to_errno): Likewise.
16439
16440 * w32.h (emacs_gnutls_pull): Add prototype.
16441 (emacs_gnutls_push): Likewise.
16442
16443 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16444 (emacs_gnutls_push): Likewise.
16445
16446 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16447
16448 * process.c (wait_reading_process_output): Check if GnuTLS
16449 buffered some data internally if no FDs are set for TLS
16450 connections.
16451
16452 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16453 (LIBS): Link to USER_LIBS.
16454 ($(BLD)/gnutls.$(0)): New target.
16455
16456 2011-04-24 Eli Zaretskii <eliz@gnu.org>
16457
16458 * xdisp.c (handle_single_display_spec): Rename the
16459 display_replaced_before_p argument into display_replaced_p, to
16460 make it consistent with the commentary. Fix typos in the
16461 commentary.
16462
16463 * textprop.c (syms_of_textprop): Remove dead code.
16464 (copy_text_properties): Delete obsolete commentary about an
16465 interface that was deleted long ago. Fix typos in the description
16466 of arguments.
16467
16468 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16469 to changes in oldXMenu/XMenu.h from 2011-04-16.
16470 <menu_help_message, prev_menu_help_message>: Constify.
16471 (IT_menu_make_room): menu->help_text is now `const char **';
16472 adjust.
16473
16474 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16475 to changes in oldXMenu/XMenu.h from 2011-04-16.
16476 (struct XMenu): Declare `help_text' `const char **'.
16477
16478 * xfaces.c <Qunspecified>: Make extern again.
16479
16480 * syntax.c: Include sys/types.h before including regex.h, as
16481 required by POSIX.
16482
16483 * doc.c (get_doc_string): Improve the format passed to `error'.
16484
16485 * doprnt.c (doprnt): Improve commentary.
16486
16487 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16488
16489 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16490 them with etags.
16491
16492 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16493 changes in globals.h immediately force recompilation.
16494 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16495 $(CURDIR)/s/ms-w32.h.
16496 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16497
16498 * character.c (Fchar_direction): Function deleted.
16499 (syms_of_character): Don't defsubr it.
16500 <char-direction-table>: Deleted.
16501
16502 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16503
16504 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16505 * doprnt.c: Include limits.h.
16506 (SIZE_MAX): New macro.
16507 (doprnt): Return a size_t value. 2nd arg is now size_t.
16508 Many local variables are now size_t instead of int or unsigned.
16509 Improve overflow protection. Support `l' modifier for integer
16510 conversions. Support %l conversion. Don't assume an EMACS_INT
16511 argument for integer conversions and for %c.
16512
16513 * lisp.h (doprnt): Restore prototype.
16514
16515 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16516 $(SRC)/character.h.
16517
16518 * Makefile.in (base_obj): Add back doprnt.o.
16519
16520 * deps.mk (doprnt.o): Add back prerequisites.
16521 (callint.o): Depend on character.h.
16522
16523 * eval.c (internal_lisp_condition_case): Include the handler
16524 representation in the error message.
16525 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16526 when breaking from the loop.
16527
16528 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16529
16530 * callint.c (Fcall_interactively): When displaying error message
16531 about invalid control letter, pass the character's codepoint, not
16532 a pointer to its multibyte form. Improve display of the character
16533 in octal and display also its hex code.
16534
16535 * character.c (char_string): Use %x to display the (unsigned)
16536 codepoint of an invalid character, to avoid displaying a bogus
16537 negative value.
16538
16539 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16540 `error', not SYMBOL_NAME itself.
16541
16542 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16543 character arguments to `error'.
16544
16545 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16546 to `error' in error message about FINAL_CHAR argument. Make sure
16547 FINAL_CHAR is a character, and use %c when it is passed as
16548 argument to `error'.
16549
16550 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16551
16552 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16553
16554 * w32.c: Include <time.h>.
16555 (sys_localtime): New function.
16556
16557 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
16558
16559 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16560
16561 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16562
16563 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
16564
16565 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16566 zombies (Bug#8467).
16567
16568 2011-04-19 Eli Zaretskii <eliz@gnu.org>
16569
16570 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16571 gl_state.e_property when gl_state.object is Qt.
16572
16573 * insdel.c (make_gap_larger): Remove limitation of buffer size
16574 to <= INT_MAX.
16575
16576 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
16577
16578 * xdisp.c (lookup_glyphless_char_display)
16579 (produce_glyphless_glyph): Handle cons cell entry in
16580 glyphless-char-display.
16581 (Vglyphless_char_display): Document it.
16582
16583 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16584 glyphless-char-display.
16585
16586 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
16587
16588 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16589
16590 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16591
16592 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16593 definition for no-X builds.
16594
16595 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
16596
16597 Static checks with GCC 4.6.0 and non-default toolkits.
16598
16599 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16600
16601 * process.c (keyboard_bit_set): Define only if SIGIO.
16602 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16603 (send_process): Repair possible setjmp clobbering.
16604
16605 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16606
16607 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16608
16609 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16610
16611 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16612 Define only if needed.
16613
16614 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16615 by pacifying GCC about it. Maybe it's time to retire it?
16616 * xfaces.c (USG, __TIMEVAL__): Likewise.
16617
16618 * dispextern.h (struct redisplay_interface): Rename param
16619 to avoid shadowing.
16620 * termhooks.h (struct terminal): Likewise.
16621 * xterm.c (xembed_send_message): Likewise.
16622
16623 * insdel.c (make_gap_smaller): Define only if
16624 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16625
16626 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16627 it.
16628
16629 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16630 so that we aren't warned about unused symbols.
16631
16632 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16633
16634 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16635
16636 * xfns.c (x_real_positions): Mark locals as initialized.
16637
16638 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16639
16640 * xterm.c: Fix problems found by static analysis with other toolkits.
16641 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16642 (x_dispatch_event): Declare static if USE_GTK, and
16643 define if USE_GTK || USE_X_TOOLKIT.
16644 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16645 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16646 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16647 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16648
16649 * xmenu.c (menu_help_callback): Pointer type fixes.
16650 Use const pointers when pointing at readonly data. Avoid pointer
16651 signedness clashes.
16652 (FALSE): Remove unused macro.
16653 (update_frame_menubar): Remove unused decl.
16654
16655 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16656
16657 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16658 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16659 (single_menu_item): Rename local to avoid shadowing.
16660
16661 * keyboard.c (make_lispy_event): Remove unused local var.
16662
16663 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16664 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16665
16666 * bitmaps: Change bitmaps from unsigned char back to the X11
16667 compatible char. Avoid the old compiler warnings about
16668 out-of-range initializers by using, for example, '\xab' rather
16669 than 0xab.
16670
16671 * xgselect.c (xgselect_initialize): Check vs interface
16672 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16673
16674 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16675
16676 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16677 to read-only memory.
16678
16679 * fns.c (vector): Remove; this old hack is no longer needed.
16680
16681 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16682 Remove unused var.
16683 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16684
16685 * xrdb.c (x_load_resources): Omit unused local.
16686
16687 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16688 (x_window): Rename locals to avoid shadowing.
16689 (USG): Use the kludged USG macro, to pacify gcc.
16690
16691 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16692 (x_term_init): Remove local to avoid shadowing.
16693
16694 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16695
16696 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16697 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16698
16699 2011-04-16 Eli Zaretskii <eliz@gnu.org>
16700
16701 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16702
16703 Fix regex.c, syntax.c and friends for buffers > 2GB.
16704 * syntax.h (struct gl_state_s): Declare character position members
16705 EMACS_INT.
16706
16707 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16708
16709 * textprop.c (verify_interval_modification, interval_of):
16710 Declare arguments EMACS_INT.
16711
16712 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16713 EMACS_INT.
16714
16715 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16716
16717 * indent.c (Fvertical_motion): Local variable it_start is now
16718 EMACS_INT.
16719
16720 * regex.c (re_match, re_match_2, re_match_2_internal)
16721 (bcmp_translate, regcomp, regexec, print_double_string)
16722 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16723 (re_compile_pattern, re_exec): Declare arguments and local
16724 variables `size_t' and `ssize_t' and return values `regoff_t', as
16725 appropriate.
16726 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16727 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16728 <compile_stack_type>: `size' and `avail' are now `size_t'.
16729
16730 * regex.h <regoff_t>: Use ssize_t, not int.
16731 (re_search, re_search_2, re_match, re_match_2): Arguments that
16732 specify buffer/string position and length are now ssize_t and
16733 size_t. Return type is regoff_t.
16734
16735 2011-04-16 Ben Key <bkey76@gmail.com>
16736
16737 * nsfont.m: Fixed bugs in ns_get_family and
16738 ns_descriptor_to_entity that were caused by using free to
16739 deallocate memory blocks that were allocated by xmalloc (via
16740 xstrdup). This caused Emacs to crash when compiled with
16741 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16742 --enable-checking=xmallocoverrun). xfree is now used to
16743 deallocate these memory blocks.
16744
16745 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
16746
16747 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16748
16749 emacs_write: Accept and return EMACS_INT for sizes.
16750 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16751 et seq.
16752 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16753 Accept and return EMACS_INT.
16754 (emacs_gnutls_write): Return the number of bytes written on
16755 partial writes.
16756 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16757 (emacs_read, emacs_write): Remove check for negative size, as the
16758 Emacs source code has been audited now.
16759 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16760 (emacs_read, emacs_write): Use it.
16761 * process.c (send_process): Adjust to the new signatures of
16762 emacs_write and emacs_gnutls_write. Do not attempt to store
16763 a byte offset into an 'int'; it might overflow.
16764 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16765
16766 * sound.c: Don't assume sizes fit in 'int'.
16767 (struct sound_device.period_size, alsa_period_size):
16768 Return EMACS_INT, not int.
16769 (struct sound_device.write, vox_write, alsa_write):
16770 Accept EMACS_INT, not int.
16771 (wav_play, au_play): Use EMACS_INT to store sizes and to
16772 record read return values.
16773
16774 2011-04-15 Ben Key <bkey76@gmail.com>
16775
16776 * keyboard.c (Qundefined): Don't declare static since it is used
16777 in nsfns.m.
16778 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16779 static since they are used in nsfont.m.
16780
16781 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16782
16783 * process.c (Qprocessp): Don't declare static.
16784 * lisp.h (Qprocessp): Declare again.
16785
16786 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
16787
16788 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16789
16790 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16791
16792 Improve C-level modularity by making more things 'static'.
16793
16794 Don't publish debugger-only interfaces to other modules.
16795 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16796 (verify_bytepos, count_markers): Move decls to the only modules
16797 that need them.
16798 * region-cache.h (pp_cache): Likewise.
16799 * window.h (check_all_windows): Likewise.
16800 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16801
16802 * sysdep.c (croak): Now static, if
16803 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16804 * syssignal.h (croak): Declare only if not static.
16805
16806 * alloc.c (refill_memory_reserve): Now static if
16807 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16808 * lisp.h (refill_memory_reserve): Declare only if not static.
16809
16810 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16811 Define only if USE_LUCID.
16812
16813 * xrdb.c (x_customization_string, x_rm_string): Now static.
16814
16815 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16816 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16817
16818 * xdisp.c (draw_row_with_mouse_face): Now static.
16819 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16820
16821 * window.h (check_all_windows): Mark externally visible.
16822
16823 * window.c (window_deletion_count): Now static.
16824
16825 * undo.c: Make symbols static if they're not exported.
16826 (last_undo_buffer, last_boundary_position, pending_boundary):
16827 Now static.
16828
16829 * textprop.c (interval_insert_behind_hooks): Now static.
16830 (interval_insert_in_front_hooks): Likewise.
16831
16832 * term.c: Make symbols static if they're not exported.
16833 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16834 (max_frame_lines, tty_set_terminal_modes):
16835 (tty_reset_terminal_modes, tty_turn_off_highlight):
16836 (get_tty_terminal): Now static.
16837 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16838 * termhooks.h (term_mouse_moveto): Do not declare if
16839 HAVE_WINDOW_SYSTEM.
16840 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16841 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16842
16843 * sysdep.c: Make symbols static if they're not exported.
16844 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16845 Now static.
16846 (sigprocmask_set, full_mask): Remove; unused.
16847 (wait_debugging): Mark as visible.
16848 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16849 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16850
16851 * syntax.c (syntax_temp): Define only if !__GNUC__.
16852
16853 * sound.c (current_sound_device, current_sound): Now static.
16854
16855 * search.c (searchbufs, searchbuf_head): Now static.
16856
16857 * scroll.c (scroll_cost): Remove; unused.
16858 * dispextern.h (scroll_cost): Remove decl.
16859
16860 * region-cache.h (pp_cache): Mark as externally visible.
16861
16862 * process.c: Make symbols static if they're not exported.
16863 (process_tick, update_tick, create_process, chan_process):
16864 (Vprocess_alist, proc_buffered_char, datagram_access):
16865 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16866 (deactivate_process): Mark defn as static, as well as decl.
16867 * lisp.h (create_process): Remove decl.
16868 * process.h (chan_process, Vprocess_alist): Remove decls.
16869
16870 * print.c: Make symbols static if they're not exported.
16871 (print_depth, new_backquote_output, being_printed, print_buffer):
16872 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16873 (print_interval, print_number_index, initial_stderr_stream):
16874 Now static.
16875 * lisp.h (Fprinc): Remove decl.
16876 (debug_output_compilation_hack): Mark as externally visible.
16877
16878 * sysdep.c (croak): Move decl from here to syssignal.h.
16879 * syssignal.h (croak): Put it here, so the API can be checked when
16880 'croak' is called from dissociate_if_controlling_tty.
16881
16882 * minibuf.c: Make symbols static if they're not exported.
16883 (minibuf_save_list, choose_minibuf_frame): Now static.
16884 * lisp.h (choose_minibuf_frame): Remove decl.
16885
16886 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16887
16888 * lread.c: Make symbols static if they're not exported.
16889 (read_objects, initial_obarray, oblookup_last_bucket_number):
16890 Now static.
16891 (make_symbol): Remove; unused.
16892 * lisp.h (initial_obarray, make_symbol): Remove decls.
16893
16894 * keyboard.c: Make symbols static if they're not exported.
16895 (single_kboard, recent_keys_index, total_keys, recent_keys):
16896 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16897 (this_single_command_key_start, echoing, last_auto_save):
16898 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16899 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16900 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16901 (Vlispy_mouse_stem, double_click_count):
16902 Now static.
16903 (force_auto_save_soon): Define only if SIGDANGER.
16904 (ignore_mouse_drag_p): Now static if
16905 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16906 (print_help): Remove; unused.
16907 (stop_character, last_timer_event): Mark as externally visible.
16908 * keyboard.h (ignore_mouse_drag_p): Declare only if
16909 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16910 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16911 * lisp.h (echoing): Remove decl.
16912 (force_auto_save_soon): Declare only if SIGDANGER.
16913 * xdisp.c (redisplay_window): Simplify code, to make it more
16914 obvious that ignore_mouse_drag_p is not accessed if !defined
16915 USE_GTK && !defined HAVE_NS.
16916
16917 * intervals.c: Make symbols static if they're not exported.
16918 (merge_properties_sticky, merge_interval_right, delete_interval):
16919 Now static.
16920 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16921
16922 * insdel.c: Make symbols static if they're not exported.
16923 However, leave prepare_to_modify_buffer alone. It's never
16924 called from outside this function, but that appears to be a bug.
16925 (combine_after_change_list, combine_after_change_buffer):
16926 (adjust_after_replace, signal_before_change): Now static.
16927 (adjust_after_replace_noundo): Remove; unused.
16928 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16929 (signal_before_change): Remove decls.
16930
16931 * indent.c (val_compute_motion, val_vmotion): Now static.
16932
16933 * image.c: Make symbols static if they're not exported.
16934 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16935 if USE_GTK.
16936 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16937 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16938
16939 * fringe.c (standard_bitmaps): Now static.
16940 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16941
16942 * frame.c: Make symbols static if they're not exported.
16943 (x_report_frame_params, make_terminal_frame): Now static.
16944 (get_frame_param): Now static, unless HAVE_NS.
16945 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16946 (x_get_resource_string): Remove; not used.
16947 * frame.h (make_terminal_frame, x_report_frame_params):
16948 (x_get_resource_string); Remove decls.
16949 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16950 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16951
16952 * font.c, fontset.c: Make symbols static if they're not exported.
16953 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16954 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16955 * font.c (font_close_object): Now static.
16956 * font.h (font_close_object): Remove.
16957 * fontset.c (FONTSET_OBJLIST): Remove.
16958 (free_realized_fontset) #if-0 the body, which does nothing.
16959 (face_suitable_for_char_p): #if-0, as it's never called.
16960 * fontset.h (face_suitable_for_char_p): Remove decl.
16961 * xfaces.c (face_at_string_position):
16962 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16963 since 0 is always ASCII.
16964
16965 * fns.c (weak_hash_tables): Now static.
16966
16967 * fileio.c: Make symbols static if they're not exported.
16968 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16969 (Vwrite_region_annotation_buffers): Now static.
16970
16971 * eval.c: Make symbols static if they're not exported.
16972 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16973 * lisp.h (backtrace_list): Remove decl.
16974
16975 * emacs.c: Make symbols static if they're not exported.
16976 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16977 (fatal_error_code, fatal_error_signal_hook, standard_args):
16978 Now static.
16979 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16980 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16981 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16982 * lisp.h (fatal_error_signal_hook): Remove decl.
16983 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16984
16985 * editfns.c: Move a (normally-unused) function to its only use.
16986 * editfns.c, lisp.h (get_operating_system_release): Remove.
16987 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16988 worth the hassle of breaking this out.
16989
16990 * xterm.c: Make symbols static if they're not exported.
16991 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16992 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16993 (x_destroy_window, x_delete_display):
16994 Now static.
16995 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16996 (x_mouse_leave): Remove; unused.
16997 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16998 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16999 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17000 Remove decls.
17001 (x_mouse_leave): Declare only if WINDOWSNT.
17002 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17003 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17004 USE_X_TOOLKIT.
17005
17006 * ftxfont.c: Make symbols static if they're not exported.
17007 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17008 HAVE_FREETYPE.
17009 * font.h (ftxfont_driver): Likewise.
17010
17011 * xfns.c: Make symbols static if they're not exported.
17012 (x_last_font_name, x_display_info_for_name):
17013 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17014 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17015 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17016 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17017 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17018 (last_show_tip_args): Now static.
17019 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17020 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17021 (x_screen_planes): Remove; unused.
17022 * dispextern.h (x_screen_planes): Remove decl.
17023
17024 * dispnew.c: Make symbols static if they're not exported.
17025 * dispextern.h (redraw_garbaged_frames, scrolling):
17026 (increment_row_positions): Remove.
17027 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17028 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17029 Now static.
17030 (redraw_garbaged_frames): Remove; unused.
17031
17032 * xfaces.c: Make symbols static if they're not exported.
17033 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17034 Remove decls.
17035 * xterm.h (defined_color): Remove decls.
17036 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17037 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17038 (menu_face_changed_default, defined_color, free_realized_face):
17039 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17040 (ascii_face_of_lisp_face): Remove; unused.
17041
17042 * xdisp.c: Make symbols static if they're not exported.
17043 * dispextern.h (scratch_glyph_row, window_box_edges):
17044 (glyph_to_pixel_coords, set_cursor_from_row):
17045 (get_next_display_element, set_iterator_to_next):
17046 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17047 (show_mouse_face): Remove decls
17048 * frame.h (message_buf_print): Likewise.
17049 * lisp.h (pop_message, set_message, check_point_in_composition):
17050 Likewise.
17051 * xterm.h (set_vertical_scroll_bar): Likewise.
17052 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17053 (message_buf_print, scratch_glyph_row, displayed_buffer):
17054 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17055 (get_next_display_element, show_mouse_face, window_box_edges):
17056 (frame_to_window_pixel_xy, check_point_in_composition):
17057 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17058 (glyph_to_pixel_coords): Remove; unused.
17059
17060 * dired.c (file_name_completion): Now static.
17061
17062 * dbusbind.c (xd_in_read_queued_messages): Now static.
17063
17064 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17065 * data.c (circular_list_error): Remove.
17066
17067 * commands.h (last_point_position, last_point_position_buffer):
17068 (last_point_position_window): Remove decls.
17069 * keyboard.c: Make these variables static.
17070
17071 * coding.h (coding, code_convert_region, encode_coding_gap):
17072 Remove decls.
17073 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17074 (iso_code_class, detect_coding, code_convert_region): Now static.
17075 (encode_coding_gap): Remove; unused.
17076
17077 * chartab.c (chartab_chars, chartab_bits): Now static.
17078
17079 * charset.h (charset_iso_8859_1): Remove decl.
17080 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17081 Now static.
17082
17083 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17084 * ccl.c (Vccl_program_table): Now static.
17085 (check_ccl_update): Remove; unused.
17086
17087 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17088 * category.h: ... from here.
17089 * category.c (check_category_table, set_category_set): Now static.
17090
17091 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17092 * lisp.h: Remove these decls.
17093
17094 * buffer.c (buffer_count): Remove unused var.
17095
17096 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17097 so that it's not optimized away.
17098 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17099 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17100 exported only to the debugger.
17101
17102 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17103 * atimer.h (run_all_atimers): Remove; not exported.
17104
17105 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17106 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17107 was inaccessible from Lisp.
17108 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17109 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17110
17111 alloc.c: Import and export fewer symbols, and remove unused items.
17112 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17113 is defined.
17114 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17115 it's not optimized away by whole-program optimization.
17116 (message_enable_multibyte, free_misc): Remove.
17117 (catchlist, handlerlist, mark_backtrace):
17118 Declare only if BYTE_MARK_STACK.
17119 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17120 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17121 (message_enable_multibyte): Remove decl.
17122 (free_misc, interval_free_list, float_block, float_block_index):
17123 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17124 (cons_free_list, last_marked_index):
17125 Now static.
17126 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17127 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17128 (mark_backtrace): Define only if BYTE_MARK_STACK.
17129 * xdisp.c (message_enable_multibyte): Now static.
17130
17131 Declare Lisp_Object Q* variables to be 'static' if not exported.
17132 This makes it easier for human readers (and static analyzers)
17133 to see whether these variables are used from other modules.
17134 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17135 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17136 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17137 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17138 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17139 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17140 * xmenu.c, xselect.c:
17141 Declare Q* vars static if they are not used in other modules.
17142 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17143 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17144 Remove decls of unexported vars.
17145 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17146
17147 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17148
17149 Make Emacs functions such as Fatom 'static' by default.
17150 This makes it easier for human readers (and static analyzers)
17151 to see whether these functions can be called from other modules.
17152 DEFUN now defines a static function. To make the function external
17153 so that it can be used in other C modules, use the new macro DEFUE.
17154 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17155 (Finit_image_library):
17156 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17157 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17158 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17159 Remove decls, since these functions are now static.
17160 (Funintern, Fget_internal_run_time): New decls, since these functions
17161 were already external.
17162
17163 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17164 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17165 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17166 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17167 * keyboard.c, keymap.c, lread.c:
17168 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17169 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17170 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17171 Mark functions with DEFUE instead of DEFUN,
17172 if they are used in other modules.
17173 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17174 decls for now-static functions.
17175 * buffer.h (Fdelete_overlay): Remove decl.
17176 * callproc.c (Fgetenv_internal): Mark as internal.
17177 * composite.c (Fremove_list_of_text_properties): Remove decl.
17178 (Fcomposition_get_gstring): New forward static decl.
17179 * composite.h (Fcomposite_get_gstring): Remove decl.
17180 * dired.c (Ffile_attributes): New forward static decl.
17181 * doc.c (Fdocumntation_property): New forward static decl.
17182 * eval.c (Ffetch_bytecode): New forward static decl.
17183 (Funintern): Remove extern decl; now in .h file where it belongs.
17184 * fileio.c (Fmake_symbolic_link): New forward static decl.
17185 * image.c (Finit_image_library): New forward static decl.
17186 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17187 * intervals.h (Fprevious_property_change):
17188 (Fremove_list_of_text_properties): Remove decls.
17189 * keyboard.c (Fthis_command_keys): Remove decl.
17190 (Fcommand_execute): New forward static decl.
17191 * keymap.c (Flookup_key): New forward static decl.
17192 (Fcopy_keymap): Now static.
17193 * keymap.h (Flookup_key): Remove decl.
17194 * process.c (Fget_process): New forward static decl.
17195 (Fprocess_datagram_address): Mark as internal.
17196 * syntax.c (Fsyntax_table_p): New forward static decl.
17197 (skip_chars): Remove duplicate decl.
17198 * textprop.c (Fprevious_property_change): New forward static decl.
17199 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17200 Now internal.
17201 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17202 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17203
17204 * editfns.c (Fformat): Remove unreachable code.
17205
17206 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17207
17208 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17209 change. (Bug#8496)
17210
17211 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17212
17213 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17214 when at ZV. (Bug#8487)
17215
17216 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17217
17218 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17219 (Bug#8437)
17220 * keyboard.c (parse_tool_bar_item): Likewise.
17221 * sound.c (sound_cleanup, alsa_close): Likewise.
17222 * termcap.c (tgetent): Likewise.
17223 * xfns.c (x_default_font_parameter): Likewise.
17224 * xsettings.c (read_and_apply_settings): Likewise.
17225
17226 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17227 (overrun_check_free): Protoize.
17228
17229 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17230
17231 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17232 since callers should never pass a negative size.
17233 Change the signature to match that of plain 'read' and 'write'; see
17234 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17235 * lisp.h: Update prototypes of emacs_write and emacs_read.
17236
17237 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17238
17239 * xdisp.c (redisplay_window): Don't try to determine the character
17240 position of the scroll margin if the window start point w->startp
17241 is outside the buffer's accessible region. (Bug#8468)
17242
17243 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17244
17245 Fix write-region and its subroutines for buffers > 2GB.
17246 * fileio.c (a_write, e_write): Modify declaration of arguments and
17247 local variables to support buffers larger than 2GB.
17248 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17249
17250 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17251 argument, local variables, and return value.
17252
17253 * lisp.h: Update prototypes of emacs_write and emacs_read.
17254
17255 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17256
17257 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17258
17259 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17260
17261 Fix more problems found by GCC 4.6.0's static checks.
17262
17263 * xdisp.c (vmessage): Use a better test for character truncation.
17264
17265 * charset.c (load_charset_map): <, not <=, for optimization,
17266 and to avoid potential problems with integer overflow.
17267 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17268 * casetab.c (set_identity, shuffle): Likewise.
17269 * editfns.c (Fformat): Likewise.
17270 * syntax.c (skip_chars): Likewise.
17271
17272 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17273 This also lets GCC 4.6.0 generate slightly better loop code.
17274
17275 * callint.c (Fcall_interactively): <, not <=, for optimization.
17276 (Fcall_interactively): Count the number of arguments produced,
17277 not the number of arguments given. This is simpler and lets GCC
17278 4.6.0 generate slightly better code.
17279
17280 * ftfont.c: Distingish more carefully between FcChar8 and char.
17281 The previous code passed unsigned char * to a functions like
17282 strlen and xstrcasecmp that expect char *, which does not
17283 conform to the C standard.
17284 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17285 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17286 char * when the C standard requires it.
17287
17288 * keyboard.c (read_char): Remove unused var.
17289
17290 * eval.c: Port to Windows vsnprintf (Bug#8435).
17291 Include <limits.h>.
17292 (SIZE_MAX): Define if the headers do not.
17293 (verror): Do not give up if vsnprintf returns a negative count.
17294 Instead, grow the buffer. This ports to Windows vsnprintf, which
17295 does not conform to C99. Problem reported by Eli Zaretskii.
17296 Also, simplify the allocation scheme, by avoiding the need for
17297 calling realloc, and removing the ALLOCATED variable.
17298
17299 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17300
17301 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17302 But keep the doprint source code for now, as we might revamp it
17303 and use it again (Bug#8435).
17304 * lisp.h (doprnt): Remove.
17305 * Makefile.in (base_obj): Remove doprnt.o.
17306 * deps.mk (doprnt.o): Remove.
17307
17308 error: Print 32- and 64-bit integers portably (Bug#8435).
17309 Without this change, on typical 64-bit hosts error ("...%d...", N)
17310 was used to print both 32- and 64-bit integers N, which relied on
17311 undefined behavior.
17312 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17313 * lisp.h (error, verror): Mark as printf-like functions.
17314 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17315 Report overflow in size calculations when allocating printf buffer.
17316 Do not truncate output string at its first null byte.
17317 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17318 Truncate the output at a character boundary, since vsnprintf does not
17319 do that.
17320 * charset.c (check_iso_charset_parameter): Convert internal
17321 character to string before calling 'error', since %c now has the
17322 printf meaning.
17323 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17324 overflow when computing char to be passed to 'error'. Do not
17325 pass Lisp_Object to 'error'; pass the integer instead.
17326 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17327 formatted with plain %d.
17328
17329 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17330
17331 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17332
17333 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17334
17335 * xterm.c (x_catch_errors): Remove duplicate declaration.
17336
17337 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17338
17339 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17340
17341 2011-04-10 Jim Meyering <meyering@redhat.com>
17342
17343 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17344 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17345 return ssize_t not "int", and use size_t as the buffer length.
17346 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17347 * gnutls.h: Update declarations.
17348 * process.c (read_process_output): Use ssize_t, to match.
17349 (send_process): Likewise.
17350
17351 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17352
17353 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17354
17355 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17356
17357 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17358 Use unsigned char, to match FcChar8 type definition.
17359
17360 * xterm.c (handle_one_xevent):
17361 * xmenu.c (create_and_show_popup_menu):
17362 * xselect.c (x_decline_selection_request)
17363 (x_reply_selection_request): Avoid type-punned deref of X events.
17364
17365 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17366
17367 Fix some uses of `int' instead of EMACS_INT.
17368 * search.c (string_match_1, fast_string_match)
17369 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17370 (scan_buffer, find_next_newline_no_quit)
17371 (find_before_next_newline, search_command, Freplace_match)
17372 (Fmatch_data): Make some `int' variables be EMACS_INT.
17373
17374 * xdisp.c (display_count_lines): 3rd argument and return value now
17375 EMACS_INT. All callers changed.
17376 (pint2hrstr): Last argument is now EMACS_INT.
17377
17378 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17379 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17380 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17381 (decode_coding_utf_16, decode_coding_emacs_mule)
17382 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17383 (decode_coding_ccl, decode_coding_charset)
17384 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17385 (decode_coding_iso_2022, decode_coding_emacs_mule)
17386 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17387 <char_offset, last_offset>: Declare EMACS_INT.
17388 (encode_coding_utf_8, encode_coding_utf_16)
17389 (encode_coding_emacs_mule, encode_invocation_designation)
17390 (encode_designation_at_bol, encode_coding_iso_2022)
17391 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17392 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17393 Declare EMACS_INT.
17394 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17395 (encode_invocation_designation): Last argument P_NCHARS is now
17396 EMACS_INT.
17397 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17398 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17399
17400 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17401 All users changed.
17402
17403 * ccl.c (Fccl_execute_on_string): Declare some variables
17404 EMACS_INT.
17405
17406 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17407
17408 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17409
17410 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17411
17412 * process.c (Fformat_network_address): Doc fix.
17413
17414 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17415
17416 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17417
17418 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
17419
17420 * keyboard.c (read_char): Call Lisp function help-form-show,
17421 instead of using internal_with_output_to_temp_buffer.
17422 (Qhelp_form_show): New var.
17423 (syms_of_keyboard): Use DEFSYM macro.
17424
17425 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17426
17427 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17428
17429 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
17430
17431 * process.c (Flist_processes): Remove to Lisp.
17432 (list_processes_1): Delete.
17433
17434 2011-04-06 Eli Zaretskii <eliz@gnu.org>
17435
17436 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17437
17438 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17439
17440 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
17441
17442 Fix more problems found by GCC 4.6.0's static checks.
17443
17444 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17445
17446 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17447
17448 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17449
17450 * xdisp.c (vmessage): Mark as a printf-like function.
17451
17452 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17453
17454 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17455
17456 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17457 printf-like functions.
17458 (tiff_load): Add casts to remove these marks before passing them
17459 to system-supplied API.
17460
17461 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17462
17463 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17464 This avoids several warnings with gcc -Wstrict-overflow.
17465 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17466 directly, rather than having caller test rule sign. This avoids
17467 some unnecessary tests.
17468 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17469 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17470 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17471
17472 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17473 (xfont_open): Avoid unnecessary tests.
17474
17475 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17476
17477 * composite.h, composite.c (composition_gstring_put_cache):
17478 Use EMACS_INT, not int, for length.
17479
17480 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17481 breaking out part of COMPOSITION_DECODE_RULE.
17482 (COMPOSITION_DECODE_RULE): Use it.
17483 * composite.c (get_composition_id): Remove unused local vars,
17484 by using the new macro.
17485
17486 * textprop.c (set_text_properties_1): Change while to do-while,
17487 since the condition is always true at first.
17488
17489 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17490 (interval_deletion_adjustment): Return unsigned value.
17491 All uses changed.
17492
17493 * process.c (list_processes_1, create_pty, read_process_output):
17494 (exec_sentinel): Remove vars that were set but not used.
17495 (create_pty): Remove unnecessary "volatile"s.
17496 (Fnetwork_interface_info): Avoid possibility of int overflow.
17497 (read_process_output): Do adaptive read buffering even if carryover.
17498 (read_process_output): Simplify nbytes computation if buffered.
17499
17500 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17501
17502 * syntax.c (scan_words): Remove var that was set but not used.
17503 (update_syntax_table): Use unsigned instead of int.
17504
17505 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17506 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17507 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17508
17509 * print.c (print_error_message): Avoid int overflow.
17510
17511 * font.c (font_list_entities): Redo for clarity,
17512 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17513
17514 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17515 (font_score): Avoid potential overflow in diff calculation.
17516
17517 * fns.c (substring_both): Remove var that is set but not used.
17518 (sxhash): Redo loop for clarity and to avoid wraparound warning.
17519
17520 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17521
17522 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17523 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17524 can always succeed if overflow has undefined behavior.
17525
17526 * search.c (boyer_moore, wordify): Remove vars set but not used.
17527 (wordify): Omit three unnecessary tests.
17528
17529 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17530 All callers changed. This avoids the need for an unused var.
17531
17532 * casefiddle.c (casify_region): Remove var that is set but not used.
17533
17534 * dired.c (file_name_completion): Remove var that is set but not used.
17535
17536 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17537
17538 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17539 (Finsert_file_contents): Remove unnecessary code checking fd.
17540
17541 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17542 Check for integer overflow on size calculations.
17543
17544 * buffer.c (Fprevious_overlay_change): Remove var that is set
17545 but not used.
17546
17547 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17548 Remove vars that are set but not used.
17549 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17550 (timer_check_2): Mark vars as initialized.
17551
17552 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17553
17554 * image.c (lookup_image): Remove var that is set but not used.
17555 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17556
17557 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17558 that are set but not used.
17559
17560 * xfns.c (make_invisible_cursor): Don't return garbage
17561 if XCreateBitmapFromData fails (Bug#8410).
17562
17563 * xselect.c (x_get_local_selection, x_handle_property_notify):
17564 Remove vars that are set but not used.
17565
17566 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17567 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17568
17569 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17570 Remove var that is set but not used.
17571 (scroll_bar_windows_size): Now size_t, not int.
17572 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17573 Check for overflow.
17574
17575 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17576 (map_tty_color) [!defined MSDOS]: Likewise.
17577
17578 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17579
17580 * coding.c: Remove vars that are set but not used.
17581 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17582 All callers changed.
17583 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17584 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17585 (decode_coding_charset): Remove vars that are set but not used.
17586
17587 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17588 that is set but not used.
17589
17590 * print.c (print_object): Remove var that is set but not used.
17591
17592 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17593 The gnulib version avoids calling malloc in the usual case,
17594 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17595 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17596 * filelock.c (current_lock_owner): Likewise.
17597 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17598 * sysdep.c: Include allocator.h, careadlinkat.h.
17599 (emacs_no_realloc_allocator): New static constant.
17600 (emacs_readlink): New function.
17601 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17602 ../lib/careadlinkat.h.
17603
17604 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17605
17606 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17607 first non-nil return value).
17608
17609 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17610
17611 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17612 if not defined (Bug#8403).
17613
17614 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17615
17616 * xdisp.c (display_count_lines): Remove parameter `start',
17617 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17618 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17619 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17620 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17621 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17622 and thereabouts. All callers changed.
17623 (get_per_char_metric): Remove parameter `f', unused since
17624 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17625
17626 2011-04-02 Jim Meyering <meyering@redhat.com>
17627
17628 do not dereference NULL upon failed strdup
17629 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17630 (ns_get_family): Likewise.
17631
17632 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17633
17634 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17635
17636 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17637
17638 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17639 later (Bug#8403).
17640
17641 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17642
17643 Add lexical binding.
17644
17645 * window.c (Ftemp_output_buffer_show): New fun.
17646 (Fsave_window_excursion):
17647 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17648
17649 * lread.c (lisp_file_lexically_bound_p): New function.
17650 (Fload): Bind Qlexical_binding.
17651 (readevalloop): Remove `evalfun' arg.
17652 Bind Qinternal_interpreter_environment.
17653 (Feval_buffer): Bind Qlexical_binding.
17654 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17655 Mark as dynamic.
17656 (syms_of_lread): Declare `lexical-binding'.
17657
17658 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17659
17660 * keyboard.c (eval_dyn): New fun.
17661 (menu_item_eval_property): Use it.
17662
17663 * image.c (parse_image_spec): Use Ffunctionp.
17664
17665 * fns.c (concat, mapcar1): Accept byte-code-functions.
17666
17667 * eval.c (Fsetq): Handle lexical vars.
17668 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17669 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17670 (FletX, Flet): Obey lexical binding.
17671 (Fcommandp): Handle closures.
17672 (Feval): New `lexical' arg.
17673 (eval_sub): New function extracted from Feval. Use it almost
17674 everywhere where Feval was used. Look up vars in lexical env.
17675 Handle closures.
17676 (Ffunctionp): Move from subr.el.
17677 (Ffuncall): Handle closures.
17678 (apply_lambda): Remove `eval_flags'.
17679 (funcall_lambda): Handle closures and new byte-code-functions.
17680 (Fspecial_variable_p): New function.
17681 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17682 but without exporting it to Lisp.
17683
17684 * doc.c (Fdocumentation, store_function_docstring):
17685 * data.c (Finteractive_form): Handle closures.
17686
17687 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17688 interactive spec.
17689
17690 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17691 New byte-codes.
17692 (exec_byte_code): New function extracted from Fbyte_code to handle new
17693 calling convention for byte-code-functions. Add new byte-codes.
17694
17695 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17696
17697 * alloc.c (Fmake_symbol): Init new `declared_special' field.
17698
17699 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17700
17701 * xdisp.c (redisplay_internal): Fix prototype.
17702
17703 2011-03-31 Eli Zaretskii <eliz@gnu.org>
17704
17705 * xdisp.c (SCROLL_LIMIT): New macro.
17706 (try_scrolling): Use it when setting scroll_limit.
17707 Limit scrolling to 100 screen lines.
17708 (redisplay_window): Even when falling back on "recentering",
17709 position point in the window according to scroll-conservatively,
17710 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17711
17712 (try_scrolling): When point is above the window, allow searching
17713 as far as scroll_max, or one screenful, to compute vertical
17714 distance from PT to the scroll margin position. This prevents
17715 try_scrolling from unnecessarily failing when
17716 scroll-conservatively is set to a value slightly larger than the
17717 window height. Clean up the case of PT below the margin at bottom
17718 of window: scroll_max can no longer be INT_MAX. When aggressive
17719 scrolling is in use, don't let point enter the opposite scroll
17720 margin as result of the scroll.
17721 (syms_of_xdisp) <scroll-conservatively>: Document the
17722 threshold of 100 lines for never-recentering scrolling.
17723
17724 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17725
17726 * dispextern.h (move_it_by_lines):
17727 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17728 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17729 (message_log_check_duplicate): Remove parameters `prev_bol' and
17730 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17731 (redisplay_internal): Remove parameter `preserve_echo_area',
17732 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17733
17734 * indent.c (Fvertical_motion):
17735 * window.c (window_scroll_pixel_based, Frecenter):
17736 Don't pass `need_y_p' to `move_it_by_lines'.
17737
17738 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17739
17740 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17741 steal a few bits to be more compact.
17742 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17743 Remove unneeded casts.
17744
17745 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17746
17747 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17748
17749 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17750 binding" message (bug#7967).
17751
17752 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17753
17754 Fix more problems found by GCC 4.6.0's static checks.
17755
17756 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17757 Remove unused local var.
17758
17759 * editfns.c (Fmessage_box): Remove unused local var.
17760
17761 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17762 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17763 Omit unused local vars.
17764 * window.c (shrink_windows): Omit unused local var.
17765 * menu.c (digest_single_submenu): Omit unused local var.
17766 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17767 Omit unused local var.
17768
17769 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17770 Don't assume string length fits in int.
17771 (keyremap_step, read_key_sequence): Use size_t for sizes.
17772 (read_key_sequence): Don't check last_real_key_start redundantly.
17773
17774 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17775 instead of alloca (Bug#8344).
17776
17777 * eval.c (Fbacktrace): Don't assume nargs fits in int.
17778 (Fbacktrace_frame): Don't assume nframes fits in int.
17779
17780 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17781
17782 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17783 concerns.
17784
17785 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17786
17787 * cm.c (calccost): Turn while-do into do-while, for clarity.
17788
17789 * keyboard.c (syms_of_keyboard): Use the same style as later
17790 in this function when indexing through an array. This also
17791 works around GCC bug 48267.
17792
17793 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17794
17795 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17796
17797 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17798 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17799
17800 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17801 This avoids undefined behavior on integer overflow, and is a bit
17802 more convenient anyway since it is compared to a size_t variable.
17803
17804 Variadic C functions now count arguments with size_t, not int.
17805 This avoids an unnecessary limitation on 64-bit machines, which
17806 caused (substring ...) to crash on large vectors (Bug#8344).
17807 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17808 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
17809 All variadic functions and their callers changed accordingly.
17810 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17811 * data.c (arith_driver, float_arith_driver): Likewise.
17812 * editfns.c (general_insert_function): Likewise.
17813 * eval.c (struct backtrace.nargs, interactive_p)
17814 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17815 (funcall_lambda, mark_backtrace): Likewise.
17816 * fns.c (concat): Likewise.
17817 * frame.c (x_set_frame_parameters): Likewise.
17818 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17819 0 if not found, not -1. All callers changed.
17820
17821 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17822 (stack_copy_size): Now size_t, not int.
17823 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17824
17825 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17826
17827 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17828 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17829 All callers changed.
17830
17831 * lisp.h (multibyte_char_to_unibyte):
17832 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17833 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17834 * character.h (CHAR_TO_BYTE8):
17835 * cmds.c (internal_self_insert):
17836 * editfns.c (general_insert_function):
17837 * keymap.c (push_key_description):
17838 * search.c (Freplace_match):
17839 * xdisp.c (message_dolog, set_message_1): All callers changed.
17840
17841 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17842
17843 * keyboard.c (safe_run_hook_funcall): New function.
17844 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17845 don't set the hook to nil, but remove the offending function instead.
17846 (Qcommand_hook_internal): Remove, unused.
17847 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17848 Vcommand_hook_internal.
17849
17850 * eval.c (enum run_hooks_condition): Remove.
17851 (funcall_nil, funcall_not): New functions.
17852 (run_hook_with_args): Call each function through a `funcall' argument.
17853 Remove `cond' argument, now redundant.
17854 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17855 (Frun_hook_with_args_until_failure): Adjust accordingly.
17856 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17857
17858 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17859
17860 * dispextern.h (string_buffer_position): Remove declaration.
17861
17862 * print.c (strout): Remove parameter `multibyte', unused since
17863 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17864
17865 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17866 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17867 All callers changed.
17868
17869 * w32.c (_wsa_errlist): Use braces for struct initializers.
17870
17871 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17872 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17873 All callers changed.
17874 (string_buffer_position): Likewise. Also, make static (it's never
17875 used outside xdisp.c).
17876 (cursor_row_p): Remove parameter `w', unused since
17877 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17878 (decode_mode_spec): Remove parameter `precision', introduced during
17879 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17880 All callers changed.
17881
17882 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17883
17884 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17885
17886 2011-03-27 Anders Lindgren <andlind@gmail.com>
17887
17888 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17889 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17890 (ns_update_auto_hide_menu_bar): New functions.
17891 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17892 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17893 ns_constrain_all_frames.
17894 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17895 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17896
17897 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17898
17899 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17900
17901 2011-03-27 Glenn Morris <rgm@gnu.org>
17902
17903 * syssignal.h: Replace RETSIGTYPE with void.
17904 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17905 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17906 Replace SIGTYPE with void everywhere.
17907 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17908 * s/template.h (SIGTYPE): Remove commented out definition.
17909
17910 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17911
17912 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17913 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17914
17915 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17916
17917 * w32.c (read_unc_volume): Use parameter `henum', instead of
17918 global variable `wget_enum_handle'.
17919
17920 * keymap.c (describe_vector): Remove parameters `indices' and
17921 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17922 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17923
17924 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17925
17926 * keyboard.c (timer_check): Remove parameter `do_it_now',
17927 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17928 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17929 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17930
17931 * keyboard.c (read_char):
17932 * w32menu.c (w32_menu_display_help):
17933 * xmenu.c (show_help_event, menu_help_callback):
17934 Adjust calls to `show_help_echo'.
17935
17936 * gtkutil.c (xg_maybe_add_timer):
17937 * keyboard.c (readable_events):
17938 * process.c (wait_reading_process_output):
17939 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17940
17941 * insdel.c (adjust_markers_gap_motion):
17942 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17943 (gap_left, gap_right): Don't call it.
17944
17945 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17946
17947 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17948 incurred during fontification.
17949
17950 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17951
17952 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17953 (DEFVAR_PER_BUFFER): Don't pass it.
17954
17955 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17956 (scrolling_window): Don't pass it.
17957
17958 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17959
17960 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17961
17962 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17963 and `suffix'.
17964 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17965 of variables specific to SELinux and computation of `encoded_absname'.
17966
17967 * image.c (XPutPixel): Remove unused variable `height'.
17968
17969 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17970
17971 * unexw32.c (get_section_info): Remove unused variable `section'.
17972
17973 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17974 (system_process_attributes): Remove unused variable `sess'.
17975 (sys_read): Remove unused variable `err'.
17976
17977 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17978 (w32_wnd_proc): Remove unused variable `isdead'.
17979 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17980 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17981 (x_create_tip_frame): Remove unused variable `tem'.
17982
17983 * w32inevt.c (w32_console_read_socket):
17984 Remove unused variable `no_events'.
17985
17986 * w32term.c (x_draw_composite_glyph_string_foreground):
17987 Remove unused variable `width'.
17988
17989 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17990
17991 * w32term.c (x_set_glyph_string_clipping):
17992 Don't pass uninitialized region to CombineRgn.
17993
17994 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17995
17996 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17997 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17998 (Fx_close_connection): Remove unused variable `i'.
17999
18000 * w32font.c (w32font_draw): Return number of glyphs.
18001 (w32font_open_internal): Remove unused variable `i'.
18002 (w32font_driver): Add missing initializer.
18003
18004 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18005 (fill_in_menu): Remove unused variable `items_added'.
18006
18007 * w32term.c (last_mouse_press_frame): Remove static global variable.
18008 (w32_clip_to_row): Remove unused variable `f'.
18009 (x_delete_terminal): Remove unused variable `i'.
18010
18011 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18012 (NOTHING): Remove unused static global variable.
18013 (uniscribe_check_otf): Remove unused variable `table'.
18014 (uniscribe_font_driver): Add missing initializers.
18015
18016 2011-03-23 Julien Danjou <julien@danjou.info>
18017
18018 * term.c (Fsuspend_tty, Fresume_tty):
18019 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18020 * window.c (temp_output_buffer_show):
18021 * insdel.c (signal_before_change):
18022 * frame.c (Fhandle_switch_frame):
18023 * fileio.c (Fdo_auto_save):
18024 * emacs.c (Fkill_emacs):
18025 * editfns.c (save_excursion_restore):
18026 * cmds.c (internal_self_insert):
18027 * callint.c (Fcall_interactively):
18028 * buffer.c (Fkill_all_local_variables):
18029 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18030 Use Frun_hooks.
18031 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18032 unconditionally since it does the check itself.
18033
18034 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18035
18036 Fix more problems found by GCC 4.5.2's static checks.
18037
18038 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18039 the first time through the loop, since we know p0 < p1 then.
18040 This also avoids a gcc -Wstrict-overflow warning.
18041
18042 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18043 leading to a memory leak, possible in functions like
18044 load_charset_map_from_file that can allocate an unbounded number
18045 of objects (Bug#8318).
18046
18047 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18048 that could (at least in theory) be that large.
18049
18050 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18051 This is less likely to overflow, and avoids undefined behavior if
18052 overflow does occur. All callers changed. Use strtoul to scan
18053 for the unsigned long integer.
18054 (pint2hrstr): Simplify and tune code slightly.
18055 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18056
18057 * scroll.c (do_scrolling): Work around GCC bug 48228.
18058 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18059
18060 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18061 This also avoids a warning with gcc -Wstrict-overflow.
18062 (validate_x_resource_name): Simplify count usage.
18063 This also avoids a warning with gcc -Wstrict-overflow.
18064
18065 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18066 fail (Bug#8306).
18067
18068 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18069
18070 * process.c (Fmake_network_process): Use socklen_t, not int,
18071 where POSIX says socklen_t is required in portable programs.
18072 This fixes a porting bug on hosts like 64-bit HP-UX, where
18073 socklen_t is wider than int (Bug#8277).
18074 (Fmake_network_process, server_accept_connection):
18075 (wait_reading_process_output, read_process_output):
18076 Likewise.
18077
18078 * process.c: Rename or move locals to avoid shadowing.
18079 (list_processes_1, Fmake_network_process):
18080 (read_process_output_error_handler, exec_sentinel_error_handler):
18081 Rename or move locals.
18082 (Fmake_network_process): Define label "retry_connect" only if needed.
18083 (Fnetwork_interface_info): Fix pointer signedness.
18084 (process_send_signal): Add cast to avoid pointer signedness problem.
18085 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18086 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18087
18088 Make tparam.h and terminfo.c consistent.
18089 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18090 Include tparam.h instead, since it declares them.
18091 * cm.h (PC): Remove extern decl; tparam.h now does this.
18092 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18093 * terminfo.c: Include tparam.h, to check interfaces.
18094 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18095 (tparam): Adjust signature to match interface in tparam.h;
18096 this removes some undefined behavior. Check that outstring and len
18097 are zero, which they always are with Emacs.
18098 * tparam.h (PC, BC, UP): New extern decls.
18099
18100 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18101 (xftfont_open): Rename locals to avoid shadowing.
18102
18103 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18104 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18105 (OTF_TAG_SYM): Omit macro if not needed.
18106 (ftfont_list): Remove unused local.
18107 (get_adstyle_property, ftfont_pattern_entity):
18108 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18109 Rename locals to avoid shadowing.
18110
18111 * xfont.c (xfont_list_family): Mark var as initialized.
18112
18113 * xml.c (make_dom): Now static.
18114
18115 * composite.c (composition_compute_stop_pos): Rename local to
18116 avoid shadowing.
18117 (composition_reseat_it): Remove unused locals.
18118 (find_automatic_composition, composition_adjust_point): Likewise.
18119 (composition_update_it): Mark var as initialized.
18120 (find_automatic_composition): Mark vars as initialized,
18121 with a FIXME (Bug#8290).
18122
18123 character.h: Rename locals to avoid shadowing.
18124 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18125 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18126 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18127 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18128 to avoid shadowing.
18129
18130 * textprop.c (property_change_between_p): Remove; unused.
18131
18132 * intervals.c (interval_start_pos): Now static.
18133
18134 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18135
18136 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18137 Rename locals to avoid shadowing.
18138
18139 * sound.c (wav_play, au_play, Fplay_sound_internal):
18140 Fix pointer signedness.
18141 (alsa_choose_format): Remove unused local var.
18142 (wav_play): Initialize a variable to 0, to prevent undefined
18143 behavior (Bug#8278).
18144
18145 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18146
18147 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18148
18149 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18150 clobbering (Bug#8298).
18151 * sysdep.c (sys_subshell): Likewise.
18152 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18153
18154 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18155 This should get cleaned up, so that child_setup has the
18156 same signature on all platforms.
18157
18158 * callproc.c (call_process_cleanup): Now static.
18159 (relocate_fd): Rename locals to avoid shadowing.
18160
18161 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18162
18163 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18164 not to be necessary, and produces flickering.
18165
18166 2011-03-20 Glenn Morris <rgm@gnu.org>
18167
18168 * config.in: Remove file.
18169
18170 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18171
18172 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18173 are now in src/globals.h.
18174 (syms_of_minibuf): Remove spurious & from previous change.
18175
18176 2011-03-20 Leo Liu <sdl.web@gmail.com>
18177
18178 * minibuf.c (completing-read-function): New variable.
18179 (completing-read-default): Rename from completing-read.
18180 (completing-read): Call completing-read-function.
18181
18182 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18183
18184 * xfaces.c (Fx_load_color_file):
18185 Read color file from absolute filename (bug#8250).
18186
18187 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18188
18189 * makefile.w32-in: Update dependencies.
18190
18191 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18192
18193 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18194
18195 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18196
18197 Fix more problems found by GCC 4.5.2's static checks.
18198
18199 * process.c (make_serial_process_unwind, send_process_trap):
18200 (sigchld_handler): Now static.
18201
18202 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18203 That way, the code declares only the vars that it needs.
18204 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18205 * s/cygwin.h (PTY_ITERATION): Likewise.
18206 * s/darwin.h (PTY_ITERATION): Likewise.
18207 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18208
18209 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18210 * process.c (allocate_pty): Don't declare stb unless it's needed.
18211
18212 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18213 (CONSTANTLIM): Remove; unused.
18214 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18215 Define only if needed.
18216
18217 * unexelf.c (unexec): Name an expression,
18218 to avoid gcc -Wbad-function-cast warning.
18219 Use a different way to cause a compilation error if anyone uses
18220 n rather than nn, a way that does not involve shadowing.
18221 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18222
18223 * deps.mk (unexalpha.o): Remove; unused.
18224
18225 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18226 * unexec.h: New file.
18227 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18228 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18229 Depend on unexec.h.
18230 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18231 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18232 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18233 Change as necessary to match prototype in unexec.h.
18234
18235 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18236 shadowing.
18237 (back_comment, skip_chars): Mark vars as initialized.
18238
18239 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18240 Rename locals to avoid shadowing.
18241
18242 * lread.c (read1): Rewrite so as not to use empty "else".
18243 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18244
18245 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18246
18247 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18248 warning when compiling print.c.
18249
18250 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18251 instead of using an uninitialized var.
18252 (font_sort_entities): Mark var as initialized.
18253
18254 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18255
18256 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18257 pointers to constants.
18258 (font_parse_fcname): Remove unused vars.
18259 (font_delete_unmatched): Now static.
18260 (font_get_spec): Remove; unused.
18261 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18262 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18263 Rename or move locals to avoid shadowing.
18264
18265 * fns.c (require_nesting_list, require_unwind): Now static.
18266 (Ffillarray): Rename locals to avoid shadowing.
18267
18268 * floatfns.c (domain_error2): Define only if needed.
18269 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18270
18271 * alloc.c (mark_backtrace): Move decl from here ...
18272 * lisp.h: ... to here, so that it can be checked.
18273
18274 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18275 (Fdefvar): Rewrite so as not to use empty "else".
18276 (lisp_indirect_variable): Name an expression,
18277 to avoid gcc -Wbad-function-cast warning.
18278 (Fdefvar): Rename locals to avoid shadowing.
18279
18280 * callint.c (quotify_arg, quotify_args): Now static.
18281 (Fcall_interactively): Rename locals to avoid shadowing.
18282 Use const pointer when appropriate.
18283
18284 * lisp.h (get_system_name, get_operating_system_release):
18285 Move decls here, to check interfaces.
18286 * process.c (get_operating_system_release): Move decl to lisp.h.
18287 * xrdb.c (get_system_name): Likewise.
18288 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18289 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18290 some of which prompt warnings from gcc -Wbad-function-cast.
18291 (Fformat_time_string, Fencode_time, Finsert_char):
18292 (Ftranslate_region_internal, Fformat):
18293 Rename or remove local vars to avoid shadowing.
18294 (Ftranslate_region_internal): Mark var as initialized.
18295
18296 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18297 avoid shadowing.
18298
18299 * lisp.h (eassert): Check that the argument compiles, even if
18300 ENABLE_CHECKING is not defined.
18301
18302 * data.c (Findirect_variable): Name an expression, to avoid
18303 gcc -Wbad-function-cast warning.
18304 (default_value, arithcompare, arith_driver, arith_error): Now static.
18305 (store_symval_forwarding): Rename local to avoid shadowing.
18306 (Fmake_variable_buffer_local, Fmake_local_variable):
18307 Mark variables as initialized.
18308 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18309
18310 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18311 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18312 Rename locals to avoid shadowing.
18313 (mark_stack): Move local variables into the #ifdef region where
18314 they're used.
18315 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18316 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18317 needed otherwise.
18318 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18319 (GC_STRING_CHARS): Remove; not used.
18320 (Fmemory_limit): Cast sbrk's returned value to char *.
18321
18322 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18323 avoids undefined behavior in theory.
18324
18325 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18326
18327 Use functions, not macros, for up- and down-casing (Bug#8254).
18328 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18329 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18330 to use the following functions instead of these macros.
18331 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18332 EMACS_INT, since callers assume the returned value fits in int.
18333 (upcase1): Likewise, for UPCASE_TABLE.
18334 (uppercasep, lowercasep, upcase): New static inline functions.
18335 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18336 the race-condition problem in the old DOWNCASE.
18337
18338 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18339 Rename locals to avoid shadowing.
18340 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18341 (regex_compile, re_search_2, re_match_2_internal):
18342 Remove unused local vars.
18343 (FREE_VAR): Rewrite so as not to use empty "else",
18344 which gcc can warn about.
18345 (regex_compile, re_match_2_internal): Mark locals as initialized.
18346 (RETALLOC_IF): Define only if needed.
18347 (WORDCHAR_P): Likewise. This one is never needed, but is used
18348 only in a comment talking about a compiler bug, so put inside
18349 the #if 0 of that comment.
18350 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18351 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18352 Remove; unused.
18353
18354 * search.c (boyer_moore): Rename locals to avoid shadowing.
18355 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18356 (PREV_CHAR_BOUNDARY): Likewise.
18357
18358 * search.c (simple_search): Remove unused var.
18359
18360 * dired.c (compile_pattern): Move decl from here ...
18361 * lisp.h: ... to here, so that it can be checked.
18362 (struct re_registers): New forward decl.
18363
18364 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18365
18366 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18367 All uses changed.
18368 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18369 Rename locals to avoid shadowing.
18370 (Fvertical_motion): Mark locals as initialized.
18371
18372 * casefiddle.c (casify_object, casify_region): Now static.
18373 (casify_region): Mark local as initialized.
18374
18375 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18376
18377 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18378 New macros, so that the caller can use some names other than
18379 gcpro1, gcpro2, etc.
18380 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18381 of the new macros.
18382 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18383 argument, for consistency with GCPRO2_VAR, etc: it is now the
18384 prefix of the variable, not the variable itself. All uses
18385 changed.
18386 * dired.c (directory_files_internal, file_name_completion):
18387 Rename locals to avoid shadowing.
18388
18389 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18390 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18391 dired.c's scmp function, had undefined behavior.
18392 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18393 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18394 * buffer.h: ... to here, because these macros use current_buffer,
18395 and the new implementation with inline functions needs to have
18396 current_buffer in scope now, rather than later when the macros
18397 are used.
18398 (downcase, upcase1): New static inline functions.
18399 (DOWNCASE, UPCASE1): Reimplement using these functions.
18400 This avoids undefined behavior in expressions like
18401 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18402 from race conditions in accessing the global variables
18403 case_temp1 and case_temp2.
18404 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18405 * lisp.h (case_temp1, case_temp2): Remove their decls.
18406 * character.h (ASCII_CHAR_P): Move from here ...
18407 * lisp.h: ... to here, so that the inline functions mentioned
18408 above can use them.
18409
18410 * dired.c (directory_files_internal_unwind): Now static.
18411
18412 * fileio.c (file_name_as_directory, directory_file_name):
18413 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18414 Now static.
18415 (file_name_as_directory): Use const pointers when appropriate.
18416 (Fexpand_file_name): Likewise. In particular, newdir might
18417 point at constant storage, so make it a const pointer.
18418 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18419 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18420 signedness issues.
18421 (Fset_file_times, Finsert_file_contents, auto_save_error):
18422 Rename locals to avoid shadowing.
18423
18424 * minibuf.c (choose_minibuf_frame_1): Now static.
18425 (Ftry_completion, Fall_completions): Rename or remove locals
18426 to avoid shadowing.
18427
18428 * marker.c (bytepos_to_charpos): Remove; unused.
18429
18430 * lisp.h (verify_bytepos, count_markers): New decls,
18431 so that gcc does not warn that these functions aren't declared.
18432
18433 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18434 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18435 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18436 (copy_text): Remove unused local var.
18437
18438 * filelock.c (within_one_second): Now static.
18439 (lock_file_1): Rename local to avoid shadowing.
18440
18441 * buffer.c (fix_overlays_before): Mark locals as initialized.
18442 (fix_start_end_in_overlays): Likewise. This function should be
18443 simplified by using pointers-to-pointers, but that's a different
18444 matter.
18445 (switch_to_buffer_1): Now static.
18446 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18447 (report_overlay_modification): Rename locals to avoid shadowing.
18448
18449 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18450 Fix pointer signedness issue.
18451 (sys_subshell): Mark local as volatile if checking for lint,
18452 to suppress a gcc -Wclobbered warning that does not seem to be right.
18453 (MAXPATHLEN): Define only if needed.
18454
18455 * process.c (serial_open, serial_configure): Move decls from here ...
18456 * systty.h: ... to here, so that they can be checked.
18457
18458 * fns.c (get_random, seed_random): Move extern decls from here ...
18459 * lisp.h: ... to here, so that they can be checked.
18460
18461 * sysdep.c (reset_io): Now static.
18462 (wait_for_termination_signal): Remove; unused.
18463
18464 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18465 (copy_keymap_item, append_key, push_text_char_description):
18466 Now static.
18467 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18468 (DENSE_TABLE_SIZE): Remove; unused.
18469 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18470 (describe_map_tree):
18471 Rename locals to avoid shadowing.
18472
18473 * keyboard.c: Declare functions static if they are not used elsewhere.
18474 (echo_char, echo_dash, cmd_error, top_level_2):
18475 (poll_for_input, handle_async_input): Now static.
18476 (read_char, kbd_buffer_get_event, make_lispy_position):
18477 (make_lispy_event, make_lispy_movement, apply_modifiers):
18478 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18479 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18480 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18481 (read_key_sequence, read_char): Mark locals as initialized.
18482 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18483
18484 * keyboard.h (make_ctrl_char): New decl.
18485 (mark_kboards): Move decl here ...
18486 * alloc.c (mark_kboards): ... from here.
18487
18488 * lisp.h (force_auto_save_soon): New decl.
18489
18490 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18491 (DEFINE_DUMMY_FUNCTION): New macro.
18492 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18493 Use it.
18494 (main): Add casts to avoid warnings
18495 if GCC considers string literals to be constants.
18496
18497 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18498
18499 * dbusbind.c: Pointer signedness fixes.
18500 (xd_signature, xd_append_arg, xd_initialize):
18501 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18502 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18503 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18504 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18505
18506 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18507 if GCC considers string literals to be constants.
18508 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18509
18510 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18511
18512 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18513 (print_preprocess, print_object): New macro to fix last change.
18514
18515 * print.c (print_preprocess): Don't forget font objects.
18516
18517 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
18518
18519 * emacs.c (USAGE3): Doc fixes.
18520
18521 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18522
18523 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18524 structure.
18525
18526 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
18527
18528 * lisp.h (VWindow_system, Qfile_name_history):
18529 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18530 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18531 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18532
18533 * w32select.c: Don't #include "keyboard.h".
18534 (run_protected): Add extern declaration for waiting_for_input.
18535
18536 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18537 * w32console.c (detect_input_pending, read_input_pending)
18538 (encode_terminal_code):
18539 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18540 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18541 (w32_system_caret_y, Qfile_name_history):
18542 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18543 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18544 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18545 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18546 * w32proc.c (Qlocal, report_file_error):
18547 * w32term.c (Vwindow_system, updating_frame):
18548 * w32uniscribe.c (initialized, uniscribe_font_driver):
18549 Remove unneeded extern declarations.
18550
18551 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
18552
18553 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18554
18555 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
18556
18557 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18558 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18559 These macros can no longer be used for assignment.
18560
18561 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18562 Assign struct members directly, instead of using BUF_BEGV etc.
18563 (record_buffer_markers, fetch_buffer_markers): New functions for
18564 recording and fetching special buffer markers.
18565 (set_buffer_internal_1, set_buffer_temp): Use them.
18566
18567 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18568
18569 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18570
18571 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18572 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18573
18574 * xdisp.c (hscroll_window_tree):
18575 (reconsider_clip_changes): Use PT instead of BUF_PT.
18576
18577 2011-03-13 Eli Zaretskii <eliz@gnu.org>
18578
18579 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18580 $(EMACS_ROOT)/lib/intprops.h.
18581
18582 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18583
18584 Fix more problems found by GCC 4.5.2's static checks.
18585
18586 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18587 to unsigned char * to avoid compiler diagnostic.
18588 (xg_free_frame_widgets): Make it clear that a local variable is
18589 needed only if USE_GTK_TOOLTIP.
18590 (gdk_window_get_screen): Make it clear that this macro is needed
18591 only if USE_GTK_TOOLTIP.
18592 (int_gtk_range_get_value): New function, which avoids a diagnostic
18593 from gcc -Wbad-function-cast.
18594 (xg_set_toolkit_scroll_bar_thumb): Use it.
18595 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18596 diagnostic from gcc -Wbad-function-cast.
18597 (get_utf8_string, xg_get_file_with_chooser):
18598 Rename locals to avoid shadowing.
18599 (create_dialog): Move locals to avoid shadowing.
18600
18601 * xgselect.c (xg_select): Remove unused var.
18602
18603 * image.c (four_corners_best): Mark locals as initialized.
18604 (gif_load): Initialize transparent_p to zero (Bug#8238).
18605 Mark another local as initialized.
18606 (my_png_error, my_error_exit): Mark with NO_RETURN.
18607
18608 * image.c (clear_image_cache): Now static.
18609 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18610 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18611 (x_edge_detection): Remove unnecessary cast that
18612 gcc -Wbad-function-cast diagnoses.
18613 (gif_load): Fix pointer signedness.
18614 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18615 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18616
18617 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18618
18619 Improve quality of tests for time stamp overflow.
18620 For example, without this patch (encode-time 0 0 0 1 1
18621 1152921504606846976) returns the obviously-bogus value (-948597
18622 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18623 reports time overflow. See
18624 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18625 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18626 * editfns.c: Include limits.h and intprops.h.
18627 (TIME_T_MIN, TIME_T_MAX): New macros.
18628 (time_overflow): Move earlier, to before first use.
18629 (hi_time, lo_time): New functions, for an accurate test for
18630 out-of-range times.
18631 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18632 (Fget_internal_run_time): Don't assume time_t fits in int.
18633 (make_time): Use list2 instead of Fcons twice.
18634 (Fdecode_time): More accurate test for out-of-range times.
18635 (check_tm_member): New function.
18636 (Fencode_time): Use it, to test for out-of-range times.
18637 (lisp_time_argument): Don't rely on undefined left-shift and
18638 right-shift behavior when checking for time stamp overflow.
18639
18640 * editfns.c (time_overflow): New function, refactoring common code.
18641 (Fformat_time_string, Fdecode_time, Fencode_time):
18642 (Fcurrent_time_string): Use it.
18643
18644 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18645 * dired.c (make_time): Move to ...
18646 * editfns.c (make_time): ... here.
18647 * systime.h: Note the move.
18648
18649 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18650
18651 * fringe.c (update_window_fringes): Remove unused variables.
18652
18653 * unexmacosx.c (copy_data_segment): Also copy __got section.
18654 (Bug#8223)
18655
18656 2011-03-12 Eli Zaretskii <eliz@gnu.org>
18657
18658 * termcap.c [MSDOS]: Include "msdos.h".
18659 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18660 Constify `char *' arguments and their references according to
18661 prototypes in tparam.h.
18662
18663 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18664
18665 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18666 Adapt all references accordingly.
18667
18668 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18669
18670 2011-03-11 Tom Tromey <tromey@redhat.com>
18671
18672 * buffer.c (syms_of_buffer): Remove obsolete comment.
18673
18674 2011-03-11 Eli Zaretskii <eliz@gnu.org>
18675
18676 * termhooks.h (encode_terminal_code): Declare prototype.
18677
18678 * msdos.c (encode_terminal_code): Don't declare prototype.
18679
18680 * term.c (encode_terminal_code): Now external again, used by
18681 w32console.c and msdos.c.
18682
18683 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18684 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18685
18686 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
18687
18688 Fix some minor problems found by GCC 4.5.2's static checks.
18689
18690 * fringe.c (update_window_fringes): Mark locals as initialized
18691 (Bug#8227).
18692 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18693
18694 * alloc.c (mark_fringe_data): Move decl from here ...
18695 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18696 to check its interface.
18697 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18698
18699 * fontset.c (free_realized_fontset): Now static.
18700 (Fset_fontset_font): Rename local to avoid shadowing.
18701 (fontset_font): Mark local as initialized.
18702 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18703
18704 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18705
18706 * xselect.c (x_disown_buffer_selections): Remove; not used.
18707 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18708 (x_own_selection, Fx_disown_selection_internal): Rename locals
18709 to avoid shadowing.
18710 (x_handle_dnd_message): Remove local to avoid shadowing.
18711
18712 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18713 so that the caller can use some name other than gcpro1.
18714 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18715 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18716 (Fx_backspace_delete_keys_p):
18717 Use them to avoid shadowing, and rename vars to avoid shadowing.
18718 (x_decode_color, x_set_name, x_window): Now static.
18719 (Fx_create_frame): Add braces to silence GCC warning.
18720 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18721 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18722 Remove unused locals.
18723 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18724 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18725 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18726 macros.
18727
18728 * xterm.h (x_mouse_leave): New decl.
18729
18730 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18731 Remove unused functions.
18732 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18733 (x_calc_absolute_position): Now static.
18734 (XTread_socket): Don't define label "out" unless it's used.
18735 Don't declare local "event" unless it's used.
18736 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18737 unless they are used.
18738 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18739 (x_fatal_error_signal): Remove; not used.
18740 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18741 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18742 (x_error_catcher, x_connection_closed, x_error_handler):
18743 (x_error_quitter, xembed_send_message, x_iconify_frame):
18744 (my_log_handler): Rename locals to avoid shadowing.
18745 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18746 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18747
18748 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18749 Rename or move locals to avoid shadowing.
18750 (tty_defined_color, merge_face_heights): Now static.
18751 (free_realized_faces_for_fontset): Remove; not used.
18752 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18753 does not deduce is never used uninitialized.
18754 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18755 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18756
18757 * terminal.c (store_terminal_param): Now static.
18758
18759 * xmenu.c (menu_highlight_callback): Now static.
18760 (set_frame_menubar): Remove unused local.
18761 (xmenu_show): Rename parameter to avoid shadowing.
18762 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18763 since they might point to immutable storage.
18764 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18765 since it's unused otherwise.
18766
18767 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18768 Add a FIXME, since the code still doesn't look right. (Bug#8215)
18769 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18770 avoids a gcc -Wuninitialized diagnostic.
18771 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18772 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18773 does not deduce are never used uninitialized.
18774
18775 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18776
18777 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18778 * window.c (window_loop, size_window):
18779 (run_window_configuration_change_hook, enlarge_window): Likewise.
18780
18781 * window.c (display_buffer): Now static.
18782 (size_window): Mark variables that gcc -Wuninitialized
18783 does not deduce are never used uninitialized.
18784 * window.h (check_all_windows): New decl, to forestall
18785 gcc -Wmissing-prototypes diagnostic.
18786 * dispextern.h (bidi_dump_cached_states): Likewise.
18787
18788 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18789 shadowing.
18790 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18791 Include <limits.h>.
18792 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18793 and to avoid gcc -Wuninitialized warning.
18794 (load_charset_map): Mark variables that gcc -Wuninitialized
18795 does not deduce are never used uninitialized.
18796 (load_charset): Abort instead of using uninitialized var (Bug#8229).
18797
18798 * coding.c (coding_set_source, coding_set_destination):
18799 Use "else { /* comment */ }" rather than "else /* comment */;"
18800 for clarity, and to avoid gcc -Wempty-body warning.
18801 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18802 a block, when the outer 'i' will do.
18803 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18804 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18805 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18806 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18807 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18808 Rename locals to avoid shadowing.
18809 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
18810 * coding.c (emacs_mule_char, encode_invocation_designation):
18811 Now static, since they're not used elsewhere.
18812 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
18813 (decode_coding_object, encode_coding_object, detect_coding_system):
18814 (decode_coding_emacs_mule): Mark variables that gcc
18815 -Wuninitialized does not deduce are never used uninitialized.
18816 (detect_coding_iso_2022): Initialize a local variable that might
18817 be used uninitialized. Leave a FIXME because it's not clear that
18818 this initialization is needed. (Bug#8211)
18819 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18820 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18821 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18822 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18823 Remove unused macros.
18824
18825 * category.c (hash_get_category_set): Remove unused local var.
18826 (copy_category_table): Now static, since it's not used elsewhere.
18827 * character.c (string_count_byte8): Likewise.
18828
18829 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18830 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18831
18832 * chartab.c (copy_sub_char_table): Now static, since it's not used
18833 elsewhere.
18834 (sub_char_table_ref_and_range, char_table_ref_and_range):
18835 Rename locals to avoid shadowing.
18836 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
18837
18838 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18839 (BIDI_BOB): Remove unused macro.
18840
18841 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18842 deduce are never used uninitialized.
18843 * term.c (encode_terminal_code): Likewise.
18844
18845 * term.c (encode_terminal_code): Now static. Remove unused local.
18846
18847 * tparam.h: New file.
18848 * term.c, tparam.h: Include it.
18849 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18850 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18851 Move these decls to tparam.h, and make them agree with what
18852 is actually in tparam.c. The previous trick of using incompatible
18853 decls in different modules does not conform to the C standard.
18854 All callers of tparam changed to use tparam's actual API.
18855 * tparam.c (tparam1, tparam, tgoto):
18856 Use const pointers where appropriate.
18857
18858 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18859 * cm.h (struct cm): Likewise.
18860 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18861 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18862 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18863 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18864 (turn_on_face, init_tty): Likewise.
18865 * termchar.h (struct tty_display_info): Likewise.
18866
18867 * term.c (term_mouse_position): Rename local to avoid shadowing.
18868
18869 * alloc.c (mark_ttys): Move decl from here ...
18870 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18871
18872 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18873
18874 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18875
18876 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
18877
18878 * search.c (compile_pattern_1): Remove argument regp, unused since
18879 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18880 (compile_pattern): Don't pass it.
18881
18882 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18883
18884 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18885 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18886 for ! HAVE_GTK3.
18887 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18888
18889 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18890
18891 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18892 gdk_window_get_screen, gdk_window_get_geometry,
18893 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18894 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18895 (xg_get_pixbuf_from_pixmap): New function.
18896 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18897 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18898 Call xg_get_pixbuf_from_pixmap instead of
18899 gdk_pixbuf_get_from_drawable.
18900 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18901 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18902 (xg_check_special_colors): Use GtkStyleContext and its functions
18903 for HAVE_GTK3.
18904 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18905 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18906 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18907 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18908 Call gtk_widget_get_preferred_size.
18909 (xg_frame_resized): gdk_window_get_geometry only takes 5
18910 parameters.
18911 (xg_win_to_widget, xg_event_is_for_menubar):
18912 Call gdk_x11_window_lookup_for_display.
18913 (xg_set_widget_bg): New function.
18914 (delete_cb): New function.
18915 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18916 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18917 (xg_set_background_color): Call xg_set_widget_bg.
18918 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18919 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18920 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18921 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18922 if ! HAVE_GTK3.
18923 (update_frame_tool_bar): Call gtk_widget_hide.
18924 (xg_initialize): Use GDK_KEY_g.
18925
18926 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18927 if ! HAVE_GTK3
18928 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18929
18930 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18931 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18932 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18933
18934 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18935
18936 * w32xfns.c (select_palette): Check success of RealizePalette against
18937 GDI_ERROR, not zero.
18938
18939 See ChangeLog.11 for earlier changes.
18940
18941 ;; Local Variables:
18942 ;; coding: utf-8
18943 ;; End:
18944
18945 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18946
18947 This file is part of GNU Emacs.
18948
18949 GNU Emacs is free software: you can redistribute it and/or modify
18950 it under the terms of the GNU General Public License as published by
18951 the Free Software Foundation, either version 3 of the License, or
18952 (at your option) any later version.
18953
18954 GNU Emacs is distributed in the hope that it will be useful,
18955 but WITHOUT ANY WARRANTY; without even the implied warranty of
18956 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18957 GNU General Public License for more details.
18958
18959 You should have received a copy of the GNU General Public License
18960 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.