]> code.delx.au - gnu-emacs/blob - src/ChangeLog
* w32select.c (waiting_for_input): Declare by including "keyboard.h"
[gnu-emacs] / src / ChangeLog
1 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2
3 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4 instead of having a wrong decl.
5 * nsmenu.m (waiting_for_input): Remove wrong decl.
6
7 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
8
9 keyboard.c, keymap.c: Use bool for booleans.
10 * dispnew.c (sit_for): Distinguish between 3-way display_option
11 and boolean do_display.
12 * keyboard.c (single_kboard, this_command_key_count_reset)
13 (waiting_for_input, echoing, immediate_quit, input_pending)
14 (interrupt_input, interrupts_deferred, pop_kboard)
15 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
16 (command_loop_1, adjust_point_for_property)
17 (safe_run_hooks_error, input_polling_used, read_char):
18 (help_char_p, readable_events, kbd_buffer_events_waiting)
19 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
20 (lucid_event_type_list_p, get_input_pending):
21 (gobble_input, menu_separator_name_p, menu_bar_item)
22 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
23 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
24 (keyremap_step, test_undefined, read_key_sequence)
25 (detect_input_pending, detect_input_pending_ignore_squeezables)
26 (detect_input_pending_run_timers, requeued_events_pending_p)
27 (quit_throw_to_read_char, Fset_input_interrupt_mode):
28 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
29 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
30 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
31 (accessible_keymaps_1, Fkey_description, push_key_description):
32 (shadow_lookup, struct where_is_internal_data)
33 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
34 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
35 (describe_map, describe_vector):
36 * menu.c (single_menu_item):
37 * nsmenu.m (ns_update_menubar):
38 * process.c (wait_reading_process_output):
39 * search.c (scan_buffer, scan_newline):
40 Use bool for boolean.
41 * keyboard.c (timers_run, swallow_events)
42 (detect_input_pending_run_timers):
43 * process.c (wait_reading_process_output):
44 Use unsigned for counter where wraparound-on-overflow is desired,
45 since unsigned is guaranteed to have that behavior and signed is not.
46 (read_char): Use ptrdiff_t for string length.
47 (get_input_pending): Remove first argument, since it was always
48 the same pointer-to-int (now pointer-to-boolean) &input_pending,
49 and behave as if it had that value. Return new value of
50 input_pending. All callers changed.
51 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
52 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
53 a string length.
54 * keymap.c (push_key_description): Omit last arg, which was always 1.
55 All callers changed.
56
57 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
58
59 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
60
61 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
62 ($(BLD)/term.$(O)): Update dependencies.
63
64 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
65
66 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
67 * lisp.h (enum pvec_type): Adjust comments and omit explicit
68 initializer for PVEC_NORMAL_VECTOR.
69
70 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
71
72 Clean out old termopts cruft.
73 * termopts.h (flow_control, meta_key): Remove unused decls.
74 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
75 Don't include termopts.h.
76
77 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
78
79 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
80
81 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
82
83 * commands.h (immediate_quit): Remove duplicate decl.
84
85 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
86
87 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
88 caching.
89 (nsfont_open): Remove setting of Vfonts_in_cache.
90 (syms_of_nsfont): Remove initialization of Vfonts_in_cache
91
92 2012-10-09 Eli Zaretskii <eliz@gnu.org>
93
94 * w32fns.c (w32_last_error): Change the return value to DWORD, to
95 match what GetLastError returns. Explain why the function is
96 needed.
97
98 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
99 'is_tooltip_frame', to avoid confusion with its global namesake.
100
101 2012-10-08 Daniel Colascione <dancol@dancol.org>
102
103 * xdisp.c (start_hourglass): Call w32_note_current_window when
104 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
105 build that caused Emacs to display the hourglass cursor forever.
106
107 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
108 which is broken under remote desktop, calculate the number of
109 colors available for a display based on the display's number of
110 planes and number of bits per pixel per plane. (bug#10397).
111
112 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
113
114 * nsfont.m (Vfonts_in_cache): New variable.
115 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
116 are used. Add cached fonts to Vfonts_in_cache.
117 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
118
119 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
120
121 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
122 in nt/config.nt.
123 (FONT_H): Define after FRAME_H.
124 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
125 Update dependencies.
126
127 * w32term.c: Remove leftover declaration of keyboard_codepage.
128
129 2012-10-08 Eli Zaretskii <eliz@gnu.org>
130
131 * makefile.w32-in (FONT_H): Add $(FRAME_H).
132 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
133 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
134 (GLOBAL_SOURCES): Add cygw32.c.
135 ($(BLD)/unexw32.$(O)):
136 ($(BLD)/w32.$(O)):
137 ($(BLD)/w32console.$(O)):
138 ($(BLD)/w32fns.$(O)):
139 ($(BLD)/w32heap.$(O)):
140 ($(BLD)/w32menu.$(O)):
141 ($(BLD)/w32proc.$(O)): Add w32common.h.
142
143 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
144 'const char *'.
145 (x_to_w32_color): Don't modify the argument, modify a copy instead.
146
147 2012-10-08 Daniel Colascione <dancol@dancol.org>
148
149 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
150 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
151 accidental message numbering hole. Change other messages to
152 match.
153
154 * w32select.h (HAVE_W32SELECT): Remove.
155
156 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
157 w32common.h instead of w32heap.h
158
159 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
160 (get_allocation_unit, get_processor_type, get_w32_major_version)
161 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
162 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
163 (OS_NT, os_subtype, cache_system_info): Move declarations to
164 w32common.
165
166 * w32heap.c: Include w32common.h.
167 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
168 (w32_minor_version, w32_build_number, w32_subtype): Remove
169 duplicate definitions.
170
171 * w32fns.c: Include w32common.h; include w32heap.h only in
172 WINDOWSNT.
173
174 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
175 Use `report_file_error' instead of `error' in order to better
176 inform users of what went wrong. Increase NTGUI_UNICODE file
177 dialog box file name length to 32k, the maximum allowed by the NT
178 kernel.
179
180 * w32common.h: New file.
181 (ROUND_UP, ROUND_DOWN, get_page_size)
182 (get_allocation_unit, get_processor_type, get_w32_major_version)
183 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
184 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
185 (OS_NT, os_subtype, cache_system_info): Move here.
186
187 * unexw32.c, unexcw.c: Include w32common.h.
188
189 * emacs.c (main): Use (defined (WINDOWSNT) || defined
190 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
191 to call syms_of_w32select.
192
193 * cygw32.h: Remove obsolete EXFUN declarations.
194
195 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
196
197 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
198 of w32inevt.o from SOME_MACHINE_OBJECTS.
199
200 2012-10-08 Daniel Colascione <dancol@dancol.org>
201
202 * image.c: Permanent fix for JPEG compilation issue --- limit
203 jpeglib `boolean' redefinition to Cygwin builds.
204
205 2012-10-08 Eli Zaretskii <eliz@gnu.org>
206
207 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
208
209 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
210 Cygwin.
211
212 2012-10-08 Daniel Colascione <dancol@dancol.org>
213
214 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
215 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
216 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
217 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
218 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
219 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
220 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
221 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
222 now a supported configuration.
223
224 * Makefile.in: consolidate image variables into LIBIMAGE; add
225 W32_OBJ and W32_LIBS. Compile new files.
226
227 * conf_post.h:
228 (_DebPrint) declare tracing facility for W32 debugging. We need
229 to unify tracing later.
230
231 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
232 unconditional use of W32 Unicode functions. Cygwin runs only on
233 100% Unicode operating systems.
234
235 * cygw32.c: New file. Define Cygwin-specific facilities.
236 (Fcygwin_convert_path_to_windows)
237 (Fcygwin_convert_path_from_windows): New user functions for
238 accessing Cygwin path-munging routines.
239
240 * cygw32.h: New file.
241 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
242 UTF-16LE strings temporarily inside non-Lisp-visible string
243 objects.
244
245 (w32_strerror): Just what it says on the tin.
246
247 * emacs.c: Make the NS fork-then-exec code for daemon-launching
248 also run for Cygwin; both systems have the same problem with using
249 GUI facilities in a forked child. Also call syms_of_cygw32,
250 syms_of_w32select in correct places.
251
252 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
253 needs fork-then-exec for daemon launching.
254
255 * font.h: Include frame.h.
256
257 * image.c: Use the image library cache machinery only when we're
258 compiling for native WINDOWSNT; Cygwin can use shared libraries
259 like any other Unixlike system.
260
261 * keyboard.c: Clarify a comment regarding the input loop.
262
263 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
264 functions directly instead of trying to detect at runtime that our
265 host operating system supports them. We make this change for two
266 reasons: Cygwin lacks support for the multibyte character
267 conversion functions used by the legacy menu code, and Cygwin
268 never needs to rely on non-Unicode APIs.
269
270 * unexw32.c (hinst): Declare extern.
271
272 * w32.c: Change header order;
273 (w32_strerror): Move to w32fns.c because we need it for
274 non-WINDOWSNT builds.
275
276 * w32.h: Add #error macro to make sure we don't include w32.h for
277 Cygwin builds. Remove w32select declarations.
278
279 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
280 w32fns.c. w32console.c is WINDOWSNT-only.
281
282 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
283 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
284 POSIXy alternative.
285 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
286 (w32_major_version, w32_minor_version, w32_build_number)
287 (os_subtype, sound_type): Define here
288 (w32_defined_color): Make color parameter const for consistency
289 with other _defined_color functions.
290 (w32_createwindow): Unconditionally call w32_init_class instead of
291 doing so only when hprevinst is non-NULL. Plumbing hprevinst
292 through the code is complex and unnecessary because class
293 registration is practically free.
294 (w32_name_of_message): New EMACSDEBUG-only function.
295 (Fset_message_beep): Move here
296 (Fx_open_connection): Require that the display name for Windows be
297 "w32" for consistency, emacsclient disambiguation, and maybe, one
298 day, multi-window-system support.
299 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
300 Cygwin files for W32 GUI facilities, since these clearly don't
301 expect Cygwin names.
302 (_DebPrint): Define.
303 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
304 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
305 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
306 (w32_last_error): Remove.
307
308 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
309
310 * w32heap.c (syspage_mask): Declare here.
311 (cache_system_info): Remove.
312
313 * w32inevt.c (faked_key): Define globally, not statically.
314 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
315 (w32_console_toggle_lock_key): Move to w32fns.c.
316
317 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
318
319 * w32proc.c (_DebPrint): Move to w32fns.c.
320 * w32select.c: Include string.h, stdio.h for Cygwin.
321 * w32select.h: New File.
322
323 * w32term.c: Include io.h for non-CYGWIN builds; needed for
324 get_osfhandle.
325 (w32_message_fd): New variable. Under Cygwin, holds the file
326 descriptor the system used to tell us about pending thread
327 messages.
328
329 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
330 that prevented compilation under non-WINDOWSNT systems.
331
332 (w32_initialize): Open /dev/windows and assign it to
333 w32_message_fd. Provide w32 feature.
334
335 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
336 (WM_EMACS_INPUT_READY): add.
337 (prepend_msg, w32_message_fd): Declare globally.
338
339 * w32xfns.c:
340 (keyboard_handle): Use only when WINDOWSNT.
341 (notify_msg_ready): New function. Posts a message to the main
342 thread's message queue under CYGWIN, which wakes up the main
343 thread from select(2) by making the /dev/windows file descriptor
344 ready. Under WINDOWSNT, it sets an event the same way the old
345 code did.
346
347 (post, prepend_msg): Actually call notify_msg_ready instead of
348 setting the input event directly.
349
350 2012-10-07 Eli Zaretskii <eliz@gnu.org>
351
352 * ralloc.c (relinquish): If a heap is ready to be relinquished,
353 but it still has blocs in it, don't return it to the system,
354 instead of aborting. (Bug#12402)
355
356 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
357
358 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
359
360 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
361 MAC_OS_X_VERSION_10_6.
362 (syms_of_nsterm): Remove comment about Panther and above for
363 ns-antialias-text.
364 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
365 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
366 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
367
368 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
369 MAC_OS_X_VERSION_10_4.
370
371 * nsmenu.m (fillWithWidgetValue:): Remove code for <
372 MAC_OS_X_VERSION_10_2.
373
374 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
375
376 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
377 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
378
379 * nsterm.m (ns_in_resize): Remove (Bug#12479).
380 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
381 (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove
382 ns_in_resize check.
383 (ns_clear_frame_area): Remove resize handle code.
384
385 * nsfns.m (ns_in_resize): Remove.
386 (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
387 ns_in_resize check.
388
389 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
390
391 Improve sys_siglist detection.
392 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
393 defined as a macro, as is done in Solaris.
394 (sys_siglist_entries): New macro.
395 (save_strsignal): Use it.
396 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
397 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
398
399 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
400
401 * nsfns.m (Fx_create_frame): Call x_default_parameter with
402 fullscreen/Fullscreen.
403
404 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
405 tobar_height is new.
406
407 * nsterm.m (x_make_frame_visible): Check for fullscreen.
408 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
409 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
410 (windowDidResize:): Check for correct window if old style fullscreen.
411 Capitalize word in comment. Remove incorrect comment.
412 (initFrameFromEmacs:): tbar_height renamed tibar_height.
413 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
414 error in drawing background.
415 (toggleFullScreen:): Remove comment. Rearrange calls.
416 Set toolbar values to zero, save old height in tobar_height.
417 Restore tool bar height when leaving fullscreen.
418 (canBecomeMainWindow): New function.
419
420 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
421
422 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
423
424 2012-10-05 Eli Zaretskii <eliz@gnu.org>
425
426 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
427
428 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
429 that time stamps of directories could also be changed. Don't
430 request the too broad GENERIC_WRITE, only the more restrictive
431 FILE_WRITE_ATTRIBUTES access rights.
432
433 * fileio.c (Fset_file_times): Special-case ignoring errors for
434 directories only on MSDOS, not on MS-Windows.
435
436 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
437
438 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
439
440 2012-10-04 Eli Zaretskii <eliz@gnu.org>
441
442 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
443 see whether CreateFile failed.
444
445 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
446
447 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
448 to avoid similar races.
449 * keyboard.c (pending_signals): Now bool, not int.
450
451 Port timers to OpenBSD, plus check for timer failures.
452 OpenBSD problem reported by Han Boetes.
453 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
454 and/or setitimer.
455 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
456 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
457 like OpenBSD, which has timer_settime but does not declare it.
458 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
459 whether to use itimerspec-related primitives. All uses of
460 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
461
462 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
463
464 * profiler.c (handle_profiler_signal): Fix a malloc race
465 that caused Emacs to hang on Fedora 17 when profiling Lisp.
466
467 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
468
469 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
470
471 2012-10-02 Eli Zaretskii <eliz@gnu.org>
472
473 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
474 consistent with the change in return value of 'safe_strsignal'.
475
476 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
477
478 Prefer plain 'static' to 'static inline' (Bug#12541).
479 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
480 (bidi_set_sor_type, bidi_push_embedding_level)
481 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
482 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
483 (bidi_cache_search, bidi_cache_ensure_space)
484 (bidi_cache_iterator_state, bidi_cache_find)
485 (bidi_peek_at_next_level, bidi_set_paragraph_end)
486 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
487 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
488 Now 'static', not 'static inline'.
489
490 Count overruns when profiling; change units to ns.
491 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
492 Give extra weight to samples after overruns, to attempt to count
493 the time more accurately.
494 (setup_cpu_timer): Change sampling interval units from ms to ns, since
495 the underlying primitives nominally do ns.
496 (Fprofiler_cpu_start): Document the change. Mention that
497 the sampling intervals are only approximate.
498
499 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
500
501 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
502
503 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
504 case for the special 0 coding-system.
505
506 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
507 (Fmake_overlay): Remove redundant tests.
508 (fix_start_end_in_overlays): Remove redundant recentering.
509
510 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
511
512 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
513 Update dependencies.
514
515 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
516
517 Fix a malloc race condition involving strsignal.
518 A signal can arrive in the middle of a malloc, and Emacs's signal
519 handler can invoke strsignal, which can invoke malloc, which is
520 not portable. This race condition bug makes Emacs hang on GNU/Linux.
521 Fix it by altering the signal handler so that it does not invoke
522 strsignal.
523 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
524 * process.c (status_message): Use const pointer, in case strsignal
525 is #defined to safe_strsignal.
526 * sysdep.c (sys_siglist, init_signals): Always define and
527 initialize a substitute sys_siglist if the system does not define
528 one, even if HAVE_STRSIGNAL.
529 (safe_strsignal): Rename from strsignal. Always define,
530 using sys_siglist. Return a const pointer.
531 * syssignal.h (safe_strsignal): New decl.
532 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
533
534 2012-10-01 Eli Zaretskii <eliz@gnu.org>
535
536 * w32proc.c (timer_loop): Fix code that waits for timer
537 expiration, to avoid high CPU usage.
538
539 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
540
541 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
542 (sweep_weak_table): Remove redundant prototypes.
543
544 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
545
546 * emacs.c: Move the inclusion of TERM_HEADER after including
547 windows.h on WINDOWSNT. This avoids compilation problems with
548 MSVC.
549
550 2012-10-01 Eli Zaretskii <eliz@gnu.org>
551
552 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
553 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
554 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
555 as the previous version used 'void *'.
556
557 * ralloc.c (ROUNDUP): Fix last change.
558 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
559 'size_t'.
560
561 * w32proc.c <disable_itimers>: New static flag.
562 (init_timers): Initialize it to zero, after creating the critical
563 sections used by the timer threads.
564 (term_timers): Set to 1 before deleting the critical sections.
565 (getitimer, setitimer): If disable_itimers is non-zero, return an
566 error indication without doing anything. Reported by Fabrice
567 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
568 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
569 return results.
570 [!HAVE_SETITIMER]: Behave as the previous version that didn't
571 support timers.
572
573 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
574 term_ntproc after all the other bookkeeping, to get timers working
575 as long as possible.
576
577 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
578
579 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
580 Suggested by Juri Linkov in
581 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
582
583 Prefer plain 'static' to 'static inline' (Bug#12541).
584 With static functions, modern compilers inline pretty well by
585 themselves; advice from programmers often hurts as much as it helps.
586 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
587 this change shrinks the text size of the Emacs executable by 1.1%
588 without affecting CPU significantly in my benchmark.
589 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
590 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
591 (mark_maybe_object, mark_maybe_pointer, bounded_number):
592 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
593 (bset_auto_fill_function, bset_auto_save_file_format)
594 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
595 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
596 (bset_cache_long_line_scans, bset_case_fold_search)
597 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
598 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
599 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
600 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
601 (bset_header_line_format, bset_indicate_buffer_boundaries)
602 (bset_indicate_empty_lines, bset_invisibility_spec)
603 (bset_left_fringe_width, bset_major_mode, bset_mark)
604 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
605 (bset_name, bset_overwrite_mode, bset_pt_marker)
606 (bset_right_fringe_width, bset_save_length)
607 (bset_scroll_bar_width, bset_scroll_down_aggressively)
608 (bset_scroll_up_aggressively, bset_selective_display)
609 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
610 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
611 (set_buffer_overlays_after):
612 * category.c (bset_category_table):
613 * charset.c (read_hex):
614 * coding.c (produce_composition, produce_charset)
615 (handle_composition_annotation, handle_charset_annotation)
616 (char_encodable_p):
617 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
618 (assign_row, set_frame_matrix_frame, make_current)
619 (add_row_entry):
620 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
621 * fns.c (maybe_resize_hash_table):
622 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
623 * gmalloc.c (register_heapinfo):
624 * image.c (lookup_image_type):
625 * intervals.c (set_interval_object, set_interval_left)
626 (set_interval_right, copy_interval_parent, rotate_right)
627 (rotate_left, balance_possible_root_interval):
628 * keyboard.c (kset_echo_string, kset_kbd_queue)
629 (kset_keyboard_translate_table, kset_last_prefix_arg)
630 (kset_last_repeatable_command, kset_local_function_key_map)
631 (kset_overriding_terminal_local_map, kset_real_last_command)
632 (kset_system_key_syms, clear_event, set_prop):
633 * lread.c (digit_to_number):
634 * marker.c (attach_marker, live_buffer, set_marker_internal):
635 * nsterm.m (ns_compute_glyph_string_overhangs):
636 * process.c (pset_buffer, pset_command)
637 (pset_decode_coding_system, pset_decoding_buf)
638 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
639 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
640 (pset_status, pset_tty_name, pset_type, pset_write_queue):
641 * syntax.c (bset_syntax_table, dec_bytepos):
642 * terminal.c (tset_param_alist):
643 * textprop.c (interval_has_some_properties)
644 (interval_has_some_properties_list):
645 * window.c (wset_combination_limit, wset_dedicated)
646 (wset_display_table, wset_hchild, wset_left_fringe_width)
647 (wset_left_margin_cols, wset_new_normal, wset_new_total)
648 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
649 (wset_right_fringe_width, wset_right_margin_cols)
650 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
651 (wset_vertical_scroll_bar_type, wset_window_parameters):
652 * xdisp.c (wset_base_line_number, wset_base_line_pos)
653 (wset_column_number_displayed, wset_region_showing)
654 (window_box_edges, run_window_scroll_functions)
655 (append_glyph_string_lists, prepend_glyph_string_lists)
656 (append_glyph_string, set_glyph_string_background_width)
657 (append_glyph, append_composite_glyph)
658 (take_vertical_position_into_account):
659 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
660 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
661 (lface_hash, lface_same_font_attributes_p, lookup_face):
662 * xml.c (libxml2_loaded_p):
663 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
664 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
665 Now 'static', not 'static inline'.
666
667 * bidi.c: Tune.
668 (bidi_copy_it): Do the whole copy with a single memcpy.
669 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
670
671 Revert the FOLLOW-SYMLINKS change for file-attributes.
672 Doing it right would require several changes to Tramp, and there's
673 not enough time to get that tested before the freeze today.
674 * dired.c (directory_files_internal, Ffile_attributes):
675 Undo last change.
676
677 * frame.c (x_report_frame_params): Port better to wider ints.
678 Do not assume that EMACS_UINT is the same width as uprintmax_t,
679 or that pointers can be printed in 15 decimal digits.
680 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
681
682 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
683
684 Support x64 build on MS-Windows.
685 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
686 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
687 compatibility with x64.
688 (x_get_focus_frame): Add prototype.
689
690 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
691 defining an XRectangle structure.
692
693 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
694 arithmetics for compatibility with x64.
695
696 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
697 compatibility with x64.
698
699 * w32heap.h: Adjust prototypes and declarations.
700
701 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
702 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
703 DWORD, long, and unsigned long, for compatibility with x64.
704 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
705 (sbrk): Argument is now of type ptrdiff_t.
706
707 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
708 less than 0x0500.
709 (w32_msg_pump): Use WPARAM type for 'result'.
710
711 * w32.c (init_environment, get_emacs_configuration): Support AMD64
712 architecture.
713 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
714 compatibility with x64.
715
716 * vm-limit.c (lim_data): Now size_t.
717 (check_memory_limits): Adjust prototypes of real_morecore and
718 __morecore to receive argument of type ptrdiff_t. Use size_t for
719 five_percent and data_size.
720
721 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
722 variables, for compatibility with x64.
723 (rva_to_section, offset_to_section, relocate_offset)
724 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
725 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
726 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
727 for compatibility with x64.
728
729 * sysdep.c (STDERR_FILENO): Define if not already defined.
730
731 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
732 (__morecore): Argument type is now ptrdiff_t.
733 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
734 (relinquish): Use ptrdiff_t type for 'excess'.
735 (r_alloc_sbrk): Argument type is now ptrdiff_t.
736
737 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
738 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
739 instead of a literal number.
740
741 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
742 (min): Define only if not already defined.
743
744 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
745 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
746 hosts.
747
748 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
749 'bitmaps' is a pointer.
750
751 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
752
753 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
754
755 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
756
757 file-attributes has a new optional arg FOLLOW-SYMLINKS.
758 * dired.c (directory_files_internal, Ffile_attributes):
759 New arg follow_symlinks. All uses changed.
760
761 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
762
763 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
764
765 2012-09-30 Eli Zaretskii <eliz@gnu.org>
766
767 Support atimers and CPU profiler via profile.c on MS-Windows.
768 * w32proc.c (sig_mask, crit_sig): New static variables.
769 (sys_signal): Support SIGALRM and SIGPROF.
770 (sigemptyset, sigaddset, sigfillset, sigprocmask)
771 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
772 sigfillset, and sigprocmask are no longer no-ops.
773 (sigismember): New function.
774 (struct itimer_data): New definition.
775 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
776 (crit_prof): New static variables.
777 (MAX_SINGLE_SLEEP): New definition.
778 (timer_loop, stop_timer_thread, term_timers, init_timers)
779 (start_timer_thread, getitimer, setitimer): New functions.
780 (alarm): No longer a no-op, calls setitimer.
781
782 * w32.c (term_ntproc): Call term_timers.
783 (init_ntproc): Make sure all signals are unblocked at startup, to
784 erase any traces of dumping. Call init_timers.
785
786 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
787 Windows-specific code to display the hourglass mouse pointer is no
788 longer used.
789 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
790 to hourglass timer expiration.
791 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
792 Remove, no longer used.
793 (w32_note_current_window, show_hourglass, hide_hourglass):
794 New functions, in support of hourglass cursor display similar to other
795 window systems.
796 (syms_of_w32fns): Don't initialize hourglass_timer.
797
798 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
799 WINDOWSNT as well.
800 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
801
802 * w32.h (init_timers, term_timers): Add prototypes.
803
804 2012-09-30 Kenichi Handa <handa@gnu.org>
805
806 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
807 to the buffer relocation which may be caused by ccl_driver.
808
809 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
810
811 * xfns.c (Fx_file_dialog): Update comment.
812
813 * w32fns.c (Fx_file_dialog): Update comment.
814
815 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
816 Initialize panel name field if OSX >= 10.6.
817
818 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
819
820 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
821
822 * nsterm.m (NEW_STYLE_FS): New define.
823 (ns_fullscreen_hook, windowWillEnterFullScreen)
824 (windowDidEnterFullScreen, windowWillExitFullScreen)
825 (windowDidExitFullScreen, toggleFullScreen, handleFS)
826 (setFSValue): New functions.
827 (EmacsFSWindow): New implementation.
828 (canBecomeKeyWindow): New function for EmacsFSWindow.
829 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
830 (dealloc): Release nonfs_window if in fullscreen.
831 (updateFrameSize:): Call windowDidMove to update top/left.
832 (windowWillResize:toSize:): Check if frame is still maximized.
833 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
834 next_maximized, maximized_width, maximized_height and nonfs_window.
835 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
836 tbar_height.
837 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
838 fullscreen. Set maximized_width/height. Act on next_maximized.
839
840 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
841 (EmacsView): Add variables for fullscreen.
842 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
843 (EmacsFSWindow): New interface for fullscreen.
844
845 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
846
847 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
848
849 2012-09-30 Chong Yidong <cyd@gnu.org>
850
851 * fns.c (Frandom): Doc fix.
852
853 2012-09-30 Martin Rudalics <rudalics@gmx.at>
854
855 * window.c (Vwindow_combination_limit): New default value.
856 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
857
858 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
859
860 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
861 Suggested by Eli Zaretskii in
862 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
863
864 2012-09-30 Eli Zaretskii <eliz@gnu.org>
865
866 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
867 HAVE_TIMER_SETTIME is defined.
868
869 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
870
871 Profiler improvements: more-accurate timers, overflow checks.
872 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
873 signal.h, setjmp.h. Include systime.h instead.
874 (saturated_add): New function.
875 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
876 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
877 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
878 New static vars.
879 (enum profiler_cpu_running): New enum.
880 (profiler_cpu_running): Now of that enum type, not bool.
881 All uses changed to store the new value.
882 (handle_profiler_signal): Rename from sigprof_handler_1,
883 for consistency with other handlers. Do not check whether
884 cpu_log is a hash-table if garbage collecting, since it
885 doesn't matter in that case.
886 (deliver_profiler_signal): Rename from sigprof_handler,
887 for consistency with other handlers.
888 (setup_cpu_timer): New function, with much of what used to be in
889 Fprofiler_cpu_start. Check for out-of-range argument.
890 Prefer timer_settime if available, and prefer
891 thread cputime clocks, then process cputime clocks, then
892 monotonic clocks, to the old realtime clock. Use make_timeval
893 to round more-correctly when falling back to setitimer.
894 (Fprofiler_cpu_start): Use it.
895 (Fprofiler_cpu_stop): Prefer timer_settime if available.
896 Don't assume that passing NULL as the 2nd argument of setitimer
897 is the same as passing a pointer to all-zero storage.
898 Ignore SIGPROF afterwards.
899 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
900 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
901 non-fatal signal handlers. Ignore SIGPROF on startup.
902 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
903 in profiler.c, since sysdep.c now uses it.
904
905 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
906 Suggested by Eli Zaretskii in
907 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
908
909 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
910
911 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
912
913 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
914
915 * lisp.h (struct backtrace): Remove indirection for `function' field.
916 * xdisp.c (redisplay_internal):
917 * profiler.c (record_backtrace, sigprof_handler_1):
918 * alloc.c (Fgarbage_collect):
919 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
920 (Fbacktrace_frame): Adjust accordingly.
921
922 2012-09-28 Glenn Morris <rgm@gnu.org>
923
924 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
925 (Frun_hook_with_args_until_failure): Doc fixes.
926
927 2012-09-28 Eli Zaretskii <eliz@gnu.org>
928
929 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
930 Qautomatic_redisplay and change the symbol name. All users changed.
931
932 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
933
934 * profiler.c (sigprof_handler): Fix race condition.
935
936 2012-09-28 Glenn Morris <rgm@gnu.org>
937
938 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
939
940 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
941
942 Check more robustly for timer_settime.
943 * Makefile.in (LIB_TIMER_TIME): New macro.
944 (LIBES): Add it.
945 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
946 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
947 call timer_settime.
948
949 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
950
951 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
952
953 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
954
955 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
956
957 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
958
959 * character.h (MAYBE_UNIFY_CHAR): Remove.
960 * charset.c, charset.h (maybe_unify_char): Now static.
961 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
962 Since this stuff is now private to charset.c, there's no need for
963 a public macro and no need to inline by hand.
964
965 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
966 Stefan Monnier <monnier@iro.umontreal.ca>
967 Juanma Barranquero <lekktu@gmail.com>
968
969 * profiler.c: New file.
970 * Makefile.in (base_obj): Add profiler.o.
971 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
972 ($(BLD)/profiler.$(O)): New target.
973 * emacs.c (main): Call syms_of_profiler.
974 * alloc.c (Qautomatic_gc): New constant.
975 (MALLOC_PROBE): New macro.
976 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
977 (total_bytes_of_live_objects): New function.
978 (Fgarbage_collect): Use it. Record itself in backtrace_list.
979 Call malloc_probe for the memory profiler.
980 (syms_of_alloc): Define Qautomatic_gc.
981 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
982 race condition.
983 (struct backtrace): Move definition...
984 * lisp.h (struct backtrace): ..here.
985 (Qautomatic_gc, profiler_memory_running): Declare vars.
986 (malloc_probe, syms_of_profiler): Declare functions.
987 * xdisp.c (Qautomatic_redisplay): New constant.
988 (redisplay_internal): Record itself in backtrace_list.
989 (syms_of_xdisp): Define Qautomatic_redisplay.
990
991 2012-09-25 Eli Zaretskii <eliz@gnu.org>
992 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
993
994 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
995
996 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
997
998 Prefer POSIX timers if available.
999 They avoid a race if the timer is too close to the current time.
1000 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1001 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1002 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1003
1004 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1005
1006 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1007 CHAR_STRING_ADVANCE.
1008 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1009 STRING_CHAR_ADVANCE.
1010
1011 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1012
1013 Move Vlibrary_cache to emacs.c and reset before dumping.
1014
1015 * lisp.h (reset_image_types): Declare.
1016 [WINDOWSNT] (Vlibrary_cache): Declare.
1017
1018 * image.c (reset_image_types): New function.
1019
1020 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1021 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1022 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1023
1024 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1025 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1026
1027 * w32.h (Vlibrary_cache): Do not declare.
1028
1029 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1030
1031 * w32proc.c (sys_signal): Handle all signals defined by the
1032 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1033 handlers for signals supported by Windows. Don't override
1034 term_ntproc as the handler for SIGABRT.
1035 (sigaction): Rewrite to call sys_signal instead of duplicating its
1036 code.
1037 (sys_kill): Improve commentary.
1038
1039 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1040 consistency with a signature of a signal handler. All callers
1041 changed.
1042 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1043 install term_ntproc as a signal handler for SIGABRT, as that
1044 should be done by the dumped Emacs.
1045
1046 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1047
1048 * w32select.c (term_w32select): Protect against repeated
1049 invocation by setting clipboard_owner to NULL after calling
1050 DestroyWindow.
1051
1052 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1053 and term_ntproc to their modified signatures.
1054
1055 * character.c (char_string, string_char): Remove calls to
1056 MAYBE_UNIFY_CHAR. See the discussion starting at
1057 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1058 for the details.
1059
1060 2012-09-25 Chong Yidong <cyd@gnu.org>
1061
1062 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1063
1064 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1065
1066 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1067 when encountering an unknown bytecode.
1068
1069 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1070
1071 image.c, indent.c: Use bool for booleans.
1072 * dispextern.h (struct image_type): Members valid_p, load, init
1073 now return bool, not int. All uses changed.
1074 * image.c: Omit unnecessary static decls.
1075 (x_create_bitmap_mask, x_build_heuristic_mask):
1076 Return void, not int, since callers don't care about the return value.
1077 (x_create_bitmap_mask, define_image_type, valid_image_p)
1078 (struct image_keyword, parse_image_spec, image_spec_value)
1079 (check_image_size, image_background)
1080 (image_background_transparent, x_clear_image_1)
1081 (postprocess_image, lookup_image, x_check_image_size)
1082 (x_create_x_image_and_pixmap, xbm_image_p)
1083 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1084 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1085 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1086 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1087 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1088 (png_image_p, init_png_functions, png_load_body, png_load)
1089 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1090 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1091 (init_gif_functions, gif_load, imagemagick_image_p)
1092 (imagemagick_load_image, imagemagick_load, svg_image_p)
1093 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1094 (gs_load):
1095 * nsimage.m (ns_load_image):
1096 * nsterm.m (ns_defined_color):
1097 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1098 * xfns.c (x_defined_color):
1099 * xterm.c (x_alloc_lighter_color_for_widget)
1100 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1101 (x_alloc_lighter_color):
1102 * indent.c (disptab_matches_widthtab, current_column)
1103 (scan_for_column, string_display_width, indented_beyond_p)
1104 (compute_motion, vmotion, Fvertical_motion):
1105 Use bool for booleans.
1106
1107 2012-09-24 Chong Yidong <cyd@gnu.org>
1108
1109 * chartab.c (Fset_char_table_default): Obsolete function removed.
1110
1111 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1112
1113 Move pid_t related decls out of lisp.h.
1114 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1115 (interruptible_wait_for_termination):
1116 Move these decls from lisp.h to syswait.h, since they use pid_t.
1117 Needed on FreeBSD; see Herbert J. Skuhra in
1118 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1119 * callproc.c: Include syswait.h.
1120
1121 gnutls.c, gtkutil.c: Use bool for boolean.
1122 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1123 (emacs_gnutls_handle_error):
1124 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1125 (xg_hide_tooltip, xg_create_frame_widgets)
1126 (create_dialog, xg_uses_old_file_dialog)
1127 (xg_get_file_with_chooser, xg_get_file_with_selection)
1128 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1129 (xg_item_label_same_p, xg_update_menubar)
1130 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1131 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1132 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1133 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1134 (update_frame_tool_bar, free_frame_tool_bar):
1135 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1136 * nsmenu.m (ns_update_menubar):
1137 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1138 * xfns.c (Fx_show_tip) [USE_GTK]:
1139 Use bool for boolean.
1140 * gtkutil.c (xg_update_frame_menubar):
1141 * xmenu.c (update_frame_menubar):
1142 Return void, not int, since caller ignores return value.
1143 * gtkutil.c (xg_change_toolbar_position):
1144 Return void, not 1.
1145
1146 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1147
1148 * makefile.w32-in (BLOCKINPUT_H): Remove.
1149 (SYSSIGNAL_H): New macro.
1150 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1151 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1152 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1153 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1154 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1155 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1156 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1157 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1158 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1159 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1160 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1161 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1162 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1163 ($(BLD)/w32xfns.$(O)): Update dependencies.
1164
1165 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1166
1167 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1168 fatal_error_backtrace.
1169
1170 * w32proc.c (sys_kill): Undo last change: don't do anything when
1171 invoked to deliver SIGABRT to our own process. This is now
1172 handled by emacs_raise.
1173
1174 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1175
1176 * w32term.c (w32_read_socket): Remove leftover reference to
1177 interrupt_input_pending.
1178
1179 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1180
1181 Do not use SA_NODEFER.
1182 Problem reported by Dani Moncayo in
1183 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1184 * alloc.c (die):
1185 * sysdep.c (emacs_abort): Do not reset signal handler.
1186 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1187 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1188 wanted even on POSIXish hosts, and it doesn't work on Windows.
1189
1190 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1191
1192 * xterm.c (x_term_init): Call fixup_locale before and after calling
1193 gtk_init (Bug#12392).
1194
1195 2012-09-23 Chong Yidong <cyd@gnu.org>
1196
1197 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1198 Vdynamic_library_alist.
1199
1200 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1201 (Fgnutls_available_p): Caller changed.
1202
1203 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1204 (Flibxml_parse_xml_region): Likewise.
1205
1206 * dispextern.h (struct image_type): Remove arg from init function.
1207
1208 * image.c (Finit_image_library, lookup_image_type)
1209 (define_image_type): Remove now-unneeded second arg.
1210 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1211 (init_tiff_functions, init_gif_functions, init_svg_functions):
1212 Arglist and w32_delayed_load calling convention changed.
1213 (gs_type): Remove init_gs_functions; there is no such function.
1214 (valid_image_p, make_image): Fix caller to lookup_image_type.
1215
1216 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1217
1218 Simplify and avoid signal-handling races (Bug#12471).
1219 * alloc.c (die):
1220 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1221 Avoid recursive loop if there's a fatal error in the function itself.
1222 * atimer.c (pending_atimers):
1223 * blockinput.h: Don't include "atimer.h"; no longer needed.
1224 (interrupt_input_pending): Remove. All uses removed.
1225 pending_signals now counts both atimers and ordinary interrupts.
1226 This is less racy than having three separate pending-signal flags.
1227 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1228 (input_blocked_p):
1229 Rename from their upper-case counterparts BLOCK_INPUT,
1230 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1231 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1232 This makes it easier to access volatile variables more accurately.
1233 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1234 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1235 that's more reliable if the code is buggy and sets
1236 interrupt_input_blocked to a negative value. All uses changed.
1237 * atimer.c (deliver_alarm_signal):
1238 Remove. No need to deliver this to the parent; any thread can
1239 handle this signal now. All uses replaced by underlying handler.
1240 * atimer.c (turn_on_atimers):
1241 * dispnew.c (handle_window_change_signal):
1242 * emacs.c (handle_danger_signal):
1243 * keyboard.c (kbd_buffer_get_event):
1244 Don't reestablish signal handler; not needed with sigaction.
1245 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1246 (UNBLOCK_INPUT_TO):
1247 Rework to avoid unnecessary accesses to volatile variables.
1248 (UNBLOCK_INPUT_TO): Now a function.
1249 (totally_unblock_input, unblock_input): New decls.
1250 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1251 (init_data): Remove. Necessary stuff now done in init_signal.
1252 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1253 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1254 (fatal_error_code): Remove; no longer needed.
1255 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1256 it doesn't always backtrace. All uses changed. No need to reset
1257 signal to default, since sigaction and/or die does that for us now.
1258 Use emacs_raise (FOO), not kill (getpid (), FOO).
1259 (main): Check more-accurately whether we're dumping.
1260 Move fatal-error setup to sysdep.c
1261 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1262 * gtkutil.c (xg_get_file_name, xg_get_font):
1263 Remove no-longer-needed signal-mask manipulation.
1264 * keyboard.c, process.c (POLL_FOR_INPUT):
1265 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1266 * keyboard.c (read_avail_input): Remove.
1267 All uses replaced by gobble_input.
1268 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1269 (kbd_buffer_store_event_hold, gobble_input):
1270 (record_asynch_buffer_change) [USABLE_SIGIO]:
1271 (store_user_signal_events):
1272 No need to mess with signal mask.
1273 (gobble_input): If blocking input and there are terminals, simply
1274 set pending_signals to 1 and return. All hooks changed to not
1275 worry about whether input is blocked.
1276 (process_pending_signals): Clear pending_signals before processing
1277 them, in case a signal comes in while we're processing.
1278 By convention callers now test pending_signals before calling us.
1279 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1280 New functions, to support changes to blockinput.h.
1281 (handle_input_available_signal): Now extern.
1282 (reinvoke_input_signal): Remove. All uses replaced by
1283 handle_async_input.
1284 (quit_count): Now volatile, since a signal handler uses it.
1285 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1286 All callers changed. Block SIGINT only if not already blocked.
1287 Clear sigmask reliably, even if Fsignal returns, which it can.
1288 Omit unnecessary accesses to volatile var.
1289 (quit_throw_to_read_char): No need to restore sigmask.
1290 * keyboard.c (gobble_input, handle_user_signal):
1291 * process.c (wait_reading_process_output):
1292 Call signal-handling code rather than killing ourselves.
1293 * lisp.h: Include <float.h>, for...
1294 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1295 (pending_signals): Now volatile.
1296 (syms_of_data): Now const if IEEE floating point.
1297 (handle_input_available_signal) [USABLE_SIGIO]:
1298 (terminate_due_to_signal, record_child_status_change): New decls.
1299 * process.c (create_process): Avoid disaster if memory is exhausted
1300 while we're processing a vfork, by tightening the critical section
1301 around the vfork.
1302 (send_process_frame, process_sent_to, handle_pipe_signal)
1303 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1304 ignores SIGPIPE.
1305 (send_process): No need for setjmp/longjmp any more, since the
1306 SIGPIPE stuff is now gone. Instead, report an error if errno
1307 is EPIPE.
1308 (record_child_status_change): Now extern. PID and W are now args.
1309 Return void, not bool. All callers changed.
1310 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1311 Remove. All uses removed. This bug should be fixed now in a
1312 different way.
1313 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1314 and record the child status change directly. This avoids the
1315 need to futz with the signal mask.
1316 (process_fatal_action): Move here from emacs.c.
1317 (emacs_sigaction_flags): New function, containing
1318 much of what used to be in emacs_sigaction_init.
1319 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1320 caught by emacs, to make races less likely.
1321 (deliver_process_signal): Rename from handle_on_main_thread.
1322 All uses changed.
1323 (BACKTRACE_LIMIT_MAX): Now at top level.
1324 (thread_backtrace_buffer, threadback_backtrace_pointers):
1325 New static vars.
1326 (deliver_thread_signal, deliver_fatal_thread_signal):
1327 New functions, for more-accurate delivery of thread-specific signals.
1328 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1329 (deliver_arith_signal): Handle in this thread, not
1330 in the main thread, since it's triggered by this thread.
1331 (maybe_fatal_sig): New function.
1332 (init_signals): New arg DUMPING so that we can be more accurate
1333 about whether we're dumping. Caller changed.
1334 Treat thread-specific signals differently from process-general signals.
1335 Block all signals while handling fatal error; that's safer.
1336 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1337 on IEEE hosts.
1338 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1339 Ignore SIGPIPE unless batch.
1340 (emacs_backtrace): Output backtrace for the appropriate thread,
1341 which is not necessarily the main thread.
1342 * syssignal.h: Include <stdbool.h>.
1343 (emacs_raise): New macro.
1344 * xterm.c (x_connection_signal): Remove; no longer needed
1345 now that we use sigaction.
1346 (x_connection_closed): No need to mess with sigmask now.
1347 (x_initialize): No need to reset SIGPIPE handler here, since
1348 init_signals does this for us now.
1349
1350 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1351
1352 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1353 background rect may be larger (Bug#12245).
1354
1355 2012-09-23 Chong Yidong <cyd@gnu.org>
1356
1357 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1358
1359 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1360
1361 * .gdbinit: Just stop at fatal_error_backtrace.
1362 See Stefan Monnier's request in
1363 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1364 Remove no-longer-used query of system type.
1365
1366 2012-09-22 Chong Yidong <cyd@gnu.org>
1367
1368 * search.c (Freplace_match): Doc fix (Bug#12325).
1369
1370 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1371
1372 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1373 (Fline_end_position): Doc fix.
1374
1375 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1376
1377 2012-09-22 Chong Yidong <cyd@gnu.org>
1378
1379 * dispextern.h (struct image_type): Add new slot, storing a type
1380 initialization function.
1381
1382 * image.c (define_image_type): Call the image initializer function
1383 if it is defined. Arguments and return value changed.
1384 (valid_image_p, make_image): Callers changed.
1385 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1386 (gif_type, imagemagick_type, svg_type, gs_type):
1387 Add initialization functions.
1388 (Finit_image_library): Call lookup_image_type.
1389 (CHECK_LIB_AVAILABLE): Macro deleted.
1390 (lookup_image_type): Call define_image_type here, rather than via
1391 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1392 (syms_of_image): Move define_image_type calls for xbm_type and
1393 pbm_type to lookup_image_type.
1394
1395 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1396
1397 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1398 'idle_timers' from here ...
1399 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1400 lists, to avoid infloops when the timer does something stupid,
1401 like reinvoke itself with the same or smaller time-out.
1402 (Bug#12447)
1403
1404 2012-09-22 Martin Rudalics <rudalics@gmx.at>
1405
1406 * window.c (Fsplit_window_internal): Handle only Qt value of
1407 Vwindow_combination_limit separately.
1408 (Qtemp_buffer_resize): New symbol.
1409 (Vwindow_combination_limit): New default value.
1410 Rewrite doc-string.
1411
1412 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1413
1414 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1415 the new overlay string. (Bug#10159)
1416
1417 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1418
1419 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1420 or that fprintf is async-signal-safe. POSIX doesn't require
1421 either assumption.
1422
1423 2012-09-22 Chong Yidong <cyd@gnu.org>
1424
1425 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1426 (Bug#8207).
1427
1428 2012-09-22 Kenichi Handa <handa@gnu.org>
1429
1430 * composite.c (composition_reseat_it): Handle the case that a
1431 grapheme cluster is not covered by a single font (Bug#12352).
1432
1433 2012-09-21 Chong Yidong <cyd@gnu.org>
1434
1435 * image.c (define_image_type): Avoid adding duplicate types to
1436 image_types (Bug#12463). Suggested by Jörg Walter.
1437
1438 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1439
1440 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1441 (print_load_command_name): Add case LC_DATA_IN_CODE.
1442 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1443
1444 2012-09-21 Glenn Morris <rgm@gnu.org>
1445
1446 * eval.c (Frun_hook_with_args_until_success)
1447 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1448
1449 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1450
1451 * fileio.c (Ffile_selinux_context): Only call freecon when
1452 lgetfilecon succeeded.
1453 (Fset_file_selinux_context): Likewise. (Bug#12444)
1454
1455 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1456
1457 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1458 reordering, locate the cursor by calling set_cursor_from_row; if
1459 that fails, clear the desired glyph matrix before returning a
1460 failure indication to the caller. Fixes leaving garbled display
1461 when fast scrolling with a down-key. (Bug#12403)
1462 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1463 scrolling through multibyte text.
1464
1465 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1466
1467 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1468 calling mark_vectorlike since that's the one that marks the window.
1469 (mark_discard_killed_buffers): Mark the final cdr.
1470 * window.h (struct window): Move prev/next_buffers to the
1471 non-standard fields.
1472 * window.c (make_window): Initialize prev/next_buffers manually.
1473
1474 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1475
1476 Omit unused arg EXPECTED from socket hooks.
1477 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1478 * nsterm.m (ns_term_init):
1479 * termhooks.h (struct terminal.read_socket_hook):
1480 * w32inevt.c (w32_console_read_socket):
1481 * w32term.c (w32_read_socket):
1482 * xterm.c (XTread_socket):
1483 Omit unused arg EXPECTED. All callers changed.
1484 (store_user_signal_events): Return void, not int, since callers no
1485 longer care about the return value. All uses changed.
1486
1487 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
1488
1489 * w32gui.h (XParseGeometry): Do not declare.
1490
1491 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1492
1493 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1494 Ignore 'expected'. See Eli Zaretskii in
1495 <http://bugs.gnu.org/12471#8> (last line).
1496
1497 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1498 (XParseGeometry): Now static. Substitute extremal values for
1499 values that are out of range.
1500
1501 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1502
1503 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1504
1505 * nsfns.m (XParseGeometry): Remove.
1506 (Fx_create_frame): Call x_set_offset to correctly interpret
1507 top_pos in geometry.
1508
1509 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1510 (Fx_parse_geometry): If there is a space in string, call
1511 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1512
1513 2012-09-17 Eli Zaretskii <eliz@gnu.org>
1514
1515 * search.c (scan_buffer): Use character positions in calls to
1516 region_cache_forward and region_cache_backward, not byte
1517 positions. (Bug#12196)
1518
1519 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1520 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1521
1522 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1523 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1524 emacs_blocked_malloc, now deleted.
1525
1526 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1527
1528 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1529 The workaround was for improving performance on Solaris 2.4, but
1530 is getting in the way now. Emacs will still work if someone is
1531 still running Solaris 2.4 in a museum somewhere; Sun dropped
1532 support for Solaris 2.4 in 2003.
1533 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1534 * process.c (create_process) [HAVE_WORKING_VFORK]:
1535 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1536 since Emacs no longer uses vfork on that platform.
1537
1538 2012-09-17 Glenn Morris <rgm@gnu.org>
1539
1540 * emacs.c: Use COPYRIGHT.
1541
1542 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1543
1544 Remove configure's --without-sync-input option (Bug#12450).
1545 When auditing signal-handling in preparation for cleaning it up,
1546 I found that SYNC_INPUT has race conditions and would be a real
1547 pain to fix. Since it's an undocumented and deprecated
1548 configure-time option, now seems like a good time to remove it.
1549 Also see <http://bugs.gnu.org/11080#16>.
1550 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1551 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1552 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1553 (malloc_hysteresis):
1554 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1555 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1556 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1557 (dont_register_blocks, bytes_used_when_reconsidered)
1558 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1559 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1560 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1561 Remove. All uses removed.
1562 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1563 implementation, one that depends on whether the new macro
1564 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1565 is defined.
1566 * atimer.c (run_timers, handle_alarm_signal):
1567 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1568 (handle_async_input, process_pending_signals)
1569 (handle_input_available_signal, init_keyboard):
1570 * nsterm.m (ns_read_socket):
1571 * process.c (wait_reading_process_output):
1572 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1573 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1574 (emacs_write):
1575 * xterm.c (XTread_socket):
1576 Assume SYNC_INPUT.
1577 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1578 * eval.c (handling_signal): Remove. All uses removed.
1579 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1580 All uses replaced with the SYNC_INPUT version.
1581 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1582 Remove decls.
1583 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1584 Now static.
1585
1586 * font.c (Ffont_shape_gstring): Remove unused local.
1587
1588 2012-09-16 Glenn Morris <rgm@gnu.org>
1589
1590 * Makefile.in (clean): No longer run nextstep's clean.
1591
1592 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1593 (ns_frag): Remove.
1594 (ns-app): Move here from ns.mk, and simplify.
1595 (clean): Simplify nextstep entry.
1596 * ns.mk: Remove file.
1597
1598 2012-09-17 Kenichi Handa <handa@gnu.org>
1599
1600 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1601 not covert the last few charactes.
1602
1603 2012-09-16 Kenichi Handa <handa@gnu.org>
1604
1605 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1606 here, but just check the validity of glyphs in the glyph-string.
1607
1608 2012-09-16 Martin Rudalics <rudalics@gmx.at>
1609
1610 * window.c (Fwindow_parameter, Fset_window_parameter):
1611 Accept any window as argument (Bug#12452).
1612
1613 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1614
1615 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1616 to ns_term_init to avoid memory leak.
1617
1618 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1619 explicit retain/release.
1620 (ns_term_init): Only allow one display. Initialize outerpool and
1621 ns_*_types.
1622
1623 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1624
1625 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1626 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1627 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1628 the Microsoft problem in a different way, by altering ../nt/config.nt.
1629
1630 2012-09-15 Eli Zaretskii <eliz@gnu.org>
1631
1632 * w32xfns.c:
1633 * w32uniscribe.c:
1634 * w32term.c:
1635 * w32select.c:
1636 * w32reg.c:
1637 * w32proc.c:
1638 * w32menu.c:
1639 * w32inevt.c:
1640 * w32heap.c:
1641 * w32font.c:
1642 * w32fns.c:
1643 * w32console.c:
1644 * w32.c:
1645 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1646 by lisp.h. This completes removal of setjmp.h inclusion
1647 erroneously announced in the previous commit. (Bug#12446)
1648
1649 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1650 more accurate.
1651
1652 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1653 not defined as a macro. The latter happens on MS-Windows.
1654 (Bug#12446)
1655
1656 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1657
1658 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1659 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1660 Some instances of '#include <setjmp.h>' removed, if the
1661 only reason for the instance was because "lisp.h" was included.
1662 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1663 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1664 and _longjmp with the new symbols. Emacs already uses _setjmp if
1665 available, so this change affects only POSIXish hosts that have
1666 sigsetjmp but not _setjmp, such as some versions of Solaris and
1667 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1668 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1669 (png_load_body) [HAVE_PNG]:
1670 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1671 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1672 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1673 since PNG requires jmp_buf. This is the only exception to the
1674 general rule that we now use sys_setjmp and sys_longjmp.
1675 This exception is OK since this code does not change the signal
1676 mask or longjmp out of a signal handler.
1677
1678 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1679
1680 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1681 Include "syssignal.h", for 'main_thread'.
1682
1683 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1684
1685 Avoid out-of-range marker position (Bug#12426).
1686 * insdel.c (replace_range, replace_range_2):
1687 Adjust markers before overlays, as suggested by comments.
1688 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1689 Remove redundant check before calling offset_intervals.
1690
1691 2012-09-14 Martin Rudalics <rudalics@gmx.at>
1692
1693 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1694 current buffer (Bug#12387).
1695
1696 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
1697
1698 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1699
1700 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1701
1702 Use a more backwards-compatible timer format (Bug#12430).
1703 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1704 vector element, not from the 4th, since PSECS is now at the end.
1705 (Fcurrent_idle_time): Doc fix.
1706
1707 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1708
1709 Function to mark objects and remove killed buffers at once.
1710 * alloc.c (discard_killed_buffers): Rename to ...
1711 (mark_discard_killed buffers) ... new name. Add marking
1712 of remaining objects. Fix comment. Adjust users.
1713 (mark_object): Do not touch frame buffer lists here.
1714 * frame.c (delete_frame): Reset frame buffer lists here.
1715
1716 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1717
1718 Better workaround for GNOME bug when --enable-gcc-warnings.
1719 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1720 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1721 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1722
1723 Simplify SIGIO usage (Bug#12408).
1724 The code that dealt with SIGIO was crufty and confusing, e.g., it
1725 played tricks like "#undef SIGIO" but these tricks were not used
1726 consistently. Simplify mostly by not #undeffing standard symbols,
1727 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1728 or not as we please) rather than "defined SIGIO" (standard symbol
1729 that we probably shouldn't #undef).
1730 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1731 Modules that need it can include it.
1732 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1733 * dispextern.h (ignore_sigio): New decl.
1734 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1735 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1736 * emacs.c (shut_down_emacs):
1737 * keyboard.c (kbd_buffer_store_event_hold):
1738 Use ignore_sigio rather than invoking 'signal' directly.
1739 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1740 for FIONREAD.
1741 (FIONREAD, SIGIO): Do not #undef.
1742 (tty_read_avail_input): Use #error rather than a syntax error.
1743 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1744 for I_PIPE, used by SETUP_SLAVE_PTY.
1745 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1746 * sysdep.c (croak): Remove; no longer needed. This bit of
1747 temporary code, with Fred N. Fish's comment that it's temporary,
1748 has been in Emacs since at least 1992!
1749 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1750 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1751 * syssignal.h (croak): Remove decl.
1752 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1753 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1754 now that we're termios-only.
1755 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1756 * term.c (dissociate_if_controlling_tty): Use #error rather than
1757 a run-time error.
1758
1759 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1760 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1761 to work around GNOME bug 683906.
1762 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1763 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1764 This works around GCC bug 54561.
1765
1766 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1767
1768 More fixes for 'volatile' and setjmp/longjmp.
1769 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1770 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1771 (png_load_body) [HAVE_PNG]:
1772 (jpeg_load_body) [HAVE_JPEG]:
1773 New function, with most of the old parent function's body.
1774 (png_load) [HAVE_PNG]:
1775 (jpeg_load) [HAVE_JPEG]:
1776 Invoke the new function, to avoid longjmp munging our locals.
1777 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1778 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1779 longjmp is passed 2, as the C standard doesn't guarantee this.
1780 Instead, store the failure code into mgr->failure_code.
1781
1782 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1783
1784 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1785 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1786 (syms_of_keyboard): Remove support for unread-command-char.
1787
1788 2012-09-12 Eli Zaretskii <eliz@gnu.org>
1789
1790 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1791 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1792 violation. (Bug#12426)
1793
1794 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1795
1796 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1797
1798 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1799
1800 * eval.c: Add `inhibit-debugger'.
1801 (Qinhibit_debugger): New symbol.
1802 (call_debugger): Bind it instead of Qdebug_on_error.
1803 (maybe_call_debugger): Test Vinhibit_debugger.
1804 (syms_of_eval): Define inhibit-debugger.
1805 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1806 (syms_of_xdisp): Remove inhibit-debug-on-message.
1807
1808 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1809
1810 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1811 If a nonvolatile local variable is written before a _longjmp to
1812 the frame containing the variable, and is read after the _longjmp,
1813 the value read is indeterminate. Some local variables of type
1814 'struct handler' and 'struct catchtag' are used in this way, so
1815 mark each of their slots as volatile if the slot can be set before
1816 _longjmp and read afterwards.
1817 * lisp.h (struct handler): var and chosen_clause are now volatile.
1818 (struct catchtag): val, next, and pdlcount are now volatile.
1819
1820 * bidi.c (bidi_push_it, bidi_pop_it):
1821 * fns.c (copy_hash_table):
1822 * image.c (define_image_type):
1823 * keyboard.c (kbd_buffer_store_event_hold):
1824 * process.c (Fprocess_send_eof):
1825 * xfaces.c (x_create_gc) [HAVE_NS]:
1826 * xgselect.c (xg_select):
1827 Prefer assignment to memcpy when either will do.
1828
1829 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1830 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1831 time an item is removed. No need to mark this function 'inline';
1832 the compiler knows better than we do.
1833
1834 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1835
1836 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1837 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1838 to change_frame_size (Bug#12388).
1839 (windowDidResize:): Pass YES to updateFrameSize.
1840
1841 * nsterm.h: Add delay parameter to updateFrameSize.
1842
1843 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1844
1845 Discard killed buffers from deleted window and frame objects.
1846 This reduces an amount of references to killed buffers and
1847 helps GC to reclaim them faster.
1848 * alloc.c (discard_killed_buffers): New function.
1849 (mark_object): Use it for deleted windows and frames.
1850 (mark_object): If symbol's value is set up for a killed buffer
1851 or deleted frame, restore it's global binding.
1852 * data.c (swap_in_global_binding): Add GC notice.
1853 (swap_in_symval_forwarding): Use convenient set_blv_where.
1854 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1855 * window.h: ... to here.
1856
1857 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1858
1859 Convenient macro to check whether the buffer is live.
1860 * buffer.h (BUFFER_LIVE_P): New macro.
1861 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1862 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1863
1864 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1865
1866 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1867 composition cases (Bug#12364).
1868
1869 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1870 overhang of succeeding glyphs overlapping box cursor.
1871
1872 * w32term.c (x_draw_glyph_string): Likewise.
1873
1874 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1875
1876 Simplify, document, and port floating-point (Bug#12381).
1877 The porting part of this patch fixes bugs on non-IEEE platforms
1878 with frexp, ldexp, logb.
1879 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1880 Now static.
1881 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1882 support, by removing commented-out code and briefly listing the
1883 C89 functions excluded. The commented-out stuff was confusing
1884 maintenance, e.g., we thought we needed cbrt but it was commented out.
1885 (logb): Remove decl; no longer needed.
1886 (isfinite): New macro, if not already supplied.
1887 (isnan): Don't replace any existing macro.
1888 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1889 are present on all C89 platforms.
1890 (Ffrexp): Do not special-case zero, as frexp does the right thing
1891 for that case.
1892 (Flogb): Do not use logb, as it doesn't have the desired meaning
1893 on hosts that use non-base-2 floating point. Instead, stick with
1894 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1895 frexp, to avoid getting an unspecified result.
1896
1897 * xdisp.c (Qinhibit_debug_on_message): Now static.
1898
1899 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1900
1901 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1902 NSBezierPath (Bug#12131).
1903
1904 2012-09-10 Chong Yidong <cyd@gnu.org>
1905
1906 * fns.c (Fdelq, Fdelete): Doc fix.
1907
1908 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1909
1910 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1911 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1912
1913 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1914
1915 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1916 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1917 Use it.
1918
1919 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1920
1921 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1922 left fringe if the window has a left margin. This avoids leaving
1923 traces of the cursor because its leftmost pixel is not drawn over.
1924
1925 * dispnew.c (update_window_line): When the left margin area of a
1926 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1927 that screen line. (Bug#12277)
1928
1929 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1930
1931 Assume C89 or later for math functions (Bug#12381).
1932 This simplifies the code, and makes it a bit smaller and faster,
1933 and (most important) makes it easier to clean up signal handling
1934 since we can stop worring about floating-point exceptions in
1935 library code. That was a problem before C89, but the problem
1936 went away many years ago on all practical Emacs targets.
1937 * data.c, image.c, lread.c, print.c:
1938 Don't include <math.h>; no longer needed.
1939 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1940 might be autoconfigured, as that never happens.
1941 * data.c (fmod):
1942 * doprnt.c (DBL_MAX_10_EXP):
1943 * print.c (DBL_DIG):
1944 Remove. C89 or later always defines these.
1945 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1946 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1947 (arith_error, domain_error, domain_error2):
1948 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1949 no longer needed -- we simply return what C returns. All uses removed.
1950 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1951 the wrapped code.
1952 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1953 Remove. All uses expanded, as these macros are no longer used
1954 more than once and are now more trouble than they're worth.
1955 (Ftan): Use tan, not sin / cos.
1956 (Flogb): Assume C89 frexp.
1957 (fmod_float): Assume C89 fmod.
1958 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1959 (init_floatfns): Remove. All uses removed.
1960
1961 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1962
1963 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1964 compositeToPoint for OSX < 10.6 (Bug#12390).
1965
1966 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1967
1968 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1969 This produces more-accurate results.
1970
1971 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1972
1973 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1974 changes (Bug#12088).
1975
1976 2012-09-08 Chong Yidong <cyd@gnu.org>
1977
1978 * syntax.c (Fstring_to_syntax): Doc fix.
1979
1980 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1981
1982 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1983 in the internal border.
1984 (x_set_window_size): Remove static variables and their usage.
1985 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1986 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1987 Remove fringe/internal border adjustment (Bug#11052).
1988 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1989 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1990 (ns_fix_rect_ibw): Remove.
1991 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1992 (ns_dumpglyphs_box_or_relief): Ditto.
1993 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1994 adjustment.
1995 (ns_dumpglyphs_image): Ditto.
1996 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1997 border adjustment.
1998 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1999 their usage. Add fringe_extended_p and its use as in other terms.
2000 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2001 scroll bar was removed.
2002 (updateFrameSize): New function.
2003 (windowDidResize): Move code to updateFrameSize and call it.
2004
2005 * nsterm.h (EmacsView): Add updateFrameSize.
2006
2007 2012-09-07 Chong Yidong <cyd@gnu.org>
2008
2009 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2010
2011 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2012
2013 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2014
2015 More signal-handler cleanup (Bug#12327).
2016 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2017 Problem introduced when merging patches. Noted by Eli Zaretskii in
2018 <http://bugs.gnu.org/12327#67>.
2019 * floatfns.c: Comment fix.
2020 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2021 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2022 and anyway the declaration is harmless even if SIGDANGER is not defined.
2023 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2024 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2025 source files not surprisingly expected syssignal.h to define, or
2026 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2027 Include <sys/ioctl.h>, for FIONREAD.
2028 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2029 This eliminates a problem whereby other files mysteriously had
2030 to include "syssignal.h" before including "systty.h" if they
2031 wanted to use "#ifdef SIGIO".
2032
2033 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2034
2035 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2036
2037 * w32.c (sigemptyset): Empty the set.
2038 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2039
2040 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2041
2042 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2043
2044 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2045 (mark_object): Likewise for frame objects.
2046
2047 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2048
2049 * syssignal.h (handle_on_main_thread): Always declare,
2050 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2051 This ports to platforms without HAVE_PTHREAD.
2052
2053 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2054
2055 Signal-handler cleanup (Bug#12327).
2056 Emacs's signal handlers were written in the old 4.2BSD style with
2057 sigblock and sigmask and so forth, and this led to some
2058 inefficiencies and confusion. Rewrite these to use
2059 pthread_sigmask etc. without copying signal sets around. Also,
2060 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2061 'signal', and instead use functions that do not attempt to take
2062 over the system name space. This patch causes Emacs's text
2063 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2064 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2065 Do not include <signal.h> or "syssignal.h", as these
2066 modules do not use signals.
2067 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2068 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2069 Do not include <signal.h>, as "syssignal.h" does that for us now.
2070 * atimer.c (sigmask_atimers): New function.
2071 (block_atimers, unblock_atimers): New functions,
2072 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2073 All uses replaced.
2074 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2075 no longer needed here.
2076 * emacs.c (main): Inspect existing signal handler with sigaction,
2077 so that there's no need to block and unblock SIGHUP.
2078 * sysdep.c (struct save_signal): New member 'action', replacing
2079 old member 'handler'.
2080 (save_signal_handlers, restore_signal_handlers):
2081 Use sigaction instead of 'signal' to save and restore.
2082 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2083 New function. All users of 'signal' modified to use set_sighandler
2084 if they're writeonly, and to use sys_signal if they're read+write.
2085 (emacs_sigaction_init, forwarded_signal): New functions.
2086 (sys_signal): Remove. All uses replaced by calls to sigaction
2087 and emacs_sigaction_init, or by direct calls to 'signal'.
2088 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2089 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2090 all uses replaced by pthread_sigmask etc. calls.
2091 * syssignal.h: Include <signal.h>.
2092 (emacs_sigaction_init, forwarded_signal): New decls.
2093 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2094 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2095 (sigmask, sys_sigmask): Remove; no longer needed.
2096 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2097 (sigblock, sigunblock, sigfree):
2098 (sigsetmask) [!defined sigsetmask]:
2099 Remove. All uses replaced by pthread_sigmask.
2100 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2101 no longer need to be replaced, and its typical old uses
2102 are now done via emacs_sigaction_init and sigaction.
2103 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2104 (sys_sigdel): Remove; unused.
2105 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2106
2107 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2108
2109 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2110 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2111
2112 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2113
2114 Explicitly mark buffer_defaults and buffer_local_symbols.
2115 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2116 mark_local_symbols here.
2117 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2118 since special buffers aren't marked here any more.
2119 (allocate_buffer): Chain new buffer with all_buffers here...
2120 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2121 not here.
2122 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2123 (syms_of_buffer): Remove staticpro of the above.
2124 (init_buffer_once): Set names for buffer_defaults and
2125 buffer_local_symbols.
2126
2127 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2128
2129 Use bool for booleans in font-related modules.
2130 * font.c (font_intern_prop, font_style_to_value)
2131 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2132 (generate_otf_features, font_check_otf_features, font_check_otf)
2133 (font_match_p, font_list_entities, font_at):
2134 * fontset.c (fontset_id_valid_p, reorder_font_vector
2135 (fontset_find_font, Fset_fontset_font)
2136 (face_suitable_for_char_p) [0]:
2137 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2138 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2139 (m17n_flt_initialized, ftfont_shape_by_flt):
2140 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2141 * nsfont.m (nsfont_draw):
2142 * w32font.c (w32font_draw):
2143 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2144 Use bool for booleans.
2145 * font.h: Adjust to above API changes.
2146 (struct font, struct font_driver, struct font_driver_list):
2147 Use bool for booleans.
2148 (struct font): Remove useless member encoding_type.
2149 All users removed.
2150 * fontset.c, xftfont.c: Omit unnecessary static decls.
2151
2152 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2153
2154 * alloc.c (mark_object): Revert window marking code
2155 since it's unsafe for the Fset_window_configuration.
2156
2157 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2158
2159 Fix race conditions with signal handlers and errno (Bug#12327).
2160 Be more systematic about preserving errno whenever a signal
2161 handler returns, even if it's not in the main thread. Do this by
2162 renaming signal handlers to distinguish between signal delivery
2163 and signal handling. All uses changed.
2164 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2165 * data.c (deliver_arith_signal): Rename from arith_error.
2166 * dispnew.c (deliver_window_change_signal): Rename from
2167 window_change_signal.
2168 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2169 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2170 * keyboard.c (deliver_input_available_signal): Rename from
2171 input_available_signal.
2172 (deliver_user_signal): Rename from handle_user_signal.
2173 (deliver_interrupt_signal): Rename from interrupt_signal.
2174 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2175 (deliver_child_signal): Rename from sigchld_handler.
2176 * atimer.c (handle_alarm_signal):
2177 * data.c (handle_arith_signal):
2178 * dispnew.c (handle_window_change_signal):
2179 * emacs.c (handle_fatal_signal, handle_danger_signal):
2180 * keyboard.c (handle_input_available_signal):
2181 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2182 * process.c (handle_pipe_signal, handle_child_signal):
2183 New functions, with the actual signal-handling code taken from the
2184 original respective signal handlers, sans the sporadic attempts to
2185 preserve errno, since that's now done by handle_on_main_thread.
2186 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2187 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2188 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2189 Move to sysdep.c.
2190 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2191 Move initialization of main_thread to sysdep.c's init_signals.
2192 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2193 our usage, and simplifies the mainline code.
2194 (record_child_status_change): New static function, as a helper
2195 for handle_child_signal, and with most of the old child handler's
2196 contents.
2197 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2198 (handle_child_signal): Use the above.
2199 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2200 Moved here from emacs.c.
2201 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2202 code moved here from emacs.c's main function.
2203 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2204 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2205 This lets callers save and restore errno properly.
2206
2207 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2208
2209 Remove redundant or unused things here and there.
2210 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2211 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2212 * editfns.c (Fcompare_buffer_substrings): Likewise.
2213 * frame.h (struct terminal, struct font_driver_list):
2214 Remove redundant declarations.
2215 * window.h (Qleft, Qright): Likewise.
2216
2217 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2218
2219 Do not mark objects from deleted buffers, windows and frames.
2220 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2221 (mark_object): Likewise for windows and frames.
2222
2223 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2224
2225 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2226 buffer_defaults and buffer_local_symbols as valid objects.
2227 Return special value to denote them.
2228
2229 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2230
2231 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2232 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2233 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2234 (file_name_absolute_p, Fsubstitute_in_file_name):
2235 (check_executable, check_writable, Ffile_accessible_directory_p)
2236 (Fset_file_selinux_context, Fdefault_file_modes)
2237 (Finsert_file_contents, choose_write_coding_system)
2238 (Fwrite_region, build_annotations, a_write, e_write)
2239 (Fdo_auto_save):
2240 * filelock.c (boot_time_initialized, get_boot_time)
2241 (get_boot_time_1, lock_file_1, within_one_second):
2242 * floatfns.c (in_float):
2243 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2244 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2245 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2246 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2247 * window.c (compare_window_configurations):
2248 Use bool for booleans.
2249 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2250 (Fdefault_file_modes): Now mode_t, not int, for modes.
2251 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2252 (internal_delete_file): Now returns void, not a (boolean) int,
2253 since nobody was looking at the return value.
2254 * lisp.h, window.h: Adjust to above API changes.
2255
2256 * xdisp.c (set_message): Simplify and reindent last change.
2257
2258 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2259
2260 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2261
2262 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2263
2264 * eval.c (call_debugger): Make the function non-static so that we
2265 can call it from set_message.
2266
2267 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2268 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2269
2270 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2271
2272 Give more-useful info on a fatal error (Bug#12328).
2273 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2274 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2275 of doing the work ourselves.
2276 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2277 do most of the work.
2278 (fatal_error_backtrace): New function, taken from the guts
2279 of the old fatal_error_signal, but with a new option to output
2280 a backtrace.
2281 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2282 info about the signal than just its number.
2283 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2284 * sysdep.c: Include <execinfo.h>
2285 (emacs_backtrace): New function, taken partly from the previous
2286 code of the 'die' function.
2287 (emacs_abort): Call fatal_error_backtrace rather than abort.
2288
2289 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2290
2291 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2292 eager (load-time) macro-expansion.
2293 * lisp.mk (lisp): Add macroexp.
2294
2295 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2296
2297 Simplify redefinition of 'abort' (Bug#12316).
2298 Do not try to redefine the 'abort' function. Instead, redo
2299 the code so that it calls 'emacs_abort' rather than 'abort'.
2300 This removes the need for the NO_ABORT configure-time macro
2301 and makes it easier to change the abort code to do a backtrace.
2302 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2303 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2304 Remove; sysdep.c's emacs_abort now takes its place.
2305 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2306 'abort' changed to use 'emacs_abort'.
2307 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2308 (abort) [!defined abort]: Rename to ...
2309 (emacs_abort): ... new name.
2310 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2311 the place of the old 'abort' in emacs.c.
2312 * w32.c, w32fns.c (abort): Do not #undef.
2313 * w32.c (emacs_abort): Rename from w32_abort.
2314
2315 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2316
2317 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2318 offsets[j].dv, since the y axis of the screen coordinates points
2319 down, while the y axis of the font definition coordinates points
2320 up. This fixes display of Arabic diacritics such as KASRA and
2321 KASRATAN. (Bug#11860)
2322
2323 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2324
2325 Be more systematic about _setjmp vs setjmp.
2326 * alloc.c (test_setjmp, mark_stack):
2327 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2328 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2329 (png_load, my_error_exit, jpeg_load):
2330 * process.c (send_process_trap, send_process):
2331 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2332 The underscored versions are up to 30x faster on some hosts.
2333 Formerly, the code used setjmp+longjmp sometimes and
2334 _setjmp+_longjmp at other times, with no particular reason to
2335 prefer setjmp+longjmp.
2336
2337 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2338
2339 Fix minor problem found by static checking.
2340 * buffer.c (Fdelete_all_overlays): Return nil.
2341
2342 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2343
2344 * buffer.c (Fdelete_all_overlays): New function.
2345
2346 2012-09-03 Chong Yidong <cyd@gnu.org>
2347
2348 * gtkutil.c: Add extern decl for Qxft.
2349
2350 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2351
2352 * emacs.c, eval.c: Use bool for boolean.
2353 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2354 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2355 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2356 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2357 (main, decode_env_path, Fdaemon_initialized):
2358 * eval.c (call_debugger, Finteractive_p, interactive_p):
2359 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2360 (maybe_call_debugger, Fbacktrace):
2361 * process.c (read_process_output, exec_sentinel):
2362 Use bool for booleans.
2363 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2364 All callers changed.
2365 * eval.c (interactive_p): Omit always-true boolean argument
2366 EXCLUDE_SUBRS_P. All callers changed.
2367 * dispextern.h, lisp.h: Reflect above API changes.
2368 * firstfile.c (dummy): Use the address of 'main', whose signature
2369 won't change, instead of the address of 'initialize', whose
2370 signature just changed from int to bool.
2371 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2372 * msdos.c (fatal_error_in_progress): ... from here.
2373 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2374 of incrementing it.
2375 (redisplay_internal, unwind_redisplay): Simply clear
2376 REDISPLAYING_P when unwinding, instead of saving its previous,
2377 always-false value and then restoring it.
2378
2379 Clean up some extern decls.
2380 Mostly, this hoists extern decls out of .c files and into .h files.
2381 That way, we're more likely to catch errors if the interfaces change.
2382 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2383 declare xg_mark_data.
2384 * dispextern.h (x_frame_parm_handlers):
2385 * font.h (Qxft):
2386 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2387 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2388 (Qultra_bold, Qoblique, Qitalic):
2389 Move extern decl here from .c file.
2390 * alloc.c (xg_mark_data) [USE_GTK]:
2391 * doc.c (Qclosure):
2392 * eval.c (Qlexical_binding):
2393 * fns.c (time) [!HAVE_UNISTD_H]:
2394 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2395 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2396 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2397 * lread.c (Qinternal_interpreter_environment):
2398 * minibuf.c (Qbuffer):
2399 * process.c (QCfamily, QCfilter):
2400 * widget.c (free_frame_faces):
2401 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2402 * xfont.c (x_clear_errors):
2403 * xterm.c (x_frame_parm_handlers):
2404 Remove now-redundant extern decls.
2405 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2406 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2407 Now static.
2408 * xfaces.c: Remove unnecessary static decls.
2409 * xterm.c (updating_frame): Remove decl of nonexistent object.
2410
2411 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2412 when building globals.h, as the objects that are not built on
2413 this host are not needed to compile C files on this host.
2414
2415 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2416
2417 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2418
2419 * frame.h: Add missing prototype for x_wm_set_size_hint.
2420
2421 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2422
2423 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2424 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2425 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2426 (Fsubstitute_command_keys):
2427 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2428 (save_excursion_save, save_excursion_restore)
2429 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2430 (format_time_string, general_insert_function)
2431 (make_buffer_string, make_buffer_string_both)
2432 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2433 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2434 (copy_text, insert_1, insert_1_both, insert_from_string)
2435 (insert_from_string_before_markers, insert_from_string_1)
2436 (insert_from_buffer, insert_from_buffer_1, replace_range)
2437 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2438 (del_range_2, modify_region):
2439 * intervals.c (intervals_equal, balance_possible_root_interval)
2440 (adjust_intervals_for_insertion, merge_properties_sticky)
2441 (graft_intervals_into_buffer, lookup_char_property)
2442 (adjust_for_invis_intang, set_point_both)
2443 (get_property_and_range, compare_string_intervals)
2444 (set_intervals_multibyte_1, set_intervals_multibyte):
2445 * keyboard.c (decode_timer):
2446 Use bool for boolean.
2447 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2448 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2449
2450 2012-09-02 Chong Yidong <cyd@gnu.org>
2451
2452 * keymap.c (push_key_description): Print M-TAB as C-M-i
2453 (Bug#11758).
2454
2455 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2456
2457 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2458 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2459 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2460 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2461 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2462 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2463 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2464
2465 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2466
2467 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2468 more than one grapheme cluster passed to the shaper: compute the
2469 offset adjustment values separately for each cluster. (Bug#11860)
2470
2471 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2472 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2473 about implicit conversions from integer to pointer.
2474
2475 2012-09-01 Daniel Colascione <dancol@dancol.org>
2476
2477 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2478 system used too early.
2479
2480 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2481
2482 Better seed support for (random).
2483 * emacs.c (main): Call init_random.
2484 * fns.c (Frandom): Set the seed from a string argument, if given.
2485 Remove long-obsolete Gentzel cruft.
2486 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2487 (init_random): New function.
2488
2489 2012-09-01 Daniel Colascione <dancol@dancol.org>
2490
2491 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2492 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2493 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2494 x_wm_set_size_hint, x_query_colors, x_real_positions,
2495 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2496 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2497 all of which have been moved to common code.
2498
2499 * xfaces.c: Include TERM_HEADER instead of listing all possible
2500 window-system headers.
2501
2502 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2503 to match header.
2504
2505 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2506 directly accessing frame internals.
2507
2508 * w32font.h: Include font.h. Define syms_of_w32font and
2509 globals_of_w32font.
2510
2511 * process.c: Include TERM_HEADER instead of listing all possible
2512 window-system headers.
2513
2514 * nsterm.h: Remove declarations now in frame.h.
2515 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2516
2517 * menu.c: Include TERM_HEADER instead of listing all possible
2518 window-system headers.
2519
2520 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2521 window system.
2522
2523 * keyboard.c: Include TERM_HEADER instead of listing all possible
2524 window-system headers.
2525
2526 * image.c: Include TERM_HEADER instead of listing all possible
2527 window-system headers. Declare Vlibrary_cache when compiling for
2528 Windows.
2529
2530 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2531 window system declarations.
2532
2533 * frame.h: Move common functions here: set_frame_menubar,
2534 x_set_window_size, x_sync, x_get_focus_frame,
2535 x_set_mouse_position, x_set_mouse_pixel_position,
2536 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2537 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2538 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2539 x_activate_menubar, x_real_positions, x_bitmap_icon,
2540 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2541 and x_query_colors.
2542
2543 * frame.c: Include TERM_HEADER instead of listing all possible
2544 window-system headers.
2545
2546 * font.c: Include TERM_HEADER instead of listing all possible
2547 window-system headers.
2548
2549 * emacs.c: Include TERM_HEADER.
2550
2551 * dispnew.c: Include TERM_HEADER instead of listing all possible
2552 window-system headers.
2553
2554 * ccl.h: Include character.h.
2555
2556 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2557 the current window system; include in list of objects to link into
2558 Emacs.
2559
2560 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2561
2562 Remove mark_ttys function and fix tty_display_info initialization.
2563 * lisp.h (mark_ttys): Remove prototype.
2564 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2565 to mark_ttys because all possible values of 'top_frame' slot are
2566 the frames which are reachable from Vframe_list.
2567 * term.c (mark_ttys): Remove.
2568 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2569
2570 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2571
2572 Change struct frame bitfields from unsigned char to unsigned.
2573 * frame.h (struct frame): Change type of 'display_preempted',
2574 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2575 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2576 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2577 bitfields from unsigned char to unsigned.
2578
2579 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2580
2581 Remove unused member of struct x_output and struct w32_output.
2582 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2583 * w32term.h (struct w32_output): Likewise.
2584
2585 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2586
2587 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2588 does not become zero (Bug#12234).
2589
2590 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2591
2592 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2593 for GCC 4.7.1 x86-64.
2594
2595 2012-08-30 Glenn Morris <rgm@gnu.org>
2596
2597 * lread.c (init_lread): For out-of-tree builds, only add the
2598 source directory's site-lisp dir to the load-path if it exists,
2599 consistent with in-tree builds. (Bug#12302)
2600
2601 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2602
2603 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2604 button_values to NULL. Call setStykeMask so dialogs get a close button.
2605 (windowShouldClose:): Set window_closed.
2606 (dealloc): New member, free button_values.
2607 (process_dialog:): Make member function. Remove window argument,
2608 replace window with self. Count buttons and allocate and store values
2609 in button_values.
2610 (addButton:value:row:): value is int with the name tag. Call setTag
2611 with tag. Remove return self, declare return value as void.
2612 (addString:row:): Remove return self, declare return value as void.
2613 (addSplit): Remove return self, declare return value as void.
2614 (clicked:): Remove return self, declare return value as void.
2615 Set dialog_return to button_values[seltag]. Code formatting change.
2616 (initFromContents:isQuestion:): Adjust call to process_dialog.
2617 Code formatting change.
2618 (timeout_handler:): Set timer_fired to YES.
2619 (runDialogAt:): Set timer_fired to NO.
2620 Handle click on close button as quit.
2621
2622 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2623 Add window_closed and button_values. Add void as return value for
2624 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2625 Add process_dialog as new member.
2626
2627 2012-08-28 Eli Zaretskii <eliz@gnu.org>
2628
2629 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2630 is not one of the heaps we manage. (Bug#12242)
2631
2632 2012-08-28 Glenn Morris <rgm@gnu.org>
2633
2634 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2635
2636 2012-08-28 Martin Rudalics <rudalics@gmx.at>
2637
2638 * window.c (Fset_window_configuration): Remove handling of
2639 auto-buffer-name window parameter. Install revision of reverted
2640 fix.
2641
2642 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2643
2644 Do not allow to set major mode for a dead buffer.
2645 * buffer.c (Fset_buffer_major_mode): Signal an error
2646 if the buffer is dead.
2647 (Fother_buffer, other_buffer_safely): Remove redundant
2648 nested declaration.
2649
2650 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2651
2652 Always use set_buffer_if_live to restore original buffer at unwind.
2653 * buffer.h (record_unwind_current_buffer): New function.
2654 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2655 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2656 * undo.c, window.c: Adjust users.
2657 * buffer.c (set_buffer_if_live): Fix comment.
2658
2659 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2660
2661 Fix usage of set_buffer_internal.
2662 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2663 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2664 * coding.c (decode_coding): Omit redundant test.
2665 * fileio.c (decide_coding_unwind): Likewise.
2666 * fns.c (secure_hash): Likewise.
2667 * insdel.c (modify_region): Likewise.
2668 * keyboard.c (command_loop_1): Likewise.
2669 * print.c (PRINTFINISH): Likewise.
2670 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2671
2672 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2673
2674 * dispnew.c: Use bool for boolean.
2675 (frame_garbaged, display_completed, delayed_size_change)
2676 (fonts_changed_p, add_window_display_history)
2677 (add_frame_display_history, verify_row_hash)
2678 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2679 (row_equal_p, realloc_glyph_pool)
2680 (allocate_matrices_for_frame_redisplay)
2681 (showing_window_margins_p)
2682 (adjust_frame_glyphs_for_frame_redisplay)
2683 (build_frame_matrix_from_leaf_window, make_current)
2684 (mirrored_line_dance, mirror_line_dance, update_frame)
2685 (update_window_tree, update_single_window)
2686 (check_current_matrix_flags, update_window, update_text_area)
2687 (update_window_line, set_window_update_flags, scrolling_window)
2688 (update_frame_1, scrolling, buffer_posn_from_coords)
2689 (do_pending_window_change, change_frame_size)
2690 (change_frame_size_1, sit_for):
2691 Use bool for boolean.
2692 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2693 and remove last int (actually boolean) argument, which was always 0.
2694 All callers changed.
2695 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2696 * dispextern.h (struct composition_it): Use bool for boolean.
2697 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2698 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2699 * dired.c (file_name_completion):
2700 Use bool for boolean. (This was missed in an earlier change.)
2701
2702 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2703
2704 * window.c (Fset_window_configuration): Revert first part of
2705 last change.
2706
2707 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2708
2709 * nsterm.h (NSPanel): New class variable dialog_return.
2710
2711 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2712 Initialize dialog_return.
2713 (windowShouldClose:): Use stop instead of stopModalWithCode.
2714 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2715 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2716 event.
2717 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2718 modal loop returns.
2719
2720 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2721
2722 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2723 * composite.c (find_composition, composition_gstring_p)
2724 (composition_reseat_it, find_automatic_composition):
2725 * data.c (let_shadows_buffer_binding_p)
2726 (let_shadows_global_binding_p, set_internal, make_blv)
2727 (Fmake_variable_buffer_local, Fmake_local_variable)
2728 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2729 (cons_to_signed, arith_driver):
2730 * dbusbind.c (xd_in_read_queued_messages):
2731 * dired.c (directory_files_internal, file_name_completion):
2732 Use bool for booleans.
2733 * dired.c (file_name_completion):
2734 * process.h (fd_callback):
2735 Omit int (actually boolean) argument. It wasn't being used.
2736 All uses changed.
2737 * composite.h, lisp.h: Reflect above API changes.
2738
2739 * cmds.c, coding.c: Use bool for booleans.
2740 * cmds.c (move_point, Fself_insert_command):
2741 * coding.h (struct composition status, struct coding_system):
2742 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2743 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2744 (emacs_mule_char, decode_coding_emacs_mule)
2745 (encode_coding_emacs_mule, detect_coding_iso_2022)
2746 (decode_coding_iso_2022, encode_invocation_designation)
2747 (encode_designation_at_bol, encode_coding_iso_2022)
2748 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2749 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2750 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2751 (encode_coding_raw_text, detect_coding_charset)
2752 (decode_coding_charset, encode_coding_charset, detect_eol)
2753 (detect_coding, get_translation_table, produce_chars)
2754 (consume_chars, reused_workbuf_in_use)
2755 (make_conversion_work_buffer, code_conversion_save)
2756 (decode_coding_object, encode_coding_object)
2757 (detect_coding_system, char_encodable_p)
2758 (Funencodable_char_position, code_convert_region)
2759 (code_convert_string, code_convert_string_norecord)
2760 (Fset_coding_system_priority):
2761 * fileio.c (Finsert_file_contents):
2762 Use bool for booleans.
2763 * coding.h, lisp.h: Reflect above API changes.
2764 * coding.c: Remove unnecessary static function decls.
2765 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2766 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2767 not a boolean 'int', since callers never look at the return value.
2768 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2769 * coding.h (decoding_buffer_size, encoding_buffer_size)
2770 (emacs_mule_string_char): Remove unused extern decls.
2771 (struct iso_2022_spec, struct coding_system):
2772 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2773 (struct emacs_mule_spec): Remove unused field 'full_support'.
2774 All initializations removed.
2775 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2776
2777 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2778
2779 Fix spare memory change (Bug#12286).
2780 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2781 (valid_lisp_object_p): Likewise.
2782
2783 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2784
2785 * window.c (Fset_window_configuration): Record any window's old
2786 buffer if it's replaced (see Bug#8789). If the new current
2787 buffer doesn't appear in the selected window, go to its old
2788 point (Bug#12208).
2789
2790 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2791
2792 Special MEM_TYPE_SPARE to denote reserved memory.
2793 * alloc.c (enum mem_type): New memory type.
2794 (refill_memory_reserve): Use new type for spare memory.
2795 This prevents live_cons_p and live_string_p from incorrect
2796 detection of uninitialized objects from spare memory as live.
2797
2798 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2799
2800 Spelling fixes.
2801 * Makefile.in (.PHONY): versioclean -> versionclean.
2802
2803 Remove unused external symbols.
2804 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2805 * window.c (Qwindow_valid_p, decode_valid_window):
2806 Now static, not extern.
2807 * data.c (Qinterval): Remove; unused.
2808 (syms_of_data): Do not define 'interval'.
2809 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2810 * window.h (decode_valid_window):
2811 Remove decls.
2812
2813 * character.c, charset.c, chartab.c: Use bool for booleans.
2814 * character.c (lisp_string_width, string_count_byte8)
2815 (string_escape_byte8):
2816 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2817 (load_charset_map_from_file, map_charset_chars)
2818 (Fdefine_charset_internal, define_charset_internal)
2819 (Fdeclare_equiv_charset, find_charsets_in_text)
2820 (Ffind_charset_region, char_charset, Fiso_charset):
2821 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2822 (sub_char_table_set, sub_char_table_set_range)
2823 (char_table_set_range, optimize_sub_char_table)
2824 (map_sub_char_table):
2825 Use bool for boolean.
2826 * character.c (str_to_unibyte): Omit last boolean argument; it was
2827 always 0. All callers changed.
2828 * character.h, charset.h: Adjust to match previous changes.
2829 * character.h (char_printable_p): Remove decl of nonexistent function.
2830 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2831 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2832 are all boolean, so make them single-bit bitfields.
2833
2834 * lisp.h (ASET): Remove attempt to detect side effects.
2835 It was meant to be temporary and it often doesn't work,
2836 because when IDX has side effects the behavior of IDX==IDX
2837 is undefined. See Stefan Monnier in
2838 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2839
2840 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2841
2842 * lisp.h (functionp): New function (extracted from Ffunctionp).
2843 (FUNCTIONP): Use it.
2844 * eval.c (Ffunctionp): Use it.
2845
2846 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2847
2848 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2849 as that's faster and simpler than static storage. Don't bother
2850 with the g_main_context_query overhead if g_main_context_pending
2851 says no events are pending.
2852 (gfds, gfds_size): Remove these static vars.
2853 (xgselect_initialize): Remove; no longer needed.
2854 All uses and decls removed.
2855
2856 * emacs.c (fatal_error_signal_hook): Remove.
2857 All uses removed. This leftover from old code was always 0.
2858
2859 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2860 * casefiddle.c (casify_object, casify_region):
2861 * casetab.c (set_case_table):
2862 * category.c, category.h (word_boundary_p):
2863 * category.h (CHAR_HAS_CATEGORY):
2864 Use bool for booleans, instead of int.
2865
2866 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2867
2868 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2869
2870 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2871
2872 On assertion failure, print backtrace if available.
2873 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2874 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2875 * Makefile.in (LIB_EXECINFO): New macro.
2876 (LIBES): Use it.
2877
2878 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2879 * bytecode.c (exec_byte_code):
2880 * callint.c (check_mark, Fcall_interactively):
2881 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2882 (getenv_internal, sync_process_alive, call_process_exited):
2883 * lisp.h (USE_SAFE_ALLOCA):
2884 Use bool for booleans, instead of int.
2885 * lisp.h, process.h: Adjust prototypes to match above changes.
2886 * callint.c (Fcall_interactively): Don't assume the mark's
2887 offset fits in 'int'.
2888
2889 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2890
2891 * buffer.c, buffer.h: Use bool for boolean.
2892 * buffer.c (reset_buffer_local_variables)
2893 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2894 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2895 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2896 (overlay_touches_p, overlay_strings, Foverlay_put)
2897 (report_overlay_modification, call_overlay_mod_hooks):
2898 (mmap_enlarge, mmap_set_vars):
2899 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2900 Use bool for booleans, instead of int.
2901 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2902 since the 1-or-0 return value is always ignored anyway.
2903 (mmap_initialized_p):
2904 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2905 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2906
2907 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2908
2909 * bidi.c: Use bool for boolean.
2910 This is a bit more readable, and makes the text segment of bidi.o
2911 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2912 Presumably it's faster too.
2913 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2914 Now bool.
2915 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2916 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2917 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2918 (bidi_explicit_dir_char, bidi_level_of_next_char)
2919 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2920 Use bool for booleans, instead of int.
2921 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2922 (bidi_unshelve_cache): Adjust decls to match code.
2923
2924 2012-08-23 Martin Rudalics <rudalics@gmx.at>
2925
2926 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2927 argument.
2928
2929 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2930
2931 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2932 * atimer.h: Include <stdbool.h>.
2933
2934 2012-08-22 Dan Nicolaescu <dann@gnu.org>
2935
2936 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2937 compile time tests instead of run time tests on systems that do
2938 not use them.
2939 (FRAME_MAC_P): Remove leftover from deleted code.
2940 * frame.c (syms_of_frame): Remove leftover from deleted code.
2941
2942 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2943
2944 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2945
2946 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2947
2948 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2949 Otherwise, the compiler complains about (A?B:C) where B is void
2950 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2951 (fontset_add): Return void, for FONTSET_ADD.
2952
2953 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2954
2955 * alloc.c: Use bool for booleans.
2956 (gc_in_progress, abort_on_gc)
2957 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2958 (dont_register_blocks) [GC_MALLOC_CHECK]:
2959 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2960 (check_string_bytes, make_specified_string, memory_full)
2961 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2962 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2963 (mark_stack, valid_pointer_p, make_pure_string)
2964 (Fgarbage_collect, survives_gc_p, gc_sweep):
2965 Use bool for booleans, instead of int.
2966 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2967 Remove unused local.
2968 * alloc.c (PURE_POINTER_P):
2969 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2970 * editfns.c (Fformat):
2971 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2972 (Fdo_auto_save):
2973 * fns.c (sweep_weak_table):
2974 * lisp.h (suppress_checking, push_message, survives_gc_p)
2975 (make_pure_string, gc_in_progress, abort_on_gc):
2976 * lread.c (readchar, read1):
2977 * print.c (Fprin1_to_string):
2978 * xdisp.c (push_message):
2979 Use bool for booleans affected directly or indirectly by
2980 alloc.c's changes.
2981
2982 Make recently-introduced setters macros.
2983 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2984 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2985 (set_fontset_default, set_fontset_fallback): Rename from their
2986 upper-case counterparts, and make them functions rather than macros.
2987 This is more consistent with the other recently-introduced setters.
2988 These don't need to be inline, since they're local.
2989
2990 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2991
2992 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2993 the loop (Bug#12247).
2994
2995 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2996
2997 * lisp.h (vcopy): Use memcpy rather than our own loop.
2998 This fixes a performance regression introduced by the recent
2999 addition of vcopy. This means 'vcopy' will need to be modified
3000 for a copying collector, but that's OK. Also, tighten the
3001 checking in the assertion.
3002
3003 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3004
3005 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3006 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3007 non-base glyph for the width of the base character, according to
3008 what x_draw_composite_glyph_string_foreground expects.
3009 Generate WADJUST value according to composition_gstring_width's
3010 expectations, to produce correct width of the composed character.
3011 Reverse the sign of the DU offset produced by ScriptPlace.
3012
3013 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3014
3015 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3016
3017 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3018
3019 Avoid direct writes to contents member of struct Lisp_Vector.
3020 * lisp.h (vcopy): New function to copy data into vector.
3021 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3022 * fns.c (Ffillarray): Use ASET.
3023 * keyboard.c (timer_check_2): Use AREF and ASET.
3024 (append_tool_bar_item, Frecent_keys): Use vcopy.
3025 * lread.c (read_vector): Use ASET.
3026 * msdos.c (Frecent_doskeys): Use vcopy.
3027 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3028 (Finternal_merge_in_global_face): Use ASET and vcopy.
3029 * xfont.c (xfont_list_pattern): Likewise.
3030
3031 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3032
3033 * window.c (Fwindow_point): For the selected window always return
3034 the position of its buffer's point.
3035 (Fset_window_point): For the selected window always go in its
3036 buffer to the specified position.
3037
3038 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3039
3040 Setter macros for fontsets.
3041 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3042 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3043 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3044 Adjust users.
3045
3046 2012-08-20 Glenn Morris <rgm@gnu.org>
3047
3048 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3049 Don't assume that `ln -f' works.
3050
3051 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3052
3053 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3054 and later about non-assignments with no effect. See discussion at
3055 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3056 details.
3057
3058 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3059
3060 Inline setter functions for Lisp_Objects slots of struct specbinding.
3061 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3062 Adjust users.
3063
3064 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3065
3066 * window.c (select_window): Always make selected window's buffer
3067 current.
3068
3069 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3070
3071 Use AREF and ASET for docstrings of category tables.
3072 * category.h (CATEGORY_DOCSTRING): Use AREF.
3073 (SET_CATEGORY_DOCSTRING): Use ASET.
3074 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3075
3076 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3077
3078 Inline setter functions for hash table members.
3079 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3080 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3081 (set_hash_key_and_value, set_hash_index, set_hash_next)
3082 (set_hash_hash): New functions.
3083 * charset.c, fns.c: Adjust users.
3084
3085 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3086
3087 Inline getter and setter functions for per-buffer values.
3088 * buffer.h (per_buffer_default, set_per_buffer_default)
3089 (per_buffer_value, set_per_buffer_value): New functions.
3090 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3091 * buffer.c, data.c: Adjust users.
3092
3093 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3094
3095 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3096
3097 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3098
3099 Rely on <config.h> + <unistd.h> to declare 'environ',
3100 as gnulib does this if the system doesn't.
3101 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3102 Remove declaration. MS-Windows declares it on stdlib.h which is
3103 included by conf_post.h.
3104 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3105 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3106 * vm-limit.c: Include <unistd.h>, for 'environ'.
3107
3108 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3109 (start_of_data): Remove decl; mem-limits.h provides it.
3110
3111 * xdisp.c (handle_invisible_prop): Make it a bit faster
3112 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3113
3114 2012-08-19 Chong Yidong <cyd@gnu.org>
3115
3116 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3117 ends (Bug#3874).
3118
3119 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3120
3121 * .gdbinit: Use call instead of set when calling a function in the
3122 inferior.
3123
3124 * data.c (set_internal): Don't use set_blv_found.
3125 (Fkill_local_variable): Likewise.
3126
3127 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3128
3129 * nsfont.m (ns_ascii_average_width): Ensure the string
3130 ascii_printable is initialized with a null-terminated character
3131 array. Otherwise, it can contain undesired extra characters.
3132
3133 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3134
3135 port new setting code to Sun C 5.8 2005/10/13
3136 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3137 Return void, not Lisp_Object. Otherwise, the compiler
3138 complains about (A?B:C) where B is void and C is Lisp_Object
3139 when compiling CHAR_TABLE_SET, due to the recent change to
3140 the API of sub_char_table_set_contents.
3141
3142 2012-08-18 Chong Yidong <cyd@gnu.org>
3143
3144 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3145 for the string case (Bug#3874).
3146
3147 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3148
3149 * buffer.h (BSET): Remove (Bug#12215).
3150 Replace all uses with calls to new setter functions.
3151 (bset_bidi_paragraph_direction, bset_case_canon_table)
3152 (bset_case_eqv_table, bset_directory, bset_display_count)
3153 (bset_display_time, bset_downcase_table)
3154 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3155 (bset_last_selected_window, bset_local_var_alist)
3156 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3157 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3158 (bset_width_table):
3159 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3160 (bset_auto_fill_function, bset_auto_save_file_format)
3161 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3162 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3163 (bset_cache_long_line_scans, bset_case_fold_search)
3164 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3165 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3166 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3167 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3168 (bset_header_line_format, bset_indicate_buffer_boundaries)
3169 (bset_indicate_empty_lines, bset_invisibility_spec)
3170 (bset_left_fringe_width, bset_major_mode, bset_mark)
3171 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3172 (bset_name, bset_overwrite_mode, bset_pt_marker)
3173 (bset_right_fringe_width, bset_save_length)
3174 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3175 (bset_scroll_up_aggressively, bset_selective_display)
3176 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3177 (bset_word_wrap, bset_zv_marker):
3178 * category.c (bset_category_table):
3179 * syntax.c (bset_syntax_table):
3180 New setter functions.
3181
3182 * process.h (PSET): Remove (Bug#12215).
3183 Replace all uses with calls to new setter functions.
3184 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3185 (PROCESS_INLINE): New macro.
3186 (pset_childp): New setter function.
3187 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3188 * process.c (PROCESS_INLINE):
3189 Define to EXTERN_INLINE, so that the corresponding functions
3190 are compiled into code.
3191 (pset_buffer, pset_command, pset_decode_coding_system)
3192 (pset_decoding_buf, pset_encode_coding_system)
3193 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3194 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3195 (pset_type, pset_write_queue): New setter functions.
3196
3197 * window.h (WSET): Remove (Bug#12215).
3198 Replace all uses with calls to new setter functions.
3199 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3200 (WINDOW_INLINE): New macro.
3201 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3202 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3203 (wset_total_lines, wset_vertical_scroll_bar)
3204 (wset_window_end_pos, wset_window_end_valid)
3205 (wset_window_end_vpos): New setter functions.
3206 * window.c (WINDOW_INLINE):
3207 Define to EXTERN_INLINE, so that the corresponding functions
3208 are compiled into code.
3209 (wset_combination_limit, wset_dedicated, wset_display_table)
3210 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3211 (wset_new_normal, wset_new_total, wset_next_buffers)
3212 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3213 (wset_prev_buffers, wset_right_fringe_width)
3214 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3215 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3216 (wset_window_parameters):
3217 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3218 (wset_column_number_displayed, wset_region_showing):
3219 New setter functions.
3220
3221 * termhooks.h (TSET): Remove (Bug#12215).
3222 Replace all uses with calls to new setter functions.
3223 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3224 (TERMHOOKS_INLINE): New macro.
3225 (tset_charset_list, tset_selection_alist): New setter functions.
3226 * terminal.c (TERMHOOKS_INLINE):
3227 Define to EXTERN_INLINE, so that the corresponding functions
3228 are compiled into code.
3229 (tset_param_alist): New setter function.
3230
3231 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3232
3233 * keyboard.h (KSET): Remove (Bug#12215).
3234 Replace all uses with calls to new setter functions.
3235 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3236 (KEYBOARD_INLINE): New macro.
3237 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3238 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3239 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3240 New setter functions.
3241 * keyboard.c (KEYBOARD_INLINE):
3242 Define to EXTERN_INLINE, so that the corresponding functions
3243 are compiled into code.
3244 (kset_echo_string, kset_kbd_queue)
3245 (kset_keyboard_translate_table, kset_last_prefix_arg)
3246 (kset_last_repeatable_command, kset_local_function_key_map)
3247 (kset_overriding_terminal_local_map, kset_real_last_command)
3248 (kset_system_key_syms): New setter functions.
3249
3250 * frame.h (FSET): Remove (Bug#12215).
3251 Replace all uses with calls to new setter functions.
3252 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3253 (FRAME_INLINE): New macro.
3254 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3255 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3256 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3257 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3258 (fset_param_alist, fset_root_window, fset_scroll_bars)
3259 (fset_selected_window, fset_title, fset_tool_bar_items)
3260 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3261 * frame.c (FRAME_INLINE):
3262 Define to EXTERN_INLINE, so that the corresponding functions
3263 are compiled into code.
3264 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3265
3266 A few more naming-convention fixes for getters and setters.
3267 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3268 and rename from buffer_overlays_set_before.
3269 (set_buffer_overlays_after): Move here from buffer.h, and rename
3270 from buffer_overlays_set_after.
3271 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3272 All uses changed.
3273 (set_buffer_intervals): Rename from buffer_set_intervals.
3274 * intervals.c (set_interval_object): Move here from intervals.h,
3275 and rename from interval_set_object.
3276 (set_interval_left): Move here from intervals.h, and rename from
3277 interval_set_left.
3278 (set_interval_right): Move here from intervals.h, and rename from
3279 interval_set_right.
3280 (copy_interval_parent): Move here from intervals.h, and rename from
3281 interval_copy_parent.
3282 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3283 (set_interval_plist): Rename from interval_set_plist.
3284 Return void, not Lisp_Object, since no caller uses the result.
3285 * lisp.h (string_intervals): Rename from string_get_intervals.
3286 (set_string_intervals): Rename from string_set_intervals.
3287
3288 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3289 (set_char_table_contents): Rename from char_table_set_contents.
3290 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3291 All uses changed. See the end of
3292 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3293
3294 * lisp.h (CSET): Remove (Bug#12215).
3295 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3296 (set_char_table_purpose): New functions,
3297 replacing CSET. All uses changed. For example, replace
3298 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3299 "set_char_table_parent (char_table, parent);".
3300 The old version was confusing because it used the same name
3301 'parent' for two different things.
3302
3303 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3304
3305 Functions to get and set Lisp_Object fields of buffer-local variables.
3306 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3307 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3308 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3309 * data.c, eval.c, frame.c: Adjust users.
3310
3311 2012-08-17 Chong Yidong <cyd@gnu.org>
3312
3313 * xfaces.c (merge_face_vectors): If the target font specfies a
3314 font spec, make the font's attributes take precedence over
3315 directly-specified attributes.
3316 (merge_face_ref): Recognize :font.
3317
3318 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3319
3320 Do not use memcpy for copying intervals.
3321 * intervals.c (reproduce_interval): New function.
3322 (reproduce_tree, reproduce_tree_obj): Use it.
3323 (reproduce_tree_obj): Remove prototype.
3324
3325 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3326
3327 * lisp.h (duration_to_sec_usec): Remove unused decl.
3328
3329 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3330
3331 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3332 to an allocated instance of NSString, not to the class itself.
3333
3334 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3335
3336 * makefile.w32-in (C_CTYPE_H): New macro.
3337 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3338 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3339 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3340
3341 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3342
3343 Use ASCII tests for character types.
3344 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3345 * xfns.c, xterm.c:
3346 Don't include <ctype.h>; was not needed.
3347 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3348 * sysdep.c, xfaces.c:
3349 Include <c-ctype.h> instead of <ctype.h>.
3350 * nsterm.m: Include <c-ctype.h>.
3351 * charset.c (read_hex):
3352 * doc.c (Fsnarf_documentation):
3353 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3354 (DRIVE_LETTER) [DOS_NT]:
3355 (Ffile_name_directory, Fexpand_file_name)
3356 (Fsubstitute_in_file_name):
3357 * font.c (font_parse_xlfd, font_parse_fcname):
3358 * frame.c (x_set_font_backend):
3359 * gtkutil.c (xg_get_font):
3360 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3361 * nsimage.m (hexchar):
3362 * nsterm.m (ns_xlfd_to_fontname):
3363 * sysdep.c (system_process_attributes):
3364 * xfaces.c (hash_string_case_insensitive):
3365 Use C-locale tests instead of locale-specific tests for character
3366 types, since we want the ASCII interpretation here, not the
3367 interpretation suitable for whatever happens to be the current locale.
3368
3369 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3370
3371 Consistently check windows for validity/liveness
3372 (Bug#11984, Bug#12025, Bug#12026).
3373 * lisp.h (CHECK_VALID_WINDOW): New macro.
3374 * window.c (decode_window): Rename to decode_live_window.
3375 (decode_valid_window, Fwindow_valid_p): New functions.
3376 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3377 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3378 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3379 (Fwindow_prev_sibling, Fwindow_combination_limit)
3380 (Fset_window_combination_limit, Fwindow_use_time)
3381 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3382 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3383 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3384 (Fwindow_hscroll, Fset_window_hscroll)
3385 (Fwindow_redisplay_end_trigger)
3386 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3387 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3388 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3389 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3390 (Fwindow_end, Fset_window_point, Fset_window_start)
3391 (Fpos_visible_in_window_p, Fwindow_line_height)
3392 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3393 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3394 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3395 (Fset_window_parameter, Fwindow_display_table)
3396 (Fset_window_display_table, Fdelete_other_windows_internal)
3397 (Fset_window_buffer, Fset_window_new_total)
3398 (Fset_window_new_normal, Fdelete_window_internal)
3399 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3400 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3401 (Fwindow_scroll_bars): Check whether argument window is a valid or
3402 live window. Update doc-strings.
3403 (syms_of_window): New symbol Qwindow_valid_p.
3404 * keyboard.c (Fposn_at_x_y): Check whether argument
3405 frame_or_window denotes a valid window.
3406
3407 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3408
3409 Fix previous char table change.
3410 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3411 * chartab.c (optimize_sub_char_table): Likewise.
3412
3413 2012-08-16 Chong Yidong <cyd@gnu.org>
3414
3415 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3416
3417 * xfont.c (xfont_open):
3418 * xftfont.c (xftfont_open): Set the font's max_width field.
3419
3420 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3421 min_width to space_width and average_width to the average over
3422 printable ASCII characters.
3423 (ns_char_width): Code cleanup.
3424 (ns_ascii_average_width): New utility function.
3425
3426 * font.h (struct font): Update comments.
3427
3428 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3429
3430 Simple interface to set Lisp_Object fields of character tables.
3431 * lisp.h (CSET): New macro.
3432 (char_table_set_extras, char_table_set_contents)
3433 (sub_char_table_set_contents): New function.
3434 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3435 * syntax.c: Adjust users.
3436
3437 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3438
3439 * eval.c (eval_sub): Bind lexical-binding.
3440 * lread.c (Qlexical_binding): Make non-static.
3441
3442 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3443
3444 * nsmenu.m (popupSession): Remove.
3445 (pop_down_menu): Remove endModalSession.
3446 (timeout_handler:): New method.
3447 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3448 Call runModalForWindow. Check timer_fired when it returns.
3449 If not set, cancel timer and break out of loop.
3450 Otherwise loop again, with a new timeout.
3451
3452 * nsterm.m: Include fcntl.h if present.
3453 (fd_entry, t_readfds, inNsSelect): Remove.
3454 (select_writefds, select_valid, select_timeout, selfds)
3455 (select_mutex, apploopnr): Add.
3456 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3457 Otherwise call kbd_buffer_store_event.
3458 (ns_send_appdefined): Remove release of fd_entry.
3459 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3460 Increment and decrement apploopnr.
3461 (ns_select): If no file descriptors, just do a NSTimer.
3462 Otherwise copy read/write masks and start select thread (fd_handler).
3463 Start main loop and wait for application defined event.
3464 Inform select thread to stop selecting after main loop is exited.
3465 (ns_term_init): Create selfds pipe and set non-blocking.
3466 Initialize select_mutex. Start the select thread (fd_handler).
3467 (fd_handler:): Loop forever, wait for info from the main thread
3468 to either start or stop selecting. When select returns, send
3469 and appdefined event.
3470 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3471 If not call kbd_buffer_store_event.
3472
3473 * nsterm.h (EmacsApp): fd_handler takes id argument.
3474 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3475
3476 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3477
3478 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3479
3480 * region-cache.c (move_cache_gap): Update gap_len using the actual
3481 growth of the boundaries array. Do not change cache_len.
3482 (Bug#12196)
3483
3484 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3485
3486 Generalize and cleanup font subsystem checks.
3487 * font.h (FONT_DEBUG, font_assert): Remove.
3488 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3489 Change font_assert to eassert. Use eassert where appropriate.
3490
3491 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3492
3493 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3494
3495 2012-08-15 Chong Yidong <cyd@gnu.org>
3496
3497 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3498 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3499 extract the font descriptor instead of just the font name.
3500 In that case, return a font spec instead of a string.
3501 (x_last_font_name): Move to this file from xfns.c.
3502
3503 * xfns.c (Fx_select_font): The return value can also be a font
3504 spec. Move x_last_font_name management to gtkutil.c.
3505
3506 * xfaces.c: Make font weight and style symbols non-static.
3507
3508 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3509
3510 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3511 (bug#12117).
3512
3513 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3514
3515 * alloc.c (Fgarbage_collect): Use plural form consistently.
3516
3517 2012-08-14 Eli Zaretskii <eliz@gnu.org>
3518
3519 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3520 iteration through the command loop. Fixes a problem whereby mouse
3521 movements are ignored until the first mouse click.
3522
3523 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3524
3525 Use bool, not int, for Lisp booleans.
3526 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3527 makes Emacs a bit smaller and presumably a bit faster.
3528 * lisp.h: Include <stdbool.h>.
3529 (struct Lisp_Boolfwd, defvar_bool):
3530 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3531 * regex.c [!emacs]: Include <stdbool.h>.
3532 (false, true): Remove; <stdbool.h> does this for us now.
3533
3534 2012-08-14 Chong Yidong <cyd@gnu.org>
3535
3536 * character.c (Fcharacterp): Doc fix (Bug#12076).
3537
3538 * data.c (Findirect_variable): Doc fix (Bug#11040).
3539
3540 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3541
3542 * editfns.c (Fformat): Doc fix (Bug#12059).
3543 (Fsave_current_buffer): Doc fix (Bug#11542).
3544
3545 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3546
3547 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3548 (bug#12022).
3549
3550 2012-08-14 Martin Rudalics <rudalics@gmx.at>
3551
3552 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3553 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3554 * minibuf.c (choose_minibuf_frame, read_minibuf):
3555 * w32fns.c (x_create_tip_frame):
3556 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3557 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3558
3559 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3560
3561 * intervals.c (offset_intervals): Remove obsolete comment.
3562
3563 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3564
3565 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3566
3567 2012-08-14 Gergely Risko <gergely@risko.hu>
3568
3569 * coding.c (decode_coding): Record buffer modification before
3570 disabling undo_list (Bug#11773).
3571
3572 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3573
3574 Revert and cleanup some recent overlay changes.
3575 * buffer.h (enum overlay_type): Remove.
3576 (buffer_get_overlays, buffer_set_overlays): Likewise.
3577 (buffer_set_overlays_before, buffer_set_overlays_after):
3578 New function. Adjust users.
3579 (unchain_both): Add eassert.
3580
3581 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3582
3583 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3584
3585 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 * gtkutil.c (xg_mark_data): Don't assume C99.
3588
3589 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3590
3591 * gtkutil.c (xg_frame_tb_info): New struct.
3592 (TB_INFO_KEY): New define.
3593 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3594 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3595 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3596 if not present.
3597 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3598 is up to date. Otherwise store new data.
3599 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3600
3601 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3602
3603 Use KSET for write access to Lisp_Object members of struct kboard.
3604 * keyboard.h (KSET): New macro.
3605 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3606 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3607 * xterm.c: Adjust users.
3608
3609 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3610
3611 Use BSET for write access to Lisp_Object members of struct buffer.
3612 * buffer.h (BSET): New macro.
3613 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3614 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3615 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3616 * window.c, xdisp.c, xfns.c: Adjust users.
3617
3618 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3619
3620 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3621
3622 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3623
3624 * nsterm.m (not_in_argv): New function.
3625 (application:openFile, application:openTempFile:):
3626 (application:openFileWithoutUI:, application:openFiles:): Open file
3627 if not_in_argv returns non-zero (bug#12171).
3628
3629 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3630 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3631 Define for Gtk+ versions less than 3.2.
3632 (xg_get_font_name): Use those functions/macros here.
3633 Reported by Frans Oilinki <moilinki@gmail.com>.
3634
3635 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3636
3637 * unexmacosx.c (copy_data_segment): Copy initialized data in
3638 statically linked libraries from input file rather than memory.
3639
3640 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3641 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3642 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3643
3644 2012-08-10 Glenn Morris <rgm@gnu.org>
3645
3646 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3647 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3648
3649 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3650
3651 Fix last change to allow compilation with low optimization levels.
3652 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3653 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3654
3655 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3656
3657 Use common inline syntax in intervals.h.
3658 * intervals.h (INTERVALS_INLINE): New macro.
3659 Change all users from LISP_INLINE.
3660
3661 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3662
3663 Define Qnone once for all platforms.
3664 * frame.c (Qnone): Define here.
3665 (syms_of_frame): DEFSYM it.
3666 * lisp.h (Qnone): New declaration.
3667 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3668 * xfns.c: Remove duplication. Adjust users.
3669
3670 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3671
3672 Remove unused macros from intervals.h.
3673 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3674 * intervals.c: Adjust comment.
3675
3676 2012-08-10 Eli Zaretskii <eliz@gnu.org>
3677
3678 * w32fns.c <w32_unicode_gui>: New static variable.
3679 (globals_of_w32fns): Initialize it according to os_subtype.
3680 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3681 testing os_subtype.
3682
3683 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
3684 Eli Zaretskii <eliz@gnu.org>
3685
3686 Fix bug #10299 with Unicode characters sent by customized
3687 keyboards created by MSKLC.
3688 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3689 (w32_init_class): Use it to initialize the Emacs class with either
3690 ANSI or Unicode API calls.
3691 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3692 later.
3693 (w32_wnd_proc): If the character code sent by WM_CHAR or
3694 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3695 original message. Call DefWindowProcW on NT and later.
3696
3697 2012-08-10 Glenn Morris <rgm@gnu.org>
3698
3699 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3700
3701 * lisp.h (DIRECTORY_SEP): Let configure set it.
3702
3703 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3704
3705 Use TSET for write access to Lisp_Object slots of struct terminal.
3706 * termhooks.h (TSET): New macro.
3707 * coding.c, terminal.c, xselect.c: Adjust users.
3708
3709 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3710
3711 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3712 the failing expression, include them in the error message.
3713 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3714 * lisp.h (internal_condition_case_n): Update declaration.
3715
3716 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3717
3718 Inline functions to examine and change buffer overlays.
3719 * buffer.c (unchain_both): New function.
3720 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3721 (buffer_has_overlays): New function.
3722 (enum overlay_type): New enum.
3723 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3724 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3725
3726 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3727
3728 Inline functions to examine and change buffer intervals.
3729 * alloc.c (mark_interval_tree): Remove.
3730 (MARK_INTERVAL_TREE): Simplify.
3731 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3732 * intervals.c (buffer_balance_intervals): New function.
3733 (graft_intervals_into_buffer): Adjust indentation.
3734 (set_intervals_multibyte): Simplify.
3735 * buffer.h (BUF_INTERVALS): Remove.
3736 (buffer_get_intervals, buffer_set_intervals): New function.
3737 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3738 * intervals.c, textprop.c: Adjust users.
3739
3740 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3741
3742 Inline functions to examine and change string intervals.
3743 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3744 (string_get_intervals, string_set_intervals): New function.
3745 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3746 * lread.c, print.c, textprop.c: Adjust users.
3747
3748 2012-08-08 Glenn Morris <rgm@gnu.org>
3749
3750 * lisp.mk (lisp): Remove language/persian.elc.
3751
3752 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3753
3754 Cleanup intervals.
3755 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3756 (NULL_INTERVAL_P): Likewise. Adjust users.
3757 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3758 Adjust comment. Move under #if 0.
3759 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3760 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3761
3762 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3763
3764 Check total length of intervals with eassert.
3765 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3766 * intervals.c: Change all users to eassert.
3767
3768 2012-08-07 Eli Zaretskii <eliz@gnu.org>
3769
3770 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3771 Rename fields to match removal of FGET and WGET and disuse of
3772 INTERNAL_FIELD in Lisp_Cons.
3773
3774 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3775
3776 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3777 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3778 name since all xname users are fixed long time ago. Do not
3779 use INTERNAL_FIELD.
3780 (set_symbol_name, set_symbol_function, set_symbol_plist):
3781 (set_symbol_next, set_overlay_plist): New function.
3782 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3783 (struct Lisp_Overlay): Likewise.
3784 (CVAR, MVAR, SVAR): Remove.
3785 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3786 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3787 * xterm.c: Adjust users.
3788 * .gdbinit: Change to use name field of struct Lisp_Symbol
3789 where appropriate.
3790
3791 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3792
3793 Basic functions to set Lisp_Object and pointer slots of intervals.
3794 * intervals.h (interval_set_parent, interval_set_object):
3795 (interval_set_left, interval_set_right, interval_set_plist):
3796 (interval_copy_parent): New function.
3797 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
3798 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3799 Adjust indentation.
3800 (INTERVAL_SIZE): Remove. Adjust users.
3801 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3802
3803 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3804
3805 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3806 * process.h (PGET): Remove.
3807 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3808 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3809
3810 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3811
3812 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3813 * window.h (WGET): Remove.
3814 (struct window): Do not use INTERNAL_FIELD.
3815 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3816 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3817 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3818 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3819 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3820 Adjust users.
3821
3822 2012-08-07 Chong Yidong <cyd@gnu.org>
3823
3824 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3825 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3826 (Fdelete_window_internal): Signal an error if the window is not on
3827 a live frame (Bug#12025).
3828
3829 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3830
3831 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3832 * frame.h (FGET): Remove.
3833 (struct frame): Do not use INTERNAL_FIELD.
3834 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3835 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3836 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3837 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3838
3839 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
3840
3841 * w32.c: Silence compiler warnings.
3842 (map_w32_filename): Remove unused variable `is_fat'.
3843 (chase_symlinks): Add parentheses around expression.
3844
3845 2012-08-06 Glenn Morris <rgm@gnu.org>
3846
3847 * sysdep.c: Respect BROKEN_GETWD.
3848
3849 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3850 Let configure handle it.
3851 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3852
3853 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3854
3855 Use GCALIGNMENT where appropriate.
3856 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3857 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3858 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3859
3860 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3861
3862 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3863 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3864
3865 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3866
3867 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3868 that should be sufficient for everyone.
3869
3870 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3871
3872 * keyboard.c (timer_check_2): Add break so timer_check returns next
3873 timeout.
3874
3875 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3876
3877 Fix Windows build errors introduced after converting to WGET and WSET.
3878 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3879 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3880
3881 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3882
3883 * nsterm.m (ns_frame_rehighlight): Use FSET.
3884
3885 * nsmenu.m (ns_update_menubar): Use FSET.
3886
3887 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3888
3889 Separate read and write access to Lisp_Object slots of Lisp_Process.
3890 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3891 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3892
3893 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3894
3895 Separate read and write access to Lisp_Object slots of struct window.
3896 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3897 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3898 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3899 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3900 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3901 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3902 Adjust users.
3903
3904 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3905
3906 Fix Windows build errors introduced after converting to FGET and FSET.
3907 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3908 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3909 (w32_judge_scroll_bars): Change to use FSET.
3910 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3911
3912 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3913
3914 Fix replacement typo.
3915 * window.c (replace_window): Set root_window instead of
3916 selected_window. This fixes a total window subsystem
3917 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3918
3919 2012-08-06 Glenn Morris <rgm@gnu.org>
3920
3921 * lisp.mk (lisp): Add language/persian.elc.
3922
3923 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3924
3925 Separate read and write access to Lisp_Object slots of struct frame.
3926 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3927 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3928 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3929 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3930 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3931
3932 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3933
3934 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3935
3936 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3937
3938 Generalize common compile-time constants.
3939 * lisp.h (header_size, bool_header_size, word_size): Now here.
3940 (struct Lisp_Vector): Add comment.
3941 (struct Lisp_Bool_Vector): Move up to define handy constants.
3942 (VECSIZE, PSEUDOVECSIZE): Simplify.
3943 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3944 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3945 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3946 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3947 * xfont.c, xmenu.c: Use word_size where appropriate.
3948
3949 2012-08-05 Lawrence Mitchell <wence@gmx.li>
3950
3951 * search.c (Freplace_match): Treat \? in the replacement text
3952 literally (Bug#8161).
3953
3954 2012-08-05 Chong Yidong <cyd@gnu.org>
3955
3956 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3957 * frame.c (Vdelete_frame_functions):
3958 * emacs.c (Vkill_emacs_hook): Doc fix.
3959
3960 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3961
3962 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3963 --with-x-toolkit=no builds.
3964 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3965
3966 2012-08-04 Chong Yidong <cyd@gnu.org>
3967
3968 * syntax.c (Fmodify_syntax_entry): Doc fix.
3969
3970 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3971
3972 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3973 * w32.c (init_environment): Change the default values of many
3974 environment variables in dflt_envvars[] to NULL, to avoid pushing
3975 them into environment when they were not already defined.
3976 Remove the code that deletes site-lisp subdirectories from the default
3977 value of EMACSLOADPATH, as it is no longer needed.
3978 (check_windows_init_file): Now external, not static.
3979 Use Vload_path as is, without adding anything, as this function is now
3980 called when Vload_path is already set up.
3981
3982 * w32.h (check_windows_init_file): Add prototype.
3983
3984 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3985 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3986 compatibility with Posix platforms.
3987 (main): Move the call to check_windows_init_file to here from
3988 w32.c.
3989 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3990 any, in the DEFALT argument into the root of the Emacs build or
3991 installation tree, as appropriate.
3992
3993 * callproc.c (init_callproc_1): Call decode_env_path instead of
3994 doing its equivalent by hand.
3995 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3996 the code that sets Vexec_path run on MS-Windows.
3997
3998 * lread.c (init_lread): Add comments to #ifdef's.
3999
4000 * msdos.c (dos_set_window_size, IT_update_begin)
4001 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4002 instead of direct references.
4003
4004 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4005
4006 Export DEFAULT_REHASH_* to GDB.
4007 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4008 Now constants, not macros.
4009
4010 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4011
4012 Remove unnecessary casts involving pointers.
4013 These casts are no longer needed now that we assume C89 or later,
4014 since they involve casting to or from void *.
4015 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4016 (make_pure_float, make_pure_vector):
4017 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4018 * macros.c (Fstart_kbd_macro):
4019 * menu.c (find_and_return_menu_selection):
4020 * minibuf.c (read_minibuf_noninteractive):
4021 * sysdep.c (closedir):
4022 * xdisp.c (x_produce_glyphs):
4023 * xfaces.c (compare_fonts_by_sort_order):
4024 * xfns.c (x_real_positions, select_visual):
4025 * xselect.c (x_stop_queuing_selection_requests)
4026 (x_get_window_property, x_get_window_property_as_lisp_data):
4027 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4028 Remove unnecessary pointer casts.
4029 * alloc.c (record_xmalloc): New function.
4030 * lisp.h (record_xmalloc): New decl.
4031 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4032 more like a function. This is because the pointer cast is not
4033 needed. All uses changed.
4034 * print.c (print_string, print_error_message): Avoid length recalc.
4035
4036 Improve fix for macroexp crash with debugging (Bug#12118).
4037 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4038 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4039 not supposed to be invoked from the garbage collector.
4040 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4041 (gc_aset): New function, which is like ASET but can be
4042 used in the garbage collector.
4043 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4044 (set_hash_index): Use it instead of ASET.
4045
4046 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4047
4048 Support symlinks on latest versions of MS-Windows.
4049 * w32.c: Include winioctl.h and aclapi.h.
4050 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4051 (revert_to_self): Forward declarations of static functions.
4052 <static BOOL g_b_init_get_security_info>:
4053 <g_b_init_create_symbolic_link>: New static flags.
4054 (globals_of_w32): Initialize them to zero.
4055 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4056 (map_w32_filename): Improve commentary. Simplify switch.
4057 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4058 headers (most versions of MinGW w32api don't).
4059 (get_security_info, create_symbolic_link)
4060 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4061 New functions.
4062 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4063 in the argument file name.
4064 (sys_access): Call unc_volume_file_attributes only if
4065 GetFileAttributes fails with network-related error codes.
4066 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4067 have the required privileges.
4068 (get_file_security_desc_by_name): Rename from
4069 get_file_security_desc.
4070 (stat_worker): New function, with most of the guts of 'stat', and
4071 with addition of handling of symlinks and support for 'lstat'.
4072 If possible, get file's attributes and security information by
4073 handle, not by name. Produce S_IFLNK bit for symlinks, when
4074 called from 'lstat'.
4075 (stat, lstat): New functions, call 'stat_worker'.
4076 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4077 symlinks when the underlying filesystem supports them.
4078
4079 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4080
4081 Fix macroexp crash on Windows with debugging (Bug#12118).
4082 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4083 checking subscripts; problem introduced with the recent
4084 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4085 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4086 since it's used in non-static inline functions now.
4087
4088 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4089 Don't assume buffer size fits in 'int'. Remove unused local.
4090
4091 Use C99-style 'extern inline' if available.
4092 * buffer.h (BUFFER_INLINE):
4093 * category.h (CATEGORY_INLINE):
4094 * character.h (CHARACTER_INLINE):
4095 * charset.h (CHARSET_INLINE):
4096 * composite.h (COMPOSITE_INLINE):
4097 * dispextern.h (DISPEXTERN_INLINE):
4098 * lisp.h (LISP_INLINE):
4099 * systime.h (SYSTIME_INLINE):
4100 New macro, replacing 'static inline' in this header.
4101 * buffer.h, category.h, character.h, charset.h, composite.h:
4102 * dispextern.h, lisp.h, systime.h:
4103 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4104 * alloc.c (LISP_INLINE):
4105 * buffer.c (BUFFER_INLINE):
4106 * category.c (CATEGORY_INLINE):
4107 * character.c (CHARACTER_INLINE):
4108 * charset.c (CHARSET_INLINE):
4109 * composite.c (COMPOSITE_INLINE):
4110 * dispnew.c (DISPEXTERN_INLINE):
4111 * sysdep.c (SYSTIME_INLINE):
4112 Define to EXTERN_INLINE, so that the corresponding functions
4113 are compiled into code.
4114 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4115 (INLINE_HEADER_END): New macros.
4116 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4117 since it's used in non-static inline functions now.
4118 (VALMASK) [!USE_LSB_TAG]: Likewise.
4119
4120 2012-08-02 Glenn Morris <rgm@gnu.org>
4121
4122 * s/: Remove empty directory.
4123
4124 * s/ms-w32.h: Move to ../nt/inc.
4125 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4126 Update for new ms-w32.h location.
4127
4128 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4129
4130 Port to Solaris 8.
4131 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4132
4133 2012-08-02 Glenn Morris <rgm@gnu.org>
4134
4135 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4136 hard-coding the path separator.
4137
4138 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4139
4140 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4141 This how ASET and AREF are supposed to work, and makes
4142 it easier to think about future improvements. See
4143 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4144 * charset.h (set_charset_attr): New function.
4145 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4146 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4147 (aref_addr): New function. All uses of &AREF(...) changed.
4148 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4149 (set_hash_index): New functions. All lvalue-style uses of
4150 HASH_KEY etc. changed.
4151 * keyboard.c (set_prop): New function. All lvalue-style uses
4152 of PROP changed.
4153
4154 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4155
4156 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4157 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4158 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4159 * nsfns.m (ns_set_name_as_filename): Likewise.
4160 * nsmenu.m (ns_update_menubar): Likewise.
4161 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4162
4163 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4164
4165 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4166 Adapt to latest changes in field names of the corresponding Lisp
4167 objects.
4168
4169 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4170
4171 2012-08-01 Glenn Morris <rgm@gnu.org>
4172
4173 * s/msdos.h: Remove file.
4174 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4175 * Makefile.in (S_FILE): Remove.
4176 (config_h): Remove S_FILE.
4177
4178 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4179
4180 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4181 Remove; moved to nt/config.nt.
4182
4183 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4184
4185 Use INTERNAL_FIELD for conses and overlays.
4186 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4187 Remove obsolete comment.
4188 (MVAR): New macro.
4189 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4190 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4191
4192 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4193
4194 Use INTERNAL_FIELD for symbols.
4195 * lisp.h (SVAR): New macro. Adjust users.
4196 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4197 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4198
4199 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4200
4201 Use INTERNAL_FIELD for processes.
4202 * process.h (PVAR): New macro. Adjust style.
4203 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4204 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4205
4206 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4207
4208 Use INTERNAL_FIELD for windows.
4209 * window.h (WVAR): New macro.
4210 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4211 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4212 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4213 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4214 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4215 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4216
4217 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4218
4219 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4220
4221 2012-08-01 Glenn Morris <rgm@gnu.org>
4222
4223 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4224 Move to configure.ac.
4225
4226 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4227
4228 * makefile.w32-in (CONFIG_H): Update dependencies.
4229 (CONF_POST_H): New macro.
4230
4231 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4232
4233 2012-07-31 Glenn Morris <rgm@gnu.org>
4234
4235 * Makefile.in (S_FILE): No longer set by configure.
4236
4237 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4238 is available.
4239 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4240
4241 * process.h (NULL_DEVICE):
4242 * emacs.c (SEPCHAR):
4243 * editfns.c (USER_FULL_NAME): Let configure set them.
4244
4245 * s/README, s/template.h: Remove files.
4246
4247 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4248
4249 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4250 Move to configure.ac.
4251
4252 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4253
4254 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4255 resulting renaming of 'struct frame' members.
4256
4257 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4258
4259 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4260 after introduction of FVAR.
4261
4262 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4263
4264 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4265
4266 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4267 instead of compositeToPoint.
4268 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4269
4270 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4271
4272 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4273
4274 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4275 * lisp.h (INTERNAL_FIELD): New macro.
4276 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4277 (BVAR): Change to use INTERNAL_FIELD.
4278 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4279 (KVAR): Change to use INTERNAL_FIELD.
4280 * frame.h (FVAR): New macro.
4281 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4282 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4283 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4284 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4285 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4286
4287 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4288
4289 Miscellaneous fixes for non-default X toolkits.
4290 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4291 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4292 Move under #ifdef USE_LUCID.
4293 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4294 definition and usage to avoid warnings.
4295
4296 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4297
4298 * nsterm.m (openFiles): Fix previous checkin.
4299
4300 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4301
4302 * indent.c (compute_motion): Remove unused local.
4303
4304 2012-07-31 Glenn Morris <rgm@gnu.org>
4305
4306 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4307
4308 * conf_post.h [USG5_4]:
4309 Move remaining contents of s/usg5-4-common.h here.
4310 * s/usg5-4-common.h: Remove file.
4311
4312 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4313 * s/irix6-5.h: Remove file.
4314
4315 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4316 * s/darwin.h: Remove file.
4317
4318 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4319 * s/hpux10-20.h: Remove file, which is now empty.
4320
4321 2012-07-30 Glenn Morris <rgm@gnu.org>
4322
4323 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4324 * Makefile.in (config_h): Add conf_post.h.
4325 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4326
4327 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4328
4329 * nsterm.m (ns_do_open_file): New variable.
4330 (ns_term_init): Set ns_do_open_file to YES after run returns.
4331 (openFile, openTempFile, openFileWithoutUI, openFiles):
4332 Open files only if ns_do_open_file.
4333
4334 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4335
4336 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4337 This no-op macro hasn't been needed for many years.
4338 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4339
4340 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4341 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4342 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4343 gdb_make_enums_visible.
4344 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4345 (DIRECTORY_SEP): Now a constant, not a macro.
4346
4347 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4348
4349 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4350 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4351
4352 * w32term.c <w32_keyboard_codepage>: Renamed from
4353 keyboard_codepage and now external. All users changed.
4354
4355 * w32term.h: Add declaration of w32_keyboard_codepage.
4356
4357 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4358 the codepage to translate keys to Unicode. If this argument is
4359 -1, use the value returned by GetConsoleCP. All callers changed.
4360
4361 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4362
4363 Update .PHONY listings in makefiles.
4364 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4365 bootstrap-clean, distclean, maintainer-clean, versioclean,
4366 extraclean, frc.
4367
4368 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4369 This is a bit clearer. Fix some commentary typos.
4370
4371 2012-07-30 Glenn Morris <rgm@gnu.org>
4372
4373 * s/netbsd.h: Let configure include signal.h if needed.
4374 Remove file, which is now empty.
4375
4376 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4377 Let configure set them.
4378 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4379 No more need to undefine.
4380
4381 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4382
4383 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4384 non-single-byte char when adding meta modifier. (Bug#12090)
4385
4386 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4387
4388 Convert safe_call to use variable number of arguments.
4389 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4390 (safe_call2): Fix comment.
4391 * lisp.h (safe_call): Adjust prototype.
4392 * coding.c (encode_coding_object): Change to use safe_call2.
4393 * xfaces.c (merge_face_heights): Change to use safe_call1.
4394
4395 2012-07-30 Glenn Morris <rgm@gnu.org>
4396
4397 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4398 does that unconditionally. Remove file, which is now empty.
4399
4400 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4401 Remove empty files.
4402
4403 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4404
4405 Export to GDB most of lisp.h's remaining object-like macros.
4406 * lisp.h (min, max): Move earlier, because they're used earlier now.
4407 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4408 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4409 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4410 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4411 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4412 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4413 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4414 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4415 Now constants, for GDB. They need not be macros.
4416 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4417 Now constants, for GDB, as well as macros, for static initializers.
4418 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4419 Move to after the definition of struct Lisp_Char_Table,
4420 since the former now needs that type defined.
4421 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4422 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4423 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4424 New enums, for gdb_make_enums_visible.
4425 (GLYPH_MODE_LINE_FACE): Remove; unused.
4426 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4427 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4428 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4429 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4430 enum maxargs, enum MAX_ALLOCA.
4431 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4432 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4433 no longer needed, now that they are done in lisp.h.
4434
4435 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4436
4437 Cleanup string bytes checking.
4438 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4439 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4440 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4441 (check_sblock, compact_small_strings): Simplify.
4442
4443 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4444
4445 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4446 These macros are confusing and no longer need to be defined, as
4447 the enum values now suffice. All uses replaced with definiens.
4448 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4449
4450 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4451
4452 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4453 ($(BLD)/w32console.$(O)): Update dependencies.
4454
4455 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4456
4457 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4458 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4459 time. Adjust users.
4460 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4461
4462 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4463
4464 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4465 setting sitelisp (Bug#12010).
4466
4467 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4468
4469 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4470
4471 * w32heap.c (cache_system_info):
4472 * w32.c (sys_rename):
4473 * w32proc.c (find_child_console, sys_kill): All users changed.
4474
4475 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4476
4477 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4478
4479 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4480
4481 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4482
4483 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4484
4485 Cleanup statistics calculation in Fgarbage_collect.
4486 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4487 Fix zombies percentage calculation. Simplify elapsed time calculation.
4488
4489 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4490
4491 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4492 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4493 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4494 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4495 (replace_range, replace_range_2, del_range_2): Change to eassert.
4496 * marker.c (byte_char_debug_check): Adjust style.
4497
4498 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4499
4500 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4501 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4502 long-ago-commented-out code that talks about "WIN32".
4503 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4504 All uses changed.
4505
4506 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4507
4508 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4509 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4510 Simplify by using alignof.
4511 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4512 * lisp.h: Include <stdalign.h>.
4513 (GCALIGNMENT): New macro and constant.
4514 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4515 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4516 (stdalign): New macro, if not already defined.
4517
4518 2012-07-28 Eli Zaretskii <eliz@gnu.org>
4519
4520 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4521 * w32inevt.c: Include w32inevt.h.
4522 (w32_read_console_input): New inline function, calls either
4523 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4524 w32_console_unicode_input.
4525 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4526 (w32_kbd_patch_key, key_event): Use the codepage returned by
4527 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4528 (key_event): use uChar.UnicodeChar only if
4529 w32_console_unicode_input is non-zero.
4530
4531 * w32console.c: Include w32heap.h.
4532 <w32_console_unicode_input>: New global variable.
4533 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4534 family of Windows, zero otherwise.
4535
4536 * w32inevt.h: Declare w32_console_unicode_input.
4537
4538 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4539 --without-x. (Bug#11742)
4540
4541 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4542
4543 Adjust GDB to reflect pvec_type changes (Bug#12036).
4544 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4545 2012-07-04 changes to pseudovector representation.
4546 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4547
4548 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
4549
4550 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4551 bus address.
4552 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4553
4554 2012-07-27 Eli Zaretskii <eliz@gnu.org>
4555
4556 * alloc.c (listn): Fix the order the arguments are consed onto the
4557 list.
4558
4559 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4560 enumeration constants, as PURE and HEAP are too general, and clash
4561 with other headers and sources, such as gmalloc.c and the
4562 MS-Windows system headers. All users changed.
4563
4564 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4565
4566 Revert last save_excursion_save and save_excursion_restore changes.
4567 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4568 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4569
4570 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4571
4572 Fix recently-introduced typos in Windows port.
4573 Reported by Martin Rudalics <rudalics@gmx.at>.
4574 * w32.c (init_environment): Replace comma with semicolon.
4575 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4576
4577 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4578
4579 Improve GDB symbol export (Bug#12036).
4580 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4581 arms of an 'if', not using conditional expressions; otherwise GDB
4582 complains about the types in the unevaluated arm when the argument
4583 is an integer literal.
4584 (xgetint): Simplify expression.
4585 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4586 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4587 Zaretskii in <http://bugs.gnu.org/12036#13>.
4588 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4589 needed now that we have gdb_make_enums_visible.
4590 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4591 (enum enum_USE_LSB_TAG):
4592 New enum types, packaging up enums that need to be exported to GDB.
4593
4594 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4595
4596 Utility function to make a list from specified amount of objects.
4597 * lisp.h (enum constype): New datatype.
4598 (listn): New prototype.
4599 * alloc.c (listn): New function.
4600 (Fmemory_use_count, syms_of_alloc): Use it.
4601 * buffer.c (syms_of_buffer): Likewise.
4602 * callint.c (syms_of_callint): Likewise.
4603 * charset.c (define_charset_internal): Likewise.
4604 * coding.c (syms_of_coding): Likewise.
4605 * keymap.c (syms_of_keymap): Likewise.
4606 * search.c (syms_of_search): Likewise.
4607 * syntax.c (syms_of_syntax): Likewise.
4608 * w32.c (init_environment): Likewise.
4609 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4610 * xdisp.c (syms_of_xdisp): Likewise.
4611 * xfns.c (syms_of_xfns): Likewise.
4612
4613 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4614
4615 Fast save_excursion_save and save_excursion_restore.
4616 * lisp.h (struct Lisp_Excursion): New data type.
4617 (PVEC_EXCURSION): New pseudovector type.
4618 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4619 to deal with it. Adjust comments.
4620 (init_marker, attach_marker): New prototype.
4621 (unchain_marker): Adjust prototype.
4622 * marker.c (attach_marker): Change to global.
4623 (init_marker): New function.
4624 * alloc.c (Fmake_marker, build_marker): Use it.
4625 (build_marker): More easserts.
4626 (mark_object): Handle struct Lisp_Excursion.
4627 * editfns.c (save_excursion_save, save_excursion_restore):
4628 Reimplement to use struct Lisp_Excursion. Add comments.
4629
4630 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4631
4632 Fix export of symbols to GDB (Bug#12036).
4633 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4634 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4635 emacs.c, as this is a more-suitable home. Had this been done earlier
4636 the fix for 12036 would have avoided some of the problems noted in
4637 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4638 would have been more obvious.
4639 * emacs.c: Do not include <verify.h>; no longer needed.
4640 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4641 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4642 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4643 Remove; now done in lisp.h.
4644 * lisp.h (PUBLISH_TO_GDB): New macro.
4645 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4646 (DATA_SEG_BITS): Use it.
4647 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4648 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4649 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4650 not be usable in #if. This simplifies things.
4651
4652 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
4653
4654 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4655
4656 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4657
4658 Simplify export of symbols to GDB (Bug#12036).
4659 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4660 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4661 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4662 Adjust to changes in lisp.h and emacs.c, by using
4663 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4664 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4665 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4666 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4667 instead of gdb_valbits.
4668 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4669 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4670 instead of gdb_array_mark_flag.
4671 (xboolvector): Get size from $->size, not $->header.size.
4672 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4673 (xreload, hook-run, hookpost-run): Remove.
4674 * emacs.c: Include <verify.h>.
4675 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4676 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4677 Remove.
4678 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4679 (gdb_USE_LSB_TAG): New enum constants.
4680 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4681 Also define these as enum constants, so they're visible to GDB.
4682 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4683 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4684 as constants, so they're visible to GDB.
4685 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4686 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4687 Now enum constants, not macros, so they're visible to GDB.
4688 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4689 more convenient now. All uses changed.
4690 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4691 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4692
4693 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4694
4695 Explicitly free restriction data that are not needed anymore.
4696 * editfns.c (save_restriction_restore): Free restriction data.
4697
4698 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4699
4700 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4701 add argument, tune behavior, and adjust all callers.
4702
4703 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4704
4705 Use typedef for EMACS_INT, EMACS_UINT.
4706 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4707 than macros. This simplifies debugging in the usual case, since
4708 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4709 and it allows expressions involving EMACS_INT casts.
4710 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4711
4712 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4713
4714 * nsterm.m (ns_read_socket): Return early if there is a modal
4715 window (Bug#12043).
4716
4717 2012-07-25 Martin Rudalics <rudalics@gmx.at>
4718
4719 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4720 that FOCUS-FRAME can be omitted.
4721
4722 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4723
4724 Adjust buffer text indirection counters at the end of Fkill_buffer.
4725 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4726 buffer is definitely dead. This should really fix an issue reported
4727 by Christoph Scholtes again. (Bug#12007).
4728 (init_buffer_once): Initialize indirection counters of
4729 buffer_defaults and buffer_local_symbols (for sanity and safety).
4730
4731 2012-07-24 Eli Zaretskii <eliz@gnu.org>
4732
4733 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4734 and continuation glyphs on tooltip frames, leave them at zero.
4735 Avoids continued lines in tooltips. (Bug#11832)
4736
4737 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4738
4739 Simplify copy_overlay.
4740 * buffer.c (copy_overlay): Simplify. Use build_marker.
4741 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4742
4743 2012-07-23 Eli Zaretskii <eliz@gnu.org>
4744
4745 * print.c (print_object): Don't crash when a frame's name is nil
4746 or invalid. (Bug#12025)
4747
4748 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4749 it signals an error when a tooltip frame is being created.
4750
4751 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4752
4753 Cleanup miscellaneous objects allocation and initialization.
4754 * alloc.c (allocate_misc): Change to static. Add argument to
4755 specify the subtype. Adjust comment and users.
4756 (build_overlay): New function.
4757 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4758 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4759 (allocate_misc): Remove prototype.
4760 (build_overlay): Add prototype.
4761
4762 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4763
4764 Swap buffer text indirection counters in Fbuffer_swap_text.
4765 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4766 This avoids crash reported by Christoph Scholtes at
4767 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4768
4769 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4770
4771 * nsmenu.m (Popdown_data): New struct.
4772 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4773 free Popdown_data.
4774 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4775 (initWithContentRect): Make imgView and contentView non-static
4776 and autorelease them. Also autorelease img and matrix (Bug#12005).
4777 (dealloc): Remove (Bug#12005).
4778
4779 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4780
4781 Adjust consing_since_gc when objects are explicitly freed.
4782 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4783 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4784 (free_cons, free_misc): Subtract object size from consing_since_gc.
4785
4786 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4787
4788 Simplify and cleanup markers positioning code.
4789 * marker.c (attach_marker): More useful eassert.
4790 (live_buffer, set_marker_internal): New function.
4791 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4792 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4793
4794 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4795
4796 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4797 as it's limited by the amount of memory, not by INT_MAX.
4798
4799 2012-07-21 Eli Zaretskii <eliz@gnu.org>
4800
4801 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4802 in special-event-map. See the discussion at
4803 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4804 for the reasons.
4805
4806 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4807 info.dwItemData. Fixes crashes on 64-bit Windows.
4808 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4809
4810 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4811
4812 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4813 (conversationIdentifier): Return value is NSInteger.
4814 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4815
4816 2012-07-21 Chong Yidong <cyd@gnu.org>
4817
4818 * window.c (decode_any_window): Signal an error if the window is
4819 on a dead frame (Bug#11984).
4820
4821 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4822
4823 Add indirection counting to speed up Fkill_buffer.
4824 * buffer.h (struct buffer): New member.
4825 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4826 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4827 base buffer indirection counter.
4828 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4829 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4830 through buffer list if indirection counter is 0.
4831
4832 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4833
4834 Extend the value returned by Fgarbage_collect with heap statistics.
4835 * alloc.c (Qheap): New symbol.
4836 (syms_of_alloc): DEFSYM it.
4837 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4838 (Fmemory_free): Remove.
4839 (syms_of_alloc): Don't defsubr it.
4840 * buffer.c (Fcompact_buffer): Remove.
4841 (syms_of_buffer): Don't defsubr it.
4842
4843 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4844
4845 Make maybe_gc inline.
4846 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4847 * lisp.h (consing_since_gc, gc_relative_threshold)
4848 (memory_full_cons_threshold): Revert declaration.
4849 (maybe_gc): Remove prototype, define as inline.
4850 * alloc.c: Remove old commented-out code.
4851 (consing_since_gc, gc_relative_threshold)
4852 (memory_full_cons_threshold): Revert to global.
4853 (maybe_gc): Remove.
4854
4855 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4856
4857 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4858 * lisp.h (build_unibyte_string): New function.
4859 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4860 * sysdep.c, w32fns.c, xfns.c: Use it.
4861 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4862 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4863 Adjust users accordingly.
4864 * font.h (font_open_by_name): Adjust prototype.
4865
4866 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4867
4868 Cleanup calls to Fgarbage_collect.
4869 * lisp.h (maybe_gc): New prototype.
4870 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4871 Remove declarations.
4872 * alloc.c (maybe_gc): New function.
4873 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4874 Make them static.
4875 * bytecode.c (MAYBE_GC): Use maybe_gc.
4876 * eval.c (eval_sub, Ffuncall): Likewise.
4877 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4878 to avoid dependency from auto-save feature.
4879
4880 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4881
4882 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4883 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4884 'for_each_per_buffer_object_at'.
4885 All uses changed. It's better to use upper-case for macros that
4886 cannot be implemented as functions, to give the reader a clue
4887 that they're special.
4888
4889 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4890
4891 * alloc.c (Fgarbage_collect): Tweak docstring.
4892
4893 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4894
4895 Tweak the value returned from Fgarbage_collect again.
4896 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4897 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4898 Adjust documentation.
4899 (total_vector_bytes): Rename to total_vector_slots, adjust
4900 accounting.
4901 (total_free_vector_bytes): Rename to total_free_vector_slots,
4902 adjust accounting.
4903 (Qstring_bytes, Qvector_slots): New symbols.
4904 (syms_of_alloc): DEFSYM them.
4905
4906 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4907
4908 Buffer compaction primitive which may be used from Lisp.
4909 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4910 (syms_of_buffer): Register Fcompact_buffer.
4911 * alloc.c (Fgarbage_collect): Use compact_buffer.
4912 * buffer.h (compact_buffer): New prototype.
4913 (struct buffer_text): New member.
4914
4915 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4916
4917 New macro to iterate over all buffers, miscellaneous cleanups.
4918 * lisp.h (all_buffers): Remove declaration.
4919 * buffer.h (all_buffers): Add declaration, with comment.
4920 (for_each_buffer): New macro.
4921 * alloc.c (Fgarbage_collect, mark_object): Use it.
4922 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4923 (init_buffer): Likewise.
4924 * data.c (Fset_default): Likewise.
4925 * coding.c (code_conversion_restore): Remove redundant check
4926 for dead buffer.
4927 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4928
4929 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4930
4931 Fix bug that created negative-length intervals.
4932 * intervals.c (merge_interval_right, merge_interval_left):
4933 Do not zero out this interval if it is absorbed by its children,
4934 as this interval's total length doesn't change in that case. See
4935 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4936
4937 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4938
4939 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4940 when invoking (make-bool-vector N t) and N is a positive
4941 multiple of 8 -- the last 8 bits were mistakenly cleared.
4942
4943 Remove some struct layout assumptions in bool vectors.
4944 * alloc.c (bool_header_size): New constant.
4945 (header_size, word_size): Move earlier, as they're now used earlier.
4946 Use 'word_size' in a few more places, where it's appropriate.
4947 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4948 padding before the data member of a bool vector.
4949 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4950 than doing the check by hand with an abort ().
4951
4952 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4953
4954 * eval.c (Fdefvar): Don't check constants since we only set the var if
4955 it's not yet defined anyway (bug#11904).
4956
4957 * lisp.h (last_undo_boundary): Declare new var.
4958 * keyboard.c (command_loop_1): Set it.
4959 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4960 were auto-added by the command loop (bug#11774).
4961
4962 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4963
4964 * w32font.c (Qsymbol): Remove local definition.
4965 (syms_of_w32font): Don't DEFSYM it.
4966
4967 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4968
4969 Fix sweep_vectors to handle large bool vectors correctly.
4970 * alloc.c (sweep_vectors): Account total_vector_bytes for
4971 bool vectors larger than VBLOCK_BYTES_MAX.
4972
4973 2012-07-18 Chong Yidong <cyd@gnu.org>
4974
4975 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4976 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4977
4978 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4979
4980 Return more descriptive data from Fgarbage_collect.
4981 Suggested by Stefan Monnier in
4982 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4983 * alloc.c (bounded_number): New function.
4984 (total_buffers, total_vectors): New variable.
4985 (total_string_size): Rename to total_string_bytes, adjust users.
4986 (total_vector_size): Rename to total_vector_bytes, adjust users.
4987 (sweep_vectors): Account total_vectors and total_vector_bytes.
4988 (Fgarbage_collect): New return value. Adjust documentation.
4989 (gc_sweep): Account total_buffers.
4990 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4991 (VECTOR_SIZE): Remove.
4992 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4993 (Qinterval, Qmisc): New symbols.
4994 (syms_of_data): Initialize them.
4995 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4996 (Qcons, Qbuffer): New declarations.
4997
4998 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4999
5000 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5001 Round up, not down. Improve doc.
5002
5003 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5004
5005 Restore old code in allocate_string_data to avoid Faset breakage.
5006 Reported by Julien Danjou <julien@danjou.info> in
5007 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5008 * alloc.c (allocate_string_data): Restore old code with minor
5009 adjustments, fix comment to explain this subtle issue.
5010
5011 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5012
5013 Remove FILE_SYSTEM_CASE.
5014 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5015
5016 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5017 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5018 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5019 call-process-region passes it through expand-file-name.
5020
5021 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5022
5023 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5024
5025 Fix crash when creating indirect buffer (Bug#11917)
5026 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5027 Don't handle unbound variables specially if non-zero.
5028 (Fbuffer_local_variables): Pass zero.
5029 (clone_per_buffer_values): Pass non-zero.
5030
5031 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5032
5033 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5034 to make the loop interruptible.
5035
5036 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5037
5038 * gnutls.c (emacs_gnutls_handshake): Only retry if
5039 GNUTLS_E_INTERRUPTED.
5040
5041 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5042
5043 Cleanup and convert miscellaneous checks to eassert.
5044 * alloc.c (mark_interval): Fix comment, partially rephrase
5045 old comment from intervals.h (see below).
5046 * intervals.c (find_interval, adjust_intervals_for_insertion)
5047 (delete_interval, adjust_intervals_for_deletion)
5048 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5049 Convert to eassert.
5050 (adjust_intervals_for_insertion, make_new_interval):
5051 Remove obsolete and unused code.
5052 * intervals.h (struct interval): Remove obsolete comment.
5053 * textprotp.c (erase_properties): Remove unused code.
5054 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5055 (Fremove_list_of_text_properties): Convert to eassert.
5056
5057 2012-07-17 Chong Yidong <cyd@gnu.org>
5058
5059 * editfns.c (Finsert_char): Doc fix.
5060
5061 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5062
5063 Fix previous change to make Fmemory_free always accurate.
5064 * alloc.c (make_interval): Update total_free_intervals.
5065 (make_float): Likewise for total_free_floats.
5066 (free_cons, Fcons): Likewise for total_free_conses.
5067 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5068 Likewise for total_free_vector_bytes.
5069 (Fmake_symbol): Likewise for total_free_symbols.
5070 (bytes_free): Remove.
5071
5072 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5073
5074 Simple free memory accounting feature.
5075 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5076 (sweep_vectors): Accumulate size of free vectors.
5077 (Fgarbage_collect): Setup bytes_free.
5078 (Fmemory_free): New function.
5079 (syms_of_alloc): Register it.
5080
5081 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5082
5083 Cleanup overlays checking.
5084 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5085 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5086 eassert and OVERLAYP.
5087 (sort_overlays): Change to use OVERLAYP.
5088
5089 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5090
5091 * editfns.c (Finsert_char): Make it interactive, and make the
5092 second arg optional. Copy interactive spec and docstring from
5093 ucs-insert.
5094
5095 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5096
5097 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5098 Unlike the other wrapped functions, fabs has an unspecified
5099 effect on errno.
5100
5101 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5102
5103 * nsterm.m (keyDown): Interpret flags without left/right bits
5104 as the left key (Bug#11670).
5105
5106 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5107
5108 Remove empty and useless init functions.
5109 * lisp.h (init_character_once, init_fns, init_image)
5110 (init_filelock, init_sound): Remove prototype.
5111 * character.c (init_character_once): Remove.
5112 * filelock.c (init_filelock): Likewise.
5113 * fns.c (init_fns): Likewise.
5114 * image.c (init_image): Likewise.
5115 * sound.c (init_sound): Likewise.
5116 * emacs.c (main): Adjust accordingly.
5117
5118 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5119
5120 * gtkutil.h: Tiny cleanups.
5121 (use_old_gtk_file_dialog): Remove useless declaration.
5122 (xg_uses_old_file_dialog): Add suggested const attribute.
5123
5124 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5125
5126 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5127 (bidi_paragraph_init): Use it to limit search forward for a strong
5128 directional character in abnormally large paragraphs full of
5129 neutral or weak characters. (Bug#11943)
5130
5131 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5132
5133 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5134 the toolbar (Bug#9451).
5135 (xg_make_tool_item): Give the widget event box a transparent
5136 background.
5137
5138 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5139
5140 Cleanup basic allocation variables and functions.
5141 * alloc.c (ignore_warnings, init_intervals, init_float)
5142 (init_cons, init_symbol, init_marker): Remove.
5143 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5144 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5145 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5146 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5147 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5148 (staticidx, init_alloc_once, init_strings, free_ablock):
5149 Remove redundant initialization.
5150 * fns.c (init_weak_hash_tables): Remove.
5151 * lisp.h (init_weak_hash_tables): Remove prototype.
5152
5153 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5154
5155 Use zero_vector where appropriate.
5156 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5157 accordingly.
5158 * lisp.h (zero_vector): New declaration.
5159 * font.c (null_vector): Remove.
5160 (syms_of_font): Remove initialization and staticpro.
5161 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5162 * keymap.c (Faccessible_keymaps): Likewise.
5163
5164 2012-07-15 Leo Liu <sdl.web@gmail.com>
5165
5166 * fringe.c: Fix typo in comments.
5167
5168 2012-07-14 Leo Liu <sdl.web@gmail.com>
5169
5170 * fringe.c: Add a new bitmap exclamation-mark.
5171
5172 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5173
5174 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5175
5176 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5177 (HAVE_MENUS): Don't define, defined by editing config.in with
5178 msdos/sed2v2.inp.
5179 (GMALLOC_INHIBIT_VALLOC): Don't define.
5180 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5181
5182 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5183
5184 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5185
5186 2012-07-14 Glenn Morris <rgm@gnu.org>
5187
5188 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5189 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5190 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5191
5192 2012-07-13 Glenn Morris <rgm@gnu.org>
5193
5194 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5195
5196 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5197 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5198
5199 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5200
5201 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5202 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5203 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5204 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5205 where appropriate.
5206 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5207 as boolean expression.
5208 (x_set_window_size): Remove unused variable toolbar.
5209 (ns_get_color_default, ns_mod_to_lisp): Remove.
5210 (ns_mouse_position): Remove unused variables xchar and ychar.
5211 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5212 (ns_set_vertical_scroll_bar): Remove unused variable count.
5213 (ns_delete_terminal): Remove unused variable i.
5214 (ns_term_init): Remove unused variables r, g and b.
5215 (mouseDown): Remove unused variable window.
5216 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5217 (initFrameFromEmacs): Remove unused variable vbextra.
5218 (mouseEntered): Remove unused variables p and dpyinfo.
5219 (mouseExited): Remove unused variables p and r.
5220 (ns_define_frame_cursor, ns_clear_frame_area)
5221 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5222 (menuDown): Assign [sender tag] to variable and cast the variable.
5223
5224 * nsterm.h (menuDown): Add id as type to argument sender.
5225 (ns_display_info_for_name): Add Lisp_Object argument.
5226 (ns_term_init): Add Lisp_Object argument.
5227 (ns_map_event_to_object): Add void argument.
5228 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5229 prototype with arguments and only declare if __OBJC__.
5230 (nxatoms_of_nsselect): Add void argument.
5231 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5232 (ns_alloc_autorelease_pool): Add void argument.
5233 (ns_release_autorelease_pool): Add void* argument.
5234 (ns_get_defaults_value): Add const char* argument.
5235
5236 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5237 (initFromContents): Use SSDATA where appropriate.
5238 (ns_update_menubar): Add braces to ambigous if-else.
5239 (initWithTitle): Put () around assignment in if statement.
5240 (ns_menu_show): Remove unused variables window and keymap.
5241 (update_frame_tool_bar): Remove unused variable selected_p.
5242 (initWithContentRect): Remove unused variable this_cmd_name.
5243
5244 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5245 appropriate.
5246 (setXBMColor): Remove unused variable len.
5247 (setPixmapData): Put () around assignment in loop statement.
5248
5249 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5250 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5251 where appropriate.
5252 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5253 around assignment in loop statement.
5254 (nsfont_open): Remove unused variable i.
5255 (nsfont_open): Remove unused variable len.
5256 (nsfont_draw): Remove unused variable cs.
5257
5258 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5259 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5260 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5261 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5262 (Fns_font_name, Fns_perform_service)
5263 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5264 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5265 (ns_set_name): Remove unused variable view.
5266 (x_set_menu_bar_lines): Remove unused variable olines.
5267 (x_set_tool_bar_lines): Remove unused variable root_window.
5268 (Fns_list_colors): Put () around assignment in while statement.
5269 (Fns_perform_service): Remove unused variable len.
5270 (Fns_display_usable_bounds): Remove unused variable top.
5271 (syms_of_nsfns): Remove unused variable i.
5272
5273 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5274 memcpy (Bug#11907).
5275
5276 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5277
5278 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5279 and free it with DestroyExceptionInfo (Bug#11558).
5280
5281 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5282
5283 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5284 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5285 Set here, not in nt/config.nt.
5286
5287 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5288
5289 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5290 cursor overflow into the last glyph on display line when the right
5291 fringe is off. (Bug#11832)
5292
5293 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5294
5295 * xdisp.c (produce_special_glyphs): Now static.
5296 * dispextern.h (produce_special_glyphs): Remove decl.
5297
5298 2012-07-13 Glenn Morris <rgm@gnu.org>
5299
5300 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5301 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5302
5303 * s/usg5-4-common.h (USG, USG5):
5304 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5305 * s/sol2-6.h (SOLARIS2):
5306 * s/irix6-5.h (IRIX6_5):
5307 * s/hpux10-20.h (USG, USG5, HPUX):
5308 * s/gnu-linux.h (USG, GNU_LINUX):
5309 * s/freebsd.h (BSD_SYSTEM):
5310 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5311 * s/cygwin.h (CYGWIN):
5312 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5313 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5314
5315 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5316
5317 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5318
5319 2012-07-13 Glenn Morris <rgm@gnu.org>
5320
5321 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5322
5323 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5324
5325 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5326 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5327
5328 2012-07-12 Glenn Morris <rgm@gnu.org>
5329
5330 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5331
5332 * process.c (init_process_emacs): Rename from init_process.
5333 The old name is also the name of a Mach system call.
5334 * lisp.h, emacs.c: Update for this name change.
5335 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5336 longer needed.
5337
5338 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5339
5340 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5341 memmove call that removes glyphs covered by the left truncation
5342 glyph. Improve commentary.
5343 (display_line): Fix display of continuation glyphs on GUI frames
5344 when the right fringe is turned off and variable-size fonts are
5345 used in the window. Move the code that appends a stretch glyph to
5346 produce_special_glyphs, so that it could be used for truncation
5347 and continuation glyphs alike.
5348 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5349 glyph of a suitably computed width, to align the special glyphs at
5350 the window margin. Code moved from display_line. (Bug#11832)
5351
5352 2012-07-12 Glenn Morris <rgm@gnu.org>
5353
5354 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5355
5356 * s/gnu-linux.h, s/hpux10-20.h:
5357 Do not unconditionally define HAVE_XRMSETDATABASE.
5358
5359 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5360
5361 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5362
5363 Fix typos that broke OS X build.
5364 Reported by Randal L. Schwartz in
5365 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5366 * nsterm.m (ns_timeout): Add missing local decl.
5367 (ns_get_color): snprintf -> sprintf, to fix typo.
5368
5369 2012-07-12 Glenn Morris <rgm@gnu.org>
5370
5371 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5372 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5373 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5374 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5375
5376 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5377 Move PTY_OPEN to configure.
5378
5379 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5380 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5381 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5382
5383 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5384
5385 Use empty_unibyte_string where applicable.
5386 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5387 * lread.c (read1): Likewise.
5388 * xsettings.c (syms_of_xsettings): Likewise.
5389
5390 2012-07-12 Glenn Morris <rgm@gnu.org>
5391
5392 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5393 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5394 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5395 * s/hpux10-20.h (RUN_TIME_REMAP):
5396 * s/bsd-common.h (TABDLY): Move to configure.
5397
5398 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5399
5400 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5401
5402 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5403 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5404
5405 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5406
5407 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5408 * s/template.h: Move NARROWPROTO to configure.
5409
5410 2012-07-11 Glenn Morris <rgm@gnu.org>
5411
5412 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5413 unused since 2011-01-17 change to systty.h.
5414
5415 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5416 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5417 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5418
5419 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5420
5421 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5422
5423 2012-07-11 Glenn Morris <rgm@gnu.org>
5424
5425 * s/darwin.h, s/gnu-linux.h, s/template.h:
5426 Move INTERRUPT_INPUT to configure.
5427
5428 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5429
5430 Minor adjustments to interning code.
5431 * lisp.h (intern, intern_c_string): Redefine as static inline
5432 wrappers for intern_1 and intern_c_string_1, respectively.
5433 (intern_1, intern_c_string_1): Rename prototypes.
5434 * lread.c (intern_1, intern_c_string_1, oblookup):
5435 Simplify Vobarray checking.
5436 * font.c (font_intern_prop): Likewise. Adjust comment.
5437 * w32font.c (intern_font_name): Likewise.
5438
5439 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5440
5441 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5442
5443 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5444 of Fcar/Fcdr if possible.
5445 * font.c (check_otf_features): Likewise.
5446 * fontset.c (Fnew_fontset): Likewise.
5447 * gnutls.c (Fgnutls_boot): Likewise.
5448 * minibuf.c (read_minibuf): Likewise.
5449 * msdos.c (IT_set_frame_parameters): Likewise.
5450 * xmenu.c (Fx_popup_dialog): Likewise.
5451 * w32menu.c (Fx_popup_dialog): Likewise.
5452
5453 2012-07-11 Glenn Morris <rgm@gnu.org>
5454
5455 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5456 since nothing has defined it on these platforms.
5457
5458 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5459 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5460
5461 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5462 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5463 Move CLASH_DETECTION to configure.
5464
5465 * s/gnu.h: Remove file, which is now empty.
5466
5467 * s/gnu.h, s/gnu-linux.h:
5468 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5469
5470 2012-07-11 John Wiegley <johnw@newartisans.com>
5471
5472 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5473 function attribute, so we only use it if it exists in the
5474 compiler.
5475
5476 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5477
5478 Avoid call to strlen in fast_c_string_match_ignore_case.
5479 * search.c (fast_c_string_match_ignore_case): Change to use
5480 length argument. Adjust users accordingly.
5481 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5482
5483 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5484
5485 Assume mkdir, rmdir.
5486 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5487 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5488
5489 Assume rename.
5490 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5491
5492 Assume perror.
5493 * s/hpux10-20.h (HAVE_PERROR): Remove.
5494 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5495 Remove dummy definition, as this problem was obsolete long ago.
5496
5497 Assume strerror.
5498 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5499
5500 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5501
5502 Avoid calls to strlen in font processing functions.
5503 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5504 (font_open_by_name): Change to use length argument.
5505 Adjust users accordingly.
5506 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5507 Adjust prototypes.
5508 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5509 Change to return ptrdiff_t.
5510 (xfont_list_pattern, xfont_match): Use length returned by
5511 xfont_decode_coding_xlfd.
5512 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5513
5514 2012-07-11 Glenn Morris <rgm@gnu.org>
5515
5516 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5517 Move DONT_REOPEN_PTY to configure.
5518
5519 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5520 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5521
5522 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5523
5524 Remove "#define unix" that is no longer needed (Bug#11905).
5525 * s/aix4-2.h (unix): Remove; no longer needed.
5526
5527 EMACS_TIME simplification (Bug#11875).
5528 This replaces macros (which typically do not work in GDB)
5529 with functions, typedefs and enums, making the code easier to debug.
5530 The functional style also makes code easier to read and maintain.
5531 * systime.h: Include <sys/time.h> on all hosts, not just if
5532 WINDOWSNT, since 'struct timeval' is needed in general.
5533 (EMACS_TIME): Now a typedef, not a macro.
5534 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5535 not macros.
5536 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5537 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5538 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5539 (EMACS_TIME_LE): Now functions, not macros.
5540 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5541 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5542 which are not functions. All uses rewritten to use:
5543 (make_emacs_time): New function.
5544 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5545 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5546 not functions. All uses rewritten to use the following, respectively:
5547 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5548 (add_emacs_time, sub_emacs_time): New functions.
5549 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5550 * fileio.c (Fcopy_file):
5551 * xterm.c (XTflash): Get the current time closer to when it's used.
5552 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5553
5554 * bytecode.c (targets): Suppress -Woverride-init warnings.
5555
5556 Simplify by avoiding confusing use of strncpy etc.
5557 * doc.c (Fsnarf_documentation):
5558 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5559 * frame.c (Fmake_terminal_frame):
5560 * gtkutil.c (get_utf8_string):
5561 * lread.c (openp):
5562 * nsmenu.m (ns_update_menubar):
5563 * regex.c (regerror):
5564 Prefer memcpy to strncpy and strncat when either will do.
5565 * fileio.c (Fsubstitute_in_file_name):
5566 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5567 (menu_separator_name_p):
5568 * nsmenu.m (ns_update_menubar):
5569 Prefer memcmp to strncmp when either will do.
5570 * nsterm.m: Include <ftoastr.h>.
5571 (ns_get_color):
5572 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5573 Prefer snprintf to strncpy.
5574 * nsterm.m (ns_term_init):
5575 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5576 * nsterm.m (ns_term_init):
5577 Avoid the need for strncpy, by using build_string or
5578 make_unibyte_string directly. Use dtoastr, not snprintf.
5579 * process.c (Fmake_network_process): Diagnose service names that
5580 are too long, rather than silently truncating them or creating
5581 non-null-terminated names.
5582 (Fnetwork_interface_info): Likewise, for interface names.
5583 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5584 Prefer sprintf to strncat.
5585 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5586 Prefer vsnprintf to vsprintf + strncpy.
5587
5588 2012-07-10 Glenn Morris <rgm@gnu.org>
5589
5590 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5591 Clarify fallback case.
5592
5593 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5594
5595 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5596 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5597 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5598 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5599 where argument type is known to be a Lisp_Cons.
5600
5601 2012-07-10 Tom Tromey <tromey@redhat.com>
5602
5603 * bytecode.c (BYTE_CODE_THREADED): New macro.
5604 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5605 (enum byte_code_op): New type.
5606 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5607 (exec_byte_code): Use them. Use token threading when applicable.
5608
5609 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5610
5611 Optimize pure C strings initialization.
5612 * lisp.h (make_pure_string): Fix prototype.
5613 (build_pure_c_string): New function, defined as static inline. This
5614 provides a better opportunity to optimize away calls to strlen when
5615 the function is called with compile-time constant argument.
5616 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5617 argument, adjust users accordingly. Use build_pure_c_string where
5618 appropriate.
5619 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5620 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5621 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5622
5623 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5624
5625 Avoid calls to strlen in miscellaneous functions.
5626 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5627 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5628 * lread.c (openp): Likewise.
5629
5630 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5631
5632 Avoid calls to strlen in path processing functions.
5633 * fileio.c (file_name_as_directory): Add comment. Change to add
5634 srclen argument and return the length of result. Adjust users
5635 accordingly.
5636 (directory_file_name): Fix comment. Change to add srclen argument,
5637 swap 1st and 2nd arguments to obey the common convention.
5638 Adjust users accordingly.
5639 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5640
5641 2012-07-10 Glenn Morris <rgm@gnu.org>
5642
5643 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5644 Move PENDING_OUTPUT_COUNT definition to configure.
5645
5646 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5647 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5648 * s/gnu.h (DATA_START): Move definitions to configure.
5649
5650 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5651 We include usg5-4-common.h, which defines them both.
5652
5653 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5654 O_RDONLY already includes it).
5655
5656 Stop ns builds setting the EMACSLOADPATH environment variable.
5657 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5658 Now it does not set EMACSLOADPATH, just returns the load-path string.
5659 * nsterm.h: Update accordingly.
5660 * lread.c [HAVE_NS]: Include nsterm.h.
5661 (init_lread) [HAVE_NS]: Use ns_load_path.
5662 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5663
5664 2012-07-09 Glenn Morris <rgm@gnu.org>
5665
5666 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5667 since the included bsd-common.h does so.
5668
5669 Stop ns builds setting the EMACSPATH environment variable.
5670 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5671 (ns_init_paths): Do not set EMACSPATH.
5672 * nsterm.h (ns_exec_path): Add it.
5673 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5674 Use ns_exec_path.
5675
5676 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5677
5678 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5679
5680 * process.c (wait_reading_process_output): 'waitchannels' was unset
5681 when read_kbd || !NILP (wait_for_cell); fix this.
5682
5683 Add GCC-style 'const' attribute to functions that can use it.
5684 * character.h (char_resolve_modifier_mask):
5685 * keyboard.h (make_ctrl_char):
5686 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5687 (init_character_once, next_almost_prime, init_fns, init_image)
5688 (flush_pending_output, init_sound):
5689 * mem-limits.h (start_of_data):
5690 * menu.h (finish_menu_items):
5691 Add ATTRIBUTE_CONST.
5692 * emacs.c (DEFINE_DUMMY_FUNCTION):
5693 Declare the dummy function with ATTRIBUTE_CONST.
5694 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5695 Add decls with ATTRIBUTE_CONST.
5696
5697 Minor improvements to make_formatted_string.
5698 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5699 where int is good enough, as vsprintf returns an int.
5700 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5701
5702 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5703
5704 Use make_formatted_string to avoid double length calculation.
5705 * lisp.h (make_formatted_string): New prototype.
5706 * alloc.c (make_formatted_string): New function.
5707 * buffer.c (Fgenerate_new_buffer_name): Use it.
5708 * dbus.c (syms_of_dbusbind): Likewise.
5709 * editfns.c (Fcurrent_time_zone): Likewise.
5710 * filelock.c (get_boot_time): Likewise.
5711 * frame.c (make_terminal_frame, set_term_frame_name)
5712 (x_report_frame_params): Likewise.
5713 * image.c (gs_load): Likewise.
5714 * minibuf.c (get_minibuffer): Likewise.
5715 * msdos.c (dos_set_window_size): Likewise.
5716 * process.c (make_process): Likewise.
5717 * xdisp.c (ensure_echo_area_buffers): Likewise.
5718 * xsettings.c (apply_xft_settings): Likewise.
5719
5720 2012-07-09 Glenn Morris <rgm@gnu.org>
5721
5722 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5723 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5724 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5725 * nsterm.h (ns_etc_directory): Add it.
5726 * callproc.c [HAVE_NS]: Include nsterm.h.
5727 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5728
5729 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5730
5731 Move marker debugging code under MARKER_DEBUG.
5732 * marker.c (MARKER_DEBUG): Move marker debugging code under
5733 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5734 for bootstrap with --enable-checking (~3x slowdown reported
5735 by Juanma Barranquero <lekktu@gmail.com>).
5736 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5737
5738 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5739
5740 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5741 See <http://bugs.gnu.org/11825#29>.
5742
5743 2012-07-08 Eli Zaretskii <eliz@gnu.org>
5744
5745 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5746 has no font, use the frame's font. (Bug#11813)
5747 (display_line): Add commentary about displaying truncation glyphs
5748 on GUI frames.
5749 (produce_special_glyphs): Move here from term.c.
5750
5751 * term.c (produce_special_glyphs): Move to xdisp.c.
5752
5753 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5754 section.
5755
5756 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5757
5758 * xdisp.c (display_line): Avoid warning about implicit declaration
5759 of FRAME_FONT.
5760
5761 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5762
5763 * lisp.h: Remove empty conditional.
5764
5765 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5766
5767 * lread.c (load_path_check): Now static.
5768
5769 Fix some minor --with-ns problems found by static checking.
5770 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5771 (x_set_font) [!HAVE_X_WINDOWS]:
5772 * image.c (xpm_load_image) [HAVE_NS]:
5773 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5774 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5775 Remove unused local.
5776 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5777 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5778 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5779 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5780 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5781 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5782 Fix pointer signedness problem.
5783 * xfaces.c (FRAME_X_FONT_TABLE):
5784 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5785
5786 2012-07-07 Glenn Morris <rgm@gnu.org>
5787
5788 * lread.c (load_path_check): New function, split from init_lread.
5789 (init_lread): Reorganize. Motivation:
5790 If EMACSLOADPATH is set, check/warn about that rather than the
5791 defaults, which we are not going to use. Hence we can remove
5792 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5793 Don't warn if site-lisp directories are missing.
5794 If not installed, start from a blank load-path, since
5795 PATH_LOADSEARCH refers to the eventual installation directories.
5796
5797 2012-07-07 Eli Zaretskii <eliz@gnu.org>
5798
5799 Support truncation and continuation glyphs on GUI frames, when
5800 fringes are disabled. (Bug#11832)
5801 * xdisp.c (init_iterator): Get dimensions of truncation and
5802 continuation glyphs even if on GUI frames.
5803 Adjust it->last_visible_x on GUI frames when the left or right fringes,
5804 or both, are absent.
5805 (start_display, move_it_in_display_line_to): Handle the case of a
5806 GUI frame without a fringe to display continuation or truncation
5807 glyphs.
5808 (insert_left_trunc_glyphs): Support GUI frames: make sure
5809 truncation glyphs overwrite enough glyphs from the current line to
5810 have sufficient space in pixels.
5811 (display_line): Support truncation and continuation glyphs on GUI
5812 frames. If some spare pixels are left on the line after inserting
5813 the truncation glyphs, fill that space with a stretch glyph of a
5814 suitably computed width.
5815
5816 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5817 produce_glyphs, to support GUI sessions.
5818
5819 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5820
5821 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5822
5823 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5824
5825 Do not require float-time's arg to fit in time_t (Bug#11825).
5826 This works better on hosts where time_t is unsigned, and where
5827 float-time is applied to the (negative) difference between two times.
5828 * editfns.c (decode_time_components): Last arg is now double *,
5829 not int *, and means to store all the result as a double, without
5830 worrying about whether the seconds part fits in time_t.
5831 All callers changed.
5832 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5833 All callers changed.
5834 (Ffloat_time): Do not fail merely because the specified time falls
5835 outside of time_t range.
5836
5837 2012-07-07 Glenn Morris <rgm@gnu.org>
5838
5839 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5840 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5841 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5842
5843 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
5844
5845 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5846 Update dependencies.
5847
5848 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5849
5850 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5851
5852 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5853 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5854 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5855 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5856 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5857 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5858
5859 * xfont.c (compare_font_names): Redo to omit the need for casts.
5860
5861 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5862
5863 * xfns.c (Fx_change_window_property): Doc fix.
5864 * w32fns.c (Fx_change_window_property): Doc fix.
5865
5866 * w32fns.c (Fx_window_property): Accept the same arguments as the
5867 X Windows version. Doc fix.
5868 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5869
5870 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5871 Eli Zaretskii <eliz@gnu.org>
5872
5873 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5874 Windows-specific code from nt/config.nt moved here.
5875 Obsolete settings removed.
5876
5877 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5878
5879 * process.c: Avoid unnecessary calls to gettime.
5880 (wait_reading_process_output): Don't get the time of day
5881 when gobbling data immediately and not waiting, as there's no need
5882 for it in that case. This removes a FIXME.
5883
5884 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5885
5886 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5887 is defined (Bug#11768).
5888
5889 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5890
5891 Fix marker debugging code.
5892 * marker.c (byte_char_debug_check): Do not perform the check
5893 if buffer is not multibyte.
5894 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5895 Call byte_char_debug_check with correct arguments.
5896
5897 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5898
5899 Compile marker debugging code only if ENABLE_CHECKING is defined.
5900 * marker.c (byte_char_debug_check, count_markers):
5901 Use only if ENABLE_CHECKING is defined.
5902 (byte_debug_flag): Remove.
5903 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5904 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5905
5906 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5907
5908 Avoid code repetition in marker-related functions.
5909 * marker.c (attach_marker): New function.
5910 (Fset_marker, set_marker_restricted, set_marker_both)
5911 (set_marker_restricted_both): Use it.
5912 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5913 Consistently rename charno to charpos.
5914 (marker_position): Add eassert.
5915 (marker_byte_position): Convert to eassert.
5916
5917 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5918
5919 Simplify list operations in unchain_overlay and unchain_marker.
5920 * buffer.c (unchain_overlay): Simplify. Add comment.
5921 * marker.c (unchain_marker): Simplify. Fix comments.
5922
5923 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5924
5925 Introduce fast path for the widely used marker operation.
5926 * alloc.c (build_marker): New function.
5927 * lisp.h (build_marker): New prototype.
5928 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5929 * composite.c (autocmp_chars): Likewise.
5930 * editfns.c (buildmark): Remove.
5931 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5932 (save_restriction_save): Use build_marker.
5933 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5934 * window.c (save_window_save): Likewise.
5935
5936 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5937
5938 Do not use Fdelete_overlay in delete_all_overlays
5939 to avoid redundant calls to unchain_overlay.
5940 * buffer.c (drop_overlay): New function.
5941 (delete_all_overlays, Fdelete_overlay): Use it.
5942 * minibuf.c (get_minibuffer): Fix comment.
5943
5944 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5945
5946 Port to OpenBSD 5.1 amd64.
5947 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5948 This is needed for OpenBSD, and should be harmless on all BSD systems.
5949 Also, include <sys/sysctl.h>, as it should be available on all
5950 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5951 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5952 use p_pid member, not kp_proc.pid.
5953
5954 2012-07-06 Glenn Morris <rgm@gnu.org>
5955
5956 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5957
5958 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5959
5960 More xmalloc and related cleanup.
5961 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5962 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5963 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5964 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5965 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5966 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5967 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5968 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5969 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5970 * xterm.c:
5971 Omit needless casts involving void * pointers and allocation.
5972 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5973 as the former is more robust if P's type is changed.
5974 Prefer xzalloc to xmalloc + memset 0.
5975 Simplify malloc-or-realloc to realloc.
5976 Don't worry about xmalloc returning a null pointer.
5977 Prefer xstrdup to xmalloc + strcpy.
5978 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5979 growing it.
5980 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5981 alloca of a constant.
5982
5983 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5984
5985 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5986 hscroll is larger than the line width. Fixes long and futile
5987 looping inside extend_face_to_end_of_line (on a TTY) producing
5988 glyphs that are not needed and thrown away.
5989
5990 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5991
5992 * marker.c (set_marker_restricted_both): Simplify by using
5993 clip_to_bounds.
5994
5995 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5996
5997 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5998
5999 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6000
6001 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6002 not defined (Bug#11768).
6003 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6004 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6005 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6006 followed by gtk_box_set_homogeneous (Bug#11768).
6007 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6008 (update_theme_scrollbar_width, xg_create_scroll_bar):
6009 Use gtk_scrollbar_new (Bug#11768).
6010 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6011 (is_box_type): New function (Bug#11768).
6012 (xg_tool_item_stale_p): Call is_box_type.
6013 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6014 with default display (Bug#11768).
6015
6016 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6017
6018 * xdisp.c (window_hscroll_limited): New function.
6019 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6020 coordinates when window's hscroll is set to insanely large
6021 values. (Bug#11857)
6022
6023 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6024
6025 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6026 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6027
6028 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6029
6030 Cleanup xmalloc.
6031 * lisp.h (xzalloc): New prototype. Omit needless casts.
6032 * alloc.c (xzalloc): New function. Omit needless casts.
6033 * charset.c: Omit needless casts. Convert all calls to
6034 xmalloc with following memset to xzalloc.
6035 * dispnew.c: Likewise.
6036 * fringe.c: Likewise.
6037 * image.c: Likewise.
6038 * sound.c: Likewise.
6039 * term.c: Likewise.
6040 * w32fns.c: Likewise.
6041 * w32font.c: Likewise.
6042 * w32term.c: Likewise.
6043 * xfaces.c: Likewise.
6044 * xfns.c: Likewise.
6045 * xterm.c: Likewise.
6046 * atimer.c: Omit needless casts.
6047 * buffer.c: Likewise.
6048 * callproc.c: Likewise.
6049 * ccl.c: Likewise.
6050 * coding.c: Likewise.
6051 * composite.c: Likewise.
6052 * doc.c: Likewise.
6053 * doprnt.c: Likewise.
6054 * editfns.c: Likewise.
6055 * emacs.c: Likewise.
6056 * eval.c: Likewise.
6057 * filelock.c: Likewise.
6058 * fns.c: Likewise.
6059 * gtkutil.c: Likewise.
6060 * keyboard.c: Likewise.
6061 * lisp.h: Likewise.
6062 * lread.c: Likewise.
6063 * minibuf.c: Likewise.
6064 * msdos.c: Likewise.
6065 * print.c: Likewise.
6066 * process.c: Likewise.
6067 * region-cache.c: Likewise.
6068 * search.c: Likewise.
6069 * sysdep.c: Likewise.
6070 * termcap.c: Likewise.
6071 * terminal.c: Likewise.
6072 * tparam.c: Likewise.
6073 * w16select.c: Likewise.
6074 * w32.c: Likewise.
6075 * w32reg.c: Likewise.
6076 * w32select.c: Likewise.
6077 * w32uniscribe.c: Likewise.
6078 * widget.c: Likewise.
6079 * xdisp.c: Likewise.
6080 * xmenu.c: Likewise.
6081 * xrdb.c: Likewise.
6082 * xselect.c: Likewise.
6083
6084 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6085
6086 * fileio.c (time_error_value): Check the right error number.
6087 Problem reported by Troels Nielsen in
6088 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6089
6090 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6091
6092 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6093 This should be fixed in a better way; see Eli Zaretskii in
6094 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6095 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6096
6097 * fileio.c (time_error_value): Rename from special_mtime.
6098 The old name's problems were noted by Eli Zaretskii in
6099 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6100
6101 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6102 This variable's comment says Emacs needs at least one GDB-visible
6103 symbol of type enum pvec_type, to work around GDB problems.
6104 The symbol's value doesn't matter.
6105
6106 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6107 that causes compilation to fail on pre-C99 compilers.
6108
6109 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6110
6111 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6112 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6113
6114 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6115
6116 * buffer.c (init_buffer_once): Fix initialization of
6117 headers for buffer_defaults and buffer_local_symbols.
6118 Reported by Juanma Barranquero <lekktu@gmail.com>.
6119
6120 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6121
6122 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6123 * lisp.h (enum pvec_type): Use fewer bits.
6124 (PSEUDOVECTOR_SIZE_BITS): New constant.
6125 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6126 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6127 change in pvec_type.
6128 (PSEUDOVECTOR_TYPEP): New macro.
6129 (TYPED_PSEUDOVECTORP): Use it.
6130 * fns.c (internal_equal): Adapt code to extract pvectype.
6131 * emacs.c (gdb_pvec_type): Update type.
6132 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6133 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6134 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6135 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6136 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6137 abusing vector->header.next.nbytes.
6138 (live_vector_p): Use PVEC_TYPE.
6139 (mark_object): Adapt code to extract pvectype. Use switch.
6140
6141 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6142
6143 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6144 Tighten new eassert a bit.
6145
6146 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6147
6148 Fix compilation with --enable-gcc-warnings and -O1
6149 optimization level.
6150 * doprnt.c (doprnt): Change type of tem to int, initialize
6151 to avoid compiler warning. Add eassert.
6152 * search.c (simple_search): Initialize match_byte to avoid
6153 compiler warning. Add eassert.
6154
6155 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6156
6157 Avoid weird behavior with large horizontal scrolls.
6158 Without this change, for example, large hscroll values would
6159 mess up Emacs's display on Fedora 15 x86, presumably due to
6160 overflows in int calculations in the display code.
6161 Also, if buffers had long lines, Emacs would freeze.
6162 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6163 (set_window_hscroll): New function, containing the old guts of
6164 Fset_window_hscroll. Return the clipped value.
6165 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6166 This avoids the need to check against PTRDIFF_MAX.
6167
6168 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6169
6170 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6171
6172 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6173
6174 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6175
6176 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6177 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6178 since GCC 4.4.6 issues a bogus warning for them.
6179
6180 Fix bugs in file timestamp newness comparisons.
6181 * fileio.c (Ffile_newer_than_file_p):
6182 * lread.c (Fload): Use full timestamp resolution of files,
6183 not just the 1-second resolution, so that files that are only
6184 slightly newer still count as newer.
6185 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6186 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6187
6188 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6189
6190 * fileio.c: Improve handling of file time marker. (Bug#11852)
6191 (special_mtime): New function.
6192 (Finsert_file_contents, Fverify_visited_file_modtime):
6193 Use it to set special mtime values consistently.
6194
6195 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6196
6197 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6198 marker for non-existing file. (Bug#11852)
6199
6200 2012-07-03 Glenn Morris <rgm@gnu.org>
6201
6202 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6203 and did not make it into globals.h).
6204
6205 2012-07-03 Tom Tromey <tromey@redhat.com>
6206
6207 * window.c (Fset_window_margins, Fset_window_fringes)
6208 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6209 * textprop.c (Fprevious_property_change): No longer static.
6210 * syntax.c (Fsyntax_table_p): No longer static.
6211 * process.c (Fget_process, Fprocess_datagram_address): No longer
6212 static.
6213 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6214 * keyboard.c (Fcommand_execute): No longer static.
6215 Remove EXFUN.
6216 * insdel.c (Fcombine_after_change_execute): No longer static.
6217 * image.c (Finit_image_library): No longer static.
6218 * fileio.c (Fmake_symbolic_link): No longer static.
6219 * eval.c (Ffetch_bytecode): No longer static.
6220 * editfns.c (Fuser_full_name): No longer static.
6221 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6222 No longer static.
6223 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6224 static.
6225 * dired.c (Ffile_attributes): No longer static.
6226 * composite.c (Fcomposition_get_gstring): No longer static.
6227 * callproc.c (Fgetenv_internal): No longer static.
6228
6229 * ccl.h: Remove EXFUNs.
6230 * buffer.h: Remove EXFUNs.
6231 * dispextern.h: Remove EXFUNs.
6232 * intervals.h: Remove EXFUNs.
6233 * fontset.h: Remove EXFUN.
6234 * font.h: Remove EXFUNs.
6235 * dosfns.c (system_process_attributes): Remove EXFUN.
6236 * keymap.h: Remove EXFUNs.
6237 * lisp.h: Remove EXFUNs.
6238 * w32term.h: Remove EXFUNs.
6239 * window.h: Remove EXFUNs.
6240 * xsettings.h: Remove EXFUN.
6241 * xterm.h: Remove EXFUN.
6242
6243 2012-07-03 Glenn Morris <rgm@gnu.org>
6244
6245 * lisp.h (Frandom): Make it visible to C.
6246 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6247 buffer for invisible buffers. (Bug#1229)
6248
6249 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6250
6251 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6252 values which aren't power of 2.
6253 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6254 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
6255 accordingly.
6256
6257 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6258
6259 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6260
6261 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6262
6263 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6264
6265 * alloc.c (allocate_vector_block): Remove redundant
6266 calls to mallopt if DOUG_LEA_MALLOC is defined.
6267 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6268 avoid calls to mallopt if zero_vector is returned.
6269
6270 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6271
6272 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6273 is enabled, avoid dereferencing NULL current_sblock if
6274 running undumped.
6275
6276 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6277
6278 Cleanup basic buffer management.
6279 * buffer.h (struct buffer): Change layout to use generic vector
6280 marking code. Fix some comments. Change type of 'clip_changed'
6281 to bitfield. Remove unused #ifndef old.
6282 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6283 (GET_OVERLAYS_AT): Fix indentation.
6284 (for_each_per_buffer_object_at): New macro.
6285 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6286 (Fbuffer_local_variables): Use it.
6287 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6288 * alloc.c (allocate_buffer): Adjust to match new layout of
6289 struct buffer. Fix comment.
6290 (mark_overlay): New function.
6291 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6292 Lisp area of struct buffer.
6293 (mark_object): Use it. Adjust marking of misc objects
6294 and related comments.
6295
6296 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6297
6298 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6299 wrapper that is not needed because the wrapped code is a no-op (zero
6300 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6301 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6302
6303 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6304
6305 * alloc.c (mark_buffer): Simplify. Remove prototype.
6306 (mark_object): Add comment. Reorganize marking of vector-like
6307 objects. Use CHECK_LIVE for all vector-like objects except buffers
6308 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6309 Avoid redundant calls to mark_vectorlike for bool vectors.
6310
6311 2012-06-30 Glenn Morris <rgm@gnu.org>
6312
6313 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6314
6315 * epaths.in (PATH_SITELOADSEARCH): New.
6316 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6317 This is rather than relying on --enable-locallisppath elements
6318 having "site-lisp" in their names. (Bug#10208#25, 11658)
6319
6320 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6321
6322 * w32proc.c (sys_select): Accept and ignore one more argument.
6323
6324 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6325
6326 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6327 (pselect) [!MS_DOS]: Redirect to sys_select.
6328
6329 * sysdep.c: Don't include dos.h and dosfns.h.
6330
6331 * process.c (sys_select):
6332 * msdos.c (sys_select): Accept one more argument and ignore it.
6333
6334 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6335 adapt data types and code to that.
6336
6337 * dosfns.c:
6338 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6339 which clashes with the gnulib function of the same name.
6340
6341 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6342
6343 * font.c (font_style_to_value, font_style_symbolic)
6344 (font_prop_validate_style): Add type checks for values in
6345 font_style_table.
6346
6347 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6348 argument.
6349 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6350 uses.
6351
6352 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6353
6354 * xdisp.c (try_window_id): Undo last change.
6355
6356 * w32.c (getwd): Adjust commentary about startup_dir.
6357 (init_environment): Always call sys_access, even in non-MSVC
6358 builds. Don't chdir to the directory of the Emacs executable.
6359 This undoes code from 1997 which was justified by the need to
6360 "avoid conflicts when removing and renaming directories". But its
6361 downside was that every relative file name was being interpreted
6362 relative to the directory of the Emacs executable, which can never
6363 be TRT. In particular, it broke sys_access when called with
6364 relative file names.
6365 (sys_access): Map GetLastError to errno.
6366
6367 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6368
6369 * window.h (struct window): Change type of 'fringes_outside_margins'
6370 to bitfield. Fix comment. Adjust users accordingly.
6371 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6372 Adjust comment.
6373 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6374 to ptrdiff_t.
6375
6376 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6377
6378 * gnutls.c (emacs_gnutls_handshake):
6379 Add QUIT to make the loop interruptible.
6380
6381 2012-06-29 Glenn Morris <rgm@gnu.org>
6382
6383 * charset.c (init_charset): Make lack of etc/charsets fatal.
6384
6385 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6386
6387 * editfns.c (region_limit): Fix type mismatch.
6388
6389 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6390
6391 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6392 undefined. Convert from xassert to eassert.
6393 * nsmenu.m: Convert from xassert to eassert.
6394 * nsterm.m: Likewise.
6395
6396 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6397
6398 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6399
6400 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6401
6402 Avoid integer overflow on scroll-left and scroll-right.
6403 * window.c (HSCROLL_MAX): New macro.
6404 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6405 overflow when requested scroll falls outside ptrdiff_t range.
6406
6407 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6408
6409 * window.h (struct window): Change type of 'hscroll',
6410 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6411 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6412 Adjust users accordingly.
6413 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6414 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6415 from EMACS_INT to ptrdiff_t.
6416 (make_window): Omit redundant initialization.
6417
6418 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
6419
6420 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6421
6422 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6423
6424 * window.h (struct window): Change type of 'use_time' and
6425 'sequence_number' from Lisp_Object to int.
6426 * frame.c (make_frame): Adjust users accordingly.
6427 * print.c (print_object): Likewise.
6428 * window.c (select_window, Fwindow_use_time, make_parent_window)
6429 (make_window): Likewise.
6430
6431 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6432
6433 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6434 enabled with --enable-checking=[all,glyphs] configure option.
6435 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6436 adjust comments accordingly.
6437 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6438 undefined, adjust comments accordingly.
6439 * image.c: Likewise.
6440 * scroll.c: Likewise.
6441 * w32fns.c: Likewise.
6442 * w32term.c: Likewise.
6443 * xdisp.c: Likewise.
6444 * xfaces.c: Likewise.
6445 * xfns.c: Likewise.
6446 * xterm.c: Likewise.
6447
6448 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6449
6450 Generalize run-time debugging checks.
6451 * dispextern.h (XASSERTS): Remove.
6452 * fontset.c (xassert): Remove.
6453 Convert from xassert to eassert.
6454 * alloc.c: Convert from xassert to eassert.
6455 * bidi.c: Likewise.
6456 * dispnew.c: Likewise.
6457 * fns.c: Likewise.
6458 * fringe.c: Likewise.
6459 * ftfont.c: Likewise.
6460 * gtkutil.c: Likewise.
6461 * image.c: Likewise.
6462 * keyboard.c: Likewise.
6463 * menu.c: Likewise.
6464 * process.c: Likewise.
6465 * scroll.c: Likewise.
6466 * sound.c: Likewise.
6467 * term.c: Likewise.
6468 * w32console.c: Likewise.
6469 * w32fns.c: Likewise.
6470 * w32term.c: Likewise.
6471 * window.c: Likewise.
6472 * xdisp.c: Likewise.
6473 * xfaces.c: Likewise.
6474 * xfns.c: Likewise.
6475 * xselect.c: Likewise.
6476 * xterm.c: Likewise.
6477
6478 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6479
6480 * fns.c (maybe_resize_hash_table): Output message when growing the
6481 purify-hashtable.
6482
6483 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6484
6485 * alloc.c (allocate_string_data): Remove dead code.
6486 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6487 avoid GCC warning about unused macro.
6488
6489 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6490
6491 * alloc.c (allocate_string): Omit intervals initialization.
6492 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6493 as in make_pure_string and make_pure_c_string.
6494
6495 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6496
6497 * alloc.c (allocate_string): Fix last change.
6498
6499 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6500
6501 * alloc.c (allocate_string): Remove two redundant calls
6502 to memset, add explicit initialization where appropriate.
6503
6504 2012-06-27 Glenn Morris <rgm@gnu.org>
6505
6506 * lisp.mk (lisp): Remove paths.elc.
6507
6508 2012-06-27 Chong Yidong <cyd@gnu.org>
6509
6510 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6511
6512 2012-06-26 John Wiegley <johnw@newartisans.com>
6513
6514 * unexmacosx.c (copy_data_segment): Add two section names used
6515 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6516
6517 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6518 when building with Clang.
6519
6520 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6521
6522 * eval.c (Fapply): Allow calling it with a single argument.
6523
6524 2012-06-26 Eli Zaretskii <eliz@gnu.org>
6525
6526 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6527 _stricmp and _strnicmp.
6528 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6529
6530 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6531
6532 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6533 allocated window.
6534 (allocate_process): Likewise for new process.
6535 (allocate_terminal): Change to use offsetof.
6536 (allocate_frame): Likewise.
6537 * frame.c (make_frame): Omit redundant initialization.
6538 * window.c (make_parent_window): Use memset.
6539 (make_window): Omit redundant initialization.
6540 * process.c (make_process): Omit redundant initialization.
6541 * terminal.c (create_terminal): Likewise.
6542
6543 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6544
6545 * term.c (delete_tty): Remove redundant call to memset.
6546
6547 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6548
6549 * alloc.c: Remove build_string.
6550 * lisp.h: Define build_string as static inline. This provides
6551 a better opportunity to optimize away calls to strlen when the
6552 function is called with compile-time constant argument.
6553 * image.c (imagemagick_error): Convert to build_string.
6554 * w32proc.c (sys_spawnve): Likewise.
6555 * xterm.c (x_term_init): Likewise.
6556
6557 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6558
6559 Use sprintf return value instead of invoking strlen on result.
6560 In the old days this wasn't portable, since some sprintf
6561 implementations returned char *. But they died out years ago and
6562 Emacs already assumes sprintf returns int.
6563 Similarly for float_to_string.
6564 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6565 * ccl.c (ccl_driver):
6566 * character.c (string_escape_byte8):
6567 * data.c (Fnumber_to_string):
6568 * doprnt.c (doprnt):
6569 * print.c (print_object):
6570 * xdisp.c (message_dolog):
6571 * xfns.c (syms_of_xfns):
6572 Use sprintf or float_to_string result to avoid need to call strlen.
6573 * data.c (Fnumber_to_string):
6574 Use make_unibyte_string, since the string must be ASCII.
6575 * lisp.h, print.c (float_to_string): Now returns int length.
6576 * term.c (produce_glyphless_glyph):
6577 Use sprintf result rather than recomputing it.
6578
6579 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6580 * Makefile.in (ALL_CFLAGS):
6581 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6582 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6583
6584 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6585
6586 * dispextern.h (xstrcasecmp): Define to library function
6587 strcasecmp if available.
6588 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6589
6590 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6591
6592 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6593 Avoid comma operator.
6594 * menu.c (push_submenu_start, push_submenu_end)
6595 (push_left_right_boundary, push_menu_pane): Likewise.
6596 * msdos.c (dos_rawgetc): Likewise.
6597
6598 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6599
6600 * xfns.c (xic_create_fontsetname): Remove redundant calls
6601 to memset.
6602
6603 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6604
6605 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6606 sprintf already null-terminates its output.
6607
6608 * xfns.c (x_window): Remove redundant cast.
6609
6610 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6611
6612 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6613 `const char *' to `char *' to avoid compiler warning.
6614
6615 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6616
6617 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6618 instead of truncating it to 63 (admittedly a generous limit).
6619
6620 * process.c: Fix spelling and caps in comments.
6621
6622 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6623
6624 * emacs.c (setpgrp): Remove definition, unused.
6625 * sysdep.c (setpgrp): Remove definition, not used in this file.
6626
6627 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
6628
6629 * makefile.w32-in: Update dependencies.
6630
6631 2012-06-24 Eli Zaretskii <eliz@gnu.org>
6632
6633 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6634 (SYSTIME_H): Add nt/inc/sys/time.h.
6635
6636 * systime.h [WINDOWSNT]: Include sys/time.h.
6637
6638 * s/ms-w32.h (struct timespec): Definition moved from
6639 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6640
6641 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6642
6643 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6644 * buffer.h (buffer_slot_type_mismatch):
6645 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6646 * eval.c (unwind_to_catch):
6647 * image.c (my_png_error, my_error_exit):
6648 * keyboard.c (quit_throw_to_read_char, user_error)
6649 (Fexit_recursive_edit, Fabort_recursive_edit):
6650 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6651 (wrong_type_argument, buffer_overflow, __executable_start)
6652 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6653 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6654 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6655 (fatal):
6656 (child_setup) [!DOS_NT]:
6657 * lread.c (end_of_file_error, invalid_syntax):
6658 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6659 * puresize.h (pure_write_error):
6660 * search.c (matcher_overflow):
6661 * sound.c (sound_perror, alsa_sound_perror):
6662 * sysdep.c, syssignal.h (croak):
6663 * term.c (maybe_fatal, vfatal):
6664 * textprop.c (text_read_only):
6665 * undo.c (user_error):
6666 * unexmacosx.c (unexec_error):
6667 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6668 Use _Noreturn rather than NO_RETURN.
6669 No need for separate decl merely because of _Noreturn.
6670 * sound.c (sound_warning, parse_sound):
6671 Remove unnecessary forward decls.
6672
6673 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6674
6675 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6676 * lisp.h (WAIT_READING_MAX): New macro.
6677 * dispnew.c (Fsleep_for, sit_for):
6678 * keyboard.c (kbd_buffer_get_event):
6679 * process.c (Faccept_process_output):
6680 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6681 This improves on the previous patch, which introduced a bug
6682 when time_t is unsigned and as wide as intmax_t.
6683 See <http://bugs.gnu.org/9000#51>.
6684
6685 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6686
6687 * dispnew.c (sit_for, Fsleep_for):
6688 * keyboard.c (kbd_buffer_get_event):
6689 * process.c (Faccept_process_output): Avoid compiler warnings when
6690 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6691
6692 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
6693
6694 * makefile.w32-in: Update dependencies.
6695
6696 * w32.c (ltime): Add return type and declare static.
6697 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6698
6699 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6700
6701 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6702 Privately reported by Herbert J. Skuhra.
6703 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6704 All uses changed.
6705 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6706 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6707
6708 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6709
6710 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6711 last argument of make_unibyte_string.
6712
6713 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6714 language ID in the event parameters.
6715
6716 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6717 event.code, not the obscure "character set ID".
6718
6719 2012-06-23 Chong Yidong <cyd@gnu.org>
6720
6721 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6722
6723 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6724
6725 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6726 * w32.c (fdutimens): New function.
6727
6728 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6729
6730 * s/ms-w32.h (pselect): Redirect to sys_select.
6731
6732 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6733
6734 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6735 in the logic of incrementing and decrementing the value of
6736 use_relocatable_buffers.
6737
6738 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6739
6740 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6741 Privately reported by Herbert J. Skuhra.
6742 [__FreeBSD__]: Remove "*/" typo after "#include".
6743 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6744 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6745 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6746 Don't assume EMACS_TIME and struct timeval are the same type.
6747
6748 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6749
6750 Support higher-resolution time stamps (Bug#9000).
6751 The time stamps are only nanosecond-resolution at the C level,
6752 since that's the best that any real-world system supports now.
6753 But they are picosecond-resolution at the Lisp level, as that's
6754 easy, and leaves room for future OS improvements.
6755
6756 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6757 (LIBES): Use it.
6758
6759 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6760 Don't get current time unless it's needed.
6761
6762 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6763 now provides it if it's absent.
6764 (start_atimer): Port to higher-res time stamps.
6765 Check for time stamp overflow. Don't get current time more
6766 often than is needed.
6767
6768 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6769 Include systime.h, not time.h.
6770 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6771
6772 * dired.c: Include stat-time.h.
6773 (Ffile-attributes): File times now have higher resolution.
6774
6775 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6776 (struct image): Timestamp now has higher resolution.
6777
6778 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6779 has at least microseconds now. All uses removed.
6780 (update_frame, update_single_window, update_window, update_frame_1)
6781 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
6782 (duration_to_sec_usec): Remove; no longer needed.
6783
6784 * editfns.c (time_overflow): Now extern.
6785 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6786 (float-time, Fformat_time_string, Fcurrent_time_string)
6787 (Fcurrent_time_zone): Accept and generate higher-resolution
6788 time stamps.
6789 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6790 (decode_time_components, lisp_seconds_argument): New functions.
6791 (make_time): Now static.
6792 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6793 Report an error if the time is invalid, rather than having the caller
6794 do that.
6795
6796 * fileio.c: Include <stat-time.h>
6797 (Fcopy_file): Copy higher-resolution time stamps.
6798 Prefer to set the time stamp via a file descriptor if that works.
6799 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6800 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6801 (Fvisited_file_modtime, Fset_visited_file_modtime):
6802 Support higher-resolution time stamps.
6803
6804 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6805
6806 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6807
6808 * image.c (prepare_image_for_display, clear_image_cache)
6809 (lookup_image): Port to higer-resolution time stamps.
6810
6811 * keyboard.c (start_polling, bind_polling_period):
6812 Check for time stamp overflow.
6813 (read_char, kbd_buffer_get_event, timer_start_idle)
6814 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6815 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6816 Port to higher-resolution time stamps. Do not assume time_t is signed.
6817 (decode_timer): New function. Timers are now vectors of length 9,
6818 not 8, to accommodate the picosecond component.
6819 (timer_check_2): Use it.
6820
6821 * nsterm.m (select_timeout, timeval_subtract): Remove.
6822 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6823 as they're a bit more accurate and handle overflow better.
6824 (ns_select): Change prototype to be compatible with pselect.
6825 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6826 * nsterm.h (ns_select): Adjust prototype.
6827
6828 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6829 us-resolution time stamps.
6830 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6831
6832 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6833
6834 * lisp.h (time_overflow): New decl.
6835 (wait_reading_process_output): First arg is now intmax_t, not int,
6836 to accommodate larger waits.
6837
6838 * process.h (struct Lisp_Process.read_output_delay):
6839 Now counts nanoseconds, not microseconds.
6840 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6841 EMACS_HAS_USECS.
6842 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6843 (wait_reading_process_output):
6844 Port to ns-resolution time stamps.
6845 (Faccept_process_output, wait_reading_process_output):
6846 Check for time stamp overflow. Do not assume time_t is signed.
6847 (select_wrapper): Remove; we now use pselect.
6848 (Fprocess_attributes): Now generates ns-resolution time stamps.
6849
6850 * sysdep.c: Include utimens.h. Don't include utime.h
6851 or worry about struct utimbuf; gnulib does that for us now.
6852 (gettimeofday): Remove; gnulib provides a substitute.
6853 (make_timeval): New function.
6854 (set_file_times): Now sets ns-resolution time stamps.
6855 New arg FD; all uses changed.
6856 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6857 (system_process_attributes):
6858 Now returns ns-resolution time stamp. All uses changed.
6859 Check for time stamp overflow.
6860
6861 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6862 provides a substitute now.
6863
6864 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6865 since it guarantees struct timespec.
6866 (EMACS_TIME): Now struct timespec, so that we can support
6867 ns-resolution time stamps.
6868 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6869 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6870 (EMACS_USECS): Remove.
6871 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6872 so multiply the arg by 1000 before storing it.
6873 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6874 New macros.
6875 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6876 Port to ns-resolution time stamps.
6877 (EMACS_TIME_NEG_P): Remove; replaced by....
6878 (EMACS_TIME_SIGN): New macro.
6879 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6880 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6881 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6882 (make_timeval, make_lisp_time, decode_time_components): New decls.
6883 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6884 that it mishandled time_t overflow. You can't compare by subtracting!
6885 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6886 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6887
6888 * term.c: Include <sys/time.h>.
6889 (timeval_to_Time): New function, for proper overflow wraparound.
6890 (term_mouse_position, term_mouse_click): Use it.
6891
6892 * undo.c (record_first_change): Support higher-resolution time stamps
6893 in the undo buffer.
6894 (Fprimitive_undo): Use them when restoring time stamps.
6895
6896 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6897 (w32_get_internal_run_time):
6898 Port to higher-resolution Emacs time stamps.
6899 (ltime): Now accepts single 64-bit integer, as that's more convenient
6900 for callers.
6901
6902 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6903
6904 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6905 for compatibility with pselect. Support ns-resolution time stamps.
6906
6907 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6908
6909 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6910 Check for time stamp overflow, and support ns-resolution time stamps.
6911
6912 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6913 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6914 (timeval_subtract): Remove; no longer needed.
6915 (XTflash, XTring_bell, x_wait_for_event):
6916 Port to ns-resolution time stamps. Don't assume time_t is signed.
6917
6918 2012-06-22 Chong Yidong <cyd@gnu.org>
6919
6920 * xdisp.c (x_consider_frame_title): Revert last change.
6921
6922 2012-06-22 Eli Zaretskii <eliz@gnu.org>
6923
6924 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6925 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6926 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6927 staticidx goes up to 1597 out of 1600 = 0x640.)
6928
6929 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6930
6931 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6932 Otherwise, the umask might be mistakenly 0 while handling input signals.
6933
6934 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6935
6936 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6937
6938 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6939
6940 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6941 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6942 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6943 access to `contents' member of Lisp_Vector objects with AREF and ASET
6944 where appropriate.
6945
6946 2012-06-19 Chong Yidong <cyd@gnu.org>
6947
6948 * frame.c (delete_frame): When selecting a frame on a different
6949 text terminal, do not alter the terminal's top-frame.
6950
6951 * xdisp.c (format_mode_line_unwind_data): Record the target
6952 frame's selected window and its terminal's top-frame.
6953 (unwind_format_mode_line): Restore them.
6954 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6955 Callers changed.
6956 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6957 since tty frames can be explicitly named.
6958 (prepare_menu_bars): Likewise.
6959
6960 * term.c (Ftty_top_frame): New function.
6961
6962 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6963
6964 Port byte-code-meter to modern targets.
6965 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6966 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6967 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6968 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6969 (METER_1, METER_2): Simplify.
6970
6971 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6972
6973 * data.c (Fdefalias): Return `symbol' (bug#11686).
6974
6975 2012-06-18 Martin Rudalics <rudalics@gmx.at>
6976
6977 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6978 gets killed during executing of this function (Bug#11665).
6979 Try to always return Qt when the buffer has been actually killed.
6980 (Vkill_buffer_query_functions): In doc-string say that functions
6981 run by this hook should not change the current buffer.
6982
6983 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6984
6985 Fix recently-introduced process.c problems found by static checking.
6986 * process.c (write_queue_push, write_queue_pop, send_process):
6987 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6988 (write_queue_pop): Fix pointer signedness problem.
6989 (send_process): Remove unused local.
6990
6991 2012-06-17 Chong Yidong <cyd@gnu.org>
6992
6993 * xdisp.c (redisplay_internal): No need to redisplay terminal
6994 frames that are not on top.
6995
6996 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
6997
6998 * process.c (make_process): Initialize write_queue.
6999 (write_queue_push, write_queue_pop): New functions.
7000 (send_process): Use them to maintain correct ordering of process
7001 writes (Bug#10815).
7002
7003 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7004
7005 * lisp.h (eassert): Assume C89 or later.
7006 This removes the need for CHECK.
7007 (CHECK): Remove. Its comments about always evaluating its
7008 argument were confusing, as 'eassert' typically does not evaluate
7009 its argument.
7010
7011 * coding.c (produce_chars): Use ptrdiff_t, not int.
7012
7013 * xterm.c (x_draw_underwave): Check for integer overflow.
7014 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7015
7016 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7017
7018 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7019 referenced (Bug#11583).
7020
7021 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7022
7023 Implement wave-style variant of underlining.
7024 * dispextern.h (face_underline_type): New enum.
7025 (face): Add field for underline type.
7026 * nsterm.m (ns_draw_underwave): New function.
7027 (ns_draw_text_decoration): Use it.
7028 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7029 New functions.
7030 (x_draw_glyph_string): Use them.
7031 * xfaces.c (Qline, Qwave): New Lisp objects.
7032 (check_lface_attrs, merge_face_ref)
7033 (Finternal_set_lisp_face_attribute, realize_x_face):
7034 Handle wave-style underline face attributes.
7035 * xterm.c (x_draw_underwave): New function.
7036 (x_draw_glyph_string): Use it.
7037
7038 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7039
7040 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7041 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7042 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7043 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7044 ($(BLD)/w32select.$(O)): Update dependencies.
7045
7046 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7047
7048 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7049 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7050 * character.c (_fetch_multibyte_char_p): Remove.
7051 * alloc.c: Include "character.h" before "buffer.h".
7052 * bidi.c: Likewise.
7053 * buffer.c: Likewise.
7054 * bytecode.c: Likewise.
7055 * callint.c: Likewise.
7056 * callproc.c: Likewise.
7057 * casefiddle.c: Likewise.
7058 * casetab.c: Likewise.
7059 * category.c: Likewise.
7060 * cmds.c: Likewise.
7061 * coding.c: Likewise.
7062 * composite.c: Likewise.
7063 * dired.c: Likewise.
7064 * dispnew.c: Likewise.
7065 * doc.c: Likewise.
7066 * dosfns.c: Likewise.
7067 * editfns.c: Likewise.
7068 * emacs.c: Likewise.
7069 * fileio.c: Likewise.
7070 * filelock.c: Likewise.
7071 * font.c: Likewise.
7072 * fontset.c: Likewise.
7073 * fringe.c: Likewise.
7074 * indent.c: Likewise.
7075 * insdel.c: Likewise.
7076 * intervals.c: Likewise.
7077 * keyboard.c: Likewise.
7078 * keymap.c: Likewise.
7079 * lread.c: Likewise.
7080 * macros.c: Likewise.
7081 * marker.c: Likewise.
7082 * minibuf.c: Likewise.
7083 * nsfns.m: Likewise.
7084 * nsmenu.m: Likewise.
7085 * print.c: Likewise.
7086 * process.c: Likewise.
7087 * regex.c: Likewise.
7088 * region-cache.c: Likewise.
7089 * search.c: Likewise.
7090 * syntax.c: Likewise.
7091 * term.c: Likewise.
7092 * textprop.c: Likewise.
7093 * undo.c: Likewise.
7094 * unexsol.c: Likewise.
7095 * w16select.c: Likewise.
7096 * w32fns.c: Likewise.
7097 * w32menu.c: Likewise.
7098 * window.c: Likewise.
7099 * xdisp.c: Likewise.
7100 * xfns.c: Likewise.
7101 * xmenu.c: Likewise.
7102 * xml.c: Likewise.
7103 * xselect.c: Likewise.
7104
7105 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7106
7107 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7108 If all the glyphs of the glyph row came from strings, and we have no
7109 cursor positioning clues, put the cursor on the first glyph of the
7110 row.
7111 (handle_face_prop): Use chunk-relative overlay string index when
7112 indexing into it->string_overlays array. (Bug#11653)
7113 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7114 the rightmost. (Bug#11720)
7115
7116 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7117
7118 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7119 (CATEGORY_MEMBER): Enforce 1/0 value.
7120 * category.c (_temp_category_set): Remove.
7121
7122 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7123
7124 * window.c (Fdelete_other_windows_internal)
7125 (Fdelete_window_internal): Don't access frame's mouse highlight
7126 info of the initial frame. (Bug#11677)
7127
7128 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7129
7130 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7131 Assume USE_2_TAGS_FOR_INTS.
7132 (xreload): Adjust $tagmask width to match recent lisp.h change.
7133
7134 Simplify lisp.h in minor ways that should not affect code.
7135 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7136 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7137 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7138 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7139 (INTTYPEBITS): New macro, for clarity.
7140 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7141 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7142 Simplify now that USE_LSB_TAG is always defined.
7143 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7144 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7145
7146 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7147
7148 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7149
7150 2012-06-13 Glenn Morris <rgm@gnu.org>
7151
7152 * s/bsd-common.h (BSD4_3):
7153 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7154
7155 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7156
7157 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7158 instead of union.
7159 (XLI, XIL): Define.
7160 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7161 Use them.
7162 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7163 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7164 * alloc.c (widen_to_Lisp_Object): Remove.
7165 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7166 * frame.c (delete_frame): Remove outdated comment.
7167 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7168 USE_LISP_UNION_TYPE.
7169 (Fw32_unregister_hot_key): Likewise.
7170 (Fw32_toggle_lock_key): Likewise.
7171 * w32menu.c (add_menu_item): Likewise.
7172 (w32_menu_display_help): Use XIL instead of checking
7173 USE_LISP_UNION_TYPE.
7174 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7175 (init_heap): Likewise.
7176 * w32term.c (w32_read_socket): Update comment.
7177
7178 2012-06-13 Glenn Morris <rgm@gnu.org>
7179
7180 * s/usg5-4-common.h, src/s/unixware.h:
7181 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7182
7183 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7184
7185 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7186
7187 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7188 * alloc.c (make_number) [!defined make_number]:
7189 Remove, as lisp.h always defines this now.
7190 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7191 (roundup_size): Verify that it is a power of 2.
7192 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7193 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7194 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7195 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7196 USE_LSB_TAG now is always defined to be either 0 or 1.
7197 All uses changed.
7198 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7199 code works fine either way, and efficiency is not a concern here,
7200 as the union type is for debugging, not for production.
7201 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7202 Use an inline function on all platforms when using the union type,
7203 since this is simpler and 'static inline' can be used portably
7204 within Emacs now.
7205 (LISP_INITIALLY_ZERO): New macro.
7206 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7207 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7208
7209 2012-06-12 Glenn Morris <rgm@gnu.org>
7210
7211 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7212
7213 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7214
7215 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7216 Move BROKEN_SIGIO to configure.
7217
7218 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7219 Move NO_TERMIO to configure.
7220
7221 2012-06-12 Chong Yidong <cyd@gnu.org>
7222
7223 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7224 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7225 MagickExportImagePixels is undefined.
7226
7227 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7228
7229 * image.c (imagemagick_load_image): Remove unused label.
7230
7231 2012-06-11 Glenn Morris <rgm@gnu.org>
7232
7233 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7234 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7235 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7236 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7237
7238 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7239
7240 * alloc.c (make_byte_code): New function.
7241 (Fmake_byte_code): Use it. Don't purify here.
7242 * lread.c (read1): Use it as well to avoid extra allocation.
7243
7244 2012-06-11 Chong Yidong <cyd@gnu.org>
7245
7246 * image.c (imagemagick_load_image): Implement transparency.
7247
7248 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7249
7250 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7251 account for preceding backslashes. (Bug#11663)
7252
7253 2012-06-09 Chong Yidong <cyd@gnu.org>
7254
7255 * term.c: Support italics in capable terminals (Bug#9652).
7256 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7257 (turn_on_face): Output using TS_enter_italic_mode if available.
7258 Don't handle unused blinking and alt-charset cases.
7259 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7260 and tty_alt_charset_p cases.
7261 (tty_capable_p, init_tty): Support italics.
7262
7263 * termchar.h (struct tty_display_info): Add field for italics.
7264 Remove unused blink field.
7265
7266 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7267 Handle slant.
7268
7269 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7270 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7271 tty_alt_charset_p. Add tty_italic_p.
7272
7273 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7274
7275 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7276 dbus_type_is_basic if available.
7277 (xd_extract_signed, xd_extract_unsigned): Rename from
7278 extract_signed and extract_unsigned, respectively. Adapt callers.
7279
7280 2012-06-09 Chong Yidong <cyd@gnu.org>
7281
7282 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7283
7284 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7285 case (Bug#9752).
7286
7287 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7288
7289 * xdisp.c (vmessage): Treat frame message as multibyte.
7290 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7291 would generate the diagnostic "Making \302\247 buffer-local while
7292 let-bound!".
7293
7294 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7295
7296 * dispnew.c (showing_window_margins_p): Undo last change, which
7297 was done due to an inadvertent commit.
7298 (adjust_frame_glyphs_for_frame_redisplay): Do call
7299 showing_window_margins_p.
7300
7301 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7302
7303 * eval.c (Fmake_var_non_special): New primitive.
7304 (syms_of_eval): Defsubr it.
7305 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7306
7307 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7308
7309 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7310 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7311
7312 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7313
7314 * alloc.c (allocate_vectorlike): Fix last change.
7315
7316 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7317
7318 Block-based vector allocation of small vectors.
7319 * lisp.h (struct vectorlike_header): New field `nbytes',
7320 adjust comment accordingly.
7321 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7322 to denote vector blocks. Adjust users (live_vector_p,
7323 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7324 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7325 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7326 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7327 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7328 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7329 (roundup_size): New constant.
7330 (struct vector_block): New data type.
7331 (vector_blocks, vector_free_lists, zero_vector): New variables.
7332 (all_vectors): Rename to `large_vectors'.
7333 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7334 (sweep_vectors): New functions.
7335 (allocate_vectorlike): Return `zero_vector' as the only vector of
7336 0 items. Allocate new vector from block if vector size is less than
7337 or equal to VBLOCK_BYTES_MAX.
7338 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7339 (init_alloc_once): Add call to init_vectors.
7340
7341 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7342
7343 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7344
7345 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7346
7347 * doprnt.c (doprnt): Truncate multibyte char correctly.
7348 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7349 would mishandle a string argument "Xc" if X was a multibyte
7350 character of length 2: it would truncate after X's first byte
7351 rather than including all of X.
7352
7353 2012-06-06 Chong Yidong <cyd@gnu.org>
7354
7355 * buffer.c (word_wrap): Doc fix.
7356
7357 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7358
7359 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7360
7361 2012-06-03 Glenn Morris <rgm@gnu.org>
7362
7363 * xdisp.c (tool-bar-style): Doc fix.
7364
7365 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7366
7367 * Makefile.in (PAXCTL): Define.
7368 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7369 binary via PaX flags if the paxctl utility is available.
7370 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7371 Restore PaX flags to their default. (Bug#11398)
7372
7373 2012-06-03 Chong Yidong <cyd@gnu.org>
7374
7375 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7376 buffer (Bug#11226).
7377
7378 2012-06-03 Chong Yidong <cyd@gnu.org>
7379
7380 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7381 (note_mode_line_or_margin_highlight): If there is no help echo,
7382 use mode-line-default-help-echo. Handle the case where the mouse
7383 position is past the end of the mode line string.
7384
7385 * buffer.c (buffer_local_value_1): New function, split from
7386 Fbuffer_local_value; can return Qunbound.
7387 (Fbuffer_local_value): Use it.
7388 (Vmode_line_format): Docstring tweaks.
7389
7390 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7391
7392 * sysdep.c (system_process_attributes): Improve comment.
7393
7394 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7395
7396 * keyboard.c: Export real-this-command to Elisp.
7397 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7398 and DEFVAR it. Update all users.
7399
7400 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7401
7402 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7403
7404 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7405 Convert pctcpu and pctmem to Lisp float properly.
7406 Let the compiler fold better, as 100.0/0x8000 is exact.
7407
7408 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7409
7410 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7411 cons_block.
7412
7413 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7414
7415 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7416
7417 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7418
7419 For a 'struct window', replace some Lisp_Object fields to
7420 bitfields where appropriate, remove unused fields.
7421 * window.h (struct window): Remove unused 'last_mark_x' and
7422 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7423 change it's type from Lisp_Object to bitfield.
7424 Change type of 'force_start', 'optional_new_start',
7425 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7426 fields from Lisp_Object to bitfield. Adjust users accordingly.
7427
7428 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7429
7430 Pacify gcc -Wdouble-precision when using Xaw.
7431 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7432 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7433 Use 'float' consistently, rather than 'float' in most places
7434 and 'double' in a couple of places.
7435
7436 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7437
7438 * xdisp.c (handle_stop): Detect whether we have overlay strings
7439 loaded by testing it->current.overlay_string_index to be
7440 non-negative, instead of checking whether n_overlay_strings is
7441 positive. (Bug#11587)
7442
7443 2012-05-31 Chong Yidong <cyd@gnu.org>
7444
7445 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7446
7447 * doc.c (Fsubstitute_command_keys): Doc fix.
7448
7449 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7450
7451 * search.c (search_buffer): Remove calls to
7452 r_alloc_inhibit_buffer_relocation, as it is now called by
7453 maybe_unify_char, which was the cause of relocation of buffer text
7454 in bug#11519.
7455
7456 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7457
7458 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7459 for the duration of call to load_charset, to avoid problems with
7460 callers of maybe_unify_char that access buffer text through C
7461 pointers.
7462
7463 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7464 decrement the inhibition flag, instead of just setting or
7465 resetting it.
7466
7467 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7468
7469 Remove obsolete '#define static' cruft.
7470 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7471 This #undef was "temporary" in 2000; it is no longer needed
7472 now that '#define static' has gone away.
7473 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7474 (gray_bitmap_bits): Remove; no longer needed.
7475 All uses replaced with definiens.
7476 * xterm.c: Include "bitmaps/gray.xbm".
7477
7478 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7479
7480 Clean up __executable_start, monstartup when --enable-profiling.
7481 The following changes affect the code only when profiling.
7482 * dispnew.c (__executable_start): Rename from safe_bcopy.
7483 Define only on platforms that need it.
7484 * emacs.c: Include <sys/gmon.h> when profiling.
7485 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7486 (__executable_start): Remove decl, since lisp.h does it now.
7487 (safe_bcopy): Remove decl; no longer has that name.
7488 (main): Coalesce #if into single bit of code, for simplicity.
7489 Cast pointers to uintptr_t, since standard libraries want integers
7490 and not pointers.
7491 * lisp.h (__executable_start): New decl.
7492
7493 2012-05-31 Glenn Morris <rgm@gnu.org>
7494
7495 * image.c (Fimagemagick_types): Doc fix.
7496
7497 2012-05-30 Jim Meyering <meyering@redhat.com>
7498
7499 * callproc.c (Fcall_process_region): Include directory component
7500 in mkstemp error message (Bug#11586).
7501
7502 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7503
7504 * alloc.c, lisp.h (make_pure_vector): Now static.
7505
7506 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7507
7508 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7509 Move to byte-run.el.
7510 (Fautoload): Do the hash-doc more carefully.
7511 * data.c (Fdefalias): Purify definition, except for keymaps.
7512 (Qdefun): Move from eval.c.
7513 * lisp.h (Qdefun): Remove.
7514 * lread.c (read1): Tiny simplification.
7515
7516 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
7517
7518 Do not create empty overlays with the evaporate property (Bug#9642).
7519 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7520 Bug#9642, but explicitly check that the buffer the overlay would
7521 be moved to is live and rearrange lines to make sure that errors
7522 will not put the overlay in an inconsistent state.
7523 (Fdelete_overlay): Cosmetics.
7524
7525 2012-05-28 Eli Zaretskii <eliz@gnu.org>
7526
7527 * w32term.c (my_bring_window_to_top): New function.
7528 (x_raise_frame): Use handle returned by DeferWindowPos, which
7529 could be different from the original one.
7530 Call my_bring_window_to_top instead of my_set_foreground_window.
7531 (Bug#11513)
7532
7533 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7534 by calling BringWindowToTop.
7535
7536 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7537 (WM_EMACS_END): Increase by one.
7538
7539 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7540
7541 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7542 This avoids undefined behavior that might cause the eassert
7543 to not catch an out-of-range value.
7544
7545 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
7546
7547 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7548 Update dependencies.
7549
7550 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7551
7552 * bidi.c (bidi_mirror_char): Fix last change.
7553
7554 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7555
7556 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7557 when referring to sectname field in printf format.
7558
7559 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7560
7561 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7562 Only r_alloc_inhibit_buffer_relocation needed to be added;
7563 the others were already declared.
7564
7565 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7566 before checking whether it's out of range. Put the check inside
7567 eassert. See
7568 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7569
7570 2012-05-27 Ken Brown <kbrown@cornell.edu>
7571
7572 * callproc.c (Fcall_process): Restore a line that was accidentally
7573 commented out in the 2011-02-13 change (bug#11547).
7574
7575 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7576
7577 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7578 defined on ralloc.c.
7579
7580 * buffer.c [REL_ALLOC]: Remove prototypes of
7581 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7582 they are now on lisp.h.
7583
7584 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7585
7586 * search.c (search_buffer): Use it to inhibit relocation of buffer
7587 text while re_search_2 is doing its job, because re_search_2 is
7588 passed C pointers to buffer text. (Bug#11519)
7589
7590 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7591 Update value to 24.
7592
7593 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7594 state after an additional call to move_it_in_display_line_to, keep
7595 the values of it->max_ascent and it->max_descent found for the
7596 entire line.
7597 (pos_visible_p): Revert the comparison against bottom_y to what it
7598 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7599 (Bug#11464)
7600
7601 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7602
7603 Fix coding-related core dumps with gcc -ftrapv.
7604 The code was computing A - B, where A and B are pointers, and B is
7605 random garbage. This can lead to core dumps on platforms that
7606 have special pointer registers, and it also leads to core dumps on
7607 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7608 A - B only when B is initialized properly.
7609 * coding.c (coding_set_source, coding_set_destination): Return void.
7610 (coding_change_source, coding_change_destinations): New functions,
7611 with the old behaviors of coding_set_source and coding_set_destination.
7612 All callers that need an offset changed to use these new functions.
7613
7614 2012-05-26 Glenn Morris <rgm@gnu.org>
7615
7616 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7617
7618 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7619
7620 Extend mouse support on W32 text-mode console.
7621 * xdisp.c (draw_row_with_mouse_face):
7622 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7623
7624 * w32console.c: Include window.h.
7625 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7626 New functions.
7627 (initialize_w32_display): Initialize mouse-highlight data.
7628
7629 * w32inevt.c: Include termchar.h and window.h.
7630 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7631 moves, call note_mouse_highlight. If help_echo changed, call
7632 gen_help_event to produce help-echo message in the echo area.
7633 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7634 highlight info.
7635
7636 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7637
7638 * lread.c (read1): Simplify slightly to avoid an overflow warning
7639 with GCC 4.7.0 on x86-64.
7640
7641 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7642
7643 * bidi.c (bidi_mirror_char): Revert last change: an int is
7644 definitely wide enough here.
7645
7646 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
7647
7648 Fix integer width and related bugs (Bug#9874).
7649 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7650 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7651 (string_bytes, check_sblock, allocate_string_data):
7652 (compact_small_strings, Fmake_bool_vector, make_string)
7653 (make_unibyte_string, make_multibyte_string)
7654 (make_string_from_bytes, make_specified_string)
7655 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7656 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7657 (mark_vectorlike):
7658 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7659 (allocate_pseudovector):
7660 Use int, not EMACS_INT, where int is wide enough.
7661 (inhibit_garbage_collection, Fgarbage_collect):
7662 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7663 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7664 int might not be wide enough.
7665 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7666 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7667 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7668 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7669 (bidi_level_of_next_char, bidi_move_to_visually_next):
7670 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7671 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7672 (Fkill_buffer, Fset_buffer_major_mode)
7673 (advance_to_char_boundary, Fbuffer_swap_text)
7674 (Fset_buffer_multibyte, overlays_at, overlays_in)
7675 (overlay_touches_p, struct sortvec, record_overlay_string)
7676 (overlay_strings, recenter_overlay_lists)
7677 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7678 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7679 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7680 (Foverlay_recenter, last_overlay_modification_hooks_used)
7681 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7682 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7683 (validate_region): Omit unnecessary test for b <= e,
7684 since that's guaranteed by the previous test.
7685 (adjust_overlays_for_delete): Avoid pos + length overflow.
7686 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7687 (report_overlay_modification):
7688 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7689 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7690 Omit pointer cast, which isn't needed anyway, and doesn't work
7691 after the EMACS_INT -> ptrdiff_t change.
7692 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7693 * buffer.h: Adjust decls to match defn changes elsewhere.
7694 (struct buffer_text, struct buffer):
7695 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7696 Use EMACS_INT, not int, where int might not be wide enough.
7697 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7698 not int, to avoid needless 32-bit limit on 64-bit hosts.
7699 (exec_byte_code): Use tighter memory-full test, one that checks
7700 for alloca overflow. Don't compute the address of the object just
7701 before an array, as that's not portable. Use EMACS_INT, not
7702 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7703 * callint.c (Fcall_interactively):
7704 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7705 * callproc.c (call_process_kill, Fcall_process):
7706 Don't assume pid_t fits into an Emacs fixnum.
7707 (call_process_cleanup, Fcall_process, child_setup):
7708 Don't assume pid_t fits into int.
7709 (call_process_cleanup, Fcall_process, delete_temp_file)
7710 (Fcall_process_region):
7711 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7712 (Fcall_process): Simplify handling of volatile integers.
7713 Use int, not EMACS_INT, where int will do.
7714 * casefiddle.c (casify_object, casify_region, operate_on_word)
7715 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7716 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7717 (casify_object): Avoid integer overflow when overallocating buffer.
7718 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7719 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
7720 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7721 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7722 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7723 integers are now checked earlier. All uses replaced with XINT.
7724 (ccl_driver):
7725 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7726 For CCL_MapSingle, check that content and value are in int range.
7727 (ccl_driver, Fregister_code_conversion_map):
7728 Check that Vcode_version_map_vector is a vector.
7729 (resolve_symbol_ccl_program): Check that vector header is in range.
7730 Always copy the vector, so that we can check its contents reliably
7731 now rather than having to recheck each instruction as it's being
7732 executed. Check that vector words fit in 'int'.
7733 (ccl_get_compiled_code, Fregister_ccl_program)
7734 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7735 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7736 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7737 contents are in range.
7738 (Fccl_execute_on_string): Check that status is in range.
7739 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7740 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7741 Accept and return EMACS_INT, not int, because callers can pass values
7742 out of 'int' range.
7743 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7744 (multibyte_chars_in_text, parse_str_as_multibyte)
7745 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7746 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7747 (string_escape_byte8, Fget_byte):
7748 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7749 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7750 avoid mishandling large integers.
7751 * character.h: Adjust decls to match defn changes elsewhere.
7752 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7753 (Ffind_charset_region):
7754 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7755 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7756 (load_charset_map_from_vector, Fdefine_charset_internal):
7757 Don't assume fixnum fits in int.
7758 (load_charset_map_from_vector, Fmap_charset_chars):
7759 Remove now-unnecessary CHECK_NATNUMs.
7760 (Fdefine_charset_internal): Check ranges here, more carefully.
7761 Don't rely on undefined behavior with signed left shift overflow.
7762 Don't assume unsigned int fits into fixnum, or that fixnum fits
7763 into unsigned int. Don't require max_code to be a valid fixnum;
7764 that's not true for gb10830 4-byte on a 32-bit host. Allow
7765 invalid_code to be a cons, for the same reason. Require code_offset
7766 to be a character. Avoid int overflow if max_char is close
7767 to INT_MAX.
7768 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7769 this is intended anyway and avoids some undefined behavior.
7770 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7771 INDEX_TO_CODE_POINT, as that's what it expects.
7772 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
7773 * charset.h (DECODE_CHAR): Return int, not unsigned;
7774 this is what was intended anyway, and it avoids undefined behavior.
7775 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7776 integer-overflow issues.
7777 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7778 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7779 where the argument is EMACS_INT, and this behavior is not intended.
7780 * chartab.c (Fmake_char_table, Fset_char_table_range)
7781 (uniprop_get_decoder, uniprop_get_encoder):
7782 Don't assume fixnum fits in int.
7783 * cmds.c (move_point): New function, that does the gist of
7784 Fforward_char and Fbackward_char, but does so while checking
7785 for integer overflow more accurately.
7786 (Fforward_char, Fbackward_char): Use it.
7787 (Fforward_line, Fend_of_line, internal_self_insert)
7788 (internal_self_insert):
7789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7790 Fix a FIXME, by checking for integer overflow when calculating
7791 target_clm and actual_clm.
7792 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
7793 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
7794 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7795 (coding_alloc_by_making_gap, alloc_destination)
7796 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7797 (encode_coding_utf_16, detect_coding_emacs_mule)
7798 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7799 (detect_coding_iso_2022, decode_coding_iso_2022)
7800 (encode_invocation_designation, encode_designation_at_bol)
7801 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7802 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7803 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7804 (encode_coding_ccl, encode_coding_raw_text)
7805 (detect_coding_charset, decode_coding_charset)
7806 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7807 (produce_composition, produce_charset, produce_annotation)
7808 (decode_coding, handle_composition_annotation)
7809 (handle_charset_annotation, consume_chars, decode_coding_gap)
7810 (decode_coding_object, encode_coding_object, detect_coding_system)
7811 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7812 (code_convert_region, code_convert_string)
7813 (Fdefine_coding_system_internal)
7814 (coding_set_source, coding_set_destination):
7815 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7816 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7817 (Fdefine_coding_system_internal):
7818 Don't assume fixnums fit in int.
7819 (decode_coding_gap, decode_coding_object, encode_coding_object)
7820 (Fread_coding_system, Fdetect_coding_region)
7821 (Funencodable_char_position, Fcheck_coding_systems_region)
7822 (get_translation, handle_composition_annotation, consume_chars):
7823 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7824 (consume_chars): Rewrite to not calculate an address outside buffer.
7825 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7826 Don't access memory outside of the args array.
7827 (Fdefine_coding_system_internal): Check for charset-id overflow.
7828 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7829 result of ENCODE_CHAR.
7830 * coding.h: Adjust decls to match defn changes elsewhere.
7831 (struct coding_system):
7832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7833 * composite.c (get_composition_id, find_composition)
7834 (run_composition_function, update_compositions)
7835 (compose_text, composition_gstring_put_cache)
7836 (composition_gstring_p, composition_gstring_width)
7837 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7838 (composition_compute_stop_pos, composition_reseat_it)
7839 (composition_update_it, struct position_record)
7840 (find_automatic_composition, composition_adjust_point)
7841 (Fcomposition_get_gstring, Ffind_composition_internal):
7842 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7843 (update_compositions):
7844 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7845 * composite.h: Adjust decls to match defn changes elsewhere.
7846 (struct composition):
7847 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7848 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7849 Do not attempt to compute the address of the object just before a
7850 buffer; this is not portable.
7851 (Faref, Faset):
7852 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7853 (Faset): Use int, not EMACS_INT, where int is wide enough.
7854 (Fstring_to_number): Don't assume fixnums fit in int.
7855 (Frem): Don't assume arg is nonnegative.
7856 * dbusbind.c (xd_append_arg): Check for integers out of range.
7857 (Fdbus_call_method): Don't overflow the timeout int.
7858 (extract_signed, extract_unsigned): New functions.
7859 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7860 (xd_get_connection_references): Return ptrdiff_t, not int.
7861 All uses changed.
7862 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7863 (xd_read_message_1):
7864 Use int, not unsigned, where the dbus API uses int.
7865 (Fdbus_message_internal): Don't overflow mtype.
7866 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7867 * dired.c (directory_files_internal, file_name_completion, scmp)
7868 (file_name_completion_stat):
7869 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7870 (file_name_completion): Don't overflow matchcount.
7871 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7872 * dispextern.h: Adjust decls to match defn changes elsewhere.
7873 (struct text_pos, struct glyph, struct bidi_saved_info)
7874 (struct bidi_string_data, struct bidi_it, struct composition_it)
7875 (struct it):
7876 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7877 (struct display_pos, struct composition_it, struct it):
7878 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7879 * dispnew.c (increment_matrix_positions)
7880 (increment_row_positions, mode_line_string)
7881 (marginal_area_string):
7882 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7883 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7884 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7885 (duration_to_sec_usec): New function, to check for overflow better.
7886 (Fsleep_for, sit_for): Use it.
7887 * doc.c (get_doc_string, store_function_docstring):
7888 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7889 (get_doc_string, Fsnarf_documentation):
7890 Use int, not EMACS_INT, where int is wide enough.
7891 (get_doc_string):
7892 Use SAFE_ALLOCA, not alloca.
7893 Check for overflow when converting EMACS_INT to off_t.
7894 * doprnt.c (doprnt):
7895 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7896 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7897 Don't assume uid_t fits into fixnum.
7898 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7899 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7900 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7901 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7902 (general_insert_function)
7903 (Finsert_char, make_buffer_string, make_buffer_string_both)
7904 (update_buffer_properties, Fbuffer_substring)
7905 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7906 (Fsubst_char_in_region, check_translation)
7907 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7908 (transpose_markers, Ftranspose_regions):
7909 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7910 (clip_to_bounds): Move to lisp.h as an inline function).
7911 (Fconstrain_to_field): Don't assume integers are nonnegative.
7912 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7913 (Fsubst_char_in_region, Fsave_restriction):
7914 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7915 (Femacs_pid): Don't assume pid_t fits into fixnum.
7916 (lo_time): Use int, not EMACS_INT, when int suffices.
7917 (lisp_time_argument): Check for usec out of range.
7918 (Fencode_time): Don't assume fixnum fits in int.
7919 (Fuser_login_name, Fuser_full_name): Signal an error
7920 if a uid argument is out of range, rather than relying on
7921 undefined behavior.
7922 (Fformat_time_string): Remove now-unnecessary check.
7923 lisp_time_argument checks for out-of-range usec now.
7924 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7925 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7926 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7927 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7928 (init_cmdargs, Fdump_emacs):
7929 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7930 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7931 the bottom (typically) 32 bits of the fixnum.
7932 * eval.c (specpdl_size, call_debugger):
7933 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7934 (when_entered_debugger, Fbacktrace_debug):
7935 Don't assume fixnum can fit in int.
7936 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7937 the object just before a buffer; this is not portable.
7938 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7939 (grow_specpdl, unbind_to):
7940 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7941 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7942 (grow_specpdl): Simplify allocation by using xpalloc.
7943 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7944 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7945 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7946 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7947 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7948 (a_write, e_write):
7949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7950 (Fcopy_file, non_regular_nbytes, read_non_regular)
7951 (Finsert_file_contents):
7952 Use int, not EMACS_INT, where int is wide enough.
7953 (READ_BUF_SIZE): Verify that it fits in int.
7954 (Finsert_file_contents): Check that counts are in proper range,
7955 rather than assuming fixnums fit into ptrdiff_t etc.
7956 Don't assume fixnums fit into int.
7957 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7958 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7959 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7960 (string_char_to_byte, string_byte_to_char)
7961 (string_make_multibyte, string_to_multibyte)
7962 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7963 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7964 (substring_both, Fdelete, internal_equal, Ffillarray)
7965 (Fclear_string, mapcar1)
7966 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7967 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7968 (larger_vector, make_hash_table, maybe_resize_hash_table)
7969 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7970 (Fmaphash, secure_hash):
7971 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7972 (concat): Check for string index and length overflow.
7973 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7974 (Frequire):
7975 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7976 (larger_vector): New API (vec, incr_min, size_max) replaces old
7977 one (vec, new_size, init). This catches size overflow.
7978 INIT was removed because it was always Qnil.
7979 All callers changed.
7980 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7981 the upper bound on a hash table index size.
7982 (make_hash_table, maybe_resize_hash_table): Use it.
7983 (secure_hash): Computer start_byte and end_byte only after
7984 they're known to be in ptrdiff_t range.
7985 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7986 (Ffont_get_glyphs, Ffont_at):
7987 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7988 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7989 (Flist_fonts, Fopen_font):
7990 Don't assume fixnum can fit in int.
7991 (check_gstring): Don't assume index can fit in int.
7992 (font_match_p): Check that fixnum is a character, not a nonnegative
7993 fixnum, since the later code needs to stuff it into an int.
7994 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7995 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7996 conversion overflow issues.
7997 (Fopen_font): Check for integer out of range.
7998 (Ffont_get_glyphs): Don't assume index can fit in int.
7999 * font.h: Adjust decls to match defn changes elsewhere.
8000 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8001 integer overflow.
8002 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8003 printmax_t, where ptrdiff_t is wide enough.
8004 (Finternal_char_font):
8005 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8006 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8007 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8008 (Fset_frame_position, x_set_frame_parameters)
8009 (x_set_line_spacing, x_set_border_width)
8010 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8011 Check that fixnums are in proper range for system types.
8012 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8013 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8014 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8015 Use SAFE_ALLOCA_LISP, not alloca.
8016 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8017 intptr_t is wide enough.
8018 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8019 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8020 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8021 Check for fixnum out of range.
8022 * ftfont.c (ftfont_list): Don't assume index fits in int.
8023 Check that fixnums are in proper range for system types.
8024 (ftfont_shape_by_flt):
8025 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8026 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8027 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8028 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8029 Check that fixnums are in proper range for system types.
8030 * gnutls.h: Adjust decls to match defn changes elsewhere.
8031 * gtkutil.c (xg_dialog_run):
8032 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8033 (update_frame_tool_bar):
8034 Check that fixnums are in proper range for system types.
8035 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8036 (lookup_image): Check that fixnums are in range for system types.
8037 * indent.c (last_known_column, last_known_column_point):
8038 (current_column_bol_cache):
8039 (skip_invisible, current_column, check_display_width):
8040 (check_display_width, scan_for_column, current_column_1)
8041 (Findent_to, Fcurrent_indentation, position_indentation)
8042 (indented_beyond_p, Fmove_to_column, compute_motion):
8043 (Fcompute_motion, Fvertical_motion):
8044 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8045 (last_known_column_modified): Use EMACS_INT, not int.
8046 (check_display_width):
8047 (Fcompute_motion):
8048 Check that fixnums and floats are in proper range for system types.
8049 (compute_motion): Don't assume index or fixnum fits in int.
8050 (compute_motion, Fcompute_motion):
8051 Use int, not EMACS_INT, when it is wide enough.
8052 (vmotion): Omit local var start_hpos that is always 0; that way
8053 we don't need to worry about overflow in expressions involving it.
8054 * indent.h: Adjust decls to match defn changes elsewhere.
8055 (struct position):
8056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8057 Use int, not EMACS_INT, where int is wide enough.
8058 Remove unused members ovstring_chars_done and tab_offset;
8059 all uses removed.
8060 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8061 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8062 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8063 (make_gap, copy_text, insert, insert_and_inherit)
8064 (insert_before_markers, insert_before_markers_and_inherit)
8065 (insert_1, count_combining_before, count_combining_after)
8066 (insert_1_both, insert_from_string)
8067 (insert_from_string_before_markers, insert_from_string_1)
8068 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8069 (adjust_after_replace, adjust_after_insert, replace_range)
8070 (replace_range_2, del_range, del_range_1, del_range_byte)
8071 (del_range_both, del_range_2, modify_region)
8072 (prepare_to_modify_buffer, signal_before_change)
8073 (signal_after_change, Fcombine_after_change_execute):
8074 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8075 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8076 (balance_an_interval, split_interval_right, split_interval_left)
8077 (find_interval, next_interval, update_interval)
8078 (adjust_intervals_for_insertion, delete_node, delete_interval)
8079 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8080 (static_offset_intervals, offset_intervals)
8081 (merge_interval_right, merge_interval_left, make_new_interval)
8082 (graft_intervals_into_buffer, temp_set_point_both)
8083 (temp_set_point, set_point, adjust_for_invis_intang)
8084 (set_point_both, move_if_not_intangible, get_property_and_range)
8085 (get_local_map, copy_intervals, copy_intervals_to_string)
8086 (compare_string_intervals, set_intervals_multibyte_1):
8087 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8088 * intervals.h: Adjust decls to match defn changes elsewhere.
8089 (struct interval):
8090 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8091 * keyboard.c (this_command_key_count, this_single_command_key_start)
8092 (before_command_key_count, before_command_echo_length, echo_now)
8093 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8094 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8095 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8096 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8097 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8098 (last_non_minibuf_size, last_point_position, echo_truncate)
8099 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8100 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8101 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8102 (stuff_buffered_input):
8103 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8104 (last_auto_save, command_loop_1, read_char):
8105 Use EMACS_INT, not int, to avoid integer overflow.
8106 (record_char): Avoid overflow in total_keys computation.
8107 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8108 * keyboard.h: Adjust decls to match defn changes elsewhere.
8109 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8110 (Fkey_description, Fdescribe_vector, Flookup_key):
8111 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8112 (click_position): New function, to check that positions are in range.
8113 (Fcurrent_active_maps):
8114 (describe_command):
8115 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8116 (Faccessible_keymaps, Fkey_description):
8117 (preferred_sequence_p):
8118 Don't assume fixnum can fit into int.
8119 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8120 Check for integer overflow in size calculations.
8121 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8122 avoid mishandling large integers.
8123 * lisp.h: Adjust decls to match defn changes elsewhere.
8124 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8125 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8126 (struct Lisp_Marker):
8127 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8128 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8129 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8130 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8131 All callers changed.
8132 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8133 Assume the arg has valid form, since it always does.
8134 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8135 unsigned integer system type.
8136 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8137 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8138 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8139 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8140 (duration_to_sec_usec): New decl.
8141 * lread.c (read_from_string_index, read_from_string_index_byte)
8142 (read_from_string_limit, readchar, unreadchar, openp)
8143 (read_internal_start, read1, oblookup):
8144 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8145 (Fload, readevalloop, Feval_buffer, Feval_region):
8146 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8147 (openp): Check for out-of-range argument to 'access'.
8148 (read1): Use int, not EMACS_INT, where int is wide enough.
8149 Don't assume fixnum fits into int.
8150 Fix off-by-one error that can read outside a buffer.
8151 (read_filtered_event): Use duration_to_sec_usec
8152 to do proper overflow checking on durations.
8153 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8154 in size calculation.
8155 (Fexecute_kbd_macro):
8156 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8157 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8158 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8159 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8160 (set_marker_both, set_marker_restricted_both, marker_position)
8161 (marker_byte_position, Fbuffer_has_markers_at):
8162 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8163 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8164 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8165 It now merely ensures that the menu is large enough, without
8166 necessarily growing it, as this avoids some integer overflow issues.
8167 All callers changed.
8168 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8169 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8170 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8171 Use SAFE_ALLOCA_LISP, not alloca.
8172 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8173 to EMACS_INT. Check that fixnums are in proper range for system types.
8174 * minibuf.c (minibuf_prompt_width, string_to_object)
8175 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8176 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8177 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8178 (get_minibuffer, read_minibuf_unwind):
8179 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8180 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8181 this simplifies overflow checking. All callers changed.
8182 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8183 (Ftest_completion):
8184 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8185 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8186 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8187 Check that fixnums are in proper range for system types.
8188 (Fx_create_frame, Fx_show_tip):
8189 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8190 * nsfont.m (ns_findfonts, nsfont_list_family):
8191 Don't assume fixnum fits in long.
8192 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8193 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8194 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8195 wide enough.
8196 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8197 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8198 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8199 (PRINTDECLARE, PRINTPREPARE):
8200 (strout, print_string):
8201 (print, print_preprocess, print_check_string_charset_prop)
8202 (print_object):
8203 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8204 (PRINTDECLARE):
8205 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8206 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8207 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8208 (printchar, strout): Use xpalloc to catch size calculation overflow.
8209 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8210 (print_error_message): Use SAFE_ALLOCA, not alloca.
8211 (print_object): Use int, not EMACS_INT, where int is wide enough.
8212 (print_depth, new_backquote_output, print_number_index):
8213 Use ptrdiff_t, not int, where int might not be wide enough.
8214 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8215 (Fset_process_window_size, Fformat_network_address)
8216 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8217 (sigchld_handler):
8218 Check that fixnums are in proper range for system types.
8219 (Fsignal_process): Simplify by avoiding a goto.
8220 Check for process-ids out of pid_t range rather than relying on
8221 undefined behavior.
8222 (process_tick, update_tick): Use EMACS_INT, not int.
8223 (Fformat_network_address, read_process_output, send_process)
8224 (Fprocess_send_region, status_notify):
8225 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8226 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8227 (wait_reading_process_output, read_process_output, exec_sentinel):
8228 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8229 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8230 (Faccept_process_output): Use duration_to_sec_usec to do proper
8231 overflow checking on durations.
8232 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8233 Don't assume pid_t fits in int.
8234 * process.h (struct Lisp_Process): Members tick and update_tick
8235 are now of type EMACS_INT, not int.
8236 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8237 configured --with-wide-int.
8238 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8239 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8240 * search.c (looking_at_1, string_match_1):
8241 (fast_string_match, fast_c_string_match_ignore_case)
8242 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8243 (scan_newline, find_before_next_newline, search_command)
8244 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8245 (set_search_regs, wordify):
8246 (Freplace_match):
8247 (Fmatch_data):
8248 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8249 (string_match_1, search_buffer, set_search_regs):
8250 (Fmatch_data):
8251 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8252 (wordify): Check for overflow in size calculation.
8253 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8254 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8255 Check that fixnums are in proper range for system types.
8256 * sound.c (struct sound_device)
8257 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8258 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8259 (Fplay_sound_internal):
8260 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8261 * syntax.c (struct lisp_parse_state, find_start_modiff)
8262 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8263 (Fparse_partial_sexp):
8264 Don't assume fixnums can fit in int.
8265 (struct lisp_parse_state, find_start_pos, find_start_value)
8266 (find_start_value_byte, find_start_begv)
8267 (update_syntax_table, char_quoted, dec_bytepos)
8268 (find_defun_start, prev_char_comend_first, back_comment):
8269 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8270 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8271 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8272 (Finternal_describe_syntax_value): Check that match_lisp is a
8273 character, not an integer, since the code stuffs it into int.
8274 (scan_words, scan_sexps_forward):
8275 Check that fixnums are in proper range for system types.
8276 (Fforward_word):
8277 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8278 (scan_sexps_forward):
8279 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8280 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8281 * syntax.h: Adjust decls to match defn changes elsewhere.
8282 (struct gl_state_s):
8283 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8284 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8285 MOST_POSITIVE_FIXNUM.
8286 * sysdep.c (wait_for_termination_1, wait_for_termination)
8287 (interruptible_wait_for_termination, mkdir):
8288 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8289 (emacs_read, emacs_write):
8290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8291 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8292 and double all fit in int.
8293 * term.c (set_tty_color_mode):
8294 Check that fixnums are in proper range for system types.
8295 * termhooks.h (struct input_event):
8296 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8297 * textprop.c (validate_interval_range, interval_of)
8298 (Fadd_text_properties, set_text_properties_1)
8299 (Fremove_text_properties, Fremove_list_of_text_properties)
8300 (Ftext_property_any, Ftext_property_not_all)
8301 (copy_text_properties, text_property_list, extend_property_ranges)
8302 (verify_interval_modification):
8303 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8304 (Fnext_single_char_property_change)
8305 (Fprevious_single_char_property_change):
8306 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8307 (copy_text_properties):
8308 Check for integer overflow in index calculation.
8309 * undo.c (last_boundary_position, record_point, record_insert)
8310 (record_delete, record_marker_adjustment, record_change)
8311 (record_property_change):
8312 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8313 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8314 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8315 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8316 (Fx_hide_tip, Fx_file_dialog):
8317 * w32menu.c (set_frame_menubar):
8318 Use ptrdiff_t, not int, for consistency with rest of code.
8319 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8320 (select_window, Fdelete_other_windows_internal)
8321 (window_scroll_pixel_based, window_scroll_line_based)
8322 (Frecenter, Fset_window_configuration):
8323 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8324 (Fset_window_hscroll, run_window_configuration_change_hook)
8325 (set_window_buffer, temp_output_buffer_show, scroll_command)
8326 (Fscroll_other_window, Frecenter):
8327 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8328 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8329 Don't assume fixnum fits in int.
8330 (Fset_window_scroll_bars):
8331 Check that fixnums are in proper range for system types.
8332 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8333 (string_pos, c_string_pos, number_of_chars, init_iterator)
8334 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8335 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8336 (compute_display_string_end, handle_face_prop)
8337 (face_before_or_after_it_pos, handle_invisible_prop)
8338 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8339 (display_prop_intangible_p, string_buffer_position_lim)
8340 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8341 (get_overlay_strings_1, get_overlay_strings)
8342 (iterate_out_of_display_property, forward_to_next_line_start)
8343 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8344 (get_next_display_element, set_iterator_to_next)
8345 (get_visually_first_element, compute_stop_pos_backwards)
8346 (handle_stop_backwards, next_element_from_buffer)
8347 (move_it_in_display_line_to, move_it_in_display_line)
8348 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8349 (add_to_log, message_dolog, message_log_check_duplicate)
8350 (message2, message2_nolog, message3, message3_nolog
8351 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8352 (current_message_1, truncate_echo_area, truncate_message_1)
8353 (set_message, set_message_1, store_mode_line_noprop)
8354 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8355 (text_outside_line_unchanged_p, check_point_in_composition)
8356 (reconsider_clip_changes)
8357 (redisplay_internal, set_cursor_from_row, try_scrolling)
8358 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8359 (redisplay_window, find_last_unchanged_at_beg_row)
8360 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8361 (trailing_whitespace_p, find_row_edges, display_line)
8362 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8363 (display_mode_element, store_mode_line_string)
8364 (pint2str, pint2hrstr, decode_mode_spec)
8365 (display_count_lines, display_string, draw_glyphs)
8366 (x_produce_glyphs, x_insert_glyphs)
8367 (rows_from_pos_range, mouse_face_from_buffer_pos)
8368 (fast_find_string_pos, mouse_face_from_string_pos)
8369 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8370 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8371 (safe_call, init_from_display_pos, handle_fontified_prop)
8372 (handle_single_display_spec, load_overlay_strings)
8373 (with_echo_area_buffer, setup_echo_area_for_printing)
8374 (display_echo_area, echo_area_display)
8375 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8376 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8377 (redisplay_window, dump_glyph_row, display_mode_line)
8378 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8379 (handle_display_spec, display_prop_string_p):
8380 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8381 (handle_single_display_spec, build_desired_tool_bar_string)
8382 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8383 (get_specified_cursor_type):
8384 Check that fixnums are in proper range for system types.
8385 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8386 (Flookup_image_map):
8387 Don't assume fixnums fit in int.
8388 (compare_overlay_entries):
8389 Avoid mishandling comparisons due to subtraction overflow.
8390 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8391 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8392 (handle_tool_bar_click):
8393 Use int, not unsigned, since we prefer signed and the signedness
8394 doesn't matter here.
8395 (get_next_display_element, next_element_from_display_vector):
8396 Use int, not EMACS_INT, when int is wide enough.
8397 (start_hourglass): Use duration_to_sec_usec to do proper
8398 overflow checking on durations.
8399 * xfaces.c (Fbitmap_spec_p):
8400 Check that fixnums are in proper range for system types.
8401 (compare_fonts_by_sort_order):
8402 Avoid mishandling comparisons due to subtraction overflow.
8403 (Fx_family_fonts, realize_basic_faces):
8404 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8405 (Fx_family_fonts):
8406 Don't assume fixnum fits in int.
8407 Use SAFE_ALLOCA_LISP, not alloca.
8408 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8409 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8410 (face_at_buffer_position, face_for_overlay_string)
8411 (face_at_string_position):
8412 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8413 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8414 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8415 (Fx_show_tip):
8416 Check that fixnums are in proper range for system types.
8417 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8418 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8419 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8420 (Fx_change_window_property): Don't assume fixnums fit in int.
8421 * xfont.c (xfont_chars_supported):
8422 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8423 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8424 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8425 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8426 * xml.c (parse_region):
8427 * xrdb.c (magic_file_p):
8428 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8429 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8430 (x_get_local_selection, x_reply_selection_request)
8431 (x_handle_selection_request, wait_for_property_change):
8432 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8433 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8434 short is wide enough.
8435 (x_send_client_event): Don't assume fixnum fits in int.
8436 * xterm.c (x_x_to_emacs_modifiers):
8437 Don't assume EMACS_INT overflows nicely into int.
8438 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8439 may come from Lisp.
8440 (handle_one_xevent): NATNUMP can eval its arg twice.
8441 (x_connection_closed):
8442 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8443 * xterm.h: Adjust decls to match defn changes elsewhere.
8444 (struct scroll_bar): Use struct vectorlike_header
8445 rather than rolling our own approximation.
8446 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8447
8448 2012-05-25 Glenn Morris <rgm@gnu.org>
8449
8450 * lisp.mk (lisp): Update for more files being compiled now.
8451
8452 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8453
8454 * lread.c: Remove `read_pure' which makes no difference.
8455 (read_pure): Remove var.
8456 (unreadpure): Remove function.
8457 (readevalloop): Don't call read_list with -1 flag.
8458 (read1, read_vector): Don't test read_pure any more.
8459 (read_list): Simplify.
8460
8461 * fileio.c, character.h: Minor style tweaks.
8462
8463 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8464
8465 * window.h (clip_changed): Remove useless declaration.
8466
8467 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8468
8469 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8470 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8471
8472 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8473
8474 Remove src/m/*.
8475 This directory predates autoconf and is no longer needed nowadays.
8476 Move its few remaining bits of functionality to where they're needed.
8477 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8478 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8479 * m/template.h: Remove.
8480 * Makefile.in (M_FILE): Remove. All uses removed.
8481 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8482 * lisp.h (USE_LSB_TAG):
8483 * mem-limits.h (EXCEEDS_LISP_PTR):
8484 Use VAL_MAX, not VALBITS, in #if.
8485 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8486 (EMACS_UINT): Define unconditionally now.
8487 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8488 (BITS_PER_EMACS_INT): New constants, replacing
8489 what used to be in config.h, but not useful in #if.
8490 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8491 define them any more.
8492 (VAL_MAX): New macro.
8493 (VALMASK): Use it.
8494 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8495 BITS_PER_EMACS_INT, in #if.
8496 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8497 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8498 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8499 * s/ms-w32.h (DATA_START):
8500 Move here from removed file m/intel386.h.
8501 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8502 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8503
8504 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8505
8506 Assume C89 or later.
8507 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8508 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8509 (xrealloc):
8510 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8511 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8512 * textprop.c, tparam.c (NULL): Remove.
8513 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8514 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8515 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8516 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8517 * xterm.c (input_signal_count): Assume volatile works.
8518
8519 2012-05-21 Ken Brown <kbrown@cornell.edu>
8520
8521 * xgselect.c (xg_select): Fix first argument in call to 'select'
8522 (bug#11508).
8523
8524 2012-05-20 Ken Brown <kbrown@cornell.edu>
8525
8526 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8527 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8528
8529 2012-05-19 Ken Brown <kbrown@cornell.edu>
8530
8531 * xfns.c (x_in_use): Remove `static' qualifier.
8532 * xterm.h (x_in_use): Declare.
8533 * xgselect.c: Include xterm.h.
8534 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8535 and `display_arg' (bug#9754).
8536
8537 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8538
8539 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8540
8541 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8542 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8543
8544 2012-05-18 Eli Zaretskii <eliz@gnu.org>
8545
8546 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8547
8548 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8549 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8550
8551 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8552 reference to image_cache->refcount.
8553 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8554
8555 2012-05-17 Juri Linkov <juri@jurta.org>
8556
8557 * search.c (Fword_search_regexp, Fword_search_backward)
8558 (Fword_search_forward, Fword_search_backward_lax)
8559 (Fword_search_forward_lax): Move functions to isearch.el
8560 (bug#10145, bug#11381).
8561
8562 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8563
8564 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8565
8566 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8567
8568 * lread.c (init_obarray): Declare Qt and Qnil as special.
8569
8570 2012-05-14 Glenn Morris <rgm@gnu.org>
8571
8572 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8573 Put "libexec" before "bin", for the sake of init_callproc_1.
8574
8575 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8576
8577 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8578
8579 * unexaix.c: Port to more-recent AIX compilers.
8580 (report_error, report_error_1, make_hdr, copy_sym)
8581 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8582 Make arguments const char *, not char *, to avoid violations of C
8583 standard and to fix some AIX warnings reported by Gilles Pion.
8584
8585 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8586
8587 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8588 already have overlays loaded.
8589 (handle_single_display_spec): Before returning without displaying
8590 fringe bitmap, synchronize the bidi iterator with the main display
8591 iterator, by calling iterate_out_of_display_property.
8592 (iterate_out_of_display_property): Detect buffer iteration by
8593 testing that it->string is a Lisp string.
8594 (get_next_display_element): When the current object is exhausted,
8595 and there's something on it->stack, call set_iterator_to_next to
8596 proceed with what's on the stack, instead of returning zero.
8597 (set_iterator_to_next): If called at the end of a Lisp string,
8598 proceed to consider_string_end without incrementing string
8599 position. Don't increment display vector index past the end of
8600 the display vector. (Bug#11417)
8601 (pos_visible_p): Don't report a position visible when move_it_to
8602 stopped at the last line of window, which happens to be scanned
8603 backwards by the bidi iteration. (Bug#11464)
8604
8605 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8606
8607 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8608 and right-margin display specs even if the spec is invalid or we
8609 are on a TTY, and thus unable to display on the fringes.
8610 That's because the text with the property will not be displayed anyway,
8611 so we need to signal to the caller that this is a "replacing"
8612 display spec. This fixes display when the spec is invalid or we
8613 are on a TTY.
8614
8615 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8616
8617 * unexaix.c (make_hdr): Fix typo in prototype.
8618 This bug broke the build on AIX. Problem reported by Gilles Pion.
8619
8620 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
8621
8622 * keyboard.c (kbd_buffer_get_event): Read special events also in
8623 batch mode. (Bug#11415)
8624
8625 2012-05-12 Glenn Morris <rgm@gnu.org>
8626
8627 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8628
8629 2012-05-12 Eli Zaretskii <eliz@gnu.org>
8630
8631 * lisp.mk (lisp): Add newcomment.elc.
8632
8633 2012-05-12 Glenn Morris <rgm@gnu.org>
8634
8635 * Makefile.in (MKDIR_P): New, set by configure.
8636 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8637
8638 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8639
8640 Remove unused function hourglass_started.
8641 * dispextern.h (hourglass_started):
8642 * w32fns.c (hourglass_started):
8643 * xdisp.c (hourglass_started): Remove.
8644
8645 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
8646
8647 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8648 Update dependencies.
8649
8650 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8651
8652 * xgselect.c (xg_select): Put maxfds+1 into a var.
8653 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8654
8655 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8656
8657 2012-05-10 Dave Abrahams <dave@boostpro.com>
8658
8659 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8660 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8661
8662 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
8663
8664 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8665 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8666 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8667 Initialize xd_registered_buses.
8668
8669 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8670
8671 Untag more efficiently if USE_LSB_TAG.
8672 This is based on a proposal by YAMAMOTO Mitsuharu in
8673 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8674 For an admittedly artificial (nth 8000 longlist) benchmark on
8675 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8676 Emacs's overall text size by 1%.
8677 * lisp.h (XUNTAG): New macro.
8678 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8679 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8680 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8681 * eval.c (Fautoload):
8682 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8683 * frame.h (XFRAME): Use XUNTAG.
8684
8685 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8686 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8687 Remove unportable assumptions about print widths of types like
8688 dbus_uint32_t.
8689 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8690 intptr_t when converting between pointer and integer, to avoid GCC
8691 warnings about wrong width.
8692
8693 2012-05-09 Eli Zaretskii <eliz@gnu.org>
8694
8695 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8696 stack for each reader_thread, instead of defaulting to 8MB
8697 determined by the linker. This avoids failures in creating
8698 subprocesses on Windows 7, see the discussion in this thread:
8699 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8700
8701 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8702
8703 Fix up display of the *Minibuf-0* buffer in the mini window.
8704 * keyboard.c (read_char): Don't clear the echo area if there's no
8705 message to clear.
8706 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8707 contents of *Minibuf-0*) if there's no message displayed in its stead.
8708
8709 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
8710
8711 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8712 batch mode.
8713
8714 2012-05-06 Chong Yidong <cyd@gnu.org>
8715
8716 * lisp.mk (lisp): Update.
8717
8718 2012-05-05 Jim Meyering <meyering@redhat.com>
8719
8720 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8721
8722 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8723
8724 * data.c (PUT_ERROR): New macro.
8725 (syms_of_data): Use it. Add new error type `user-error'.
8726 * undo.c (user_error): New function.
8727 (Fprimitive_undo): Use it.
8728 * print.c (print_error_message): Adjust print style for `user-error'.
8729 * keyboard.c (user_error): New function.
8730 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8731
8732 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8733
8734 Do not limit current-time-string to years 1000..9999.
8735 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8736 (Fcurrent_time_string): Support any year that is supported by the
8737 underlying localtime representation. Don't use asctime, as it
8738 has undefined behavior for years outside the range -999..9999.
8739
8740 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8741
8742 Fix race conditions involving setenv, gmtime, localtime, asctime.
8743 Without this fix, interrupts could mess up code that uses these
8744 nonreentrant functions, since setting TZ invalidates existing
8745 tm_zone or tzname values, and since most of these functions return
8746 pointers to static storage.
8747 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8748 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8749 Grow the critical sections to include not just invoking
8750 localtime/gmtime, but also accessing these functions' results
8751 including their tm_zone values if any, and any related TZ setting.
8752 (format_time_string): Last arg is now struct tm *, not struct tm **,
8753 so that the struct tm is saved in the critical section.
8754 All callers changed. Simplify allocation of initial buffer, partly
8755 motivated by the fact that memory allocation needs to be outside
8756 the critical section.
8757
8758 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8759
8760 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8761 with RESET_INTERVAL.
8762
8763 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8764 Remove duplicated buffer name initialization.
8765
8766 2012-05-02 Jim Meyering <jim@meyering.net>
8767
8768 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8769
8770 * xfns.c (x_window): Use xstrdup (Bug#11375).
8771
8772 2012-05-02 Eli Zaretskii <eliz@gnu.org>
8773
8774 * xdisp.c (pos_visible_p): If already at a newline from the
8775 display string before the 'while' loop, don't walk back the glyphs
8776 from it3.glyph_row. Solves assertion violation when the display
8777 string begins with a newline (egg.el). (Bug#11367)
8778
8779 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8780
8781 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8782 Move to simple.el.
8783
8784 2012-05-01 Glenn Morris <rgm@gnu.org>
8785
8786 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8787 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8788 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8789 All were removed before 23.1.
8790
8791 * dispnew.c: Remove HAVE_LIBNCURSES test;
8792 it is always true on relevant platforms.
8793
8794 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8795 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8796
8797 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8798
8799 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8800
8801 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8802 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8803 Remove.
8804
8805 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8806
8807 Do not avoid creating empty evaporating overlays (Bug#9642).
8808 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8809 That is, do not delete an evaporating overlay if it becomes
8810 empty after its bounds are adjusted to fit within its buffer.
8811 This fix caused other problems, and I'm reverting it until we get
8812 to the bottom of them.
8813
8814 2012-04-27 Chong Yidong <cyd@gnu.org>
8815
8816 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8817
8818 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8819
8820 * xdisp.c (pos_visible_p): If the window start position is beyond
8821 ZV, start the display from buffer beginning. Prevents assertion
8822 violation in init_iterator when the minibuffer window is scrolled
8823 via the scroll bar.
8824
8825 * window.c (window_scroll_pixel_based): Likewise.
8826
8827 2012-04-27 Chong Yidong <cyd@gnu.org>
8828
8829 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8830
8831 2012-04-27 Glenn Morris <rgm@gnu.org>
8832
8833 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8834 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8835
8836 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8837
8838 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8839 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
8840
8841 2012-04-26 Eli Zaretskii <eliz@gnu.org>
8842
8843 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8844 display element, check also the underlying string or buffer
8845 character. (Bug#11341)
8846
8847 * w32menu.c: Include w32heap.h.
8848 (add_menu_item): If the call to AppendMenuW (via
8849 unicode_append_menu) fails, disable Unicode menus only if we are
8850 running on Windows 9X/Me.
8851
8852 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8853
8854 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8855 (xgetint): Add missing shift for LSB tags.
8856
8857 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8858
8859 * keyboard.c (read_char): Don't wipe echo area for select window
8860 events: These might get delayed via `mouse-autoselect-window'
8861 (Bug#11304).
8862
8863 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8864
8865 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8866 manipulation of :loaded-from data.
8867
8868 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8869
8870 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8871 now a cons (bug#11311).
8872
8873 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8874
8875 Do not create empty overlays with the evaporate property (Bug#9642).
8876 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8877 if it becomes empty after its bounds are adjusted to fit within
8878 its buffer. Without this fix, in a nonempty buffer (let ((o
8879 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8880 yields an empty overlay that has the evaporate property, which is
8881 not supposed to happen.
8882
8883 Fix minor GTK3 problems found by static checking.
8884 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8885 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8886 (struct _EmacsFixedClass, emacs_fixed_get_type):
8887 Move decls here from emacsgtkfixed.h, since they needn't be public.
8888 (emacs_fixed_get_type): Now static.
8889 (emacs_fixed_class_init): Omit unused local.
8890 (emacs_fixed_child_type): Remove; unused.
8891 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8892 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8893 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8894 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8895 (EMACS_FIXED_GET_CLASS): Remove; unused.
8896 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8897
8898 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8899 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8900
8901 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8902
8903 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8904 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8905 (__malloc_size_t, __malloc_ptrdiff_t):
8906 Remove. All uses removed, replaced by the definiens if needed,
8907 since we can assume C89 or better now.
8908 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8909 (protect_malloc_state, align, get_contiguous_space)
8910 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8911 (malloc_atfork_handler_child, malloc_enable_thread)
8912 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8913 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8914 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8915 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8916 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8917 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8918 Define using prototypes, not old style.
8919 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8920 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8921 (align): Don't assume that signed integer overflow wraps around.
8922 Omit unused local var.
8923 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8924 (_free_internal_nolock, memalign, mallochook, reallochook):
8925 Omit no-longer-needed casts.
8926 (valloc): Use getpagesize, not __getpagesize.
8927 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8928 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8929
8930 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8931
8932 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
8933
8934 Move functions from C to Lisp. Make non-blocking method calls
8935 the default. Implement further D-Bus standard interfaces.
8936
8937 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8938 (QCdbus_request_name_allow_replacement)
8939 (QCdbus_request_name_replace_existing)
8940 (QCdbus_request_name_do_not_queue)
8941 (QCdbus_request_name_reply_primary_owner)
8942 (QCdbus_request_name_reply_in_queue)
8943 (QCdbus_request_name_reply_exists)
8944 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8945 (QCdbus_registered_serial, QCdbus_registered_method)
8946 (QCdbus_registered_signal): New Lisp objects.
8947 (XD_DEBUG_MESSAGE): Use sizeof.
8948 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8949 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8950 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8951 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8952 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8953 (xd_signature, xd_append_arg): Allow float for integer types.
8954 (xd_get_connection_references): New function.
8955 (xd_get_connection_address): Rename from xd_initialize.
8956 Return cached address.
8957 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8958 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8959 level.
8960 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8961 Return number of refcounts.
8962 (Fdbus_get_unique_name): Make stronger parameter check.
8963 (Fdbus_message_internal): New defun.
8964 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8965 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8966 (Fdbus_send_signal, Fdbus_register_service)
8967 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8968 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8969 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8970 (Vdbus_compiled_version, Vdbus_runtime_version)
8971 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8972 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8973 (Vdbus_message_type_signal): New defvars.
8974 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8975 Adapt docstring.
8976
8977 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8978
8979 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8980 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8981 Do not assume ptrdiff_t is the same width as 'int'.
8982
8983 * alloc.c: Handle unusual debugging option combinations.
8984 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8985 since the two debugging options are incompatible.
8986 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8987 is defined.
8988 (mem_init, mem_insert, mem_insert_fixup):
8989 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8990 (NEED_MEM_INSERT): Remove; no longer needed.
8991
8992 2012-04-22 Leo Liu <sdl.web@gmail.com>
8993
8994 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8995
8996 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8997
8998 * sysdep.c [__FreeBSD__]: Minor cleanups.
8999 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9000 Use Emacs indenting style more consistently. Avoid some casts.
9001 Use 'double' consistently rather than mixing 'float' and 'double'.
9002
9003 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9004
9005 * sysdep.c (list_system_processes, system_process_attributes):
9006 Add implementation for FreeBSD (Bug#5243).
9007
9008 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9009
9010 * lisp.mk (lisp): Update.
9011
9012 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9013
9014 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9015 It is never used otherwise.
9016
9017 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9018
9019 * print.c (print_preprocess): Only check print_depth if print-circle
9020 is nil.
9021 (print_object): Check for cycles even when print-circle is nil and
9022 print-gensym is t, but only check print_depth if print-circle is nil.
9023
9024 2012-04-20 Chong Yidong <cyd@gnu.org>
9025
9026 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9027 set the status to "failed" and ensure that sentinel is run.
9028
9029 2012-04-20 Glenn Morris <rgm@gnu.org>
9030
9031 * process.c (Fset_process_inherit_coding_system_flag)
9032 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9033 (Fmake_network_process, Fmake_serial_process): Doc fix.
9034
9035 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9036
9037 * xdisp.c (string_buffer_position_lim): Limit starting position to
9038 BEGV.
9039 (set_cursor_from_row): If called for a mode-line or header-line
9040 row, return zero immediately.
9041 (try_cursor_movement): If inside continuation line, don't back up
9042 farther than the first row after the header line, if any.
9043 Don't consider the header-line row as "partially visible", even if
9044 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9045
9046 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9047
9048 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9049 (bug#11238).
9050
9051 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9052 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9053
9054 configure: new option --enable-gcc-warnings (Bug#11207)
9055 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9056 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9057 (ALL_CFLAGS): Use new macros rather than old.
9058 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9059 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9060 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9061 -Wunused-result, -Wunused-variable. This should go away once
9062 the Emacs and Gnulib regex code is merged.
9063 (xmalloc, xrealloc): Now static.
9064
9065 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9066
9067 * dired.c (Fsystem_groups): Remove unused local.
9068
9069 2012-04-17 Glenn Morris <rgm@gnu.org>
9070
9071 * dired.c (Fsystem_users): Doc fix.
9072
9073 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9074
9075 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9076 (syms_of_dired): Add them.
9077
9078 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9079
9080 Fix minor alloc.c problems found by static checking.
9081 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9082 New extern decls, to avoid calling undeclared functions.
9083 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9084 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9085 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9086 (NEED_MEM_INSERT): New macro.
9087 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9088 Remove one incorrect comment and fix another.
9089
9090 Fix minor ralloc.c problems found by static checking.
9091 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9092 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9093 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9094 (r_alloc_sbrk): Now static.
9095
9096 Improve ralloc.c interface checking.
9097 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9098 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9099 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9100 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9101 [REL_ALLOC]: ... to here, to check interface.
9102 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9103 Remove decls. This fixes an "It stinks!".
9104
9105 * alloc.c (which_symbols): Fix alignment issue / type clash.
9106
9107 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9108
9109 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9110 (struct Lisp_Misc_Any): Likewise.
9111 (struct Lisp_Free): Likewise.
9112 * alloc.c (union aligned_Lisp_Symbol): Define.
9113 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9114 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9115 (union aligned_Lisp_Misc): Define.
9116 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9117 aligned_Lisp_Misc instead of union Lisp_Misc.
9118 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9119
9120 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9121
9122 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9123 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9124 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9125 * s/netbsd.h, s/sol2-6.h:
9126 Remove definition of GC_MARK_STACK, since the default now works.
9127 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9128 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9129 no longer the default.
9130 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9131
9132 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9133
9134 * lread.c (lisp_file_lexically_bound_p):
9135 Fix hang at ";-*-\n" (bug#11238).
9136
9137 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9138
9139 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9140 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9141
9142 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9143
9144 * nsterm.m (constrainFrameRect): Always constrain when there is only
9145 one screen (Bug#10962).
9146
9147 2012-04-13 Ken Brown <kbrown@cornell.edu>
9148
9149 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9150
9151 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9152
9153 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9154
9155 2012-04-11 Daniel Colascione <dancol@dancol.org>
9156
9157 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9158 against is gone. It's better to use vfork now so that when Cygwin
9159 gains a new, working vfork, we use it automatically (bug#10398).
9160
9161 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9162
9163 * window.c (save_window_save): Obey window-point-insertion-type.
9164
9165 2012-04-11 Glenn Morris <rgm@gnu.org>
9166
9167 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9168
9169 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9170
9171 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9172
9173 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9174
9175 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9176 (force_quit_count): New var.
9177 (handle_interrupt): Use it.
9178
9179 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9180
9181 * w32.c (w32_delayed_load): Record the full path of the library
9182 being loaded (bug#10424).
9183
9184 2012-04-09 Glenn Morris <rgm@gnu.org>
9185
9186 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9187 not just in the obarray, before snarfing them. (Bug#11036)
9188
9189 * Makefile.in ($(leimdir)/leim-list.el):
9190 Pass EMACS rather than BUILT_EMACS.
9191
9192 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9193
9194 * process.c (make_process):
9195 * process.h: Add integer `gnutls_handshakes_tried' member to
9196 process struct.
9197
9198 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9199 Add convenience `GNUTLS_LOG2i' macro.
9200
9201 * gnutls.c (gnutls_log_function2i): Convenience log function.
9202 (emacs_gnutls_read): Use new log functions,
9203 `gnutls_handshakes_tried' process member, and
9204 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9205 attempts per process (connection).
9206
9207 2012-04-09 Chong Yidong <cyd@gnu.org>
9208
9209 * eval.c (Fuser_variable_p, user_variable_p_eh)
9210 (lisp_indirect_variable): Functions deleted.
9211 (Fdefvar): Caller changed.
9212
9213 * callint.c (Finteractive, Fcall_interactively):
9214 * minibuf.c (Fread_variable): Callers changed.
9215
9216 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9217
9218 * xdisp.c (set_cursor_from_row): If the display string appears in
9219 the buffer at position that is closer to point than the position
9220 after the display string, display the cursor on the first glyph of
9221 the display string. Fixes cursor display when a 'display' text
9222 property immediately follows invisible text. (Bug#11094)
9223
9224 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9225
9226 composite.c: use 'double' consistently
9227 * composite.c (get_composition_id): Use 'double' consistently
9228 instead of converting 'float' to 'double' and vice versa; this is
9229 easier to understand and avoids a GCC warning.
9230
9231 2012-04-09 Glenn Morris <rgm@gnu.org>
9232
9233 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9234 preparation for dumping it with emacs. (Bug#4789)
9235 (leimdir): New variable.
9236 ($(leimdir)/leim-list.el): New rule.
9237 (emacs$(EXEEXT)): Depend on leim-list.el.
9238
9239 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9240 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9241 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9242
9243 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9244
9245 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9246 proper alignment.
9247
9248 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9249
9250 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9251 Remove unused local variable.
9252
9253 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9254
9255 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9256 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9257 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9258 objects, as mark_maybe_pointer will catch them otherwise.
9259 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9260 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9261
9262 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9263
9264 Fix typo that broke non-Windows builds.
9265 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9266
9267 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9268
9269 Support building on MS-Windows with libxml2.
9270
9271 * makefile.w32-in (OBJ2): Add xml.$(O).
9272 (GLOBAL_SOURCES): Add xml.c.
9273 ($(BLD)/xml.$(O)): New dependency list.
9274
9275 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9276 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9277 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9278 [!WINDOWSNT]: New macros.
9279 (init_libxml2_functions, libxml2_loaded_p): New functions.
9280 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9281 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9282 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9283 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9284 linked in).
9285 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9286 Call init_libxml2_functions before calling libxml2 functions.
9287 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9288
9289 * emacs.c: Don't include libxml/parser.h.
9290 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9291 xmlCleanupParser directly.
9292
9293 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9294
9295 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9296
9297 * indent.c (Fvertical_motion): If there is a display string at
9298 point, use it.vpos to compute how many lines to backtrack after
9299 move_it_to point. (Bug#11133)
9300
9301 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9302
9303 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9304 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9305 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9306 macros related to unification of CJK characters. For the details,
9307 see the discussion following the message here:
9308 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9309
9310 2012-04-04 Chong Yidong <cyd@gnu.org>
9311
9312 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9313
9314 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9315
9316 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9317 instead of alloca. (Bug#11138)
9318
9319 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9320
9321 * w32menu.c (is_simple_dialog): Properly check lisp types.
9322 (Bug#11141)
9323
9324 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9325
9326 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9327 position we get to after a call to move_it_to fails the
9328 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9329 only if we wind up in a string from display property. (Bug#11063)
9330
9331 * window.c (Fdelete_other_windows_internal): Invalidate the row
9332 and column information about mouse highlight, so that redisplay
9333 restores it after reallocating the glyph matrices. (Bug#7464)
9334
9335 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9336 string comes from a `display' text property, use the buffer
9337 position of that property as if we actually saw that position in
9338 the row's glyphs.
9339 (move_it_by_lines): Remove the assertion that
9340 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9341 violated when there's a before-string at the beginning of a line.
9342 (Bug#11063)
9343
9344 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9345
9346 * xdisp.c (append_space_for_newline): If the default face was
9347 remapped, use the remapped face for the appended newline.
9348 (extend_face_to_end_of_line): Use the remapped default face for
9349 extending the face to the end of the line.
9350 (display_line): Call extend_face_to_end_of_line when the default
9351 face was remapped. (Bug#11068)
9352
9353 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9354
9355 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9356
9357 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9358
9359 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9360
9361 2012-03-27 Glenn Morris <rgm@gnu.org>
9362
9363 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9364 Doc fixes.
9365
9366 2012-03-26 Kenichi Handa <handa@m17n.org>
9367
9368 * dispextern.h (struct glyph): Fix previous change. Change the
9369 bit length of glyphless.ch to 25 (Bug#11082).
9370
9371 2012-03-26 Chong Yidong <cyd@gnu.org>
9372
9373 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9374 (command_loop_1): Use it; inhibit selection update for
9375 handle-select-window too (Bug#8996).
9376
9377 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9378
9379 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9380
9381 2012-03-25 Kenichi Handa <handa@m17n.org>
9382
9383 * dispextern.h (struct glyph): Change the bit length of
9384 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9385
9386 2012-03-24 Eli Zaretskii <eliz@gnu.org>
9387
9388 * s/ms-w32.h (tzname): Include time.h before redirecting to
9389 _tzname. Fixes the MSVC build. (Bug#9960)
9390
9391 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9392
9393 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9394 characters.
9395
9396 * xterm.c (XTread_socket): Only modify handling_signal if
9397 !SYNC_INPUT. (Bug#11080)
9398
9399 2012-03-23 Eli Zaretskii <eliz@gnu.org>
9400
9401 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9402 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9403 when fetching a multibyte character consumes more bytes than
9404 CHAR_BYTES returns, due to unification of CJK characters in
9405 string_char. (Bug#11073)
9406
9407 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9408
9409 * process.c (wait_reading_process_output): Handle pty disconnect
9410 by refraining from sending oneself a SIGCHLD (bug#10933).
9411
9412 2012-03-22 Chong Yidong <cyd@gnu.org>
9413
9414 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9415
9416 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9417 Mark string as coming from a prefix property.
9418 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9419 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9420
9421 2012-03-21 Chong Yidong <cyd@gnu.org>
9422
9423 * xfaces.c (Vface_remapping_alist): Doc fix.
9424
9425 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9426
9427 * w32proc.c (Fw32_set_console_codepage)
9428 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9429 Doc fixes.
9430
9431 2012-03-20 Chong Yidong <cyd@gnu.org>
9432
9433 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9434 to reflect default non-nil value of redisplay-dont-pause.
9435
9436 2012-03-19 Kenichi Handa <handa@m17n.org>
9437
9438 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9439 it fit in a valid range (Bug#11003).
9440
9441 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9442
9443 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9444 that is not from display property, accept the row as a "cursor
9445 row" if one of the string's character has a non-nil `cursor'
9446 property. Fixes cursor positioning when there are newlines in
9447 overlay strings, e.g. in icomplete.el. (Bug#11035)
9448
9449 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9450
9451 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9452
9453 2012-03-12 Chong Yidong <cyd@gnu.org>
9454
9455 * eval.c (inhibit_lisp_code): Rename from
9456 inhibit_window_configuration_change_hook; move from window.c.
9457
9458 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9459 * window.c (run_window_configuration_change_hook)
9460 (syms_of_window): Callers changed.
9461
9462 2012-03-11 Chong Yidong <cyd@gnu.org>
9463
9464 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9465
9466 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9467
9468 2012-03-10 Chong Yidong <cyd@gnu.org>
9469
9470 * frame.c (other_visible_frames): Don't assume the selected frame
9471 is visible (Bug#10955).
9472
9473 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9474
9475 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9476
9477 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9478
9479 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9480 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9481 zero (Bug#10954).
9482
9483 2012-03-03 Glenn Morris <rgm@gnu.org>
9484
9485 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9486
9487 2012-03-02 Eli Zaretskii <eliz@gnu.org>
9488
9489 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9490 position past the first glyph_row that ends at ZV. (Bug#10902)
9491 (redisplay_window, next_element_from_string): Fix typos in
9492 comments.
9493 (redisplay_window): Pass to move_it_vertically the margin in
9494 pixels, not in screen lines.
9495
9496 2012-03-02 Glenn Morris <rgm@gnu.org>
9497
9498 * buffer.c (buffer-list-update-hook): Doc fix.
9499
9500 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9501
9502 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9503 push_it before setting up the iterator for the first overlay
9504 string, even if we have an empty string loaded.
9505 (next_overlay_string): If there's an empty string on the iterator
9506 stack, pop the stack. (Bug#10903)
9507
9508 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9509
9510 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9511 Suggested by Stefan Monnier in
9512 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9513 * alloc.c (widen_to_Lisp_Object): New static function.
9514 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9515 and widening them to Lisp_Objects. This would work even if
9516 USE_LSB_TAG is defined and wide integers are used, which might
9517 happen in a future version of Emacs.
9518
9519 2012-02-25 Chong Yidong <cyd@gnu.org>
9520
9521 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9522 Doc fix.
9523
9524 * xselect.c (Fx_selection_exists_p): Doc fix.
9525 (x_clipboard_manager_save_all): Print an informative message
9526 before saving to clipboard manager.
9527
9528 2012-02-24 Chong Yidong <cyd@gnu.org>
9529
9530 * keyboard.c (process_special_events): Handle all X selection
9531 requests in kbd_buffer, not just the next one (Bug#8869).
9532
9533 2012-02-23 Chong Yidong <cyd@gnu.org>
9534
9535 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9536 call when setting menu-bar-lines and tool-bar-lines parameters.
9537 (unwind_create_frame_1): New helper function.
9538
9539 * window.c (inhibit_window_configuration_change_hook): New var.
9540 (run_window_configuration_change_hook): Obey it.
9541 (syms_of_window): Initialize it.
9542
9543 2012-02-22 Chong Yidong <cyd@gnu.org>
9544
9545 * xterm.c (x_draw_image_relief): Add missing type check for
9546 Vtool_bar_button_margin (Bug#10743).
9547
9548 2012-02-21 Chong Yidong <cyd@gnu.org>
9549
9550 * fileio.c (Vfile_name_handler_alist): Doc fix.
9551
9552 * buffer.c (Fget_file_buffer): Protect against invalid file
9553 handler return value.
9554
9555 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9556
9557 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9558 when computing $valmask.
9559
9560 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9561 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9562 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9563 It's useless in that case, and it can cause problems on hosts
9564 that allocate halves of EMACS_INT values separately.
9565 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9566 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9567 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9568 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9569 it avoids undefined behavior on hosts where shifting right by more
9570 than the word width has undefined behavior.
9571
9572 2012-02-19 Chong Yidong <cyd@gnu.org>
9573
9574 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9575 (Funhandled_file_name_directory, Ffile_name_as_directory)
9576 (Fdirectory_file_name, Fexpand_file_name)
9577 (Fsubstitute_in_file_name): Protect against invalid file handler
9578 return values (Bug#10845).
9579
9580 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9581
9582 * .gdbinit (pitx): Fix incorrect references to fields of the
9583 iterator stack.
9584
9585 2012-02-17 Chong Yidong <cyd@gnu.org>
9586
9587 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9588
9589 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9590
9591 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9592 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9593
9594 2012-02-15 Chong Yidong <cyd@gnu.org>
9595
9596 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9597 marked as special. Also, starting docstrings with * is obsolete.
9598
9599 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9600
9601 * gnutls.c (emacs_gnutls_write): Fix last change.
9602
9603 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9604
9605 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9606 send_process.
9607
9608 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9609
9610 * keymap.c (Fsingle_key_description): Handle char ranges.
9611
9612 2012-02-12 Chong Yidong <cyd@gnu.org>
9613
9614 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9615 as that creates a dangerous corner case.
9616
9617 * window.c (Fdelete_window_internal): Invalidate the mouse
9618 highlight (Bug#9904).
9619
9620 2012-02-12 Glenn Morris <rgm@gnu.org>
9621
9622 * xselect.c (Fx_own_selection_internal)
9623 (Fx_get_selection_internal, Fx_disown_selection_internal)
9624 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9625 * nsselect.m (Fx_own_selection_internal)
9626 (Fx_disown_selection_internal, Fx_selection_exists_p)
9627 (Fx_selection_owner_p, Fx_get_selection_internal):
9628 Sync docs and argument specs with the xselect.c versions.
9629
9630 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9631
9632 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9633
9634 2012-02-11 Eli Zaretskii <eliz@gnu.org>
9635
9636 * w32select.c (Fx_selection_exists_p): Sync doc string and
9637 argument list with xselect.c. (Bug#10783)
9638
9639 * w16select.c (Fx_selection_exists_p): Sync doc string and
9640 argument list with xselect.c. (Bug#10783)
9641
9642 2012-02-10 Glenn Morris <rgm@gnu.org>
9643
9644 * fns.c (Fsecure_hash): Doc fix.
9645
9646 2012-02-09 Kenichi Handa <handa@m17n.org>
9647
9648 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9649
9650 2012-02-07 Chong Yidong <cyd@gnu.org>
9651
9652 * buffer.c (Fbuffer_local_variables)
9653 (buffer_lisp_local_variables): Handle unbound vars correctly;
9654 don't let Qunbound leak into Lisp.
9655
9656 2012-02-07 Glenn Morris <rgm@gnu.org>
9657
9658 * image.c (Fimagemagick_types): Doc fix.
9659
9660 * image.c (imagemagick-render-type): Change it from a lisp object
9661 to an integer. Move the doc here from the lisp manual.
9662 Treat all values not equal to 0 the same.
9663
9664 2012-02-06 Chong Yidong <cyd@gnu.org>
9665
9666 * doc.c (store_function_docstring): Avoid applying docstring of
9667 alias to base function (Bug#2603).
9668
9669 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9670
9671 * .gdbinit (pp1, pv1): Remove redundant defines.
9672 (pr): Use pp.
9673
9674 2012-02-04 Chong Yidong <cyd@gnu.org>
9675
9676 * nsterm.m: Declare a global (Bug#10694).
9677
9678 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9679
9680 * w32.c (get_emacs_configuration_options):
9681 Include --enable-checking, if specified, in the return value.
9682
9683 2012-02-04 Martin Rudalics <rudalics@gmx.at>
9684
9685 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9686 after rounding frame sizes. (Bug#9723)
9687
9688 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9689
9690 * keyboard.c (adjust_point_for_property): Don't position point
9691 before BEGV. (Bug#10696)
9692
9693 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9694
9695 Handle overflow when computing char display width (Bug#9496).
9696 * character.c (char_width): Return EMACS_INT, not int.
9697 (char_width, c_string_width): Check for overflow when
9698 computing the width; this is possible now that individual
9699 characters can have unbounded width. Problem introduced
9700 by merge from Emacs 23 on 2012-01-19.
9701
9702 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
9703
9704 * dbusbind.c (Fdbus_register_method): Mention the return value
9705 :ignore in the docstring.
9706
9707 2012-02-02 Glenn Morris <rgm@gnu.org>
9708
9709 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9710
9711 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9712 Unconditionally set to t. (Bug#10673)
9713 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9714 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9715 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9716
9717 2012-02-02 Kenichi Handa <handa@m17n.org>
9718
9719 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9720 0, do not call append_composite_glyph.
9721
9722 2012-02-02 Kenichi Handa <handa@m17n.org>
9723
9724 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9725 NULL (Bug#6988).
9726 (x_produce_glyphs): If the component of a composition is a null
9727 string, set it->pixel_width to 1 to avoid zero-width glyph.
9728
9729 2012-02-01 Eli Zaretskii <eliz@gnu.org>
9730
9731 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9732 first 2 arguments are identical. This makes inserting large
9733 output from a subprocess an order of magnitude faster on
9734 MS-Windows, where all sbrk'ed memory is always contiguous.
9735
9736 2012-01-31 Glenn Morris <rgm@gnu.org>
9737
9738 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9739 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9740 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9741
9742 2012-01-29 Glenn Morris <rgm@gnu.org>
9743
9744 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9745
9746 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9747
9748 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9749
9750 2012-01-28 Chong Yidong <cyd@gnu.org>
9751
9752 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9753
9754 2012-01-26 Chong Yidong <cyd@gnu.org>
9755
9756 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9757
9758 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9759 repeat counts (Bug#10507).
9760
9761 2012-01-26 Glenn Morris <rgm@gnu.org>
9762
9763 * lread.c (syms_of_lread): Doc fix.
9764
9765 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9766
9767 * coding.c (encode_designation_at_bol): Change return value to
9768 EMACS_INT.
9769
9770 2012-01-25 Chong Yidong <cyd@gnu.org>
9771
9772 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9773
9774 2012-01-21 Chong Yidong <cyd@gnu.org>
9775
9776 * floatfns.c (Fcopysign): Make the second argument non-optional,
9777 since nil is not allowed anyway.
9778
9779 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9780
9781 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9782 (send_process): Likewise.
9783
9784 2012-01-19 Martin Rudalics <rudalics@gmx.at>
9785
9786 * window.c (save_window_save, Fcurrent_window_configuration)
9787 (Vwindow_persistent_parameters): Do not use Qstate.
9788 Rewrite doc-strings.
9789
9790 2012-01-19 Kenichi Handa <handa@m17n.org>
9791
9792 * character.c (char_width): New function.
9793 (Fchar_width, c_string_width, lisp_string_width):
9794 Use char_width (Bug#9496).
9795
9796 2012-01-16 Martin Rudalics <rudalics@gmx.at>
9797
9798 * window.c (Vwindow_persistent_parameters): New variable.
9799 (Fset_window_configuration, save_window_save): Handle persistent
9800 window parameters.
9801
9802 2012-01-14 Eli Zaretskii <eliz@gnu.org>
9803
9804 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9805 thrashing the stack of the thread. (Bug#9087)
9806
9807 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9808
9809 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9810
9811 2012-01-11 Eli Zaretskii <eliz@gnu.org>
9812
9813 * xdisp.c (rows_from_pos_range): Handle the case where the
9814 highlight ends on a newline. (Bug#10464)
9815 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9816 he end column for display of highlight that ends on a newline
9817 before a R2L line.
9818
9819 2012-01-11 Glenn Morris <rgm@gnu.org>
9820
9821 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9822 from load-path also when installation-directory is nil. (Bug#10208)
9823
9824 2012-01-10 Glenn Morris <rgm@gnu.org>
9825
9826 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9827
9828 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9829 Update template values to be closer to their typical values these days.
9830
9831 2012-01-09 Eli Zaretskii <eliz@gnu.org>
9832
9833 * xdisp.c (rows_from_pos_range): Accept additional argument
9834 DISP_STRING, and accept any glyph in a row whose object is that
9835 string as eligible for mouse highlight. Fixes mouse highlight of
9836 display strings from overlays. (Bug#10464)
9837
9838 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
9839
9840 emacs: fix an auto-save permissions race condition (Bug#10400)
9841 * fileio.c (auto_saving_dir_umask): New static var.
9842 (Fmake_directory_internal): Use it.
9843 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9844 creating the directory. The old code temporarily assigns
9845 too-generous permissions to the directory.
9846 (do_auto_save_eh): Clear it.
9847 (Fdo_auto_save): Catch all errors, not just file errors, so
9848 that the var is always cleared.
9849
9850 2012-01-07 Eli Zaretskii <eliz@gnu.org>
9851
9852 * search.c (scan_buffer): Pass character positions to
9853 know_region_cache, not byte positions. (Bug#6540)
9854
9855 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
9856
9857 * w32.c (sys_rename): Report EXDEV when rename of a directory
9858 fails because the target is on another logical disk. (Bug#10284)
9859
9860 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9861
9862 * xterm.c (x_embed_request_focus): New function.
9863
9864 * xterm.h: Add prototype.
9865
9866 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9867
9868 2012-01-05 Glenn Morris <rgm@gnu.org>
9869
9870 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9871
9872 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9873
9874 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9875 Load gnutls_transport_set_lowat only if GnuTLS version is below
9876 2.11.1.
9877 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9878 GnuTLS versions below 2.11.1.
9879
9880 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9881
9882 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9883 to the doc string advising against its use for altering the way
9884 windows are scrolled.
9885
9886 2011-12-28 Kenichi Handa <handa@m17n.org>
9887
9888 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9889 coding-system ASCII compatible only when it does not produce BOM
9890 on encoding (Bug#10383).
9891
9892 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9893
9894 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9895 can scroll.
9896 (create_and_show_popup_menu): Always use menu_position_func for
9897 Gtk3 (Bug#10361).
9898
9899 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9900
9901 * callint.c (Fcall_interactively): Don't truncate prompt string.
9902
9903 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9904
9905 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9906 property that ends at ZV, so that the bidi iteration could be
9907 resumed from there (after widening). (Bug#10360)
9908
9909 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9910
9911 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9912
9913 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9914
9915 * nsterm.m (x_free_frame_resources):
9916 Release f->output_data.ns->miniimage.
9917 (ns_index_color): Fix indentation. Do not retain
9918 color_table->colors[i].
9919
9920 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9921 before returning.
9922
9923 * nsfns.m (x_set_background_color): Assign return value from
9924 ns_index_color to face-background instead of NSColor*.
9925 (ns_implicitly_set_icon_type): Fix indentation.
9926 Change assignment in for loop to comparison.
9927
9928 * emacs.c (ns_pool): New variable.
9929 (main): Assign ns_pool.
9930 (Fkill_emacs): Call ns_release_autorelease_pool.
9931
9932 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9933 autorelease fdesc, release fdAttrs and tdict.
9934 (ns_get_covering_families): Release charset.
9935 (ns_findfonts): Release NSFontDescriptor created with new.
9936 (ns_uni_to_glyphs): Fix indentation.
9937 (setString): Release attrStr before assigning new value.
9938
9939 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9940
9941 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9942 and NS_IMPL_COCOA.
9943 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9944 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9945
9946 2011-12-18 David Reitter <reitter@cmu.edu>
9947
9948 * nsterm.m (ns_term_init): Subscribe for notifications
9949 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9950 to method trackingNotification in EmacsMenu.
9951
9952 * nsmenu.m (trackingMenu): New variable.
9953 (trackingNotification): New method (from Aquamacs).
9954 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9955 from Aquamacs (Bug#7030).
9956
9957 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9958
9959 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9960 (symbol_to_nsstring): Fix indentation.
9961 (ns_symbol_to_pb): New function.
9962 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9963 (Fns_rotate_cut_buffers_internal): Remove.
9964 (Fns_store_selection_internal): Rename from
9965 Fns_store_cut_buffer_internal.
9966 (ns_get_foreign_selection, Fx_own_selection_internal)
9967 (Fx_disown_selection_internal, Fx_selection_exists_p)
9968 (Fns_get_selection_internal, Fns_store_selection_internal):
9969 Use ns_symbol_to_pb and check if return value is nil.
9970 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9971 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9972 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9973 renamed to Sns_store_selection_internal.
9974 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9975 and remove this function.
9976 (ns_handle_selection_clear): Remove, never used.
9977 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9978 here.
9979
9980 2011-12-17 Ken Brown <kbrown@cornell.edu>
9981
9982 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9983 GID is unknown (Bug#10257).
9984
9985 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9986
9987 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9988 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9989 which caused a build failure on GNU/Linux IA-64. This problem was
9990 introduced by my 2011-10-07 patch.
9991
9992 2011-12-15 Juri Linkov <juri@jurta.org>
9993
9994 * image.c (imagemagick_error): New function. (Bug#10112)
9995 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9996 Use `imagemagick_error' where ImageMagick functions return
9997 `MagickFalse'.
9998 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9999 proper order.
10000
10001 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10002
10003 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10004 fill background (Bug#8992).
10005
10006 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10007
10008 * window.c (Vwindow_combination_resize)
10009 (Vwindow_combination_limit): Use t instead of non-nil in
10010 doc-strings.
10011 (Vrecenter_redisplay): Add first sentence of doc-string on
10012 separate line.
10013 (Frecenter): Fix doc-string typo.
10014
10015 2011-12-11 Kenichi Handa <handa@m17n.org>
10016
10017 * coding.c (Funencodable_char_position): Pay attention to the
10018 buffer text relocation (Bug#9389).
10019
10020 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10021
10022 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10023 gtk_init (Bug#10100).
10024
10025 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10026
10027 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10028 IT->string is nil. (Bug#10263)
10029
10030 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10031
10032 * nsterm.h (x_free_frame_resources): Declare.
10033
10034 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10035 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10036
10037 * nsterm.h (ns_get_defaults_value): Declare.
10038
10039 * nsterm.m (ns_default): Call ns_get_defaults_value.
10040
10041 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10042
10043 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10044 (Bug#10170)
10045
10046 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10047
10048 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10049 that where the value of an _OBJC_* symbol points to is in the .bss
10050 section (Bug#10240).
10051
10052 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10053
10054 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10055 after the loop to call ccl_driver at least once (Bug#8619).
10056
10057 2011-12-08 Kenichi Handa <handa@m17n.org>
10058
10059 * ftfont.c (get_adstyle_property): Fix previous change
10060 (Bug#10233).
10061
10062 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10063
10064 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10065 dirs from the default value of EMACSLOADPATH (bug#10208).
10066
10067 2011-12-07 Glenn Morris <rgm@gnu.org>
10068
10069 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10070 installation and source directories as well. (Bug#10208)
10071
10072 2011-12-06 Chong Yidong <cyd@gnu.org>
10073
10074 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10075
10076 2011-12-06 Glenn Morris <rgm@gnu.org>
10077
10078 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10079 as an error, not just -1. (Bug#10217)
10080
10081 2011-12-05 Chong Yidong <cyd@gnu.org>
10082
10083 * keyboard.c (process_special_events): New function.
10084 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10085
10086 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10087
10088 * coding.c (encode_designation_at_bol): Don't use uninitialized
10089 local variable (Bug#9318).
10090
10091 2011-12-05 Kenichi Handa <handa@m17n.org>
10092
10093 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10094 return Qnil (Bug#8046, Bug#10193).
10095
10096 2011-12-05 Kenichi Handa <handa@m17n.org>
10097
10098 * coding.c (encode_designation_at_bol): New args charbuf_end and
10099 dst. Return the number of produced bytes. Callers changed.
10100 (coding_set_source): Return how many bytes coding->source was
10101 relocated.
10102 (coding_set_destination): Return how many bytes
10103 coding->destination was relocated.
10104 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10105 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10106
10107 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10108
10109 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10110 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10111 macro (Bug#9318).
10112
10113 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10114
10115 The following changes are to fix Bug#9318.
10116
10117 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10118 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10119 (encode_coding_iso_2022, encode_coding_sjis)
10120 (encode_coding_big5, encode_coding_charset): Use the above macros.
10121
10122 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10123
10124 * lisp.h (process_quit_flag): Fix external declaration.
10125
10126 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10127
10128 Don't macro-inline non-performance-critical code.
10129 * eval.c (process_quit_flag): New function.
10130 * lisp.h (QUIT): Use it.
10131
10132 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10133
10134 * nsfns.m (get_geometry_from_preferences): New function.
10135 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10136
10137 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10138
10139 * emacs.c (Qkill_emacs): Define.
10140 (syms_of_emacs): Initialize it.
10141 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10142 Qquit_flag to `kill-emacs' instead.
10143 (quit_throw_to_read_char): Add parameter `from_signal'.
10144 All callers changed. Call Fkill_emacs if requested and safe.
10145 * lisp.h (QUIT): Call Fkill_emacs if requested.
10146
10147 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10148
10149 * widget.c (update_wm_hints): Return if wmshell is null.
10150 (widget_update_wm_size_hints): New function.
10151
10152 * widget.h (widget_update_wm_size_hints): Declare.
10153
10154 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10155 widget_update_wm_size_hints (Bug#10104).
10156
10157 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10158
10159 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10160 before a newline, prepare the bidi iterator for consuming the
10161 newline, and keep the current paragraph direction. (Bug#10183)
10162 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10163
10164 2011-12-02 Juri Linkov <juri@jurta.org>
10165
10166 * search.c (Fword_search_regexp): New Lisp function created from
10167 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10168 (Fword_search_backward, Fword_search_forward)
10169 (Fword_search_backward_lax, Fword_search_forward_lax):
10170 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10171 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10172
10173 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10174
10175 * fileio.c (Finsert_file_contents): Move after-change-function call
10176 to before the "handled:" label, since all "goto handled" appear in
10177 cases where the *-change-functions have already been properly called
10178 (bug#10117).
10179
10180 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10181
10182 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10183 waiting for input. (Bug#10169)
10184
10185 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10186
10187 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10188 verifies glyph row's hash code--we have just reallocated the
10189 glyphs, so their contents can be complete garbage. (Bug#10164)
10190
10191 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10192
10193 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10194
10195 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10196
10197 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10198 attributes are tested _before_ calling verify_row_hash, to protect
10199 against GCC re-ordering of the tests. (Bug#10164)
10200
10201 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10202
10203 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10204
10205 * xterm.c (handle_one_xevent): Only set async_visible and friends
10206 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10207 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10208 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10209
10210 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10211
10212 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10213 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10214 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10215 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10216 All uses changed to use GCPRO1 etc.
10217 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10218 Revert to old implementation (i.e., before 2011-03-11).
10219
10220 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10221
10222 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10223 of scroll runs so as to avoid assigning disabled bogus rows and
10224 unnecessary graphics copy operations.
10225
10226 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10227
10228 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10229 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10230 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10231 (malloc, free, realloc, calloc): Redirect to e_* only when
10232 compiling Emacs.
10233
10234 * lisp.h (GCTYPEBITS): Move before first use.
10235 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10236 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10237 this macro definition.
10238
10239 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10240 _MSC_VER.
10241
10242 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10243
10244 * gtkutil.c (xg_create_frame_widgets):
10245 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10246 present with Gtk+ 2.0.
10247
10248 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10249
10250 * fileio.c (Finsert_file_contents): Undo previous change; see
10251 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10252
10253 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10254
10255 Rename locals to avoid shadowing.
10256 * fileio.c (Finsert_file_contents):
10257 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10258 * process.c (wait_reading_process_output):
10259 Rename inner 'proc' to 'p' to avoid shadowing.
10260 Indent for consistency with usual Emacs style.
10261
10262 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10263
10264 * xdisp.c (redisplay_window): If cursor row is not fully visible
10265 after recentering, and scroll-conservatively is set to a large
10266 number, scroll window by a few more lines to make the cursor fully
10267 visible and out of scroll-margin. (Bug#10105)
10268 (start_display): Don't move to the next line if the display should
10269 start at a newline that is part of a display vector or an overlay
10270 string. (Bug#10119)
10271
10272 2011-11-24 Juri Linkov <juri@jurta.org>
10273
10274 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10275 after the `MagickPingImage' call. (Bug#10112)
10276
10277 2011-11-23 Chong Yidong <cyd@gnu.org>
10278
10279 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10280
10281 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10282
10283 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10284 making another buffer current. (Bug#10114)
10285
10286 2011-11-23 Glenn Morris <rgm@gnu.org>
10287
10288 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10289
10290 2011-11-23 Chong Yidong <cyd@gnu.org>
10291
10292 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10293 using it (Bug#5984).
10294
10295 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10296
10297 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10298 and header-lines, as they don't have one computed for them.
10299 (Bug#10098)
10300
10301 * .gdbinit (prow): Make displayed values more self-explaining.
10302 Add row's hash code.
10303
10304 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10305
10306 * process.c (wait_reading_process_output): Fix asynchrounous
10307 GnuTLS socket handling on some versions of the GnuTLS library.
10308 (wait_reading_process_output): Add comment and URL.
10309
10310 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10311
10312 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10313
10314 2011-11-21 Chong Yidong <cyd@gnu.org>
10315
10316 * window.c (Fnext_window, Fprevious_window): Doc fix.
10317
10318 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10319
10320 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10321
10322 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10323
10324 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10325
10326 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10327
10328 * window.c (Fset_window_combination_limit): Rename argument
10329 STATUS to LIMIT.
10330 (Vwindow_combination_limit): Remove "status" from doc-string.
10331
10332 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10333
10334 * m/ibms390.h: Remove.
10335 * m/ibms390x.h: Don't include "ibms390.h".
10336
10337 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10338
10339 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10340 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10341
10342 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10343
10344 * casetab.c (Fset_case_table):
10345 * charset.c (Fcharset_after): Fix typos.
10346
10347 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10348
10349 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10350 Otherwise, valgrind does not work on some platforms.
10351 Problem reported by Andreas Schwab in
10352 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10353 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10354 is set, removing the need for VIRT_ADDRESS_VARIES.
10355 (PURE_P): Use a more-efficient implementation that needs just one
10356 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10357 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10358 to 4 (xorl, subq, cmpq, setbe).
10359 * alloc.c (pure): Always extern now, since that's the
10360 VIRT_ADDR_VARIES behavior.
10361 (PURE_POINTER_P): Use a single comparison, not two, for
10362 consistency with the new puresize.h.
10363 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10364 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10365 Remove VIRT_ADDR_VARIES no longer needed.
10366
10367 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10368
10369 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10370 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10371 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10372 behave as if the cursor position were at the window margin.
10373
10374 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10375 and the cursor position is out of bounds, behave as if the cursor
10376 position were at the window margin. (Bug#10075)
10377
10378 2011-11-18 Chong Yidong <cyd@gnu.org>
10379
10380 * window.c (Fwindow_combination_limit): Make first argument
10381 non-optional, since it is meaningless for live windows like the
10382 selected window.
10383
10384 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10385
10386 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10387
10388 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10389
10390 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10391 (graft_intervals_into_buffer): Simplify.
10392
10393 2011-11-18 Eli Zaretskii <eliz@gnu.org>
10394
10395 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10396 hash values of the two rows.
10397 (copy_row_except_pointers): Preserve the used[] arrays and the
10398 hash values of the two rows. (Bug#10035)
10399 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10400
10401 * xdisp.c (row_hash): New function, body extracted from
10402 compute_line_metrics.
10403 (compute_line_metrics): Call row_hash, instead of computing the
10404 hash code inline.
10405
10406 * dispnew.c (verify_row_hash): Call row_hash for computing the
10407 hash code of a row, instead of duplicating code from xdisp.c.
10408
10409 * dispextern.h (row_hash): Add prototype.
10410
10411 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10412
10413 * frame.c (delete_frame): Don't delete the terminal when the last
10414 X frame is closed if emacs is built with GTK toolkit.
10415
10416 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
10417
10418 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10419
10420 2011-11-17 Martin Rudalics <rudalics@gmx.at>
10421
10422 * window.c (Vwindow_splits): Rename to
10423 Vwindow_combination_resize. Suggested by Juri Linkov.
10424 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10425 of Vwindow_splits.
10426
10427 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10428
10429 * nsfns.m (Fns_font_name):
10430 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10431
10432 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10433
10434 * window.h (window): Rename slot "nest" to "combination_limit".
10435 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10436 (Fset_window_nest): Rename to Fset_window_combination_limit.
10437 (Vwindow_nest): Rename to Vwindow_combination_limit.
10438 (recombine_windows, make_parent_window, make_window)
10439 (Fsplit_window_internal, saved_window)
10440 (Fset_window_configuration, save_window_save): Rename all
10441 occurrences of window_nest to window_combination_limit.
10442
10443 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10444
10445 * image.c (imagemagick_load_image): Fix typo.
10446
10447 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10448
10449 * xdisp.c (display_line): Move the call to
10450 highlight_trailing_whitespace before the call to
10451 compute_line_metrics, since the latter needs to see the final
10452 faces of all the glyphs to compute ROW's hash value.
10453 Fixes assertion violations in row_equal_p. (Bug#10035)
10454
10455 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10456
10457 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10458 just return (bug#10044).
10459
10460 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10461
10462 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10463 with user-defined heap size. Bump the default size of the temacs
10464 heap to 27MB, to avoid memory warning when running temacs.
10465 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10466
10467 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10468 current_matrix and desired_matrix. (Bug#9990)
10469 (verify_row_hash) [XASSERTS]: New function.
10470 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10471 that the hash value of glyph rows is correct.
10472
10473 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10474
10475 * window.h (window): Remove splits slot.
10476 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10477 (Fdelete_other_windows_internal, make_parent_window)
10478 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10479 (Fset_window_configuration, save_window_save): Don't deal with
10480 split status of windows.
10481 (saved_window): Remove splits slot.
10482 (Vwindow_splits): Rewrite doc-string.
10483
10484 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10485
10486 * xfns.c (unwind_create_frame):
10487 * nsfns.m (unwind_create_frame):
10488 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10489 Vframe_list (Bug#9999).
10490
10491 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10492
10493 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10494
10495 2011-11-11 Kenichi Handa <handa@m17n.org>
10496
10497 * callproc.c (Fcall_process): Set the member dst_multibyte of
10498 process_coding.
10499
10500 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10501
10502 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10503 avoid a crash (bug#9496).
10504
10505 2011-11-09 Chong Yidong <cyd@gnu.org>
10506
10507 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10508 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10509
10510 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10511
10512 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10513
10514 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10515
10516 Avoid some portability problems by eschewing 'extern inline' functions.
10517 The trivial performance wins aren't worth the portability hassles; see
10518 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10519 et seq.
10520 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10521 (window_box_width, window_box_left, window_box_left_offset)
10522 (window_box_right, window_box_right_offset): Undo previous change,
10523 by removing the "extern"s.
10524 * intervals.c (adjust_intervals_for_insertion)
10525 (adjust_intervals_for_deletion): Undo previous change,
10526 making these static again.
10527 (offset_intervals, temp_set_point_both, temp_set_point)
10528 (copy_intervals_to_string): No longer inline.
10529 * xdisp.c (window_text_bottom_y, window_box_width)
10530 (window_box_height, window_box_left_offset)
10531 (window_box_right_offset, window_box_left, window_box_right)
10532 (window_box): No longer inline.
10533
10534 2011-11-08 Chong Yidong <cyd@gnu.org>
10535
10536 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10537 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10538 Signal an error if not a live window.
10539 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10540 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10541
10542 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
10543
10544 * lisp.h (syms_of_abbrev): Remove declaration.
10545 Reported by CHENG Gao <chenggao@royau.me>.
10546
10547 2011-11-07 Eli Zaretskii <eliz@gnu.org>
10548
10549 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10550 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10551 of temacs in GUI mode.
10552
10553 2011-11-07 Martin Rudalics <rudalics@gmx.at>
10554
10555 * window.h: Declare delete_all_child_windows instead of
10556 delete_all_subwindows.
10557 * window.c (Fwindow_nest, Fset_window_nest)
10558 (Fset_window_new_total, Fset_window_new_normal)
10559 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10560 (delete_all_subwindows): Rename to delete_all_child_windows.
10561 (Fdelete_other_windows_internal, Fset_window_configuration):
10562 Call delete_all_child_windows instead of delete_all_subwindows.
10563 * frame.c (delete_frame): Call delete_all_child_windows instead
10564 of delete_all_subwindows.
10565
10566 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10567
10568 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10569 This is also needed for porting to any host where GC_MARK_STACK is
10570 not GC_MAKE_GCPROS_NOOPS.
10571 (which_symbols): Use it.
10572
10573 2011-11-07 Kenichi Handa <handa@m17n.org>
10574
10575 * coding.c (coding_set_destination): Check coding->src_pos only
10576 when coding->src_object is a buffer (bug#9910).
10577
10578 * process.c (send_process): Set the member src_multibyte of coding
10579 to 0 (bug#9911) when sending a unibyte text.
10580
10581 * callproc.c (Fcall_process): Set the member src_multibyte of
10582 process_coding to 0 (bug#9912).
10583
10584 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10585
10586 * xmenu.c (cleanup_widget_value_tree): New function.
10587 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10588 calling free_menubar_widget_value_tree directly (Bug#9830).
10589
10590 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10591
10592 Fix some portability problems with 'inline'.
10593 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10594 (window_box_width, window_box_left, window_box_left_offset)
10595 (window_box_right, window_box_right_offset): Declare extern.
10596 Otherwise, these inline functions do not conform to C99 and
10597 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10598 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10599 * intervals.c (adjust_intervals_for_insertion)
10600 (adjust_intervals_for_deletion): Now extern, because otherwise the
10601 extern inline functions 'offset_intervals' couldn't refer to it.
10602 (static_offset_intervals): Remove.
10603 (offset_intervals): Rewrite using the old contents of
10604 static_offset_intervals. The old version didn't conform to C99
10605 because an extern inline function contained a reference to an
10606 identifier with static linkage.
10607
10608 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10609
10610 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10611 GC.
10612
10613 2011-11-06 Eli Zaretskii <eliz@gnu.org>
10614
10615 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10616 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10617 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10618 return Qleft_to_right.
10619
10620 2011-11-06 Chong Yidong <cyd@gnu.org>
10621
10622 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10623 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10624 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10625 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10626 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10627 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10628 (Fwindow_vscroll): Doc fix.
10629 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10630 argument, since it makes no sense to pass a live window and for
10631 consistency with window-child.
10632
10633 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10634
10635 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10636 support MSVC.
10637
10638 2011-11-05 Jason Rumney <jasonr@gnu.org>
10639
10640 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10641 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10642 fonts (Bug#6029).
10643 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10644 bitwise arithmetic preventing use of unicode-sip and non-truetype
10645 opentype fonts.
10646
10647 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10648
10649 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10650 "emacs"-only part.
10651
10652 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10653 initialization code to keep similarity to xfns.c after changes
10654 from 2011-11-05.
10655
10656 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10657
10658 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10659 (unwind_create_frame): New function (Bug#9943).
10660 (Fx_create_frame): Restructure code to be more similar to the one in
10661 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10662 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10663 Move terminal->reference_count++ just before making the frame official
10664 (Bug#9943).
10665
10666 * nsterm.m (x_free_frame_resources): New function.
10667 (x_destroy_window): Move code to x_free_frame_resources.
10668
10669 * xfns.c (unwind_create_frame): Fix comment.
10670 (Fx_create_frame, x_create_tip_frame):
10671 Move terminal->reference_count++ just before making the frame
10672 official. Move initialization of image_cache_refcount and
10673 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10674
10675 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10676
10677 Support MSVC build with newer versions of Visual Studio.
10678 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10679 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10680 nt/gmake.defs.
10681
10682 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10683 which are not supported by MSVC.
10684 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10685 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10686 bitfields.
10687 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10688 types in bitfields.
10689 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10690
10691 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10692
10693 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
10694
10695 Support MSVC build with newer versions of Visual Studio.
10696 * w32.c: Don't include w32api.h for MSVC.
10697 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10698
10699 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10700 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10701 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10702 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10703 e_* cousins.
10704 (alloca) [_MSC_VER]: Define to _alloca.
10705
10706 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10707
10708 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10709
10710 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10711
10712 * xdisp.c (note_mouse_highlight): If either of
10713 previous/next-single-property-change returns nil, treat that as
10714 the beginning or the end of the buffer. (Bug#9955)
10715
10716 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10717
10718 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10719 label is not null (Bug#9951).
10720 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10721 may be NULL.
10722
10723 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10724
10725 * window.c (Fwindow_body_size): Mention in the doc string that the
10726 return value is in frame's canonical units. (Bug#9949)
10727
10728 2011-11-03 Eli Zaretskii <eliz@gnu.org>
10729
10730 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10731
10732 * w32fns.c (unwind_create_frame): If needed, free the glyph
10733 matrices of the partially constructed frame. (Bug#9943)
10734 * xfns.c (unwind_create_frame): Likewise.
10735
10736 2011-11-01 Eli Zaretskii <eliz@gnu.org>
10737
10738 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10739 Don't stop backward scan on the continuation glyph, even though
10740 its CHARPOS is positive.
10741 (mouse_face_from_buffer_pos, note_mouse_highlight):
10742 Rename cover_string to disp_string.
10743
10744 2011-11-01 Martin Rudalics <rudalics@gmx.at>
10745
10746 * window.c (temp_output_buffer_show): Don't use
10747 Vtemp_buffer_show_specifiers.
10748 (Vtemp_buffer_show_specifiers): Remove unused variable.
10749
10750 2011-10-30 Eli Zaretskii <eliz@gnu.org>
10751
10752 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10753 past the beginning of the current glyph matrix.
10754
10755 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
10756
10757 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10758 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10759 HAVE_GTK3 (Bug#9869).
10760
10761 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10762 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10763
10764 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10765
10766 * xterm.c: Declare x_handle_net_wm_state to return int.
10767 (handle_one_xevent): Check if we are iconified but don't have
10768 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10769 (get_current_wm_state): Return non-zero if not hidden,
10770 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10771 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10772 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10773 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10774
10775 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10776
10777 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10778 so that this new function doesn't get optimized away by a
10779 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10780
10781 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10782
10783 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10784
10785 2011-10-29 Eli Zaretskii <eliz@gnu.org>
10786
10787 Fix the `xbytecode' command.
10788 * .gdbinit (xprintbytestr): New command.
10789 (xwhichsymbols): Rename from `which'; all callers changed.
10790 (xbytecode): Print the byte-code string as well.
10791
10792 2011-10-29 Kim Storm <storm@cua.dk>
10793
10794 * alloc.c (which_symbols): New function.
10795
10796 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10797
10798 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10799 line. (Bug#9903)
10800
10801 2011-10-29 Glenn Morris <rgm@gnu.org>
10802
10803 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10804 Not clear what it was for, and it causes various bugs. (Bug#9839)
10805
10806 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10807
10808 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10809 possible random value that matches one of those tested as
10810 condition to clear the mouse face.
10811
10812 2011-10-28 Chong Yidong <cyd@gnu.org>
10813
10814 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10815
10816 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10817
10818 * window.c (make_window): Initialize phys_cursor_on_p.
10819
10820 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10821
10822 * lisp.h (struct Lisp_Symbol): Update comments.
10823
10824 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
10825
10826 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10827
10828 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10829
10830 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10831 <oslsachem@gmail.com> for helping to debug this.
10832
10833 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10834 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10835 (g_b_init_get_glyph_outline_w): New static variables.
10836 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10837 (GetGlyphOutlineW_Proc): New typedefs.
10838 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10839 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10840 New functions.
10841 (w32font_open_internal, compute_metrics):
10842 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10843 instead of calling the "wide" APIs directly.
10844
10845 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10846
10847 * w32.h (syms_of_w32font): Add prototype.
10848
10849 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10850
10851 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10852 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10853 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10854 (Fmove_to_window_line): Doc fix.
10855
10856 2011-10-27 Chong Yidong <cyd@gnu.org>
10857
10858 * process.c (make_process): Set gnutls_state to NULL.
10859
10860 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10861 non-NULL, regardless of GNUTLS_INITSTAGE.
10862 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10863 an error. Set process slots as soon as we allocate them.
10864
10865 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10866
10867 2011-10-27 Chong Yidong <cyd@gnu.org>
10868
10869 * gnutls.c (emacs_gnutls_deinit): New function.
10870 Deallocate credentials structures as well as calling gnutls_deinit.
10871 (Fgnutls_deinit, Fgnutls_boot): Use it.
10872
10873 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10874 (deactivate_process): Call emacs_gnutls_deinit.
10875
10876 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10877
10878 * image.c (x_create_x_image_and_pixmap):
10879 * w32.c (sys_rename, w32_delayed_load):
10880 * w32font.c (fill_in_logfont):
10881 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10882
10883 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10884
10885 * w32fns.c (w32_default_color_map): New function,
10886 extracted from Fw32_default_color_map.
10887 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10888
10889 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10890
10891 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10892
10893 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10894
10895 * keyboard.c (test_undefined): New function (bug#9751).
10896 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10897
10898 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10899
10900 * sysdep.c (init_sys_modes): Fix the check for the controlling
10901 terminal (Bug#6649).
10902
10903 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10904
10905 * dispextern.h (struct bidi_it): New member next_en_type.
10906
10907 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10908 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10909 current character, check also for next_en_type being WEAK_EN.
10910 (bidi_resolve_weak): Don't enter the expensive loop if the current
10911 position is before next_en_pos. Record the bidi type of the first
10912 non-ET, non-BN character we find, in addition to its position.
10913 (bidi_level_of_next_char): Invalidate next_en_type when
10914 next_en_pos is over-stepped.
10915
10916 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10917
10918 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10919 * editfns.c: Rewrite current-time-zone so that it invokes
10920 the equivalent of (format-time-string "%Z") to get the time zone name.
10921 This fixes a bug when the time zone name contains characters that
10922 need converting from the system time locale to Emacs internal format.
10923 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10924 that patch fixed format-time-string to do the conversion, but
10925 I forgot to fix current-time-zone.
10926 (format_time_string): New function, containing most of
10927 what Fformat_time_string used to contain.
10928 (Fformat_time_string): Rewrite in terms of format_time_string.
10929 This doesn't change this function's behavior.
10930 (current-time-zone): Rewrite to use format_time_string.
10931 This fixes the bug reported by Michael Schierl in
10932 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10933 Jason Rumney's 2007-06-07 change worked around this bug, but
10934 didn't fix it.
10935 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10936
10937 2011-10-19 Eli Zaretskii <eliz@gnu.org>
10938
10939 * xdisp.c (start_display): If the character at POS is displayed
10940 via a display vector, reset IT->current.dpvec_index to zero.
10941 (try_window_reusing_current_matrix): If a line ends in a display
10942 vector or the next line starts in a display vector, continue
10943 redrawing the window even though the character position of
10944 start_row was reached.
10945 (Bug#9771, part 2)
10946
10947 2011-10-18 Chong Yidong <cyd@gnu.org>
10948
10949 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10950 with nobreak-char-display too.
10951
10952 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10953
10954 Fix part 3 of bug#9771.
10955 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10956 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10957 non-neutral characters if the current character is a paragraph
10958 separator (a.k.a. Newline). This avoids running the same
10959 expensive loop twice, once when we consume the preceding newline
10960 and the other time when the line actually needs to be displayed.
10961 Avoid the loop when we see neutrals on the base embedding level
10962 following a character whose directionality is the same as the
10963 paragraph's. This avoids running the expensive loop when a line
10964 ends in a long sequence of neutrals, like control characters.
10965 Add assertion against STRONG_AL type. Slightly rearrange code
10966 that determines the type of a neutral given the first non-neutral
10967 that follows it.
10968 (bidi_level_of_next_char): Set next_en_pos to zero when
10969 invalidating its info.
10970
10971 2011-10-17 Eli Zaretskii <eliz@gnu.org>
10972
10973 * xdisp.c (push_display_prop): Determine whether to record string
10974 or buffer position by IT->string, not by IT->method. Allow
10975 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10976 (move_it_vertically_backward): Don't look for character position
10977 immediately after the newline when in a continuation line.
10978 (Bug#9771, part 1)
10979
10980 2011-10-15 Martin Rudalics <rudalics@gmx.at>
10981
10982 * window.c (coordinates_in_window): Rewrite and delabelize
10983 vertical border check. (Bug#5357) (Bug#9618)
10984
10985 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10986
10987 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10988 errors in XSetWindowBorder (bug#9310).
10989
10990 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10991
10992 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10993 avoid crash when xmalloc overrun checking is enabled.
10994
10995 2011-10-13 Eli Zaretskii <eliz@gnu.org>
10996
10997 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10998 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10999 cursor motion with <left> and <right> arrow keys.
11000
11001 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11002 some callers set that themselves.
11003
11004 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11005
11006 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11007 display string and the previous row comes from the same string and
11008 is empty. (Bug#9739) (Bug#9738)
11009
11010 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11011
11012 * doc.c (get_doc_string): Encode file name (bug#9735).
11013
11014 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11015
11016 * bidi.c (bidi_level_of_next_char):
11017 * xdisp.c (get_visually_first_element): Remove old incorrect
11018 comments regarding the Unicode Line Separator character.
11019
11020 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11021
11022 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11023
11024 * alloc.c (Fgc_status): Do not access beyond zombies array
11025 boundary if nzombies > MAX_ZOMBIES.
11026 * alloc.c (dump_zombies): Add missing format specifier.
11027
11028 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11029
11030 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11031 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11032
11033 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11034 Some packages use them to denote characters with modifiers.
11035
11036 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11037
11038 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11039 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11040 matching a pp-number. Rename parameter var to var1.
11041
11042 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11043
11044 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11045
11046 2011-10-08 Glenn Morris <rgm@gnu.org>
11047
11048 * callint.c (Fcall_interactively): Give a more explicit error for the
11049 'c' case with a non-character input. (Bug#8479)
11050
11051 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11052
11053 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11054 lines.
11055 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11056 lines that are hscrolled on the left.
11057
11058 * dispnew.c (buffer_posn_from_coords): Account for a possible
11059 presence of header-line. (Bug#4426)
11060
11061 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11062
11063 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11064 Don't advertise functionality which we discourage or doesn't work.
11065
11066 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11067
11068 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11069 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11070 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11071 this makes Emacs dump core during garbage collection on rare
11072 occasions. sizeof is obviously inferior to offsetof here, so
11073 stick with offsetof.
11074 (GC_POINTER_ALIGNMENT): New macro.
11075 (mark_memory): Omit 3rd (offset) arg; caller changed.
11076 Don't assume EMACS_INT alignment is the same as pointer alignment.
11077
11078 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11079
11080 * keyboard.c (read_key_sequence_remapped): New var.
11081 (read_key_sequence): Compute remapping in the right buffer.
11082 (command_loop_1): Use read_key_sequence's remapping directly.
11083
11084 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11085
11086 * dired.c (file_name_completion): Don't expand file name.
11087 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11088 before checking file name handler.
11089
11090 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11091 they've been requested explicitly (bug#9591).
11092
11093 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11094
11095 * keymap.c (Fsingle_key_description): Use make_specified_string
11096 instead of build_string to build string from push_key_description.
11097 (Bug#5193)
11098
11099 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11100
11101 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11102 This fixes a Y2038 bug on 64-bit hosts.
11103 * buffer.c (reset_buffer):
11104 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11105 (Fclear_buffer_auto_save_failure):
11106 Use 0, not -1, to represent an unset failure time, since time_t
11107 might not be signed.
11108
11109 Remove dependency on glibc malloc internals.
11110 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11111 Move back here from lisp.h, but with their new implementations.
11112 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11113 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11114 * charset.c (charset_table_init): New static var.
11115 (syms_of_charset): Use it instead of xmalloc. This removes a
11116 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11117 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11118 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11119 Move back to alloc.c.
11120 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11121 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11122
11123 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11124
11125 * nsterm.m (windowDidResize): Call x_set_window_size only when
11126 ns_in_resize is true. Otherwise set pixelwidth/height and
11127 call change_frame_size (Bug#9628).
11128
11129 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11130
11131 Port --enable-checking=all to Fedora 14 x86-64.
11132 * charset.c (syms_of_charset): Also account for glibc malloc's
11133 internal overhead when calculating the initial malloc maximum.
11134
11135 Port --enable-checking=all to Fedora 14 x86.
11136 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11137 Move to lisp.h.
11138 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11139 (overrun_check_realloc, overrun_check_free):
11140 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11141 That way, xmalloc returns a properly-aligned pointer even if
11142 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11143 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11144 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11145 into account when calculating the initial malloc maximum.
11146 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11147 Move here from alloc.c, so that charset.c can use it too.
11148 Properly align; the old code wasn't right for common 32-bit hosts
11149 when configured with --enable-checking=all.
11150 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11151 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11152
11153 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11154
11155 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11156 use EDOM.
11157
11158 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11159
11160 * xdisp.c (compute_display_string_end): If there's no display
11161 string at CHARPOS, return -1.
11162
11163 * bidi.c (bidi_fetch_char): When compute_display_string_end
11164 returns a negative value, treat the character as a normal
11165 character not covered by a display string. (Bug#9624)
11166
11167 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11168
11169 * lread.c (Fread_from_string): Fix typo in docstring.
11170
11171 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11172
11173 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11174 newline, reseat the iterator instead of bidi-iterating there one
11175 character at a time. (Bug#9610)
11176 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11177 TO_CHARPOS if the bidi iterator is at base embedding level.
11178
11179 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11180
11181 * lread.c (readevalloop): Use correct code for NBSP.
11182 (read1): Likewise. (Bug#9608)
11183
11184 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11185
11186 * dbusbind.c (Fdbus_register_signal): When service is not
11187 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11188
11189 2011-09-25 Glenn Morris <rgm@gnu.org>
11190
11191 * buffer.c (truncate-lines): Doc fix.
11192
11193 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11194
11195 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11196 (Fset_window_next_buffers): Doc fix.
11197
11198 2011-09-24 Glenn Morris <rgm@gnu.org>
11199
11200 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11201
11202 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11203
11204 Fix minor problems found by static checking.
11205 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11206 * indent.c (Fvertical_motion): Fix == vs = typo.
11207
11208 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11209
11210 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11211 Default value is now t. Doc fix.
11212
11213 * indent.c (Fvertical_motion): Compute and apply the overshoot
11214 logic when moving up, not only when moving down. Fix the
11215 confusing name and values of the it_overshoot_expected variable;
11216 logic changes accordingly. (Bug#9254) (Bug#9549)
11217
11218 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11219 CHARPOS is covered by a display string which includes newlines.
11220 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11221 is covered by a display string with embedded newlines.
11222
11223 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11224
11225 * dbusbind.c (Fdbus_register_signal): Add match rule to
11226 Vdbus_registered_objects_table. (Bug#9581)
11227 (Fdbus_register_method, Vdbus_registered_objects_table):
11228 Fix docstring.
11229
11230 2011-09-24 Jim Meyering <meyering@redhat.com>
11231
11232 do not ignore write error for any output size
11233 The previous change was incomplete.
11234 While it makes emacs --batch detect the vast majority of stdout
11235 write failures, errors were still ignored whenever the output size is
11236 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11237 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11238 && echo FAIL: ignored write error
11239 FAIL: ignored write error
11240 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11241 && echo FAIL: ignored write error
11242 FAIL: ignored write error
11243 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11244
11245 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11246
11247 * emacs.c (Fkill_emacs): In noninteractive mode exit
11248 non-successfully if a write error occurred on stdout. (Bug#9574)
11249
11250 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11251
11252 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11253 the xassert test.
11254
11255 * dispextern.h (struct it): Update the comment documenting what
11256 can it->OBJECT be.
11257
11258 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11259
11260 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11261 a display string, extend search for cursor position to end of row.
11262 (find_row_edges): If the row ends in a newline from a display
11263 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11264 Handle the case of a display string with multiple newlines.
11265 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11266 non-empty line. Fixes confusing cursor motion with arrow keys at
11267 the beginning of a line that starts with whitespace.
11268
11269 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11270
11271 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11272 (bug#9493).
11273
11274 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11275
11276 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11277 boolean (Bug#9154).
11278
11279 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11280
11281 * xdisp.c (display_line): Record maximum and minimum buffer
11282 positions even if no glyphs were produced (e.g., by a zero-width
11283 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11284 buffer positions that will be removed from the glyph row because
11285 they don't fit.
11286 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11287 column is beyond frame width: don't subtract 1 "pixel" when
11288 computing width of the stretch.
11289 (reseat_at_next_visible_line_start): Undo the change made on
11290 2011-09-17 that saved paragraph information and restored it after
11291 the call to `reseat'. (Bug#9545)
11292
11293 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11294
11295 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11296 and turn window cursor on if cleared (Bug#9415).
11297
11298 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11299
11300 * search.c (boyer_moore): Take unibyte characters from pattern
11301 literally. (Bug#9458)
11302
11303 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11304
11305 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11306
11307 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11308
11309 Fix minor problem found by static checking.
11310 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11311 initialized, to pacify gcc -Wuninitialized.
11312
11313 * fileio.c: Report proper errno when syscall falls.
11314 (Finsert_file_contents): Save and restore errno,
11315 so that report_file_error outputs the correct diagnostic.
11316 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11317
11318 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11319
11320 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11321
11322 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11323
11324 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11325 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11326
11327 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11328
11329 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11330 about the current paragraph and restore it after the call to reseat.
11331
11332 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11333 (bidi_find_paragraph_start): Search back for paragraph beginning
11334 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11335 (bidi_move_to_visually_next): Only trigger paragraph-related
11336 computations when the last character is a newline or at EOB, not
11337 just any NEUTRAL_B. (Bug#9470)
11338
11339 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11340 truncated lines if point is covered by a display string. (Bug#9524)
11341
11342 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11343
11344 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11345 (cons_to_x_long): New function.
11346 (lisp_data_to_selection_data): Use it. Correct the test for
11347 short-versus-long data; it was negated. Break out of vector
11348 loop, for efficiency, when a long datum is discovered.
11349
11350 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11351
11352 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11353
11354 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11355
11356 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11357 GCC PR/17406) by declaring this function with external scope.
11358
11359 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11360
11361 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11362 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11363
11364 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11365
11366 * editfns.c (Fformat): Correctly handle text properties on "%%".
11367
11368 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11369
11370 * xterm.c (x_draw_composite_glyph_string_foreground):
11371 * w32term.c (x_draw_composite_glyph_string_foreground):
11372 * term.c (encode_terminal_code):
11373 * composite.c (composition_update_it, get_composition_id):
11374 * xdisp.c (get_next_display_element)
11375 (fill_composite_glyph_string): Add comments about special meaning
11376 of TAB characters in a composition.
11377
11378 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11379
11380 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11381 This occurs when processing a multibyte format.
11382 Problem reported by Wolfgang Jenker.
11383
11384 2011-09-15 Johan Bockgård <bojohan@gnu.org>
11385
11386 * xdisp.c (try_cursor_movement): Only check for exact match if
11387 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11388
11389 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11390
11391 Remove unused external symbols.
11392 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11393 * xdisp.c (calc_pixel_width_or_height): Now static.
11394 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11395 * indent.c (check_display_width):
11396 * w32term.c: Fix comment to match code.
11397 * xterm.c, xterm.h (x_catching_errors): Remove.
11398
11399 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11400
11401 * xselect.c: Use signed conversions more consistently (Bug#9498).
11402 (selection_data_to_lisp_data): Assume incoming selection data are
11403 signed integers, not unsigned. This is to be consistent with
11404 outgoing selection data, which was modified to use signed integers
11405 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11406 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11407 expects long, not unsigned long.
11408
11409 2011-09-14 Eli Zaretskii <eliz@gnu.org>
11410
11411 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11412 computation of loop end. Reported by Johan Bockgård
11413 <bojohan@gnu.org>.
11414
11415 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
11416
11417 * frame.c (Fother_visible_frames_p): Function deleted.
11418
11419 2011-09-12 Eli Zaretskii <eliz@gnu.org>
11420
11421 * indent.c (compute_motion): Process display vector front to back
11422 rather than the other way around. (Bug#2496)
11423
11424 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11425
11426 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11427
11428 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11429
11430 * minibuf.c (Fread_from_minibuffer): Doc fix.
11431
11432 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11433
11434 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11435 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11436
11437 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11438
11439 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11440 value for non-existent files.
11441
11442 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11443
11444 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11445 set its "size" to -1. This will set the modtime_size field of
11446 the corresponding buffer to -1, which is what
11447 verify-visited-file-modtime expects for files that do not exist.
11448 (Bug#9139)
11449
11450 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11451
11452 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11453 here ...
11454 * lisp.h: ... from here. push_key_description is no longer
11455 defined in keyboard.c, so its declaration should not be in
11456 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11457 logically belongs with push_key_description.
11458
11459 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11460
11461 * buffer.h: Include <sys/types.h> instead of <time.h>.
11462 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11463 Problem reported by Herbert J. Skuhra.
11464
11465 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11466
11467 * xml.c (parse_region): Make the parsing work for
11468 non-comment-starting XML files again (bug#9144).
11469
11470 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11471
11472 * image.c (gif_load): Fix calculation of bottom and right corner.
11473 (Bug#9468)
11474
11475 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11476
11477 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11478 redisplay in small windows.
11479
11480 2011-09-09 Eli Zaretskii <eliz@gnu.org>
11481
11482 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11483
11484 2011-09-08 Martin Rudalics <rudalics@gmx.at>
11485
11486 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11487 Operate on live windows only.
11488
11489 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
11490
11491 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11492
11493 2011-09-07 Eli Zaretskii <eliz@gnu.org>
11494
11495 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11496 only under bidi iteration.
11497
11498 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11499
11500 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11501
11502 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11503
11504 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11505 Without this fix, the command to link temacs failed due to an
11506 undefined symbol __builtin_isnan. This is because
11507 /usr/include/iso/math_c99.h #defines isnan(x) to
11508 __builtin_isnan(x), but the bundled gcc, which identifies itself
11509 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11510 a __builtin_isnan.
11511 * floatfns.c (isnan): #undef, and then #define to a clone of
11512 what's in data.c.
11513 (Fisnan): Always define, since it's always available now.
11514 (syms_of_floatfns): Always define isnan at the Lisp level.
11515
11516 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11517
11518 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11519
11520 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11521
11522 * fileio.c: Fix bugs with large file offsets (Bug#9428).
11523 The previous code assumed that file offsets (off_t values) fit in
11524 EMACS_INT variables, which is not true on typical 32-bit hosts.
11525 The code messed up by falsely reporting buffer overflow in cases
11526 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11527 when "big" contains more than 2**29 bytes, even though this
11528 inserts just one byte and does not overflow the buffer.
11529 (Finsert_file_contents): Store file offsets as off_t
11530 values, not as EMACS_INT values. Check for overflow when
11531 converting between EMACS_INT and off_t. When checking for
11532 buffer overflow or for overlap, take the offsets into account.
11533 Don't use EMACS_INT for small values where int suffices.
11534 When checking for overlap, fix a typo: ZV was used where
11535 ZV_BYTE was intended.
11536 (Fwrite_region): Don't assume off_t fits into 'long'.
11537 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11538
11539 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
11540
11541 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11542
11543 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11544
11545 sprintf-related integer and memory overflow issues (Bug#9412).
11546
11547 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11548 (esprintf, exprintf, evxprintf): New functions.
11549 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11550 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11551 (modify_event_symbol): Do not assume that the length of
11552 name_alist_or_stem is safe to alloca and fits in int.
11553 (Fexecute_extended_command): Likewise for function name and binding.
11554 (Frecursion_depth): Wrap around reliably on integer overflow.
11555 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11556 since some callers pass EMACS_INT values.
11557 (Fsingle_key_description): Don't crash if symbol name contains more
11558 than MAX_ALLOCA bytes.
11559 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11560 (get_minibuffer): Arg is now EMACS_INT, not int.
11561 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11562 (esprintf, exprintf, evxprintf): New decls.
11563 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11564
11565 * dbusbind.c (signature_cat): New function.
11566 (xd_signature, Fdbus_register_signal):
11567 Do not overrun buffer; instead, report string overflow.
11568
11569 * dispnew.c (add_window_display_history): Don't overrun buffer.
11570 Truncate instead; this is OK since it's just a log.
11571
11572 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11573 even if the time zone offset is outlandishly large.
11574 Don't mishandle offset == INT_MIN.
11575
11576 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11577 when creating daemon; the previous buffer-overflow check was incorrect.
11578
11579 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11580 which has the guts of the old verror function.
11581
11582 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11583 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11584
11585 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11586 (font_unparse_xlfd): Don't blindly alloca long strings.
11587 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11588 fits in int, when using sprintf. Use single snprintf to count
11589 length of string rather than counting it via multiple sprintfs;
11590 that's simpler and more reliable.
11591 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11592 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11593 sprintf, in case result does not fit in int.
11594
11595 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11596 (fontset_from_font): Print it.
11597
11598 * frame.c (tty_frame_count): Now printmax_t, not int.
11599 (make_terminal_frame, set_term_frame_name): Print it.
11600 (x_report_frame_params): In X, window IDs are unsigned long,
11601 not signed long, so print them as unsigned.
11602 (validate_x_resource_name): Check for implausibly long names,
11603 and don't assume name length fits in 'int'.
11604 (x_get_resource_string): Don't blindly alloca invocation name;
11605 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11606 not fit in int.
11607
11608 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11609 (xg_check_special_colors, xg_set_geometry):
11610 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11611
11612 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11613 Use esprintf, not sprintf, in case result does not fit in int.
11614
11615 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11616 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11617 it as a large positive number.
11618 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11619 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11620
11621 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11622 in case result does not fit in int.
11623
11624 * print.c (float_to_string): Detect width overflow more reliably.
11625 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11626 buffer overrun. Don't assume list length fits in 'int'. Treat
11627 print length of 0 as 0, not as infinity; to be consistent with other
11628 uses of print length in this function. Don't overflow print length
11629 index. Don't assume hash table size fits in 'long', or that
11630 vectorlike size fits in 'unsigned long'.
11631
11632 * process.c (make_process): Use printmax_t, not int, to format
11633 process-name gensyms.
11634
11635 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11636
11637 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11638 to avoid potential buffer overrun.
11639
11640 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11641 if X resource line is longer than 512 bytes.
11642
11643 * xfns.c (x_window): Make sprintf buffer a bit bigger
11644 to avoid potential buffer overrun.
11645
11646 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11647
11648 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11649
11650 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11651
11652 Integer overflow fixes for scrolling, etc.
11653 Without these, Emacs silently mishandles large integers sometimes.
11654 For example, "C-u 4294967297 M-x recenter" was treated as if
11655 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11656
11657 * xdisp.c (try_window_id): Check Emacs fixnum range before
11658 converting to 'int'.
11659
11660 * window.c (window_scroll_line_based, Frecenter):
11661 Check that an Emacs fixnum is in range before assigning it to 'int'.
11662 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11663 values converted from Emacs fixnums.
11664 (Frecenter): Don't wrap around a line count if it is out of 'int'
11665 range; instead, treat it as an extreme value.
11666 (Fset_window_configuration, compare_window_configurations):
11667 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11668
11669 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11670 that can exceed INT_MAX. Check that EMACS_INT value is in range
11671 before assigning it to the (possibly-narrower) index.
11672 (match_limit): Don't assume that a fixnum can fit in 'int'.
11673
11674 * print.c (print_object): Use ptrdiff_t, not int, for index that can
11675 exceed INT_MAX.
11676
11677 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11678 (Fvertical_motion): Don't wrap around LINES values that don't fit
11679 in 'int'. Instead, treat them as extreme values. This is good
11680 enough for windows, which can't have more than INT_MAX lines anyway.
11681
11682 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11683
11684 * Require libxml/parser.h to avoid compilation warning.
11685
11686 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11687
11688 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11689 since this reportedly can destroy thread storage.
11690
11691 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
11692
11693 * syntax.c (find_defun_start): Update all cache variables if
11694 exiting early (Bug#9401).
11695
11696 2011-08-30 Eli Zaretskii <eliz@gnu.org>
11697
11698 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11699
11700 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11701 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11702 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11703
11704 * term.c (tty_append_glyph): New function.
11705 (produce_stretch_glyph): Static function and its prototype deleted.
11706
11707 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11708 Add prototypes.
11709
11710 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11711
11712 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11713 when checking :margin (Bug#9390).
11714 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11715 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11716 so that the name doesn't mislead. All uses changed.
11717
11718 2011-08-28 Johan Bockgård <bojohan@gnu.org>
11719
11720 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11721 set_tty_hooks.
11722
11723 2011-08-27 Eli Zaretskii <eliz@gnu.org>
11724
11725 * xdisp.c (move_it_to): Don't bail out early when reaching
11726 position beyond to_charpos, if we are scanning backwards.
11727 (move_it_vertically_backward): When DY == 0, make sure we get to
11728 the first character in the line after the newline.
11729
11730 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11731
11732 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11733 (ccl_driver): Do not generate an out-of-range pointer.
11734 (Fccl_execute_on_string): Remove unnecessary check for
11735 integer overflow, noted by Stefan Monnier in
11736 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11737 Remove a FIXME that didn't need fixing.
11738 Simplify the newly-introduced buffer reallocation code.
11739
11740 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
11741
11742 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11743
11744 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
11745
11746 Integer and memory overflow issues (Bug#9196).
11747
11748 * doc.c (get_doc_string): Rework so that
11749 get_doc_string_buffer_size is the actual buffer size, rather than
11750 being 1 less than the actual buffer size; this makes xpalloc more
11751 convenient.
11752
11753 * image.c (x_allocate_bitmap_record, cache_image):
11754 * xselect.c (Fx_register_dnd_atom):
11755 Simplify previous changes by using xpalloc.
11756
11757 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11758 since either will do and ptrdiff_t is convenient with xpalloc.
11759
11760 * charset.c (charset_table_size)
11761 (struct charset_sort_data.priority): Now ptrdiff_t.
11762 (charset_compare): Don't overflow if priorities differ greatly.
11763 (Fsort_charsets): Don't assume list length fits in int.
11764 Check for size-calculation overflow when allocating sort data.
11765 (syms_of_charset): Allocate an initial charset table that is
11766 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11767
11768 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11769
11770 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11771 The actual value is always <= INT_MAX, and leaving it unsigned made
11772 overflow checking harder.
11773
11774 * dispextern.h (struct glyph_matrix.rows_allocated)
11775 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11776 with xpalloc. The values are still always <= INT_MAX.
11777
11778 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11779
11780 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11781 (SAFE_NALLOCA): New macro.
11782
11783 * region-cache.c (struct boundary.pos, find_cache_boundary)
11784 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11785 (set_cache_region, invalidate_region_cache)
11786 (revalidate_region_cache, know_region_cache, region_cache_forward)
11787 (region_cache_backward, pp_cache):
11788 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11789 so that ptrdiff_t * can be passed to xpalloc.
11790 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11791 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11792 (pp_cache): Don't assume cache_len fits in int.
11793 * region-cache.h: Adjust extern decls to match.
11794
11795 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11796 EMACS_INT, since either will do, for xpalloc.
11797
11798 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11799 (xnmalloc, xnrealloc, xpalloc): New functions.
11800
11801 * bidi.c (bidi_shelve_header_size): New constant.
11802 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11803 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11804
11805 * bidi.c (bidi_cache_shrink):
11806 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11807 (overlay_strings):
11808 Don't update size of array until after memory allocation succeeds,
11809 because xmalloc/xrealloc may not return.
11810 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11811 now that we have proper integer overflow checking.
11812 (record_overlay_string, overlay_strings): Catch overflows when
11813 calculating size of overlay_str_buf.
11814
11815 * callproc.c (Fcall_process): Check for size overflow when
11816 calculating size of args2.
11817 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11818 Normally we prefer signed values, but sticking with ptrdiff_t would
11819 require adding more-complicated checks.
11820
11821 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11822 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11823 Redo buffer-overflow calculations to avoid integer overflow.
11824 Add a FIXME comment where memory seems to be over-allocated.
11825
11826 * character.c (Fstring): Check for size-calculation overflow.
11827
11828 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11829 unnecessary integer overflow. Check for size overflow.
11830 (encode_coding_object): Don't update size until xmalloc succeeds.
11831
11832 * composite.c (get_composition_id): Check for overflow in glyph
11833 length calculations.
11834
11835 Integer and memory overflow fixes for display code.
11836 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11837 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11838 (scrolling_window): Check for overflow in size calculations.
11839 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11840 Don't assume glyph table len fits in int.
11841 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11842 (row_table_size): Now ptrdiff_t, not int.
11843 (scrolling_window): Avoid overflow in size calculations.
11844 Don't update size until allocation succeeds.
11845 * fns.c (concat): Check for overflow in size calculations.
11846 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11847 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11848 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11849
11850 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11851 (get_doc_string): Check for size calculation overflow.
11852 Don't update size until allocation succeeds.
11853 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11854 EMACS_INT, where ptrdiff_t will do.
11855 (Fsubstitute_command_keys): Check for string overflow.
11856
11857 * editfns.c (set_time_zone_rule): Don't assume environment length
11858 fits in int.
11859 (message_length): Now ptrdiff_t, not int.
11860 (Fmessage_box): Don't update size until allocation succeeds.
11861 Don't assume message length fits in int.
11862 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11863
11864 * emacs.c (main): Do not reallocate argv, since there is a null at
11865 the end that can be overwritten, and this way there's no need to
11866 worry about size-calculation overflow.
11867 (sort_args): Check for size-calculation overflow.
11868
11869 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11870 alloc succeeds.
11871 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11872
11873 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11874 (x_set_scroll_bar_width, x_figure_window_size):
11875 Check for integer overflow.
11876 (x_set_alpha): Do not assume XINT fits in int.
11877
11878 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11879 This is for the members text_lines, text_cols, total_lines, total_cols,
11880 where the system imposes an 'int' limit.
11881
11882 * fringe.c (Fdefine_fringe_bitmap):
11883 Don't update size until alloc works.
11884
11885 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11886 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11887
11888 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11889 Check for size-calculation overflow.
11890 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11891 do, as we prefer signed integers.
11892 (id_to_widget.max_size, id_to_widget.used)
11893 (xg_store_widget_in_map, xg_remove_widget_from_map)
11894 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11895 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11896 Use and return ptrdiff_t, not int.
11897 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11898 * gtkutil.h: Change prototypes to match the above.
11899
11900 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11901 are duplicate now that they've been promoted to lisp.h.
11902 (x_allocate_bitmap_record, x_alloc_image_color)
11903 (make_image_cache, cache_image, xpm_load):
11904 Don't update size until alloc is done.
11905 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11906 (x_detect_edges):
11907 Check for size calculation overflow.
11908 (ct_colors_allocated_max): New constant.
11909 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11910 overflow.
11911
11912 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11913 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11914 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11915 Use ptrdiff_t, not int, to count maps.
11916 (read_char_minibuf_menu_prompt): Check for overflow in size
11917 calculations. Don't update size until allocation succeeds.
11918 Redo calculations to avoid overflow.
11919 * keyboard.h: Change prototypes to match the above.
11920
11921 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11922 to count maps.
11923 (current_minor_maps): Check for size calculation overflow.
11924 * keymap.h: Change prototypes to match the above.
11925
11926 * lread.c (read1, init_obarray): Don't update size until alloc done.
11927
11928 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11929 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11930
11931 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11932 Now ptrdiff_t, not int.
11933 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11934 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11935
11936 * process.c (Fnetwork_interface_list): Check for overflow
11937 in size calculation.
11938
11939 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11940
11941 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11942 overflow. Don't bother calling xmalloc when xrealloc will do.
11943
11944 * search.c (Freplace_match): Check for size calculation overflow.
11945 (Fset_match_data): Don't assume list lengths fit in 'int'.
11946
11947 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11948 for command line length. Do not attempt to address one before the
11949 beginning of an array, as that's not portable.
11950
11951 * term.c (max_frame_lines): Remove; unused.
11952 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11953 not int.
11954 (encode_terminal_code, calculate_costs): Check for size
11955 calculation overflow.
11956 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11957 table lengths and related sizes. Don't update size until alloc
11958 done. Redo calculations to avoid overflow.
11959 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11960
11961 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11962 subtracting pointers.
11963 (gobble_line): Check for overflow more carefully. Don't update size
11964 until alloc done.
11965
11966 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11967 Don't update size until alloc done.
11968 Redo size calculations to avoid overflow.
11969 Check for size calculation overflow.
11970 (main) [DEBUG]: Fix typo in invoking tparam1.
11971
11972 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11973 Use ptrdiff_t, not int, for sizes.
11974 (store_mode_line_noprop_char): Don't update size until alloc done.
11975
11976 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11977 Use ptrdiff_t, not int, for sizes.
11978 (Finternal_make_lisp_face, cache_face):
11979 Check for size calculation overflow.
11980 (cache_face): Treat size calculation overflows as if they were
11981 memory exhaustion (the usual treatment), rather than aborting.
11982
11983 * xfns.c (x_encode_text, x_set_name_internal)
11984 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11985 sizes, since they can exceed INT_MAX in size. Check for size
11986 calculation overflow.
11987
11988 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11989 (xg_select): Check for size calculation overflow.
11990 Don't update size until alloc done.
11991
11992 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11993 as sprintf is limited to int lengths.
11994
11995 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11996 (X_LONG_MIN): New macros.
11997 Use them to make the following changes clearer.
11998 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11999 This change doesn't affect the value now, but it may help remind
12000 future maintainers not to raise the value too much later.
12001 (SELECTION_QUANTUM): Remove, replacing with ...
12002 (selection_quantum): ... new function, which avoids overflow.
12003 All uses changed.
12004 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12005 assumption that selection length fits in 'int'.
12006 (x_reply_selection_request, x_handle_selection_request)
12007 (x_get_window_property, receive_incremental_selection)
12008 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12009 (lisp_data_to_selection_data, clean_local_selection_data):
12010 Use ptrdiff_t, not int, to record length of selection.
12011 (x_reply_selection_request, x_get_window_property)
12012 (receive_incremental_selection, x_property_data_to_lisp):
12013 Redo calculations to avoid overflow.
12014 (x_reply_selection_request): When sending hint, ceiling it at
12015 X_LONG_MAX rather than relying on wraparound overflow to send
12016 something.
12017 (x_get_window_property, receive_incremental_selection)
12018 (lisp_data_to_selection_data, x_property_data_to_lisp):
12019 Check for size-calculation overflow.
12020 (x_get_window_property, receive_incremental_selection)
12021 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12022 Don't store size until memory allocation succeeds.
12023 (x_get_window_property): Plug memory leak on memory exhaustion.
12024 Don't double-block input; malloc is safe here. Don't assume 2**34
12025 - 4 fits in unsigned long. Add an xassert to check
12026 XGetWindowProperty overflow. Be more careful about overflow
12027 calculations, and distinguish size from memory overflow better.
12028 (receive_incremental_selection): When tracing, don't assume
12029 unsigned int is less than INT_MAX.
12030 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12031 harmful) conversions of unsigned short to int.
12032 (lisp_data_to_selection_data): Don't assume that integers
12033 in the range -65535 through -1 fit in an X unsigned short.
12034 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12035 result parameters unless successful. Rely on cons_to_unsigned
12036 to report problems with elements; the old code wasn't right anyway.
12037 (x_check_property_data): Check for int overflow; we cannot use
12038 a wider type due to X limits.
12039 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12040
12041 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12042
12043 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12044 (x_term_init): Check for size calculation overflow.
12045 (x_color_cells): Don't store size until memory allocation succeeds.
12046 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12047 Don't assume alloca size is less than MAX_ALLOCA.
12048 (x_term_init): Don't assume length fits in int (sprintf is limited
12049 to int size).
12050
12051 Use ptrdiff_t for composition IDs.
12052 * character.c (lisp_string_width):
12053 * composite.c (composition_table_size, n_compositions)
12054 (get_composition_id, composition_gstring_from_id):
12055 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12056 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12057 * window.c (Frecenter):
12058 Use ptrdiff_t, not int, for composition IDs.
12059 * composite.c (get_composition_id): Check for integer overflow.
12060 * composite.h: Adjust prototypes to match the above changes.
12061
12062 Use ptrdiff_t for hash table indexes.
12063 * category.c (hash_get_category_set):
12064 * ccl.c (ccl_driver):
12065 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12066 * coding.c (coding_system_charset_list, detect_coding_system):
12067 * coding.h (struct coding_system.id):
12068 * composite.c (get_composition_id, gstring_lookup_cache):
12069 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12070 * image.c (xpm_get_color_table_h):
12071 * lisp.h (hash_lookup, hash_put):
12072 * minibuf.c (Ftest_completion):
12073 Use ptrdiff_t for hash table indexes, not int (which is too
12074 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12075 32-bit --with-wide-int hosts).
12076
12077 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12078 Add a FIXME comment about memory leaks.
12079 (syms_of_charset): Don't assume xmalloc returns.
12080
12081 Don't assume that stated character widths fit in int.
12082 * character.c (Fchar_width, c_string_width, lisp_string_width):
12083 * character.h (CHAR_WIDTH):
12084 * indent.c (MULTIBYTE_BYTES_WIDTH):
12085 Use sanitize_char_width to avoid undefined and/or bad behavior
12086 with outlandish widths.
12087 * character.h (sanitize_tab_width): Rename from sanitize_width,
12088 now that we have two such functions. All uses changed.
12089 (sanitize_char_width): New inline function.
12090
12091 Don't assume that tab-width fits in int.
12092 * character.h (sanitize_width): New inline function.
12093 (SANE_TAB_WIDTH): New macro.
12094 (ASCII_CHAR_WIDTH): Use it.
12095 * indent.c (sane_tab_width): Remove. All uses replaced by
12096 SANE_TAB_WIDTH (current_buffer).
12097 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12098
12099 * fileio.c: Integer overflow issues with file modes.
12100 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12101
12102 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12103 Remove unreachable code.
12104 (read_hex, load_charset_map_from_file): Check for integer overflow.
12105
12106 * xterm.c: Don't go over XClientMessageEvent limit.
12107 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12108 (x_send_scroll_bar_event): Likewise. Check that the size does not
12109 exceed limits imposed by XClientMessageEvent, as well as the usual
12110 ptrdiff_t and size_t limits.
12111
12112 * keyboard.c: Overflow, signedness and related fixes.
12113 (make_lispy_movement): Use same integer type in forward decl
12114 that is used in the definition.
12115 (read_key_sequence, keyremap_step):
12116 Change bufsize argument back to int, undoing my 2011-03-30 change.
12117 We prefer signed types, and int is wide enough here.
12118 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12119 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12120 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12121 length, not size_t. Use ptrdiff_t for index, not int.
12122 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12123 possibility of integer overflow.
12124
12125 Overflow, signedness and related fixes for images.
12126
12127 * dispextern.h (struct it.stack[0].u.image.image_id)
12128 (struct_it.image_id, struct image.id, struct image_cache.size)
12129 (struct image_cache.used, struct image_cache.ref_count):
12130 * gtkutil.c (update_frame_tool_bar):
12131 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12132 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12133 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12134 * nsmenu.m (update_frame_tool_bar):
12135 * xdisp.c (calc_pixel_width_or_height):
12136 * xfns.c (image_cache_refcount):
12137 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12138 on typical 64-bit hosts.
12139
12140 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12141 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12142 Omit unnecessary casts to int.
12143 (parse_image_spec): Check that integers fall into 'int' range
12144 when the callers expect that.
12145 (image_ascent): Redo ascent calculation to avoid int overflow.
12146 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12147 (lookup_image): Remove unnecessary tests.
12148 (xbm_image_p): Locals are now of int, not EMACS_INT,
12149 since parse_image_check makes sure they fit into int.
12150 (png_load, gif_load, svg_load_image):
12151 Prefer int to unsigned where either will do.
12152 (tiff_handler): New function, combining the cores of the
12153 old tiff_error_handler and tiff_warning_handler.
12154 This function is rewritten to use vsnprintf and thereby avoid
12155 stack buffer overflows. It uses only the features of vsnprintf
12156 that are common to both POSIX and native Microsoft.
12157 (tiff_error_handler, tiff_warning_handler): Use it.
12158 (tiff_load, gif_load, imagemagick_load_image):
12159 Don't assume :index value fits in 'int'.
12160 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12161 (imagemagick_load_image): Check that crop parameters fit into
12162 the integer types that MagickCropImage accepts. Don't assume
12163 Vimagemagick_render_type has a nonnegative value. Don't assume
12164 size_t fits in 'long'.
12165 (gs_load): Use printmax_t to print the widest integers possible.
12166 Check for integer overflow when computing image height and width.
12167
12168 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12169
12170 * xdisp.c (redisplay_window): Don't force window start if point
12171 will be invisible in the resulting window. (Bug#9324)
12172
12173 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12174
12175 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12176 the display spec is of the form `(space ...)'.
12177 (handle_display_spec): Return the value returned by
12178 handle_single_display_spec, not just 1 or zero.
12179 (handle_single_display_spec): If the display spec is of the form
12180 `(space ...)', and specifies display in the text area, return 2
12181 rather than 1.
12182 (try_cursor_movement): Check for the need to scroll more
12183 accurately, and prefer exact match for point under bidi.
12184 Don't advance `row' beyond the last row of the window.
12185
12186 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12187 into disp_prop; all users changed.
12188
12189 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12190 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12191 for the text covered by the display property.
12192
12193 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12194
12195 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12196 Change return value to nil.
12197 (Frecord_buffer): Delete unused function.
12198
12199 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12200
12201 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12202 buffers, return left-to-right.
12203 (set_cursor_from_row): Consider candidate row a win if its glyph
12204 represents a newline and point is on that newline. Fixes cursor
12205 positioning on the newline at EOL of R2L text within L2R
12206 paragraph, and vice versa.
12207 (try_cursor_movement): Check continued rows, in addition to
12208 continuation rows. Fixes unwarranted scroll when point enters a
12209 continued line of R2L text within an L2R paragraph, or vice versa.
12210 (cursor_row_p): Consider the case of point being equal to
12211 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12212 from the end of a short line to the beginning of a continued line
12213 of R2L text within L2R paragraph.
12214 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12215 composed characters.
12216
12217 * bidi.c (bidi_check_type): Use xassert.
12218 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12219 members.
12220
12221 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12222
12223 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12224 a character.
12225
12226 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12227
12228 * nsfont.m (ns_otf_to_script): Fix typo.
12229
12230 2011-08-22 Kenichi Handa <handa@m17n.org>
12231
12232 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12233 extra slot even if the purpose is char-code-property-table.
12234
12235 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12236
12237 * xdisp.c (redisplay_window): When computing centering_position,
12238 account for the height of the header line. (Bug#8874)
12239
12240 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12241 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12242 candidate is selected by the mouse, and that candidate has a
12243 composed character under the mouse.
12244
12245 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12246 coordinates reported by pos-visible-in-window-p for a composed
12247 character in column zero.
12248
12249 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12250
12251 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12252
12253 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12254
12255 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12256 consider it a hit if to_charpos is anywhere in the range of the
12257 composed buffer positions.
12258
12259 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12260
12261 * image.c (gif_load): Don't assume that each subimage has the same
12262 dimensions as the base image. Handle disposal method that is
12263 "undefined" by the gif spec (Bug#9335).
12264
12265 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12266
12267 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12268 (Fcondition_case): Document `debug' symbol in error handler.
12269
12270 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12271
12272 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12273 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12274 from an Org mode buffer to a Speedbar frame.
12275
12276 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12277 a composition, take its buffer position from IT->cmp_it.charpos.
12278 Fixes cursor positioning at the beginning of a line that begins
12279 with a composed character.
12280
12281 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12282
12283 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12284 character bidirectional type, use STRONG_L instead. Fixes crashes
12285 in a buffer produced by `describe-categories'.
12286
12287 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12288 members before the level stack, so they would be saved and
12289 restored when copying iterator state. Fixes incorrect reordering
12290 around TABs covered by display properties.
12291
12292 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12293
12294 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12295
12296 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12297
12298 * eval.c (internal_condition_case, internal_condition_case_1)
12299 (internal_condition_case_2, internal_condition_case_n):
12300 Remove unnecessary aborts (Bug#9081).
12301
12302 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12303
12304 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12305 has no `load' handler, try opening the file locally. (Bug#9311)
12306
12307 2011-08-16 Ken Brown <kbrown@cornell.edu>
12308
12309 * gmalloc.c: Expand comment.
12310
12311 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12312
12313 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12314 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12315
12316 2011-08-16 Ken Brown <kbrown@cornell.edu>
12317
12318 Fix memory allocation problems in Cygwin build (Bug#9273).
12319
12320 * unexcw.c ( __malloc_initialized): Declare external variable.
12321 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12322
12323 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12324 New variables.
12325 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12326 dumped emacs.
12327 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12328 in the static heap.
12329 [CYGWIN] (special_realloc): New function.
12330 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12331 requests to realloc storage in the static heap.
12332
12333 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12334
12335 * bidi.c (bidi_initialize): Remove unused local.
12336
12337 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12338
12339 * bidimirror.h:
12340 * biditype.h: Remove file.
12341 * makefile.w32-in ($(BLD)/bidi.$(O)):
12342 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12343
12344 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12345
12346 * chartab.c: Improve commentary for the uniprop_table API.
12347
12348 * bidi.c (bidi_paragraph_init): Support zero value of
12349 bidi_ignore_explicit_marks_for_paragraph_level.
12350 (bidi_initialize): Use uniprop_table instead of including
12351 biditype.h and bidimirror.h.
12352
12353 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12354 coordinates of the iterator when restoring from ppos_it.
12355 (Bug#9296)
12356
12357 2011-08-14 Kenichi Handa <handa@m17n.org>
12358
12359 * process.c (create_process): Call setup_process_coding_systems
12360 after the pid of the process is set to -1 (Bug#8162).
12361
12362 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12363
12364 * xdisp.c (move_it_in_display_line_to): Don't invoke
12365 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12366 ppos_it. Fixes vertical cursor motion when line beginning is
12367 covered by an image. (Bug#9296)
12368
12369 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12370
12371 * nsterm.h (ns_run_ascript): Declare.
12372 (NSAPP_DATA2_RUNASSCRIPT): Define.
12373
12374 * nsfns.m (as_script, as_result, as_status): New static variables.
12375 (ns_run_ascript): New function.
12376 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12377 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12378 the event loop. Get status from as_status (Bug#7276).
12379
12380 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12381 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12382 the event loop (Bug#7276).
12383
12384 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12385
12386 * gnutls.c (QCgnutls_bootprop_priority)
12387 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12388 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12389 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12390 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12391 (QCgnutls_bootprop_verify_hostname_error)
12392 (QCgnutls_bootprop_callbacks_verify): Rename from
12393 Qgnutls_bootprop_..., all uses changed.
12394
12395 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12396 uses changed.
12397
12398 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12399
12400 * xfaces.c (Qframe_set_background_mode): Now static.
12401 * dispextern.h (Qframe_set_background_mode): Remove decl.
12402
12403 * process.c (Fnetwork_interface_info): Declare local only if needed.
12404
12405 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12406
12407 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12408 (Fnetwork_interface_list): Allocate in increments of bytes instead
12409 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12410 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12411 sockaddr.
12412 (struct ifflag_def): notrailers is smart on OSX.
12413 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12414 Get hardware address with getifaddrs if available.
12415
12416 2011-08-12 Eli Zaretskii <eliz@gnu.org>
12417
12418 * xdisp.c (iterate_out_of_display_property): xassert that
12419 IT->position is set to within IT->object's boundaries. Break from
12420 the loop as soon as EOB is reached; avoids infloops in redisplay
12421 when IT->position is set up wrongly due to some bug.
12422 Set IT->current to match the bidi iterator unconditionally.
12423 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12424 entry. Force push_it to save on the stack the current
12425 buffer/string position, to be restored by pop_it. Fix flags in
12426 the iterator structure wrt the object coming from a display
12427 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12428 properties. (Bug#9284)
12429
12430 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12431
12432 * fontset.c (fontset_get_font_group): Add proper type checks.
12433 (Bug#9172)
12434
12435 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12436
12437 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12438 and LC_VERSION_MIN_MACOSX.
12439 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12440 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12441
12442 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12443
12444 * xdisp.c (forward_to_next_line_start): Allow to use the
12445 no-display-properties-and-no-overlays under bidi display.
12446 Set disp_pos in the bidi iterator to avoid searches for display
12447 properties and overlays.
12448
12449 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12450
12451 * editfns.c (Fset_time_zone_rule): Document relationship with the
12452 setenv function.
12453
12454 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12455 the font entity extracted from the cache (Bug#8109).
12456
12457 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12458
12459 * composite.c (autocmp_chars): Don't reset point. That is done by
12460 restore_point_unwind (Bug#5984).
12461
12462 2011-08-07 Juri Linkov <juri@jurta.org>
12463
12464 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12465 to show the arg `TIME' instead of `TIMEVAL'.
12466
12467 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12468
12469 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12470 display property strides EOL and includes a newline, as in
12471 longlines-mode. (Bug#9254)
12472 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12473 word-wrap under bidirectional display. (Bug#9224)
12474
12475 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12476 is non-zero, even if the data buffer is NULL. Fixes a crash in
12477 vertical-motion with longlines-mode. (Bug#9254)
12478
12479 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12480
12481 * bidi.c <bidi_cache_total_alloc>: Now static.
12482 (bidi_initialize): Initialize bidi_cache_total_alloc.
12483
12484 * xdisp.c (display_line): Release buffer allocated for shelved bidi
12485 cache. (Bug#9221)
12486
12487 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12488 amount allocated this far in `bidi_cache_total_alloc'.
12489 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12490 non-zero, only free the data buffer without restoring the cache
12491 contents. All callers changed.
12492
12493 * dispextern.h (bidi_unshelve_cache): Update prototype.
12494
12495 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12496 (move_it_in_display_line, move_it_to)
12497 (move_it_vertically_backward, move_it_by_lines): Replace the call
12498 to xfree to an equivalent call to bidi_unshelve_cache.
12499 (move_it_in_display_line_to): Fix logic of returning
12500 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12501
12502 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12503
12504 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12505 came from a string character with a `cursor' property. (Bug#9229)
12506
12507 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12508
12509 * Makefile.in (LIB_PTHREAD): New variable.
12510 (LIBES): Add LIB_PTHREAD (Bug#9216).
12511
12512 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12513 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12514
12515 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12516
12517 * regex.c (re_iswctype): Remove some redundant boolean conversions.
12518
12519 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12520
12521 * xterm.c (x_find_topmost_parent): New function.
12522 (x_set_frame_alpha): Find topmost parent window with
12523 x_find_topmost_parent and set the property there also (bug#9181).
12524 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12525
12526 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12527
12528 * callproc.c (Fcall_process): Avoid vfork clobbering
12529 the local vars buffer, coding_systems, current_dir.
12530
12531 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12532
12533 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12534
12535 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12536
12537 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12538 so that it is not optimized away.
12539
12540 * xdisp.c (compute_display_string_pos): Remove unused local.
12541
12542 2011-08-02 Eli Zaretskii <eliz@gnu.org>
12543
12544 Fix slow cursor motion and scrolling in large buffers with
12545 selective display, like Org Mode buffers. (Bug#9218)
12546
12547 * dispextern.h (struct bidi_it): New member disp_prop_p.
12548
12549 * xdisp.c: Remove one-slot cache of display string positions.
12550 (compute_display_string_pos): Accept an additional argument
12551 DISP_PROP_P; callers changed. Scan at most 5K characters forward
12552 for a display string or property. If found, set DISP_PROP_P
12553 non-zero.
12554
12555 * bidi.c (bidi_fetch_char): Accept an additional argument
12556 DISP_PROP_P, and pass it to compute_display_string_pos.
12557 Only handle text covered by a display string if DISP_PROP_P is returned
12558 non-zero. All callers of bidi_fetch_char changed.
12559
12560 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12561
12562 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12563
12564 2010-12-03 Don March <don@ohspite.net>
12565
12566 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12567 last character M-[char] is translated to ESC [char] (bug#7541).
12568
12569 2011-08-02 Kenichi Handa <handa@m17n.org>
12570
12571 * lisp.h (uniprop_table): Extern it.
12572
12573 * chartab.c (uniprop_table): Make it non-static.
12574
12575 2011-08-01 Eli Zaretskii <eliz@gnu.org>
12576
12577 * xdisp.c (forward_to_next_line_start): Accept additional argument
12578 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12579 on the newline.
12580 (reseat_at_next_visible_line_start): Use the bidi iterator state
12581 returned by forward_to_next_line_start to restore the state of
12582 it->bidi_it after backing up to previous newline. (Bug#9212)
12583
12584 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12585
12586 * regex.c (re_comp): Protoize.
12587 (re_exec): Fix return type.
12588 (regexec): Fix type of `ret'. (Bug#9203)
12589
12590 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12591
12592 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12593 This is needed if max-image-size is a floating-point number.
12594
12595 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12596
12597 * print.c (print_object): Print empty symbol as ##.
12598
12599 * lread.c (read1): Read ## as empty symbol.
12600
12601 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12602
12603 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12604 setting frame foreground color (Bug#9175).
12605 (x_set_background_color): Likewise.
12606
12607 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12608 contents (Bug#9176).
12609 (EmacsTooltip -init): Remove bezels and add shadows to
12610 tooltip windows.
12611
12612 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12613 or scroll bar (Bug#8470).
12614
12615 * nsfont.m (nsfont_open): Remove assignment to voffset and
12616 unnecessary vars hshink, expand, hd, full_height, min_height.
12617 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12618
12619 * nsterm.h (nsfont_info): Remove voffset field.
12620
12621 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12622
12623 Implement strike-through and overline on NextStep (Bug#8863).
12624
12625 * nsfont.m (nsfont_open): Use underline position provided by font,
12626 instead of hard-coded value of 2.
12627 (nsfont_draw): Call ns_draw_text_decoration instead.
12628
12629 * nsterm.h: Add declaration for ns_draw_text_decoration.
12630
12631 * nsterm.m (ns_draw_text_decoration): New function for drawing
12632 underline, overline, and strike-through.
12633 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12634 ns_draw_text_decoration. Change treatment of cursor drawing to
12635 accommodate underlining, etc.
12636
12637 2011-07-28 Eli Zaretskii <eliz@gnu.org>
12638
12639 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12640 default.
12641
12642 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12643
12644 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12645 Without this fix, if a signal arrives just after memory fills up,
12646 'malloc' might be invoked reentrantly.
12647
12648 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12649 In other words, assume that every image size is allowed, on non-X
12650 hosts. This assumption is probably wrong, but it lets Emacs compile.
12651
12652 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12653
12654 * regex.c (re_iswctype): Convert return values to boolean.
12655
12656 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12657
12658 * xdisp.c (compute_display_string_pos): Don't use cached display
12659 string position if the buffer had its restriction changed.
12660 (Bug#9184)
12661
12662 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12663
12664 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12665
12666 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12667
12668 Integer signedness and overflow and related fixes. (Bug#9079)
12669
12670 * bidi.c: Integer size and overflow fixes.
12671 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12672 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12673 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12674 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12675 (bidi_find_other_level_edge):
12676 Use ptrdiff_t instead of EMACS_INT where either will do.
12677 This works better on 32-bit hosts configured --with-wide-int.
12678 (bidi_cache_ensure_space): Check for size-calculation overflow.
12679 Use % rather than repeated addition, for better worst-case speed.
12680 Don't set bidi_cache_size until after xrealloc returns, because it
12681 might not return.
12682 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12683 (bidi_cache_ensure_space): Also check that the bidi cache size
12684 does not exceed that of the largest Lisp string or buffer. See Eli
12685 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12686
12687 * alloc.c (__malloc_size_t): Remove.
12688 All uses replaced by size_t. See Andreas Schwab's note
12689 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12690
12691 * image.c: Improve checking for integer overflow.
12692 (check_image_size): Assume that f is nonnull, since
12693 it is always nonnull in practice. This is one less thing to
12694 worry about when checking for integer overflow later.
12695 (x_check_image_size): New function, which checks for integer
12696 overflow issues inside X.
12697 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12698 This removes the need for a memory_full check.
12699 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12700 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12701 (xbm_read_bitmap_data): Change locals back to 'int', since
12702 their values must fit in 'int'.
12703 (xpm_load_image, png_load, tiff_load):
12704 Invoke x_create_x_image_and_pixmap earlier,
12705 to avoid much needless work if the image is too large.
12706 (tiff_load): Treat overly large images as if
12707 x_create_x_image_and_pixmap failed, not as malloc failures.
12708 (gs_load): Use x_check_image_size.
12709
12710 * gtkutil.c: Omit integer casts.
12711 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12712 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12713
12714 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12715
12716 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12717 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12718 would wrongly return t on a 64-bit host.
12719
12720 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12721 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12722 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12723 and therefore cause GCC to emit a bogus diagnostic in some cases.
12724
12725 * image.c: Integer signedness and overflow and related fixes.
12726 This is not an exhaustive set of fixes, but it's time to
12727 record what I've got.
12728 (lookup_pixel_color, check_image_size): Remove redundant decls.
12729 (check_image_size): Don't assume that arbitrary EMACS_INT values
12730 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12731 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12732 (tiff_load, imagemagick_load_image):
12733 Check for overflow in size calculations.
12734 (x_create_x_image_and_pixmap): Remove unnecessary test for
12735 xmalloc returning NULL; that can't happen.
12736 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12737 (xpm_color_bucket): Use better integer hashing function.
12738 (xpm_cache_color): Don't possibly over-allocate memory.
12739 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12740 (gif_memory_source):
12741 Use ptrdiff_t, not int or size_t, to record sizes.
12742 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12743 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12744 either works, as we prefer signed integers.
12745 (tiff_read_from_memory, tiff_write_from_memory):
12746 Return tsize_t, not size_t, since that's what the TIFF API wants.
12747 (tiff_read_from_memory): Don't fail simply because the read would
12748 go past EOF; instead, return a short read.
12749 (tiff_load): Omit no-longer-needed casts.
12750 (Fimagemagick_types): Don't assume size fits into 'int'.
12751
12752 Improve hashing quality when configured --with-wide-int.
12753 * fns.c (hash_string): New function, taken from sxhash_string.
12754 Do not discard information about ASCII character case; this
12755 discarding is no longer needed.
12756 (sxhash-string): Use it. Change sig to match it. Caller changed.
12757 * lisp.h: Declare it.
12758 * lread.c (hash_string): Remove, since we now use fns.c's version.
12759 The fns.c version returns a wider integer if --with-wide-int is
12760 specified, so this should help the quality of the hashing a bit.
12761
12762 * emacs.c: Integer overflow minor fix.
12763 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12764 Define only if GNU_LINUX.
12765 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12766
12767 * dispnew.c: Integer signedness and overflow fixes.
12768 Remove unnecessary forward decls, that were a maintenance hassle.
12769 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12770 All uses changed.
12771 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12772 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12773 (prepare_desired_row, line_draw_cost):
12774 Use int, not unsigned, where either works.
12775 (save_current_matrix, restore_current_matrix):
12776 Use ptrdiff_t, not size_t, where either works.
12777 (init_display): Check for overflow more accurately, and without
12778 relying on undefined behavior.
12779
12780 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12781 Remove, replacing with the new symbols in lisp.h. All uses changed.
12782 * fileio.c (make_temp_name):
12783 * filelock.c (lock_file_1, lock_file):
12784 * xdisp.c (message_dolog):
12785 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12786 Use pMd etc. instead.
12787 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12788 replacing the pWIDE etc. symbols removed from editfns.c.
12789
12790 * keyboard.h (num_input_events): Now uintmax_t.
12791 This is (very slightly) less likely to mess up due to wraparound.
12792 All uses changed.
12793
12794 * buffer.c: Integer signedness fixes.
12795 (alloc_buffer_text, enlarge_buffer_text):
12796 Use ptrdiff_t rather than size_t when either will do, as we prefer
12797 signed integers.
12798
12799 * alloc.c: Integer signedness and overflow fixes.
12800 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12801 (__malloc_size_t): Default to size_t, not to int.
12802 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12803 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12804 Prefer ptrdiff_t to size_t when either would do, as we prefer
12805 signed integers.
12806 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12807 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12808 Now const. Initialize with values that are in range even if char
12809 is signed.
12810 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12811 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12812 These functions do the right thing with sizes > 2**32.
12813 (check_depth): Now ptrdiff_t, not int.
12814 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12815 Adjust to new way of storing sizes. Check for size overflow bugs
12816 in rest of code.
12817 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12818 slightly wrong anyway, as it missed one instance of
12819 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12820 (refill_memory_reserve): Omit needless cast to size_t.
12821 (mark_object_loop_halt): Mark as externally visible.
12822
12823 * xselect.c: Integer signedness and overflow fixes.
12824 (Fx_register_dnd_atom, x_handle_dnd_message):
12825 Use ptrdiff_t, not size_t, since we prefer signed.
12826 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12827 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12828 x_dnd_atoms_size and x_dnd_atoms_length.
12829
12830 * doprnt.c: Prefer signed to unsigned when either works.
12831 * eval.c (verror):
12832 * doprnt.c (doprnt):
12833 * lisp.h (doprnt):
12834 * xdisp.c (vmessage):
12835 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12836 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12837 prefer signed arithmetic to avoid comparison confusion.
12838 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12839 but is a bit tricky.
12840
12841 Assume freestanding C89 headers, string.h, stdlib.h.
12842 * data.c, doprnt.c, floatfns.c, print.c:
12843 Include float.h unconditionally.
12844 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12845 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12846 * regex.c: Likewise for stddef.h, string.h.
12847 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12848 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12849 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12850 (STDC_HEADERS): Remove obsolete defines.
12851 * sysdep.c: Include limits.h unconditionally.
12852
12853 Assume support for memcmp, memcpy, memmove, memset.
12854 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12855 * regex.c (memcmp, memcpy):
12856 Remove; we assume C89 now.
12857
12858 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12859 (__malloc_safe_bcopy): Remove; no longer needed.
12860
12861 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12862 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12863 well either way, and we prefer signed to unsigned.
12864
12865 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12866
12867 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12868 closes the connection while we're reading (bug#9182).
12869
12870 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12871
12872 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12873 are specified (Bug#9168).
12874
12875 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12876
12877 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12878 Found by GCC static checking and --with-wide-int on a 32-bit host.
12879
12880 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12881
12882 * xdisp.c (compute_display_string_pos): Fix logic of caching
12883 previous display string position. Initialize cached_prev_pos to
12884 -1. Fixes slow-down at the beginning of a buffer.
12885
12886 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12887
12888 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12889 for attrs[LFACE_FONTSET_INDEX].
12890
12891 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12892
12893 * xml.c (parse_region): Remove unused local
12894 that was recently introduced.
12895
12896 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12897
12898 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12899 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12900
12901 * xdisp.c (move_it_in_display_line_to): Record the best matching
12902 position for TO_CHARPOS while scanning the line, and restore it on
12903 exit if none of the characters scanned was an exact match.
12904 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12905 when exact match is impossible due to invisible text, and the
12906 lines are truncated.
12907
12908 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12909
12910 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12911 for OSX >= 10.7.
12912
12913 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12914
12915 Fix a significant slow-down of cursor motion with C-n, C-p,
12916 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12917 auto-repeat under bidi redisplay in fontified buffers.
12918 * xdisp.c (compute_stop_pos_backwards): New function.
12919 (next_element_from_buffer): Call compute_stop_pos_backwards to
12920 find a suitable prev_stop when we find ourselves before
12921 base_level_stop.
12922 (reseat): Don't look for prev_stop, as that could mean a very long
12923 run.
12924 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12925 <cached_disp_overlay_modiff>: Cache for last found display string
12926 position.
12927 (compute_display_string_pos): Return the cached position if asked
12928 about the same buffer in the same area of character positions, and
12929 the buffer wasn't changed since the time the display string
12930 position was cached.
12931
12932 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12933
12934 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12935 is an integer, which is important for empty lines. (Bug#9149)
12936
12937 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
12938
12939 * frame.c (Fmodify_frame_parameters): In tty case, update the
12940 default face if necessary (Bug#4238).
12941
12942 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
12943
12944 * editfns.c (Fstring_to_char): No need to explain what a character
12945 is in the docstring (Bug#6576).
12946
12947 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12948
12949 * xml.c (parse_region): Make sure we always return a tree.
12950
12951 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12952
12953 * xml.c (parse_region): If a document contains only comments,
12954 return that, too.
12955
12956 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12957
12958 * xml.c (make_dom): Return comments, too.
12959
12960 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12961
12962 Port to OpenBSD.
12963 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12964 and the surrounding thread.
12965 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12966 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12967 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12968 timer goes off.
12969 * s/openbsd.h (BROKEN_SIGIO): Define.
12970 * unexelf.c (unexec) [__OpenBSD__]:
12971 Don't update the .mdebug section of the Alpha COFF symbol table.
12972
12973 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12974
12975 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12976 (bug#8460).
12977
12978 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12979
12980 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12981 This fixes some race conditions on the permissions of any newly
12982 created file.
12983
12984 * alloc.c (valid_pointer_p): Use pipe, not open.
12985 This fixes some permissions issues when debugging.
12986
12987 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12988 If fchown fails to set both uid and gid, try to set just gid,
12989 as that is sometimes allowed. Adjust the file's mode to eliminate
12990 setuid or setgid bits that are inappropriate if fchown fails.
12991
12992 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12993
12994 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12995 to compare Lisp_Objects.
12996 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12997 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12998 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12999
13000 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13001
13002 * lread.c (read_integer): Unread even EOF character.
13003 (read1): Likewise. Properly record start position of symbol.
13004
13005 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13006 symbol character follows.
13007
13008 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13009
13010 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13011 This works around a problem with the previous change to Fcopy_file.
13012 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13013 and without this change, GCC might complain about discarding
13014 fchown's return value.
13015
13016 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13017
13018 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13019
13020 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13021
13022 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13023
13024 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13025
13026 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13027 it's used from the C level.
13028
13029 * process.c: Use the same condition for POLL_FOR_INPUT in both
13030 keyboard.c and process.c (bug#1858).
13031
13032 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13033
13034 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13035 (Fgnutls_boot): Use it.
13036
13037 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13038
13039 * doc.c (Fsubstitute_command_keys): Revert last change.
13040
13041 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13042
13043 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13044 quotes the next character, and doesn't affect other longer
13045 sequences (bug#8935).
13046
13047 * lread.c (syms_of_lread): Clarify that is isn't only
13048 `eval-buffer' and `eval-defun' that's affected by
13049 `lexical-binding' (bug#8460).
13050
13051 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13052
13053 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13054 bidi redisplay when a line includes both an image and is truncated.
13055
13056 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13057
13058 Fix minor problems found by static checking.
13059 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13060 (elsz): Now a signed constant, not a size_t var. We prefer signed
13061 types to unsigned, to avoid integer comparison confusion. Without
13062 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13063 "cannot optimize loop, the loop counter may overflow", a symptom
13064 of the confusion.
13065 * indent.c (Fvertical_motion): Mark locals as initialized.
13066 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13067
13068 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13069
13070 * search.c (Fre_search_backward): Mention `case-fold-search' in
13071 all the re_search_* functions (bug#8138).
13072
13073 * keyboard.c (Fopen_dribble_file): Document when the file is
13074 closed (bug#8056).
13075
13076 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13077
13078 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13079 bidi_cache_idx.
13080
13081 Support bidi reordering of display and overlay strings.
13082 * xdisp.c (compute_display_string_pos)
13083 (compute_display_string_end): Accept additional argument STRING.
13084 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13085 (reseat_to_string): Initialize bidi_it->string.s and
13086 bidi_it->string.schars.
13087 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13088 NULL (avoids a crash in bidi_paragraph_init).
13089 Initialize itb.string.lstring.
13090 (init_iterator): Call bidi_init_it only of a valid
13091 buffer position was specified. Initialize paragraph_embedding to
13092 L2R.
13093 (reseat_to_string): Initialize the bidi iterator.
13094 (display_string): If we need to ignore text properties of
13095 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13096 original value of -1 will not work with bidi.)
13097 (compute_display_string_pos): First arg is now struct
13098 `text_pos *'; all callers changed. Support display properties on
13099 Lisp strings.
13100 (compute_display_string_end): Support display properties on Lisp
13101 strings.
13102 (init_iterator, reseat_1, reseat_to_string): Initialize the
13103 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13104 when iterating on a string not from display properties).
13105 (compute_display_string_pos, compute_display_string_end):
13106 Fix calculation of the object to scan. Fixes an error when using
13107 arrow keys.
13108 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13109 base_level_stop; instead, set base_level_stop to BEGV.
13110 Fixes crashes in vertical-motion.
13111 (next_element_from_buffer): Improve commentary for when
13112 the iterator is before prev_stop.
13113 (init_iterator): Initialize bidi_p from the default value of
13114 bidi-display-reordering, not from buffer-local value. Use the
13115 buffer-local value only if initializing for buffer iteration.
13116 (handle_invisible_prop): Support invisible properties on strings
13117 that are being bidi-reordered.
13118 (set_iterator_to_next): Support bidi reordering of C strings and
13119 Lisp strings.
13120 (next_element_from_string): Support bidi reordering of Lisp
13121 strings.
13122 (handle_stop_backwards): Support Lisp strings as well.
13123 (display_string): Support display of R2L glyph rows.
13124 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13125 (init_iterator): Don't initialize it->bidi_p for strings
13126 here.
13127 (reseat_to_string): Initialize it->bidi_p for strings here.
13128 (next_element_from_string, next_element_from_c_string)
13129 (next_element_from_buffer): Add xassert's for correspondence
13130 between IT's object being iterated and it->bidi_it.string
13131 structure.
13132 (face_before_or_after_it_pos): Support bidi iteration.
13133 (next_element_from_c_string): Handle the case of the first string
13134 character that is not the first one in the visual order.
13135 (get_visually_first_element): New function, refactored from common
13136 parts of next_element_from_buffer, next_element_from_string, and
13137 next_element_from_c_string.
13138 (tool_bar_lines_needed, redisplay_tool_bar)
13139 (display_menu_bar): Force left-to-right direction. Add a FIXME
13140 comment for making that be controlled by a user option.
13141 (push_it, pop_it): Save and restore the state of the
13142 bidi iterator. Save and restore the bidi_p flag.
13143 (pop_it): Iterate out of display property for string iteration as
13144 well.
13145 (iterate_out_of_display_property): Support iteration over strings.
13146 (handle_single_display_spec): Set up it->bidi_it for iteration
13147 over a display string, and call bidi_init_it.
13148 (handle_single_display_spec, next_overlay_string)
13149 (get_overlay_strings_1, push_display_prop): Set up the bidi
13150 iterator for displaying display or overlay strings.
13151 (forward_to_next_line_start): Don't use the shortcut if
13152 bidi-iterating.
13153 (back_to_previous_visible_line_start): If handle_display_prop
13154 pushed the iterator stack, restore the internal state of the bidi
13155 iterator by calling bidi_pop_it same number of times.
13156 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13157 and we are bidi-iterating, don't decrement the iterator position;
13158 instead, set the first_elt flag in the bidi iterator, to produce
13159 the same effect.
13160 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13161 (push_display_prop): xassert that we are iterating a buffer.
13162 (push_it, pop_it): Save and restore paragraph_embedding member.
13163 (handle_single_display_spec, next_overlay_string)
13164 (get_overlay_strings_1, reseat_1, reseat_to_string)
13165 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13166 correctly. Don't assume unibyte strings are not bidi-reordered.
13167 (compute_display_string_pos)
13168 (compute_display_string_end): Fix handling the case of C string.
13169 (push_it, pop_it): Save and restore from_disp_prop_p.
13170 (handle_single_display_spec, push_display_prop): Set the
13171 from_disp_prop_p flag.
13172 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13173 (pop_it): Call iterate_out_of_display_property only if we are
13174 popping after iteration over a string that came from a display
13175 property. Fix a typo in popping stretch info. Add an assertion
13176 for verifying that the iterator position is in sync with the bidi
13177 iterator.
13178 (handle_single_display_spec, get_overlay_strings_1)
13179 (push_display_prop): Fix initialization of paragraph direction for
13180 string when that of the parent object is not yet determined.
13181 (reseat_1): Call bidi_init_it to resync the bidi
13182 iterator with IT's position. (Bug#7616)
13183 (find_row_edges): If ROW->start.pos gives position
13184 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13185 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13186 Reset the from_disp_prop_p flag.
13187 (SAVE_IT, RESTORE_IT): New macros.
13188 (pos_visible_p, face_before_or_after_it_pos)
13189 (back_to_previous_visible_line_start)
13190 (move_it_in_display_line_to, move_it_in_display_line)
13191 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13192 (try_scrolling, redisplay_window, display_line): Use them when
13193 saving a temporary copy of the iterator and restoring it back.
13194 (back_to_previous_visible_line_start, reseat_1)
13195 (init_iterator): Empty the bidi cache "stack".
13196 (move_it_in_display_line_to): If iterator ended up at
13197 EOL, but we never saw any buffer positions smaller than
13198 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13199 motion in bidi-reordered lines.
13200 (move_it_in_display_line_to): Record prev_method and prev_pos
13201 immediately before the call to set_iterator_to_next. Fixes cursor
13202 motion in bidi-reordered lines with stretch glyphs and strings
13203 displayed in margins. (Bug#8133) (Bug#8867)
13204 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13205 TO_CHARPOS.
13206 (pos_visible_p): Support positions in bidi-reordered lines.
13207 Save and restore bidi cache.
13208
13209 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13210 (bidi_paragraph_info): Delete unused struct.
13211 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13212 (bidi_cache_start): New variable.
13213 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13214 to zero.
13215 (bidi_cache_fetch_state, bidi_cache_search)
13216 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13217 (bidi_cache_find, bidi_peek_at_next_level)
13218 (bidi_level_of_next_char, bidi_find_other_level_edge)
13219 (bidi_move_to_visually_next): Compare cache index with
13220 bidi_cache_start rather than with zero.
13221 (bidi_fetch_char): Accept new argument STRING; all callers
13222 changed. Support iteration over a string. Support strings with
13223 display properties. Support unibyte strings. Fix the type of
13224 `len' according to what STRING_CHAR_AND_LENGTH expects.
13225 (bidi_paragraph_init, bidi_resolve_explicit_1)
13226 (bidi_resolve_explicit, bidi_resolve_weak)
13227 (bidi_level_of_next_char, bidi_move_to_visually_next):
13228 Support iteration over a string.
13229 (bidi_set_sor_type, bidi_resolve_explicit_1)
13230 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13231 can now be zero (for strings); special values 0 and -1 were
13232 changed to -1 and -2, respectively.
13233 (bidi_char_at_pos): New function.
13234 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13235 Call it instead of FETCH_MULTIBYTE_CHAR.
13236 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13237 initialized to valid values.
13238 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13239 values.
13240 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13241 the test for valid cached positions. Fix the logic for looking up
13242 the sentinel state in the cache. GCPRO the Lisp string we are
13243 iterating.
13244 (bidi_push_it, bidi_pop_it): New functions.
13245 (bidi_initialize): Initialize the bidi cache start stack pointer.
13246 (bidi_cache_ensure_space): New function, refactored from part of
13247 bidi_cache_iterator_state. Don't assume the required size is just
13248 one BIDI_CACHE_CHUNK away.
13249 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13250 (bidi_count_bytes, bidi_char_at_pos): New functions.
13251 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13252 always valid if bidi_cache_idx is valid.
13253 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13254 is valid if it's going to be used.
13255 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13256 (bidi_cache_fetch_state, bidi_cache_search)
13257 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13258 (bidi_cache_iterator_state, bidi_cache_find)
13259 (bidi_find_other_level_edge, bidi_cache_start_stack):
13260 All variables related to cache indices are now EMACS_INT.
13261
13262 * dispextern.h (struct bidi_string_data): New structure.
13263 (struct bidi_it): New member `string'. Make flag members be 1-bit
13264 fields, and put them last in the struct.
13265 (compute_display_string_pos, compute_display_string_end):
13266 Update prototypes.
13267 (bidi_push_it, bidi_pop_it): Add prototypes.
13268 (struct iterator_stack_entry): New members bidi_p,
13269 paragraph_embedding, and from_disp_prop_p.
13270 (struct it): Member bidi_p is now a bit field 1 bit wide.
13271 (bidi_shelve_cache, bidi_unshelve_cache):
13272 Declare prototypes.
13273
13274 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13275 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13276 and vector-like objects.
13277
13278 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13279 cache around display iteration.
13280
13281 * window.c (Fwindow_end, window_scroll_pixel_based)
13282 (displayed_window_lines, Frecenter): Save and restore the bidi
13283 cache around display iteration.
13284
13285 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13286
13287 * editfns.c (Fdelete_region): Clarify the use of the named
13288 parameters (bug#6788).
13289
13290 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13291
13292 * indent.c (Fvertical_motion): Set and restore w->pointm when
13293 saving and restoring the window's buffer (Bug#9006).
13294
13295 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13296
13297 * editfns.c (Fstring_to_char): Clarify just what is returned
13298 (bug#6576). Text by Eli Zaretskii.
13299
13300 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13301
13302 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13303
13304 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13305
13306 * buffer.c (mmap_find): Fix a typo.
13307
13308 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13309
13310 Fix execution of x selection hooks.
13311 * xselect.c (Qx_lost_selection_functions)
13312 (Qx_sent_selection_functions): New vars.
13313 (syms_of_xselect): DEFSYM them.
13314 (x_handle_selection_request): Pass Qx_sent_selection_functions
13315 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13316 (x_handle_selection_clear,x_clear_frame_selections):
13317 Pass Qx_lost_selection_functions rather than
13318 Vx_lost_selection_functions to Frun_hook_with_args.
13319
13320 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13321
13322 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13323 The old code sometimes used this field without initializing it.
13324
13325 * alloc.c (gc_sweep): Don't read past end of array.
13326 In theory, the old code could also have corrupted Emacs internals,
13327 though it'd be very unlikely.
13328
13329 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13330
13331 * character.c (Fcharacterp): Don't advertise optional ignored
13332 argument. (Bug#4026)
13333
13334 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13335
13336 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13337 key" (bug#4257).
13338
13339 * window.c (Fset_window_start): Doc fix (bug#4199).
13340 (Fset_window_hscroll): Ditto.
13341
13342 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13343
13344 Fix minor new problems caught by GCC 4.6.1.
13345 * term.c (init_tty): Remove unused local.
13346 * xsettings.c (store_monospaced_changed): Define this function only
13347 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13348 not used otherwise.
13349
13350 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13351
13352 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13353
13354 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13355
13356 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13357 are the mini-buffer and the echo area (bug#3320).
13358
13359 * term.c (init_tty): Remove support for supdup, c10 and perq
13360 terminals, which are no longer supported (bug#1482).
13361
13362 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13363
13364 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13365
13366 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13367
13368 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13369 for non-popups (Bug#3642).
13370
13371 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13372
13373 * alloc.c (reset_malloc_hooks): Protoize.
13374 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13375 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13376 * cm.c (losecursor): Likewise.
13377 * data.c (fmod): Likewise.
13378 * dispnew.c (swap_glyphs_in_rows): Likewise.
13379 * emacs.c (memory_warning_signal): Likewise.
13380 * floatfns.c (float_error): Likewise.
13381 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13382 (otf_open, font_otf_capability, generate_otf_features)
13383 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13384 Likewise.
13385 * image.c (pbm_read_file): Likewise.
13386 * indent.c (string_display_width): Likewise.
13387 * intervals.c (check_for_interval, search_for_interval)
13388 (inc_interval_count, count_intervals, root_interval)
13389 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13390 * lread.c (defalias): Likewise.
13391 * ralloc.c (r_alloc_check): Likewise.
13392 * regex.c (set_image_of_range_1, set_image_of_range)
13393 (regex_grow_registers): Likewise.
13394 * sysdep.c (strerror): Likewise.
13395 * termcap.c (valid_filename_p, tprint, main): Likewise.
13396 * tparam.c (main): Likewise.
13397 * unexhp9k800.c (run_time_remap, save_data_space)
13398 (update_file_ptrs, read_header, write_header, calculate_checksum)
13399 (copy_file, copy_rest, display_header): Likewise.
13400 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13401 Likewise.
13402 * xdisp.c (check_it): Likewise.
13403 * xfaces.c (register_color, unregister_color, unregister_colors):
13404 Likewise.
13405 * xfns.c (print_fontset_result): Likewise.
13406 * xrdb.c (member, fatal, main): Likewise.
13407
13408 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13409
13410 Fix minor problems found by static checking (Bug#9031).
13411 * chartab.c (char_table_set_range, map_sub_char_table):
13412 Remove unused locals.
13413 (uniprop_table): Now static.
13414 * composite.c (_work_char): Remove unused static var.
13415
13416 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
13417
13418 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13419
13420 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13421
13422 * gtkutil.c (qttip_cb): Remove code without function.
13423
13424 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13425
13426 * w32.c (pthread_sigmask): New stub.
13427
13428 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13429
13430 Use pthread_sigmask, not sigprocmask (Bug#9010).
13431 sigprocmask is portable only for single-threaded applications, and
13432 Emacs can be multi-threaded when it uses GTK.
13433 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13434 (LIBES): Use it.
13435 * callproc.c (Fcall_process):
13436 * process.c (create_process):
13437 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13438 Use pthread_sigmask, not sigprocmask.
13439
13440 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13441
13442 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13443 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13444 wrong (Bug#8591).
13445
13446 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13447
13448 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13449 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13450 (xg_hide_tooltip): Fix comment.
13451
13452 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13453 in registerServicesMenuSendTypes.
13454 (validRequestorForSendType): Don't check ns_return_types.
13455
13456 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13457 ns_return_type.
13458
13459 2011-07-08 Jason Rumney <jasonr@gnu.org>
13460
13461 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13462 SH_SHOW for hidden windows (Bug#5482).
13463
13464 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13465 frame struct members of non-existent frames (Bug#6284).
13466
13467 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13468
13469 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13470 variable firstTime not needed on OSX >= 10.6.
13471 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13472 >= 10.5. Use setKnobProportion, setDoubleValue.
13473
13474 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13475 (MAC_OS_X_VERSION_10_5): Define if not defined.
13476 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13477 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13478 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13479
13480 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13481 cString and lossyCString on OSX >= 10.4.
13482
13483 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13484 sizeToFit on OSX >= 10.2.
13485
13486 * nsimage.m (allocInitFromFile): Don't use deprecated method
13487 bestRepresentationForDevice on OSX >= 10.6.
13488
13489 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13490 to avoid warning.
13491
13492 * emacs.c: Declare unexec_init_emacs_zone.
13493
13494 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13495
13496 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13497
13498 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13499 on svcsMenu (Bug#8842).
13500
13501 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13502 ns_return_types.
13503 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13504
13505 * nsterm.m (QUTF8_STRING): Declare.
13506 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13507 (validRequestorForSendType): Return type is (id).
13508 Change indexOfObjectIdenticalTo to indexOfObject.
13509 Check if we have local selection before returning self (Bug#8842).
13510 (writeSelectionToPasteboard): Put local selection into paste board
13511 if we have a local selection (Bug#8842).
13512 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13513
13514 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13515 (ns_get_local_selection): Declare.
13516
13517 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13518
13519 * keymap.c (describe_map_tree): Don't insert a double newline at
13520 the end of the buffer (bug#1169) and return whether we inserted
13521 something.
13522
13523 * callint.c (Fcall_interactively): Change "reading args" to
13524 "providing args" to try to clarify what it does (bug#1010).
13525
13526 2011-07-07 Kenichi Handa <handa@m17n.org>
13527
13528 * composite.c (composition_compute_stop_pos): Ignore a static
13529 composition starting before CHARPOS (Bug#8915).
13530
13531 * xdisp.c (handle_composition_prop): Likewise.
13532
13533 2011-07-07 Eli Zaretskii <eliz@gnu.org>
13534
13535 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13536 (Bug#9015)
13537
13538 2011-07-07 Kenichi Handa <handa@m17n.org>
13539
13540 * character.h (unicode_category_t): New enum type.
13541
13542 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13543 (Qchar_code_property_table): New variable.
13544 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13545 (UNIPROP_COMPRESSED_FORM_P): New macros.
13546 (char_table_ascii): Uncompress the compressed values.
13547 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13548 Uncompress the compressed values.
13549 (sub_char_table_ref_and_range): Likewise.
13550 (char_table_ref_and_range): Uncompress the compressed values.
13551 (sub_char_table_set): New arg is_uniprop. Callers changed.
13552 Uncompress the compressed values.
13553 (sub_char_table_set_range): Args changed. Callers changed.
13554 (char_table_set_range): Adjuted for the above change.
13555 (map_sub_char_table): Delete args default_val and parent. Add arg
13556 top. Give decoded values to a Lisp function.
13557 (map_char_table): Adjust for the above change. Give decoded
13558 values to a Lisp function. Gcpro more variables.
13559 (uniprop_table_uncompress)
13560 (uniprop_decode_value_run_length): New functions.
13561 (uniprop_decoder, uniprop_decoder_count): New variables.
13562 (uniprop_get_decoder, uniprop_encode_value_character)
13563 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13564 New functions.
13565 (uniprop_encoder, uniprop_encoder_count): New variables.
13566 (uniprop_get_encoder, uniprop_table)
13567 (Funicode_property_table_internal, Fget_unicode_property_internal)
13568 (Fput_unicode_property_internal): New functions.
13569 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13570 Sunicode_property_table_internal, Sget_unicode_property_internal,
13571 and Sput_unicode_property_internal. Defvar_lisp
13572 char-code-property-alist.
13573
13574 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13575 Vunicode_category_table.
13576
13577 * font.c (font_range): Adjust for the change of
13578 Vunicode_category_table.
13579
13580 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13581
13582 * m/iris4d.h: Remove file, move contents ...
13583 * s/irix6-5.h: ... here.
13584
13585 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13586
13587 Remove unportable assumption about struct layout (Bug#8884).
13588 * alloc.c (mark_buffer):
13589 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13590 (clone_per_buffer_values): Don't assume that
13591 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13592 This isn't true in general, and it's particularly not true
13593 if Emacs is configured with --with-wide-int.
13594 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13595 New macros, used in the buffer.c change.
13596
13597 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13598
13599 * xsettings.c: Use both GConf and GSettings if both are available.
13600 (store_config_changed_event): Add comment.
13601 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13602 (store_tool_bar_style_changed): New functions.
13603 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
13604 (struct xsettings): Move font inside HAVE_XFT.
13605 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13606 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13607 Move inside HAVE_XFT.
13608 (something_changed_gsettingsCB): Rename from something_changedCB.
13609 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13610 also.
13611 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13612 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
13613 (something_changed_gconfCB): Rename from something_changedCB.
13614 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13615 (parse_settings): Move check for font inside HAVE_XFT.
13616 (read_settings, apply_xft_settings): Add comment.
13617 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13618 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13619 call store_font_name_changed.
13620 (xft_settings_event): Add comment.
13621 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13622 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13623 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13624 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13625 (xsettings_initialize): Call init_gsettings last.
13626 (xsettings_get_system_font, xsettings_get_system_normal_font):
13627 Add comment.
13628
13629 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13630
13631 Random fixes. E.g., (random) never returned negative values.
13632 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13633 subseconds part to the entropy, as that's a bit more random.
13634 Prefer signed to unsigned, since the signedness doesn't matter and
13635 in general we prefer signed. When given a limit, use a
13636 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13637 latter isn't right if USE_2_TAGS_FOR_INTS.
13638 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13639 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13640
13641 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13642
13643 * textprop.c (text_property_stickiness):
13644 Obey Vtext_property_default_nonsticky.
13645 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13646 * w32fns.c (syms_of_w32fns):
13647 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13648
13649 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13650
13651 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13652 This is more efficient than Ffile_directory_p and avoids a minor race.
13653
13654 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13655
13656 * buffer.c (Foverlay_put): Say what the return value is
13657 (bug#7835).
13658
13659 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13660 is a directory before asking whether to use the file name
13661 (bug#7564).
13662 (barf_or_query_if_file_exists): Make the "File is a directory"
13663 error be more correct.
13664
13665 * fns.c (Frequire): Remove the mention of the .gz files, since
13666 that's installation-specific, but keep the mention of
13667 `get-load-suffixes'.
13668
13669 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13670
13671 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13672 Report string overflow if the output is too long.
13673
13674 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
13675
13676 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13677 (syms_of_gnutls): Remove duplicate DEFSYM for
13678 Qgnutls_bootprop_verify_hostname_error, an error for
13679 Qgnutls_bootprop_verify_error (which is no longer used).
13680
13681 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13682 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13683 Also (re)move comments that are misplaced or no longer relevant.
13684
13685 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13686
13687 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13688
13689 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
13690
13691 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13692 and background color parameters if they have been changed.
13693
13694 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13695
13696 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13697
13698 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13699
13700 * xsettings.c (SYSTEM_FONT): Define only when used.
13701 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13702
13703 * keymap.c (access_keymap_1): Now static.
13704
13705 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
13706
13707 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13708 leave any prefix arg for the up event (Bug#1586).
13709
13710 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13711
13712 * lread.c (syms_of_lread): Mention single symbols defined by
13713 `defvar' or `defconst' (bug#7154).
13714
13715 * fns.c (Frequire): Mention .el.gz files (bug#7314).
13716 (Frequire): Mention get-load-suffixes.
13717
13718 2011-07-02 Martin Rudalics <rudalics@gmx.at>
13719
13720 * window.h (window): Remove clone_number slot.
13721 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13722 Remove.
13723 (make_parent_window, make_window, saved_window)
13724 (Fset_window_configuration, save_window_save): Don't deal with
13725 clone numbers.
13726 * buffer.c (Qclone_number): Remove declaration.
13727 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13728
13729 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13730
13731 Add multiple inheritance to keymaps.
13732 * keymap.c (Fmake_composed_keymap): New function.
13733 (Fset_keymap_parent): Simplify.
13734 (fix_submap_inheritance): Remove.
13735 (access_keymap_1): New function extracted from access_keymap to handle
13736 embedded parents and handle lists of maps.
13737 (access_keymap): Use it.
13738 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13739 (Fcopy_keymap): Handle embedded parents.
13740 (Fcommand_remapping, define_as_prefix): Simplify.
13741 (Fkey_binding): Simplify.
13742 (syms_of_keymap): Move minibuffer-local-completion-map,
13743 minibuffer-local-filename-completion-map,
13744 minibuffer-local-must-match-map, and
13745 minibuffer-local-filename-must-match-map to Elisp.
13746 (syms_of_keymap): Defsubr make-composed-keymap.
13747 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13748 (parse_menu_item): Trivial simplification.
13749
13750 2011-07-01 Glenn Morris <rgm@gnu.org>
13751
13752 * Makefile.in (SETTINGS_LIBS): Fix typo.
13753
13754 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13755
13756 * coding.c (Fencode_coding_string): Record the last coding system
13757 used, as the function doc string says (bug#8738).
13758
13759 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13760
13761 * xsettings.c (store_monospaced_changed): Take new font as arg and
13762 check for change against current_mono_font.
13763 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13764 (emacs_settings_constructor, emacs_settings_get_property)
13765 (emacs_settings_set_property, emacs_settings_class_init)
13766 (emacs_settings_init, gsettings_obj): Remove.
13767 (something_changedCB): New function for HAVE_GSETTINGS.
13768 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13769 with value as argument.
13770 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13771 g_settings_new (Bug#8967). Do not create gsettings_obj.
13772 Remove calls to g_settings_bind. Connect something_changedCB to
13773 "changed".
13774
13775 * xgselect.c: Add defined (HAVE_GSETTINGS).
13776 (xgselect_initialize): Ditto.
13777
13778 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13779 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13780 xg_select.
13781
13782 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13783
13784 * eval.c (struct backtrace): Simplify and port the data structure.
13785 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13786 signed bit field, as this assumption is not portable and it makes
13787 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13788 "char debug_on_exit : 1" as this is not portable either; instead,
13789 use the portable "unsigned int debug_on_exit : 1". Remove unused
13790 member evalargs. Remove obsolete comments about cc bombing out.
13791
13792 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13793
13794 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
13795 Let HAVE_GSETTINGS override HAVE_GCONF.
13796 (store_monospaced_changed): New function.
13797 (EMACS_SETTINGS): A new type derived from GObject to handle
13798 GSettings notifications.
13799 (emacs_settings_constructor, emacs_settings_get_property)
13800 (emacs_settings_set_property, emacs_settings_class_init):
13801 New functions.
13802 (gsettings_client, gsettings_obj): New variables.
13803 (GSETTINGS_SCHEMA): New define.
13804 (something_changedCB): Call store_monospaced_changed.
13805 (init_gsettings): New function.
13806 (xsettings_initialize): Call init_gsettings.
13807 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13808 to NULL.
13809
13810 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13811 GCONF_CFLAGS/LIBS.
13812
13813 2011-06-29 Martin Rudalics <rudalics@gmx.at>
13814
13815 * window.c (resize_root_window, grow_mini_window)
13816 (shrink_mini_window): Rename Qresize_root_window to
13817 Qwindow_resize_root_window and Qresize_root_window_vertically to
13818 Qwindow_resize_root_window_vertically.
13819
13820 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13821
13822 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13823
13824 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
13825
13826 * makefile.w32-in: Redesign dependencies so they reflect more
13827 clearly which files are directly included by each source file,
13828 and not through other includes.
13829
13830 2011-06-27 Martin Rudalics <rudalics@gmx.at>
13831
13832 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13833 (sort_overlays, overlay_strings): When an overlay's clone number
13834 matches the window's clone number process the overlay even if
13835 the overlay's window property doesn't match the current window.
13836
13837 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13838 (Fwindow_hchild): Rename to Fwindow_left_child.
13839 (Fwindow_next): Rename to Fwindow_next_sibling.
13840 (Fwindow_prev): Rename to Fwindow_prev_sibling.
13841 (resize_window_check): Rename to window_resize_check.
13842 (resize_window_apply): Rename to window_resize_apply.
13843 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13844 (Fdelete_other_windows_internal, resize_frame_windows)
13845 (Fsplit_window_internal, Fdelete_window_internal)
13846 (grow_mini_window, shrink_mini_window)
13847 (Fresize_mini_window_internal): Fix callers accordingly.
13848
13849 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13850
13851 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13852 (emacs_fixed_set_min_size): Remove.
13853 (emacs_fixed_new): Take frame as argument.
13854
13855 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13856 (_EmacsFixedPrivate): Remove minwidth/height.
13857 Add struct frame *f.
13858 (emacs_fixed_init): Initialize priv->f.
13859 (get_parent_class, emacs_fixed_set_min_size): Remove.
13860 (emacs_fixed_new): Set priv->f to argument.
13861 (emacs_fixed_get_preferred_width)
13862 (emacs_fixed_get_preferred_height): Use min_width/height from
13863 frames size_hint to set minimum and natural (Bug#8919).
13864 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13865 and use min_width/height from frames size_hint to set
13866 min_width/height (Bug#8919).
13867
13868 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13869 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13870 Fix indentation.
13871
13872 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13873
13874 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13875 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13876 called at ZV.
13877
13878 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13879
13880 * process.c (wait_reading_process_output): Bypass select if
13881 waiting for a cell while ignoring keyboard input, and input is
13882 pending. Suggested by Jan Djärv (Bug#8869).
13883
13884 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13885
13886 Use gnulib's dup2 module instead of rolling our own.
13887 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13888
13889 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13890
13891 * dispnew.c (scrolling_window): Before scrolling, turn off a
13892 mouse-highlight in the window being scrolled.
13893
13894 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13895
13896 Move DEFSYM to lisp.h and use everywhere.
13897
13898 * character.h (DEFSYM): Move declaration...
13899 * lisp.h (DEFSYM): ...here.
13900
13901 * gnutls.c:
13902 * minibuf.c:
13903 * w32menu.c:
13904 * w32proc.c:
13905 * w32select.c: Don't include character.h.
13906
13907 * alloc.c (syms_of_alloc):
13908 * buffer.c (syms_of_buffer):
13909 * bytecode.c (syms_of_bytecode):
13910 * callint.c (syms_of_callint):
13911 * casefiddle.c (syms_of_casefiddle):
13912 * casetab.c (init_casetab_once):
13913 * category.c (init_category_once, syms_of_category):
13914 * ccl.c (syms_of_ccl):
13915 * cmds.c (syms_of_cmds):
13916 * composite.c (syms_of_composite):
13917 * dbusbind.c (syms_of_dbusbind):
13918 * dired.c (syms_of_dired):
13919 * dispnew.c (syms_of_display):
13920 * doc.c (syms_of_doc):
13921 * editfns.c (syms_of_editfns):
13922 * emacs.c (syms_of_emacs):
13923 * eval.c (syms_of_eval):
13924 * fileio.c (syms_of_fileio):
13925 * fns.c (syms_of_fns):
13926 * frame.c (syms_of_frame):
13927 * fringe.c (syms_of_fringe):
13928 * insdel.c (syms_of_insdel):
13929 * keymap.c (syms_of_keymap):
13930 * lread.c (init_obarray, syms_of_lread):
13931 * macros.c (syms_of_macros):
13932 * msdos.c (syms_of_msdos):
13933 * print.c (syms_of_print):
13934 * process.c (syms_of_process):
13935 * search.c (syms_of_search):
13936 * sound.c (syms_of_sound):
13937 * syntax.c (init_syntax_once, syms_of_syntax):
13938 * terminal.c (syms_of_terminal):
13939 * textprop.c (syms_of_textprop):
13940 * undo.c (syms_of_undo):
13941 * w32.c (globals_of_w32):
13942 * window.c (syms_of_window):
13943 * xdisp.c (syms_of_xdisp):
13944 * xfaces.c (syms_of_xfaces):
13945 * xfns.c (syms_of_xfns):
13946 * xmenu.c (syms_of_xmenu):
13947 * xsettings.c (syms_of_xsettings):
13948 * xterm.c (syms_of_xterm): Use DEFSYM.
13949
13950 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13951
13952 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13953
13954 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13955
13956 Integer and buffer overflow fixes (Bug#8873).
13957
13958 * print.c (printchar, strout): Check for string overflow.
13959 (PRINTPREPARE, printchar, strout):
13960 Don't set size unless allocation succeeds.
13961
13962 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13963 for sizes. Check for string overflow more accurately.
13964 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13965
13966 * macros.c: Integer and buffer overflow fixes.
13967 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13968 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13969 Use ptrdiff_t, not int, for sizes.
13970 Don't increment bufsize until after realloc succeeds.
13971 Check for size-calculation overflow.
13972 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13973
13974 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13975
13976 * lread.c: Integer overflow fixes.
13977 (read_integer): Radix is now EMACS_INT, not int,
13978 to improve quality of diagnostics for out-of-range radices.
13979 Calculate buffer size correctly for out-of-range radices.
13980 (read1): Check for integer overflow in radices, and in
13981 read-circle numbers.
13982 (read_escape): Avoid int overflow.
13983 (Fload, openp, read_buffer_size, read1)
13984 (substitute_object_recurse, read_vector, read_list, map_obarray):
13985 Use ptrdiff_t, not int, for sizes.
13986 (read1): Use EMACS_INT, not int, for sizes.
13987 Check for size overflow.
13988
13989 * image.c (cache_image): Check for size arithmetic overflow.
13990
13991 * lread.c: Integer overflow issues.
13992 (saved_doc_string_size, saved_doc_string_length)
13993 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13994 Now ptrdiff_t, not int.
13995 (read1): Don't assume doc string length fits in int. Check for
13996 out-of-range doc string lengths.
13997 (read_list): Don't assume file position fits in int.
13998 (read_escape): Check for hex character overflow.
13999
14000 2011-06-22 Leo Liu <sdl.web@gmail.com>
14001
14002 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14003 Move to minibuffer.el.
14004
14005 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14006
14007 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14008 The following patches are for when GLYPH_DEBUG && !XASSERT.
14009 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14010 * dispnew.c (flush_stdout):
14011 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14012 Mark as externally visible.
14013 * dispnew.c (check_window_matrix_pointers): Now static.
14014 * dispnew.c (window_to_frame_vpos):
14015 * xfns.c (unwind_create_frame):
14016 * xterm.c (x_check_font): Remove unused local.
14017 * scroll.c (CHECK_BOUNDS):
14018 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14019 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14020 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14021 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14022 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14023 Now static.
14024 (debug_method_add): Use va_list and vsprintf rather than relying
14025 on undefined behavior with wrong number of arguments.
14026 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14027 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14028 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14029 since we're not interested in debugging glyphs with old libraries.
14030 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14031 GCC 4.6.0's static checking.
14032
14033 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14034
14035 Integer overflow and signedness fixes (Bug#8873).
14036 A few related buffer overrun fixes, too.
14037
14038 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14039
14040 * dispextern.h (struct face.stipple):
14041 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14042 (x_bitmap_mask, x_allocate_bitmap_record)
14043 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14044 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14045 (x_create_bitmap_from_xpm_data):
14046 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14047 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14048 (.bitmaps_last):
14049 * xfaces.c (load_pixmap):
14050 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14051 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14052 (.bitmaps_last, struct x_output.icon_bitmap):
14053 Use ptrdiff_t, not int, for bitmap indexes.
14054 (x_allocate_bitmap_record): Check for size overflow.
14055 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14056
14057 Use ptrdiff_t, not int, for overlay counts.
14058 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14059 * editfns.c (overlays_around, get_pos_property):
14060 * textprop.c (get_char_property_and_overlay):
14061 * xdisp.c (next_overlay_change, note_mouse_highlight):
14062 * xfaces.c (face_at_buffer_position):
14063 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14064 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14065 (Fnext_overlay_change, Fprevious_overlay_change)
14066 (mouse_face_overlay_overlaps, Foverlays_in):
14067 Use ptrdiff_t, not int, for sizes.
14068 (overlays_at, overlays_in): Check for size-calculation overflow.
14069
14070 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14071
14072 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14073 (x_session_initialize): Do not assume string length fits in int.
14074
14075 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14076 This is unlikely, but can occur if DPI is outlandish.
14077
14078 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14079 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14080
14081 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14082 * xrdb.c (magic_file_p, search_magic_path):
14083 Omit last arg SUFFIX; it was always 0. All callers changed.
14084 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14085
14086 * xfont.c (xfont_match): Avoid need for strlen.
14087
14088 * xfns.c: Don't assume strlen fits in int.
14089 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14090
14091 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14092 not unsigned long, as we prefer signed integers. All callers changed.
14093 Detect integer overflow in repeat count.
14094 (message_dolog): Don't assume print length fits in 39 bytes.
14095 (display_mode_element): Don't assume strlen fits in int.
14096
14097 * termcap.c: Don't assume sizes fit in int and never overflow.
14098 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14099 (gobble_line): Check for size-calculation overflow.
14100
14101 * minibuf.c (Fread_buffer):
14102 * lread.c (intern, intern_c_string):
14103 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14104 Don't assume string length fits in int.
14105
14106 * keyboard.c (parse_tool_bar_item):
14107 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14108
14109 * font.c: Don't assume string length fits in int.
14110 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14111 Use ptrdiff_t, not int.
14112 (font_intern_prop): Don't assume string length fits in int.
14113 Don't assume integer property fits in fixnum.
14114 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14115
14116 * filelock.c: Fix some buffer overrun and integer overflow issues.
14117 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14118 Reformulate so as not to need the command string.
14119 Invoke gzip -cd rather than gunzip, as it's more portable.
14120 (lock_info_type, lock_file_1, lock_file):
14121 Don't assume pid_t and time_t fit in unsigned long.
14122 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14123 (current_lock_owner): Prefer signed type for sizes.
14124 Use memcpy, not strncpy, where memcpy is what is really wanted.
14125 Don't assume (via atoi) that time_t and pid_t fit in int.
14126 Check for time_t and/or pid_t out of range, e.g., via a network share.
14127 Don't alloca where an auto var works fine.
14128
14129 * fileio.c: Fix some integer overflow issues.
14130 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14131 Don't assume string length fits in int.
14132 (directory_file_name): Don't assume string length fits in long.
14133 (make_temp_name): Don't assume pid fits in int, or that its print
14134 length is less than 20.
14135
14136 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14137
14138 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14139
14140 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14141
14142 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14143 We prefer signed integers, even for size calculations.
14144
14145 * emacs.c: Don't assume string length fits in 'int'.
14146 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14147 (main): Don't invoke strlen when not needed.
14148
14149 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14150 (XD_DEBUG_MESSAGE): Don't waste a byte.
14151
14152 * callproc.c (getenv_internal_1, getenv_internal)
14153 (Fgetenv_internal):
14154 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14155
14156 * lread.c (invalid_syntax): Omit length argument.
14157 All uses changed. This doesn't fix a bug, but it simplifies the
14158 code away from its former Hollerith-constant appearance, and it's
14159 one less 'int' to worry about when looking at integer-overflow issues.
14160 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14161
14162 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14163 This didn't break anything, but it didn't help either.
14164 It's confusing to put a bogus integer in a place where the actual
14165 value does not matter.
14166 (LIST_END_P): Remove unused macro and its bogus comment.
14167 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14168
14169 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14170 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14171 implementation.
14172 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14173 We prefer signed types, and the value cannot exceed the EMACS_INT
14174 range anyway (because otherwise the length would not be representable).
14175 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14176 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14177 This avoids a GCC warning when WIDE_EMACS_INT.
14178
14179 * indent.c (sane_tab_width): New function.
14180 (current_column, scan_for_column, Findent_to, position_indentation)
14181 (compute_motion): Use it. This is just for clarity.
14182 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14183
14184 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14185
14186 * lisp.h (lint_assume): New macro.
14187 * composite.c (composition_gstring_put_cache):
14188 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14189
14190 * editfns.c, insdel.c:
14191 Omit unnecessary forward decls, to simplify future changes.
14192
14193 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14194
14195 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14196
14197 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14198 Use much-faster test for byte-length change.
14199 Don't assume string byte-length fits in 'int'.
14200 Check that character arg fits in 'int'.
14201 (mapcar1): Declare byte as byte, for clarity.
14202
14203 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14204
14205 * fns.c (concat): Catch string overflow earlier.
14206 Do not rely on integer wraparound.
14207
14208 * dispextern.h (struct it.overlay_strings_charpos)
14209 (struct it.selective): Now EMACS_INT, not int.
14210 * xdisp.c (forward_to_next_line_start)
14211 (back_to_previous_visible_line_start)
14212 (reseat_at_next_visible_line_start, next_element_from_buffer):
14213 Don't arbitrarily truncate the value of 'selective' to int.
14214
14215 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14216
14217 * composite.c: Don't truncate sizes to 'int'.
14218 (composition_gstring_p, composition_reseat_it)
14219 (composition_adjust_point): Use EMACS_INT, not int.
14220 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14221 not EMACS_UINT, for indexes.
14222
14223 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14224
14225 * buffer.c: Include <verify.h>.
14226 (struct sortvec.priority, struct sortstr.priority):
14227 Now EMACS_INT, not int.
14228 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14229 (struct sortstr.size, record_overlay_string)
14230 (struct sortstrlist.size, struct sortlist.used):
14231 Don't truncate size to int.
14232 (record_overlay_string): Check for size-calculation overflow.
14233 (init_buffer_once): Check at compile-time, not run-time.
14234
14235 2011-06-22 Jim Meyering <meyering@redhat.com>
14236
14237 Don't leak an XBM-image-sized buffer
14238 * image.c (xbm_load): Free the image buffer after using it.
14239
14240 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14241
14242 Port to Sun C.
14243 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14244 that Sun C diagnosed.
14245 * fns.c (secure_hash): Fix pointer signedness issue.
14246 * intervals.c (static_offset_intervals): New function.
14247 (offset_intervals): Use it.
14248
14249 2011-06-21 Leo Liu <sdl.web@gmail.com>
14250
14251 * deps.mk (fns.o):
14252 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14253 sha512.h.
14254
14255 * fns.c (secure_hash): Rename from crypto_hash_function and change
14256 the first arg to accept symbols.
14257 (Fsecure_hash): New primitive.
14258 (syms_of_fns): New symbols.
14259
14260 2011-06-20 Deniz Dogan <deniz@dogan.se>
14261
14262 * process.c (Fset_process_buffer): Clarify return value in
14263 docstring.
14264
14265 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14266
14267 * dispnew.c (add_window_display_history): Use BVAR.
14268
14269 * xdisp.c (debug_method_add): Use BVAR.
14270 (check_window_end, dump_glyph_matrix, dump_glyph)
14271 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14272
14273 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14274 Likewise.
14275
14276 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14277 check till after the cache is created in init_frame_faces.
14278
14279 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14280
14281 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14282
14283 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14284
14285 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14286 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14287 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14288
14289 Improve buffer-overflow checking (Bug#8873).
14290 * fileio.c (Finsert_file_contents):
14291 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14292 Remove the old (too-loose) buffer overflow checks.
14293 They weren't needed, since make_gap checks for buffer overflow.
14294 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14295 The old code merely checked for Emacs fixnum overflow, and relied
14296 on undefined (wraparound) behavior. The new code avoids undefined
14297 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14298
14299 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14300 Tune. Don't use wider integers than needed. Don't use alloca.
14301 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14302
14303 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14304
14305 * insdel.c, lisp.h (buffer_overflow): New function.
14306 (insert_from_buffer_1, replace_range, replace_range_2):
14307 * insdel.c (make_gap_larger):
14308 * editfns.c (Finsert_char):
14309 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14310
14311 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14312
14313 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14314
14315 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14316
14317 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14318 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14319
14320 * fileio.c: Don't assume EMACS_INT fits in off_t.
14321 (emacs_lseek): New static function.
14322 (Finsert_file_contents, Fwrite_region): Use it.
14323 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14324
14325 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14326
14327 * fns.c: Don't overflow int when computing a list length.
14328 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14329 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14330 truncation on 64-bit hosts. Check for QUIT every
14331 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14332 faster and is responsive enough.
14333 (Flength): Report an error instead of overflowing an integer.
14334 (Fsafe_length): Return a float if the value is not representable
14335 as a fixnum. This shouldn't happen except in contrived situations.
14336 (Fnthcdr, Fsort): Don't assume list length fits in int.
14337 (Fcopy_sequence): Don't assume vector length fits in int.
14338
14339 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14340 (header_size, word_size): New constants.
14341 (allocate_vectorlike): Don't check size overflow here.
14342 (allocate_vector): Check it here instead, since this is the only
14343 caller of allocate_vectorlike that could cause overflow.
14344 Check that the new vector's length is representable as a fixnum.
14345
14346 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14347 The previous code was bogus. For example, next_almost_prime (32)
14348 returned 39, which is undesirable as it is a multiple of 3; and
14349 next_almost_prime (24) returned 25, which is a multiple of 5 so
14350 why was the code bothering to check for multiples of 7?
14351
14352 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14353
14354 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14355
14356 Variadic C functions now count arguments with ptrdiff_t.
14357 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14358 Back then I didn't know that the Emacs coding style prefers signed int.
14359 Also, in the meantime I found a few more instances where arguments
14360 were being counted with int, which may truncate counts on 64-bit
14361 machines, or EMACS_INT, which may be unnecessarily wide.
14362 * lisp.h (struct Lisp_Subr.function.aMANY)
14363 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14364 Arg counts are now ptrdiff_t, not size_t.
14365 All variadic functions and their callers changed accordingly.
14366 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14367 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14368 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14369 * callint.c (Fcall_interactively): Check arg count for overflow,
14370 to avoid potential buffer overrun. Use signed char, not 'int',
14371 for 'varies' array, so that we needn't bother to check its size
14372 calculation for overflow.
14373 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14374 * eval.c (apply_lambda):
14375 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14376 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14377 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14378
14379 * callint.c (Fcall_interactively): Don't use index var as event count.
14380
14381 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14382 * mem-limits.h (SIZE): Remove; no longer used.
14383
14384 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14385
14386 Remove unnecessary casts.
14387 * xterm.c (x_term_init):
14388 * xfns.c (x_set_border_pixel):
14389 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14390 These aren't needed now that we assume ANSI C.
14391
14392 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14393 It's more likely to cause problems (due to unsigned overflow)
14394 than to cure them.
14395
14396 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14397
14398 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14399
14400 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14401
14402 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14403
14404 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14405
14406 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14407
14408 GLYPH_CODE_FACE returns EMACS_INT, not int.
14409 * dispextern.h (merge_faces):
14410 * xfaces.c (merge_faces):
14411 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14412 Don't assume EMACS_INT fits in int.
14413
14414 * character.h (CHAR_VALID_P): Remove unused parameter.
14415 * fontset.c, lisp.h, xdisp.c: All uses changed.
14416
14417 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14418
14419 * fns.c (concat): Minor tuning based on overflow analysis.
14420 This doesn't fix any bugs. Use int to hold character, instead
14421 of constantly refetching from Emacs object. Use XFASTINT, not
14422 XINT, for value known to be a character. Don't bother comparing
14423 a single byte to 0400, as it's always less.
14424
14425 * floatfns.c (Fexpt):
14426 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14427
14428 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14429 for characters.
14430
14431 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14432
14433 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14434 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14435 incorrectly succeed when S was a string, because 4294967386 was
14436 truncated before it was used.
14437
14438 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14439 Otherwise, an out-of-range integer could cause undefined behavior
14440 on a 64-bit host.
14441
14442 * composite.c: Use int, not EMACS_INT, for characters.
14443 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14444 EMACS_INT, for values that are known to be in character range.
14445 This doesn't fix any bugs but is the usual style inside Emacs and
14446 may generate better code on 32-bit machines.
14447
14448 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14449 This is for reasons similar to the recent CHAR_STRING fix.
14450 * charset.c (Fencode_char): Check that character arg is actually
14451 a character. Pass an int to ENCODE_CHAR.
14452 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14453 wider than 'int', as a compile-time check to prevent future regressions
14454 in this area.
14455
14456 * character.c (char_string): Remove unnecessary casts.
14457
14458 Make sure a 64-bit char is never passed to CHAR_STRING.
14459 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14460 by silently ignoring the top 32 bits, allowing some values
14461 that were far too large to be valid characters.
14462 * character.h: Include <verify.h>.
14463 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14464 arguments are no wider than unsigned, as a compile-time check
14465 to prevent future regressions in this area.
14466 * data.c (Faset):
14467 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14468 (Fsubst_char_in_region):
14469 * fns.c (concat):
14470 * xdisp.c (decode_mode_spec_coding):
14471 Adjust to CHAR_STRING's new requirement.
14472 * editfns.c (Finsert_char, Fsubst_char_in_region):
14473 * fns.c (concat): Check that character args are actually
14474 characters. Without this test, these functions did the wrong
14475 thing with wildly out-of-range values on 64-bit hosts.
14476
14477 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14478 These casts should not be needed on 32-bit hosts, either.
14479 * keyboard.c (read_char):
14480 * lread.c (Fload): Remove casts to unsigned.
14481
14482 * lisp.h (UNSIGNED_CMP): New macro.
14483 This fixes comparison bugs on 64-bit hosts.
14484 (ASCII_CHAR_P): Use it.
14485 * casefiddle.c (casify_object):
14486 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14487 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14488 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14489 * dispextern.h (FACE_FROM_ID):
14490 * keyboard.c (read_char): Use UNSIGNED_CMP.
14491
14492 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14493 not to EMACS_INT, to avoid GCC warning.
14494
14495 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14496
14497 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14498 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14499 isn't needed on 32-bit machines.
14500
14501 * buffer.c (Fgenerate_new_buffer_name):
14502 Use EMACS_INT for count, not int.
14503 (advance_to_char_boundary): Return EMACS_INT, not int.
14504
14505 * data.c (Qcompiled_function): Now static.
14506
14507 * window.c (window_body_lines): Now static.
14508
14509 * image.c (gif_load): Rename local to avoid shadowing.
14510
14511 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14512 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14513 * alloc.c (make_save_value): Integer argument is now of type
14514 ptrdiff_t, not int.
14515 (mark_object): Use ptrdiff_t, not int.
14516 * lisp.h (pD): New macro.
14517 * print.c (print_object): Use it.
14518
14519 * alloc.c: Use EMACS_INT, not int, to count objects.
14520 (total_conses, total_markers, total_symbols, total_vector_size)
14521 (total_free_conses, total_free_markers, total_free_symbols)
14522 (total_free_floats, total_floats, total_free_intervals)
14523 (total_intervals, total_strings, total_free_strings):
14524 Now EMACS_INT, not int. All uses changed.
14525 (Fgarbage_collect): Compute overall total using a double, so that
14526 integer overflow is less likely to be a problem. Check for overflow
14527 when converting back to an integer.
14528 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14529 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14530 These were 'int' variables that could overflow on 64-bit hosts;
14531 they were never used, so remove them instead of repairing them.
14532 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14533 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14534 Previously, this ceilinged at INT_MAX, but that doesn't work on
14535 64-bit machines.
14536 (allocate_pseudovector): Don't use EMACS_INT when int would do.
14537
14538 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14539 (allocate_vectorlike): Check for ptrdiff_t overflow.
14540 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14541 when a (possibly-narrower) signed value would do just as well.
14542 We prefer using signed arithmetic, to avoid comparison confusion.
14543
14544 * alloc.c: Catch some string size overflows that we were missing.
14545 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14546 for convenience in STRING_BYTES_MAX.
14547 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14548 The definition here is exact; the one in lisp.h was approximate.
14549 (allocate_string_data): Check for string overflow. This catches
14550 some instances we weren't catching before. Also, it catches
14551 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14552 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14553 and ptrdiff_t and EMACS_INT are both 64 bits.
14554
14555 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14556 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14557 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14558
14559 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14560
14561 * alloc.c (Fmake_string): Check for out-of-range init.
14562
14563 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14564
14565 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14566
14567 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14568
14569 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14570 xg_get_default_scrollbar_width.
14571
14572 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14573 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14574 (style_changed_cb): Call update_theme_scrollbar_width and call
14575 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14576 all frames (Bug#8505).
14577 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14578 Call gtk_window_set_resizable if HAVE_GTK3.
14579 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14580 and height if HAVE_GTK3 (Bug#8505).
14581 (scroll_bar_width_for_theme): New variable.
14582 (update_theme_scrollbar_width): New function.
14583 (xg_get_default_scrollbar_width): Move code to
14584 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14585 (xg_initialize): Call update_theme_scrollbar_width.
14586
14587 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14588
14589 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14590
14591 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14592
14593 * frame.c (make_frame): Call other_buffer_safely instead of
14594 other_buffer.
14595
14596 * window.c (temp_output_buffer_show): Call display_buffer with
14597 second argument Vtemp_buffer_show_specifiers and reset latter
14598 immediately after the call.
14599 (Vtemp_buffer_show_specifiers): New variable.
14600 (auto_window_vscroll_p, next_screen_context_lines)
14601 (Vscroll_preserve_screen_position): Remove leading asterisks from
14602 doc-strings.
14603
14604 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
14605
14606 Fix minor problems found by GCC 4.6.0 static checking.
14607 * buffer.c (Qclone_number): Remove for now, as it's unused.
14608 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14609 (record_buffer): Remove unused local.
14610 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14611 (set_frame_buffer_list): Remove; unused.
14612 * frame.h (other_visible_frames): Remove decl.
14613 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14614 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14615 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14616 if HAVE_GPM.
14617 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14618 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14619 Define only if HAVE_GPM.
14620 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14621 (update_hints_inhibit): Remove; never set. All uses removed.
14622 * widgetprv.h (emacsFrameClassRec): Remove decl.
14623 * window.c (delete_deletable_window): Now returns void, since it
14624 wasn't returning anything.
14625 (compare_window_configurations): Remove unused locals.
14626 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14627 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14628 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14629 the same widths as pointers. This follows up on the 2011-05-06 patch.
14630 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14631 * xterm.h: Likewise.
14632 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14633
14634 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
14635
14636 * makefile.w32-in: Update dependencies.
14637 (LISP_H): Add lib/intprops.h.
14638
14639 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14640
14641 * image.c (gif_load): Add animation frame delay to the metadata.
14642 (syms_of_image): Use DEFSYM. New symbol `delay'.
14643
14644 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14645
14646 * window.c (delete_deletable_window): Re-add.
14647 (Fset_window_configuration): Rewrite to handle dead buffers and
14648 consequently deletable windows.
14649 (window_tree, Fwindow_tree): Remove. Supply functionality in
14650 window.el.
14651 (compare_window_configurations): Simplify code.
14652
14653 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14654
14655 * image.c (imagemagick_load_image): Fix type mismatch.
14656 (Fimagemagick_types): Likewise.
14657
14658 * window.h (replace_buffer_in_windows): Declare.
14659
14660 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14661
14662 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14663 Qclone_number. Remove external declaration of Qdelete_window.
14664 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14665 code.
14666 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14667 Run Qbuffer_list_update_hook if allowed.
14668 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14669 buffer list implementation.
14670 (other_buffer_safely): New function.
14671 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14672 calls to replace_buffer_in_windows and
14673 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14674 if allowed.
14675 (record_buffer): Inhibit quitting and rewrite using quittable
14676 functions. Run Qbuffer_list_update_hook if allowed.
14677 (Frecord_buffer, Funrecord_buffer): New functions.
14678 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14679 Move switch-to-buffer to window.el.
14680 (bury-buffer): Move to window.el.
14681 (Vbuffer_list_update_hook): New variable.
14682
14683 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14684 section.
14685
14686 * window.h (resize_frame_windows): Move up in code.
14687 (Fwindow_frame): Remove EXFUN.
14688 (replace_buffer_in_all_windows): Remove prototype.
14689 (replace_buffer_in_windows_safely): Add prototype.
14690
14691 * window.c: Declare Qdelete_window static again. Move down
14692 declaration of select_count.
14693 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14694 (Fother_window): Move to window.el.
14695 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14696 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14697 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14698 window.el.
14699 (replace_buffer_in_windows): Implement by calling
14700 Qreplace_buffer_in_windows.
14701 (replace_buffer_in_all_windows): Remove with some functionality
14702 moved into replace_buffer_in_windows_safely.
14703 (replace_buffer_in_windows_safely): New function.
14704 (select_window_norecord, select_frame_norecord): Move in front
14705 of run_window_configuration_change_hook. Remove now obsolete
14706 declarations.
14707 (Fset_window_buffer): Rewrite doc-string.
14708 Call Qrecord_window_buffer.
14709 (keys_of_window): Move binding for other-window to window.el.
14710
14711 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14712
14713 * dispextern.h (struct image): Replace data member, whose int_val
14714 and ptr_val fields were not used by anything, with a single
14715 lisp_val object.
14716
14717 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14718 (gif_clear_image, gif_load, imagemagick_load_image)
14719 (gs_clear_image, gs_load): Callers changed.
14720
14721 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14722
14723 * buffer.h: Include <time.h>, for time_t.
14724 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14725
14726 Fix minor problems found by static checking.
14727
14728 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14729
14730 Make identifiers static if they are not used in other modules.
14731 * data.c (Qcompiled_function, Qframe, Qvector):
14732 * image.c (QimageMagick, Qsvg):
14733 * minibuf.c (Qmetadata):
14734 * window.c (resize_window_check, resize_root_window): Now static.
14735 * window.h (resize_window_check, resize_root_window): Remove decls.
14736
14737 * window.c (window_deletion_count, delete_deletable_window):
14738 Remove; unused.
14739 (window_body_lines): Now static.
14740 (Fdelete_other_windows_internal): Mark vars as initialized.
14741 Make sure 'resize_failed' is initialized.
14742 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14743 (resize_window_apply): Remove unused local.
14744 * window.h (delete_deletable_window): Remove decl.
14745
14746 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14747 (imagemagick_load_image): Fix pointer signedness problem by changing
14748 last arg from unsigned char * to char *. All uses changed.
14749 Also, fix a local for similar reasons.
14750 Remove unused locals. Remove locals to avoid shadowing.
14751 (fn_rsvg_handle_free): Remove; unused.
14752 (svg_load, svg_load_image): Fix pointer signedness problem.
14753 (imagemagick_load_image): Don't use garbage pointer image_wand.
14754
14755 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14756
14757 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
14758
14759 * image.c (gif_load): Fix omitted cast error introduced by
14760 2011-06-06 change.
14761
14762 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14763
14764 * window.h (resize_proportionally, orig_total_lines)
14765 (orig_top_line): Remove from window structure.
14766 (set_window_height, set_window_width, change_window_heights)
14767 (Fdelete_window): Remove prototypes.
14768 (resize_frame_windows): Remove duplicate declaration.
14769
14770 2011-06-10 Eli Zaretskii <eliz@gnu.org>
14771
14772 * window.h (resize_frame_windows, resize_window_check)
14773 (delete_deletable_window, resize_root_window)
14774 (resize_frame_windows): Declare prototypes.
14775
14776 * window.c (resize_window_apply): Make definition be "static" to
14777 match the prototype.
14778
14779 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14780
14781 * window.c: Remove declarations of Qwindow_size_fixed,
14782 window_min_size_1, window_min_size_2, window_min_size,
14783 size_window, window_fixed_size_p, enlarge_window, delete_window.
14784 Remove static from declaration of Qdelete_window, it's
14785 temporarily needed by Fbury_buffer.
14786 (replace_window): Don't assign orig_top_line and
14787 orig_total_lines.
14788 (Fdelete_window, delete_window): Remove. Window deletion is
14789 handled by window.el.
14790 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14791 Replace Fdelete_window calls with calls to Qdelete_window.
14792 (Fdelete_other_windows): Remove. Deleting other windows is
14793 handled by window.el.
14794 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14795 handled in window.el.
14796 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14797 Window minimum sizes are handled in window.el.
14798 (shrink_windows, size_window, set_window_height)
14799 (set_window_width, change_window_heights, window_height)
14800 (window_width, CURBEG, CURSIZE, enlarge_window)
14801 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14802 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14803 handled in window.el.
14804 (make_dummy_parent): Rename to make_parent_window and give it a
14805 second argument horflag.
14806 (make_window): Don't set resize_proportionally any more.
14807 (Fsplit_window): Remove. Windows are split in window.el.
14808 (save_restore_action, save_restore_orig_size)
14809 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14810 Resize mini windows in window.el.
14811 (grow_mini_window, shrink_mini_window): Implement by calling
14812 Qresize_root_window_vertically, resize_window_check and
14813 resize_window_apply.
14814 (saved_window, Fset_window_configuration, save_window_save):
14815 Do not handle orig_top_line, orig_total_lines, and
14816 resize_proportionally.
14817 (window_min_height, window_min_width): Move to window.el.
14818 (keys_of_window): Move bindings for delete-other-windows,
14819 split-window, delete-window and enlarge-window to window.el.
14820
14821 * buffer.c: Temporarily extern Qdelete_window.
14822 (Fbury_buffer): Temporarily call Qdelete_window instead of
14823 Fdelete_window (Fbury_buffer will move to window.el soon).
14824
14825 * frame.c (set_menu_bar_lines_1): Remove code handling
14826 orig_top_line and orig_total_lines.
14827
14828 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14829 set_window_height but set heights directly.
14830 (change_frame_size_1): Use resize_frame_windows.
14831
14832 * xdisp.c (init_xdisp): Don't use set_window_height but set
14833 heights directly.
14834
14835 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14836 Use resize_frame_windows instead of change_window_heights and run
14837 run_window_configuration_change_hook.
14838
14839 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14840 instead of change_window_heights and run
14841 run_window_configuration_change_hook.
14842
14843 2011-06-09 Martin Rudalics <rudalics@gmx.at>
14844
14845 * window.c (replace_window): Rename second argument REPLACEMENT to
14846 NEW. New third argument SETFLAG. Rewrite.
14847 (delete_window, make_dummy_parent): Call replace_window with
14848 third argument 1.
14849 (window_list_1): Move down in code.
14850 (run_window_configuration_change_hook): Move set_buffer part
14851 before select_frame_norecord part in order to unwind correctly.
14852 Rename count1 to count.
14853 (recombine_windows, delete_deletable_window, resize_root_window)
14854 (Fdelete_other_windows_internal)
14855 (Frun_window_configuration_change_hook, make_parent_window)
14856 (resize_window_check, resize_window_apply, Fresize_window_apply)
14857 (resize_frame_windows, Fsplit_window_internal)
14858 (Fdelete_window_internal, Fresize_mini_window_internal):
14859 New functions.
14860 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14861
14862 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14863
14864 * window.h (window): Add some new members to window structure -
14865 normal_lines, normal_cols, new_total, new_normal, clone_number,
14866 splits, nest, prev_buffers, next_buffers.
14867 (WINDOW_TOTAL_SIZE): Move here from window.c.
14868 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14869
14870 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14871 Remove.
14872 (make_dummy_parent): Set new members of windows structure.
14873 (make_window): Move down in code. Handle new members of window
14874 structure.
14875 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14876 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14877 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14878 (Fset_window_prev_buffers, Fwindow_next_buffers)
14879 (Fset_window_next_buffers, Fset_window_clone_number):
14880 New functions.
14881 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14882 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14883 Doc-string fixes.
14884 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14885 Argument WINDOW can be now internal window too.
14886 (Fwindow_use_time): Move up in code.
14887 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14888 Rewrite doc-string.
14889 (Fset_window_configuration, saved_window)
14890 (Fcurrent_window_configuration, save_window_save): Handle new
14891 members of window structure.
14892 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14893 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14894 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14895 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14896 Qget_mru_window, Qresize_root_window,
14897 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14898 Qauto_buffer_name; staticpro them.
14899
14900 2011-06-07 Martin Rudalics <rudalics@gmx.at>
14901
14902 * window.c (Fwindow_total_size, Fwindow_left_column)
14903 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14904 (Fwindow_list_1): New functions.
14905 (window_box_text_cols): Replace with window_body_cols.
14906 (Fwindow_width, Fscroll_left, Fscroll_right):
14907 Use window_body_cols instead of window_box_text_cols.
14908 (delete_window, Fset_window_configuration):
14909 Call delete_all_subwindows with window as argument.
14910 (delete_all_subwindows): Take a window as argument and not a
14911 structure. Rewrite.
14912 (window_loop): Remove handling of GET_LRU_WINDOW and
14913 GET_LARGEST_WINDOW.
14914 (Fget_lru_window, Fget_largest_window): Move to window.el.
14915
14916 * window.h: Extern window_body_cols instead of
14917 window_box_text_cols. delete_all_subwindows now takes a
14918 Lisp_Object as argument.
14919
14920 * indent.c (compute_motion, Fcompute_motion):
14921 Use window_body_cols instead of window_box_text_cols.
14922
14923 * frame.c (delete_frame): Call delete_all_subwindows with root
14924 window as argument.
14925
14926 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14927
14928 * fns.c (Fputhash): Document return value.
14929
14930 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
14931
14932 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14933
14934 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14935
14936 Cons<->int and similar integer overflow fixes (Bug#8794).
14937
14938 Check for overflow when converting integer to cons and back.
14939 * charset.c (Fdefine_charset_internal, Fdecode_char):
14940 Use cons_to_unsigned to catch overflow.
14941 (Fencode_char): Use INTEGER_TO_CONS.
14942 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14943 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14944 * data.c (long_to_cons, cons_to_long): Remove.
14945 (cons_to_unsigned, cons_to_signed): New functions.
14946 These signal an error for invalid or out-of-range values.
14947 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14948 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14949 * font.c (Ffont_variation_glyphs):
14950 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14951 * lisp.h: Include <intprops.h>.
14952 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14953 (cons_to_signed, cons_to_unsigned): New decls.
14954 (long_to_cons, cons_to_long): Remove decls.
14955 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14956 (Fprimitive_undo): Use CONS_TO_INTEGER.
14957 * xfns.c (Fx_window_property): Likewise.
14958 * xselect.c: Include <limits.h>.
14959 (x_own_selection, selection_data_to_lisp_data):
14960 Use INTEGER_TO_CONS.
14961 (x_handle_selection_request, x_handle_selection_clear)
14962 (x_get_foreign_selection, Fx_disown_selection_internal)
14963 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14964 (lisp_data_to_selection_data): Use cons_to_unsigned.
14965 (x_fill_property_data): Use cons_to_signed.
14966 Report values out of range.
14967
14968 Check for buffer and string overflow more precisely.
14969 * buffer.h (BUF_BYTES_MAX): New macro.
14970 * lisp.h (STRING_BYTES_MAX): New macro.
14971 * alloc.c (Fmake_string):
14972 * character.c (string_escape_byte8):
14973 * coding.c (coding_alloc_by_realloc):
14974 * doprnt.c (doprnt):
14975 * editfns.c (Fformat):
14976 * eval.c (verror):
14977 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14978 since they may not be the same number.
14979 * editfns.c (Finsert_char):
14980 * fileio.c (Finsert_file_contents):
14981 Likewise for BUF_BYTES_MAX.
14982
14983 * image.c: Use ptrdiff_t, not int, for sizes.
14984 (slurp_file): Switch from int to ptrdiff_t.
14985 All uses changed.
14986 (slurp_file): Check that file size fits in both size_t (for
14987 malloc) and ptrdiff_t (for sanity and safety).
14988
14989 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14990 if b->modtime has its maximal value.
14991
14992 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14993
14994 Don't assume time_t can fit into int.
14995 * buffer.h (struct buffer.modtime): Now time_t, not int.
14996 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14997 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14998
14999 Minor fixes for signed vs unsigned integers.
15000 * character.h (MAYBE_UNIFY_CHAR):
15001 * charset.c (maybe_unify_char):
15002 * keyboard.c (read_char, reorder_modifiers):
15003 XINT -> XFASTINT, since the integer must be nonnegative.
15004 * ftfont.c (ftfont_spec_pattern):
15005 * keymap.c (access_keymap, silly_event_symbol_error):
15006 XUINT -> XFASTINT, since the integer must be nonnegative.
15007 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15008 since it makes no difference and we prefer signed.
15009 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15010 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15011 nonnegative.
15012
15013 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15014
15015 * window.h (Fwindow_frame): Declare.
15016
15017 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15018
15019 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15020 (SPARE_MEMORY): Always define.
15021 (LARGE_REQUEST): Remove.
15022 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15023
15024 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15025
15026 * lisp.h: Move EXFUNS for Fframe_root_window,
15027 Fframe_first_window and Fset_frame_selected_window to window.h.
15028
15029 * window.h: Move EXFUNS for Fframe_root_window,
15030 Fframe_first_window and Fset_frame_selected_window here from
15031 lisp.h.
15032
15033 * frame.c (Fwindow_frame, Fframe_first_window)
15034 (Fframe_root_window, Fframe_selected_window)
15035 (Fset_frame_selected_window): Move to window.c.
15036 (Factive_minibuffer_window): Move to minibuf.c.
15037 (Fother_visible_frames_p): New function.
15038
15039 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15040
15041 * window.c (decode_window, decode_any_window): Move up in code.
15042 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15043 (inhibit_frame_unsplittable): Remove unused variable.
15044 (Fwindow_buffer): Move up and rewrite doc-string.
15045 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15046 (Fwindow_prev): New functions.
15047 (Fwindow_frame): Move here from frame.c. Accept any window as
15048 argument.
15049 (Fframe_root_window, Fframe_first_window)
15050 (Fframe_selected_window): Move here from frame.c. Accept frame
15051 or arbitrary window as argument. Update doc-strings.
15052 (Fminibuffer_window): Move up in code.
15053 (Fwindow_minibuffer_p): Move up in code and simplify.
15054 (Fset_frame_selected_window): Move here from frame.c.
15055 Marginal rewrite.
15056 (Fselected_window, select_window, Fselect_window): Move up in
15057 code. Minor doc-string fixes.
15058
15059 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15060
15061 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15062 Do not assume that spare memory exists; that assumption is valid
15063 only if SYSTEM_MALLOC.
15064 (LARGE_REQUEST): New macro, so that the issue of large requests
15065 is separated from the issue of spare memory.
15066
15067 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15068
15069 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15070 format. (Bug#8806)
15071
15072 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15073
15074 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15075 before statements.
15076
15077 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15078
15079 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15080
15081 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15082
15083 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15084 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15085
15086 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15087
15088 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15089
15090 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15091
15092 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15093 (x_clipboard_manager_save): Add return value.
15094 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15095 New error handlers.
15096 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15097 Obey Vx_select_enable_clipboard_manager. Catch errors in
15098 x_clipboard_manager_save (Bug#8779).
15099 (Vx_select_enable_clipboard_manager): New variable.
15100 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15101
15102 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15103
15104 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15105
15106 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15107
15108 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15109 in the current matrix if keep_current_p is non-zero.
15110
15111 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15112
15113 * bidi.c (bidi_level_of_next_char): Fix last change.
15114
15115 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15116
15117 Support bidi reordering of text covered by display properties.
15118
15119 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15120 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15121 (bidi_cache_search, bidi_cache_iterator_state)
15122 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15123 (bidi_level_of_next_char, bidi_move_to_visually_next):
15124 Support character positions inside a run of characters covered by a
15125 display string.
15126 (bidi_paragraph_init, bidi_resolve_explicit_1)
15127 (bidi_level_of_next_char): Call bidi_fetch_char and
15128 bidi_fetch_char_advance instead of FETCH_CHAR and
15129 FETCH_CHAR_ADVANCE.
15130 (bidi_init_it): Initialize new members.
15131 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15132 definitions.
15133 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15134 instead of using explicit *_CHAR codes.
15135 (bidi_resolve_explicit, bidi_resolve_weak):
15136 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15137 bidirectional text is supported only in multibyte buffers.
15138 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15139 it to initialize the frame_window_p member of struct bidi_it.
15140 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15141 (bidi_resolve_explicit, bidi_resolve_weak)
15142 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15143 bidi_it->nchars is non-positive.
15144 (bidi_level_of_next_char): Don't try to lookup the cache for the
15145 next/previous character if nothing is cached there yet, or if we
15146 were just reseat()'ed to a new position.
15147
15148 * xdisp.c (set_cursor_from_row): Set start and stop points
15149 according to the row's direction when priming the loop that looks
15150 for the glyph on which to display cursor.
15151 (single_display_spec_intangible_p): Function deleted.
15152 (display_prop_intangible_p): Reimplement to call
15153 handle_display_spec instead of single_display_spec_intangible_p.
15154 Accept 3 additional arguments needed by handle_display_spec.
15155 This fixes incorrect cursor motion across display property with complex
15156 values: lists, `(when COND...)' forms, etc.
15157 (single_display_spec_string_p): Support property values that are
15158 lists with the argument STRING its top-level element.
15159 (display_prop_string_p): Fix the condition for processing a
15160 property that is a list to be consistent with handle_display_spec.
15161 (handle_display_spec): New function, refactored from the
15162 last portion of handle_display_prop.
15163 (compute_display_string_pos): Accept additional argument
15164 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15165 value of a `display' property is a "replacing spec".
15166 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15167 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15168 the display property, but just return a value indicating whether
15169 the display property will replace the characters it covers.
15170 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15171 frame_window_p members of struct bidi_it.
15172 (compute_display_string_pos, compute_display_string_end):
15173 New functions.
15174 (push_it): Accept second argument POSITION, where pop_it should
15175 jump to continue iteration.
15176 (reseat_1): Initialize bidi_it.disp_pos.
15177
15178 * keyboard.c (adjust_point_for_property): Adjust the call to
15179 display_prop_intangible_p to its new signature.
15180
15181 * dispextern.h (struct bidi_it): New member frame_window_p.
15182 (bidi_init_it): Update prototypes.
15183 (display_prop_intangible_p): Update prototype.
15184 (compute_display_string_pos, compute_display_string_end):
15185 Declare prototypes.
15186 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15187 EMACS_INT.
15188
15189 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15190
15191 Malloc failure behavior now depends on size of allocation.
15192 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15193 * lisp.h: Change signatures accordingly.
15194 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15195 All callers changed. (Bug#8762)
15196
15197 * gnutls.c: Use Emacs's memory allocators.
15198 Without this change, the gnutls library would invoke malloc etc.
15199 directly, which causes problems on non-SYNC_INPUT hosts, and which
15200 runs afoul of improving memory_full behavior. (Bug#8761)
15201 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15202 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15203 xfree instead of the default malloc, realloc, free.
15204 (Fgnutls_boot): No need to check for memory allocation failure,
15205 since xmalloc does that for us.
15206
15207 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15208 * category.c (hash_get_category_set):
15209 * ccl.c (ccl_driver):
15210 * charset.c (Fdefine_charset_internal):
15211 * charset.h (struct charset.hash_index):
15212 * composite.c (get_composition_id, gstring_lookup_cache)
15213 (composition_gstring_put_cache):
15214 * composite.h (struct composition.hash_index):
15215 * dispextern.h (struct image.hash):
15216 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15217 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15218 (hashfn_equal, hashfn_user_defined, make_hash_table)
15219 (maybe_resize_hash_table, hash_lookup, hash_put)
15220 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15221 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15222 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15223 * image.c (make_image, search_image_cache, lookup_image)
15224 (xpm_put_color_table_h):
15225 * lisp.h (struct Lisp_Hash_Table):
15226 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15227 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15228 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15229 * alloc.c (allocate_vectorlike):
15230 Check for overflow in vector size calculations.
15231 * ccl.c (ccl_driver):
15232 Check for overflow when converting EMACS_INT to int.
15233 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15234 need to be updated by these changes.
15235 * fns.c (make_hash_table, maybe_resize_hash_table):
15236 Check for integer overflow with large hash tables.
15237 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15238 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15239 (SXHASH_REDUCE): New macro.
15240 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15241 Use it instead of discarding useful hash info with large hash values.
15242 (sxhash_float): New function.
15243 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15244 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15245 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15246 Rewrite to use FIXNUM_BITS, as this simplifies things.
15247 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15248 Adjust signatures to match updated version of code.
15249 (consing_since_gc): Now EMACS_INT, since a single hash table can
15250 use more than INT_MAX bytes.
15251
15252 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15253
15254 Make it possible to build with GCC-4.6+ -O2 -flto.
15255
15256 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15257
15258 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15259
15260 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15261 Call minibuffer-inactive-mode.
15262
15263 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15264
15265 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15266 Update dependencies.
15267
15268 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15269
15270 * data.c (init_data): Remove code for UTS, this system is not
15271 supported anymore.
15272
15273 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15274
15275 Don't force ./temacs to start in terminal mode.
15276
15277 * frame.c (make_initial_frame): Initialize faces in all cases, not
15278 only when CANNOT_DUMP is defined.
15279 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15280
15281 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15282
15283 * dispnew.c (add_window_display_history): Use const for the string
15284 pointer. Remove declaration, not needed.
15285
15286 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15287
15288 Use 'inline', not 'INLINE'.
15289 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15290 * alloc.c, fontset.c (INLINE): Remove.
15291 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15292 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15293 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15294 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15295 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15296
15297 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15298
15299 Make it possible to run ./temacs.
15300
15301 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15302 syms_of_callproc does the same thing. Remove test for
15303 "initialized", do it in the caller.
15304 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15305
15306 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15307
15308 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15309 (read_minibuf): Use get_minibuffer.
15310 (syms_of_minibuf): Use DEFSYM.
15311 (Qmetadata): New var.
15312 * data.c (Qbuffer): Don't make it static.
15313 (syms_of_data): Use DEFSYM.
15314
15315 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15316
15317 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15318 (CCL_CODE_MIN): New macro.
15319
15320 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15321
15322 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15323
15324 * eval.c (Qdebug): Now static.
15325 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15326 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15327 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15328
15329 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15330
15331 * image.c: Various fixes to ImageMagick code comments.
15332 (Fimagemagick_types): Doc fix.
15333
15334 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15335
15336 Minor fixes prompted by GCC 4.6.0 warnings.
15337
15338 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15339
15340 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15341 (x_clipboard_manager_save_all): Move extern decl to ...
15342 * xterm.h: ... here, so that it can be checked for consistency.
15343
15344 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15345
15346 * xselect.c (x_clipboard_manager_save_frame)
15347 (x_clipboard_manager_save_all): New functions.
15348 (Fx_clipboard_manager_save): Lisp function deleted.
15349
15350 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15351 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15352
15353 * xterm.h: Update prototype.
15354
15355 2011-05-28 William Xu <william.xwl@gmail.com>
15356
15357 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15358 exiting (Bug#8239).
15359
15360 2011-05-28 Jim Meyering <meyering@redhat.com>
15361
15362 Avoid a sign-extension bug in crypto_hash_function.
15363 * fns.c (to_uchar): Define.
15364 (crypto_hash_function): Use it to convert some newly-signed
15365 variables to unsigned, to avoid sign-extension bugs. For example,
15366 without this change, (md5 "truc") would evaluate to
15367 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15368 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15369 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15370
15371 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15372
15373 Integer overflow fixes.
15374
15375 * dbusbind.c: Serial number integer overflow fixes.
15376 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15377 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15378 to hold a serial number that is too large for a fixnum.
15379 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15380 Check for serial numbers out of range. Decode any serial number
15381 that was so large that it became a float. (Bug#8722)
15382
15383 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15384 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15385 Use XFASTINT rather than XUINT when numbers are nonnegative.
15386 (xd_append_arg, Fdbus_method_return_internal):
15387 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15388 arguments, check that Lisp number is nonnegative, rather than
15389 silently wrapping negative numbers around. (Bug#8722)
15390 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15391 (Bug#8722)
15392
15393 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15394
15395 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15396
15397 ccl: Add integer overflow checks.
15398 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15399 (IN_INT_RANGE): New macros.
15400 (ccl_driver): Use them to check for integer overflow when
15401 decoding a CCL program. Many of the new checks are whether XINT (x)
15402 fits in int; it doesn't always, on 64-bit hosts. The new version
15403 doesn't catch all possible integer overflows, but it's an
15404 improvement. (Bug#8719)
15405
15406 * alloc.c (make_event_array): Use XINT, not XUINT.
15407 There's no need for unsigned here.
15408
15409 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15410 This follows up to the 2011-05-06 change that substituted uintptr_t
15411 for EMACS_INT. This case wasn't caught back then.
15412
15413 Rework Fformat to avoid integer overflow issues.
15414 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15415 now (part of C89). Include <verify.h>.
15416 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15417 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15418 (Fformat): Avoid the prepass trying to compute sizes; it was only
15419 approximate and thus did not catch overflow reliably. Instead, walk
15420 through the format just once, formatting and computing sizes as we go,
15421 checking for integer overflow at every step, and allocating a larger
15422 buffer as needed. Keep track separately whether the format is
15423 multibyte. Keep only the most-recently calculated precision, rather
15424 than them all. Record whether each argument has been converted to
15425 string. Use EMACS_INT, not int, for byte and char and arg counts.
15426 Support field widths and precisions larger than INT_MAX. Avoid
15427 sprintf's undefined behavior with conversion specifications such as %#d
15428 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15429 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15430 formatting out-of-range floating point numbers with int
15431 formats. (Bug#8668)
15432
15433 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15434
15435 * data.c: Avoid integer truncation in expressions involving floats.
15436 * data.c: Include <intprops.h>.
15437 (arith_driver): When there's an integer overflow in an expression
15438 involving floating point, convert the integers to floating point
15439 so that the resulting value does not suffer from catastrophic
15440 integer truncation. For example, on a 64-bit host (* 4
15441 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15442 Do not rely on undefined behavior after integer overflow.
15443
15444 merge count_size_as_multibyte, parse_str_to_multibyte
15445 * character.c, character.h (count_size_as_multibyte):
15446 Rename from parse_str_to_multibyte; all uses changed.
15447 Check for integer overflow.
15448 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15449 since it's now a duplicate of the other. This is more of
15450 a character than a buffer op, so better that it's in character.c.
15451 * fns.c, print.c: Adjust to above changes.
15452
15453 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15454
15455 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15456
15457 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15458
15459 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15460 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15461 (x_clipboard_manager_save): Now static.
15462 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15463
15464 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15465 (crypto_hash_function): Now static.
15466 Fix pointer signedness problems. Avoid unnecessary initializations.
15467
15468 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15469
15470 * termhooks.h (Vselection_alist): Make it terminal-local.
15471
15472 * terminal.c (create_terminal): Initialize it.
15473
15474 * xselect.c: Support for clipboard managers.
15475 (Vselection_alist): Move to termhooks.h as terminal-local var.
15476 (LOCAL_SELECTION): New macro.
15477 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15478 (symbol_to_x_atom): Remove gratuitous arg.
15479 (x_handle_selection_request, lisp_data_to_selection_data)
15480 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15481 (x_own_selection, x_get_local_selection, x_convert_selection):
15482 New arg, specifying work frame. Use terminal-local Vselection_alist.
15483 (some_frame_on_display): Delete unused function.
15484 (Fx_own_selection_internal, Fx_get_selection_internal)
15485 (Fx_disown_selection_internal, Fx_selection_owner_p)
15486 (Fx_selection_exists_p): New optional frame arg.
15487 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15488 (x_handle_selection_clear): Don't treat other terminals with the
15489 same keyboard specially. Use the terminal-local Vselection_alist.
15490 (x_clear_frame_selections): Use Frun_hook_with_args.
15491
15492 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15493
15494 * xterm.h: Add support for those atoms.
15495
15496 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
15497
15498 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15499 (converted_selections, conversion_fail_tag): New global variables.
15500 (x_selection_request_lisp_error): Free the above.
15501 (x_get_local_selection): Remove unnecessary code.
15502 (x_reply_selection_request): Args changed; handle arbitrary array
15503 of converted selections stored in converted_selections.
15504 Separate the XChangeProperty and SelectionNotify steps.
15505 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15506 (x_convert_selection): New function.
15507 (x_handle_selection_event): Simplify.
15508 (x_get_foreign_selection): Don't ignore incoming requests while
15509 waiting for an answer; this will fail when we implement
15510 SAVE_TARGETS, and seems unnecessary anyway.
15511 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15512 (Vx_sent_selection_functions): Doc fix.
15513
15514 2011-05-26 Leo Liu <sdl.web@gmail.com>
15515
15516 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15517
15518 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15519
15520 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15521
15522 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15523 for fringe update if it has periodic bitmap.
15524 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15525 and fringe_bitmap_periodic_p.
15526
15527 * fringe.c (get_fringe_bitmap_data): New function.
15528 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15529 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15530 row. Mark glyph row for fringe update if periodicity changed.
15531
15532 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15533 for fringe update unless it has periodic bitmap.
15534
15535 2011-05-25 Kenichi Handa <handa@m17n.org>
15536
15537 * xdisp.c (get_next_display_element): Set correct it->face_id for
15538 a static composition.
15539
15540 2011-05-24 Leo Liu <sdl.web@gmail.com>
15541
15542 * deps.mk (fns.o):
15543 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15544
15545 * fns.c (crypto_hash_function, Fsha1): New function.
15546 (Fmd5): Use crypto_hash_function.
15547 (syms_of_fns): Add Ssha1.
15548
15549 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15550
15551 * gnutls.c: Remove unused macros.
15552 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15553 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15554 Remove macros that are defined and never used.
15555 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15556
15557 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15558
15559 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15560 (Fx_get_selection_internal): Minor cleanup.
15561 (Fx_own_selection_internal): Rename arguments for consistency with
15562 select.el.
15563
15564 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15565
15566 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15567
15568 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15569
15570 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15571
15572 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15573
15574 * dispnew.c (scrolling_window): Don't exclude the case that the
15575 last enabled row in the desired matrix touches the bottom boundary.
15576
15577 2011-05-21 Glenn Morris <rgm@gnu.org>
15578
15579 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15580 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15581 and add some more files.
15582
15583 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15584
15585 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15586 report_file_error introduced by the change from 2011-05-07.
15587
15588 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15589
15590 * systime.h (Time): Define only if emacs is defined.
15591 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15592 where the include path doesn't have X11/X.h by default. See
15593 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15594
15595 2011-05-20 Kenichi Handa <handa@m17n.org>
15596
15597 * composite.c (find_automatic_composition): Fix previous change.
15598
15599 2011-05-20 Glenn Morris <rgm@gnu.org>
15600
15601 * lisp.mk: New file, split from Makefile.in.
15602 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15603 (shortlisp): Remove.
15604 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15605
15606 2011-05-19 Glenn Morris <rgm@gnu.org>
15607
15608 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15609 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15610 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15611 (lisp): Set the order to that of loadup.el.
15612 (shortlisp): Make it a copy of $lisp.
15613 (SOME_MACHINE_LISP): Remove.
15614 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15615 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15616
15617 2011-05-18 Kenichi Handa <handa@m17n.org>
15618
15619 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15620 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15621 (find_automatic_composition): Mostly rewrite for efficiency.
15622
15623 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
15624
15625 * makefile.w32-in: Update dependencies.
15626
15627 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15628
15629 * menu.c: Include limits.h (fixes the MS-Windows build broken by
15630 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15631
15632 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
15633
15634 Fix some integer overflow issues, such as string length overflow.
15635
15636 * insdel.c (count_size_as_multibyte): Check for string overflow.
15637
15638 * character.c (lisp_string_width): Check for string overflow.
15639 Use EMACS_INT, not int, for string indexes and lengths; in
15640 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15641 the resulting string length overflows an EMACS_INT; instead,
15642 report a string overflow if no precision given. When checking for
15643 precision exhaustion, use a check that cannot possibly have
15644 integer overflow. (Bug#8675)
15645 * character.h (lisp_string_width): Adjust to new signature.
15646
15647 * alloc.c (string_overflow): New function.
15648 (Fmake_string): Use it. This doesn't change behavior, but saves
15649 a few bytes and will simplify future changes.
15650 * character.c (string_escape_byte8): Likewise.
15651 * lisp.h (string_overflow): New decl.
15652
15653 Fixups, following up to the user-interface timestamp change.
15654 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15655 for UI timestamps, instead of unsigned long.
15656 * msdos.c (mouse_get_pos): Likewise.
15657 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15658 * w32gui.h (Time): Define by including "systime.h" rather than by
15659 declaring it ourselves. (Bug#8664)
15660
15661 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15662 * image.c (clear_image_cache): Likewise.
15663
15664 * term.c (term_mouse_position): Don't assume time_t wraparound.
15665
15666 Be more systematic about user-interface timestamps.
15667 Before, the code sometimes used 'Time', sometimes 'unsigned long',
15668 and sometimes 'EMACS_UINT', to represent these timestamps.
15669 This change causes it to use 'Time' uniformly, as that's what X uses.
15670 This makes the code easier to follow, and makes it easier to catch
15671 integer overflow bugs such as Bug#8664.
15672 * frame.c (Fmouse_position, Fmouse_pixel_position):
15673 Use Time, not unsigned long, for user-interface timestamps.
15674 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15675 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15676 * keyboard.h (last_event_timestamp): Likewise.
15677 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15678 * menu.h (xmenu_show): Likewise.
15679 * term.c (term_mouse_position): Likewise.
15680 * termhooks.h (struct input_event.timestamp): Likewise.
15681 (struct terminal.mouse_position_hook): Likewise.
15682 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15683 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15684 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15685 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15686 what it was before.
15687 * menu.h, termhooks.h: Include "systime.h", for Time.
15688
15689 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15690 Don't assume that the difference between two unsigned long values
15691 can fit into an integer. At this point, we know button_down_time
15692 <= event->timestamp, so the difference must be nonnegative, so
15693 there's no need to cast the result if double-click-time is
15694 nonnegative, as it should be; check that it's nonnegative, just in
15695 case. This bug is triggered when events are more than 2**31 ms
15696 apart (about 25 days). (Bug#8664)
15697
15698 * xselect.c (last_event_timestamp): Remove duplicate decl.
15699 (x_own_selection): Remove needless cast to unsigned long.
15700
15701 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15702 that always fit in int. Use a sentinel instead of a counter, to
15703 avoid a temp and to allay GCC's concerns about possible int overflow.
15704 * frame.h (struct frame): Use int for menu_bar_items_used
15705 instead of EMACS_INT, since it always fits in int.
15706
15707 * menu.c (grow_menu_items): Check for int overflow.
15708
15709 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15710
15711 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15712 Before, the code was not consistent. These values cannot exceed
15713 2**31 - 1 so there's no need to make them unsigned.
15714 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15715 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15716 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15717 as modifiers.
15718 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15719
15720 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15721 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15722 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15723 presumably because the widths might not match.
15724
15725 * window.c (size_window): Avoid needless test at loop start.
15726
15727 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15728
15729 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15730
15731 2011-05-12 Drew Adams <drew.adams@oracle.com>
15732
15733 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15734
15735 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15736
15737 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15738 `width' to `bar_area_x' and `bar_area_width', respectively.
15739 (x_scroll_run): Take account of fringe background extension.
15740
15741 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15742 Rename local vars `left' and `width' to `bar_area_x' and
15743 `bar_area_width', respectively.
15744 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15745 background extension.
15746
15747 2011-05-10 Jim Meyering <meyering@redhat.com>
15748
15749 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15750
15751 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
15752
15753 * image.c (Finit_image_library): Return t for built-in image types,
15754 like pbm and xbm. (Bug#8640)
15755
15756 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15757
15758 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15759
15760 2011-05-07 Eli Zaretskii <eliz@gnu.org>
15761
15762 * w32console.c (Fset_screen_color): Doc fix.
15763 (Fget_screen_color): New function.
15764 (syms_of_ntterm): Defsubr it.
15765
15766 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15767 unlink the temporary file if Fcall_process didn't create it in the
15768 first place.
15769 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15770 child process will be redirected to a file specified with `:file'.
15771 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15772 cue to call_process_cleanup not to close that handle.
15773
15774 2011-05-07 Ben Key <bkey76@gmail.com>
15775
15776 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15777 one of two shell specific rules, either bootstrap-temacs-CMD or
15778 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15779 to the previous implementation of the bootstrap-temacs rule.
15780 The bootstrap-temacs-CMD rule is similar to the previous
15781 implementation of the bootstrap-temacs rule except that it
15782 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15783 variable.
15784
15785 These changes, along with some changes to nt/configure.bat,
15786 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15787 earlier fix to add support for --cflags and --ldflags options
15788 that include quotes so that it works whether make uses cmd or
15789 sh as the shell.
15790
15791 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
15792
15793 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15794 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15795 is a constant.
15796 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15797 a string. Handle both cases.
15798 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15799 (Fdbus_register_method): Use Qinvalid_function.
15800
15801 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15802
15803 * makefile.w32-in: Update dependencies.
15804 (LISP_H): Add inttypes.h and stdin.h.
15805 (PROCESS_H): Add unistd.h.
15806
15807 2011-05-06 Eli Zaretskii <eliz@gnu.org>
15808
15809 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15810 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15811
15812 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
15813
15814 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15815
15816 * term.c (vfatal): Remove stray call to va_end.
15817 It's not needed and the C Standard doesn't allow it here anyway.
15818
15819 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15820 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15821
15822 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15823 bytes.
15824
15825 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15826
15827 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15828
15829 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15830
15831 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15832
15833 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15834
15835 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15836 * charset.c (Fdefine_charset_internal): Don't initialize
15837 charset.code_space[15]. The value was garbage, on hosts with
15838 32-bit int (Bug#8600).
15839
15840 * lread.c (read_integer): Be more consistent with string-to-number.
15841 Use string_to_number to do the actual conversion; this avoids
15842 rounding errors and fixes some other screwups. Without this fix,
15843 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15844 (digit_to_number): Move earlier, for benefit of read_integer.
15845 Return -1 if the digit is out of range for the base, -2 if it is
15846 not a digit in any supported base. (Bug#8602)
15847
15848 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15849
15850 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15851 to match comment at start of function. This also removes a
15852 GCC warning about overflow in a 32+64-bit port.
15853
15854 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15855
15856 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15857 Reported by Stefan Monnier in
15858 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15859 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15860 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15861
15862 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15863 (EMACS_UINTPTR): Likewise, with uintptr_t.
15864
15865 * lisp.h: Prefer 64-bit EMACS_INT if available.
15866 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15867 on 32-bit hosts that have 64-bit int, so that they can access
15868 large files.
15869 However, temporarily disable this change unless the temporary
15870 symbol WIDE_EMACS_INT is defined.
15871
15872 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15873
15874 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15875 This removes an assumption that EMACS_INT and long are the same
15876 width as pointers. The assumption is true for Emacs porting targets
15877 now, but we want to make other targets possible.
15878 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15879 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15880 In the rest of the code, change types of integers that hold casted
15881 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15882 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15883 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15884 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15885 No need to cast type when ORing.
15886 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15887 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15888 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15889 assume EMACS_INT is the same width as char *.
15890 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15891 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15892 Remove no-longer-needed casts.
15893 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15894 (xg_tool_bar_help_callback, xg_make_tool_item):
15895 Use EMACS_INTPTR to hold an integer
15896 that will be cast to void *; this can avoid a GCC warning
15897 if EMACS_INT is not the same width as void *.
15898 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15899 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15900 (current_message_1, set_message_1):
15901 Use a local to convert to proper width without a cast.
15902 * xmenu.c (dialog_selection_callback): Likewise.
15903
15904 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15905 Also, don't assume VALBITS / RAND_BITS is less than 5,
15906 and don't rely on undefined behavior when shifting a 1 left into
15907 the sign bit.
15908 * lisp.h (get_random): Change signature to match.
15909
15910 * lread.c (hash_string): Use size_t, not int, for hash computation.
15911 Normally we prefer signed values; but hashing is special, because
15912 it's better to use unsigned division on hash table sizes so that
15913 the remainder is nonnegative. Also, size_t is the natural width
15914 for hashing into memory. The previous code used 'int', which doesn't
15915 retain enough info to hash well into very large tables.
15916 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15917
15918 * dbusbind.c: Don't possibly lose pointer info when converting.
15919 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15920 Use XPNTR rather than XHASH, so that the high-order bits of
15921 the pointer aren't lost when converting through void *.
15922
15923 * eval.c (Fautoload): Don't double-shift a pointer.
15924
15925 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15926
15927 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15928
15929 * gnutls.c (DEF_GNUTLS_FN):
15930 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15931
15932 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15933
15934 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15935 marker. (Bug#8610)
15936
15937 2011-05-05 Eli Zaretskii <eliz@gnu.org>
15938
15939 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15940 New version that can reserve upto 2GB of heap space.
15941
15942 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
15943
15944 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15945
15946 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15947
15948 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15949 `gnutls_certificate_set_x509_key_file'.
15950
15951 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
15952
15953 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15954 Update dependencies.
15955
15956 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15957
15958 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15959 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15960 Remove unused parameter `fildes'.
15961 * process.c (read_process_output, send_process): Don't pass it.
15962
15963 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15964
15965 Fix previous change: the library cache is defined in w32.c.
15966 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15967 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15968
15969 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15970
15971 Implement dynamic loading of GnuTLS on Windows.
15972
15973 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15974 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15975 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15976 Declare.
15977
15978 * gnutls.c (Qgnutls_dll): Define.
15979 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15980 (gnutls_*): Declare function pointers.
15981 (init_gnutls_functions): New function to initialize function pointers.
15982 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15983 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15984 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15985 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15986 (emacs_gnutls_write, emacs_gnutls_read)
15987 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15988 (Fgnutls_available_p): New function.
15989 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15990 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15991 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15992
15993 * image.c: Include w32.h.
15994 (Vimage_type_cache): Delete.
15995 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15996 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15997 (w32_delayed_load): Move to w32.c.
15998
15999 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16000
16001 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16002 (w32_delayed_load): Move from image.c. When loading a library, record
16003 its filename in the :loaded-from property of the library id.
16004 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16005 Initialize and staticpro them.
16006 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16007
16008 * process.c: Include lisp.h before w32.h, not after.
16009 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16010 instead of gnutls_record_check_pending.
16011
16012 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16013
16014 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16015
16016 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16017 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16018 as passed in.
16019
16020 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16021
16022 * xterm.c (x_set_frame_alpha): Do not set property on anything
16023 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16024
16025 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16026
16027 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16028
16029 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16030
16031 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16032 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16033 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16034 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16035 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16036 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16037 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16038 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16039 (Qgnutls_bootprop_callbacks_verify): Make static.
16040
16041 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16042
16043 * callproc.c: Indentation fixup.
16044
16045 * sysdep.c (wait_for_termination_1): Make static.
16046 (wait_for_termination, interruptible_wait_for_termination):
16047 Move after wait_for_termination_1.
16048
16049 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16050
16051 * sysdep.c (interruptible_wait_for_termination): New function
16052 which is like wait_for_termination, but allows keyboard
16053 interruptions.
16054
16055 * callproc.c (Fcall_process): Add (:file "file") as an option for
16056 the STDOUT buffer.
16057 (Fcall_process_region): Ditto.
16058
16059 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16060
16061 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16062 rather than `XVECTOR (FOO)->size'.
16063
16064 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16065 inttypes.h, as a gnulib replacement is used if it not available in
16066 system headers.
16067
16068 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16069
16070 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16071 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16072 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16073
16074 * coding.c (coding_alloc_by_realloc): Error out if destination
16075 will grow beyond MOST_POSITIVE_FIXNUM.
16076 (decode_coding_emacs_mule): Abort if there isn't enough place in
16077 charbuf for the composition carryover bytes. Reserve an extra
16078 space for up to 2 characters produced in a loop.
16079 (decode_coding_iso_2022): Abort if there isn't enough place in
16080 charbuf for the composition carryover bytes.
16081
16082 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16083
16084 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16085 aborting when %lld or %lll format is passed.
16086 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16087 %llo or %llx format is passed. (Bug#8545)
16088
16089 * window.c (window_scroll_line_based): Use a marker instead of
16090 simple variables to record original value of point. (Bug#7952)
16091
16092 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16093 produced by %s or %c overflows available buffer space. (Bug#8545)
16094
16095 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16096
16097 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16098 (SIZE_MAX): Move defn after all includes, as they might #define it.
16099
16100 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16101
16102 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16103
16104 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16105
16106 * keyboard.c (Qdelayed_warnings_hook): Define.
16107 (command_loop_1): Run `delayed-warnings-hook'
16108 if Vdelayed_warnings_list is non-nil.
16109 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16110 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16111
16112 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16113
16114 * doprnt.c (doprnt): Don't return value smaller than the buffer
16115 size if the message was truncated. (Bug#8545).
16116
16117 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16118
16119 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16120 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16121
16122 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16123
16124 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16125
16126 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16127
16128 * makefile.w32-in: Update dependencies.
16129
16130 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16131
16132 Improve `doprnt' and its usage. (Bug#8545)
16133 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16134 `format_end'. Remove support for %l as a conversion specifier.
16135 Don't use xrealloc. Improve diagnostics when the %l size modifier
16136 is used. Update the commentary.
16137
16138 * eval.c (verror): Simplify calculation of size_t.
16139
16140 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16141 messages.
16142
16143 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16144
16145 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16146 change.
16147
16148 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16149
16150 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16151 This makes this file independent of the recent pseudovector change.
16152
16153 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16154
16155 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16156
16157 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16158 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16159 Remove unused local.
16160 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16161
16162 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16163 GCC 4.6.0 optimizes based on type-based alias analysis.
16164 For example, if b is of type struct buffer * and v of type struct
16165 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16166 != &v->size, and therefore "v->size = 1; b->size = 2; return
16167 v->size;" must therefore return 1. This assumption is incorrect
16168 for Emacs, since it type-puns struct Lisp_Vector * with many other
16169 types. To fix this problem, this patch adds a new type struct
16170 vectorlike_header that documents the constraints on layout of vectors
16171 and pseudovectors, and helps optimizing compilers not get fooled
16172 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16173 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16174 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16175 the size member.
16176 (XSETPVECTYPE): Rewrite in terms of new macro.
16177 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16178 This is a bit clearer, and further avoids the possibility of
16179 undesirable aliasing.
16180 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16181 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16182 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16183 since Lisp_Subr is a special case (no "next" field).
16184 (ASIZE): Now uses header.size rather than size.
16185 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16186 to avoid the hassle of writing XVECTOR (foo)->header.size.
16187 (struct vectorlike_header): New type.
16188 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16189 object, to help avoid aliasing.
16190 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16191 (SUBRP): Likewise, since Lisp_Subr is a special case.
16192 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16193 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16194 (struct Lisp_Hash_Table): Combine first two members into a single
16195 struct vectorlike_header member. All uses of "size" and "next" members
16196 changed to be "header.size" and "header.next".
16197 * buffer.h (struct buffer): Likewise.
16198 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16199 * frame.h (struct frame): Likewise.
16200 * process.h (struct Lisp_Process): Likewise.
16201 * termhooks.h (struct terminal): Likewise.
16202 * window.c (struct save_window_data, struct saved_window): Likewise.
16203 * window.h (struct window): Likewise.
16204 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16205 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16206 * buffer.c (init_buffer_once): Likewise.
16207 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16208 special case.
16209 * process.c (Fformat_network_address): Use local var for size,
16210 for brevity.
16211
16212 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16213
16214 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16215 * data.c (atof): Remove decl; no longer used or needed.
16216 (digit_to_number): Move to lread.c.
16217 (Fstring_to_number): Use new string_to_number function, to be
16218 consistent with how the Lisp reader treats infinities and NaNs.
16219 Do not assume that floating-point numbers represent EMACS_INT
16220 without losing information; this is not true on most 64-bit hosts.
16221 Avoid double-rounding errors, by insisting on integers when
16222 parsing non-base-10 numbers, as the documentation specifies.
16223 * lisp.h (string_to_number): New decl, replacing ...
16224 (isfloat_string): Remove.
16225 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16226 (read1): Do not accept +. and -. as integers; this
16227 appears to have been a coding error. Similarly, do not accept
16228 strings like +-1e0 as floating point numbers. Do not report
16229 overflow for integer overflows unless the base is not 10 which
16230 means we have no simple and reliable way to continue.
16231 Break out the floating-point parsing into a new
16232 function string_to_number, so that Fstring_to_number parses
16233 floating point numbers consistently with the Lisp reader.
16234 (digit_to_number): Move here from data.c. Make it static inline.
16235 (E_CHAR, EXP_INT): Remove, replacing with ...
16236 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16237 (string_to_number): New function, replacing isfloat_string.
16238 This function checks for valid syntax and produces the resulting
16239 Lisp float number too. Rework it so that string-to-number
16240 no longer mishandles examples like "1.0e+". Use strtoumax,
16241 so that overflow for non-base-10 numbers is reported only when
16242 there's no portable and simple way to convert to floating point.
16243
16244 * textprop.c (set_text_properties_1): Rewrite for clarity,
16245 and to avoid GCC warning about integer overflow.
16246
16247 * intervals.h (struct interval): Use EMACS_INT for members
16248 where EMACS_UINT might cause problems. See
16249 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16250 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16251 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16252 All uses changed.
16253 (offset_intervals): Tell GCC not to worry about length overflow
16254 when negating a negative length.
16255
16256 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16257 (overrun_check_free): Likewise.
16258
16259 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16260 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16261 word size.
16262
16263 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16264 (gnutls_make_error): Rename local to avoid shadowing.
16265 (gnutls_emacs_global_deinit): ifdef out; not used.
16266 (Fgnutls_boot): Use const for pointer to readonly storage.
16267 Comment out unused local. Fix pointer signedness problems.
16268
16269 * lread.c (openp): Don't stuff size_t into an 'int'.
16270 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16271 about possible signed overflow.
16272
16273 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16274 (GDK_KEY_g): Don't define if already defined.
16275 (xg_prepare_tooltip): Avoid pointer signedness problem.
16276 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16277
16278 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16279 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16280
16281 * xfns.c (Fx_window_property): Simplify a bit,
16282 to make a bit faster and to avoid GCC 4.6.0 warning.
16283 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16284
16285 * fns.c (internal_equal): Don't assume size_t fits in int.
16286
16287 * alloc.c (compact_small_strings): Tighten assertion a little.
16288
16289 Replace pEd with more-general pI, and fix some printf arg casts.
16290 * lisp.h (pI): New macro, generalizing old pEd macro to other
16291 conversion specifiers. For example, use "...%"pI"d..." rather
16292 than "...%"pEd"...".
16293 (pEd): Remove. All uses replaced with similar uses of pI.
16294 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16295 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16296 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16297 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16298 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16299 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16300 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16301 64-bit hosts.
16302 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16303 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16304 * print.c (safe_debug_print, print_object): Likewise.
16305 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16306 to int.
16307 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16308 avoiding the 0 flag, which is not portable.
16309 * process.c (Fmake_network_process): Use pI to avoid cast.
16310 * region-cache.c (pp_cache): Likewise.
16311 * xdisp.c (decode_mode_spec): Likewise.
16312 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16313 behavior on 64-bit hosts with printf arg.
16314 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16315 (x_stop_queuing_selection_requests): Likewise.
16316 (x_get_window_property): Don't truncate byte count to an 'int'
16317 when tracing.
16318
16319 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16320 here, since it parses constructs like leading '-' and spaces,
16321 which are not wanted; and it overflows with large numbers.
16322 Instead, simply match F[0-9]+, which is what is wanted anyway.
16323
16324 * alloc.c: Remove unportable assumptions about struct layout.
16325 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16326 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16327 (allocate_vectorlike, make_pure_vector): Use the new macros,
16328 plus offsetof, to remove unportable assumptions about struct layout.
16329 These assumptions hold on all porting targets that I know of, but
16330 they are not guaranteed, they're easy to remove, and removing them
16331 makes further changes easier.
16332
16333 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16334 This doesn't fix a bug but makes the code clearer.
16335 (string_overrun_cookie): Now const. Use initializers that
16336 don't formally overflow signed char, to avoid warnings.
16337 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16338 can cause Emacs to crash when string overrun checking is enabled.
16339 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16340 multiple of sizeof (EMACS_INT); it need not be, if
16341 alignof(EMACS_INT) < sizeof (EMACS_INT).
16342 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16343
16344 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16345
16346 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16347
16348 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16349
16350 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16351 supposed to be handshaking. (Bug#8556)
16352 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16353
16354 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16355
16356 * lisp.h (Qdebug): List symbol.
16357 * eval.c (Qdebug): Restore global linkage.
16358 * keyboard.c (debug-on-event): New variable.
16359 (handle_user_signal): Break into debugger when debug-on-event
16360 matches the current signal symbol.
16361
16362 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16363
16364 * alloc.c (check_sblock, check_string_bytes)
16365 (check_string_free_list): Convert to standard C.
16366
16367 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16368
16369 * w32.c (emacs_gnutls_push): Fix typo.
16370
16371 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16372
16373 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16374 "cast to pointer from integer of different size".
16375
16376 Improve doprnt and its use in verror. (Bug#8545)
16377 * doprnt.c (doprnt): Document the set of format control sequences
16378 supported by the function. Use SAFE_ALLOCA instead of always
16379 using `alloca'.
16380
16381 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16382 is one byte too soon. Don't use xrealloc; instead xfree and
16383 xmalloc anew.
16384
16385 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16386
16387 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16388 callbacks stage.
16389
16390 * gnutls.c: Renamed global_initialized to
16391 gnutls_global_initialized. Added internals for the
16392 :verify-hostname-error, :verify-error, and :verify-flags
16393 parameters of `gnutls-boot' and documented those parameters in the
16394 docstring. Start callback support.
16395 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16396 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16397 on error. Return error code.
16398 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16399 (emacs_gnutls_read): Likewise.
16400 (Fgnutls_boot): Return handshake error code.
16401 (emacs_gnutls_handle_error): New function.
16402 (wsaerror_to_errno): Likewise.
16403
16404 * w32.h (emacs_gnutls_pull): Add prototype.
16405 (emacs_gnutls_push): Likewise.
16406
16407 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16408 (emacs_gnutls_push): Likewise.
16409
16410 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16411
16412 * process.c (wait_reading_process_output): Check if GnuTLS
16413 buffered some data internally if no FDs are set for TLS
16414 connections.
16415
16416 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16417 (LIBS): Link to USER_LIBS.
16418 ($(BLD)/gnutls.$(0)): New target.
16419
16420 2011-04-24 Eli Zaretskii <eliz@gnu.org>
16421
16422 * xdisp.c (handle_single_display_spec): Rename the
16423 display_replaced_before_p argument into display_replaced_p, to
16424 make it consistent with the commentary. Fix typos in the
16425 commentary.
16426
16427 * textprop.c (syms_of_textprop): Remove dead code.
16428 (copy_text_properties): Delete obsolete commentary about an
16429 interface that was deleted long ago. Fix typos in the description
16430 of arguments.
16431
16432 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16433 to changes in oldXMenu/XMenu.h from 2011-04-16.
16434 <menu_help_message, prev_menu_help_message>: Constify.
16435 (IT_menu_make_room): menu->help_text is now `const char **';
16436 adjust.
16437
16438 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16439 to changes in oldXMenu/XMenu.h from 2011-04-16.
16440 (struct XMenu): Declare `help_text' `const char **'.
16441
16442 * xfaces.c <Qunspecified>: Make extern again.
16443
16444 * syntax.c: Include sys/types.h before including regex.h, as
16445 required by POSIX.
16446
16447 * doc.c (get_doc_string): Improve the format passed to `error'.
16448
16449 * doprnt.c (doprnt): Improve commentary.
16450
16451 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16452
16453 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16454 them with etags.
16455
16456 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16457 changes in globals.h immediately force recompilation.
16458 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16459 $(CURDIR)/s/ms-w32.h.
16460 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16461
16462 * character.c (Fchar_direction): Function deleted.
16463 (syms_of_character): Don't defsubr it.
16464 <char-direction-table>: Deleted.
16465
16466 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16467
16468 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16469 * doprnt.c: Include limits.h.
16470 (SIZE_MAX): New macro.
16471 (doprnt): Return a size_t value. 2nd arg is now size_t.
16472 Many local variables are now size_t instead of int or unsigned.
16473 Improve overflow protection. Support `l' modifier for integer
16474 conversions. Support %l conversion. Don't assume an EMACS_INT
16475 argument for integer conversions and for %c.
16476
16477 * lisp.h (doprnt): Restore prototype.
16478
16479 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16480 $(SRC)/character.h.
16481
16482 * Makefile.in (base_obj): Add back doprnt.o.
16483
16484 * deps.mk (doprnt.o): Add back prerequisites.
16485 (callint.o): Depend on character.h.
16486
16487 * eval.c (internal_lisp_condition_case): Include the handler
16488 representation in the error message.
16489 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16490 when breaking from the loop.
16491
16492 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16493
16494 * callint.c (Fcall_interactively): When displaying error message
16495 about invalid control letter, pass the character's codepoint, not
16496 a pointer to its multibyte form. Improve display of the character
16497 in octal and display also its hex code.
16498
16499 * character.c (char_string): Use %x to display the (unsigned)
16500 codepoint of an invalid character, to avoid displaying a bogus
16501 negative value.
16502
16503 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16504 `error', not SYMBOL_NAME itself.
16505
16506 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16507 character arguments to `error'.
16508
16509 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16510 to `error' in error message about FINAL_CHAR argument. Make sure
16511 FINAL_CHAR is a character, and use %c when it is passed as
16512 argument to `error'.
16513
16514 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16515
16516 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16517
16518 * w32.c: Include <time.h>.
16519 (sys_localtime): New function.
16520
16521 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
16522
16523 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16524
16525 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16526
16527 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
16528
16529 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16530 zombies (Bug#8467).
16531
16532 2011-04-19 Eli Zaretskii <eliz@gnu.org>
16533
16534 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16535 gl_state.e_property when gl_state.object is Qt.
16536
16537 * insdel.c (make_gap_larger): Remove limitation of buffer size
16538 to <= INT_MAX.
16539
16540 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
16541
16542 * xdisp.c (lookup_glyphless_char_display)
16543 (produce_glyphless_glyph): Handle cons cell entry in
16544 glyphless-char-display.
16545 (Vglyphless_char_display): Document it.
16546
16547 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16548 glyphless-char-display.
16549
16550 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
16551
16552 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16553
16554 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16555
16556 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16557 definition for no-X builds.
16558
16559 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
16560
16561 Static checks with GCC 4.6.0 and non-default toolkits.
16562
16563 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16564
16565 * process.c (keyboard_bit_set): Define only if SIGIO.
16566 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16567 (send_process): Repair possible setjmp clobbering.
16568
16569 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16570
16571 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16572
16573 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16574
16575 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16576 Define only if needed.
16577
16578 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16579 by pacifying GCC about it. Maybe it's time to retire it?
16580 * xfaces.c (USG, __TIMEVAL__): Likewise.
16581
16582 * dispextern.h (struct redisplay_interface): Rename param
16583 to avoid shadowing.
16584 * termhooks.h (struct terminal): Likewise.
16585 * xterm.c (xembed_send_message): Likewise.
16586
16587 * insdel.c (make_gap_smaller): Define only if
16588 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16589
16590 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16591 it.
16592
16593 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16594 so that we aren't warned about unused symbols.
16595
16596 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16597
16598 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16599
16600 * xfns.c (x_real_positions): Mark locals as initialized.
16601
16602 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16603
16604 * xterm.c: Fix problems found by static analysis with other toolkits.
16605 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16606 (x_dispatch_event): Declare static if USE_GTK, and
16607 define if USE_GTK || USE_X_TOOLKIT.
16608 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16609 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16610 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16611 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16612
16613 * xmenu.c (menu_help_callback): Pointer type fixes.
16614 Use const pointers when pointing at readonly data. Avoid pointer
16615 signedness clashes.
16616 (FALSE): Remove unused macro.
16617 (update_frame_menubar): Remove unused decl.
16618
16619 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16620
16621 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16622 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16623 (single_menu_item): Rename local to avoid shadowing.
16624
16625 * keyboard.c (make_lispy_event): Remove unused local var.
16626
16627 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16628 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16629
16630 * bitmaps: Change bitmaps from unsigned char back to the X11
16631 compatible char. Avoid the old compiler warnings about
16632 out-of-range initializers by using, for example, '\xab' rather
16633 than 0xab.
16634
16635 * xgselect.c (xgselect_initialize): Check vs interface
16636 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16637
16638 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16639
16640 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16641 to read-only memory.
16642
16643 * fns.c (vector): Remove; this old hack is no longer needed.
16644
16645 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16646 Remove unused var.
16647 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16648
16649 * xrdb.c (x_load_resources): Omit unused local.
16650
16651 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16652 (x_window): Rename locals to avoid shadowing.
16653 (USG): Use the kludged USG macro, to pacify gcc.
16654
16655 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16656 (x_term_init): Remove local to avoid shadowing.
16657
16658 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16659
16660 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16661 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16662
16663 2011-04-16 Eli Zaretskii <eliz@gnu.org>
16664
16665 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16666
16667 Fix regex.c, syntax.c and friends for buffers > 2GB.
16668 * syntax.h (struct gl_state_s): Declare character position members
16669 EMACS_INT.
16670
16671 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16672
16673 * textprop.c (verify_interval_modification, interval_of):
16674 Declare arguments EMACS_INT.
16675
16676 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16677 EMACS_INT.
16678
16679 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16680
16681 * indent.c (Fvertical_motion): Local variable it_start is now
16682 EMACS_INT.
16683
16684 * regex.c (re_match, re_match_2, re_match_2_internal)
16685 (bcmp_translate, regcomp, regexec, print_double_string)
16686 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16687 (re_compile_pattern, re_exec): Declare arguments and local
16688 variables `size_t' and `ssize_t' and return values `regoff_t', as
16689 appropriate.
16690 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16691 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16692 <compile_stack_type>: `size' and `avail' are now `size_t'.
16693
16694 * regex.h <regoff_t>: Use ssize_t, not int.
16695 (re_search, re_search_2, re_match, re_match_2): Arguments that
16696 specify buffer/string position and length are now ssize_t and
16697 size_t. Return type is regoff_t.
16698
16699 2011-04-16 Ben Key <bkey76@gmail.com>
16700
16701 * nsfont.m: Fixed bugs in ns_get_family and
16702 ns_descriptor_to_entity that were caused by using free to
16703 deallocate memory blocks that were allocated by xmalloc (via
16704 xstrdup). This caused Emacs to crash when compiled with
16705 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16706 --enable-checking=xmallocoverrun). xfree is now used to
16707 deallocate these memory blocks.
16708
16709 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
16710
16711 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16712
16713 emacs_write: Accept and return EMACS_INT for sizes.
16714 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16715 et seq.
16716 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16717 Accept and return EMACS_INT.
16718 (emacs_gnutls_write): Return the number of bytes written on
16719 partial writes.
16720 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16721 (emacs_read, emacs_write): Remove check for negative size, as the
16722 Emacs source code has been audited now.
16723 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16724 (emacs_read, emacs_write): Use it.
16725 * process.c (send_process): Adjust to the new signatures of
16726 emacs_write and emacs_gnutls_write. Do not attempt to store
16727 a byte offset into an 'int'; it might overflow.
16728 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16729
16730 * sound.c: Don't assume sizes fit in 'int'.
16731 (struct sound_device.period_size, alsa_period_size):
16732 Return EMACS_INT, not int.
16733 (struct sound_device.write, vox_write, alsa_write):
16734 Accept EMACS_INT, not int.
16735 (wav_play, au_play): Use EMACS_INT to store sizes and to
16736 record read return values.
16737
16738 2011-04-15 Ben Key <bkey76@gmail.com>
16739
16740 * keyboard.c (Qundefined): Don't declare static since it is used
16741 in nsfns.m.
16742 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16743 static since they are used in nsfont.m.
16744
16745 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16746
16747 * process.c (Qprocessp): Don't declare static.
16748 * lisp.h (Qprocessp): Declare again.
16749
16750 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
16751
16752 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16753
16754 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16755
16756 Improve C-level modularity by making more things 'static'.
16757
16758 Don't publish debugger-only interfaces to other modules.
16759 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16760 (verify_bytepos, count_markers): Move decls to the only modules
16761 that need them.
16762 * region-cache.h (pp_cache): Likewise.
16763 * window.h (check_all_windows): Likewise.
16764 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16765
16766 * sysdep.c (croak): Now static, if
16767 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16768 * syssignal.h (croak): Declare only if not static.
16769
16770 * alloc.c (refill_memory_reserve): Now static if
16771 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16772 * lisp.h (refill_memory_reserve): Declare only if not static.
16773
16774 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16775 Define only if USE_LUCID.
16776
16777 * xrdb.c (x_customization_string, x_rm_string): Now static.
16778
16779 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16780 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16781
16782 * xdisp.c (draw_row_with_mouse_face): Now static.
16783 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16784
16785 * window.h (check_all_windows): Mark externally visible.
16786
16787 * window.c (window_deletion_count): Now static.
16788
16789 * undo.c: Make symbols static if they're not exported.
16790 (last_undo_buffer, last_boundary_position, pending_boundary):
16791 Now static.
16792
16793 * textprop.c (interval_insert_behind_hooks): Now static.
16794 (interval_insert_in_front_hooks): Likewise.
16795
16796 * term.c: Make symbols static if they're not exported.
16797 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16798 (max_frame_lines, tty_set_terminal_modes):
16799 (tty_reset_terminal_modes, tty_turn_off_highlight):
16800 (get_tty_terminal): Now static.
16801 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16802 * termhooks.h (term_mouse_moveto): Do not declare if
16803 HAVE_WINDOW_SYSTEM.
16804 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16805 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16806
16807 * sysdep.c: Make symbols static if they're not exported.
16808 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16809 Now static.
16810 (sigprocmask_set, full_mask): Remove; unused.
16811 (wait_debugging): Mark as visible.
16812 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16813 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16814
16815 * syntax.c (syntax_temp): Define only if !__GNUC__.
16816
16817 * sound.c (current_sound_device, current_sound): Now static.
16818
16819 * search.c (searchbufs, searchbuf_head): Now static.
16820
16821 * scroll.c (scroll_cost): Remove; unused.
16822 * dispextern.h (scroll_cost): Remove decl.
16823
16824 * region-cache.h (pp_cache): Mark as externally visible.
16825
16826 * process.c: Make symbols static if they're not exported.
16827 (process_tick, update_tick, create_process, chan_process):
16828 (Vprocess_alist, proc_buffered_char, datagram_access):
16829 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16830 (deactivate_process): Mark defn as static, as well as decl.
16831 * lisp.h (create_process): Remove decl.
16832 * process.h (chan_process, Vprocess_alist): Remove decls.
16833
16834 * print.c: Make symbols static if they're not exported.
16835 (print_depth, new_backquote_output, being_printed, print_buffer):
16836 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16837 (print_interval, print_number_index, initial_stderr_stream):
16838 Now static.
16839 * lisp.h (Fprinc): Remove decl.
16840 (debug_output_compilation_hack): Mark as externally visible.
16841
16842 * sysdep.c (croak): Move decl from here to syssignal.h.
16843 * syssignal.h (croak): Put it here, so the API can be checked when
16844 'croak' is called from dissociate_if_controlling_tty.
16845
16846 * minibuf.c: Make symbols static if they're not exported.
16847 (minibuf_save_list, choose_minibuf_frame): Now static.
16848 * lisp.h (choose_minibuf_frame): Remove decl.
16849
16850 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16851
16852 * lread.c: Make symbols static if they're not exported.
16853 (read_objects, initial_obarray, oblookup_last_bucket_number):
16854 Now static.
16855 (make_symbol): Remove; unused.
16856 * lisp.h (initial_obarray, make_symbol): Remove decls.
16857
16858 * keyboard.c: Make symbols static if they're not exported.
16859 (single_kboard, recent_keys_index, total_keys, recent_keys):
16860 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16861 (this_single_command_key_start, echoing, last_auto_save):
16862 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16863 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16864 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16865 (Vlispy_mouse_stem, double_click_count):
16866 Now static.
16867 (force_auto_save_soon): Define only if SIGDANGER.
16868 (ignore_mouse_drag_p): Now static if
16869 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16870 (print_help): Remove; unused.
16871 (stop_character, last_timer_event): Mark as externally visible.
16872 * keyboard.h (ignore_mouse_drag_p): Declare only if
16873 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16874 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16875 * lisp.h (echoing): Remove decl.
16876 (force_auto_save_soon): Declare only if SIGDANGER.
16877 * xdisp.c (redisplay_window): Simplify code, to make it more
16878 obvious that ignore_mouse_drag_p is not accessed if !defined
16879 USE_GTK && !defined HAVE_NS.
16880
16881 * intervals.c: Make symbols static if they're not exported.
16882 (merge_properties_sticky, merge_interval_right, delete_interval):
16883 Now static.
16884 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16885
16886 * insdel.c: Make symbols static if they're not exported.
16887 However, leave prepare_to_modify_buffer alone. It's never
16888 called from outside this function, but that appears to be a bug.
16889 (combine_after_change_list, combine_after_change_buffer):
16890 (adjust_after_replace, signal_before_change): Now static.
16891 (adjust_after_replace_noundo): Remove; unused.
16892 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16893 (signal_before_change): Remove decls.
16894
16895 * indent.c (val_compute_motion, val_vmotion): Now static.
16896
16897 * image.c: Make symbols static if they're not exported.
16898 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16899 if USE_GTK.
16900 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16901 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16902
16903 * fringe.c (standard_bitmaps): Now static.
16904 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16905
16906 * frame.c: Make symbols static if they're not exported.
16907 (x_report_frame_params, make_terminal_frame): Now static.
16908 (get_frame_param): Now static, unless HAVE_NS.
16909 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16910 (x_get_resource_string): Remove; not used.
16911 * frame.h (make_terminal_frame, x_report_frame_params):
16912 (x_get_resource_string); Remove decls.
16913 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16914 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16915
16916 * font.c, fontset.c: Make symbols static if they're not exported.
16917 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16918 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16919 * font.c (font_close_object): Now static.
16920 * font.h (font_close_object): Remove.
16921 * fontset.c (FONTSET_OBJLIST): Remove.
16922 (free_realized_fontset) #if-0 the body, which does nothing.
16923 (face_suitable_for_char_p): #if-0, as it's never called.
16924 * fontset.h (face_suitable_for_char_p): Remove decl.
16925 * xfaces.c (face_at_string_position):
16926 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16927 since 0 is always ASCII.
16928
16929 * fns.c (weak_hash_tables): Now static.
16930
16931 * fileio.c: Make symbols static if they're not exported.
16932 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16933 (Vwrite_region_annotation_buffers): Now static.
16934
16935 * eval.c: Make symbols static if they're not exported.
16936 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16937 * lisp.h (backtrace_list): Remove decl.
16938
16939 * emacs.c: Make symbols static if they're not exported.
16940 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16941 (fatal_error_code, fatal_error_signal_hook, standard_args):
16942 Now static.
16943 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16944 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16945 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16946 * lisp.h (fatal_error_signal_hook): Remove decl.
16947 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16948
16949 * editfns.c: Move a (normally-unused) function to its only use.
16950 * editfns.c, lisp.h (get_operating_system_release): Remove.
16951 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16952 worth the hassle of breaking this out.
16953
16954 * xterm.c: Make symbols static if they're not exported.
16955 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16956 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16957 (x_destroy_window, x_delete_display):
16958 Now static.
16959 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16960 (x_mouse_leave): Remove; unused.
16961 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16962 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16963 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16964 Remove decls.
16965 (x_mouse_leave): Declare only if WINDOWSNT.
16966 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16967 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16968 USE_X_TOOLKIT.
16969
16970 * ftxfont.c: Make symbols static if they're not exported.
16971 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16972 HAVE_FREETYPE.
16973 * font.h (ftxfont_driver): Likewise.
16974
16975 * xfns.c: Make symbols static if they're not exported.
16976 (x_last_font_name, x_display_info_for_name):
16977 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16978 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16979 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16980 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16981 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16982 (last_show_tip_args): Now static.
16983 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16984 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16985 (x_screen_planes): Remove; unused.
16986 * dispextern.h (x_screen_planes): Remove decl.
16987
16988 * dispnew.c: Make symbols static if they're not exported.
16989 * dispextern.h (redraw_garbaged_frames, scrolling):
16990 (increment_row_positions): Remove.
16991 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16992 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16993 Now static.
16994 (redraw_garbaged_frames): Remove; unused.
16995
16996 * xfaces.c: Make symbols static if they're not exported.
16997 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16998 Remove decls.
16999 * xterm.h (defined_color): Remove decls.
17000 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17001 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17002 (menu_face_changed_default, defined_color, free_realized_face):
17003 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17004 (ascii_face_of_lisp_face): Remove; unused.
17005
17006 * xdisp.c: Make symbols static if they're not exported.
17007 * dispextern.h (scratch_glyph_row, window_box_edges):
17008 (glyph_to_pixel_coords, set_cursor_from_row):
17009 (get_next_display_element, set_iterator_to_next):
17010 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17011 (show_mouse_face): Remove decls
17012 * frame.h (message_buf_print): Likewise.
17013 * lisp.h (pop_message, set_message, check_point_in_composition):
17014 Likewise.
17015 * xterm.h (set_vertical_scroll_bar): Likewise.
17016 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17017 (message_buf_print, scratch_glyph_row, displayed_buffer):
17018 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17019 (get_next_display_element, show_mouse_face, window_box_edges):
17020 (frame_to_window_pixel_xy, check_point_in_composition):
17021 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17022 (glyph_to_pixel_coords): Remove; unused.
17023
17024 * dired.c (file_name_completion): Now static.
17025
17026 * dbusbind.c (xd_in_read_queued_messages): Now static.
17027
17028 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17029 * data.c (circular_list_error): Remove.
17030
17031 * commands.h (last_point_position, last_point_position_buffer):
17032 (last_point_position_window): Remove decls.
17033 * keyboard.c: Make these variables static.
17034
17035 * coding.h (coding, code_convert_region, encode_coding_gap):
17036 Remove decls.
17037 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17038 (iso_code_class, detect_coding, code_convert_region): Now static.
17039 (encode_coding_gap): Remove; unused.
17040
17041 * chartab.c (chartab_chars, chartab_bits): Now static.
17042
17043 * charset.h (charset_iso_8859_1): Remove decl.
17044 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17045 Now static.
17046
17047 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17048 * ccl.c (Vccl_program_table): Now static.
17049 (check_ccl_update): Remove; unused.
17050
17051 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17052 * category.h: ... from here.
17053 * category.c (check_category_table, set_category_set): Now static.
17054
17055 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17056 * lisp.h: Remove these decls.
17057
17058 * buffer.c (buffer_count): Remove unused var.
17059
17060 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17061 so that it's not optimized away.
17062 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17063 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17064 exported only to the debugger.
17065
17066 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17067 * atimer.h (run_all_atimers): Remove; not exported.
17068
17069 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17070 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17071 was inaccessible from Lisp.
17072 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17073 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17074
17075 alloc.c: Import and export fewer symbols, and remove unused items.
17076 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17077 is defined.
17078 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17079 it's not optimized away by whole-program optimization.
17080 (message_enable_multibyte, free_misc): Remove.
17081 (catchlist, handlerlist, mark_backtrace):
17082 Declare only if BYTE_MARK_STACK.
17083 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17084 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17085 (message_enable_multibyte): Remove decl.
17086 (free_misc, interval_free_list, float_block, float_block_index):
17087 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17088 (cons_free_list, last_marked_index):
17089 Now static.
17090 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17091 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17092 (mark_backtrace): Define only if BYTE_MARK_STACK.
17093 * xdisp.c (message_enable_multibyte): Now static.
17094
17095 Declare Lisp_Object Q* variables to be 'static' if not exported.
17096 This makes it easier for human readers (and static analyzers)
17097 to see whether these variables are used from other modules.
17098 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17099 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17100 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17101 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17102 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17103 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17104 * xmenu.c, xselect.c:
17105 Declare Q* vars static if they are not used in other modules.
17106 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17107 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17108 Remove decls of unexported vars.
17109 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17110
17111 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17112
17113 Make Emacs functions such as Fatom 'static' by default.
17114 This makes it easier for human readers (and static analyzers)
17115 to see whether these functions can be called from other modules.
17116 DEFUN now defines a static function. To make the function external
17117 so that it can be used in other C modules, use the new macro DEFUE.
17118 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17119 (Finit_image_library):
17120 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17121 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17122 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17123 Remove decls, since these functions are now static.
17124 (Funintern, Fget_internal_run_time): New decls, since these functions
17125 were already external.
17126
17127 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17128 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17129 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17130 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17131 * keyboard.c, keymap.c, lread.c:
17132 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17133 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17134 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17135 Mark functions with DEFUE instead of DEFUN,
17136 if they are used in other modules.
17137 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17138 decls for now-static functions.
17139 * buffer.h (Fdelete_overlay): Remove decl.
17140 * callproc.c (Fgetenv_internal): Mark as internal.
17141 * composite.c (Fremove_list_of_text_properties): Remove decl.
17142 (Fcomposition_get_gstring): New forward static decl.
17143 * composite.h (Fcomposite_get_gstring): Remove decl.
17144 * dired.c (Ffile_attributes): New forward static decl.
17145 * doc.c (Fdocumntation_property): New forward static decl.
17146 * eval.c (Ffetch_bytecode): New forward static decl.
17147 (Funintern): Remove extern decl; now in .h file where it belongs.
17148 * fileio.c (Fmake_symbolic_link): New forward static decl.
17149 * image.c (Finit_image_library): New forward static decl.
17150 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17151 * intervals.h (Fprevious_property_change):
17152 (Fremove_list_of_text_properties): Remove decls.
17153 * keyboard.c (Fthis_command_keys): Remove decl.
17154 (Fcommand_execute): New forward static decl.
17155 * keymap.c (Flookup_key): New forward static decl.
17156 (Fcopy_keymap): Now static.
17157 * keymap.h (Flookup_key): Remove decl.
17158 * process.c (Fget_process): New forward static decl.
17159 (Fprocess_datagram_address): Mark as internal.
17160 * syntax.c (Fsyntax_table_p): New forward static decl.
17161 (skip_chars): Remove duplicate decl.
17162 * textprop.c (Fprevious_property_change): New forward static decl.
17163 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17164 Now internal.
17165 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17166 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17167
17168 * editfns.c (Fformat): Remove unreachable code.
17169
17170 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17171
17172 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17173 change. (Bug#8496)
17174
17175 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17176
17177 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17178 when at ZV. (Bug#8487)
17179
17180 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17181
17182 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17183 (Bug#8437)
17184 * keyboard.c (parse_tool_bar_item): Likewise.
17185 * sound.c (sound_cleanup, alsa_close): Likewise.
17186 * termcap.c (tgetent): Likewise.
17187 * xfns.c (x_default_font_parameter): Likewise.
17188 * xsettings.c (read_and_apply_settings): Likewise.
17189
17190 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17191 (overrun_check_free): Protoize.
17192
17193 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17194
17195 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17196 since callers should never pass a negative size.
17197 Change the signature to match that of plain 'read' and 'write'; see
17198 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17199 * lisp.h: Update prototypes of emacs_write and emacs_read.
17200
17201 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17202
17203 * xdisp.c (redisplay_window): Don't try to determine the character
17204 position of the scroll margin if the window start point w->startp
17205 is outside the buffer's accessible region. (Bug#8468)
17206
17207 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17208
17209 Fix write-region and its subroutines for buffers > 2GB.
17210 * fileio.c (a_write, e_write): Modify declaration of arguments and
17211 local variables to support buffers larger than 2GB.
17212 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17213
17214 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17215 argument, local variables, and return value.
17216
17217 * lisp.h: Update prototypes of emacs_write and emacs_read.
17218
17219 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17220
17221 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17222
17223 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17224
17225 Fix more problems found by GCC 4.6.0's static checks.
17226
17227 * xdisp.c (vmessage): Use a better test for character truncation.
17228
17229 * charset.c (load_charset_map): <, not <=, for optimization,
17230 and to avoid potential problems with integer overflow.
17231 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17232 * casetab.c (set_identity, shuffle): Likewise.
17233 * editfns.c (Fformat): Likewise.
17234 * syntax.c (skip_chars): Likewise.
17235
17236 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17237 This also lets GCC 4.6.0 generate slightly better loop code.
17238
17239 * callint.c (Fcall_interactively): <, not <=, for optimization.
17240 (Fcall_interactively): Count the number of arguments produced,
17241 not the number of arguments given. This is simpler and lets GCC
17242 4.6.0 generate slightly better code.
17243
17244 * ftfont.c: Distingish more carefully between FcChar8 and char.
17245 The previous code passed unsigned char * to a functions like
17246 strlen and xstrcasecmp that expect char *, which does not
17247 conform to the C standard.
17248 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17249 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17250 char * when the C standard requires it.
17251
17252 * keyboard.c (read_char): Remove unused var.
17253
17254 * eval.c: Port to Windows vsnprintf (Bug#8435).
17255 Include <limits.h>.
17256 (SIZE_MAX): Define if the headers do not.
17257 (verror): Do not give up if vsnprintf returns a negative count.
17258 Instead, grow the buffer. This ports to Windows vsnprintf, which
17259 does not conform to C99. Problem reported by Eli Zaretskii.
17260 Also, simplify the allocation scheme, by avoiding the need for
17261 calling realloc, and removing the ALLOCATED variable.
17262
17263 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17264
17265 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17266 But keep the doprint source code for now, as we might revamp it
17267 and use it again (Bug#8435).
17268 * lisp.h (doprnt): Remove.
17269 * Makefile.in (base_obj): Remove doprnt.o.
17270 * deps.mk (doprnt.o): Remove.
17271
17272 error: Print 32- and 64-bit integers portably (Bug#8435).
17273 Without this change, on typical 64-bit hosts error ("...%d...", N)
17274 was used to print both 32- and 64-bit integers N, which relied on
17275 undefined behavior.
17276 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17277 * lisp.h (error, verror): Mark as printf-like functions.
17278 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17279 Report overflow in size calculations when allocating printf buffer.
17280 Do not truncate output string at its first null byte.
17281 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17282 Truncate the output at a character boundary, since vsnprintf does not
17283 do that.
17284 * charset.c (check_iso_charset_parameter): Convert internal
17285 character to string before calling 'error', since %c now has the
17286 printf meaning.
17287 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17288 overflow when computing char to be passed to 'error'. Do not
17289 pass Lisp_Object to 'error'; pass the integer instead.
17290 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17291 formatted with plain %d.
17292
17293 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17294
17295 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17296
17297 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17298
17299 * xterm.c (x_catch_errors): Remove duplicate declaration.
17300
17301 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17302
17303 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17304
17305 2011-04-10 Jim Meyering <meyering@redhat.com>
17306
17307 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17308 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17309 return ssize_t not "int", and use size_t as the buffer length.
17310 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17311 * gnutls.h: Update declarations.
17312 * process.c (read_process_output): Use ssize_t, to match.
17313 (send_process): Likewise.
17314
17315 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17316
17317 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17318
17319 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17320
17321 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17322 Use unsigned char, to match FcChar8 type definition.
17323
17324 * xterm.c (handle_one_xevent):
17325 * xmenu.c (create_and_show_popup_menu):
17326 * xselect.c (x_decline_selection_request)
17327 (x_reply_selection_request): Avoid type-punned deref of X events.
17328
17329 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17330
17331 Fix some uses of `int' instead of EMACS_INT.
17332 * search.c (string_match_1, fast_string_match)
17333 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17334 (scan_buffer, find_next_newline_no_quit)
17335 (find_before_next_newline, search_command, Freplace_match)
17336 (Fmatch_data): Make some `int' variables be EMACS_INT.
17337
17338 * xdisp.c (display_count_lines): 3rd argument and return value now
17339 EMACS_INT. All callers changed.
17340 (pint2hrstr): Last argument is now EMACS_INT.
17341
17342 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17343 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17344 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17345 (decode_coding_utf_16, decode_coding_emacs_mule)
17346 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17347 (decode_coding_ccl, decode_coding_charset)
17348 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17349 (decode_coding_iso_2022, decode_coding_emacs_mule)
17350 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17351 <char_offset, last_offset>: Declare EMACS_INT.
17352 (encode_coding_utf_8, encode_coding_utf_16)
17353 (encode_coding_emacs_mule, encode_invocation_designation)
17354 (encode_designation_at_bol, encode_coding_iso_2022)
17355 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17356 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17357 Declare EMACS_INT.
17358 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17359 (encode_invocation_designation): Last argument P_NCHARS is now
17360 EMACS_INT.
17361 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17362 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17363
17364 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17365 All users changed.
17366
17367 * ccl.c (Fccl_execute_on_string): Declare some variables
17368 EMACS_INT.
17369
17370 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17371
17372 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17373
17374 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17375
17376 * process.c (Fformat_network_address): Doc fix.
17377
17378 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17379
17380 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17381
17382 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
17383
17384 * keyboard.c (read_char): Call Lisp function help-form-show,
17385 instead of using internal_with_output_to_temp_buffer.
17386 (Qhelp_form_show): New var.
17387 (syms_of_keyboard): Use DEFSYM macro.
17388
17389 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17390
17391 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17392
17393 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
17394
17395 * process.c (Flist_processes): Remove to Lisp.
17396 (list_processes_1): Delete.
17397
17398 2011-04-06 Eli Zaretskii <eliz@gnu.org>
17399
17400 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17401
17402 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17403
17404 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
17405
17406 Fix more problems found by GCC 4.6.0's static checks.
17407
17408 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17409
17410 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17411
17412 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17413
17414 * xdisp.c (vmessage): Mark as a printf-like function.
17415
17416 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17417
17418 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17419
17420 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17421 printf-like functions.
17422 (tiff_load): Add casts to remove these marks before passing them
17423 to system-supplied API.
17424
17425 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17426
17427 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17428 This avoids several warnings with gcc -Wstrict-overflow.
17429 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17430 directly, rather than having caller test rule sign. This avoids
17431 some unnecessary tests.
17432 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17433 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17434 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17435
17436 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17437 (xfont_open): Avoid unnecessary tests.
17438
17439 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17440
17441 * composite.h, composite.c (composition_gstring_put_cache):
17442 Use EMACS_INT, not int, for length.
17443
17444 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17445 breaking out part of COMPOSITION_DECODE_RULE.
17446 (COMPOSITION_DECODE_RULE): Use it.
17447 * composite.c (get_composition_id): Remove unused local vars,
17448 by using the new macro.
17449
17450 * textprop.c (set_text_properties_1): Change while to do-while,
17451 since the condition is always true at first.
17452
17453 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17454 (interval_deletion_adjustment): Return unsigned value.
17455 All uses changed.
17456
17457 * process.c (list_processes_1, create_pty, read_process_output):
17458 (exec_sentinel): Remove vars that were set but not used.
17459 (create_pty): Remove unnecessary "volatile"s.
17460 (Fnetwork_interface_info): Avoid possibility of int overflow.
17461 (read_process_output): Do adaptive read buffering even if carryover.
17462 (read_process_output): Simplify nbytes computation if buffered.
17463
17464 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17465
17466 * syntax.c (scan_words): Remove var that was set but not used.
17467 (update_syntax_table): Use unsigned instead of int.
17468
17469 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17470 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17471 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17472
17473 * print.c (print_error_message): Avoid int overflow.
17474
17475 * font.c (font_list_entities): Redo for clarity,
17476 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17477
17478 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17479 (font_score): Avoid potential overflow in diff calculation.
17480
17481 * fns.c (substring_both): Remove var that is set but not used.
17482 (sxhash): Redo loop for clarity and to avoid wraparound warning.
17483
17484 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17485
17486 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17487 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17488 can always succeed if overflow has undefined behavior.
17489
17490 * search.c (boyer_moore, wordify): Remove vars set but not used.
17491 (wordify): Omit three unnecessary tests.
17492
17493 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17494 All callers changed. This avoids the need for an unused var.
17495
17496 * casefiddle.c (casify_region): Remove var that is set but not used.
17497
17498 * dired.c (file_name_completion): Remove var that is set but not used.
17499
17500 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17501
17502 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17503 (Finsert_file_contents): Remove unnecessary code checking fd.
17504
17505 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17506 Check for integer overflow on size calculations.
17507
17508 * buffer.c (Fprevious_overlay_change): Remove var that is set
17509 but not used.
17510
17511 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17512 Remove vars that are set but not used.
17513 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17514 (timer_check_2): Mark vars as initialized.
17515
17516 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17517
17518 * image.c (lookup_image): Remove var that is set but not used.
17519 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17520
17521 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17522 that are set but not used.
17523
17524 * xfns.c (make_invisible_cursor): Don't return garbage
17525 if XCreateBitmapFromData fails (Bug#8410).
17526
17527 * xselect.c (x_get_local_selection, x_handle_property_notify):
17528 Remove vars that are set but not used.
17529
17530 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17531 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17532
17533 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17534 Remove var that is set but not used.
17535 (scroll_bar_windows_size): Now size_t, not int.
17536 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17537 Check for overflow.
17538
17539 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17540 (map_tty_color) [!defined MSDOS]: Likewise.
17541
17542 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17543
17544 * coding.c: Remove vars that are set but not used.
17545 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17546 All callers changed.
17547 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17548 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17549 (decode_coding_charset): Remove vars that are set but not used.
17550
17551 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17552 that is set but not used.
17553
17554 * print.c (print_object): Remove var that is set but not used.
17555
17556 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17557 The gnulib version avoids calling malloc in the usual case,
17558 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17559 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17560 * filelock.c (current_lock_owner): Likewise.
17561 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17562 * sysdep.c: Include allocator.h, careadlinkat.h.
17563 (emacs_no_realloc_allocator): New static constant.
17564 (emacs_readlink): New function.
17565 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17566 ../lib/careadlinkat.h.
17567
17568 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17569
17570 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17571 first non-nil return value).
17572
17573 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17574
17575 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17576 if not defined (Bug#8403).
17577
17578 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17579
17580 * xdisp.c (display_count_lines): Remove parameter `start',
17581 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17582 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17583 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17584 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17585 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17586 and thereabouts. All callers changed.
17587 (get_per_char_metric): Remove parameter `f', unused since
17588 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17589
17590 2011-04-02 Jim Meyering <meyering@redhat.com>
17591
17592 do not dereference NULL upon failed strdup
17593 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17594 (ns_get_family): Likewise.
17595
17596 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17597
17598 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17599
17600 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17601
17602 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17603 later (Bug#8403).
17604
17605 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17606
17607 Add lexical binding.
17608
17609 * window.c (Ftemp_output_buffer_show): New fun.
17610 (Fsave_window_excursion):
17611 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17612
17613 * lread.c (lisp_file_lexically_bound_p): New function.
17614 (Fload): Bind Qlexical_binding.
17615 (readevalloop): Remove `evalfun' arg.
17616 Bind Qinternal_interpreter_environment.
17617 (Feval_buffer): Bind Qlexical_binding.
17618 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17619 Mark as dynamic.
17620 (syms_of_lread): Declare `lexical-binding'.
17621
17622 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17623
17624 * keyboard.c (eval_dyn): New fun.
17625 (menu_item_eval_property): Use it.
17626
17627 * image.c (parse_image_spec): Use Ffunctionp.
17628
17629 * fns.c (concat, mapcar1): Accept byte-code-functions.
17630
17631 * eval.c (Fsetq): Handle lexical vars.
17632 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17633 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17634 (FletX, Flet): Obey lexical binding.
17635 (Fcommandp): Handle closures.
17636 (Feval): New `lexical' arg.
17637 (eval_sub): New function extracted from Feval. Use it almost
17638 everywhere where Feval was used. Look up vars in lexical env.
17639 Handle closures.
17640 (Ffunctionp): Move from subr.el.
17641 (Ffuncall): Handle closures.
17642 (apply_lambda): Remove `eval_flags'.
17643 (funcall_lambda): Handle closures and new byte-code-functions.
17644 (Fspecial_variable_p): New function.
17645 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17646 but without exporting it to Lisp.
17647
17648 * doc.c (Fdocumentation, store_function_docstring):
17649 * data.c (Finteractive_form): Handle closures.
17650
17651 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17652 interactive spec.
17653
17654 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17655 New byte-codes.
17656 (exec_byte_code): New function extracted from Fbyte_code to handle new
17657 calling convention for byte-code-functions. Add new byte-codes.
17658
17659 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17660
17661 * alloc.c (Fmake_symbol): Init new `declared_special' field.
17662
17663 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17664
17665 * xdisp.c (redisplay_internal): Fix prototype.
17666
17667 2011-03-31 Eli Zaretskii <eliz@gnu.org>
17668
17669 * xdisp.c (SCROLL_LIMIT): New macro.
17670 (try_scrolling): Use it when setting scroll_limit.
17671 Limit scrolling to 100 screen lines.
17672 (redisplay_window): Even when falling back on "recentering",
17673 position point in the window according to scroll-conservatively,
17674 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17675
17676 (try_scrolling): When point is above the window, allow searching
17677 as far as scroll_max, or one screenful, to compute vertical
17678 distance from PT to the scroll margin position. This prevents
17679 try_scrolling from unnecessarily failing when
17680 scroll-conservatively is set to a value slightly larger than the
17681 window height. Clean up the case of PT below the margin at bottom
17682 of window: scroll_max can no longer be INT_MAX. When aggressive
17683 scrolling is in use, don't let point enter the opposite scroll
17684 margin as result of the scroll.
17685 (syms_of_xdisp) <scroll-conservatively>: Document the
17686 threshold of 100 lines for never-recentering scrolling.
17687
17688 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17689
17690 * dispextern.h (move_it_by_lines):
17691 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17692 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17693 (message_log_check_duplicate): Remove parameters `prev_bol' and
17694 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17695 (redisplay_internal): Remove parameter `preserve_echo_area',
17696 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17697
17698 * indent.c (Fvertical_motion):
17699 * window.c (window_scroll_pixel_based, Frecenter):
17700 Don't pass `need_y_p' to `move_it_by_lines'.
17701
17702 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17703
17704 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17705 steal a few bits to be more compact.
17706 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17707 Remove unneeded casts.
17708
17709 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17710
17711 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17712
17713 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17714 binding" message (bug#7967).
17715
17716 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17717
17718 Fix more problems found by GCC 4.6.0's static checks.
17719
17720 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17721 Remove unused local var.
17722
17723 * editfns.c (Fmessage_box): Remove unused local var.
17724
17725 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17726 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17727 Omit unused local vars.
17728 * window.c (shrink_windows): Omit unused local var.
17729 * menu.c (digest_single_submenu): Omit unused local var.
17730 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17731 Omit unused local var.
17732
17733 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17734 Don't assume string length fits in int.
17735 (keyremap_step, read_key_sequence): Use size_t for sizes.
17736 (read_key_sequence): Don't check last_real_key_start redundantly.
17737
17738 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17739 instead of alloca (Bug#8344).
17740
17741 * eval.c (Fbacktrace): Don't assume nargs fits in int.
17742 (Fbacktrace_frame): Don't assume nframes fits in int.
17743
17744 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17745
17746 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17747 concerns.
17748
17749 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17750
17751 * cm.c (calccost): Turn while-do into do-while, for clarity.
17752
17753 * keyboard.c (syms_of_keyboard): Use the same style as later
17754 in this function when indexing through an array. This also
17755 works around GCC bug 48267.
17756
17757 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17758
17759 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17760
17761 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17762 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17763
17764 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17765 This avoids undefined behavior on integer overflow, and is a bit
17766 more convenient anyway since it is compared to a size_t variable.
17767
17768 Variadic C functions now count arguments with size_t, not int.
17769 This avoids an unnecessary limitation on 64-bit machines, which
17770 caused (substring ...) to crash on large vectors (Bug#8344).
17771 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17772 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
17773 All variadic functions and their callers changed accordingly.
17774 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17775 * data.c (arith_driver, float_arith_driver): Likewise.
17776 * editfns.c (general_insert_function): Likewise.
17777 * eval.c (struct backtrace.nargs, interactive_p)
17778 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17779 (funcall_lambda, mark_backtrace): Likewise.
17780 * fns.c (concat): Likewise.
17781 * frame.c (x_set_frame_parameters): Likewise.
17782 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17783 0 if not found, not -1. All callers changed.
17784
17785 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17786 (stack_copy_size): Now size_t, not int.
17787 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17788
17789 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17790
17791 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17792 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17793 All callers changed.
17794
17795 * lisp.h (multibyte_char_to_unibyte):
17796 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17797 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17798 * character.h (CHAR_TO_BYTE8):
17799 * cmds.c (internal_self_insert):
17800 * editfns.c (general_insert_function):
17801 * keymap.c (push_key_description):
17802 * search.c (Freplace_match):
17803 * xdisp.c (message_dolog, set_message_1): All callers changed.
17804
17805 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17806
17807 * keyboard.c (safe_run_hook_funcall): New function.
17808 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17809 don't set the hook to nil, but remove the offending function instead.
17810 (Qcommand_hook_internal): Remove, unused.
17811 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17812 Vcommand_hook_internal.
17813
17814 * eval.c (enum run_hooks_condition): Remove.
17815 (funcall_nil, funcall_not): New functions.
17816 (run_hook_with_args): Call each function through a `funcall' argument.
17817 Remove `cond' argument, now redundant.
17818 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17819 (Frun_hook_with_args_until_failure): Adjust accordingly.
17820 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17821
17822 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17823
17824 * dispextern.h (string_buffer_position): Remove declaration.
17825
17826 * print.c (strout): Remove parameter `multibyte', unused since
17827 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17828
17829 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17830 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17831 All callers changed.
17832
17833 * w32.c (_wsa_errlist): Use braces for struct initializers.
17834
17835 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17836 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17837 All callers changed.
17838 (string_buffer_position): Likewise. Also, make static (it's never
17839 used outside xdisp.c).
17840 (cursor_row_p): Remove parameter `w', unused since
17841 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17842 (decode_mode_spec): Remove parameter `precision', introduced during
17843 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17844 All callers changed.
17845
17846 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17847
17848 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17849
17850 2011-03-27 Anders Lindgren <andlind@gmail.com>
17851
17852 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17853 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17854 (ns_update_auto_hide_menu_bar): New functions.
17855 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17856 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17857 ns_constrain_all_frames.
17858 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17859 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17860
17861 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17862
17863 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17864
17865 2011-03-27 Glenn Morris <rgm@gnu.org>
17866
17867 * syssignal.h: Replace RETSIGTYPE with void.
17868 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17869 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17870 Replace SIGTYPE with void everywhere.
17871 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17872 * s/template.h (SIGTYPE): Remove commented out definition.
17873
17874 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17875
17876 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17877 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17878
17879 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17880
17881 * w32.c (read_unc_volume): Use parameter `henum', instead of
17882 global variable `wget_enum_handle'.
17883
17884 * keymap.c (describe_vector): Remove parameters `indices' and
17885 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17886 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17887
17888 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17889
17890 * keyboard.c (timer_check): Remove parameter `do_it_now',
17891 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17892 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17893 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17894
17895 * keyboard.c (read_char):
17896 * w32menu.c (w32_menu_display_help):
17897 * xmenu.c (show_help_event, menu_help_callback):
17898 Adjust calls to `show_help_echo'.
17899
17900 * gtkutil.c (xg_maybe_add_timer):
17901 * keyboard.c (readable_events):
17902 * process.c (wait_reading_process_output):
17903 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17904
17905 * insdel.c (adjust_markers_gap_motion):
17906 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17907 (gap_left, gap_right): Don't call it.
17908
17909 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17910
17911 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17912 incurred during fontification.
17913
17914 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17915
17916 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17917 (DEFVAR_PER_BUFFER): Don't pass it.
17918
17919 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17920 (scrolling_window): Don't pass it.
17921
17922 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17923
17924 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17925
17926 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17927 and `suffix'.
17928 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17929 of variables specific to SELinux and computation of `encoded_absname'.
17930
17931 * image.c (XPutPixel): Remove unused variable `height'.
17932
17933 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17934
17935 * unexw32.c (get_section_info): Remove unused variable `section'.
17936
17937 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17938 (system_process_attributes): Remove unused variable `sess'.
17939 (sys_read): Remove unused variable `err'.
17940
17941 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17942 (w32_wnd_proc): Remove unused variable `isdead'.
17943 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17944 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17945 (x_create_tip_frame): Remove unused variable `tem'.
17946
17947 * w32inevt.c (w32_console_read_socket):
17948 Remove unused variable `no_events'.
17949
17950 * w32term.c (x_draw_composite_glyph_string_foreground):
17951 Remove unused variable `width'.
17952
17953 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17954
17955 * w32term.c (x_set_glyph_string_clipping):
17956 Don't pass uninitialized region to CombineRgn.
17957
17958 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17959
17960 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17961 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17962 (Fx_close_connection): Remove unused variable `i'.
17963
17964 * w32font.c (w32font_draw): Return number of glyphs.
17965 (w32font_open_internal): Remove unused variable `i'.
17966 (w32font_driver): Add missing initializer.
17967
17968 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17969 (fill_in_menu): Remove unused variable `items_added'.
17970
17971 * w32term.c (last_mouse_press_frame): Remove static global variable.
17972 (w32_clip_to_row): Remove unused variable `f'.
17973 (x_delete_terminal): Remove unused variable `i'.
17974
17975 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17976 (NOTHING): Remove unused static global variable.
17977 (uniscribe_check_otf): Remove unused variable `table'.
17978 (uniscribe_font_driver): Add missing initializers.
17979
17980 2011-03-23 Julien Danjou <julien@danjou.info>
17981
17982 * term.c (Fsuspend_tty, Fresume_tty):
17983 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17984 * window.c (temp_output_buffer_show):
17985 * insdel.c (signal_before_change):
17986 * frame.c (Fhandle_switch_frame):
17987 * fileio.c (Fdo_auto_save):
17988 * emacs.c (Fkill_emacs):
17989 * editfns.c (save_excursion_restore):
17990 * cmds.c (internal_self_insert):
17991 * callint.c (Fcall_interactively):
17992 * buffer.c (Fkill_all_local_variables):
17993 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17994 Use Frun_hooks.
17995 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17996 unconditionally since it does the check itself.
17997
17998 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17999
18000 Fix more problems found by GCC 4.5.2's static checks.
18001
18002 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18003 the first time through the loop, since we know p0 < p1 then.
18004 This also avoids a gcc -Wstrict-overflow warning.
18005
18006 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18007 leading to a memory leak, possible in functions like
18008 load_charset_map_from_file that can allocate an unbounded number
18009 of objects (Bug#8318).
18010
18011 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18012 that could (at least in theory) be that large.
18013
18014 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18015 This is less likely to overflow, and avoids undefined behavior if
18016 overflow does occur. All callers changed. Use strtoul to scan
18017 for the unsigned long integer.
18018 (pint2hrstr): Simplify and tune code slightly.
18019 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18020
18021 * scroll.c (do_scrolling): Work around GCC bug 48228.
18022 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18023
18024 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18025 This also avoids a warning with gcc -Wstrict-overflow.
18026 (validate_x_resource_name): Simplify count usage.
18027 This also avoids a warning with gcc -Wstrict-overflow.
18028
18029 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18030 fail (Bug#8306).
18031
18032 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18033
18034 * process.c (Fmake_network_process): Use socklen_t, not int,
18035 where POSIX says socklen_t is required in portable programs.
18036 This fixes a porting bug on hosts like 64-bit HP-UX, where
18037 socklen_t is wider than int (Bug#8277).
18038 (Fmake_network_process, server_accept_connection):
18039 (wait_reading_process_output, read_process_output):
18040 Likewise.
18041
18042 * process.c: Rename or move locals to avoid shadowing.
18043 (list_processes_1, Fmake_network_process):
18044 (read_process_output_error_handler, exec_sentinel_error_handler):
18045 Rename or move locals.
18046 (Fmake_network_process): Define label "retry_connect" only if needed.
18047 (Fnetwork_interface_info): Fix pointer signedness.
18048 (process_send_signal): Add cast to avoid pointer signedness problem.
18049 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18050 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18051
18052 Make tparam.h and terminfo.c consistent.
18053 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18054 Include tparam.h instead, since it declares them.
18055 * cm.h (PC): Remove extern decl; tparam.h now does this.
18056 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18057 * terminfo.c: Include tparam.h, to check interfaces.
18058 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18059 (tparam): Adjust signature to match interface in tparam.h;
18060 this removes some undefined behavior. Check that outstring and len
18061 are zero, which they always are with Emacs.
18062 * tparam.h (PC, BC, UP): New extern decls.
18063
18064 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18065 (xftfont_open): Rename locals to avoid shadowing.
18066
18067 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18068 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18069 (OTF_TAG_SYM): Omit macro if not needed.
18070 (ftfont_list): Remove unused local.
18071 (get_adstyle_property, ftfont_pattern_entity):
18072 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18073 Rename locals to avoid shadowing.
18074
18075 * xfont.c (xfont_list_family): Mark var as initialized.
18076
18077 * xml.c (make_dom): Now static.
18078
18079 * composite.c (composition_compute_stop_pos): Rename local to
18080 avoid shadowing.
18081 (composition_reseat_it): Remove unused locals.
18082 (find_automatic_composition, composition_adjust_point): Likewise.
18083 (composition_update_it): Mark var as initialized.
18084 (find_automatic_composition): Mark vars as initialized,
18085 with a FIXME (Bug#8290).
18086
18087 character.h: Rename locals to avoid shadowing.
18088 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18089 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18090 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18091 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18092 to avoid shadowing.
18093
18094 * textprop.c (property_change_between_p): Remove; unused.
18095
18096 * intervals.c (interval_start_pos): Now static.
18097
18098 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18099
18100 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18101 Rename locals to avoid shadowing.
18102
18103 * sound.c (wav_play, au_play, Fplay_sound_internal):
18104 Fix pointer signedness.
18105 (alsa_choose_format): Remove unused local var.
18106 (wav_play): Initialize a variable to 0, to prevent undefined
18107 behavior (Bug#8278).
18108
18109 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18110
18111 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18112
18113 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18114 clobbering (Bug#8298).
18115 * sysdep.c (sys_subshell): Likewise.
18116 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18117
18118 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18119 This should get cleaned up, so that child_setup has the
18120 same signature on all platforms.
18121
18122 * callproc.c (call_process_cleanup): Now static.
18123 (relocate_fd): Rename locals to avoid shadowing.
18124
18125 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18126
18127 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18128 not to be necessary, and produces flickering.
18129
18130 2011-03-20 Glenn Morris <rgm@gnu.org>
18131
18132 * config.in: Remove file.
18133
18134 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18135
18136 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18137 are now in src/globals.h.
18138 (syms_of_minibuf): Remove spurious & from previous change.
18139
18140 2011-03-20 Leo Liu <sdl.web@gmail.com>
18141
18142 * minibuf.c (completing-read-function): New variable.
18143 (completing-read-default): Rename from completing-read.
18144 (completing-read): Call completing-read-function.
18145
18146 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18147
18148 * xfaces.c (Fx_load_color_file):
18149 Read color file from absolute filename (bug#8250).
18150
18151 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18152
18153 * makefile.w32-in: Update dependencies.
18154
18155 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18156
18157 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18158
18159 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18160
18161 Fix more problems found by GCC 4.5.2's static checks.
18162
18163 * process.c (make_serial_process_unwind, send_process_trap):
18164 (sigchld_handler): Now static.
18165
18166 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18167 That way, the code declares only the vars that it needs.
18168 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18169 * s/cygwin.h (PTY_ITERATION): Likewise.
18170 * s/darwin.h (PTY_ITERATION): Likewise.
18171 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18172
18173 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18174 * process.c (allocate_pty): Don't declare stb unless it's needed.
18175
18176 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18177 (CONSTANTLIM): Remove; unused.
18178 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18179 Define only if needed.
18180
18181 * unexelf.c (unexec): Name an expression,
18182 to avoid gcc -Wbad-function-cast warning.
18183 Use a different way to cause a compilation error if anyone uses
18184 n rather than nn, a way that does not involve shadowing.
18185 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18186
18187 * deps.mk (unexalpha.o): Remove; unused.
18188
18189 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18190 * unexec.h: New file.
18191 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18192 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18193 Depend on unexec.h.
18194 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18195 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18196 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18197 Change as necessary to match prototype in unexec.h.
18198
18199 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18200 shadowing.
18201 (back_comment, skip_chars): Mark vars as initialized.
18202
18203 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18204 Rename locals to avoid shadowing.
18205
18206 * lread.c (read1): Rewrite so as not to use empty "else".
18207 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18208
18209 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18210
18211 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18212 warning when compiling print.c.
18213
18214 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18215 instead of using an uninitialized var.
18216 (font_sort_entities): Mark var as initialized.
18217
18218 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18219
18220 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18221 pointers to constants.
18222 (font_parse_fcname): Remove unused vars.
18223 (font_delete_unmatched): Now static.
18224 (font_get_spec): Remove; unused.
18225 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18226 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18227 Rename or move locals to avoid shadowing.
18228
18229 * fns.c (require_nesting_list, require_unwind): Now static.
18230 (Ffillarray): Rename locals to avoid shadowing.
18231
18232 * floatfns.c (domain_error2): Define only if needed.
18233 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18234
18235 * alloc.c (mark_backtrace): Move decl from here ...
18236 * lisp.h: ... to here, so that it can be checked.
18237
18238 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18239 (Fdefvar): Rewrite so as not to use empty "else".
18240 (lisp_indirect_variable): Name an expression,
18241 to avoid gcc -Wbad-function-cast warning.
18242 (Fdefvar): Rename locals to avoid shadowing.
18243
18244 * callint.c (quotify_arg, quotify_args): Now static.
18245 (Fcall_interactively): Rename locals to avoid shadowing.
18246 Use const pointer when appropriate.
18247
18248 * lisp.h (get_system_name, get_operating_system_release):
18249 Move decls here, to check interfaces.
18250 * process.c (get_operating_system_release): Move decl to lisp.h.
18251 * xrdb.c (get_system_name): Likewise.
18252 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18253 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18254 some of which prompt warnings from gcc -Wbad-function-cast.
18255 (Fformat_time_string, Fencode_time, Finsert_char):
18256 (Ftranslate_region_internal, Fformat):
18257 Rename or remove local vars to avoid shadowing.
18258 (Ftranslate_region_internal): Mark var as initialized.
18259
18260 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18261 avoid shadowing.
18262
18263 * lisp.h (eassert): Check that the argument compiles, even if
18264 ENABLE_CHECKING is not defined.
18265
18266 * data.c (Findirect_variable): Name an expression, to avoid
18267 gcc -Wbad-function-cast warning.
18268 (default_value, arithcompare, arith_driver, arith_error): Now static.
18269 (store_symval_forwarding): Rename local to avoid shadowing.
18270 (Fmake_variable_buffer_local, Fmake_local_variable):
18271 Mark variables as initialized.
18272 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18273
18274 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18275 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18276 Rename locals to avoid shadowing.
18277 (mark_stack): Move local variables into the #ifdef region where
18278 they're used.
18279 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18280 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18281 needed otherwise.
18282 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18283 (GC_STRING_CHARS): Remove; not used.
18284 (Fmemory_limit): Cast sbrk's returned value to char *.
18285
18286 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18287 avoids undefined behavior in theory.
18288
18289 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18290
18291 Use functions, not macros, for up- and down-casing (Bug#8254).
18292 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18293 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18294 to use the following functions instead of these macros.
18295 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18296 EMACS_INT, since callers assume the returned value fits in int.
18297 (upcase1): Likewise, for UPCASE_TABLE.
18298 (uppercasep, lowercasep, upcase): New static inline functions.
18299 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18300 the race-condition problem in the old DOWNCASE.
18301
18302 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18303 Rename locals to avoid shadowing.
18304 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18305 (regex_compile, re_search_2, re_match_2_internal):
18306 Remove unused local vars.
18307 (FREE_VAR): Rewrite so as not to use empty "else",
18308 which gcc can warn about.
18309 (regex_compile, re_match_2_internal): Mark locals as initialized.
18310 (RETALLOC_IF): Define only if needed.
18311 (WORDCHAR_P): Likewise. This one is never needed, but is used
18312 only in a comment talking about a compiler bug, so put inside
18313 the #if 0 of that comment.
18314 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18315 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18316 Remove; unused.
18317
18318 * search.c (boyer_moore): Rename locals to avoid shadowing.
18319 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18320 (PREV_CHAR_BOUNDARY): Likewise.
18321
18322 * search.c (simple_search): Remove unused var.
18323
18324 * dired.c (compile_pattern): Move decl from here ...
18325 * lisp.h: ... to here, so that it can be checked.
18326 (struct re_registers): New forward decl.
18327
18328 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18329
18330 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18331 All uses changed.
18332 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18333 Rename locals to avoid shadowing.
18334 (Fvertical_motion): Mark locals as initialized.
18335
18336 * casefiddle.c (casify_object, casify_region): Now static.
18337 (casify_region): Mark local as initialized.
18338
18339 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18340
18341 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18342 New macros, so that the caller can use some names other than
18343 gcpro1, gcpro2, etc.
18344 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18345 of the new macros.
18346 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18347 argument, for consistency with GCPRO2_VAR, etc: it is now the
18348 prefix of the variable, not the variable itself. All uses
18349 changed.
18350 * dired.c (directory_files_internal, file_name_completion):
18351 Rename locals to avoid shadowing.
18352
18353 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18354 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18355 dired.c's scmp function, had undefined behavior.
18356 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18357 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18358 * buffer.h: ... to here, because these macros use current_buffer,
18359 and the new implementation with inline functions needs to have
18360 current_buffer in scope now, rather than later when the macros
18361 are used.
18362 (downcase, upcase1): New static inline functions.
18363 (DOWNCASE, UPCASE1): Reimplement using these functions.
18364 This avoids undefined behavior in expressions like
18365 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18366 from race conditions in accessing the global variables
18367 case_temp1 and case_temp2.
18368 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18369 * lisp.h (case_temp1, case_temp2): Remove their decls.
18370 * character.h (ASCII_CHAR_P): Move from here ...
18371 * lisp.h: ... to here, so that the inline functions mentioned
18372 above can use them.
18373
18374 * dired.c (directory_files_internal_unwind): Now static.
18375
18376 * fileio.c (file_name_as_directory, directory_file_name):
18377 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18378 Now static.
18379 (file_name_as_directory): Use const pointers when appropriate.
18380 (Fexpand_file_name): Likewise. In particular, newdir might
18381 point at constant storage, so make it a const pointer.
18382 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18383 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18384 signedness issues.
18385 (Fset_file_times, Finsert_file_contents, auto_save_error):
18386 Rename locals to avoid shadowing.
18387
18388 * minibuf.c (choose_minibuf_frame_1): Now static.
18389 (Ftry_completion, Fall_completions): Rename or remove locals
18390 to avoid shadowing.
18391
18392 * marker.c (bytepos_to_charpos): Remove; unused.
18393
18394 * lisp.h (verify_bytepos, count_markers): New decls,
18395 so that gcc does not warn that these functions aren't declared.
18396
18397 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18398 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18399 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18400 (copy_text): Remove unused local var.
18401
18402 * filelock.c (within_one_second): Now static.
18403 (lock_file_1): Rename local to avoid shadowing.
18404
18405 * buffer.c (fix_overlays_before): Mark locals as initialized.
18406 (fix_start_end_in_overlays): Likewise. This function should be
18407 simplified by using pointers-to-pointers, but that's a different
18408 matter.
18409 (switch_to_buffer_1): Now static.
18410 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18411 (report_overlay_modification): Rename locals to avoid shadowing.
18412
18413 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18414 Fix pointer signedness issue.
18415 (sys_subshell): Mark local as volatile if checking for lint,
18416 to suppress a gcc -Wclobbered warning that does not seem to be right.
18417 (MAXPATHLEN): Define only if needed.
18418
18419 * process.c (serial_open, serial_configure): Move decls from here ...
18420 * systty.h: ... to here, so that they can be checked.
18421
18422 * fns.c (get_random, seed_random): Move extern decls from here ...
18423 * lisp.h: ... to here, so that they can be checked.
18424
18425 * sysdep.c (reset_io): Now static.
18426 (wait_for_termination_signal): Remove; unused.
18427
18428 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18429 (copy_keymap_item, append_key, push_text_char_description):
18430 Now static.
18431 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18432 (DENSE_TABLE_SIZE): Remove; unused.
18433 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18434 (describe_map_tree):
18435 Rename locals to avoid shadowing.
18436
18437 * keyboard.c: Declare functions static if they are not used elsewhere.
18438 (echo_char, echo_dash, cmd_error, top_level_2):
18439 (poll_for_input, handle_async_input): Now static.
18440 (read_char, kbd_buffer_get_event, make_lispy_position):
18441 (make_lispy_event, make_lispy_movement, apply_modifiers):
18442 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18443 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18444 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18445 (read_key_sequence, read_char): Mark locals as initialized.
18446 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18447
18448 * keyboard.h (make_ctrl_char): New decl.
18449 (mark_kboards): Move decl here ...
18450 * alloc.c (mark_kboards): ... from here.
18451
18452 * lisp.h (force_auto_save_soon): New decl.
18453
18454 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18455 (DEFINE_DUMMY_FUNCTION): New macro.
18456 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18457 Use it.
18458 (main): Add casts to avoid warnings
18459 if GCC considers string literals to be constants.
18460
18461 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18462
18463 * dbusbind.c: Pointer signedness fixes.
18464 (xd_signature, xd_append_arg, xd_initialize):
18465 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18466 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18467 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18468 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18469
18470 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18471 if GCC considers string literals to be constants.
18472 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18473
18474 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18475
18476 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18477 (print_preprocess, print_object): New macro to fix last change.
18478
18479 * print.c (print_preprocess): Don't forget font objects.
18480
18481 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
18482
18483 * emacs.c (USAGE3): Doc fixes.
18484
18485 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18486
18487 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18488 structure.
18489
18490 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
18491
18492 * lisp.h (VWindow_system, Qfile_name_history):
18493 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18494 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18495 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18496
18497 * w32select.c: Don't #include "keyboard.h".
18498 (run_protected): Add extern declaration for waiting_for_input.
18499
18500 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18501 * w32console.c (detect_input_pending, read_input_pending)
18502 (encode_terminal_code):
18503 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18504 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18505 (w32_system_caret_y, Qfile_name_history):
18506 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18507 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18508 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18509 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18510 * w32proc.c (Qlocal, report_file_error):
18511 * w32term.c (Vwindow_system, updating_frame):
18512 * w32uniscribe.c (initialized, uniscribe_font_driver):
18513 Remove unneeded extern declarations.
18514
18515 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
18516
18517 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18518
18519 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
18520
18521 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18522 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18523 These macros can no longer be used for assignment.
18524
18525 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18526 Assign struct members directly, instead of using BUF_BEGV etc.
18527 (record_buffer_markers, fetch_buffer_markers): New functions for
18528 recording and fetching special buffer markers.
18529 (set_buffer_internal_1, set_buffer_temp): Use them.
18530
18531 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18532
18533 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18534
18535 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18536 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18537
18538 * xdisp.c (hscroll_window_tree):
18539 (reconsider_clip_changes): Use PT instead of BUF_PT.
18540
18541 2011-03-13 Eli Zaretskii <eliz@gnu.org>
18542
18543 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18544 $(EMACS_ROOT)/lib/intprops.h.
18545
18546 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18547
18548 Fix more problems found by GCC 4.5.2's static checks.
18549
18550 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18551 to unsigned char * to avoid compiler diagnostic.
18552 (xg_free_frame_widgets): Make it clear that a local variable is
18553 needed only if USE_GTK_TOOLTIP.
18554 (gdk_window_get_screen): Make it clear that this macro is needed
18555 only if USE_GTK_TOOLTIP.
18556 (int_gtk_range_get_value): New function, which avoids a diagnostic
18557 from gcc -Wbad-function-cast.
18558 (xg_set_toolkit_scroll_bar_thumb): Use it.
18559 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18560 diagnostic from gcc -Wbad-function-cast.
18561 (get_utf8_string, xg_get_file_with_chooser):
18562 Rename locals to avoid shadowing.
18563 (create_dialog): Move locals to avoid shadowing.
18564
18565 * xgselect.c (xg_select): Remove unused var.
18566
18567 * image.c (four_corners_best): Mark locals as initialized.
18568 (gif_load): Initialize transparent_p to zero (Bug#8238).
18569 Mark another local as initialized.
18570 (my_png_error, my_error_exit): Mark with NO_RETURN.
18571
18572 * image.c (clear_image_cache): Now static.
18573 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18574 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18575 (x_edge_detection): Remove unnecessary cast that
18576 gcc -Wbad-function-cast diagnoses.
18577 (gif_load): Fix pointer signedness.
18578 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18579 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18580
18581 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18582
18583 Improve quality of tests for time stamp overflow.
18584 For example, without this patch (encode-time 0 0 0 1 1
18585 1152921504606846976) returns the obviously-bogus value (-948597
18586 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18587 reports time overflow. See
18588 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18589 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18590 * editfns.c: Include limits.h and intprops.h.
18591 (TIME_T_MIN, TIME_T_MAX): New macros.
18592 (time_overflow): Move earlier, to before first use.
18593 (hi_time, lo_time): New functions, for an accurate test for
18594 out-of-range times.
18595 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18596 (Fget_internal_run_time): Don't assume time_t fits in int.
18597 (make_time): Use list2 instead of Fcons twice.
18598 (Fdecode_time): More accurate test for out-of-range times.
18599 (check_tm_member): New function.
18600 (Fencode_time): Use it, to test for out-of-range times.
18601 (lisp_time_argument): Don't rely on undefined left-shift and
18602 right-shift behavior when checking for time stamp overflow.
18603
18604 * editfns.c (time_overflow): New function, refactoring common code.
18605 (Fformat_time_string, Fdecode_time, Fencode_time):
18606 (Fcurrent_time_string): Use it.
18607
18608 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18609 * dired.c (make_time): Move to ...
18610 * editfns.c (make_time): ... here.
18611 * systime.h: Note the move.
18612
18613 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18614
18615 * fringe.c (update_window_fringes): Remove unused variables.
18616
18617 * unexmacosx.c (copy_data_segment): Also copy __got section.
18618 (Bug#8223)
18619
18620 2011-03-12 Eli Zaretskii <eliz@gnu.org>
18621
18622 * termcap.c [MSDOS]: Include "msdos.h".
18623 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18624 Constify `char *' arguments and their references according to
18625 prototypes in tparam.h.
18626
18627 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18628
18629 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18630 Adapt all references accordingly.
18631
18632 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18633
18634 2011-03-11 Tom Tromey <tromey@redhat.com>
18635
18636 * buffer.c (syms_of_buffer): Remove obsolete comment.
18637
18638 2011-03-11 Eli Zaretskii <eliz@gnu.org>
18639
18640 * termhooks.h (encode_terminal_code): Declare prototype.
18641
18642 * msdos.c (encode_terminal_code): Don't declare prototype.
18643
18644 * term.c (encode_terminal_code): Now external again, used by
18645 w32console.c and msdos.c.
18646
18647 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18648 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18649
18650 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
18651
18652 Fix some minor problems found by GCC 4.5.2's static checks.
18653
18654 * fringe.c (update_window_fringes): Mark locals as initialized
18655 (Bug#8227).
18656 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18657
18658 * alloc.c (mark_fringe_data): Move decl from here ...
18659 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18660 to check its interface.
18661 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18662
18663 * fontset.c (free_realized_fontset): Now static.
18664 (Fset_fontset_font): Rename local to avoid shadowing.
18665 (fontset_font): Mark local as initialized.
18666 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18667
18668 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18669
18670 * xselect.c (x_disown_buffer_selections): Remove; not used.
18671 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18672 (x_own_selection, Fx_disown_selection_internal): Rename locals
18673 to avoid shadowing.
18674 (x_handle_dnd_message): Remove local to avoid shadowing.
18675
18676 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18677 so that the caller can use some name other than gcpro1.
18678 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18679 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18680 (Fx_backspace_delete_keys_p):
18681 Use them to avoid shadowing, and rename vars to avoid shadowing.
18682 (x_decode_color, x_set_name, x_window): Now static.
18683 (Fx_create_frame): Add braces to silence GCC warning.
18684 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18685 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18686 Remove unused locals.
18687 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18688 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18689 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18690 macros.
18691
18692 * xterm.h (x_mouse_leave): New decl.
18693
18694 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18695 Remove unused functions.
18696 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18697 (x_calc_absolute_position): Now static.
18698 (XTread_socket): Don't define label "out" unless it's used.
18699 Don't declare local "event" unless it's used.
18700 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18701 unless they are used.
18702 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18703 (x_fatal_error_signal): Remove; not used.
18704 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18705 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18706 (x_error_catcher, x_connection_closed, x_error_handler):
18707 (x_error_quitter, xembed_send_message, x_iconify_frame):
18708 (my_log_handler): Rename locals to avoid shadowing.
18709 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18710 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18711
18712 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18713 Rename or move locals to avoid shadowing.
18714 (tty_defined_color, merge_face_heights): Now static.
18715 (free_realized_faces_for_fontset): Remove; not used.
18716 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18717 does not deduce is never used uninitialized.
18718 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18719 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18720
18721 * terminal.c (store_terminal_param): Now static.
18722
18723 * xmenu.c (menu_highlight_callback): Now static.
18724 (set_frame_menubar): Remove unused local.
18725 (xmenu_show): Rename parameter to avoid shadowing.
18726 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18727 since they might point to immutable storage.
18728 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18729 since it's unused otherwise.
18730
18731 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18732 Add a FIXME, since the code still doesn't look right. (Bug#8215)
18733 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18734 avoids a gcc -Wuninitialized diagnostic.
18735 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18736 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18737 does not deduce are never used uninitialized.
18738
18739 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18740
18741 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18742 * window.c (window_loop, size_window):
18743 (run_window_configuration_change_hook, enlarge_window): Likewise.
18744
18745 * window.c (display_buffer): Now static.
18746 (size_window): Mark variables that gcc -Wuninitialized
18747 does not deduce are never used uninitialized.
18748 * window.h (check_all_windows): New decl, to forestall
18749 gcc -Wmissing-prototypes diagnostic.
18750 * dispextern.h (bidi_dump_cached_states): Likewise.
18751
18752 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18753 shadowing.
18754 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18755 Include <limits.h>.
18756 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18757 and to avoid gcc -Wuninitialized warning.
18758 (load_charset_map): Mark variables that gcc -Wuninitialized
18759 does not deduce are never used uninitialized.
18760 (load_charset): Abort instead of using uninitialized var (Bug#8229).
18761
18762 * coding.c (coding_set_source, coding_set_destination):
18763 Use "else { /* comment */ }" rather than "else /* comment */;"
18764 for clarity, and to avoid gcc -Wempty-body warning.
18765 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18766 a block, when the outer 'i' will do.
18767 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18768 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18769 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18770 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18771 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18772 Rename locals to avoid shadowing.
18773 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
18774 * coding.c (emacs_mule_char, encode_invocation_designation):
18775 Now static, since they're not used elsewhere.
18776 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
18777 (decode_coding_object, encode_coding_object, detect_coding_system):
18778 (decode_coding_emacs_mule): Mark variables that gcc
18779 -Wuninitialized does not deduce are never used uninitialized.
18780 (detect_coding_iso_2022): Initialize a local variable that might
18781 be used uninitialized. Leave a FIXME because it's not clear that
18782 this initialization is needed. (Bug#8211)
18783 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18784 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18785 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18786 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18787 Remove unused macros.
18788
18789 * category.c (hash_get_category_set): Remove unused local var.
18790 (copy_category_table): Now static, since it's not used elsewhere.
18791 * character.c (string_count_byte8): Likewise.
18792
18793 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18794 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18795
18796 * chartab.c (copy_sub_char_table): Now static, since it's not used
18797 elsewhere.
18798 (sub_char_table_ref_and_range, char_table_ref_and_range):
18799 Rename locals to avoid shadowing.
18800 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
18801
18802 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18803 (BIDI_BOB): Remove unused macro.
18804
18805 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18806 deduce are never used uninitialized.
18807 * term.c (encode_terminal_code): Likewise.
18808
18809 * term.c (encode_terminal_code): Now static. Remove unused local.
18810
18811 * tparam.h: New file.
18812 * term.c, tparam.h: Include it.
18813 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18814 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18815 Move these decls to tparam.h, and make them agree with what
18816 is actually in tparam.c. The previous trick of using incompatible
18817 decls in different modules does not conform to the C standard.
18818 All callers of tparam changed to use tparam's actual API.
18819 * tparam.c (tparam1, tparam, tgoto):
18820 Use const pointers where appropriate.
18821
18822 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18823 * cm.h (struct cm): Likewise.
18824 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18825 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18826 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18827 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18828 (turn_on_face, init_tty): Likewise.
18829 * termchar.h (struct tty_display_info): Likewise.
18830
18831 * term.c (term_mouse_position): Rename local to avoid shadowing.
18832
18833 * alloc.c (mark_ttys): Move decl from here ...
18834 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18835
18836 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18837
18838 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18839
18840 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
18841
18842 * search.c (compile_pattern_1): Remove argument regp, unused since
18843 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18844 (compile_pattern): Don't pass it.
18845
18846 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18847
18848 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18849 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18850 for ! HAVE_GTK3.
18851 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18852
18853 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18854
18855 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18856 gdk_window_get_screen, gdk_window_get_geometry,
18857 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18858 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18859 (xg_get_pixbuf_from_pixmap): New function.
18860 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18861 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18862 Call xg_get_pixbuf_from_pixmap instead of
18863 gdk_pixbuf_get_from_drawable.
18864 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18865 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18866 (xg_check_special_colors): Use GtkStyleContext and its functions
18867 for HAVE_GTK3.
18868 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18869 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18870 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18871 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18872 Call gtk_widget_get_preferred_size.
18873 (xg_frame_resized): gdk_window_get_geometry only takes 5
18874 parameters.
18875 (xg_win_to_widget, xg_event_is_for_menubar):
18876 Call gdk_x11_window_lookup_for_display.
18877 (xg_set_widget_bg): New function.
18878 (delete_cb): New function.
18879 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18880 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18881 (xg_set_background_color): Call xg_set_widget_bg.
18882 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18883 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18884 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18885 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18886 if ! HAVE_GTK3.
18887 (update_frame_tool_bar): Call gtk_widget_hide.
18888 (xg_initialize): Use GDK_KEY_g.
18889
18890 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18891 if ! HAVE_GTK3
18892 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18893
18894 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18895 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18896 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18897
18898 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18899
18900 * w32xfns.c (select_palette): Check success of RealizePalette against
18901 GDI_ERROR, not zero.
18902
18903 See ChangeLog.11 for earlier changes.
18904
18905 ;; Local Variables:
18906 ;; coding: utf-8
18907 ;; End:
18908
18909 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18910
18911 This file is part of GNU Emacs.
18912
18913 GNU Emacs is free software: you can redistribute it and/or modify
18914 it under the terms of the GNU General Public License as published by
18915 the Free Software Foundation, either version 3 of the License, or
18916 (at your option) any later version.
18917
18918 GNU Emacs is distributed in the hope that it will be useful,
18919 but WITHOUT ANY WARRANTY; without even the implied warranty of
18920 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18921 GNU General Public License for more details.
18922
18923 You should have received a copy of the GNU General Public License
18924 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.