xdisp.c (reseat_1): Make the information stored in it->cmp_it invalidate.
[bpt/emacs.git] / src / ChangeLog
1 2012-10-17 Kenichi Handa <handa@gnu.org>
2
3 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4 invalidate.
5
6 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
7
8 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
9
10 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
11
12 * coding.c (detect_coding): Set coding->id before calling
13 this->detector.
14
15 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
16
17 * fileio.c: Formatting fixes.
18
19 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
20
21 Fix some stat-related races.
22 * fileio.c (Fwrite_region): Avoid race condition if a file is
23 removed or renamed by some other process immediately after Emacs
24 writes it but before Emacs stats it. Do not assume that stat (or
25 fstat) succeeds.
26 * image.c (slurp_file): Resolve the file name with fopen + fstat
27 rather than stat + fopen.
28 (pbm_read_file) [0]: Remove unused code with stat race.
29 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
30 Remove ineffective code with stat race.
31
32 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
33
34 * doc.c (get_doc_string): Don't signal an error if the file is missing.
35
36 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
37
38 * nsterm.m (hold_event_q): New static variable.
39 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
40 ! q_event_ptr.
41 (hold_event): New function.
42 (ns_read_socket): If hold_event_q have events, store them and
43 return (Bug#12384).
44 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
45 is zero (Bug#12384).
46
47 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
48
49 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
50
51 2012-10-12 Eli Zaretskii <eliz@gnu.org>
52
53 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
54
55 * fileio.c (check_existing): New function.
56 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
57 instead of calling 'stat', when what's needed is to check whether
58 a file exists. This avoids expensive system calls on MS-Windows.
59 (Bug#12587)
60
61 * w32.c (init_environment): Call 'check_existing' instead of
62 'stat'.
63
64 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
65 determine whether a file exists and is not a directory.
66
67 * lisp.h (check_existing): Add prototype.
68
69 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
70
71 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
72
73 2012-10-12 Glenn Morris <rgm@gnu.org>
74
75 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
76
77 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
78
79 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
80
81 * eval.c (Fautoload): Remember previous autoload status in load-history.
82
83 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
84
85 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
86 * lread.c (load_each_byte, new_backquote_flag, readchar)
87 (read_filtered_event, lisp_file_lexically_bound_p)
88 (safe_to_load_version, Fload, complete_filename_p, openp)
89 (build_load_history, readevalloop, read_escape, read1)
90 (string_to_number, read_vector, read_list):
91 * macros.c (Fstart_kbd_macro):
92 * marker.c (CONSIDER):
93 * menu.c (parse_single_submenu, digest_single_submenu)
94 (find_and_return_menu_selection, Fx_popup_menu):
95 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
96 (Ftry_completion):
97 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
98 (ns_menu_show):
99 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
100 (xmenu_show, xdialog_show):
101 Use bool for booleans.
102 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
103 as it's not a predicate. All uses changed. Omit unnecessary
104 buffer termination.
105
106 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
107
108 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
109 (save_excursion_restore): Do not restore mark if it was not saved.
110
111 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
112
113 * marker.c (cached_modiff): EMACS_INT, not int.
114
115 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
116 instead of having a wrong decl.
117 * nsmenu.m (waiting_for_input): Remove wrong decl.
118
119 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
120
121 keyboard.c, keymap.c: Use bool for booleans.
122 * dispnew.c (sit_for): Distinguish between 3-way display_option
123 and boolean do_display.
124 * keyboard.c (single_kboard, this_command_key_count_reset)
125 (waiting_for_input, echoing, immediate_quit, input_pending)
126 (interrupt_input, interrupts_deferred, pop_kboard)
127 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
128 (command_loop_1, adjust_point_for_property)
129 (safe_run_hooks_error, input_polling_used, read_char):
130 (help_char_p, readable_events, kbd_buffer_events_waiting)
131 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
132 (lucid_event_type_list_p, get_input_pending):
133 (gobble_input, menu_separator_name_p, menu_bar_item)
134 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
135 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
136 (keyremap_step, test_undefined, read_key_sequence)
137 (detect_input_pending, detect_input_pending_ignore_squeezables)
138 (detect_input_pending_run_timers, requeued_events_pending_p)
139 (quit_throw_to_read_char, Fset_input_interrupt_mode):
140 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
141 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
142 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
143 (accessible_keymaps_1, Fkey_description, push_key_description):
144 (shadow_lookup, struct where_is_internal_data)
145 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
146 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
147 (describe_map, describe_vector):
148 * menu.c (single_menu_item):
149 * nsmenu.m (ns_update_menubar):
150 * process.c (wait_reading_process_output):
151 * search.c (scan_buffer, scan_newline):
152 Use bool for boolean.
153 * keyboard.c (timers_run, swallow_events)
154 (detect_input_pending_run_timers):
155 * process.c (wait_reading_process_output):
156 Use unsigned for counter where wraparound-on-overflow is desired,
157 since unsigned is guaranteed to have that behavior and signed is not.
158 (read_char): Use ptrdiff_t for string length.
159 (get_input_pending): Remove first argument, since it was always
160 the same pointer-to-int (now pointer-to-boolean) &input_pending,
161 and behave as if it had that value. Return new value of
162 input_pending. All callers changed.
163 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
164 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
165 a string length.
166 * keymap.c (push_key_description): Omit last arg, which was always 1.
167 All callers changed.
168
169 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
170
171 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
172
173 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
174 ($(BLD)/term.$(O)): Update dependencies.
175
176 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
177
178 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
179 * lisp.h (enum pvec_type): Adjust comments and omit explicit
180 initializer for PVEC_NORMAL_VECTOR.
181
182 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
183
184 Clean out old termopts cruft.
185 * termopts.h (flow_control, meta_key): Remove unused decls.
186 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
187 Don't include termopts.h.
188
189 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
190
191 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
192
193 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
194
195 * commands.h (immediate_quit): Remove duplicate decl.
196
197 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
198
199 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
200 caching.
201 (nsfont_open): Remove setting of Vfonts_in_cache.
202 (syms_of_nsfont): Remove initialization of Vfonts_in_cache
203
204 2012-10-09 Eli Zaretskii <eliz@gnu.org>
205
206 * w32fns.c (w32_last_error): Change the return value to DWORD, to
207 match what GetLastError returns. Explain why the function is
208 needed.
209
210 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
211 'is_tooltip_frame', to avoid confusion with its global namesake.
212
213 2012-10-08 Daniel Colascione <dancol@dancol.org>
214
215 * xdisp.c (start_hourglass): Call w32_note_current_window when
216 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
217 build that caused Emacs to display the hourglass cursor forever.
218
219 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
220 which is broken under remote desktop, calculate the number of
221 colors available for a display based on the display's number of
222 planes and number of bits per pixel per plane. (bug#10397).
223
224 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
225
226 * nsfont.m (Vfonts_in_cache): New variable.
227 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
228 are used. Add cached fonts to Vfonts_in_cache.
229 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
230
231 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
232
233 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
234 in nt/config.nt.
235 (FONT_H): Define after FRAME_H.
236 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
237 Update dependencies.
238
239 * w32term.c: Remove leftover declaration of keyboard_codepage.
240
241 2012-10-08 Eli Zaretskii <eliz@gnu.org>
242
243 * makefile.w32-in (FONT_H): Add $(FRAME_H).
244 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
245 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
246 (GLOBAL_SOURCES): Add cygw32.c.
247 ($(BLD)/unexw32.$(O)):
248 ($(BLD)/w32.$(O)):
249 ($(BLD)/w32console.$(O)):
250 ($(BLD)/w32fns.$(O)):
251 ($(BLD)/w32heap.$(O)):
252 ($(BLD)/w32menu.$(O)):
253 ($(BLD)/w32proc.$(O)): Add w32common.h.
254
255 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
256 'const char *'.
257 (x_to_w32_color): Don't modify the argument, modify a copy instead.
258
259 2012-10-08 Daniel Colascione <dancol@dancol.org>
260
261 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
262 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
263 accidental message numbering hole. Change other messages to
264 match.
265
266 * w32select.h (HAVE_W32SELECT): Remove.
267
268 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
269 w32common.h instead of w32heap.h
270
271 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
272 (get_allocation_unit, get_processor_type, get_w32_major_version)
273 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
274 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
275 (OS_NT, os_subtype, cache_system_info): Move declarations to
276 w32common.
277
278 * w32heap.c: Include w32common.h.
279 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
280 (w32_minor_version, w32_build_number, w32_subtype): Remove
281 duplicate definitions.
282
283 * w32fns.c: Include w32common.h; include w32heap.h only in
284 WINDOWSNT.
285
286 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
287 Use `report_file_error' instead of `error' in order to better
288 inform users of what went wrong. Increase NTGUI_UNICODE file
289 dialog box file name length to 32k, the maximum allowed by the NT
290 kernel.
291
292 * w32common.h: New file.
293 (ROUND_UP, ROUND_DOWN, get_page_size)
294 (get_allocation_unit, get_processor_type, get_w32_major_version)
295 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
296 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
297 (OS_NT, os_subtype, cache_system_info): Move here.
298
299 * unexw32.c, unexcw.c: Include w32common.h.
300
301 * emacs.c (main): Use (defined (WINDOWSNT) || defined
302 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
303 to call syms_of_w32select.
304
305 * cygw32.h: Remove obsolete EXFUN declarations.
306
307 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
308
309 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
310 of w32inevt.o from SOME_MACHINE_OBJECTS.
311
312 2012-10-08 Daniel Colascione <dancol@dancol.org>
313
314 * image.c: Permanent fix for JPEG compilation issue --- limit
315 jpeglib `boolean' redefinition to Cygwin builds.
316
317 2012-10-08 Eli Zaretskii <eliz@gnu.org>
318
319 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
320
321 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
322 Cygwin.
323
324 2012-10-08 Daniel Colascione <dancol@dancol.org>
325
326 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
327 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
328 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
329 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
330 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
331 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
332 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
333 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
334 now a supported configuration.
335
336 * Makefile.in: consolidate image variables into LIBIMAGE; add
337 W32_OBJ and W32_LIBS. Compile new files.
338
339 * conf_post.h:
340 (_DebPrint) declare tracing facility for W32 debugging. We need
341 to unify tracing later.
342
343 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
344 unconditional use of W32 Unicode functions. Cygwin runs only on
345 100% Unicode operating systems.
346
347 * cygw32.c: New file. Define Cygwin-specific facilities.
348 (Fcygwin_convert_path_to_windows)
349 (Fcygwin_convert_path_from_windows): New user functions for
350 accessing Cygwin path-munging routines.
351
352 * cygw32.h: New file.
353 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
354 UTF-16LE strings temporarily inside non-Lisp-visible string
355 objects.
356
357 (w32_strerror): Just what it says on the tin.
358
359 * emacs.c: Make the NS fork-then-exec code for daemon-launching
360 also run for Cygwin; both systems have the same problem with using
361 GUI facilities in a forked child. Also call syms_of_cygw32,
362 syms_of_w32select in correct places.
363
364 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
365 needs fork-then-exec for daemon launching.
366
367 * font.h: Include frame.h.
368
369 * image.c: Use the image library cache machinery only when we're
370 compiling for native WINDOWSNT; Cygwin can use shared libraries
371 like any other Unixlike system.
372
373 * keyboard.c: Clarify a comment regarding the input loop.
374
375 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
376 functions directly instead of trying to detect at runtime that our
377 host operating system supports them. We make this change for two
378 reasons: Cygwin lacks support for the multibyte character
379 conversion functions used by the legacy menu code, and Cygwin
380 never needs to rely on non-Unicode APIs.
381
382 * unexw32.c (hinst): Declare extern.
383
384 * w32.c: Change header order;
385 (w32_strerror): Move to w32fns.c because we need it for
386 non-WINDOWSNT builds.
387
388 * w32.h: Add #error macro to make sure we don't include w32.h for
389 Cygwin builds. Remove w32select declarations.
390
391 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
392 w32fns.c. w32console.c is WINDOWSNT-only.
393
394 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
395 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
396 POSIXy alternative.
397 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
398 (w32_major_version, w32_minor_version, w32_build_number)
399 (os_subtype, sound_type): Define here
400 (w32_defined_color): Make color parameter const for consistency
401 with other _defined_color functions.
402 (w32_createwindow): Unconditionally call w32_init_class instead of
403 doing so only when hprevinst is non-NULL. Plumbing hprevinst
404 through the code is complex and unnecessary because class
405 registration is practically free.
406 (w32_name_of_message): New EMACSDEBUG-only function.
407 (Fset_message_beep): Move here
408 (Fx_open_connection): Require that the display name for Windows be
409 "w32" for consistency, emacsclient disambiguation, and maybe, one
410 day, multi-window-system support.
411 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
412 Cygwin files for W32 GUI facilities, since these clearly don't
413 expect Cygwin names.
414 (_DebPrint): Define.
415 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
416 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
417 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
418 (w32_last_error): Remove.
419
420 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
421
422 * w32heap.c (syspage_mask): Declare here.
423 (cache_system_info): Remove.
424
425 * w32inevt.c (faked_key): Define globally, not statically.
426 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
427 (w32_console_toggle_lock_key): Move to w32fns.c.
428
429 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
430
431 * w32proc.c (_DebPrint): Move to w32fns.c.
432 * w32select.c: Include string.h, stdio.h for Cygwin.
433 * w32select.h: New File.
434
435 * w32term.c: Include io.h for non-CYGWIN builds; needed for
436 get_osfhandle.
437 (w32_message_fd): New variable. Under Cygwin, holds the file
438 descriptor the system used to tell us about pending thread
439 messages.
440
441 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
442 that prevented compilation under non-WINDOWSNT systems.
443
444 (w32_initialize): Open /dev/windows and assign it to
445 w32_message_fd. Provide w32 feature.
446
447 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
448 (WM_EMACS_INPUT_READY): add.
449 (prepend_msg, w32_message_fd): Declare globally.
450
451 * w32xfns.c:
452 (keyboard_handle): Use only when WINDOWSNT.
453 (notify_msg_ready): New function. Posts a message to the main
454 thread's message queue under CYGWIN, which wakes up the main
455 thread from select(2) by making the /dev/windows file descriptor
456 ready. Under WINDOWSNT, it sets an event the same way the old
457 code did.
458
459 (post, prepend_msg): Actually call notify_msg_ready instead of
460 setting the input event directly.
461
462 2012-10-07 Eli Zaretskii <eliz@gnu.org>
463
464 * ralloc.c (relinquish): If a heap is ready to be relinquished,
465 but it still has blocs in it, don't return it to the system,
466 instead of aborting. (Bug#12402)
467
468 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
469
470 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
471
472 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
473 MAC_OS_X_VERSION_10_6.
474 (syms_of_nsterm): Remove comment about Panther and above for
475 ns-antialias-text.
476 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
477 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
478 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
479
480 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
481 MAC_OS_X_VERSION_10_4.
482
483 * nsmenu.m (fillWithWidgetValue:): Remove code for <
484 MAC_OS_X_VERSION_10_2.
485
486 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
487
488 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
489 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
490
491 * nsterm.m (ns_in_resize): Remove (Bug#12479).
492 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
493 (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove
494 ns_in_resize check.
495 (ns_clear_frame_area): Remove resize handle code.
496
497 * nsfns.m (ns_in_resize): Remove.
498 (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
499 ns_in_resize check.
500
501 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
502
503 Improve sys_siglist detection.
504 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
505 defined as a macro, as is done in Solaris.
506 (sys_siglist_entries): New macro.
507 (save_strsignal): Use it.
508 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
509 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
510
511 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
512
513 * nsfns.m (Fx_create_frame): Call x_default_parameter with
514 fullscreen/Fullscreen.
515
516 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
517 tobar_height is new.
518
519 * nsterm.m (x_make_frame_visible): Check for fullscreen.
520 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
521 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
522 (windowDidResize:): Check for correct window if old style fullscreen.
523 Capitalize word in comment. Remove incorrect comment.
524 (initFrameFromEmacs:): tbar_height renamed tibar_height.
525 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
526 error in drawing background.
527 (toggleFullScreen:): Remove comment. Rearrange calls.
528 Set toolbar values to zero, save old height in tobar_height.
529 Restore tool bar height when leaving fullscreen.
530 (canBecomeMainWindow): New function.
531
532 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
533
534 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
535
536 2012-10-05 Eli Zaretskii <eliz@gnu.org>
537
538 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
539
540 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
541 that time stamps of directories could also be changed. Don't
542 request the too broad GENERIC_WRITE, only the more restrictive
543 FILE_WRITE_ATTRIBUTES access rights.
544
545 * fileio.c (Fset_file_times): Special-case ignoring errors for
546 directories only on MSDOS, not on MS-Windows.
547
548 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
549
550 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
551
552 2012-10-04 Eli Zaretskii <eliz@gnu.org>
553
554 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
555 see whether CreateFile failed.
556
557 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
558
559 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
560 to avoid similar races.
561 * keyboard.c (pending_signals): Now bool, not int.
562
563 Port timers to OpenBSD, plus check for timer failures.
564 OpenBSD problem reported by Han Boetes.
565 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
566 and/or setitimer.
567 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
568 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
569 like OpenBSD, which has timer_settime but does not declare it.
570 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
571 whether to use itimerspec-related primitives. All uses of
572 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
573
574 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
575
576 * profiler.c (handle_profiler_signal): Fix a malloc race
577 that caused Emacs to hang on Fedora 17 when profiling Lisp.
578
579 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
580
581 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
582
583 2012-10-02 Eli Zaretskii <eliz@gnu.org>
584
585 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
586 consistent with the change in return value of 'safe_strsignal'.
587
588 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
589
590 Prefer plain 'static' to 'static inline' (Bug#12541).
591 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
592 (bidi_set_sor_type, bidi_push_embedding_level)
593 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
594 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
595 (bidi_cache_search, bidi_cache_ensure_space)
596 (bidi_cache_iterator_state, bidi_cache_find)
597 (bidi_peek_at_next_level, bidi_set_paragraph_end)
598 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
599 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
600 Now 'static', not 'static inline'.
601
602 Count overruns when profiling; change units to ns.
603 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
604 Give extra weight to samples after overruns, to attempt to count
605 the time more accurately.
606 (setup_cpu_timer): Change sampling interval units from ms to ns, since
607 the underlying primitives nominally do ns.
608 (Fprofiler_cpu_start): Document the change. Mention that
609 the sampling intervals are only approximate.
610
611 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
612
613 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
614
615 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
616 case for the special 0 coding-system.
617
618 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
619 (Fmake_overlay): Remove redundant tests.
620 (fix_start_end_in_overlays): Remove redundant recentering.
621
622 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
623
624 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
625 Update dependencies.
626
627 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
628
629 Fix a malloc race condition involving strsignal.
630 A signal can arrive in the middle of a malloc, and Emacs's signal
631 handler can invoke strsignal, which can invoke malloc, which is
632 not portable. This race condition bug makes Emacs hang on GNU/Linux.
633 Fix it by altering the signal handler so that it does not invoke
634 strsignal.
635 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
636 * process.c (status_message): Use const pointer, in case strsignal
637 is #defined to safe_strsignal.
638 * sysdep.c (sys_siglist, init_signals): Always define and
639 initialize a substitute sys_siglist if the system does not define
640 one, even if HAVE_STRSIGNAL.
641 (safe_strsignal): Rename from strsignal. Always define,
642 using sys_siglist. Return a const pointer.
643 * syssignal.h (safe_strsignal): New decl.
644 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
645
646 2012-10-01 Eli Zaretskii <eliz@gnu.org>
647
648 * w32proc.c (timer_loop): Fix code that waits for timer
649 expiration, to avoid high CPU usage.
650
651 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
652
653 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
654 (sweep_weak_table): Remove redundant prototypes.
655
656 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
657
658 * emacs.c: Move the inclusion of TERM_HEADER after including
659 windows.h on WINDOWSNT. This avoids compilation problems with
660 MSVC.
661
662 2012-10-01 Eli Zaretskii <eliz@gnu.org>
663
664 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
665 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
666 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
667 as the previous version used 'void *'.
668
669 * ralloc.c (ROUNDUP): Fix last change.
670 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
671 'size_t'.
672
673 * w32proc.c <disable_itimers>: New static flag.
674 (init_timers): Initialize it to zero, after creating the critical
675 sections used by the timer threads.
676 (term_timers): Set to 1 before deleting the critical sections.
677 (getitimer, setitimer): If disable_itimers is non-zero, return an
678 error indication without doing anything. Reported by Fabrice
679 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
680 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
681 return results.
682 [!HAVE_SETITIMER]: Behave as the previous version that didn't
683 support timers.
684
685 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
686 term_ntproc after all the other bookkeeping, to get timers working
687 as long as possible.
688
689 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
690
691 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
692 Suggested by Juri Linkov in
693 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
694
695 Prefer plain 'static' to 'static inline' (Bug#12541).
696 With static functions, modern compilers inline pretty well by
697 themselves; advice from programmers often hurts as much as it helps.
698 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
699 this change shrinks the text size of the Emacs executable by 1.1%
700 without affecting CPU significantly in my benchmark.
701 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
702 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
703 (mark_maybe_object, mark_maybe_pointer, bounded_number):
704 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
705 (bset_auto_fill_function, bset_auto_save_file_format)
706 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
707 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
708 (bset_cache_long_line_scans, bset_case_fold_search)
709 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
710 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
711 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
712 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
713 (bset_header_line_format, bset_indicate_buffer_boundaries)
714 (bset_indicate_empty_lines, bset_invisibility_spec)
715 (bset_left_fringe_width, bset_major_mode, bset_mark)
716 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
717 (bset_name, bset_overwrite_mode, bset_pt_marker)
718 (bset_right_fringe_width, bset_save_length)
719 (bset_scroll_bar_width, bset_scroll_down_aggressively)
720 (bset_scroll_up_aggressively, bset_selective_display)
721 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
722 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
723 (set_buffer_overlays_after):
724 * category.c (bset_category_table):
725 * charset.c (read_hex):
726 * coding.c (produce_composition, produce_charset)
727 (handle_composition_annotation, handle_charset_annotation)
728 (char_encodable_p):
729 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
730 (assign_row, set_frame_matrix_frame, make_current)
731 (add_row_entry):
732 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
733 * fns.c (maybe_resize_hash_table):
734 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
735 * gmalloc.c (register_heapinfo):
736 * image.c (lookup_image_type):
737 * intervals.c (set_interval_object, set_interval_left)
738 (set_interval_right, copy_interval_parent, rotate_right)
739 (rotate_left, balance_possible_root_interval):
740 * keyboard.c (kset_echo_string, kset_kbd_queue)
741 (kset_keyboard_translate_table, kset_last_prefix_arg)
742 (kset_last_repeatable_command, kset_local_function_key_map)
743 (kset_overriding_terminal_local_map, kset_real_last_command)
744 (kset_system_key_syms, clear_event, set_prop):
745 * lread.c (digit_to_number):
746 * marker.c (attach_marker, live_buffer, set_marker_internal):
747 * nsterm.m (ns_compute_glyph_string_overhangs):
748 * process.c (pset_buffer, pset_command)
749 (pset_decode_coding_system, pset_decoding_buf)
750 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
751 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
752 (pset_status, pset_tty_name, pset_type, pset_write_queue):
753 * syntax.c (bset_syntax_table, dec_bytepos):
754 * terminal.c (tset_param_alist):
755 * textprop.c (interval_has_some_properties)
756 (interval_has_some_properties_list):
757 * window.c (wset_combination_limit, wset_dedicated)
758 (wset_display_table, wset_hchild, wset_left_fringe_width)
759 (wset_left_margin_cols, wset_new_normal, wset_new_total)
760 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
761 (wset_right_fringe_width, wset_right_margin_cols)
762 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
763 (wset_vertical_scroll_bar_type, wset_window_parameters):
764 * xdisp.c (wset_base_line_number, wset_base_line_pos)
765 (wset_column_number_displayed, wset_region_showing)
766 (window_box_edges, run_window_scroll_functions)
767 (append_glyph_string_lists, prepend_glyph_string_lists)
768 (append_glyph_string, set_glyph_string_background_width)
769 (append_glyph, append_composite_glyph)
770 (take_vertical_position_into_account):
771 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
772 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
773 (lface_hash, lface_same_font_attributes_p, lookup_face):
774 * xml.c (libxml2_loaded_p):
775 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
776 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
777 Now 'static', not 'static inline'.
778
779 * bidi.c: Tune.
780 (bidi_copy_it): Do the whole copy with a single memcpy.
781 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
782
783 Revert the FOLLOW-SYMLINKS change for file-attributes.
784 Doing it right would require several changes to Tramp, and there's
785 not enough time to get that tested before the freeze today.
786 * dired.c (directory_files_internal, Ffile_attributes):
787 Undo last change.
788
789 * frame.c (x_report_frame_params): Port better to wider ints.
790 Do not assume that EMACS_UINT is the same width as uprintmax_t,
791 or that pointers can be printed in 15 decimal digits.
792 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
793
794 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
795
796 Support x64 build on MS-Windows.
797 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
798 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
799 compatibility with x64.
800 (x_get_focus_frame): Add prototype.
801
802 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
803 defining an XRectangle structure.
804
805 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
806 arithmetics for compatibility with x64.
807
808 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
809 compatibility with x64.
810
811 * w32heap.h: Adjust prototypes and declarations.
812
813 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
814 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
815 DWORD, long, and unsigned long, for compatibility with x64.
816 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
817 (sbrk): Argument is now of type ptrdiff_t.
818
819 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
820 less than 0x0500.
821 (w32_msg_pump): Use WPARAM type for 'result'.
822
823 * w32.c (init_environment, get_emacs_configuration): Support AMD64
824 architecture.
825 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
826 compatibility with x64.
827
828 * vm-limit.c (lim_data): Now size_t.
829 (check_memory_limits): Adjust prototypes of real_morecore and
830 __morecore to receive argument of type ptrdiff_t. Use size_t for
831 five_percent and data_size.
832
833 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
834 variables, for compatibility with x64.
835 (rva_to_section, offset_to_section, relocate_offset)
836 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
837 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
838 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
839 for compatibility with x64.
840
841 * sysdep.c (STDERR_FILENO): Define if not already defined.
842
843 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
844 (__morecore): Argument type is now ptrdiff_t.
845 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
846 (relinquish): Use ptrdiff_t type for 'excess'.
847 (r_alloc_sbrk): Argument type is now ptrdiff_t.
848
849 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
850 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
851 instead of a literal number.
852
853 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
854 (min): Define only if not already defined.
855
856 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
857 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
858 hosts.
859
860 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
861 'bitmaps' is a pointer.
862
863 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
864
865 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
866
867 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
868
869 file-attributes has a new optional arg FOLLOW-SYMLINKS.
870 * dired.c (directory_files_internal, Ffile_attributes):
871 New arg follow_symlinks. All uses changed.
872
873 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
874
875 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
876
877 2012-09-30 Eli Zaretskii <eliz@gnu.org>
878
879 Support atimers and CPU profiler via profile.c on MS-Windows.
880 * w32proc.c (sig_mask, crit_sig): New static variables.
881 (sys_signal): Support SIGALRM and SIGPROF.
882 (sigemptyset, sigaddset, sigfillset, sigprocmask)
883 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
884 sigfillset, and sigprocmask are no longer no-ops.
885 (sigismember): New function.
886 (struct itimer_data): New definition.
887 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
888 (crit_prof): New static variables.
889 (MAX_SINGLE_SLEEP): New definition.
890 (timer_loop, stop_timer_thread, term_timers, init_timers)
891 (start_timer_thread, getitimer, setitimer): New functions.
892 (alarm): No longer a no-op, calls setitimer.
893
894 * w32.c (term_ntproc): Call term_timers.
895 (init_ntproc): Make sure all signals are unblocked at startup, to
896 erase any traces of dumping. Call init_timers.
897
898 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
899 Windows-specific code to display the hourglass mouse pointer is no
900 longer used.
901 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
902 to hourglass timer expiration.
903 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
904 Remove, no longer used.
905 (w32_note_current_window, show_hourglass, hide_hourglass):
906 New functions, in support of hourglass cursor display similar to other
907 window systems.
908 (syms_of_w32fns): Don't initialize hourglass_timer.
909
910 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
911 WINDOWSNT as well.
912 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
913
914 * w32.h (init_timers, term_timers): Add prototypes.
915
916 2012-09-30 Kenichi Handa <handa@gnu.org>
917
918 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
919 to the buffer relocation which may be caused by ccl_driver.
920
921 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
922
923 * xfns.c (Fx_file_dialog): Update comment.
924
925 * w32fns.c (Fx_file_dialog): Update comment.
926
927 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
928 Initialize panel name field if OSX >= 10.6.
929
930 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
931
932 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
933
934 * nsterm.m (NEW_STYLE_FS): New define.
935 (ns_fullscreen_hook, windowWillEnterFullScreen)
936 (windowDidEnterFullScreen, windowWillExitFullScreen)
937 (windowDidExitFullScreen, toggleFullScreen, handleFS)
938 (setFSValue): New functions.
939 (EmacsFSWindow): New implementation.
940 (canBecomeKeyWindow): New function for EmacsFSWindow.
941 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
942 (dealloc): Release nonfs_window if in fullscreen.
943 (updateFrameSize:): Call windowDidMove to update top/left.
944 (windowWillResize:toSize:): Check if frame is still maximized.
945 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
946 next_maximized, maximized_width, maximized_height and nonfs_window.
947 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
948 tbar_height.
949 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
950 fullscreen. Set maximized_width/height. Act on next_maximized.
951
952 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
953 (EmacsView): Add variables for fullscreen.
954 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
955 (EmacsFSWindow): New interface for fullscreen.
956
957 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
958
959 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
960
961 2012-09-30 Chong Yidong <cyd@gnu.org>
962
963 * fns.c (Frandom): Doc fix.
964
965 2012-09-30 Martin Rudalics <rudalics@gmx.at>
966
967 * window.c (Vwindow_combination_limit): New default value.
968 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
969
970 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
971
972 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
973 Suggested by Eli Zaretskii in
974 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
975
976 2012-09-30 Eli Zaretskii <eliz@gnu.org>
977
978 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
979 HAVE_TIMER_SETTIME is defined.
980
981 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
982
983 Profiler improvements: more-accurate timers, overflow checks.
984 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
985 signal.h, setjmp.h. Include systime.h instead.
986 (saturated_add): New function.
987 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
988 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
989 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
990 New static vars.
991 (enum profiler_cpu_running): New enum.
992 (profiler_cpu_running): Now of that enum type, not bool.
993 All uses changed to store the new value.
994 (handle_profiler_signal): Rename from sigprof_handler_1,
995 for consistency with other handlers. Do not check whether
996 cpu_log is a hash-table if garbage collecting, since it
997 doesn't matter in that case.
998 (deliver_profiler_signal): Rename from sigprof_handler,
999 for consistency with other handlers.
1000 (setup_cpu_timer): New function, with much of what used to be in
1001 Fprofiler_cpu_start. Check for out-of-range argument.
1002 Prefer timer_settime if available, and prefer
1003 thread cputime clocks, then process cputime clocks, then
1004 monotonic clocks, to the old realtime clock. Use make_timeval
1005 to round more-correctly when falling back to setitimer.
1006 (Fprofiler_cpu_start): Use it.
1007 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1008 Don't assume that passing NULL as the 2nd argument of setitimer
1009 is the same as passing a pointer to all-zero storage.
1010 Ignore SIGPROF afterwards.
1011 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1012 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1013 non-fatal signal handlers. Ignore SIGPROF on startup.
1014 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1015 in profiler.c, since sysdep.c now uses it.
1016
1017 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1018 Suggested by Eli Zaretskii in
1019 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1020
1021 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1022
1023 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1024
1025 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1026
1027 * lisp.h (struct backtrace): Remove indirection for `function' field.
1028 * xdisp.c (redisplay_internal):
1029 * profiler.c (record_backtrace, sigprof_handler_1):
1030 * alloc.c (Fgarbage_collect):
1031 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1032 (Fbacktrace_frame): Adjust accordingly.
1033
1034 2012-09-28 Glenn Morris <rgm@gnu.org>
1035
1036 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1037 (Frun_hook_with_args_until_failure): Doc fixes.
1038
1039 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1040
1041 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1042 Qautomatic_redisplay and change the symbol name. All users changed.
1043
1044 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1045
1046 * profiler.c (sigprof_handler): Fix race condition.
1047
1048 2012-09-28 Glenn Morris <rgm@gnu.org>
1049
1050 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1051
1052 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1053
1054 Check more robustly for timer_settime.
1055 * Makefile.in (LIB_TIMER_TIME): New macro.
1056 (LIBES): Add it.
1057 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1058 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1059 call timer_settime.
1060
1061 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1062
1063 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1064
1065 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1066
1067 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1068
1069 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1070
1071 * character.h (MAYBE_UNIFY_CHAR): Remove.
1072 * charset.c, charset.h (maybe_unify_char): Now static.
1073 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1074 Since this stuff is now private to charset.c, there's no need for
1075 a public macro and no need to inline by hand.
1076
1077 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1078 Stefan Monnier <monnier@iro.umontreal.ca>
1079 Juanma Barranquero <lekktu@gmail.com>
1080
1081 * profiler.c: New file.
1082 * Makefile.in (base_obj): Add profiler.o.
1083 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1084 ($(BLD)/profiler.$(O)): New target.
1085 * emacs.c (main): Call syms_of_profiler.
1086 * alloc.c (Qautomatic_gc): New constant.
1087 (MALLOC_PROBE): New macro.
1088 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1089 (total_bytes_of_live_objects): New function.
1090 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1091 Call malloc_probe for the memory profiler.
1092 (syms_of_alloc): Define Qautomatic_gc.
1093 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1094 race condition.
1095 (struct backtrace): Move definition...
1096 * lisp.h (struct backtrace): ..here.
1097 (Qautomatic_gc, profiler_memory_running): Declare vars.
1098 (malloc_probe, syms_of_profiler): Declare functions.
1099 * xdisp.c (Qautomatic_redisplay): New constant.
1100 (redisplay_internal): Record itself in backtrace_list.
1101 (syms_of_xdisp): Define Qautomatic_redisplay.
1102
1103 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1104 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1105
1106 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1107
1108 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1109
1110 Prefer POSIX timers if available.
1111 They avoid a race if the timer is too close to the current time.
1112 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1113 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1114 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1115
1116 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1117
1118 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1119 CHAR_STRING_ADVANCE.
1120 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1121 STRING_CHAR_ADVANCE.
1122
1123 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1124
1125 Move Vlibrary_cache to emacs.c and reset before dumping.
1126
1127 * lisp.h (reset_image_types): Declare.
1128 [WINDOWSNT] (Vlibrary_cache): Declare.
1129
1130 * image.c (reset_image_types): New function.
1131
1132 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1133 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1134 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1135
1136 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1137 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1138
1139 * w32.h (Vlibrary_cache): Do not declare.
1140
1141 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1142
1143 * w32proc.c (sys_signal): Handle all signals defined by the
1144 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1145 handlers for signals supported by Windows. Don't override
1146 term_ntproc as the handler for SIGABRT.
1147 (sigaction): Rewrite to call sys_signal instead of duplicating its
1148 code.
1149 (sys_kill): Improve commentary.
1150
1151 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1152 consistency with a signature of a signal handler. All callers
1153 changed.
1154 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1155 install term_ntproc as a signal handler for SIGABRT, as that
1156 should be done by the dumped Emacs.
1157
1158 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1159
1160 * w32select.c (term_w32select): Protect against repeated
1161 invocation by setting clipboard_owner to NULL after calling
1162 DestroyWindow.
1163
1164 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1165 and term_ntproc to their modified signatures.
1166
1167 * character.c (char_string, string_char): Remove calls to
1168 MAYBE_UNIFY_CHAR. See the discussion starting at
1169 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1170 for the details.
1171
1172 2012-09-25 Chong Yidong <cyd@gnu.org>
1173
1174 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1175
1176 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1177
1178 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1179 when encountering an unknown bytecode.
1180
1181 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1182
1183 image.c, indent.c: Use bool for booleans.
1184 * dispextern.h (struct image_type): Members valid_p, load, init
1185 now return bool, not int. All uses changed.
1186 * image.c: Omit unnecessary static decls.
1187 (x_create_bitmap_mask, x_build_heuristic_mask):
1188 Return void, not int, since callers don't care about the return value.
1189 (x_create_bitmap_mask, define_image_type, valid_image_p)
1190 (struct image_keyword, parse_image_spec, image_spec_value)
1191 (check_image_size, image_background)
1192 (image_background_transparent, x_clear_image_1)
1193 (postprocess_image, lookup_image, x_check_image_size)
1194 (x_create_x_image_and_pixmap, xbm_image_p)
1195 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1196 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1197 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1198 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1199 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1200 (png_image_p, init_png_functions, png_load_body, png_load)
1201 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1202 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1203 (init_gif_functions, gif_load, imagemagick_image_p)
1204 (imagemagick_load_image, imagemagick_load, svg_image_p)
1205 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1206 (gs_load):
1207 * nsimage.m (ns_load_image):
1208 * nsterm.m (ns_defined_color):
1209 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1210 * xfns.c (x_defined_color):
1211 * xterm.c (x_alloc_lighter_color_for_widget)
1212 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1213 (x_alloc_lighter_color):
1214 * indent.c (disptab_matches_widthtab, current_column)
1215 (scan_for_column, string_display_width, indented_beyond_p)
1216 (compute_motion, vmotion, Fvertical_motion):
1217 Use bool for booleans.
1218
1219 2012-09-24 Chong Yidong <cyd@gnu.org>
1220
1221 * chartab.c (Fset_char_table_default): Obsolete function removed.
1222
1223 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1224
1225 Move pid_t related decls out of lisp.h.
1226 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1227 (interruptible_wait_for_termination):
1228 Move these decls from lisp.h to syswait.h, since they use pid_t.
1229 Needed on FreeBSD; see Herbert J. Skuhra in
1230 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1231 * callproc.c: Include syswait.h.
1232
1233 gnutls.c, gtkutil.c: Use bool for boolean.
1234 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1235 (emacs_gnutls_handle_error):
1236 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1237 (xg_hide_tooltip, xg_create_frame_widgets)
1238 (create_dialog, xg_uses_old_file_dialog)
1239 (xg_get_file_with_chooser, xg_get_file_with_selection)
1240 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1241 (xg_item_label_same_p, xg_update_menubar)
1242 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1243 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1244 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1245 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1246 (update_frame_tool_bar, free_frame_tool_bar):
1247 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1248 * nsmenu.m (ns_update_menubar):
1249 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1250 * xfns.c (Fx_show_tip) [USE_GTK]:
1251 Use bool for boolean.
1252 * gtkutil.c (xg_update_frame_menubar):
1253 * xmenu.c (update_frame_menubar):
1254 Return void, not int, since caller ignores return value.
1255 * gtkutil.c (xg_change_toolbar_position):
1256 Return void, not 1.
1257
1258 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1259
1260 * makefile.w32-in (BLOCKINPUT_H): Remove.
1261 (SYSSIGNAL_H): New macro.
1262 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1263 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1264 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1265 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1266 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1267 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1268 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1269 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1270 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1271 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1272 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1273 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1274 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1275 ($(BLD)/w32xfns.$(O)): Update dependencies.
1276
1277 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1278
1279 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1280 fatal_error_backtrace.
1281
1282 * w32proc.c (sys_kill): Undo last change: don't do anything when
1283 invoked to deliver SIGABRT to our own process. This is now
1284 handled by emacs_raise.
1285
1286 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1287
1288 * w32term.c (w32_read_socket): Remove leftover reference to
1289 interrupt_input_pending.
1290
1291 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1292
1293 Do not use SA_NODEFER.
1294 Problem reported by Dani Moncayo in
1295 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1296 * alloc.c (die):
1297 * sysdep.c (emacs_abort): Do not reset signal handler.
1298 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1299 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1300 wanted even on POSIXish hosts, and it doesn't work on Windows.
1301
1302 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1303
1304 * xterm.c (x_term_init): Call fixup_locale before and after calling
1305 gtk_init (Bug#12392).
1306
1307 2012-09-23 Chong Yidong <cyd@gnu.org>
1308
1309 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1310 Vdynamic_library_alist.
1311
1312 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1313 (Fgnutls_available_p): Caller changed.
1314
1315 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1316 (Flibxml_parse_xml_region): Likewise.
1317
1318 * dispextern.h (struct image_type): Remove arg from init function.
1319
1320 * image.c (Finit_image_library, lookup_image_type)
1321 (define_image_type): Remove now-unneeded second arg.
1322 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1323 (init_tiff_functions, init_gif_functions, init_svg_functions):
1324 Arglist and w32_delayed_load calling convention changed.
1325 (gs_type): Remove init_gs_functions; there is no such function.
1326 (valid_image_p, make_image): Fix caller to lookup_image_type.
1327
1328 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1329
1330 Simplify and avoid signal-handling races (Bug#12471).
1331 * alloc.c (die):
1332 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1333 Avoid recursive loop if there's a fatal error in the function itself.
1334 * atimer.c (pending_atimers):
1335 * blockinput.h: Don't include "atimer.h"; no longer needed.
1336 (interrupt_input_pending): Remove. All uses removed.
1337 pending_signals now counts both atimers and ordinary interrupts.
1338 This is less racy than having three separate pending-signal flags.
1339 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1340 (input_blocked_p):
1341 Rename from their upper-case counterparts BLOCK_INPUT,
1342 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1343 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1344 This makes it easier to access volatile variables more accurately.
1345 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1346 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1347 that's more reliable if the code is buggy and sets
1348 interrupt_input_blocked to a negative value. All uses changed.
1349 * atimer.c (deliver_alarm_signal):
1350 Remove. No need to deliver this to the parent; any thread can
1351 handle this signal now. All uses replaced by underlying handler.
1352 * atimer.c (turn_on_atimers):
1353 * dispnew.c (handle_window_change_signal):
1354 * emacs.c (handle_danger_signal):
1355 * keyboard.c (kbd_buffer_get_event):
1356 Don't reestablish signal handler; not needed with sigaction.
1357 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1358 (UNBLOCK_INPUT_TO):
1359 Rework to avoid unnecessary accesses to volatile variables.
1360 (UNBLOCK_INPUT_TO): Now a function.
1361 (totally_unblock_input, unblock_input): New decls.
1362 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1363 (init_data): Remove. Necessary stuff now done in init_signal.
1364 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1365 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1366 (fatal_error_code): Remove; no longer needed.
1367 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1368 it doesn't always backtrace. All uses changed. No need to reset
1369 signal to default, since sigaction and/or die does that for us now.
1370 Use emacs_raise (FOO), not kill (getpid (), FOO).
1371 (main): Check more-accurately whether we're dumping.
1372 Move fatal-error setup to sysdep.c
1373 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1374 * gtkutil.c (xg_get_file_name, xg_get_font):
1375 Remove no-longer-needed signal-mask manipulation.
1376 * keyboard.c, process.c (POLL_FOR_INPUT):
1377 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1378 * keyboard.c (read_avail_input): Remove.
1379 All uses replaced by gobble_input.
1380 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1381 (kbd_buffer_store_event_hold, gobble_input):
1382 (record_asynch_buffer_change) [USABLE_SIGIO]:
1383 (store_user_signal_events):
1384 No need to mess with signal mask.
1385 (gobble_input): If blocking input and there are terminals, simply
1386 set pending_signals to 1 and return. All hooks changed to not
1387 worry about whether input is blocked.
1388 (process_pending_signals): Clear pending_signals before processing
1389 them, in case a signal comes in while we're processing.
1390 By convention callers now test pending_signals before calling us.
1391 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1392 New functions, to support changes to blockinput.h.
1393 (handle_input_available_signal): Now extern.
1394 (reinvoke_input_signal): Remove. All uses replaced by
1395 handle_async_input.
1396 (quit_count): Now volatile, since a signal handler uses it.
1397 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1398 All callers changed. Block SIGINT only if not already blocked.
1399 Clear sigmask reliably, even if Fsignal returns, which it can.
1400 Omit unnecessary accesses to volatile var.
1401 (quit_throw_to_read_char): No need to restore sigmask.
1402 * keyboard.c (gobble_input, handle_user_signal):
1403 * process.c (wait_reading_process_output):
1404 Call signal-handling code rather than killing ourselves.
1405 * lisp.h: Include <float.h>, for...
1406 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1407 (pending_signals): Now volatile.
1408 (syms_of_data): Now const if IEEE floating point.
1409 (handle_input_available_signal) [USABLE_SIGIO]:
1410 (terminate_due_to_signal, record_child_status_change): New decls.
1411 * process.c (create_process): Avoid disaster if memory is exhausted
1412 while we're processing a vfork, by tightening the critical section
1413 around the vfork.
1414 (send_process_frame, process_sent_to, handle_pipe_signal)
1415 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1416 ignores SIGPIPE.
1417 (send_process): No need for setjmp/longjmp any more, since the
1418 SIGPIPE stuff is now gone. Instead, report an error if errno
1419 is EPIPE.
1420 (record_child_status_change): Now extern. PID and W are now args.
1421 Return void, not bool. All callers changed.
1422 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1423 Remove. All uses removed. This bug should be fixed now in a
1424 different way.
1425 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1426 and record the child status change directly. This avoids the
1427 need to futz with the signal mask.
1428 (process_fatal_action): Move here from emacs.c.
1429 (emacs_sigaction_flags): New function, containing
1430 much of what used to be in emacs_sigaction_init.
1431 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1432 caught by emacs, to make races less likely.
1433 (deliver_process_signal): Rename from handle_on_main_thread.
1434 All uses changed.
1435 (BACKTRACE_LIMIT_MAX): Now at top level.
1436 (thread_backtrace_buffer, threadback_backtrace_pointers):
1437 New static vars.
1438 (deliver_thread_signal, deliver_fatal_thread_signal):
1439 New functions, for more-accurate delivery of thread-specific signals.
1440 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1441 (deliver_arith_signal): Handle in this thread, not
1442 in the main thread, since it's triggered by this thread.
1443 (maybe_fatal_sig): New function.
1444 (init_signals): New arg DUMPING so that we can be more accurate
1445 about whether we're dumping. Caller changed.
1446 Treat thread-specific signals differently from process-general signals.
1447 Block all signals while handling fatal error; that's safer.
1448 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1449 on IEEE hosts.
1450 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1451 Ignore SIGPIPE unless batch.
1452 (emacs_backtrace): Output backtrace for the appropriate thread,
1453 which is not necessarily the main thread.
1454 * syssignal.h: Include <stdbool.h>.
1455 (emacs_raise): New macro.
1456 * xterm.c (x_connection_signal): Remove; no longer needed
1457 now that we use sigaction.
1458 (x_connection_closed): No need to mess with sigmask now.
1459 (x_initialize): No need to reset SIGPIPE handler here, since
1460 init_signals does this for us now.
1461
1462 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1463
1464 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1465 background rect may be larger (Bug#12245).
1466
1467 2012-09-23 Chong Yidong <cyd@gnu.org>
1468
1469 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1470
1471 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1472
1473 * .gdbinit: Just stop at fatal_error_backtrace.
1474 See Stefan Monnier's request in
1475 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1476 Remove no-longer-used query of system type.
1477
1478 2012-09-22 Chong Yidong <cyd@gnu.org>
1479
1480 * search.c (Freplace_match): Doc fix (Bug#12325).
1481
1482 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1483
1484 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1485 (Fline_end_position): Doc fix.
1486
1487 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1488
1489 2012-09-22 Chong Yidong <cyd@gnu.org>
1490
1491 * dispextern.h (struct image_type): Add new slot, storing a type
1492 initialization function.
1493
1494 * image.c (define_image_type): Call the image initializer function
1495 if it is defined. Arguments and return value changed.
1496 (valid_image_p, make_image): Callers changed.
1497 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1498 (gif_type, imagemagick_type, svg_type, gs_type):
1499 Add initialization functions.
1500 (Finit_image_library): Call lookup_image_type.
1501 (CHECK_LIB_AVAILABLE): Macro deleted.
1502 (lookup_image_type): Call define_image_type here, rather than via
1503 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1504 (syms_of_image): Move define_image_type calls for xbm_type and
1505 pbm_type to lookup_image_type.
1506
1507 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1508
1509 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1510 'idle_timers' from here ...
1511 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1512 lists, to avoid infloops when the timer does something stupid,
1513 like reinvoke itself with the same or smaller time-out.
1514 (Bug#12447)
1515
1516 2012-09-22 Martin Rudalics <rudalics@gmx.at>
1517
1518 * window.c (Fsplit_window_internal): Handle only Qt value of
1519 Vwindow_combination_limit separately.
1520 (Qtemp_buffer_resize): New symbol.
1521 (Vwindow_combination_limit): New default value.
1522 Rewrite doc-string.
1523
1524 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1525
1526 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1527 the new overlay string. (Bug#10159)
1528
1529 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1530
1531 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1532 or that fprintf is async-signal-safe. POSIX doesn't require
1533 either assumption.
1534
1535 2012-09-22 Chong Yidong <cyd@gnu.org>
1536
1537 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1538 (Bug#8207).
1539
1540 2012-09-22 Kenichi Handa <handa@gnu.org>
1541
1542 * composite.c (composition_reseat_it): Handle the case that a
1543 grapheme cluster is not covered by a single font (Bug#12352).
1544
1545 2012-09-21 Chong Yidong <cyd@gnu.org>
1546
1547 * image.c (define_image_type): Avoid adding duplicate types to
1548 image_types (Bug#12463). Suggested by Jörg Walter.
1549
1550 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1551
1552 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1553 (print_load_command_name): Add case LC_DATA_IN_CODE.
1554 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1555
1556 2012-09-21 Glenn Morris <rgm@gnu.org>
1557
1558 * eval.c (Frun_hook_with_args_until_success)
1559 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1560
1561 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1562
1563 * fileio.c (Ffile_selinux_context): Only call freecon when
1564 lgetfilecon succeeded.
1565 (Fset_file_selinux_context): Likewise. (Bug#12444)
1566
1567 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1568
1569 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1570 reordering, locate the cursor by calling set_cursor_from_row; if
1571 that fails, clear the desired glyph matrix before returning a
1572 failure indication to the caller. Fixes leaving garbled display
1573 when fast scrolling with a down-key. (Bug#12403)
1574 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1575 scrolling through multibyte text.
1576
1577 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1578
1579 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1580 calling mark_vectorlike since that's the one that marks the window.
1581 (mark_discard_killed_buffers): Mark the final cdr.
1582 * window.h (struct window): Move prev/next_buffers to the
1583 non-standard fields.
1584 * window.c (make_window): Initialize prev/next_buffers manually.
1585
1586 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1587
1588 Omit unused arg EXPECTED from socket hooks.
1589 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1590 * nsterm.m (ns_term_init):
1591 * termhooks.h (struct terminal.read_socket_hook):
1592 * w32inevt.c (w32_console_read_socket):
1593 * w32term.c (w32_read_socket):
1594 * xterm.c (XTread_socket):
1595 Omit unused arg EXPECTED. All callers changed.
1596 (store_user_signal_events): Return void, not int, since callers no
1597 longer care about the return value. All uses changed.
1598
1599 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
1600
1601 * w32gui.h (XParseGeometry): Do not declare.
1602
1603 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1604
1605 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1606 Ignore 'expected'. See Eli Zaretskii in
1607 <http://bugs.gnu.org/12471#8> (last line).
1608
1609 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1610 (XParseGeometry): Now static. Substitute extremal values for
1611 values that are out of range.
1612
1613 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1614
1615 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1616
1617 * nsfns.m (XParseGeometry): Remove.
1618 (Fx_create_frame): Call x_set_offset to correctly interpret
1619 top_pos in geometry.
1620
1621 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1622 (Fx_parse_geometry): If there is a space in string, call
1623 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1624
1625 2012-09-17 Eli Zaretskii <eliz@gnu.org>
1626
1627 * search.c (scan_buffer): Use character positions in calls to
1628 region_cache_forward and region_cache_backward, not byte
1629 positions. (Bug#12196)
1630
1631 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1632 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1633
1634 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1635 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1636 emacs_blocked_malloc, now deleted.
1637
1638 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1639
1640 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1641 The workaround was for improving performance on Solaris 2.4, but
1642 is getting in the way now. Emacs will still work if someone is
1643 still running Solaris 2.4 in a museum somewhere; Sun dropped
1644 support for Solaris 2.4 in 2003.
1645 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1646 * process.c (create_process) [HAVE_WORKING_VFORK]:
1647 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1648 since Emacs no longer uses vfork on that platform.
1649
1650 2012-09-17 Glenn Morris <rgm@gnu.org>
1651
1652 * emacs.c: Use COPYRIGHT.
1653
1654 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1655
1656 Remove configure's --without-sync-input option (Bug#12450).
1657 When auditing signal-handling in preparation for cleaning it up,
1658 I found that SYNC_INPUT has race conditions and would be a real
1659 pain to fix. Since it's an undocumented and deprecated
1660 configure-time option, now seems like a good time to remove it.
1661 Also see <http://bugs.gnu.org/11080#16>.
1662 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1663 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1664 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1665 (malloc_hysteresis):
1666 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1667 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1668 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1669 (dont_register_blocks, bytes_used_when_reconsidered)
1670 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1671 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1672 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1673 Remove. All uses removed.
1674 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1675 implementation, one that depends on whether the new macro
1676 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1677 is defined.
1678 * atimer.c (run_timers, handle_alarm_signal):
1679 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1680 (handle_async_input, process_pending_signals)
1681 (handle_input_available_signal, init_keyboard):
1682 * nsterm.m (ns_read_socket):
1683 * process.c (wait_reading_process_output):
1684 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1685 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1686 (emacs_write):
1687 * xterm.c (XTread_socket):
1688 Assume SYNC_INPUT.
1689 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1690 * eval.c (handling_signal): Remove. All uses removed.
1691 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1692 All uses replaced with the SYNC_INPUT version.
1693 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1694 Remove decls.
1695 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1696 Now static.
1697
1698 * font.c (Ffont_shape_gstring): Remove unused local.
1699
1700 2012-09-16 Glenn Morris <rgm@gnu.org>
1701
1702 * Makefile.in (clean): No longer run nextstep's clean.
1703
1704 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1705 (ns_frag): Remove.
1706 (ns-app): Move here from ns.mk, and simplify.
1707 (clean): Simplify nextstep entry.
1708 * ns.mk: Remove file.
1709
1710 2012-09-17 Kenichi Handa <handa@gnu.org>
1711
1712 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1713 not covert the last few charactes.
1714
1715 2012-09-16 Kenichi Handa <handa@gnu.org>
1716
1717 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1718 here, but just check the validity of glyphs in the glyph-string.
1719
1720 2012-09-16 Martin Rudalics <rudalics@gmx.at>
1721
1722 * window.c (Fwindow_parameter, Fset_window_parameter):
1723 Accept any window as argument (Bug#12452).
1724
1725 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1726
1727 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1728 to ns_term_init to avoid memory leak.
1729
1730 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1731 explicit retain/release.
1732 (ns_term_init): Only allow one display. Initialize outerpool and
1733 ns_*_types.
1734
1735 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1736
1737 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1738 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1739 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1740 the Microsoft problem in a different way, by altering ../nt/config.nt.
1741
1742 2012-09-15 Eli Zaretskii <eliz@gnu.org>
1743
1744 * w32xfns.c:
1745 * w32uniscribe.c:
1746 * w32term.c:
1747 * w32select.c:
1748 * w32reg.c:
1749 * w32proc.c:
1750 * w32menu.c:
1751 * w32inevt.c:
1752 * w32heap.c:
1753 * w32font.c:
1754 * w32fns.c:
1755 * w32console.c:
1756 * w32.c:
1757 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1758 by lisp.h. This completes removal of setjmp.h inclusion
1759 erroneously announced in the previous commit. (Bug#12446)
1760
1761 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1762 more accurate.
1763
1764 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1765 not defined as a macro. The latter happens on MS-Windows.
1766 (Bug#12446)
1767
1768 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1769
1770 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1771 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1772 Some instances of '#include <setjmp.h>' removed, if the
1773 only reason for the instance was because "lisp.h" was included.
1774 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1775 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1776 and _longjmp with the new symbols. Emacs already uses _setjmp if
1777 available, so this change affects only POSIXish hosts that have
1778 sigsetjmp but not _setjmp, such as some versions of Solaris and
1779 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1780 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1781 (png_load_body) [HAVE_PNG]:
1782 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1783 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1784 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1785 since PNG requires jmp_buf. This is the only exception to the
1786 general rule that we now use sys_setjmp and sys_longjmp.
1787 This exception is OK since this code does not change the signal
1788 mask or longjmp out of a signal handler.
1789
1790 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1791
1792 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1793 Include "syssignal.h", for 'main_thread'.
1794
1795 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1796
1797 Avoid out-of-range marker position (Bug#12426).
1798 * insdel.c (replace_range, replace_range_2):
1799 Adjust markers before overlays, as suggested by comments.
1800 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1801 Remove redundant check before calling offset_intervals.
1802
1803 2012-09-14 Martin Rudalics <rudalics@gmx.at>
1804
1805 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1806 current buffer (Bug#12387).
1807
1808 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
1809
1810 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1811
1812 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1813
1814 Use a more backwards-compatible timer format (Bug#12430).
1815 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1816 vector element, not from the 4th, since PSECS is now at the end.
1817 (Fcurrent_idle_time): Doc fix.
1818
1819 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1820
1821 Function to mark objects and remove killed buffers at once.
1822 * alloc.c (discard_killed_buffers): Rename to ...
1823 (mark_discard_killed buffers) ... new name. Add marking
1824 of remaining objects. Fix comment. Adjust users.
1825 (mark_object): Do not touch frame buffer lists here.
1826 * frame.c (delete_frame): Reset frame buffer lists here.
1827
1828 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1829
1830 Better workaround for GNOME bug when --enable-gcc-warnings.
1831 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1832 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1833 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1834
1835 Simplify SIGIO usage (Bug#12408).
1836 The code that dealt with SIGIO was crufty and confusing, e.g., it
1837 played tricks like "#undef SIGIO" but these tricks were not used
1838 consistently. Simplify mostly by not #undeffing standard symbols,
1839 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1840 or not as we please) rather than "defined SIGIO" (standard symbol
1841 that we probably shouldn't #undef).
1842 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1843 Modules that need it can include it.
1844 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1845 * dispextern.h (ignore_sigio): New decl.
1846 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1847 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1848 * emacs.c (shut_down_emacs):
1849 * keyboard.c (kbd_buffer_store_event_hold):
1850 Use ignore_sigio rather than invoking 'signal' directly.
1851 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1852 for FIONREAD.
1853 (FIONREAD, SIGIO): Do not #undef.
1854 (tty_read_avail_input): Use #error rather than a syntax error.
1855 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1856 for I_PIPE, used by SETUP_SLAVE_PTY.
1857 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1858 * sysdep.c (croak): Remove; no longer needed. This bit of
1859 temporary code, with Fred N. Fish's comment that it's temporary,
1860 has been in Emacs since at least 1992!
1861 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1862 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1863 * syssignal.h (croak): Remove decl.
1864 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1865 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1866 now that we're termios-only.
1867 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1868 * term.c (dissociate_if_controlling_tty): Use #error rather than
1869 a run-time error.
1870
1871 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1872 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1873 to work around GNOME bug 683906.
1874 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1875 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1876 This works around GCC bug 54561.
1877
1878 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1879
1880 More fixes for 'volatile' and setjmp/longjmp.
1881 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1882 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1883 (png_load_body) [HAVE_PNG]:
1884 (jpeg_load_body) [HAVE_JPEG]:
1885 New function, with most of the old parent function's body.
1886 (png_load) [HAVE_PNG]:
1887 (jpeg_load) [HAVE_JPEG]:
1888 Invoke the new function, to avoid longjmp munging our locals.
1889 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1890 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1891 longjmp is passed 2, as the C standard doesn't guarantee this.
1892 Instead, store the failure code into mgr->failure_code.
1893
1894 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1895
1896 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1897 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1898 (syms_of_keyboard): Remove support for unread-command-char.
1899
1900 2012-09-12 Eli Zaretskii <eliz@gnu.org>
1901
1902 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1903 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1904 violation. (Bug#12426)
1905
1906 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1907
1908 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1909
1910 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1911
1912 * eval.c: Add `inhibit-debugger'.
1913 (Qinhibit_debugger): New symbol.
1914 (call_debugger): Bind it instead of Qdebug_on_error.
1915 (maybe_call_debugger): Test Vinhibit_debugger.
1916 (syms_of_eval): Define inhibit-debugger.
1917 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1918 (syms_of_xdisp): Remove inhibit-debug-on-message.
1919
1920 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1921
1922 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1923 If a nonvolatile local variable is written before a _longjmp to
1924 the frame containing the variable, and is read after the _longjmp,
1925 the value read is indeterminate. Some local variables of type
1926 'struct handler' and 'struct catchtag' are used in this way, so
1927 mark each of their slots as volatile if the slot can be set before
1928 _longjmp and read afterwards.
1929 * lisp.h (struct handler): var and chosen_clause are now volatile.
1930 (struct catchtag): val, next, and pdlcount are now volatile.
1931
1932 * bidi.c (bidi_push_it, bidi_pop_it):
1933 * fns.c (copy_hash_table):
1934 * image.c (define_image_type):
1935 * keyboard.c (kbd_buffer_store_event_hold):
1936 * process.c (Fprocess_send_eof):
1937 * xfaces.c (x_create_gc) [HAVE_NS]:
1938 * xgselect.c (xg_select):
1939 Prefer assignment to memcpy when either will do.
1940
1941 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1942 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1943 time an item is removed. No need to mark this function 'inline';
1944 the compiler knows better than we do.
1945
1946 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1947
1948 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1949 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1950 to change_frame_size (Bug#12388).
1951 (windowDidResize:): Pass YES to updateFrameSize.
1952
1953 * nsterm.h: Add delay parameter to updateFrameSize.
1954
1955 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1956
1957 Discard killed buffers from deleted window and frame objects.
1958 This reduces an amount of references to killed buffers and
1959 helps GC to reclaim them faster.
1960 * alloc.c (discard_killed_buffers): New function.
1961 (mark_object): Use it for deleted windows and frames.
1962 (mark_object): If symbol's value is set up for a killed buffer
1963 or deleted frame, restore it's global binding.
1964 * data.c (swap_in_global_binding): Add GC notice.
1965 (swap_in_symval_forwarding): Use convenient set_blv_where.
1966 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1967 * window.h: ... to here.
1968
1969 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1970
1971 Convenient macro to check whether the buffer is live.
1972 * buffer.h (BUFFER_LIVE_P): New macro.
1973 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1974 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1975
1976 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1977
1978 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1979 composition cases (Bug#12364).
1980
1981 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1982 overhang of succeeding glyphs overlapping box cursor.
1983
1984 * w32term.c (x_draw_glyph_string): Likewise.
1985
1986 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1987
1988 Simplify, document, and port floating-point (Bug#12381).
1989 The porting part of this patch fixes bugs on non-IEEE platforms
1990 with frexp, ldexp, logb.
1991 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1992 Now static.
1993 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1994 support, by removing commented-out code and briefly listing the
1995 C89 functions excluded. The commented-out stuff was confusing
1996 maintenance, e.g., we thought we needed cbrt but it was commented out.
1997 (logb): Remove decl; no longer needed.
1998 (isfinite): New macro, if not already supplied.
1999 (isnan): Don't replace any existing macro.
2000 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2001 are present on all C89 platforms.
2002 (Ffrexp): Do not special-case zero, as frexp does the right thing
2003 for that case.
2004 (Flogb): Do not use logb, as it doesn't have the desired meaning
2005 on hosts that use non-base-2 floating point. Instead, stick with
2006 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2007 frexp, to avoid getting an unspecified result.
2008
2009 * xdisp.c (Qinhibit_debug_on_message): Now static.
2010
2011 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2012
2013 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2014 NSBezierPath (Bug#12131).
2015
2016 2012-09-10 Chong Yidong <cyd@gnu.org>
2017
2018 * fns.c (Fdelq, Fdelete): Doc fix.
2019
2020 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2021
2022 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2023 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2024
2025 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2026
2027 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2028 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2029 Use it.
2030
2031 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2032
2033 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2034 left fringe if the window has a left margin. This avoids leaving
2035 traces of the cursor because its leftmost pixel is not drawn over.
2036
2037 * dispnew.c (update_window_line): When the left margin area of a
2038 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2039 that screen line. (Bug#12277)
2040
2041 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2042
2043 Assume C89 or later for math functions (Bug#12381).
2044 This simplifies the code, and makes it a bit smaller and faster,
2045 and (most important) makes it easier to clean up signal handling
2046 since we can stop worring about floating-point exceptions in
2047 library code. That was a problem before C89, but the problem
2048 went away many years ago on all practical Emacs targets.
2049 * data.c, image.c, lread.c, print.c:
2050 Don't include <math.h>; no longer needed.
2051 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2052 might be autoconfigured, as that never happens.
2053 * data.c (fmod):
2054 * doprnt.c (DBL_MAX_10_EXP):
2055 * print.c (DBL_DIG):
2056 Remove. C89 or later always defines these.
2057 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2058 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2059 (arith_error, domain_error, domain_error2):
2060 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2061 no longer needed -- we simply return what C returns. All uses removed.
2062 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2063 the wrapped code.
2064 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2065 Remove. All uses expanded, as these macros are no longer used
2066 more than once and are now more trouble than they're worth.
2067 (Ftan): Use tan, not sin / cos.
2068 (Flogb): Assume C89 frexp.
2069 (fmod_float): Assume C89 fmod.
2070 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2071 (init_floatfns): Remove. All uses removed.
2072
2073 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2074
2075 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2076 compositeToPoint for OSX < 10.6 (Bug#12390).
2077
2078 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2079
2080 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2081 This produces more-accurate results.
2082
2083 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2084
2085 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2086 changes (Bug#12088).
2087
2088 2012-09-08 Chong Yidong <cyd@gnu.org>
2089
2090 * syntax.c (Fstring_to_syntax): Doc fix.
2091
2092 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2093
2094 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2095 in the internal border.
2096 (x_set_window_size): Remove static variables and their usage.
2097 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2098 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2099 Remove fringe/internal border adjustment (Bug#11052).
2100 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2101 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2102 (ns_fix_rect_ibw): Remove.
2103 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2104 (ns_dumpglyphs_box_or_relief): Ditto.
2105 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2106 adjustment.
2107 (ns_dumpglyphs_image): Ditto.
2108 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2109 border adjustment.
2110 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2111 their usage. Add fringe_extended_p and its use as in other terms.
2112 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2113 scroll bar was removed.
2114 (updateFrameSize): New function.
2115 (windowDidResize): Move code to updateFrameSize and call it.
2116
2117 * nsterm.h (EmacsView): Add updateFrameSize.
2118
2119 2012-09-07 Chong Yidong <cyd@gnu.org>
2120
2121 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2122
2123 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2124
2125 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2126
2127 More signal-handler cleanup (Bug#12327).
2128 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2129 Problem introduced when merging patches. Noted by Eli Zaretskii in
2130 <http://bugs.gnu.org/12327#67>.
2131 * floatfns.c: Comment fix.
2132 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2133 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2134 and anyway the declaration is harmless even if SIGDANGER is not defined.
2135 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2136 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2137 source files not surprisingly expected syssignal.h to define, or
2138 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2139 Include <sys/ioctl.h>, for FIONREAD.
2140 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2141 This eliminates a problem whereby other files mysteriously had
2142 to include "syssignal.h" before including "systty.h" if they
2143 wanted to use "#ifdef SIGIO".
2144
2145 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2146
2147 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2148
2149 * w32.c (sigemptyset): Empty the set.
2150 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2151
2152 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2153
2154 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2155
2156 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2157 (mark_object): Likewise for frame objects.
2158
2159 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2160
2161 * syssignal.h (handle_on_main_thread): Always declare,
2162 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2163 This ports to platforms without HAVE_PTHREAD.
2164
2165 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2166
2167 Signal-handler cleanup (Bug#12327).
2168 Emacs's signal handlers were written in the old 4.2BSD style with
2169 sigblock and sigmask and so forth, and this led to some
2170 inefficiencies and confusion. Rewrite these to use
2171 pthread_sigmask etc. without copying signal sets around. Also,
2172 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2173 'signal', and instead use functions that do not attempt to take
2174 over the system name space. This patch causes Emacs's text
2175 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2176 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2177 Do not include <signal.h> or "syssignal.h", as these
2178 modules do not use signals.
2179 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2180 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2181 Do not include <signal.h>, as "syssignal.h" does that for us now.
2182 * atimer.c (sigmask_atimers): New function.
2183 (block_atimers, unblock_atimers): New functions,
2184 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2185 All uses replaced.
2186 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2187 no longer needed here.
2188 * emacs.c (main): Inspect existing signal handler with sigaction,
2189 so that there's no need to block and unblock SIGHUP.
2190 * sysdep.c (struct save_signal): New member 'action', replacing
2191 old member 'handler'.
2192 (save_signal_handlers, restore_signal_handlers):
2193 Use sigaction instead of 'signal' to save and restore.
2194 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2195 New function. All users of 'signal' modified to use set_sighandler
2196 if they're writeonly, and to use sys_signal if they're read+write.
2197 (emacs_sigaction_init, forwarded_signal): New functions.
2198 (sys_signal): Remove. All uses replaced by calls to sigaction
2199 and emacs_sigaction_init, or by direct calls to 'signal'.
2200 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2201 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2202 all uses replaced by pthread_sigmask etc. calls.
2203 * syssignal.h: Include <signal.h>.
2204 (emacs_sigaction_init, forwarded_signal): New decls.
2205 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2206 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2207 (sigmask, sys_sigmask): Remove; no longer needed.
2208 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2209 (sigblock, sigunblock, sigfree):
2210 (sigsetmask) [!defined sigsetmask]:
2211 Remove. All uses replaced by pthread_sigmask.
2212 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2213 no longer need to be replaced, and its typical old uses
2214 are now done via emacs_sigaction_init and sigaction.
2215 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2216 (sys_sigdel): Remove; unused.
2217 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2218
2219 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2220
2221 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2222 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2223
2224 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2225
2226 Explicitly mark buffer_defaults and buffer_local_symbols.
2227 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2228 mark_local_symbols here.
2229 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2230 since special buffers aren't marked here any more.
2231 (allocate_buffer): Chain new buffer with all_buffers here...
2232 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2233 not here.
2234 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2235 (syms_of_buffer): Remove staticpro of the above.
2236 (init_buffer_once): Set names for buffer_defaults and
2237 buffer_local_symbols.
2238
2239 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2240
2241 Use bool for booleans in font-related modules.
2242 * font.c (font_intern_prop, font_style_to_value)
2243 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2244 (generate_otf_features, font_check_otf_features, font_check_otf)
2245 (font_match_p, font_list_entities, font_at):
2246 * fontset.c (fontset_id_valid_p, reorder_font_vector
2247 (fontset_find_font, Fset_fontset_font)
2248 (face_suitable_for_char_p) [0]:
2249 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2250 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2251 (m17n_flt_initialized, ftfont_shape_by_flt):
2252 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2253 * nsfont.m (nsfont_draw):
2254 * w32font.c (w32font_draw):
2255 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2256 Use bool for booleans.
2257 * font.h: Adjust to above API changes.
2258 (struct font, struct font_driver, struct font_driver_list):
2259 Use bool for booleans.
2260 (struct font): Remove useless member encoding_type.
2261 All users removed.
2262 * fontset.c, xftfont.c: Omit unnecessary static decls.
2263
2264 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2265
2266 * alloc.c (mark_object): Revert window marking code
2267 since it's unsafe for the Fset_window_configuration.
2268
2269 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2270
2271 Fix race conditions with signal handlers and errno (Bug#12327).
2272 Be more systematic about preserving errno whenever a signal
2273 handler returns, even if it's not in the main thread. Do this by
2274 renaming signal handlers to distinguish between signal delivery
2275 and signal handling. All uses changed.
2276 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2277 * data.c (deliver_arith_signal): Rename from arith_error.
2278 * dispnew.c (deliver_window_change_signal): Rename from
2279 window_change_signal.
2280 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2281 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2282 * keyboard.c (deliver_input_available_signal): Rename from
2283 input_available_signal.
2284 (deliver_user_signal): Rename from handle_user_signal.
2285 (deliver_interrupt_signal): Rename from interrupt_signal.
2286 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2287 (deliver_child_signal): Rename from sigchld_handler.
2288 * atimer.c (handle_alarm_signal):
2289 * data.c (handle_arith_signal):
2290 * dispnew.c (handle_window_change_signal):
2291 * emacs.c (handle_fatal_signal, handle_danger_signal):
2292 * keyboard.c (handle_input_available_signal):
2293 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2294 * process.c (handle_pipe_signal, handle_child_signal):
2295 New functions, with the actual signal-handling code taken from the
2296 original respective signal handlers, sans the sporadic attempts to
2297 preserve errno, since that's now done by handle_on_main_thread.
2298 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2299 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2300 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2301 Move to sysdep.c.
2302 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2303 Move initialization of main_thread to sysdep.c's init_signals.
2304 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2305 our usage, and simplifies the mainline code.
2306 (record_child_status_change): New static function, as a helper
2307 for handle_child_signal, and with most of the old child handler's
2308 contents.
2309 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2310 (handle_child_signal): Use the above.
2311 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2312 Moved here from emacs.c.
2313 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2314 code moved here from emacs.c's main function.
2315 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2316 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2317 This lets callers save and restore errno properly.
2318
2319 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2320
2321 Remove redundant or unused things here and there.
2322 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2323 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2324 * editfns.c (Fcompare_buffer_substrings): Likewise.
2325 * frame.h (struct terminal, struct font_driver_list):
2326 Remove redundant declarations.
2327 * window.h (Qleft, Qright): Likewise.
2328
2329 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2330
2331 Do not mark objects from deleted buffers, windows and frames.
2332 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2333 (mark_object): Likewise for windows and frames.
2334
2335 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2336
2337 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2338 buffer_defaults and buffer_local_symbols as valid objects.
2339 Return special value to denote them.
2340
2341 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2342
2343 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2344 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2345 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2346 (file_name_absolute_p, Fsubstitute_in_file_name):
2347 (check_executable, check_writable, Ffile_accessible_directory_p)
2348 (Fset_file_selinux_context, Fdefault_file_modes)
2349 (Finsert_file_contents, choose_write_coding_system)
2350 (Fwrite_region, build_annotations, a_write, e_write)
2351 (Fdo_auto_save):
2352 * filelock.c (boot_time_initialized, get_boot_time)
2353 (get_boot_time_1, lock_file_1, within_one_second):
2354 * floatfns.c (in_float):
2355 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2356 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2357 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2358 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2359 * window.c (compare_window_configurations):
2360 Use bool for booleans.
2361 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2362 (Fdefault_file_modes): Now mode_t, not int, for modes.
2363 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2364 (internal_delete_file): Now returns void, not a (boolean) int,
2365 since nobody was looking at the return value.
2366 * lisp.h, window.h: Adjust to above API changes.
2367
2368 * xdisp.c (set_message): Simplify and reindent last change.
2369
2370 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2371
2372 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2373
2374 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2375
2376 * eval.c (call_debugger): Make the function non-static so that we
2377 can call it from set_message.
2378
2379 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2380 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2381
2382 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2383
2384 Give more-useful info on a fatal error (Bug#12328).
2385 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2386 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2387 of doing the work ourselves.
2388 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2389 do most of the work.
2390 (fatal_error_backtrace): New function, taken from the guts
2391 of the old fatal_error_signal, but with a new option to output
2392 a backtrace.
2393 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2394 info about the signal than just its number.
2395 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2396 * sysdep.c: Include <execinfo.h>
2397 (emacs_backtrace): New function, taken partly from the previous
2398 code of the 'die' function.
2399 (emacs_abort): Call fatal_error_backtrace rather than abort.
2400
2401 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2402
2403 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2404 eager (load-time) macro-expansion.
2405 * lisp.mk (lisp): Add macroexp.
2406
2407 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2408
2409 Simplify redefinition of 'abort' (Bug#12316).
2410 Do not try to redefine the 'abort' function. Instead, redo
2411 the code so that it calls 'emacs_abort' rather than 'abort'.
2412 This removes the need for the NO_ABORT configure-time macro
2413 and makes it easier to change the abort code to do a backtrace.
2414 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2415 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2416 Remove; sysdep.c's emacs_abort now takes its place.
2417 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2418 'abort' changed to use 'emacs_abort'.
2419 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2420 (abort) [!defined abort]: Rename to ...
2421 (emacs_abort): ... new name.
2422 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2423 the place of the old 'abort' in emacs.c.
2424 * w32.c, w32fns.c (abort): Do not #undef.
2425 * w32.c (emacs_abort): Rename from w32_abort.
2426
2427 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2428
2429 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2430 offsets[j].dv, since the y axis of the screen coordinates points
2431 down, while the y axis of the font definition coordinates points
2432 up. This fixes display of Arabic diacritics such as KASRA and
2433 KASRATAN. (Bug#11860)
2434
2435 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2436
2437 Be more systematic about _setjmp vs setjmp.
2438 * alloc.c (test_setjmp, mark_stack):
2439 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2440 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2441 (png_load, my_error_exit, jpeg_load):
2442 * process.c (send_process_trap, send_process):
2443 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2444 The underscored versions are up to 30x faster on some hosts.
2445 Formerly, the code used setjmp+longjmp sometimes and
2446 _setjmp+_longjmp at other times, with no particular reason to
2447 prefer setjmp+longjmp.
2448
2449 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2450
2451 Fix minor problem found by static checking.
2452 * buffer.c (Fdelete_all_overlays): Return nil.
2453
2454 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2455
2456 * buffer.c (Fdelete_all_overlays): New function.
2457
2458 2012-09-03 Chong Yidong <cyd@gnu.org>
2459
2460 * gtkutil.c: Add extern decl for Qxft.
2461
2462 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2463
2464 * emacs.c, eval.c: Use bool for boolean.
2465 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2466 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2467 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2468 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2469 (main, decode_env_path, Fdaemon_initialized):
2470 * eval.c (call_debugger, Finteractive_p, interactive_p):
2471 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2472 (maybe_call_debugger, Fbacktrace):
2473 * process.c (read_process_output, exec_sentinel):
2474 Use bool for booleans.
2475 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2476 All callers changed.
2477 * eval.c (interactive_p): Omit always-true boolean argument
2478 EXCLUDE_SUBRS_P. All callers changed.
2479 * dispextern.h, lisp.h: Reflect above API changes.
2480 * firstfile.c (dummy): Use the address of 'main', whose signature
2481 won't change, instead of the address of 'initialize', whose
2482 signature just changed from int to bool.
2483 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2484 * msdos.c (fatal_error_in_progress): ... from here.
2485 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2486 of incrementing it.
2487 (redisplay_internal, unwind_redisplay): Simply clear
2488 REDISPLAYING_P when unwinding, instead of saving its previous,
2489 always-false value and then restoring it.
2490
2491 Clean up some extern decls.
2492 Mostly, this hoists extern decls out of .c files and into .h files.
2493 That way, we're more likely to catch errors if the interfaces change.
2494 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2495 declare xg_mark_data.
2496 * dispextern.h (x_frame_parm_handlers):
2497 * font.h (Qxft):
2498 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2499 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2500 (Qultra_bold, Qoblique, Qitalic):
2501 Move extern decl here from .c file.
2502 * alloc.c (xg_mark_data) [USE_GTK]:
2503 * doc.c (Qclosure):
2504 * eval.c (Qlexical_binding):
2505 * fns.c (time) [!HAVE_UNISTD_H]:
2506 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2507 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2508 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2509 * lread.c (Qinternal_interpreter_environment):
2510 * minibuf.c (Qbuffer):
2511 * process.c (QCfamily, QCfilter):
2512 * widget.c (free_frame_faces):
2513 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2514 * xfont.c (x_clear_errors):
2515 * xterm.c (x_frame_parm_handlers):
2516 Remove now-redundant extern decls.
2517 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2518 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2519 Now static.
2520 * xfaces.c: Remove unnecessary static decls.
2521 * xterm.c (updating_frame): Remove decl of nonexistent object.
2522
2523 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2524 when building globals.h, as the objects that are not built on
2525 this host are not needed to compile C files on this host.
2526
2527 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2528
2529 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2530
2531 * frame.h: Add missing prototype for x_wm_set_size_hint.
2532
2533 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2534
2535 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2536 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2537 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2538 (Fsubstitute_command_keys):
2539 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2540 (save_excursion_save, save_excursion_restore)
2541 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2542 (format_time_string, general_insert_function)
2543 (make_buffer_string, make_buffer_string_both)
2544 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2545 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2546 (copy_text, insert_1, insert_1_both, insert_from_string)
2547 (insert_from_string_before_markers, insert_from_string_1)
2548 (insert_from_buffer, insert_from_buffer_1, replace_range)
2549 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2550 (del_range_2, modify_region):
2551 * intervals.c (intervals_equal, balance_possible_root_interval)
2552 (adjust_intervals_for_insertion, merge_properties_sticky)
2553 (graft_intervals_into_buffer, lookup_char_property)
2554 (adjust_for_invis_intang, set_point_both)
2555 (get_property_and_range, compare_string_intervals)
2556 (set_intervals_multibyte_1, set_intervals_multibyte):
2557 * keyboard.c (decode_timer):
2558 Use bool for boolean.
2559 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2560 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2561
2562 2012-09-02 Chong Yidong <cyd@gnu.org>
2563
2564 * keymap.c (push_key_description): Print M-TAB as C-M-i
2565 (Bug#11758).
2566
2567 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2568
2569 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2570 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2571 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2572 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2573 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2574 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2575 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2576
2577 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2578
2579 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2580 more than one grapheme cluster passed to the shaper: compute the
2581 offset adjustment values separately for each cluster. (Bug#11860)
2582
2583 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2584 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2585 about implicit conversions from integer to pointer.
2586
2587 2012-09-01 Daniel Colascione <dancol@dancol.org>
2588
2589 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2590 system used too early.
2591
2592 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2593
2594 Better seed support for (random).
2595 * emacs.c (main): Call init_random.
2596 * fns.c (Frandom): Set the seed from a string argument, if given.
2597 Remove long-obsolete Gentzel cruft.
2598 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2599 (init_random): New function.
2600
2601 2012-09-01 Daniel Colascione <dancol@dancol.org>
2602
2603 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2604 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2605 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2606 x_wm_set_size_hint, x_query_colors, x_real_positions,
2607 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2608 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2609 all of which have been moved to common code.
2610
2611 * xfaces.c: Include TERM_HEADER instead of listing all possible
2612 window-system headers.
2613
2614 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2615 to match header.
2616
2617 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2618 directly accessing frame internals.
2619
2620 * w32font.h: Include font.h. Define syms_of_w32font and
2621 globals_of_w32font.
2622
2623 * process.c: Include TERM_HEADER instead of listing all possible
2624 window-system headers.
2625
2626 * nsterm.h: Remove declarations now in frame.h.
2627 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2628
2629 * menu.c: Include TERM_HEADER instead of listing all possible
2630 window-system headers.
2631
2632 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2633 window system.
2634
2635 * keyboard.c: Include TERM_HEADER instead of listing all possible
2636 window-system headers.
2637
2638 * image.c: Include TERM_HEADER instead of listing all possible
2639 window-system headers. Declare Vlibrary_cache when compiling for
2640 Windows.
2641
2642 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2643 window system declarations.
2644
2645 * frame.h: Move common functions here: set_frame_menubar,
2646 x_set_window_size, x_sync, x_get_focus_frame,
2647 x_set_mouse_position, x_set_mouse_pixel_position,
2648 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2649 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2650 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2651 x_activate_menubar, x_real_positions, x_bitmap_icon,
2652 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2653 and x_query_colors.
2654
2655 * frame.c: Include TERM_HEADER instead of listing all possible
2656 window-system headers.
2657
2658 * font.c: Include TERM_HEADER instead of listing all possible
2659 window-system headers.
2660
2661 * emacs.c: Include TERM_HEADER.
2662
2663 * dispnew.c: Include TERM_HEADER instead of listing all possible
2664 window-system headers.
2665
2666 * ccl.h: Include character.h.
2667
2668 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2669 the current window system; include in list of objects to link into
2670 Emacs.
2671
2672 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2673
2674 Remove mark_ttys function and fix tty_display_info initialization.
2675 * lisp.h (mark_ttys): Remove prototype.
2676 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2677 to mark_ttys because all possible values of 'top_frame' slot are
2678 the frames which are reachable from Vframe_list.
2679 * term.c (mark_ttys): Remove.
2680 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2681
2682 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2683
2684 Change struct frame bitfields from unsigned char to unsigned.
2685 * frame.h (struct frame): Change type of 'display_preempted',
2686 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2687 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2688 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2689 bitfields from unsigned char to unsigned.
2690
2691 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2692
2693 Remove unused member of struct x_output and struct w32_output.
2694 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2695 * w32term.h (struct w32_output): Likewise.
2696
2697 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2698
2699 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2700 does not become zero (Bug#12234).
2701
2702 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2703
2704 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2705 for GCC 4.7.1 x86-64.
2706
2707 2012-08-30 Glenn Morris <rgm@gnu.org>
2708
2709 * lread.c (init_lread): For out-of-tree builds, only add the
2710 source directory's site-lisp dir to the load-path if it exists,
2711 consistent with in-tree builds. (Bug#12302)
2712
2713 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2714
2715 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2716 button_values to NULL. Call setStykeMask so dialogs get a close button.
2717 (windowShouldClose:): Set window_closed.
2718 (dealloc): New member, free button_values.
2719 (process_dialog:): Make member function. Remove window argument,
2720 replace window with self. Count buttons and allocate and store values
2721 in button_values.
2722 (addButton:value:row:): value is int with the name tag. Call setTag
2723 with tag. Remove return self, declare return value as void.
2724 (addString:row:): Remove return self, declare return value as void.
2725 (addSplit): Remove return self, declare return value as void.
2726 (clicked:): Remove return self, declare return value as void.
2727 Set dialog_return to button_values[seltag]. Code formatting change.
2728 (initFromContents:isQuestion:): Adjust call to process_dialog.
2729 Code formatting change.
2730 (timeout_handler:): Set timer_fired to YES.
2731 (runDialogAt:): Set timer_fired to NO.
2732 Handle click on close button as quit.
2733
2734 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2735 Add window_closed and button_values. Add void as return value for
2736 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2737 Add process_dialog as new member.
2738
2739 2012-08-28 Eli Zaretskii <eliz@gnu.org>
2740
2741 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2742 is not one of the heaps we manage. (Bug#12242)
2743
2744 2012-08-28 Glenn Morris <rgm@gnu.org>
2745
2746 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2747
2748 2012-08-28 Martin Rudalics <rudalics@gmx.at>
2749
2750 * window.c (Fset_window_configuration): Remove handling of
2751 auto-buffer-name window parameter. Install revision of reverted
2752 fix.
2753
2754 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2755
2756 Do not allow to set major mode for a dead buffer.
2757 * buffer.c (Fset_buffer_major_mode): Signal an error
2758 if the buffer is dead.
2759 (Fother_buffer, other_buffer_safely): Remove redundant
2760 nested declaration.
2761
2762 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2763
2764 Always use set_buffer_if_live to restore original buffer at unwind.
2765 * buffer.h (record_unwind_current_buffer): New function.
2766 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2767 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2768 * undo.c, window.c: Adjust users.
2769 * buffer.c (set_buffer_if_live): Fix comment.
2770
2771 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2772
2773 Fix usage of set_buffer_internal.
2774 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2775 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2776 * coding.c (decode_coding): Omit redundant test.
2777 * fileio.c (decide_coding_unwind): Likewise.
2778 * fns.c (secure_hash): Likewise.
2779 * insdel.c (modify_region): Likewise.
2780 * keyboard.c (command_loop_1): Likewise.
2781 * print.c (PRINTFINISH): Likewise.
2782 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2783
2784 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2785
2786 * dispnew.c: Use bool for boolean.
2787 (frame_garbaged, display_completed, delayed_size_change)
2788 (fonts_changed_p, add_window_display_history)
2789 (add_frame_display_history, verify_row_hash)
2790 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2791 (row_equal_p, realloc_glyph_pool)
2792 (allocate_matrices_for_frame_redisplay)
2793 (showing_window_margins_p)
2794 (adjust_frame_glyphs_for_frame_redisplay)
2795 (build_frame_matrix_from_leaf_window, make_current)
2796 (mirrored_line_dance, mirror_line_dance, update_frame)
2797 (update_window_tree, update_single_window)
2798 (check_current_matrix_flags, update_window, update_text_area)
2799 (update_window_line, set_window_update_flags, scrolling_window)
2800 (update_frame_1, scrolling, buffer_posn_from_coords)
2801 (do_pending_window_change, change_frame_size)
2802 (change_frame_size_1, sit_for):
2803 Use bool for boolean.
2804 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2805 and remove last int (actually boolean) argument, which was always 0.
2806 All callers changed.
2807 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2808 * dispextern.h (struct composition_it): Use bool for boolean.
2809 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2810 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2811 * dired.c (file_name_completion):
2812 Use bool for boolean. (This was missed in an earlier change.)
2813
2814 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2815
2816 * window.c (Fset_window_configuration): Revert first part of
2817 last change.
2818
2819 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2820
2821 * nsterm.h (NSPanel): New class variable dialog_return.
2822
2823 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2824 Initialize dialog_return.
2825 (windowShouldClose:): Use stop instead of stopModalWithCode.
2826 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2827 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2828 event.
2829 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2830 modal loop returns.
2831
2832 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2833
2834 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2835 * composite.c (find_composition, composition_gstring_p)
2836 (composition_reseat_it, find_automatic_composition):
2837 * data.c (let_shadows_buffer_binding_p)
2838 (let_shadows_global_binding_p, set_internal, make_blv)
2839 (Fmake_variable_buffer_local, Fmake_local_variable)
2840 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2841 (cons_to_signed, arith_driver):
2842 * dbusbind.c (xd_in_read_queued_messages):
2843 * dired.c (directory_files_internal, file_name_completion):
2844 Use bool for booleans.
2845 * dired.c (file_name_completion):
2846 * process.h (fd_callback):
2847 Omit int (actually boolean) argument. It wasn't being used.
2848 All uses changed.
2849 * composite.h, lisp.h: Reflect above API changes.
2850
2851 * cmds.c, coding.c: Use bool for booleans.
2852 * cmds.c (move_point, Fself_insert_command):
2853 * coding.h (struct composition status, struct coding_system):
2854 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2855 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2856 (emacs_mule_char, decode_coding_emacs_mule)
2857 (encode_coding_emacs_mule, detect_coding_iso_2022)
2858 (decode_coding_iso_2022, encode_invocation_designation)
2859 (encode_designation_at_bol, encode_coding_iso_2022)
2860 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2861 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2862 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2863 (encode_coding_raw_text, detect_coding_charset)
2864 (decode_coding_charset, encode_coding_charset, detect_eol)
2865 (detect_coding, get_translation_table, produce_chars)
2866 (consume_chars, reused_workbuf_in_use)
2867 (make_conversion_work_buffer, code_conversion_save)
2868 (decode_coding_object, encode_coding_object)
2869 (detect_coding_system, char_encodable_p)
2870 (Funencodable_char_position, code_convert_region)
2871 (code_convert_string, code_convert_string_norecord)
2872 (Fset_coding_system_priority):
2873 * fileio.c (Finsert_file_contents):
2874 Use bool for booleans.
2875 * coding.h, lisp.h: Reflect above API changes.
2876 * coding.c: Remove unnecessary static function decls.
2877 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2878 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2879 not a boolean 'int', since callers never look at the return value.
2880 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2881 * coding.h (decoding_buffer_size, encoding_buffer_size)
2882 (emacs_mule_string_char): Remove unused extern decls.
2883 (struct iso_2022_spec, struct coding_system):
2884 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2885 (struct emacs_mule_spec): Remove unused field 'full_support'.
2886 All initializations removed.
2887 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2888
2889 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2890
2891 Fix spare memory change (Bug#12286).
2892 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2893 (valid_lisp_object_p): Likewise.
2894
2895 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2896
2897 * window.c (Fset_window_configuration): Record any window's old
2898 buffer if it's replaced (see Bug#8789). If the new current
2899 buffer doesn't appear in the selected window, go to its old
2900 point (Bug#12208).
2901
2902 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2903
2904 Special MEM_TYPE_SPARE to denote reserved memory.
2905 * alloc.c (enum mem_type): New memory type.
2906 (refill_memory_reserve): Use new type for spare memory.
2907 This prevents live_cons_p and live_string_p from incorrect
2908 detection of uninitialized objects from spare memory as live.
2909
2910 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2911
2912 Spelling fixes.
2913 * Makefile.in (.PHONY): versioclean -> versionclean.
2914
2915 Remove unused external symbols.
2916 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2917 * window.c (Qwindow_valid_p, decode_valid_window):
2918 Now static, not extern.
2919 * data.c (Qinterval): Remove; unused.
2920 (syms_of_data): Do not define 'interval'.
2921 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2922 * window.h (decode_valid_window):
2923 Remove decls.
2924
2925 * character.c, charset.c, chartab.c: Use bool for booleans.
2926 * character.c (lisp_string_width, string_count_byte8)
2927 (string_escape_byte8):
2928 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2929 (load_charset_map_from_file, map_charset_chars)
2930 (Fdefine_charset_internal, define_charset_internal)
2931 (Fdeclare_equiv_charset, find_charsets_in_text)
2932 (Ffind_charset_region, char_charset, Fiso_charset):
2933 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2934 (sub_char_table_set, sub_char_table_set_range)
2935 (char_table_set_range, optimize_sub_char_table)
2936 (map_sub_char_table):
2937 Use bool for boolean.
2938 * character.c (str_to_unibyte): Omit last boolean argument; it was
2939 always 0. All callers changed.
2940 * character.h, charset.h: Adjust to match previous changes.
2941 * character.h (char_printable_p): Remove decl of nonexistent function.
2942 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2943 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2944 are all boolean, so make them single-bit bitfields.
2945
2946 * lisp.h (ASET): Remove attempt to detect side effects.
2947 It was meant to be temporary and it often doesn't work,
2948 because when IDX has side effects the behavior of IDX==IDX
2949 is undefined. See Stefan Monnier in
2950 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2951
2952 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2953
2954 * lisp.h (functionp): New function (extracted from Ffunctionp).
2955 (FUNCTIONP): Use it.
2956 * eval.c (Ffunctionp): Use it.
2957
2958 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2959
2960 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2961 as that's faster and simpler than static storage. Don't bother
2962 with the g_main_context_query overhead if g_main_context_pending
2963 says no events are pending.
2964 (gfds, gfds_size): Remove these static vars.
2965 (xgselect_initialize): Remove; no longer needed.
2966 All uses and decls removed.
2967
2968 * emacs.c (fatal_error_signal_hook): Remove.
2969 All uses removed. This leftover from old code was always 0.
2970
2971 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2972 * casefiddle.c (casify_object, casify_region):
2973 * casetab.c (set_case_table):
2974 * category.c, category.h (word_boundary_p):
2975 * category.h (CHAR_HAS_CATEGORY):
2976 Use bool for booleans, instead of int.
2977
2978 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2979
2980 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2981
2982 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2983
2984 On assertion failure, print backtrace if available.
2985 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2986 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2987 * Makefile.in (LIB_EXECINFO): New macro.
2988 (LIBES): Use it.
2989
2990 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2991 * bytecode.c (exec_byte_code):
2992 * callint.c (check_mark, Fcall_interactively):
2993 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2994 (getenv_internal, sync_process_alive, call_process_exited):
2995 * lisp.h (USE_SAFE_ALLOCA):
2996 Use bool for booleans, instead of int.
2997 * lisp.h, process.h: Adjust prototypes to match above changes.
2998 * callint.c (Fcall_interactively): Don't assume the mark's
2999 offset fits in 'int'.
3000
3001 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3002
3003 * buffer.c, buffer.h: Use bool for boolean.
3004 * buffer.c (reset_buffer_local_variables)
3005 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3006 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3007 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3008 (overlay_touches_p, overlay_strings, Foverlay_put)
3009 (report_overlay_modification, call_overlay_mod_hooks):
3010 (mmap_enlarge, mmap_set_vars):
3011 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3012 Use bool for booleans, instead of int.
3013 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3014 since the 1-or-0 return value is always ignored anyway.
3015 (mmap_initialized_p):
3016 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3017 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3018
3019 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3020
3021 * bidi.c: Use bool for boolean.
3022 This is a bit more readable, and makes the text segment of bidi.o
3023 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3024 Presumably it's faster too.
3025 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3026 Now bool.
3027 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3028 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3029 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3030 (bidi_explicit_dir_char, bidi_level_of_next_char)
3031 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3032 Use bool for booleans, instead of int.
3033 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3034 (bidi_unshelve_cache): Adjust decls to match code.
3035
3036 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3037
3038 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3039 argument.
3040
3041 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3042
3043 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3044 * atimer.h: Include <stdbool.h>.
3045
3046 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3047
3048 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3049 compile time tests instead of run time tests on systems that do
3050 not use them.
3051 (FRAME_MAC_P): Remove leftover from deleted code.
3052 * frame.c (syms_of_frame): Remove leftover from deleted code.
3053
3054 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3055
3056 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3057
3058 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3059
3060 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3061 Otherwise, the compiler complains about (A?B:C) where B is void
3062 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3063 (fontset_add): Return void, for FONTSET_ADD.
3064
3065 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3066
3067 * alloc.c: Use bool for booleans.
3068 (gc_in_progress, abort_on_gc)
3069 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3070 (dont_register_blocks) [GC_MALLOC_CHECK]:
3071 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3072 (check_string_bytes, make_specified_string, memory_full)
3073 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3074 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3075 (mark_stack, valid_pointer_p, make_pure_string)
3076 (Fgarbage_collect, survives_gc_p, gc_sweep):
3077 Use bool for booleans, instead of int.
3078 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3079 Remove unused local.
3080 * alloc.c (PURE_POINTER_P):
3081 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3082 * editfns.c (Fformat):
3083 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3084 (Fdo_auto_save):
3085 * fns.c (sweep_weak_table):
3086 * lisp.h (suppress_checking, push_message, survives_gc_p)
3087 (make_pure_string, gc_in_progress, abort_on_gc):
3088 * lread.c (readchar, read1):
3089 * print.c (Fprin1_to_string):
3090 * xdisp.c (push_message):
3091 Use bool for booleans affected directly or indirectly by
3092 alloc.c's changes.
3093
3094 Make recently-introduced setters macros.
3095 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3096 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3097 (set_fontset_default, set_fontset_fallback): Rename from their
3098 upper-case counterparts, and make them functions rather than macros.
3099 This is more consistent with the other recently-introduced setters.
3100 These don't need to be inline, since they're local.
3101
3102 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3103
3104 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3105 the loop (Bug#12247).
3106
3107 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3108
3109 * lisp.h (vcopy): Use memcpy rather than our own loop.
3110 This fixes a performance regression introduced by the recent
3111 addition of vcopy. This means 'vcopy' will need to be modified
3112 for a copying collector, but that's OK. Also, tighten the
3113 checking in the assertion.
3114
3115 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3116
3117 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3118 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3119 non-base glyph for the width of the base character, according to
3120 what x_draw_composite_glyph_string_foreground expects.
3121 Generate WADJUST value according to composition_gstring_width's
3122 expectations, to produce correct width of the composed character.
3123 Reverse the sign of the DU offset produced by ScriptPlace.
3124
3125 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3126
3127 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3128
3129 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3130
3131 Avoid direct writes to contents member of struct Lisp_Vector.
3132 * lisp.h (vcopy): New function to copy data into vector.
3133 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3134 * fns.c (Ffillarray): Use ASET.
3135 * keyboard.c (timer_check_2): Use AREF and ASET.
3136 (append_tool_bar_item, Frecent_keys): Use vcopy.
3137 * lread.c (read_vector): Use ASET.
3138 * msdos.c (Frecent_doskeys): Use vcopy.
3139 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3140 (Finternal_merge_in_global_face): Use ASET and vcopy.
3141 * xfont.c (xfont_list_pattern): Likewise.
3142
3143 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3144
3145 * window.c (Fwindow_point): For the selected window always return
3146 the position of its buffer's point.
3147 (Fset_window_point): For the selected window always go in its
3148 buffer to the specified position.
3149
3150 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3151
3152 Setter macros for fontsets.
3153 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3154 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3155 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3156 Adjust users.
3157
3158 2012-08-20 Glenn Morris <rgm@gnu.org>
3159
3160 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3161 Don't assume that `ln -f' works.
3162
3163 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3164
3165 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3166 and later about non-assignments with no effect. See discussion at
3167 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3168 details.
3169
3170 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3171
3172 Inline setter functions for Lisp_Objects slots of struct specbinding.
3173 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3174 Adjust users.
3175
3176 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3177
3178 * window.c (select_window): Always make selected window's buffer
3179 current.
3180
3181 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3182
3183 Use AREF and ASET for docstrings of category tables.
3184 * category.h (CATEGORY_DOCSTRING): Use AREF.
3185 (SET_CATEGORY_DOCSTRING): Use ASET.
3186 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3187
3188 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3189
3190 Inline setter functions for hash table members.
3191 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3192 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3193 (set_hash_key_and_value, set_hash_index, set_hash_next)
3194 (set_hash_hash): New functions.
3195 * charset.c, fns.c: Adjust users.
3196
3197 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3198
3199 Inline getter and setter functions for per-buffer values.
3200 * buffer.h (per_buffer_default, set_per_buffer_default)
3201 (per_buffer_value, set_per_buffer_value): New functions.
3202 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3203 * buffer.c, data.c: Adjust users.
3204
3205 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3206
3207 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3208
3209 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3210
3211 Rely on <config.h> + <unistd.h> to declare 'environ',
3212 as gnulib does this if the system doesn't.
3213 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3214 Remove declaration. MS-Windows declares it on stdlib.h which is
3215 included by conf_post.h.
3216 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3217 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3218 * vm-limit.c: Include <unistd.h>, for 'environ'.
3219
3220 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3221 (start_of_data): Remove decl; mem-limits.h provides it.
3222
3223 * xdisp.c (handle_invisible_prop): Make it a bit faster
3224 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3225
3226 2012-08-19 Chong Yidong <cyd@gnu.org>
3227
3228 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3229 ends (Bug#3874).
3230
3231 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3232
3233 * .gdbinit: Use call instead of set when calling a function in the
3234 inferior.
3235
3236 * data.c (set_internal): Don't use set_blv_found.
3237 (Fkill_local_variable): Likewise.
3238
3239 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3240
3241 * nsfont.m (ns_ascii_average_width): Ensure the string
3242 ascii_printable is initialized with a null-terminated character
3243 array. Otherwise, it can contain undesired extra characters.
3244
3245 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3246
3247 port new setting code to Sun C 5.8 2005/10/13
3248 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3249 Return void, not Lisp_Object. Otherwise, the compiler
3250 complains about (A?B:C) where B is void and C is Lisp_Object
3251 when compiling CHAR_TABLE_SET, due to the recent change to
3252 the API of sub_char_table_set_contents.
3253
3254 2012-08-18 Chong Yidong <cyd@gnu.org>
3255
3256 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3257 for the string case (Bug#3874).
3258
3259 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3260
3261 * buffer.h (BSET): Remove (Bug#12215).
3262 Replace all uses with calls to new setter functions.
3263 (bset_bidi_paragraph_direction, bset_case_canon_table)
3264 (bset_case_eqv_table, bset_directory, bset_display_count)
3265 (bset_display_time, bset_downcase_table)
3266 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3267 (bset_last_selected_window, bset_local_var_alist)
3268 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3269 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3270 (bset_width_table):
3271 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3272 (bset_auto_fill_function, bset_auto_save_file_format)
3273 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3274 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3275 (bset_cache_long_line_scans, bset_case_fold_search)
3276 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3277 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3278 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3279 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3280 (bset_header_line_format, bset_indicate_buffer_boundaries)
3281 (bset_indicate_empty_lines, bset_invisibility_spec)
3282 (bset_left_fringe_width, bset_major_mode, bset_mark)
3283 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3284 (bset_name, bset_overwrite_mode, bset_pt_marker)
3285 (bset_right_fringe_width, bset_save_length)
3286 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3287 (bset_scroll_up_aggressively, bset_selective_display)
3288 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3289 (bset_word_wrap, bset_zv_marker):
3290 * category.c (bset_category_table):
3291 * syntax.c (bset_syntax_table):
3292 New setter functions.
3293
3294 * process.h (PSET): Remove (Bug#12215).
3295 Replace all uses with calls to new setter functions.
3296 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3297 (PROCESS_INLINE): New macro.
3298 (pset_childp): New setter function.
3299 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3300 * process.c (PROCESS_INLINE):
3301 Define to EXTERN_INLINE, so that the corresponding functions
3302 are compiled into code.
3303 (pset_buffer, pset_command, pset_decode_coding_system)
3304 (pset_decoding_buf, pset_encode_coding_system)
3305 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3306 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3307 (pset_type, pset_write_queue): New setter functions.
3308
3309 * window.h (WSET): Remove (Bug#12215).
3310 Replace all uses with calls to new setter functions.
3311 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3312 (WINDOW_INLINE): New macro.
3313 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3314 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3315 (wset_total_lines, wset_vertical_scroll_bar)
3316 (wset_window_end_pos, wset_window_end_valid)
3317 (wset_window_end_vpos): New setter functions.
3318 * window.c (WINDOW_INLINE):
3319 Define to EXTERN_INLINE, so that the corresponding functions
3320 are compiled into code.
3321 (wset_combination_limit, wset_dedicated, wset_display_table)
3322 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3323 (wset_new_normal, wset_new_total, wset_next_buffers)
3324 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3325 (wset_prev_buffers, wset_right_fringe_width)
3326 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3327 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3328 (wset_window_parameters):
3329 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3330 (wset_column_number_displayed, wset_region_showing):
3331 New setter functions.
3332
3333 * termhooks.h (TSET): Remove (Bug#12215).
3334 Replace all uses with calls to new setter functions.
3335 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3336 (TERMHOOKS_INLINE): New macro.
3337 (tset_charset_list, tset_selection_alist): New setter functions.
3338 * terminal.c (TERMHOOKS_INLINE):
3339 Define to EXTERN_INLINE, so that the corresponding functions
3340 are compiled into code.
3341 (tset_param_alist): New setter function.
3342
3343 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3344
3345 * keyboard.h (KSET): Remove (Bug#12215).
3346 Replace all uses with calls to new setter functions.
3347 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3348 (KEYBOARD_INLINE): New macro.
3349 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3350 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3351 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3352 New setter functions.
3353 * keyboard.c (KEYBOARD_INLINE):
3354 Define to EXTERN_INLINE, so that the corresponding functions
3355 are compiled into code.
3356 (kset_echo_string, kset_kbd_queue)
3357 (kset_keyboard_translate_table, kset_last_prefix_arg)
3358 (kset_last_repeatable_command, kset_local_function_key_map)
3359 (kset_overriding_terminal_local_map, kset_real_last_command)
3360 (kset_system_key_syms): New setter functions.
3361
3362 * frame.h (FSET): Remove (Bug#12215).
3363 Replace all uses with calls to new setter functions.
3364 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3365 (FRAME_INLINE): New macro.
3366 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3367 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3368 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3369 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3370 (fset_param_alist, fset_root_window, fset_scroll_bars)
3371 (fset_selected_window, fset_title, fset_tool_bar_items)
3372 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3373 * frame.c (FRAME_INLINE):
3374 Define to EXTERN_INLINE, so that the corresponding functions
3375 are compiled into code.
3376 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3377
3378 A few more naming-convention fixes for getters and setters.
3379 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3380 and rename from buffer_overlays_set_before.
3381 (set_buffer_overlays_after): Move here from buffer.h, and rename
3382 from buffer_overlays_set_after.
3383 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3384 All uses changed.
3385 (set_buffer_intervals): Rename from buffer_set_intervals.
3386 * intervals.c (set_interval_object): Move here from intervals.h,
3387 and rename from interval_set_object.
3388 (set_interval_left): Move here from intervals.h, and rename from
3389 interval_set_left.
3390 (set_interval_right): Move here from intervals.h, and rename from
3391 interval_set_right.
3392 (copy_interval_parent): Move here from intervals.h, and rename from
3393 interval_copy_parent.
3394 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3395 (set_interval_plist): Rename from interval_set_plist.
3396 Return void, not Lisp_Object, since no caller uses the result.
3397 * lisp.h (string_intervals): Rename from string_get_intervals.
3398 (set_string_intervals): Rename from string_set_intervals.
3399
3400 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3401 (set_char_table_contents): Rename from char_table_set_contents.
3402 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3403 All uses changed. See the end of
3404 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3405
3406 * lisp.h (CSET): Remove (Bug#12215).
3407 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3408 (set_char_table_purpose): New functions,
3409 replacing CSET. All uses changed. For example, replace
3410 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3411 "set_char_table_parent (char_table, parent);".
3412 The old version was confusing because it used the same name
3413 'parent' for two different things.
3414
3415 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3416
3417 Functions to get and set Lisp_Object fields of buffer-local variables.
3418 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3419 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3420 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3421 * data.c, eval.c, frame.c: Adjust users.
3422
3423 2012-08-17 Chong Yidong <cyd@gnu.org>
3424
3425 * xfaces.c (merge_face_vectors): If the target font specfies a
3426 font spec, make the font's attributes take precedence over
3427 directly-specified attributes.
3428 (merge_face_ref): Recognize :font.
3429
3430 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3431
3432 Do not use memcpy for copying intervals.
3433 * intervals.c (reproduce_interval): New function.
3434 (reproduce_tree, reproduce_tree_obj): Use it.
3435 (reproduce_tree_obj): Remove prototype.
3436
3437 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3438
3439 * lisp.h (duration_to_sec_usec): Remove unused decl.
3440
3441 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3442
3443 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3444 to an allocated instance of NSString, not to the class itself.
3445
3446 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3447
3448 * makefile.w32-in (C_CTYPE_H): New macro.
3449 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3450 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3451 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3452
3453 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3454
3455 Use ASCII tests for character types.
3456 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3457 * xfns.c, xterm.c:
3458 Don't include <ctype.h>; was not needed.
3459 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3460 * sysdep.c, xfaces.c:
3461 Include <c-ctype.h> instead of <ctype.h>.
3462 * nsterm.m: Include <c-ctype.h>.
3463 * charset.c (read_hex):
3464 * doc.c (Fsnarf_documentation):
3465 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3466 (DRIVE_LETTER) [DOS_NT]:
3467 (Ffile_name_directory, Fexpand_file_name)
3468 (Fsubstitute_in_file_name):
3469 * font.c (font_parse_xlfd, font_parse_fcname):
3470 * frame.c (x_set_font_backend):
3471 * gtkutil.c (xg_get_font):
3472 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3473 * nsimage.m (hexchar):
3474 * nsterm.m (ns_xlfd_to_fontname):
3475 * sysdep.c (system_process_attributes):
3476 * xfaces.c (hash_string_case_insensitive):
3477 Use C-locale tests instead of locale-specific tests for character
3478 types, since we want the ASCII interpretation here, not the
3479 interpretation suitable for whatever happens to be the current locale.
3480
3481 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3482
3483 Consistently check windows for validity/liveness
3484 (Bug#11984, Bug#12025, Bug#12026).
3485 * lisp.h (CHECK_VALID_WINDOW): New macro.
3486 * window.c (decode_window): Rename to decode_live_window.
3487 (decode_valid_window, Fwindow_valid_p): New functions.
3488 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3489 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3490 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3491 (Fwindow_prev_sibling, Fwindow_combination_limit)
3492 (Fset_window_combination_limit, Fwindow_use_time)
3493 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3494 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3495 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3496 (Fwindow_hscroll, Fset_window_hscroll)
3497 (Fwindow_redisplay_end_trigger)
3498 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3499 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3500 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3501 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3502 (Fwindow_end, Fset_window_point, Fset_window_start)
3503 (Fpos_visible_in_window_p, Fwindow_line_height)
3504 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3505 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3506 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3507 (Fset_window_parameter, Fwindow_display_table)
3508 (Fset_window_display_table, Fdelete_other_windows_internal)
3509 (Fset_window_buffer, Fset_window_new_total)
3510 (Fset_window_new_normal, Fdelete_window_internal)
3511 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3512 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3513 (Fwindow_scroll_bars): Check whether argument window is a valid or
3514 live window. Update doc-strings.
3515 (syms_of_window): New symbol Qwindow_valid_p.
3516 * keyboard.c (Fposn_at_x_y): Check whether argument
3517 frame_or_window denotes a valid window.
3518
3519 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3520
3521 Fix previous char table change.
3522 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3523 * chartab.c (optimize_sub_char_table): Likewise.
3524
3525 2012-08-16 Chong Yidong <cyd@gnu.org>
3526
3527 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3528
3529 * xfont.c (xfont_open):
3530 * xftfont.c (xftfont_open): Set the font's max_width field.
3531
3532 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3533 min_width to space_width and average_width to the average over
3534 printable ASCII characters.
3535 (ns_char_width): Code cleanup.
3536 (ns_ascii_average_width): New utility function.
3537
3538 * font.h (struct font): Update comments.
3539
3540 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3541
3542 Simple interface to set Lisp_Object fields of character tables.
3543 * lisp.h (CSET): New macro.
3544 (char_table_set_extras, char_table_set_contents)
3545 (sub_char_table_set_contents): New function.
3546 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3547 * syntax.c: Adjust users.
3548
3549 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3550
3551 * eval.c (eval_sub): Bind lexical-binding.
3552 * lread.c (Qlexical_binding): Make non-static.
3553
3554 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3555
3556 * nsmenu.m (popupSession): Remove.
3557 (pop_down_menu): Remove endModalSession.
3558 (timeout_handler:): New method.
3559 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3560 Call runModalForWindow. Check timer_fired when it returns.
3561 If not set, cancel timer and break out of loop.
3562 Otherwise loop again, with a new timeout.
3563
3564 * nsterm.m: Include fcntl.h if present.
3565 (fd_entry, t_readfds, inNsSelect): Remove.
3566 (select_writefds, select_valid, select_timeout, selfds)
3567 (select_mutex, apploopnr): Add.
3568 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3569 Otherwise call kbd_buffer_store_event.
3570 (ns_send_appdefined): Remove release of fd_entry.
3571 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3572 Increment and decrement apploopnr.
3573 (ns_select): If no file descriptors, just do a NSTimer.
3574 Otherwise copy read/write masks and start select thread (fd_handler).
3575 Start main loop and wait for application defined event.
3576 Inform select thread to stop selecting after main loop is exited.
3577 (ns_term_init): Create selfds pipe and set non-blocking.
3578 Initialize select_mutex. Start the select thread (fd_handler).
3579 (fd_handler:): Loop forever, wait for info from the main thread
3580 to either start or stop selecting. When select returns, send
3581 and appdefined event.
3582 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3583 If not call kbd_buffer_store_event.
3584
3585 * nsterm.h (EmacsApp): fd_handler takes id argument.
3586 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3587
3588 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3589
3590 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3591
3592 * region-cache.c (move_cache_gap): Update gap_len using the actual
3593 growth of the boundaries array. Do not change cache_len.
3594 (Bug#12196)
3595
3596 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3597
3598 Generalize and cleanup font subsystem checks.
3599 * font.h (FONT_DEBUG, font_assert): Remove.
3600 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3601 Change font_assert to eassert. Use eassert where appropriate.
3602
3603 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3604
3605 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3606
3607 2012-08-15 Chong Yidong <cyd@gnu.org>
3608
3609 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3610 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3611 extract the font descriptor instead of just the font name.
3612 In that case, return a font spec instead of a string.
3613 (x_last_font_name): Move to this file from xfns.c.
3614
3615 * xfns.c (Fx_select_font): The return value can also be a font
3616 spec. Move x_last_font_name management to gtkutil.c.
3617
3618 * xfaces.c: Make font weight and style symbols non-static.
3619
3620 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3621
3622 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3623 (bug#12117).
3624
3625 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3626
3627 * alloc.c (Fgarbage_collect): Use plural form consistently.
3628
3629 2012-08-14 Eli Zaretskii <eliz@gnu.org>
3630
3631 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3632 iteration through the command loop. Fixes a problem whereby mouse
3633 movements are ignored until the first mouse click.
3634
3635 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3636
3637 Use bool, not int, for Lisp booleans.
3638 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3639 makes Emacs a bit smaller and presumably a bit faster.
3640 * lisp.h: Include <stdbool.h>.
3641 (struct Lisp_Boolfwd, defvar_bool):
3642 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3643 * regex.c [!emacs]: Include <stdbool.h>.
3644 (false, true): Remove; <stdbool.h> does this for us now.
3645
3646 2012-08-14 Chong Yidong <cyd@gnu.org>
3647
3648 * character.c (Fcharacterp): Doc fix (Bug#12076).
3649
3650 * data.c (Findirect_variable): Doc fix (Bug#11040).
3651
3652 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3653
3654 * editfns.c (Fformat): Doc fix (Bug#12059).
3655 (Fsave_current_buffer): Doc fix (Bug#11542).
3656
3657 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3658
3659 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3660 (bug#12022).
3661
3662 2012-08-14 Martin Rudalics <rudalics@gmx.at>
3663
3664 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3665 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3666 * minibuf.c (choose_minibuf_frame, read_minibuf):
3667 * w32fns.c (x_create_tip_frame):
3668 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3669 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3670
3671 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3672
3673 * intervals.c (offset_intervals): Remove obsolete comment.
3674
3675 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3676
3677 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3678
3679 2012-08-14 Gergely Risko <gergely@risko.hu>
3680
3681 * coding.c (decode_coding): Record buffer modification before
3682 disabling undo_list (Bug#11773).
3683
3684 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3685
3686 Revert and cleanup some recent overlay changes.
3687 * buffer.h (enum overlay_type): Remove.
3688 (buffer_get_overlays, buffer_set_overlays): Likewise.
3689 (buffer_set_overlays_before, buffer_set_overlays_after):
3690 New function. Adjust users.
3691 (unchain_both): Add eassert.
3692
3693 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3694
3695 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3696
3697 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3698
3699 * gtkutil.c (xg_mark_data): Don't assume C99.
3700
3701 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3702
3703 * gtkutil.c (xg_frame_tb_info): New struct.
3704 (TB_INFO_KEY): New define.
3705 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3706 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3707 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3708 if not present.
3709 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3710 is up to date. Otherwise store new data.
3711 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3712
3713 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3714
3715 Use KSET for write access to Lisp_Object members of struct kboard.
3716 * keyboard.h (KSET): New macro.
3717 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3718 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3719 * xterm.c: Adjust users.
3720
3721 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3722
3723 Use BSET for write access to Lisp_Object members of struct buffer.
3724 * buffer.h (BSET): New macro.
3725 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3726 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3727 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3728 * window.c, xdisp.c, xfns.c: Adjust users.
3729
3730 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3731
3732 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3733
3734 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3735
3736 * nsterm.m (not_in_argv): New function.
3737 (application:openFile, application:openTempFile:):
3738 (application:openFileWithoutUI:, application:openFiles:): Open file
3739 if not_in_argv returns non-zero (bug#12171).
3740
3741 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3742 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3743 Define for Gtk+ versions less than 3.2.
3744 (xg_get_font_name): Use those functions/macros here.
3745 Reported by Frans Oilinki <moilinki@gmail.com>.
3746
3747 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3748
3749 * unexmacosx.c (copy_data_segment): Copy initialized data in
3750 statically linked libraries from input file rather than memory.
3751
3752 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3753 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3754 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3755
3756 2012-08-10 Glenn Morris <rgm@gnu.org>
3757
3758 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3759 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3760
3761 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3762
3763 Fix last change to allow compilation with low optimization levels.
3764 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3765 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3766
3767 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3768
3769 Use common inline syntax in intervals.h.
3770 * intervals.h (INTERVALS_INLINE): New macro.
3771 Change all users from LISP_INLINE.
3772
3773 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3774
3775 Define Qnone once for all platforms.
3776 * frame.c (Qnone): Define here.
3777 (syms_of_frame): DEFSYM it.
3778 * lisp.h (Qnone): New declaration.
3779 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3780 * xfns.c: Remove duplication. Adjust users.
3781
3782 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3783
3784 Remove unused macros from intervals.h.
3785 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3786 * intervals.c: Adjust comment.
3787
3788 2012-08-10 Eli Zaretskii <eliz@gnu.org>
3789
3790 * w32fns.c <w32_unicode_gui>: New static variable.
3791 (globals_of_w32fns): Initialize it according to os_subtype.
3792 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3793 testing os_subtype.
3794
3795 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
3796 Eli Zaretskii <eliz@gnu.org>
3797
3798 Fix bug #10299 with Unicode characters sent by customized
3799 keyboards created by MSKLC.
3800 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3801 (w32_init_class): Use it to initialize the Emacs class with either
3802 ANSI or Unicode API calls.
3803 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3804 later.
3805 (w32_wnd_proc): If the character code sent by WM_CHAR or
3806 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3807 original message. Call DefWindowProcW on NT and later.
3808
3809 2012-08-10 Glenn Morris <rgm@gnu.org>
3810
3811 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3812
3813 * lisp.h (DIRECTORY_SEP): Let configure set it.
3814
3815 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3816
3817 Use TSET for write access to Lisp_Object slots of struct terminal.
3818 * termhooks.h (TSET): New macro.
3819 * coding.c, terminal.c, xselect.c: Adjust users.
3820
3821 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3822
3823 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3824 the failing expression, include them in the error message.
3825 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3826 * lisp.h (internal_condition_case_n): Update declaration.
3827
3828 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3829
3830 Inline functions to examine and change buffer overlays.
3831 * buffer.c (unchain_both): New function.
3832 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3833 (buffer_has_overlays): New function.
3834 (enum overlay_type): New enum.
3835 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3836 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3837
3838 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3839
3840 Inline functions to examine and change buffer intervals.
3841 * alloc.c (mark_interval_tree): Remove.
3842 (MARK_INTERVAL_TREE): Simplify.
3843 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3844 * intervals.c (buffer_balance_intervals): New function.
3845 (graft_intervals_into_buffer): Adjust indentation.
3846 (set_intervals_multibyte): Simplify.
3847 * buffer.h (BUF_INTERVALS): Remove.
3848 (buffer_get_intervals, buffer_set_intervals): New function.
3849 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3850 * intervals.c, textprop.c: Adjust users.
3851
3852 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3853
3854 Inline functions to examine and change string intervals.
3855 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3856 (string_get_intervals, string_set_intervals): New function.
3857 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3858 * lread.c, print.c, textprop.c: Adjust users.
3859
3860 2012-08-08 Glenn Morris <rgm@gnu.org>
3861
3862 * lisp.mk (lisp): Remove language/persian.elc.
3863
3864 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3865
3866 Cleanup intervals.
3867 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3868 (NULL_INTERVAL_P): Likewise. Adjust users.
3869 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3870 Adjust comment. Move under #if 0.
3871 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3872 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3873
3874 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3875
3876 Check total length of intervals with eassert.
3877 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3878 * intervals.c: Change all users to eassert.
3879
3880 2012-08-07 Eli Zaretskii <eliz@gnu.org>
3881
3882 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3883 Rename fields to match removal of FGET and WGET and disuse of
3884 INTERNAL_FIELD in Lisp_Cons.
3885
3886 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3887
3888 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3889 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3890 name since all xname users are fixed long time ago. Do not
3891 use INTERNAL_FIELD.
3892 (set_symbol_name, set_symbol_function, set_symbol_plist):
3893 (set_symbol_next, set_overlay_plist): New function.
3894 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3895 (struct Lisp_Overlay): Likewise.
3896 (CVAR, MVAR, SVAR): Remove.
3897 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3898 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3899 * xterm.c: Adjust users.
3900 * .gdbinit: Change to use name field of struct Lisp_Symbol
3901 where appropriate.
3902
3903 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3904
3905 Basic functions to set Lisp_Object and pointer slots of intervals.
3906 * intervals.h (interval_set_parent, interval_set_object):
3907 (interval_set_left, interval_set_right, interval_set_plist):
3908 (interval_copy_parent): New function.
3909 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
3910 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3911 Adjust indentation.
3912 (INTERVAL_SIZE): Remove. Adjust users.
3913 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3914
3915 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3916
3917 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3918 * process.h (PGET): Remove.
3919 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3920 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3921
3922 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3923
3924 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3925 * window.h (WGET): Remove.
3926 (struct window): Do not use INTERNAL_FIELD.
3927 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3928 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3929 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3930 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3931 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3932 Adjust users.
3933
3934 2012-08-07 Chong Yidong <cyd@gnu.org>
3935
3936 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3937 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3938 (Fdelete_window_internal): Signal an error if the window is not on
3939 a live frame (Bug#12025).
3940
3941 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3942
3943 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3944 * frame.h (FGET): Remove.
3945 (struct frame): Do not use INTERNAL_FIELD.
3946 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3947 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3948 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3949 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3950
3951 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
3952
3953 * w32.c: Silence compiler warnings.
3954 (map_w32_filename): Remove unused variable `is_fat'.
3955 (chase_symlinks): Add parentheses around expression.
3956
3957 2012-08-06 Glenn Morris <rgm@gnu.org>
3958
3959 * sysdep.c: Respect BROKEN_GETWD.
3960
3961 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3962 Let configure handle it.
3963 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3964
3965 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3966
3967 Use GCALIGNMENT where appropriate.
3968 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3969 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3970 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3971
3972 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3973
3974 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3975 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3976
3977 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3978
3979 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3980 that should be sufficient for everyone.
3981
3982 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3983
3984 * keyboard.c (timer_check_2): Add break so timer_check returns next
3985 timeout.
3986
3987 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3988
3989 Fix Windows build errors introduced after converting to WGET and WSET.
3990 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3991 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3992
3993 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3994
3995 * nsterm.m (ns_frame_rehighlight): Use FSET.
3996
3997 * nsmenu.m (ns_update_menubar): Use FSET.
3998
3999 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4000
4001 Separate read and write access to Lisp_Object slots of Lisp_Process.
4002 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4003 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4004
4005 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4006
4007 Separate read and write access to Lisp_Object slots of struct window.
4008 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4009 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4010 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4011 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4012 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4013 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4014 Adjust users.
4015
4016 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4017
4018 Fix Windows build errors introduced after converting to FGET and FSET.
4019 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4020 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4021 (w32_judge_scroll_bars): Change to use FSET.
4022 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4023
4024 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4025
4026 Fix replacement typo.
4027 * window.c (replace_window): Set root_window instead of
4028 selected_window. This fixes a total window subsystem
4029 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4030
4031 2012-08-06 Glenn Morris <rgm@gnu.org>
4032
4033 * lisp.mk (lisp): Add language/persian.elc.
4034
4035 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4036
4037 Separate read and write access to Lisp_Object slots of struct frame.
4038 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4039 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4040 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4041 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4042 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4043
4044 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4045
4046 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4047
4048 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4049
4050 Generalize common compile-time constants.
4051 * lisp.h (header_size, bool_header_size, word_size): Now here.
4052 (struct Lisp_Vector): Add comment.
4053 (struct Lisp_Bool_Vector): Move up to define handy constants.
4054 (VECSIZE, PSEUDOVECSIZE): Simplify.
4055 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4056 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4057 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4058 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4059 * xfont.c, xmenu.c: Use word_size where appropriate.
4060
4061 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4062
4063 * search.c (Freplace_match): Treat \? in the replacement text
4064 literally (Bug#8161).
4065
4066 2012-08-05 Chong Yidong <cyd@gnu.org>
4067
4068 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4069 * frame.c (Vdelete_frame_functions):
4070 * emacs.c (Vkill_emacs_hook): Doc fix.
4071
4072 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4073
4074 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4075 --with-x-toolkit=no builds.
4076 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4077
4078 2012-08-04 Chong Yidong <cyd@gnu.org>
4079
4080 * syntax.c (Fmodify_syntax_entry): Doc fix.
4081
4082 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4083
4084 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4085 * w32.c (init_environment): Change the default values of many
4086 environment variables in dflt_envvars[] to NULL, to avoid pushing
4087 them into environment when they were not already defined.
4088 Remove the code that deletes site-lisp subdirectories from the default
4089 value of EMACSLOADPATH, as it is no longer needed.
4090 (check_windows_init_file): Now external, not static.
4091 Use Vload_path as is, without adding anything, as this function is now
4092 called when Vload_path is already set up.
4093
4094 * w32.h (check_windows_init_file): Add prototype.
4095
4096 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4097 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4098 compatibility with Posix platforms.
4099 (main): Move the call to check_windows_init_file to here from
4100 w32.c.
4101 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4102 any, in the DEFALT argument into the root of the Emacs build or
4103 installation tree, as appropriate.
4104
4105 * callproc.c (init_callproc_1): Call decode_env_path instead of
4106 doing its equivalent by hand.
4107 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4108 the code that sets Vexec_path run on MS-Windows.
4109
4110 * lread.c (init_lread): Add comments to #ifdef's.
4111
4112 * msdos.c (dos_set_window_size, IT_update_begin)
4113 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4114 instead of direct references.
4115
4116 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4117
4118 Export DEFAULT_REHASH_* to GDB.
4119 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4120 Now constants, not macros.
4121
4122 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4123
4124 Remove unnecessary casts involving pointers.
4125 These casts are no longer needed now that we assume C89 or later,
4126 since they involve casting to or from void *.
4127 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4128 (make_pure_float, make_pure_vector):
4129 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4130 * macros.c (Fstart_kbd_macro):
4131 * menu.c (find_and_return_menu_selection):
4132 * minibuf.c (read_minibuf_noninteractive):
4133 * sysdep.c (closedir):
4134 * xdisp.c (x_produce_glyphs):
4135 * xfaces.c (compare_fonts_by_sort_order):
4136 * xfns.c (x_real_positions, select_visual):
4137 * xselect.c (x_stop_queuing_selection_requests)
4138 (x_get_window_property, x_get_window_property_as_lisp_data):
4139 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4140 Remove unnecessary pointer casts.
4141 * alloc.c (record_xmalloc): New function.
4142 * lisp.h (record_xmalloc): New decl.
4143 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4144 more like a function. This is because the pointer cast is not
4145 needed. All uses changed.
4146 * print.c (print_string, print_error_message): Avoid length recalc.
4147
4148 Improve fix for macroexp crash with debugging (Bug#12118).
4149 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4150 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4151 not supposed to be invoked from the garbage collector.
4152 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4153 (gc_aset): New function, which is like ASET but can be
4154 used in the garbage collector.
4155 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4156 (set_hash_index): Use it instead of ASET.
4157
4158 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4159
4160 Support symlinks on latest versions of MS-Windows.
4161 * w32.c: Include winioctl.h and aclapi.h.
4162 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4163 (revert_to_self): Forward declarations of static functions.
4164 <static BOOL g_b_init_get_security_info>:
4165 <g_b_init_create_symbolic_link>: New static flags.
4166 (globals_of_w32): Initialize them to zero.
4167 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4168 (map_w32_filename): Improve commentary. Simplify switch.
4169 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4170 headers (most versions of MinGW w32api don't).
4171 (get_security_info, create_symbolic_link)
4172 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4173 New functions.
4174 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4175 in the argument file name.
4176 (sys_access): Call unc_volume_file_attributes only if
4177 GetFileAttributes fails with network-related error codes.
4178 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4179 have the required privileges.
4180 (get_file_security_desc_by_name): Rename from
4181 get_file_security_desc.
4182 (stat_worker): New function, with most of the guts of 'stat', and
4183 with addition of handling of symlinks and support for 'lstat'.
4184 If possible, get file's attributes and security information by
4185 handle, not by name. Produce S_IFLNK bit for symlinks, when
4186 called from 'lstat'.
4187 (stat, lstat): New functions, call 'stat_worker'.
4188 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4189 symlinks when the underlying filesystem supports them.
4190
4191 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4192
4193 Fix macroexp crash on Windows with debugging (Bug#12118).
4194 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4195 checking subscripts; problem introduced with the recent
4196 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4197 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4198 since it's used in non-static inline functions now.
4199
4200 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4201 Don't assume buffer size fits in 'int'. Remove unused local.
4202
4203 Use C99-style 'extern inline' if available.
4204 * buffer.h (BUFFER_INLINE):
4205 * category.h (CATEGORY_INLINE):
4206 * character.h (CHARACTER_INLINE):
4207 * charset.h (CHARSET_INLINE):
4208 * composite.h (COMPOSITE_INLINE):
4209 * dispextern.h (DISPEXTERN_INLINE):
4210 * lisp.h (LISP_INLINE):
4211 * systime.h (SYSTIME_INLINE):
4212 New macro, replacing 'static inline' in this header.
4213 * buffer.h, category.h, character.h, charset.h, composite.h:
4214 * dispextern.h, lisp.h, systime.h:
4215 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4216 * alloc.c (LISP_INLINE):
4217 * buffer.c (BUFFER_INLINE):
4218 * category.c (CATEGORY_INLINE):
4219 * character.c (CHARACTER_INLINE):
4220 * charset.c (CHARSET_INLINE):
4221 * composite.c (COMPOSITE_INLINE):
4222 * dispnew.c (DISPEXTERN_INLINE):
4223 * sysdep.c (SYSTIME_INLINE):
4224 Define to EXTERN_INLINE, so that the corresponding functions
4225 are compiled into code.
4226 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4227 (INLINE_HEADER_END): New macros.
4228 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4229 since it's used in non-static inline functions now.
4230 (VALMASK) [!USE_LSB_TAG]: Likewise.
4231
4232 2012-08-02 Glenn Morris <rgm@gnu.org>
4233
4234 * s/: Remove empty directory.
4235
4236 * s/ms-w32.h: Move to ../nt/inc.
4237 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4238 Update for new ms-w32.h location.
4239
4240 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4241
4242 Port to Solaris 8.
4243 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4244
4245 2012-08-02 Glenn Morris <rgm@gnu.org>
4246
4247 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4248 hard-coding the path separator.
4249
4250 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4251
4252 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4253 This how ASET and AREF are supposed to work, and makes
4254 it easier to think about future improvements. See
4255 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4256 * charset.h (set_charset_attr): New function.
4257 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4258 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4259 (aref_addr): New function. All uses of &AREF(...) changed.
4260 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4261 (set_hash_index): New functions. All lvalue-style uses of
4262 HASH_KEY etc. changed.
4263 * keyboard.c (set_prop): New function. All lvalue-style uses
4264 of PROP changed.
4265
4266 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4267
4268 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4269 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4270 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4271 * nsfns.m (ns_set_name_as_filename): Likewise.
4272 * nsmenu.m (ns_update_menubar): Likewise.
4273 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4274
4275 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4276
4277 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4278 Adapt to latest changes in field names of the corresponding Lisp
4279 objects.
4280
4281 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4282
4283 2012-08-01 Glenn Morris <rgm@gnu.org>
4284
4285 * s/msdos.h: Remove file.
4286 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4287 * Makefile.in (S_FILE): Remove.
4288 (config_h): Remove S_FILE.
4289
4290 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4291
4292 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4293 Remove; moved to nt/config.nt.
4294
4295 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4296
4297 Use INTERNAL_FIELD for conses and overlays.
4298 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4299 Remove obsolete comment.
4300 (MVAR): New macro.
4301 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4302 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4303
4304 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4305
4306 Use INTERNAL_FIELD for symbols.
4307 * lisp.h (SVAR): New macro. Adjust users.
4308 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4309 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4310
4311 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4312
4313 Use INTERNAL_FIELD for processes.
4314 * process.h (PVAR): New macro. Adjust style.
4315 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4316 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4317
4318 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4319
4320 Use INTERNAL_FIELD for windows.
4321 * window.h (WVAR): New macro.
4322 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4323 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4324 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4325 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4326 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4327 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4328
4329 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4330
4331 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4332
4333 2012-08-01 Glenn Morris <rgm@gnu.org>
4334
4335 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4336 Move to configure.ac.
4337
4338 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4339
4340 * makefile.w32-in (CONFIG_H): Update dependencies.
4341 (CONF_POST_H): New macro.
4342
4343 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4344
4345 2012-07-31 Glenn Morris <rgm@gnu.org>
4346
4347 * Makefile.in (S_FILE): No longer set by configure.
4348
4349 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4350 is available.
4351 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4352
4353 * process.h (NULL_DEVICE):
4354 * emacs.c (SEPCHAR):
4355 * editfns.c (USER_FULL_NAME): Let configure set them.
4356
4357 * s/README, s/template.h: Remove files.
4358
4359 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4360
4361 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4362 Move to configure.ac.
4363
4364 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4365
4366 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4367 resulting renaming of 'struct frame' members.
4368
4369 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4370
4371 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4372 after introduction of FVAR.
4373
4374 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4375
4376 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4377
4378 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4379 instead of compositeToPoint.
4380 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4381
4382 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4383
4384 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4385
4386 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4387 * lisp.h (INTERNAL_FIELD): New macro.
4388 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4389 (BVAR): Change to use INTERNAL_FIELD.
4390 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4391 (KVAR): Change to use INTERNAL_FIELD.
4392 * frame.h (FVAR): New macro.
4393 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4394 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4395 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4396 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4397 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4398
4399 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4400
4401 Miscellaneous fixes for non-default X toolkits.
4402 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4403 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4404 Move under #ifdef USE_LUCID.
4405 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4406 definition and usage to avoid warnings.
4407
4408 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4409
4410 * nsterm.m (openFiles): Fix previous checkin.
4411
4412 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4413
4414 * indent.c (compute_motion): Remove unused local.
4415
4416 2012-07-31 Glenn Morris <rgm@gnu.org>
4417
4418 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4419
4420 * conf_post.h [USG5_4]:
4421 Move remaining contents of s/usg5-4-common.h here.
4422 * s/usg5-4-common.h: Remove file.
4423
4424 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4425 * s/irix6-5.h: Remove file.
4426
4427 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4428 * s/darwin.h: Remove file.
4429
4430 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4431 * s/hpux10-20.h: Remove file, which is now empty.
4432
4433 2012-07-30 Glenn Morris <rgm@gnu.org>
4434
4435 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4436 * Makefile.in (config_h): Add conf_post.h.
4437 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4438
4439 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4440
4441 * nsterm.m (ns_do_open_file): New variable.
4442 (ns_term_init): Set ns_do_open_file to YES after run returns.
4443 (openFile, openTempFile, openFileWithoutUI, openFiles):
4444 Open files only if ns_do_open_file.
4445
4446 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4447
4448 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4449 This no-op macro hasn't been needed for many years.
4450 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4451
4452 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4453 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4454 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4455 gdb_make_enums_visible.
4456 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4457 (DIRECTORY_SEP): Now a constant, not a macro.
4458
4459 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4460
4461 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4462 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4463
4464 * w32term.c <w32_keyboard_codepage>: Renamed from
4465 keyboard_codepage and now external. All users changed.
4466
4467 * w32term.h: Add declaration of w32_keyboard_codepage.
4468
4469 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4470 the codepage to translate keys to Unicode. If this argument is
4471 -1, use the value returned by GetConsoleCP. All callers changed.
4472
4473 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4474
4475 Update .PHONY listings in makefiles.
4476 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4477 bootstrap-clean, distclean, maintainer-clean, versioclean,
4478 extraclean, frc.
4479
4480 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4481 This is a bit clearer. Fix some commentary typos.
4482
4483 2012-07-30 Glenn Morris <rgm@gnu.org>
4484
4485 * s/netbsd.h: Let configure include signal.h if needed.
4486 Remove file, which is now empty.
4487
4488 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4489 Let configure set them.
4490 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4491 No more need to undefine.
4492
4493 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4494
4495 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4496 non-single-byte char when adding meta modifier. (Bug#12090)
4497
4498 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4499
4500 Convert safe_call to use variable number of arguments.
4501 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4502 (safe_call2): Fix comment.
4503 * lisp.h (safe_call): Adjust prototype.
4504 * coding.c (encode_coding_object): Change to use safe_call2.
4505 * xfaces.c (merge_face_heights): Change to use safe_call1.
4506
4507 2012-07-30 Glenn Morris <rgm@gnu.org>
4508
4509 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4510 does that unconditionally. Remove file, which is now empty.
4511
4512 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4513 Remove empty files.
4514
4515 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4516
4517 Export to GDB most of lisp.h's remaining object-like macros.
4518 * lisp.h (min, max): Move earlier, because they're used earlier now.
4519 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4520 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4521 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4522 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4523 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4524 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4525 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4526 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4527 Now constants, for GDB. They need not be macros.
4528 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4529 Now constants, for GDB, as well as macros, for static initializers.
4530 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4531 Move to after the definition of struct Lisp_Char_Table,
4532 since the former now needs that type defined.
4533 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4534 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4535 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4536 New enums, for gdb_make_enums_visible.
4537 (GLYPH_MODE_LINE_FACE): Remove; unused.
4538 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4539 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4540 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4541 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4542 enum maxargs, enum MAX_ALLOCA.
4543 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4544 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4545 no longer needed, now that they are done in lisp.h.
4546
4547 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4548
4549 Cleanup string bytes checking.
4550 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4551 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4552 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4553 (check_sblock, compact_small_strings): Simplify.
4554
4555 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4556
4557 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4558 These macros are confusing and no longer need to be defined, as
4559 the enum values now suffice. All uses replaced with definiens.
4560 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4561
4562 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4563
4564 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4565 ($(BLD)/w32console.$(O)): Update dependencies.
4566
4567 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4568
4569 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4570 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4571 time. Adjust users.
4572 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4573
4574 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4575
4576 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4577 setting sitelisp (Bug#12010).
4578
4579 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4580
4581 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4582
4583 * w32heap.c (cache_system_info):
4584 * w32.c (sys_rename):
4585 * w32proc.c (find_child_console, sys_kill): All users changed.
4586
4587 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4588
4589 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4590
4591 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4592
4593 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4594
4595 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4596
4597 Cleanup statistics calculation in Fgarbage_collect.
4598 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4599 Fix zombies percentage calculation. Simplify elapsed time calculation.
4600
4601 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4602
4603 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4604 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4605 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4606 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4607 (replace_range, replace_range_2, del_range_2): Change to eassert.
4608 * marker.c (byte_char_debug_check): Adjust style.
4609
4610 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4611
4612 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4613 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4614 long-ago-commented-out code that talks about "WIN32".
4615 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4616 All uses changed.
4617
4618 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4619
4620 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4621 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4622 Simplify by using alignof.
4623 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4624 * lisp.h: Include <stdalign.h>.
4625 (GCALIGNMENT): New macro and constant.
4626 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4627 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4628 (stdalign): New macro, if not already defined.
4629
4630 2012-07-28 Eli Zaretskii <eliz@gnu.org>
4631
4632 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4633 * w32inevt.c: Include w32inevt.h.
4634 (w32_read_console_input): New inline function, calls either
4635 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4636 w32_console_unicode_input.
4637 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4638 (w32_kbd_patch_key, key_event): Use the codepage returned by
4639 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4640 (key_event): use uChar.UnicodeChar only if
4641 w32_console_unicode_input is non-zero.
4642
4643 * w32console.c: Include w32heap.h.
4644 <w32_console_unicode_input>: New global variable.
4645 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4646 family of Windows, zero otherwise.
4647
4648 * w32inevt.h: Declare w32_console_unicode_input.
4649
4650 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4651 --without-x. (Bug#11742)
4652
4653 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4654
4655 Adjust GDB to reflect pvec_type changes (Bug#12036).
4656 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4657 2012-07-04 changes to pseudovector representation.
4658 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4659
4660 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
4661
4662 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4663 bus address.
4664 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4665
4666 2012-07-27 Eli Zaretskii <eliz@gnu.org>
4667
4668 * alloc.c (listn): Fix the order the arguments are consed onto the
4669 list.
4670
4671 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4672 enumeration constants, as PURE and HEAP are too general, and clash
4673 with other headers and sources, such as gmalloc.c and the
4674 MS-Windows system headers. All users changed.
4675
4676 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4677
4678 Revert last save_excursion_save and save_excursion_restore changes.
4679 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4680 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4681
4682 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4683
4684 Fix recently-introduced typos in Windows port.
4685 Reported by Martin Rudalics <rudalics@gmx.at>.
4686 * w32.c (init_environment): Replace comma with semicolon.
4687 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4688
4689 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4690
4691 Improve GDB symbol export (Bug#12036).
4692 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4693 arms of an 'if', not using conditional expressions; otherwise GDB
4694 complains about the types in the unevaluated arm when the argument
4695 is an integer literal.
4696 (xgetint): Simplify expression.
4697 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4698 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4699 Zaretskii in <http://bugs.gnu.org/12036#13>.
4700 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4701 needed now that we have gdb_make_enums_visible.
4702 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4703 (enum enum_USE_LSB_TAG):
4704 New enum types, packaging up enums that need to be exported to GDB.
4705
4706 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4707
4708 Utility function to make a list from specified amount of objects.
4709 * lisp.h (enum constype): New datatype.
4710 (listn): New prototype.
4711 * alloc.c (listn): New function.
4712 (Fmemory_use_count, syms_of_alloc): Use it.
4713 * buffer.c (syms_of_buffer): Likewise.
4714 * callint.c (syms_of_callint): Likewise.
4715 * charset.c (define_charset_internal): Likewise.
4716 * coding.c (syms_of_coding): Likewise.
4717 * keymap.c (syms_of_keymap): Likewise.
4718 * search.c (syms_of_search): Likewise.
4719 * syntax.c (syms_of_syntax): Likewise.
4720 * w32.c (init_environment): Likewise.
4721 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4722 * xdisp.c (syms_of_xdisp): Likewise.
4723 * xfns.c (syms_of_xfns): Likewise.
4724
4725 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4726
4727 Fast save_excursion_save and save_excursion_restore.
4728 * lisp.h (struct Lisp_Excursion): New data type.
4729 (PVEC_EXCURSION): New pseudovector type.
4730 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4731 to deal with it. Adjust comments.
4732 (init_marker, attach_marker): New prototype.
4733 (unchain_marker): Adjust prototype.
4734 * marker.c (attach_marker): Change to global.
4735 (init_marker): New function.
4736 * alloc.c (Fmake_marker, build_marker): Use it.
4737 (build_marker): More easserts.
4738 (mark_object): Handle struct Lisp_Excursion.
4739 * editfns.c (save_excursion_save, save_excursion_restore):
4740 Reimplement to use struct Lisp_Excursion. Add comments.
4741
4742 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4743
4744 Fix export of symbols to GDB (Bug#12036).
4745 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4746 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4747 emacs.c, as this is a more-suitable home. Had this been done earlier
4748 the fix for 12036 would have avoided some of the problems noted in
4749 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4750 would have been more obvious.
4751 * emacs.c: Do not include <verify.h>; no longer needed.
4752 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4753 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4754 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4755 Remove; now done in lisp.h.
4756 * lisp.h (PUBLISH_TO_GDB): New macro.
4757 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4758 (DATA_SEG_BITS): Use it.
4759 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4760 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4761 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4762 not be usable in #if. This simplifies things.
4763
4764 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
4765
4766 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4767
4768 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4769
4770 Simplify export of symbols to GDB (Bug#12036).
4771 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4772 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4773 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4774 Adjust to changes in lisp.h and emacs.c, by using
4775 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4776 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4777 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4778 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4779 instead of gdb_valbits.
4780 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4781 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4782 instead of gdb_array_mark_flag.
4783 (xboolvector): Get size from $->size, not $->header.size.
4784 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4785 (xreload, hook-run, hookpost-run): Remove.
4786 * emacs.c: Include <verify.h>.
4787 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4788 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4789 Remove.
4790 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4791 (gdb_USE_LSB_TAG): New enum constants.
4792 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4793 Also define these as enum constants, so they're visible to GDB.
4794 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4795 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4796 as constants, so they're visible to GDB.
4797 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4798 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4799 Now enum constants, not macros, so they're visible to GDB.
4800 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4801 more convenient now. All uses changed.
4802 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4803 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4804
4805 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4806
4807 Explicitly free restriction data that are not needed anymore.
4808 * editfns.c (save_restriction_restore): Free restriction data.
4809
4810 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4811
4812 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4813 add argument, tune behavior, and adjust all callers.
4814
4815 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4816
4817 Use typedef for EMACS_INT, EMACS_UINT.
4818 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4819 than macros. This simplifies debugging in the usual case, since
4820 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4821 and it allows expressions involving EMACS_INT casts.
4822 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4823
4824 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4825
4826 * nsterm.m (ns_read_socket): Return early if there is a modal
4827 window (Bug#12043).
4828
4829 2012-07-25 Martin Rudalics <rudalics@gmx.at>
4830
4831 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4832 that FOCUS-FRAME can be omitted.
4833
4834 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4835
4836 Adjust buffer text indirection counters at the end of Fkill_buffer.
4837 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4838 buffer is definitely dead. This should really fix an issue reported
4839 by Christoph Scholtes again. (Bug#12007).
4840 (init_buffer_once): Initialize indirection counters of
4841 buffer_defaults and buffer_local_symbols (for sanity and safety).
4842
4843 2012-07-24 Eli Zaretskii <eliz@gnu.org>
4844
4845 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4846 and continuation glyphs on tooltip frames, leave them at zero.
4847 Avoids continued lines in tooltips. (Bug#11832)
4848
4849 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4850
4851 Simplify copy_overlay.
4852 * buffer.c (copy_overlay): Simplify. Use build_marker.
4853 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4854
4855 2012-07-23 Eli Zaretskii <eliz@gnu.org>
4856
4857 * print.c (print_object): Don't crash when a frame's name is nil
4858 or invalid. (Bug#12025)
4859
4860 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4861 it signals an error when a tooltip frame is being created.
4862
4863 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4864
4865 Cleanup miscellaneous objects allocation and initialization.
4866 * alloc.c (allocate_misc): Change to static. Add argument to
4867 specify the subtype. Adjust comment and users.
4868 (build_overlay): New function.
4869 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4870 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4871 (allocate_misc): Remove prototype.
4872 (build_overlay): Add prototype.
4873
4874 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4875
4876 Swap buffer text indirection counters in Fbuffer_swap_text.
4877 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4878 This avoids crash reported by Christoph Scholtes at
4879 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4880
4881 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4882
4883 * nsmenu.m (Popdown_data): New struct.
4884 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4885 free Popdown_data.
4886 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4887 (initWithContentRect): Make imgView and contentView non-static
4888 and autorelease them. Also autorelease img and matrix (Bug#12005).
4889 (dealloc): Remove (Bug#12005).
4890
4891 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4892
4893 Adjust consing_since_gc when objects are explicitly freed.
4894 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4895 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4896 (free_cons, free_misc): Subtract object size from consing_since_gc.
4897
4898 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4899
4900 Simplify and cleanup markers positioning code.
4901 * marker.c (attach_marker): More useful eassert.
4902 (live_buffer, set_marker_internal): New function.
4903 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4904 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4905
4906 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4907
4908 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4909 as it's limited by the amount of memory, not by INT_MAX.
4910
4911 2012-07-21 Eli Zaretskii <eliz@gnu.org>
4912
4913 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4914 in special-event-map. See the discussion at
4915 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4916 for the reasons.
4917
4918 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4919 info.dwItemData. Fixes crashes on 64-bit Windows.
4920 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4921
4922 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4923
4924 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4925 (conversationIdentifier): Return value is NSInteger.
4926 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4927
4928 2012-07-21 Chong Yidong <cyd@gnu.org>
4929
4930 * window.c (decode_any_window): Signal an error if the window is
4931 on a dead frame (Bug#11984).
4932
4933 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4934
4935 Add indirection counting to speed up Fkill_buffer.
4936 * buffer.h (struct buffer): New member.
4937 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4938 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4939 base buffer indirection counter.
4940 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4941 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4942 through buffer list if indirection counter is 0.
4943
4944 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4945
4946 Extend the value returned by Fgarbage_collect with heap statistics.
4947 * alloc.c (Qheap): New symbol.
4948 (syms_of_alloc): DEFSYM it.
4949 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4950 (Fmemory_free): Remove.
4951 (syms_of_alloc): Don't defsubr it.
4952 * buffer.c (Fcompact_buffer): Remove.
4953 (syms_of_buffer): Don't defsubr it.
4954
4955 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4956
4957 Make maybe_gc inline.
4958 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4959 * lisp.h (consing_since_gc, gc_relative_threshold)
4960 (memory_full_cons_threshold): Revert declaration.
4961 (maybe_gc): Remove prototype, define as inline.
4962 * alloc.c: Remove old commented-out code.
4963 (consing_since_gc, gc_relative_threshold)
4964 (memory_full_cons_threshold): Revert to global.
4965 (maybe_gc): Remove.
4966
4967 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4968
4969 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4970 * lisp.h (build_unibyte_string): New function.
4971 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4972 * sysdep.c, w32fns.c, xfns.c: Use it.
4973 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4974 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4975 Adjust users accordingly.
4976 * font.h (font_open_by_name): Adjust prototype.
4977
4978 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4979
4980 Cleanup calls to Fgarbage_collect.
4981 * lisp.h (maybe_gc): New prototype.
4982 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4983 Remove declarations.
4984 * alloc.c (maybe_gc): New function.
4985 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4986 Make them static.
4987 * bytecode.c (MAYBE_GC): Use maybe_gc.
4988 * eval.c (eval_sub, Ffuncall): Likewise.
4989 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4990 to avoid dependency from auto-save feature.
4991
4992 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4993
4994 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4995 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4996 'for_each_per_buffer_object_at'.
4997 All uses changed. It's better to use upper-case for macros that
4998 cannot be implemented as functions, to give the reader a clue
4999 that they're special.
5000
5001 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5002
5003 * alloc.c (Fgarbage_collect): Tweak docstring.
5004
5005 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5006
5007 Tweak the value returned from Fgarbage_collect again.
5008 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5009 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5010 Adjust documentation.
5011 (total_vector_bytes): Rename to total_vector_slots, adjust
5012 accounting.
5013 (total_free_vector_bytes): Rename to total_free_vector_slots,
5014 adjust accounting.
5015 (Qstring_bytes, Qvector_slots): New symbols.
5016 (syms_of_alloc): DEFSYM them.
5017
5018 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5019
5020 Buffer compaction primitive which may be used from Lisp.
5021 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5022 (syms_of_buffer): Register Fcompact_buffer.
5023 * alloc.c (Fgarbage_collect): Use compact_buffer.
5024 * buffer.h (compact_buffer): New prototype.
5025 (struct buffer_text): New member.
5026
5027 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5028
5029 New macro to iterate over all buffers, miscellaneous cleanups.
5030 * lisp.h (all_buffers): Remove declaration.
5031 * buffer.h (all_buffers): Add declaration, with comment.
5032 (for_each_buffer): New macro.
5033 * alloc.c (Fgarbage_collect, mark_object): Use it.
5034 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5035 (init_buffer): Likewise.
5036 * data.c (Fset_default): Likewise.
5037 * coding.c (code_conversion_restore): Remove redundant check
5038 for dead buffer.
5039 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5040
5041 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5042
5043 Fix bug that created negative-length intervals.
5044 * intervals.c (merge_interval_right, merge_interval_left):
5045 Do not zero out this interval if it is absorbed by its children,
5046 as this interval's total length doesn't change in that case. See
5047 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5048
5049 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5050
5051 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5052 when invoking (make-bool-vector N t) and N is a positive
5053 multiple of 8 -- the last 8 bits were mistakenly cleared.
5054
5055 Remove some struct layout assumptions in bool vectors.
5056 * alloc.c (bool_header_size): New constant.
5057 (header_size, word_size): Move earlier, as they're now used earlier.
5058 Use 'word_size' in a few more places, where it's appropriate.
5059 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5060 padding before the data member of a bool vector.
5061 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5062 than doing the check by hand with an abort ().
5063
5064 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5065
5066 * eval.c (Fdefvar): Don't check constants since we only set the var if
5067 it's not yet defined anyway (bug#11904).
5068
5069 * lisp.h (last_undo_boundary): Declare new var.
5070 * keyboard.c (command_loop_1): Set it.
5071 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5072 were auto-added by the command loop (bug#11774).
5073
5074 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5075
5076 * w32font.c (Qsymbol): Remove local definition.
5077 (syms_of_w32font): Don't DEFSYM it.
5078
5079 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5080
5081 Fix sweep_vectors to handle large bool vectors correctly.
5082 * alloc.c (sweep_vectors): Account total_vector_bytes for
5083 bool vectors larger than VBLOCK_BYTES_MAX.
5084
5085 2012-07-18 Chong Yidong <cyd@gnu.org>
5086
5087 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5088 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5089
5090 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5091
5092 Return more descriptive data from Fgarbage_collect.
5093 Suggested by Stefan Monnier in
5094 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5095 * alloc.c (bounded_number): New function.
5096 (total_buffers, total_vectors): New variable.
5097 (total_string_size): Rename to total_string_bytes, adjust users.
5098 (total_vector_size): Rename to total_vector_bytes, adjust users.
5099 (sweep_vectors): Account total_vectors and total_vector_bytes.
5100 (Fgarbage_collect): New return value. Adjust documentation.
5101 (gc_sweep): Account total_buffers.
5102 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5103 (VECTOR_SIZE): Remove.
5104 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5105 (Qinterval, Qmisc): New symbols.
5106 (syms_of_data): Initialize them.
5107 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5108 (Qcons, Qbuffer): New declarations.
5109
5110 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5111
5112 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5113 Round up, not down. Improve doc.
5114
5115 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5116
5117 Restore old code in allocate_string_data to avoid Faset breakage.
5118 Reported by Julien Danjou <julien@danjou.info> in
5119 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5120 * alloc.c (allocate_string_data): Restore old code with minor
5121 adjustments, fix comment to explain this subtle issue.
5122
5123 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5124
5125 Remove FILE_SYSTEM_CASE.
5126 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5127
5128 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5129 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5130 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5131 call-process-region passes it through expand-file-name.
5132
5133 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5134
5135 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5136
5137 Fix crash when creating indirect buffer (Bug#11917)
5138 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5139 Don't handle unbound variables specially if non-zero.
5140 (Fbuffer_local_variables): Pass zero.
5141 (clone_per_buffer_values): Pass non-zero.
5142
5143 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5144
5145 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5146 to make the loop interruptible.
5147
5148 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5149
5150 * gnutls.c (emacs_gnutls_handshake): Only retry if
5151 GNUTLS_E_INTERRUPTED.
5152
5153 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5154
5155 Cleanup and convert miscellaneous checks to eassert.
5156 * alloc.c (mark_interval): Fix comment, partially rephrase
5157 old comment from intervals.h (see below).
5158 * intervals.c (find_interval, adjust_intervals_for_insertion)
5159 (delete_interval, adjust_intervals_for_deletion)
5160 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5161 Convert to eassert.
5162 (adjust_intervals_for_insertion, make_new_interval):
5163 Remove obsolete and unused code.
5164 * intervals.h (struct interval): Remove obsolete comment.
5165 * textprotp.c (erase_properties): Remove unused code.
5166 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5167 (Fremove_list_of_text_properties): Convert to eassert.
5168
5169 2012-07-17 Chong Yidong <cyd@gnu.org>
5170
5171 * editfns.c (Finsert_char): Doc fix.
5172
5173 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5174
5175 Fix previous change to make Fmemory_free always accurate.
5176 * alloc.c (make_interval): Update total_free_intervals.
5177 (make_float): Likewise for total_free_floats.
5178 (free_cons, Fcons): Likewise for total_free_conses.
5179 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5180 Likewise for total_free_vector_bytes.
5181 (Fmake_symbol): Likewise for total_free_symbols.
5182 (bytes_free): Remove.
5183
5184 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5185
5186 Simple free memory accounting feature.
5187 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5188 (sweep_vectors): Accumulate size of free vectors.
5189 (Fgarbage_collect): Setup bytes_free.
5190 (Fmemory_free): New function.
5191 (syms_of_alloc): Register it.
5192
5193 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5194
5195 Cleanup overlays checking.
5196 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5197 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5198 eassert and OVERLAYP.
5199 (sort_overlays): Change to use OVERLAYP.
5200
5201 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5202
5203 * editfns.c (Finsert_char): Make it interactive, and make the
5204 second arg optional. Copy interactive spec and docstring from
5205 ucs-insert.
5206
5207 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5208
5209 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5210 Unlike the other wrapped functions, fabs has an unspecified
5211 effect on errno.
5212
5213 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5214
5215 * nsterm.m (keyDown): Interpret flags without left/right bits
5216 as the left key (Bug#11670).
5217
5218 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5219
5220 Remove empty and useless init functions.
5221 * lisp.h (init_character_once, init_fns, init_image)
5222 (init_filelock, init_sound): Remove prototype.
5223 * character.c (init_character_once): Remove.
5224 * filelock.c (init_filelock): Likewise.
5225 * fns.c (init_fns): Likewise.
5226 * image.c (init_image): Likewise.
5227 * sound.c (init_sound): Likewise.
5228 * emacs.c (main): Adjust accordingly.
5229
5230 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5231
5232 * gtkutil.h: Tiny cleanups.
5233 (use_old_gtk_file_dialog): Remove useless declaration.
5234 (xg_uses_old_file_dialog): Add suggested const attribute.
5235
5236 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5237
5238 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5239 (bidi_paragraph_init): Use it to limit search forward for a strong
5240 directional character in abnormally large paragraphs full of
5241 neutral or weak characters. (Bug#11943)
5242
5243 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5244
5245 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5246 the toolbar (Bug#9451).
5247 (xg_make_tool_item): Give the widget event box a transparent
5248 background.
5249
5250 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5251
5252 Cleanup basic allocation variables and functions.
5253 * alloc.c (ignore_warnings, init_intervals, init_float)
5254 (init_cons, init_symbol, init_marker): Remove.
5255 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5256 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5257 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5258 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5259 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5260 (staticidx, init_alloc_once, init_strings, free_ablock):
5261 Remove redundant initialization.
5262 * fns.c (init_weak_hash_tables): Remove.
5263 * lisp.h (init_weak_hash_tables): Remove prototype.
5264
5265 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5266
5267 Use zero_vector where appropriate.
5268 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5269 accordingly.
5270 * lisp.h (zero_vector): New declaration.
5271 * font.c (null_vector): Remove.
5272 (syms_of_font): Remove initialization and staticpro.
5273 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5274 * keymap.c (Faccessible_keymaps): Likewise.
5275
5276 2012-07-15 Leo Liu <sdl.web@gmail.com>
5277
5278 * fringe.c: Fix typo in comments.
5279
5280 2012-07-14 Leo Liu <sdl.web@gmail.com>
5281
5282 * fringe.c: Add a new bitmap exclamation-mark.
5283
5284 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5285
5286 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5287
5288 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5289 (HAVE_MENUS): Don't define, defined by editing config.in with
5290 msdos/sed2v2.inp.
5291 (GMALLOC_INHIBIT_VALLOC): Don't define.
5292 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5293
5294 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5295
5296 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5297
5298 2012-07-14 Glenn Morris <rgm@gnu.org>
5299
5300 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5301 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5302 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5303
5304 2012-07-13 Glenn Morris <rgm@gnu.org>
5305
5306 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5307
5308 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5309 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5310
5311 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5312
5313 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5314 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5315 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5316 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5317 where appropriate.
5318 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5319 as boolean expression.
5320 (x_set_window_size): Remove unused variable toolbar.
5321 (ns_get_color_default, ns_mod_to_lisp): Remove.
5322 (ns_mouse_position): Remove unused variables xchar and ychar.
5323 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5324 (ns_set_vertical_scroll_bar): Remove unused variable count.
5325 (ns_delete_terminal): Remove unused variable i.
5326 (ns_term_init): Remove unused variables r, g and b.
5327 (mouseDown): Remove unused variable window.
5328 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5329 (initFrameFromEmacs): Remove unused variable vbextra.
5330 (mouseEntered): Remove unused variables p and dpyinfo.
5331 (mouseExited): Remove unused variables p and r.
5332 (ns_define_frame_cursor, ns_clear_frame_area)
5333 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5334 (menuDown): Assign [sender tag] to variable and cast the variable.
5335
5336 * nsterm.h (menuDown): Add id as type to argument sender.
5337 (ns_display_info_for_name): Add Lisp_Object argument.
5338 (ns_term_init): Add Lisp_Object argument.
5339 (ns_map_event_to_object): Add void argument.
5340 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5341 prototype with arguments and only declare if __OBJC__.
5342 (nxatoms_of_nsselect): Add void argument.
5343 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5344 (ns_alloc_autorelease_pool): Add void argument.
5345 (ns_release_autorelease_pool): Add void* argument.
5346 (ns_get_defaults_value): Add const char* argument.
5347
5348 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5349 (initFromContents): Use SSDATA where appropriate.
5350 (ns_update_menubar): Add braces to ambigous if-else.
5351 (initWithTitle): Put () around assignment in if statement.
5352 (ns_menu_show): Remove unused variables window and keymap.
5353 (update_frame_tool_bar): Remove unused variable selected_p.
5354 (initWithContentRect): Remove unused variable this_cmd_name.
5355
5356 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5357 appropriate.
5358 (setXBMColor): Remove unused variable len.
5359 (setPixmapData): Put () around assignment in loop statement.
5360
5361 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5362 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5363 where appropriate.
5364 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5365 around assignment in loop statement.
5366 (nsfont_open): Remove unused variable i.
5367 (nsfont_open): Remove unused variable len.
5368 (nsfont_draw): Remove unused variable cs.
5369
5370 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5371 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5372 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5373 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5374 (Fns_font_name, Fns_perform_service)
5375 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5376 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5377 (ns_set_name): Remove unused variable view.
5378 (x_set_menu_bar_lines): Remove unused variable olines.
5379 (x_set_tool_bar_lines): Remove unused variable root_window.
5380 (Fns_list_colors): Put () around assignment in while statement.
5381 (Fns_perform_service): Remove unused variable len.
5382 (Fns_display_usable_bounds): Remove unused variable top.
5383 (syms_of_nsfns): Remove unused variable i.
5384
5385 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5386 memcpy (Bug#11907).
5387
5388 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5389
5390 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5391 and free it with DestroyExceptionInfo (Bug#11558).
5392
5393 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5394
5395 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5396 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5397 Set here, not in nt/config.nt.
5398
5399 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5400
5401 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5402 cursor overflow into the last glyph on display line when the right
5403 fringe is off. (Bug#11832)
5404
5405 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5406
5407 * xdisp.c (produce_special_glyphs): Now static.
5408 * dispextern.h (produce_special_glyphs): Remove decl.
5409
5410 2012-07-13 Glenn Morris <rgm@gnu.org>
5411
5412 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5413 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5414
5415 * s/usg5-4-common.h (USG, USG5):
5416 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5417 * s/sol2-6.h (SOLARIS2):
5418 * s/irix6-5.h (IRIX6_5):
5419 * s/hpux10-20.h (USG, USG5, HPUX):
5420 * s/gnu-linux.h (USG, GNU_LINUX):
5421 * s/freebsd.h (BSD_SYSTEM):
5422 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5423 * s/cygwin.h (CYGWIN):
5424 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5425 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5426
5427 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5428
5429 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5430
5431 2012-07-13 Glenn Morris <rgm@gnu.org>
5432
5433 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5434
5435 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5436
5437 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5438 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5439
5440 2012-07-12 Glenn Morris <rgm@gnu.org>
5441
5442 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5443
5444 * process.c (init_process_emacs): Rename from init_process.
5445 The old name is also the name of a Mach system call.
5446 * lisp.h, emacs.c: Update for this name change.
5447 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5448 longer needed.
5449
5450 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5451
5452 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5453 memmove call that removes glyphs covered by the left truncation
5454 glyph. Improve commentary.
5455 (display_line): Fix display of continuation glyphs on GUI frames
5456 when the right fringe is turned off and variable-size fonts are
5457 used in the window. Move the code that appends a stretch glyph to
5458 produce_special_glyphs, so that it could be used for truncation
5459 and continuation glyphs alike.
5460 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5461 glyph of a suitably computed width, to align the special glyphs at
5462 the window margin. Code moved from display_line. (Bug#11832)
5463
5464 2012-07-12 Glenn Morris <rgm@gnu.org>
5465
5466 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5467
5468 * s/gnu-linux.h, s/hpux10-20.h:
5469 Do not unconditionally define HAVE_XRMSETDATABASE.
5470
5471 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5472
5473 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5474
5475 Fix typos that broke OS X build.
5476 Reported by Randal L. Schwartz in
5477 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5478 * nsterm.m (ns_timeout): Add missing local decl.
5479 (ns_get_color): snprintf -> sprintf, to fix typo.
5480
5481 2012-07-12 Glenn Morris <rgm@gnu.org>
5482
5483 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5484 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5485 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5486 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5487
5488 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5489 Move PTY_OPEN to configure.
5490
5491 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5492 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5493 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5494
5495 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5496
5497 Use empty_unibyte_string where applicable.
5498 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5499 * lread.c (read1): Likewise.
5500 * xsettings.c (syms_of_xsettings): Likewise.
5501
5502 2012-07-12 Glenn Morris <rgm@gnu.org>
5503
5504 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5505 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5506 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5507 * s/hpux10-20.h (RUN_TIME_REMAP):
5508 * s/bsd-common.h (TABDLY): Move to configure.
5509
5510 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5511
5512 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5513
5514 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5515 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5516
5517 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5518
5519 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5520 * s/template.h: Move NARROWPROTO to configure.
5521
5522 2012-07-11 Glenn Morris <rgm@gnu.org>
5523
5524 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5525 unused since 2011-01-17 change to systty.h.
5526
5527 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5528 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5529 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5530
5531 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5532
5533 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5534
5535 2012-07-11 Glenn Morris <rgm@gnu.org>
5536
5537 * s/darwin.h, s/gnu-linux.h, s/template.h:
5538 Move INTERRUPT_INPUT to configure.
5539
5540 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5541
5542 Minor adjustments to interning code.
5543 * lisp.h (intern, intern_c_string): Redefine as static inline
5544 wrappers for intern_1 and intern_c_string_1, respectively.
5545 (intern_1, intern_c_string_1): Rename prototypes.
5546 * lread.c (intern_1, intern_c_string_1, oblookup):
5547 Simplify Vobarray checking.
5548 * font.c (font_intern_prop): Likewise. Adjust comment.
5549 * w32font.c (intern_font_name): Likewise.
5550
5551 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5552
5553 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5554
5555 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5556 of Fcar/Fcdr if possible.
5557 * font.c (check_otf_features): Likewise.
5558 * fontset.c (Fnew_fontset): Likewise.
5559 * gnutls.c (Fgnutls_boot): Likewise.
5560 * minibuf.c (read_minibuf): Likewise.
5561 * msdos.c (IT_set_frame_parameters): Likewise.
5562 * xmenu.c (Fx_popup_dialog): Likewise.
5563 * w32menu.c (Fx_popup_dialog): Likewise.
5564
5565 2012-07-11 Glenn Morris <rgm@gnu.org>
5566
5567 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5568 since nothing has defined it on these platforms.
5569
5570 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5571 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5572
5573 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5574 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5575 Move CLASH_DETECTION to configure.
5576
5577 * s/gnu.h: Remove file, which is now empty.
5578
5579 * s/gnu.h, s/gnu-linux.h:
5580 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5581
5582 2012-07-11 John Wiegley <johnw@newartisans.com>
5583
5584 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5585 function attribute, so we only use it if it exists in the
5586 compiler.
5587
5588 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5589
5590 Avoid call to strlen in fast_c_string_match_ignore_case.
5591 * search.c (fast_c_string_match_ignore_case): Change to use
5592 length argument. Adjust users accordingly.
5593 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5594
5595 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5596
5597 Assume mkdir, rmdir.
5598 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5599 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5600
5601 Assume rename.
5602 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5603
5604 Assume perror.
5605 * s/hpux10-20.h (HAVE_PERROR): Remove.
5606 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5607 Remove dummy definition, as this problem was obsolete long ago.
5608
5609 Assume strerror.
5610 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5611
5612 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5613
5614 Avoid calls to strlen in font processing functions.
5615 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5616 (font_open_by_name): Change to use length argument.
5617 Adjust users accordingly.
5618 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5619 Adjust prototypes.
5620 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5621 Change to return ptrdiff_t.
5622 (xfont_list_pattern, xfont_match): Use length returned by
5623 xfont_decode_coding_xlfd.
5624 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5625
5626 2012-07-11 Glenn Morris <rgm@gnu.org>
5627
5628 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5629 Move DONT_REOPEN_PTY to configure.
5630
5631 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5632 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5633
5634 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5635
5636 Remove "#define unix" that is no longer needed (Bug#11905).
5637 * s/aix4-2.h (unix): Remove; no longer needed.
5638
5639 EMACS_TIME simplification (Bug#11875).
5640 This replaces macros (which typically do not work in GDB)
5641 with functions, typedefs and enums, making the code easier to debug.
5642 The functional style also makes code easier to read and maintain.
5643 * systime.h: Include <sys/time.h> on all hosts, not just if
5644 WINDOWSNT, since 'struct timeval' is needed in general.
5645 (EMACS_TIME): Now a typedef, not a macro.
5646 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5647 not macros.
5648 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5649 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5650 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5651 (EMACS_TIME_LE): Now functions, not macros.
5652 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5653 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5654 which are not functions. All uses rewritten to use:
5655 (make_emacs_time): New function.
5656 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5657 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5658 not functions. All uses rewritten to use the following, respectively:
5659 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5660 (add_emacs_time, sub_emacs_time): New functions.
5661 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5662 * fileio.c (Fcopy_file):
5663 * xterm.c (XTflash): Get the current time closer to when it's used.
5664 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5665
5666 * bytecode.c (targets): Suppress -Woverride-init warnings.
5667
5668 Simplify by avoiding confusing use of strncpy etc.
5669 * doc.c (Fsnarf_documentation):
5670 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5671 * frame.c (Fmake_terminal_frame):
5672 * gtkutil.c (get_utf8_string):
5673 * lread.c (openp):
5674 * nsmenu.m (ns_update_menubar):
5675 * regex.c (regerror):
5676 Prefer memcpy to strncpy and strncat when either will do.
5677 * fileio.c (Fsubstitute_in_file_name):
5678 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5679 (menu_separator_name_p):
5680 * nsmenu.m (ns_update_menubar):
5681 Prefer memcmp to strncmp when either will do.
5682 * nsterm.m: Include <ftoastr.h>.
5683 (ns_get_color):
5684 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5685 Prefer snprintf to strncpy.
5686 * nsterm.m (ns_term_init):
5687 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5688 * nsterm.m (ns_term_init):
5689 Avoid the need for strncpy, by using build_string or
5690 make_unibyte_string directly. Use dtoastr, not snprintf.
5691 * process.c (Fmake_network_process): Diagnose service names that
5692 are too long, rather than silently truncating them or creating
5693 non-null-terminated names.
5694 (Fnetwork_interface_info): Likewise, for interface names.
5695 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5696 Prefer sprintf to strncat.
5697 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5698 Prefer vsnprintf to vsprintf + strncpy.
5699
5700 2012-07-10 Glenn Morris <rgm@gnu.org>
5701
5702 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5703 Clarify fallback case.
5704
5705 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5706
5707 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5708 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5709 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5710 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5711 where argument type is known to be a Lisp_Cons.
5712
5713 2012-07-10 Tom Tromey <tromey@redhat.com>
5714
5715 * bytecode.c (BYTE_CODE_THREADED): New macro.
5716 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5717 (enum byte_code_op): New type.
5718 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5719 (exec_byte_code): Use them. Use token threading when applicable.
5720
5721 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5722
5723 Optimize pure C strings initialization.
5724 * lisp.h (make_pure_string): Fix prototype.
5725 (build_pure_c_string): New function, defined as static inline. This
5726 provides a better opportunity to optimize away calls to strlen when
5727 the function is called with compile-time constant argument.
5728 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5729 argument, adjust users accordingly. Use build_pure_c_string where
5730 appropriate.
5731 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5732 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5733 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5734
5735 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5736
5737 Avoid calls to strlen in miscellaneous functions.
5738 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5739 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5740 * lread.c (openp): Likewise.
5741
5742 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5743
5744 Avoid calls to strlen in path processing functions.
5745 * fileio.c (file_name_as_directory): Add comment. Change to add
5746 srclen argument and return the length of result. Adjust users
5747 accordingly.
5748 (directory_file_name): Fix comment. Change to add srclen argument,
5749 swap 1st and 2nd arguments to obey the common convention.
5750 Adjust users accordingly.
5751 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5752
5753 2012-07-10 Glenn Morris <rgm@gnu.org>
5754
5755 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5756 Move PENDING_OUTPUT_COUNT definition to configure.
5757
5758 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5759 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5760 * s/gnu.h (DATA_START): Move definitions to configure.
5761
5762 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5763 We include usg5-4-common.h, which defines them both.
5764
5765 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5766 O_RDONLY already includes it).
5767
5768 Stop ns builds setting the EMACSLOADPATH environment variable.
5769 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5770 Now it does not set EMACSLOADPATH, just returns the load-path string.
5771 * nsterm.h: Update accordingly.
5772 * lread.c [HAVE_NS]: Include nsterm.h.
5773 (init_lread) [HAVE_NS]: Use ns_load_path.
5774 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5775
5776 2012-07-09 Glenn Morris <rgm@gnu.org>
5777
5778 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5779 since the included bsd-common.h does so.
5780
5781 Stop ns builds setting the EMACSPATH environment variable.
5782 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5783 (ns_init_paths): Do not set EMACSPATH.
5784 * nsterm.h (ns_exec_path): Add it.
5785 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5786 Use ns_exec_path.
5787
5788 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5789
5790 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5791
5792 * process.c (wait_reading_process_output): 'waitchannels' was unset
5793 when read_kbd || !NILP (wait_for_cell); fix this.
5794
5795 Add GCC-style 'const' attribute to functions that can use it.
5796 * character.h (char_resolve_modifier_mask):
5797 * keyboard.h (make_ctrl_char):
5798 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5799 (init_character_once, next_almost_prime, init_fns, init_image)
5800 (flush_pending_output, init_sound):
5801 * mem-limits.h (start_of_data):
5802 * menu.h (finish_menu_items):
5803 Add ATTRIBUTE_CONST.
5804 * emacs.c (DEFINE_DUMMY_FUNCTION):
5805 Declare the dummy function with ATTRIBUTE_CONST.
5806 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5807 Add decls with ATTRIBUTE_CONST.
5808
5809 Minor improvements to make_formatted_string.
5810 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5811 where int is good enough, as vsprintf returns an int.
5812 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5813
5814 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5815
5816 Use make_formatted_string to avoid double length calculation.
5817 * lisp.h (make_formatted_string): New prototype.
5818 * alloc.c (make_formatted_string): New function.
5819 * buffer.c (Fgenerate_new_buffer_name): Use it.
5820 * dbus.c (syms_of_dbusbind): Likewise.
5821 * editfns.c (Fcurrent_time_zone): Likewise.
5822 * filelock.c (get_boot_time): Likewise.
5823 * frame.c (make_terminal_frame, set_term_frame_name)
5824 (x_report_frame_params): Likewise.
5825 * image.c (gs_load): Likewise.
5826 * minibuf.c (get_minibuffer): Likewise.
5827 * msdos.c (dos_set_window_size): Likewise.
5828 * process.c (make_process): Likewise.
5829 * xdisp.c (ensure_echo_area_buffers): Likewise.
5830 * xsettings.c (apply_xft_settings): Likewise.
5831
5832 2012-07-09 Glenn Morris <rgm@gnu.org>
5833
5834 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5835 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5836 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5837 * nsterm.h (ns_etc_directory): Add it.
5838 * callproc.c [HAVE_NS]: Include nsterm.h.
5839 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5840
5841 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5842
5843 Move marker debugging code under MARKER_DEBUG.
5844 * marker.c (MARKER_DEBUG): Move marker debugging code under
5845 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5846 for bootstrap with --enable-checking (~3x slowdown reported
5847 by Juanma Barranquero <lekktu@gmail.com>).
5848 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5849
5850 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5851
5852 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5853 See <http://bugs.gnu.org/11825#29>.
5854
5855 2012-07-08 Eli Zaretskii <eliz@gnu.org>
5856
5857 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5858 has no font, use the frame's font. (Bug#11813)
5859 (display_line): Add commentary about displaying truncation glyphs
5860 on GUI frames.
5861 (produce_special_glyphs): Move here from term.c.
5862
5863 * term.c (produce_special_glyphs): Move to xdisp.c.
5864
5865 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5866 section.
5867
5868 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5869
5870 * xdisp.c (display_line): Avoid warning about implicit declaration
5871 of FRAME_FONT.
5872
5873 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5874
5875 * lisp.h: Remove empty conditional.
5876
5877 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5878
5879 * lread.c (load_path_check): Now static.
5880
5881 Fix some minor --with-ns problems found by static checking.
5882 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5883 (x_set_font) [!HAVE_X_WINDOWS]:
5884 * image.c (xpm_load_image) [HAVE_NS]:
5885 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5886 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5887 Remove unused local.
5888 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5889 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5890 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5891 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5892 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5893 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5894 Fix pointer signedness problem.
5895 * xfaces.c (FRAME_X_FONT_TABLE):
5896 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5897
5898 2012-07-07 Glenn Morris <rgm@gnu.org>
5899
5900 * lread.c (load_path_check): New function, split from init_lread.
5901 (init_lread): Reorganize. Motivation:
5902 If EMACSLOADPATH is set, check/warn about that rather than the
5903 defaults, which we are not going to use. Hence we can remove
5904 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5905 Don't warn if site-lisp directories are missing.
5906 If not installed, start from a blank load-path, since
5907 PATH_LOADSEARCH refers to the eventual installation directories.
5908
5909 2012-07-07 Eli Zaretskii <eliz@gnu.org>
5910
5911 Support truncation and continuation glyphs on GUI frames, when
5912 fringes are disabled. (Bug#11832)
5913 * xdisp.c (init_iterator): Get dimensions of truncation and
5914 continuation glyphs even if on GUI frames.
5915 Adjust it->last_visible_x on GUI frames when the left or right fringes,
5916 or both, are absent.
5917 (start_display, move_it_in_display_line_to): Handle the case of a
5918 GUI frame without a fringe to display continuation or truncation
5919 glyphs.
5920 (insert_left_trunc_glyphs): Support GUI frames: make sure
5921 truncation glyphs overwrite enough glyphs from the current line to
5922 have sufficient space in pixels.
5923 (display_line): Support truncation and continuation glyphs on GUI
5924 frames. If some spare pixels are left on the line after inserting
5925 the truncation glyphs, fill that space with a stretch glyph of a
5926 suitably computed width.
5927
5928 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5929 produce_glyphs, to support GUI sessions.
5930
5931 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5932
5933 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5934
5935 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5936
5937 Do not require float-time's arg to fit in time_t (Bug#11825).
5938 This works better on hosts where time_t is unsigned, and where
5939 float-time is applied to the (negative) difference between two times.
5940 * editfns.c (decode_time_components): Last arg is now double *,
5941 not int *, and means to store all the result as a double, without
5942 worrying about whether the seconds part fits in time_t.
5943 All callers changed.
5944 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5945 All callers changed.
5946 (Ffloat_time): Do not fail merely because the specified time falls
5947 outside of time_t range.
5948
5949 2012-07-07 Glenn Morris <rgm@gnu.org>
5950
5951 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5952 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5953 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5954
5955 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
5956
5957 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5958 Update dependencies.
5959
5960 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5961
5962 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5963
5964 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5965 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5966 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5967 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5968 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5969 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5970
5971 * xfont.c (compare_font_names): Redo to omit the need for casts.
5972
5973 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5974
5975 * xfns.c (Fx_change_window_property): Doc fix.
5976 * w32fns.c (Fx_change_window_property): Doc fix.
5977
5978 * w32fns.c (Fx_window_property): Accept the same arguments as the
5979 X Windows version. Doc fix.
5980 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5981
5982 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5983 Eli Zaretskii <eliz@gnu.org>
5984
5985 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5986 Windows-specific code from nt/config.nt moved here.
5987 Obsolete settings removed.
5988
5989 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5990
5991 * process.c: Avoid unnecessary calls to gettime.
5992 (wait_reading_process_output): Don't get the time of day
5993 when gobbling data immediately and not waiting, as there's no need
5994 for it in that case. This removes a FIXME.
5995
5996 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5997
5998 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5999 is defined (Bug#11768).
6000
6001 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6002
6003 Fix marker debugging code.
6004 * marker.c (byte_char_debug_check): Do not perform the check
6005 if buffer is not multibyte.
6006 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6007 Call byte_char_debug_check with correct arguments.
6008
6009 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6010
6011 Compile marker debugging code only if ENABLE_CHECKING is defined.
6012 * marker.c (byte_char_debug_check, count_markers):
6013 Use only if ENABLE_CHECKING is defined.
6014 (byte_debug_flag): Remove.
6015 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6016 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6017
6018 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6019
6020 Avoid code repetition in marker-related functions.
6021 * marker.c (attach_marker): New function.
6022 (Fset_marker, set_marker_restricted, set_marker_both)
6023 (set_marker_restricted_both): Use it.
6024 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6025 Consistently rename charno to charpos.
6026 (marker_position): Add eassert.
6027 (marker_byte_position): Convert to eassert.
6028
6029 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6030
6031 Simplify list operations in unchain_overlay and unchain_marker.
6032 * buffer.c (unchain_overlay): Simplify. Add comment.
6033 * marker.c (unchain_marker): Simplify. Fix comments.
6034
6035 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6036
6037 Introduce fast path for the widely used marker operation.
6038 * alloc.c (build_marker): New function.
6039 * lisp.h (build_marker): New prototype.
6040 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6041 * composite.c (autocmp_chars): Likewise.
6042 * editfns.c (buildmark): Remove.
6043 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6044 (save_restriction_save): Use build_marker.
6045 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6046 * window.c (save_window_save): Likewise.
6047
6048 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6049
6050 Do not use Fdelete_overlay in delete_all_overlays
6051 to avoid redundant calls to unchain_overlay.
6052 * buffer.c (drop_overlay): New function.
6053 (delete_all_overlays, Fdelete_overlay): Use it.
6054 * minibuf.c (get_minibuffer): Fix comment.
6055
6056 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6057
6058 Port to OpenBSD 5.1 amd64.
6059 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6060 This is needed for OpenBSD, and should be harmless on all BSD systems.
6061 Also, include <sys/sysctl.h>, as it should be available on all
6062 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6063 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6064 use p_pid member, not kp_proc.pid.
6065
6066 2012-07-06 Glenn Morris <rgm@gnu.org>
6067
6068 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6069
6070 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6071
6072 More xmalloc and related cleanup.
6073 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6074 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6075 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6076 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6077 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6078 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6079 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6080 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6081 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6082 * xterm.c:
6083 Omit needless casts involving void * pointers and allocation.
6084 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6085 as the former is more robust if P's type is changed.
6086 Prefer xzalloc to xmalloc + memset 0.
6087 Simplify malloc-or-realloc to realloc.
6088 Don't worry about xmalloc returning a null pointer.
6089 Prefer xstrdup to xmalloc + strcpy.
6090 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6091 growing it.
6092 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6093 alloca of a constant.
6094
6095 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6096
6097 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6098 hscroll is larger than the line width. Fixes long and futile
6099 looping inside extend_face_to_end_of_line (on a TTY) producing
6100 glyphs that are not needed and thrown away.
6101
6102 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6103
6104 * marker.c (set_marker_restricted_both): Simplify by using
6105 clip_to_bounds.
6106
6107 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6108
6109 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6110
6111 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6112
6113 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6114 not defined (Bug#11768).
6115 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6116 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6117 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6118 followed by gtk_box_set_homogeneous (Bug#11768).
6119 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6120 (update_theme_scrollbar_width, xg_create_scroll_bar):
6121 Use gtk_scrollbar_new (Bug#11768).
6122 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6123 (is_box_type): New function (Bug#11768).
6124 (xg_tool_item_stale_p): Call is_box_type.
6125 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6126 with default display (Bug#11768).
6127
6128 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6129
6130 * xdisp.c (window_hscroll_limited): New function.
6131 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6132 coordinates when window's hscroll is set to insanely large
6133 values. (Bug#11857)
6134
6135 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6136
6137 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6138 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6139
6140 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6141
6142 Cleanup xmalloc.
6143 * lisp.h (xzalloc): New prototype. Omit needless casts.
6144 * alloc.c (xzalloc): New function. Omit needless casts.
6145 * charset.c: Omit needless casts. Convert all calls to
6146 xmalloc with following memset to xzalloc.
6147 * dispnew.c: Likewise.
6148 * fringe.c: Likewise.
6149 * image.c: Likewise.
6150 * sound.c: Likewise.
6151 * term.c: Likewise.
6152 * w32fns.c: Likewise.
6153 * w32font.c: Likewise.
6154 * w32term.c: Likewise.
6155 * xfaces.c: Likewise.
6156 * xfns.c: Likewise.
6157 * xterm.c: Likewise.
6158 * atimer.c: Omit needless casts.
6159 * buffer.c: Likewise.
6160 * callproc.c: Likewise.
6161 * ccl.c: Likewise.
6162 * coding.c: Likewise.
6163 * composite.c: Likewise.
6164 * doc.c: Likewise.
6165 * doprnt.c: Likewise.
6166 * editfns.c: Likewise.
6167 * emacs.c: Likewise.
6168 * eval.c: Likewise.
6169 * filelock.c: Likewise.
6170 * fns.c: Likewise.
6171 * gtkutil.c: Likewise.
6172 * keyboard.c: Likewise.
6173 * lisp.h: Likewise.
6174 * lread.c: Likewise.
6175 * minibuf.c: Likewise.
6176 * msdos.c: Likewise.
6177 * print.c: Likewise.
6178 * process.c: Likewise.
6179 * region-cache.c: Likewise.
6180 * search.c: Likewise.
6181 * sysdep.c: Likewise.
6182 * termcap.c: Likewise.
6183 * terminal.c: Likewise.
6184 * tparam.c: Likewise.
6185 * w16select.c: Likewise.
6186 * w32.c: Likewise.
6187 * w32reg.c: Likewise.
6188 * w32select.c: Likewise.
6189 * w32uniscribe.c: Likewise.
6190 * widget.c: Likewise.
6191 * xdisp.c: Likewise.
6192 * xmenu.c: Likewise.
6193 * xrdb.c: Likewise.
6194 * xselect.c: Likewise.
6195
6196 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6197
6198 * fileio.c (time_error_value): Check the right error number.
6199 Problem reported by Troels Nielsen in
6200 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6201
6202 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6203
6204 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6205 This should be fixed in a better way; see Eli Zaretskii in
6206 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6207 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6208
6209 * fileio.c (time_error_value): Rename from special_mtime.
6210 The old name's problems were noted by Eli Zaretskii in
6211 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6212
6213 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6214 This variable's comment says Emacs needs at least one GDB-visible
6215 symbol of type enum pvec_type, to work around GDB problems.
6216 The symbol's value doesn't matter.
6217
6218 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6219 that causes compilation to fail on pre-C99 compilers.
6220
6221 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6222
6223 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6224 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6225
6226 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6227
6228 * buffer.c (init_buffer_once): Fix initialization of
6229 headers for buffer_defaults and buffer_local_symbols.
6230 Reported by Juanma Barranquero <lekktu@gmail.com>.
6231
6232 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6233
6234 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6235 * lisp.h (enum pvec_type): Use fewer bits.
6236 (PSEUDOVECTOR_SIZE_BITS): New constant.
6237 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6238 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6239 change in pvec_type.
6240 (PSEUDOVECTOR_TYPEP): New macro.
6241 (TYPED_PSEUDOVECTORP): Use it.
6242 * fns.c (internal_equal): Adapt code to extract pvectype.
6243 * emacs.c (gdb_pvec_type): Update type.
6244 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6245 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6246 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6247 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6248 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6249 abusing vector->header.next.nbytes.
6250 (live_vector_p): Use PVEC_TYPE.
6251 (mark_object): Adapt code to extract pvectype. Use switch.
6252
6253 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6254
6255 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6256 Tighten new eassert a bit.
6257
6258 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6259
6260 Fix compilation with --enable-gcc-warnings and -O1
6261 optimization level.
6262 * doprnt.c (doprnt): Change type of tem to int, initialize
6263 to avoid compiler warning. Add eassert.
6264 * search.c (simple_search): Initialize match_byte to avoid
6265 compiler warning. Add eassert.
6266
6267 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6268
6269 Avoid weird behavior with large horizontal scrolls.
6270 Without this change, for example, large hscroll values would
6271 mess up Emacs's display on Fedora 15 x86, presumably due to
6272 overflows in int calculations in the display code.
6273 Also, if buffers had long lines, Emacs would freeze.
6274 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6275 (set_window_hscroll): New function, containing the old guts of
6276 Fset_window_hscroll. Return the clipped value.
6277 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6278 This avoids the need to check against PTRDIFF_MAX.
6279
6280 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6281
6282 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6283
6284 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6285
6286 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6287
6288 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6289 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6290 since GCC 4.4.6 issues a bogus warning for them.
6291
6292 Fix bugs in file timestamp newness comparisons.
6293 * fileio.c (Ffile_newer_than_file_p):
6294 * lread.c (Fload): Use full timestamp resolution of files,
6295 not just the 1-second resolution, so that files that are only
6296 slightly newer still count as newer.
6297 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6298 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6299
6300 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6301
6302 * fileio.c: Improve handling of file time marker. (Bug#11852)
6303 (special_mtime): New function.
6304 (Finsert_file_contents, Fverify_visited_file_modtime):
6305 Use it to set special mtime values consistently.
6306
6307 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6308
6309 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6310 marker for non-existing file. (Bug#11852)
6311
6312 2012-07-03 Glenn Morris <rgm@gnu.org>
6313
6314 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6315 and did not make it into globals.h).
6316
6317 2012-07-03 Tom Tromey <tromey@redhat.com>
6318
6319 * window.c (Fset_window_margins, Fset_window_fringes)
6320 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6321 * textprop.c (Fprevious_property_change): No longer static.
6322 * syntax.c (Fsyntax_table_p): No longer static.
6323 * process.c (Fget_process, Fprocess_datagram_address): No longer
6324 static.
6325 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6326 * keyboard.c (Fcommand_execute): No longer static.
6327 Remove EXFUN.
6328 * insdel.c (Fcombine_after_change_execute): No longer static.
6329 * image.c (Finit_image_library): No longer static.
6330 * fileio.c (Fmake_symbolic_link): No longer static.
6331 * eval.c (Ffetch_bytecode): No longer static.
6332 * editfns.c (Fuser_full_name): No longer static.
6333 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6334 No longer static.
6335 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6336 static.
6337 * dired.c (Ffile_attributes): No longer static.
6338 * composite.c (Fcomposition_get_gstring): No longer static.
6339 * callproc.c (Fgetenv_internal): No longer static.
6340
6341 * ccl.h: Remove EXFUNs.
6342 * buffer.h: Remove EXFUNs.
6343 * dispextern.h: Remove EXFUNs.
6344 * intervals.h: Remove EXFUNs.
6345 * fontset.h: Remove EXFUN.
6346 * font.h: Remove EXFUNs.
6347 * dosfns.c (system_process_attributes): Remove EXFUN.
6348 * keymap.h: Remove EXFUNs.
6349 * lisp.h: Remove EXFUNs.
6350 * w32term.h: Remove EXFUNs.
6351 * window.h: Remove EXFUNs.
6352 * xsettings.h: Remove EXFUN.
6353 * xterm.h: Remove EXFUN.
6354
6355 2012-07-03 Glenn Morris <rgm@gnu.org>
6356
6357 * lisp.h (Frandom): Make it visible to C.
6358 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6359 buffer for invisible buffers. (Bug#1229)
6360
6361 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6362
6363 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6364 values which aren't power of 2.
6365 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6366 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
6367 accordingly.
6368
6369 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6370
6371 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6372
6373 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6374
6375 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6376
6377 * alloc.c (allocate_vector_block): Remove redundant
6378 calls to mallopt if DOUG_LEA_MALLOC is defined.
6379 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6380 avoid calls to mallopt if zero_vector is returned.
6381
6382 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6383
6384 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6385 is enabled, avoid dereferencing NULL current_sblock if
6386 running undumped.
6387
6388 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6389
6390 Cleanup basic buffer management.
6391 * buffer.h (struct buffer): Change layout to use generic vector
6392 marking code. Fix some comments. Change type of 'clip_changed'
6393 to bitfield. Remove unused #ifndef old.
6394 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6395 (GET_OVERLAYS_AT): Fix indentation.
6396 (for_each_per_buffer_object_at): New macro.
6397 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6398 (Fbuffer_local_variables): Use it.
6399 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6400 * alloc.c (allocate_buffer): Adjust to match new layout of
6401 struct buffer. Fix comment.
6402 (mark_overlay): New function.
6403 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6404 Lisp area of struct buffer.
6405 (mark_object): Use it. Adjust marking of misc objects
6406 and related comments.
6407
6408 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6409
6410 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6411 wrapper that is not needed because the wrapped code is a no-op (zero
6412 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6413 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6414
6415 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6416
6417 * alloc.c (mark_buffer): Simplify. Remove prototype.
6418 (mark_object): Add comment. Reorganize marking of vector-like
6419 objects. Use CHECK_LIVE for all vector-like objects except buffers
6420 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6421 Avoid redundant calls to mark_vectorlike for bool vectors.
6422
6423 2012-06-30 Glenn Morris <rgm@gnu.org>
6424
6425 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6426
6427 * epaths.in (PATH_SITELOADSEARCH): New.
6428 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6429 This is rather than relying on --enable-locallisppath elements
6430 having "site-lisp" in their names. (Bug#10208#25, 11658)
6431
6432 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6433
6434 * w32proc.c (sys_select): Accept and ignore one more argument.
6435
6436 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6437
6438 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6439 (pselect) [!MS_DOS]: Redirect to sys_select.
6440
6441 * sysdep.c: Don't include dos.h and dosfns.h.
6442
6443 * process.c (sys_select):
6444 * msdos.c (sys_select): Accept one more argument and ignore it.
6445
6446 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6447 adapt data types and code to that.
6448
6449 * dosfns.c:
6450 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6451 which clashes with the gnulib function of the same name.
6452
6453 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6454
6455 * font.c (font_style_to_value, font_style_symbolic)
6456 (font_prop_validate_style): Add type checks for values in
6457 font_style_table.
6458
6459 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6460 argument.
6461 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6462 uses.
6463
6464 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6465
6466 * xdisp.c (try_window_id): Undo last change.
6467
6468 * w32.c (getwd): Adjust commentary about startup_dir.
6469 (init_environment): Always call sys_access, even in non-MSVC
6470 builds. Don't chdir to the directory of the Emacs executable.
6471 This undoes code from 1997 which was justified by the need to
6472 "avoid conflicts when removing and renaming directories". But its
6473 downside was that every relative file name was being interpreted
6474 relative to the directory of the Emacs executable, which can never
6475 be TRT. In particular, it broke sys_access when called with
6476 relative file names.
6477 (sys_access): Map GetLastError to errno.
6478
6479 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6480
6481 * window.h (struct window): Change type of 'fringes_outside_margins'
6482 to bitfield. Fix comment. Adjust users accordingly.
6483 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6484 Adjust comment.
6485 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6486 to ptrdiff_t.
6487
6488 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6489
6490 * gnutls.c (emacs_gnutls_handshake):
6491 Add QUIT to make the loop interruptible.
6492
6493 2012-06-29 Glenn Morris <rgm@gnu.org>
6494
6495 * charset.c (init_charset): Make lack of etc/charsets fatal.
6496
6497 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6498
6499 * editfns.c (region_limit): Fix type mismatch.
6500
6501 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6502
6503 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6504 undefined. Convert from xassert to eassert.
6505 * nsmenu.m: Convert from xassert to eassert.
6506 * nsterm.m: Likewise.
6507
6508 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6509
6510 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6511
6512 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6513
6514 Avoid integer overflow on scroll-left and scroll-right.
6515 * window.c (HSCROLL_MAX): New macro.
6516 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6517 overflow when requested scroll falls outside ptrdiff_t range.
6518
6519 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6520
6521 * window.h (struct window): Change type of 'hscroll',
6522 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6523 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6524 Adjust users accordingly.
6525 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6526 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6527 from EMACS_INT to ptrdiff_t.
6528 (make_window): Omit redundant initialization.
6529
6530 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
6531
6532 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6533
6534 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6535
6536 * window.h (struct window): Change type of 'use_time' and
6537 'sequence_number' from Lisp_Object to int.
6538 * frame.c (make_frame): Adjust users accordingly.
6539 * print.c (print_object): Likewise.
6540 * window.c (select_window, Fwindow_use_time, make_parent_window)
6541 (make_window): Likewise.
6542
6543 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6544
6545 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6546 enabled with --enable-checking=[all,glyphs] configure option.
6547 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6548 adjust comments accordingly.
6549 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6550 undefined, adjust comments accordingly.
6551 * image.c: Likewise.
6552 * scroll.c: Likewise.
6553 * w32fns.c: Likewise.
6554 * w32term.c: Likewise.
6555 * xdisp.c: Likewise.
6556 * xfaces.c: Likewise.
6557 * xfns.c: Likewise.
6558 * xterm.c: Likewise.
6559
6560 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6561
6562 Generalize run-time debugging checks.
6563 * dispextern.h (XASSERTS): Remove.
6564 * fontset.c (xassert): Remove.
6565 Convert from xassert to eassert.
6566 * alloc.c: Convert from xassert to eassert.
6567 * bidi.c: Likewise.
6568 * dispnew.c: Likewise.
6569 * fns.c: Likewise.
6570 * fringe.c: Likewise.
6571 * ftfont.c: Likewise.
6572 * gtkutil.c: Likewise.
6573 * image.c: Likewise.
6574 * keyboard.c: Likewise.
6575 * menu.c: Likewise.
6576 * process.c: Likewise.
6577 * scroll.c: Likewise.
6578 * sound.c: Likewise.
6579 * term.c: Likewise.
6580 * w32console.c: Likewise.
6581 * w32fns.c: Likewise.
6582 * w32term.c: Likewise.
6583 * window.c: Likewise.
6584 * xdisp.c: Likewise.
6585 * xfaces.c: Likewise.
6586 * xfns.c: Likewise.
6587 * xselect.c: Likewise.
6588 * xterm.c: Likewise.
6589
6590 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6591
6592 * fns.c (maybe_resize_hash_table): Output message when growing the
6593 purify-hashtable.
6594
6595 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6596
6597 * alloc.c (allocate_string_data): Remove dead code.
6598 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6599 avoid GCC warning about unused macro.
6600
6601 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6602
6603 * alloc.c (allocate_string): Omit intervals initialization.
6604 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6605 as in make_pure_string and make_pure_c_string.
6606
6607 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6608
6609 * alloc.c (allocate_string): Fix last change.
6610
6611 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6612
6613 * alloc.c (allocate_string): Remove two redundant calls
6614 to memset, add explicit initialization where appropriate.
6615
6616 2012-06-27 Glenn Morris <rgm@gnu.org>
6617
6618 * lisp.mk (lisp): Remove paths.elc.
6619
6620 2012-06-27 Chong Yidong <cyd@gnu.org>
6621
6622 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6623
6624 2012-06-26 John Wiegley <johnw@newartisans.com>
6625
6626 * unexmacosx.c (copy_data_segment): Add two section names used
6627 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6628
6629 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6630 when building with Clang.
6631
6632 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6633
6634 * eval.c (Fapply): Allow calling it with a single argument.
6635
6636 2012-06-26 Eli Zaretskii <eliz@gnu.org>
6637
6638 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6639 _stricmp and _strnicmp.
6640 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6641
6642 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6643
6644 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6645 allocated window.
6646 (allocate_process): Likewise for new process.
6647 (allocate_terminal): Change to use offsetof.
6648 (allocate_frame): Likewise.
6649 * frame.c (make_frame): Omit redundant initialization.
6650 * window.c (make_parent_window): Use memset.
6651 (make_window): Omit redundant initialization.
6652 * process.c (make_process): Omit redundant initialization.
6653 * terminal.c (create_terminal): Likewise.
6654
6655 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6656
6657 * term.c (delete_tty): Remove redundant call to memset.
6658
6659 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6660
6661 * alloc.c: Remove build_string.
6662 * lisp.h: Define build_string as static inline. This provides
6663 a better opportunity to optimize away calls to strlen when the
6664 function is called with compile-time constant argument.
6665 * image.c (imagemagick_error): Convert to build_string.
6666 * w32proc.c (sys_spawnve): Likewise.
6667 * xterm.c (x_term_init): Likewise.
6668
6669 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6670
6671 Use sprintf return value instead of invoking strlen on result.
6672 In the old days this wasn't portable, since some sprintf
6673 implementations returned char *. But they died out years ago and
6674 Emacs already assumes sprintf returns int.
6675 Similarly for float_to_string.
6676 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6677 * ccl.c (ccl_driver):
6678 * character.c (string_escape_byte8):
6679 * data.c (Fnumber_to_string):
6680 * doprnt.c (doprnt):
6681 * print.c (print_object):
6682 * xdisp.c (message_dolog):
6683 * xfns.c (syms_of_xfns):
6684 Use sprintf or float_to_string result to avoid need to call strlen.
6685 * data.c (Fnumber_to_string):
6686 Use make_unibyte_string, since the string must be ASCII.
6687 * lisp.h, print.c (float_to_string): Now returns int length.
6688 * term.c (produce_glyphless_glyph):
6689 Use sprintf result rather than recomputing it.
6690
6691 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6692 * Makefile.in (ALL_CFLAGS):
6693 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6694 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6695
6696 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6697
6698 * dispextern.h (xstrcasecmp): Define to library function
6699 strcasecmp if available.
6700 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6701
6702 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6703
6704 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6705 Avoid comma operator.
6706 * menu.c (push_submenu_start, push_submenu_end)
6707 (push_left_right_boundary, push_menu_pane): Likewise.
6708 * msdos.c (dos_rawgetc): Likewise.
6709
6710 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6711
6712 * xfns.c (xic_create_fontsetname): Remove redundant calls
6713 to memset.
6714
6715 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6716
6717 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6718 sprintf already null-terminates its output.
6719
6720 * xfns.c (x_window): Remove redundant cast.
6721
6722 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6723
6724 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6725 `const char *' to `char *' to avoid compiler warning.
6726
6727 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6728
6729 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6730 instead of truncating it to 63 (admittedly a generous limit).
6731
6732 * process.c: Fix spelling and caps in comments.
6733
6734 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6735
6736 * emacs.c (setpgrp): Remove definition, unused.
6737 * sysdep.c (setpgrp): Remove definition, not used in this file.
6738
6739 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
6740
6741 * makefile.w32-in: Update dependencies.
6742
6743 2012-06-24 Eli Zaretskii <eliz@gnu.org>
6744
6745 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6746 (SYSTIME_H): Add nt/inc/sys/time.h.
6747
6748 * systime.h [WINDOWSNT]: Include sys/time.h.
6749
6750 * s/ms-w32.h (struct timespec): Definition moved from
6751 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6752
6753 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6754
6755 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6756 * buffer.h (buffer_slot_type_mismatch):
6757 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6758 * eval.c (unwind_to_catch):
6759 * image.c (my_png_error, my_error_exit):
6760 * keyboard.c (quit_throw_to_read_char, user_error)
6761 (Fexit_recursive_edit, Fabort_recursive_edit):
6762 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6763 (wrong_type_argument, buffer_overflow, __executable_start)
6764 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6765 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6766 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6767 (fatal):
6768 (child_setup) [!DOS_NT]:
6769 * lread.c (end_of_file_error, invalid_syntax):
6770 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6771 * puresize.h (pure_write_error):
6772 * search.c (matcher_overflow):
6773 * sound.c (sound_perror, alsa_sound_perror):
6774 * sysdep.c, syssignal.h (croak):
6775 * term.c (maybe_fatal, vfatal):
6776 * textprop.c (text_read_only):
6777 * undo.c (user_error):
6778 * unexmacosx.c (unexec_error):
6779 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6780 Use _Noreturn rather than NO_RETURN.
6781 No need for separate decl merely because of _Noreturn.
6782 * sound.c (sound_warning, parse_sound):
6783 Remove unnecessary forward decls.
6784
6785 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6786
6787 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6788 * lisp.h (WAIT_READING_MAX): New macro.
6789 * dispnew.c (Fsleep_for, sit_for):
6790 * keyboard.c (kbd_buffer_get_event):
6791 * process.c (Faccept_process_output):
6792 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6793 This improves on the previous patch, which introduced a bug
6794 when time_t is unsigned and as wide as intmax_t.
6795 See <http://bugs.gnu.org/9000#51>.
6796
6797 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6798
6799 * dispnew.c (sit_for, Fsleep_for):
6800 * keyboard.c (kbd_buffer_get_event):
6801 * process.c (Faccept_process_output): Avoid compiler warnings when
6802 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6803
6804 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
6805
6806 * makefile.w32-in: Update dependencies.
6807
6808 * w32.c (ltime): Add return type and declare static.
6809 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6810
6811 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6812
6813 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6814 Privately reported by Herbert J. Skuhra.
6815 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6816 All uses changed.
6817 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6818 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6819
6820 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6821
6822 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6823 last argument of make_unibyte_string.
6824
6825 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6826 language ID in the event parameters.
6827
6828 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6829 event.code, not the obscure "character set ID".
6830
6831 2012-06-23 Chong Yidong <cyd@gnu.org>
6832
6833 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6834
6835 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6836
6837 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6838 * w32.c (fdutimens): New function.
6839
6840 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6841
6842 * s/ms-w32.h (pselect): Redirect to sys_select.
6843
6844 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6845
6846 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6847 in the logic of incrementing and decrementing the value of
6848 use_relocatable_buffers.
6849
6850 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6851
6852 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6853 Privately reported by Herbert J. Skuhra.
6854 [__FreeBSD__]: Remove "*/" typo after "#include".
6855 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6856 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6857 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6858 Don't assume EMACS_TIME and struct timeval are the same type.
6859
6860 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6861
6862 Support higher-resolution time stamps (Bug#9000).
6863 The time stamps are only nanosecond-resolution at the C level,
6864 since that's the best that any real-world system supports now.
6865 But they are picosecond-resolution at the Lisp level, as that's
6866 easy, and leaves room for future OS improvements.
6867
6868 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6869 (LIBES): Use it.
6870
6871 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6872 Don't get current time unless it's needed.
6873
6874 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6875 now provides it if it's absent.
6876 (start_atimer): Port to higher-res time stamps.
6877 Check for time stamp overflow. Don't get current time more
6878 often than is needed.
6879
6880 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6881 Include systime.h, not time.h.
6882 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6883
6884 * dired.c: Include stat-time.h.
6885 (Ffile-attributes): File times now have higher resolution.
6886
6887 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6888 (struct image): Timestamp now has higher resolution.
6889
6890 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6891 has at least microseconds now. All uses removed.
6892 (update_frame, update_single_window, update_window, update_frame_1)
6893 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
6894 (duration_to_sec_usec): Remove; no longer needed.
6895
6896 * editfns.c (time_overflow): Now extern.
6897 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6898 (float-time, Fformat_time_string, Fcurrent_time_string)
6899 (Fcurrent_time_zone): Accept and generate higher-resolution
6900 time stamps.
6901 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6902 (decode_time_components, lisp_seconds_argument): New functions.
6903 (make_time): Now static.
6904 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6905 Report an error if the time is invalid, rather than having the caller
6906 do that.
6907
6908 * fileio.c: Include <stat-time.h>
6909 (Fcopy_file): Copy higher-resolution time stamps.
6910 Prefer to set the time stamp via a file descriptor if that works.
6911 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6912 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6913 (Fvisited_file_modtime, Fset_visited_file_modtime):
6914 Support higher-resolution time stamps.
6915
6916 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6917
6918 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6919
6920 * image.c (prepare_image_for_display, clear_image_cache)
6921 (lookup_image): Port to higer-resolution time stamps.
6922
6923 * keyboard.c (start_polling, bind_polling_period):
6924 Check for time stamp overflow.
6925 (read_char, kbd_buffer_get_event, timer_start_idle)
6926 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6927 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6928 Port to higher-resolution time stamps. Do not assume time_t is signed.
6929 (decode_timer): New function. Timers are now vectors of length 9,
6930 not 8, to accommodate the picosecond component.
6931 (timer_check_2): Use it.
6932
6933 * nsterm.m (select_timeout, timeval_subtract): Remove.
6934 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6935 as they're a bit more accurate and handle overflow better.
6936 (ns_select): Change prototype to be compatible with pselect.
6937 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6938 * nsterm.h (ns_select): Adjust prototype.
6939
6940 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6941 us-resolution time stamps.
6942 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6943
6944 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6945
6946 * lisp.h (time_overflow): New decl.
6947 (wait_reading_process_output): First arg is now intmax_t, not int,
6948 to accommodate larger waits.
6949
6950 * process.h (struct Lisp_Process.read_output_delay):
6951 Now counts nanoseconds, not microseconds.
6952 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6953 EMACS_HAS_USECS.
6954 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6955 (wait_reading_process_output):
6956 Port to ns-resolution time stamps.
6957 (Faccept_process_output, wait_reading_process_output):
6958 Check for time stamp overflow. Do not assume time_t is signed.
6959 (select_wrapper): Remove; we now use pselect.
6960 (Fprocess_attributes): Now generates ns-resolution time stamps.
6961
6962 * sysdep.c: Include utimens.h. Don't include utime.h
6963 or worry about struct utimbuf; gnulib does that for us now.
6964 (gettimeofday): Remove; gnulib provides a substitute.
6965 (make_timeval): New function.
6966 (set_file_times): Now sets ns-resolution time stamps.
6967 New arg FD; all uses changed.
6968 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6969 (system_process_attributes):
6970 Now returns ns-resolution time stamp. All uses changed.
6971 Check for time stamp overflow.
6972
6973 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6974 provides a substitute now.
6975
6976 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6977 since it guarantees struct timespec.
6978 (EMACS_TIME): Now struct timespec, so that we can support
6979 ns-resolution time stamps.
6980 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6981 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6982 (EMACS_USECS): Remove.
6983 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6984 so multiply the arg by 1000 before storing it.
6985 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6986 New macros.
6987 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6988 Port to ns-resolution time stamps.
6989 (EMACS_TIME_NEG_P): Remove; replaced by....
6990 (EMACS_TIME_SIGN): New macro.
6991 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6992 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6993 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6994 (make_timeval, make_lisp_time, decode_time_components): New decls.
6995 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6996 that it mishandled time_t overflow. You can't compare by subtracting!
6997 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6998 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6999
7000 * term.c: Include <sys/time.h>.
7001 (timeval_to_Time): New function, for proper overflow wraparound.
7002 (term_mouse_position, term_mouse_click): Use it.
7003
7004 * undo.c (record_first_change): Support higher-resolution time stamps
7005 in the undo buffer.
7006 (Fprimitive_undo): Use them when restoring time stamps.
7007
7008 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7009 (w32_get_internal_run_time):
7010 Port to higher-resolution Emacs time stamps.
7011 (ltime): Now accepts single 64-bit integer, as that's more convenient
7012 for callers.
7013
7014 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7015
7016 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7017 for compatibility with pselect. Support ns-resolution time stamps.
7018
7019 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7020
7021 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7022 Check for time stamp overflow, and support ns-resolution time stamps.
7023
7024 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7025 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7026 (timeval_subtract): Remove; no longer needed.
7027 (XTflash, XTring_bell, x_wait_for_event):
7028 Port to ns-resolution time stamps. Don't assume time_t is signed.
7029
7030 2012-06-22 Chong Yidong <cyd@gnu.org>
7031
7032 * xdisp.c (x_consider_frame_title): Revert last change.
7033
7034 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7035
7036 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7037 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7038 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7039 staticidx goes up to 1597 out of 1600 = 0x640.)
7040
7041 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7042
7043 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7044 Otherwise, the umask might be mistakenly 0 while handling input signals.
7045
7046 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7047
7048 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7049
7050 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7051
7052 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7053 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7054 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7055 access to `contents' member of Lisp_Vector objects with AREF and ASET
7056 where appropriate.
7057
7058 2012-06-19 Chong Yidong <cyd@gnu.org>
7059
7060 * frame.c (delete_frame): When selecting a frame on a different
7061 text terminal, do not alter the terminal's top-frame.
7062
7063 * xdisp.c (format_mode_line_unwind_data): Record the target
7064 frame's selected window and its terminal's top-frame.
7065 (unwind_format_mode_line): Restore them.
7066 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7067 Callers changed.
7068 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7069 since tty frames can be explicitly named.
7070 (prepare_menu_bars): Likewise.
7071
7072 * term.c (Ftty_top_frame): New function.
7073
7074 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7075
7076 Port byte-code-meter to modern targets.
7077 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7078 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7079 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7080 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7081 (METER_1, METER_2): Simplify.
7082
7083 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7084
7085 * data.c (Fdefalias): Return `symbol' (bug#11686).
7086
7087 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7088
7089 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7090 gets killed during executing of this function (Bug#11665).
7091 Try to always return Qt when the buffer has been actually killed.
7092 (Vkill_buffer_query_functions): In doc-string say that functions
7093 run by this hook should not change the current buffer.
7094
7095 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7096
7097 Fix recently-introduced process.c problems found by static checking.
7098 * process.c (write_queue_push, write_queue_pop, send_process):
7099 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7100 (write_queue_pop): Fix pointer signedness problem.
7101 (send_process): Remove unused local.
7102
7103 2012-06-17 Chong Yidong <cyd@gnu.org>
7104
7105 * xdisp.c (redisplay_internal): No need to redisplay terminal
7106 frames that are not on top.
7107
7108 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7109
7110 * process.c (make_process): Initialize write_queue.
7111 (write_queue_push, write_queue_pop): New functions.
7112 (send_process): Use them to maintain correct ordering of process
7113 writes (Bug#10815).
7114
7115 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7116
7117 * lisp.h (eassert): Assume C89 or later.
7118 This removes the need for CHECK.
7119 (CHECK): Remove. Its comments about always evaluating its
7120 argument were confusing, as 'eassert' typically does not evaluate
7121 its argument.
7122
7123 * coding.c (produce_chars): Use ptrdiff_t, not int.
7124
7125 * xterm.c (x_draw_underwave): Check for integer overflow.
7126 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7127
7128 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7129
7130 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7131 referenced (Bug#11583).
7132
7133 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7134
7135 Implement wave-style variant of underlining.
7136 * dispextern.h (face_underline_type): New enum.
7137 (face): Add field for underline type.
7138 * nsterm.m (ns_draw_underwave): New function.
7139 (ns_draw_text_decoration): Use it.
7140 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7141 New functions.
7142 (x_draw_glyph_string): Use them.
7143 * xfaces.c (Qline, Qwave): New Lisp objects.
7144 (check_lface_attrs, merge_face_ref)
7145 (Finternal_set_lisp_face_attribute, realize_x_face):
7146 Handle wave-style underline face attributes.
7147 * xterm.c (x_draw_underwave): New function.
7148 (x_draw_glyph_string): Use it.
7149
7150 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7151
7152 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7153 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7154 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7155 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7156 ($(BLD)/w32select.$(O)): Update dependencies.
7157
7158 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7159
7160 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7161 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7162 * character.c (_fetch_multibyte_char_p): Remove.
7163 * alloc.c: Include "character.h" before "buffer.h".
7164 * bidi.c: Likewise.
7165 * buffer.c: Likewise.
7166 * bytecode.c: Likewise.
7167 * callint.c: Likewise.
7168 * callproc.c: Likewise.
7169 * casefiddle.c: Likewise.
7170 * casetab.c: Likewise.
7171 * category.c: Likewise.
7172 * cmds.c: Likewise.
7173 * coding.c: Likewise.
7174 * composite.c: Likewise.
7175 * dired.c: Likewise.
7176 * dispnew.c: Likewise.
7177 * doc.c: Likewise.
7178 * dosfns.c: Likewise.
7179 * editfns.c: Likewise.
7180 * emacs.c: Likewise.
7181 * fileio.c: Likewise.
7182 * filelock.c: Likewise.
7183 * font.c: Likewise.
7184 * fontset.c: Likewise.
7185 * fringe.c: Likewise.
7186 * indent.c: Likewise.
7187 * insdel.c: Likewise.
7188 * intervals.c: Likewise.
7189 * keyboard.c: Likewise.
7190 * keymap.c: Likewise.
7191 * lread.c: Likewise.
7192 * macros.c: Likewise.
7193 * marker.c: Likewise.
7194 * minibuf.c: Likewise.
7195 * nsfns.m: Likewise.
7196 * nsmenu.m: Likewise.
7197 * print.c: Likewise.
7198 * process.c: Likewise.
7199 * regex.c: Likewise.
7200 * region-cache.c: Likewise.
7201 * search.c: Likewise.
7202 * syntax.c: Likewise.
7203 * term.c: Likewise.
7204 * textprop.c: Likewise.
7205 * undo.c: Likewise.
7206 * unexsol.c: Likewise.
7207 * w16select.c: Likewise.
7208 * w32fns.c: Likewise.
7209 * w32menu.c: Likewise.
7210 * window.c: Likewise.
7211 * xdisp.c: Likewise.
7212 * xfns.c: Likewise.
7213 * xmenu.c: Likewise.
7214 * xml.c: Likewise.
7215 * xselect.c: Likewise.
7216
7217 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7218
7219 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7220 If all the glyphs of the glyph row came from strings, and we have no
7221 cursor positioning clues, put the cursor on the first glyph of the
7222 row.
7223 (handle_face_prop): Use chunk-relative overlay string index when
7224 indexing into it->string_overlays array. (Bug#11653)
7225 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7226 the rightmost. (Bug#11720)
7227
7228 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7229
7230 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7231 (CATEGORY_MEMBER): Enforce 1/0 value.
7232 * category.c (_temp_category_set): Remove.
7233
7234 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7235
7236 * window.c (Fdelete_other_windows_internal)
7237 (Fdelete_window_internal): Don't access frame's mouse highlight
7238 info of the initial frame. (Bug#11677)
7239
7240 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7241
7242 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7243 Assume USE_2_TAGS_FOR_INTS.
7244 (xreload): Adjust $tagmask width to match recent lisp.h change.
7245
7246 Simplify lisp.h in minor ways that should not affect code.
7247 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7248 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7249 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7250 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7251 (INTTYPEBITS): New macro, for clarity.
7252 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7253 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7254 Simplify now that USE_LSB_TAG is always defined.
7255 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7256 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7257
7258 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7259
7260 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7261
7262 2012-06-13 Glenn Morris <rgm@gnu.org>
7263
7264 * s/bsd-common.h (BSD4_3):
7265 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7266
7267 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7268
7269 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7270 instead of union.
7271 (XLI, XIL): Define.
7272 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7273 Use them.
7274 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7275 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7276 * alloc.c (widen_to_Lisp_Object): Remove.
7277 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7278 * frame.c (delete_frame): Remove outdated comment.
7279 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7280 USE_LISP_UNION_TYPE.
7281 (Fw32_unregister_hot_key): Likewise.
7282 (Fw32_toggle_lock_key): Likewise.
7283 * w32menu.c (add_menu_item): Likewise.
7284 (w32_menu_display_help): Use XIL instead of checking
7285 USE_LISP_UNION_TYPE.
7286 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7287 (init_heap): Likewise.
7288 * w32term.c (w32_read_socket): Update comment.
7289
7290 2012-06-13 Glenn Morris <rgm@gnu.org>
7291
7292 * s/usg5-4-common.h, src/s/unixware.h:
7293 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7294
7295 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7296
7297 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7298
7299 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7300 * alloc.c (make_number) [!defined make_number]:
7301 Remove, as lisp.h always defines this now.
7302 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7303 (roundup_size): Verify that it is a power of 2.
7304 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7305 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7306 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7307 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7308 USE_LSB_TAG now is always defined to be either 0 or 1.
7309 All uses changed.
7310 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7311 code works fine either way, and efficiency is not a concern here,
7312 as the union type is for debugging, not for production.
7313 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7314 Use an inline function on all platforms when using the union type,
7315 since this is simpler and 'static inline' can be used portably
7316 within Emacs now.
7317 (LISP_INITIALLY_ZERO): New macro.
7318 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7319 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7320
7321 2012-06-12 Glenn Morris <rgm@gnu.org>
7322
7323 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7324
7325 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7326
7327 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7328 Move BROKEN_SIGIO to configure.
7329
7330 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7331 Move NO_TERMIO to configure.
7332
7333 2012-06-12 Chong Yidong <cyd@gnu.org>
7334
7335 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7336 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7337 MagickExportImagePixels is undefined.
7338
7339 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7340
7341 * image.c (imagemagick_load_image): Remove unused label.
7342
7343 2012-06-11 Glenn Morris <rgm@gnu.org>
7344
7345 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7346 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7347 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7348 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7349
7350 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7351
7352 * alloc.c (make_byte_code): New function.
7353 (Fmake_byte_code): Use it. Don't purify here.
7354 * lread.c (read1): Use it as well to avoid extra allocation.
7355
7356 2012-06-11 Chong Yidong <cyd@gnu.org>
7357
7358 * image.c (imagemagick_load_image): Implement transparency.
7359
7360 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7361
7362 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7363 account for preceding backslashes. (Bug#11663)
7364
7365 2012-06-09 Chong Yidong <cyd@gnu.org>
7366
7367 * term.c: Support italics in capable terminals (Bug#9652).
7368 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7369 (turn_on_face): Output using TS_enter_italic_mode if available.
7370 Don't handle unused blinking and alt-charset cases.
7371 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7372 and tty_alt_charset_p cases.
7373 (tty_capable_p, init_tty): Support italics.
7374
7375 * termchar.h (struct tty_display_info): Add field for italics.
7376 Remove unused blink field.
7377
7378 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7379 Handle slant.
7380
7381 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7382 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7383 tty_alt_charset_p. Add tty_italic_p.
7384
7385 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7386
7387 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7388 dbus_type_is_basic if available.
7389 (xd_extract_signed, xd_extract_unsigned): Rename from
7390 extract_signed and extract_unsigned, respectively. Adapt callers.
7391
7392 2012-06-09 Chong Yidong <cyd@gnu.org>
7393
7394 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7395
7396 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7397 case (Bug#9752).
7398
7399 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7400
7401 * xdisp.c (vmessage): Treat frame message as multibyte.
7402 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7403 would generate the diagnostic "Making \302\247 buffer-local while
7404 let-bound!".
7405
7406 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7407
7408 * dispnew.c (showing_window_margins_p): Undo last change, which
7409 was done due to an inadvertent commit.
7410 (adjust_frame_glyphs_for_frame_redisplay): Do call
7411 showing_window_margins_p.
7412
7413 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7414
7415 * eval.c (Fmake_var_non_special): New primitive.
7416 (syms_of_eval): Defsubr it.
7417 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7418
7419 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7420
7421 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7422 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7423
7424 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7425
7426 * alloc.c (allocate_vectorlike): Fix last change.
7427
7428 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7429
7430 Block-based vector allocation of small vectors.
7431 * lisp.h (struct vectorlike_header): New field `nbytes',
7432 adjust comment accordingly.
7433 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7434 to denote vector blocks. Adjust users (live_vector_p,
7435 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7436 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7437 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7438 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7439 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7440 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7441 (roundup_size): New constant.
7442 (struct vector_block): New data type.
7443 (vector_blocks, vector_free_lists, zero_vector): New variables.
7444 (all_vectors): Rename to `large_vectors'.
7445 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7446 (sweep_vectors): New functions.
7447 (allocate_vectorlike): Return `zero_vector' as the only vector of
7448 0 items. Allocate new vector from block if vector size is less than
7449 or equal to VBLOCK_BYTES_MAX.
7450 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7451 (init_alloc_once): Add call to init_vectors.
7452
7453 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7454
7455 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7456
7457 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7458
7459 * doprnt.c (doprnt): Truncate multibyte char correctly.
7460 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7461 would mishandle a string argument "Xc" if X was a multibyte
7462 character of length 2: it would truncate after X's first byte
7463 rather than including all of X.
7464
7465 2012-06-06 Chong Yidong <cyd@gnu.org>
7466
7467 * buffer.c (word_wrap): Doc fix.
7468
7469 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7470
7471 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7472
7473 2012-06-03 Glenn Morris <rgm@gnu.org>
7474
7475 * xdisp.c (tool-bar-style): Doc fix.
7476
7477 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7478
7479 * Makefile.in (PAXCTL): Define.
7480 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7481 binary via PaX flags if the paxctl utility is available.
7482 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7483 Restore PaX flags to their default. (Bug#11398)
7484
7485 2012-06-03 Chong Yidong <cyd@gnu.org>
7486
7487 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7488 buffer (Bug#11226).
7489
7490 2012-06-03 Chong Yidong <cyd@gnu.org>
7491
7492 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7493 (note_mode_line_or_margin_highlight): If there is no help echo,
7494 use mode-line-default-help-echo. Handle the case where the mouse
7495 position is past the end of the mode line string.
7496
7497 * buffer.c (buffer_local_value_1): New function, split from
7498 Fbuffer_local_value; can return Qunbound.
7499 (Fbuffer_local_value): Use it.
7500 (Vmode_line_format): Docstring tweaks.
7501
7502 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7503
7504 * sysdep.c (system_process_attributes): Improve comment.
7505
7506 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7507
7508 * keyboard.c: Export real-this-command to Elisp.
7509 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7510 and DEFVAR it. Update all users.
7511
7512 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7513
7514 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7515
7516 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7517 Convert pctcpu and pctmem to Lisp float properly.
7518 Let the compiler fold better, as 100.0/0x8000 is exact.
7519
7520 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7521
7522 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7523 cons_block.
7524
7525 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7526
7527 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7528
7529 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7530
7531 For a 'struct window', replace some Lisp_Object fields to
7532 bitfields where appropriate, remove unused fields.
7533 * window.h (struct window): Remove unused 'last_mark_x' and
7534 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7535 change it's type from Lisp_Object to bitfield.
7536 Change type of 'force_start', 'optional_new_start',
7537 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7538 fields from Lisp_Object to bitfield. Adjust users accordingly.
7539
7540 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7541
7542 Pacify gcc -Wdouble-precision when using Xaw.
7543 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7544 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7545 Use 'float' consistently, rather than 'float' in most places
7546 and 'double' in a couple of places.
7547
7548 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7549
7550 * xdisp.c (handle_stop): Detect whether we have overlay strings
7551 loaded by testing it->current.overlay_string_index to be
7552 non-negative, instead of checking whether n_overlay_strings is
7553 positive. (Bug#11587)
7554
7555 2012-05-31 Chong Yidong <cyd@gnu.org>
7556
7557 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7558
7559 * doc.c (Fsubstitute_command_keys): Doc fix.
7560
7561 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7562
7563 * search.c (search_buffer): Remove calls to
7564 r_alloc_inhibit_buffer_relocation, as it is now called by
7565 maybe_unify_char, which was the cause of relocation of buffer text
7566 in bug#11519.
7567
7568 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7569
7570 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7571 for the duration of call to load_charset, to avoid problems with
7572 callers of maybe_unify_char that access buffer text through C
7573 pointers.
7574
7575 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7576 decrement the inhibition flag, instead of just setting or
7577 resetting it.
7578
7579 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7580
7581 Remove obsolete '#define static' cruft.
7582 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7583 This #undef was "temporary" in 2000; it is no longer needed
7584 now that '#define static' has gone away.
7585 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7586 (gray_bitmap_bits): Remove; no longer needed.
7587 All uses replaced with definiens.
7588 * xterm.c: Include "bitmaps/gray.xbm".
7589
7590 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7591
7592 Clean up __executable_start, monstartup when --enable-profiling.
7593 The following changes affect the code only when profiling.
7594 * dispnew.c (__executable_start): Rename from safe_bcopy.
7595 Define only on platforms that need it.
7596 * emacs.c: Include <sys/gmon.h> when profiling.
7597 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7598 (__executable_start): Remove decl, since lisp.h does it now.
7599 (safe_bcopy): Remove decl; no longer has that name.
7600 (main): Coalesce #if into single bit of code, for simplicity.
7601 Cast pointers to uintptr_t, since standard libraries want integers
7602 and not pointers.
7603 * lisp.h (__executable_start): New decl.
7604
7605 2012-05-31 Glenn Morris <rgm@gnu.org>
7606
7607 * image.c (Fimagemagick_types): Doc fix.
7608
7609 2012-05-30 Jim Meyering <meyering@redhat.com>
7610
7611 * callproc.c (Fcall_process_region): Include directory component
7612 in mkstemp error message (Bug#11586).
7613
7614 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7615
7616 * alloc.c, lisp.h (make_pure_vector): Now static.
7617
7618 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7619
7620 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7621 Move to byte-run.el.
7622 (Fautoload): Do the hash-doc more carefully.
7623 * data.c (Fdefalias): Purify definition, except for keymaps.
7624 (Qdefun): Move from eval.c.
7625 * lisp.h (Qdefun): Remove.
7626 * lread.c (read1): Tiny simplification.
7627
7628 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
7629
7630 Do not create empty overlays with the evaporate property (Bug#9642).
7631 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7632 Bug#9642, but explicitly check that the buffer the overlay would
7633 be moved to is live and rearrange lines to make sure that errors
7634 will not put the overlay in an inconsistent state.
7635 (Fdelete_overlay): Cosmetics.
7636
7637 2012-05-28 Eli Zaretskii <eliz@gnu.org>
7638
7639 * w32term.c (my_bring_window_to_top): New function.
7640 (x_raise_frame): Use handle returned by DeferWindowPos, which
7641 could be different from the original one.
7642 Call my_bring_window_to_top instead of my_set_foreground_window.
7643 (Bug#11513)
7644
7645 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7646 by calling BringWindowToTop.
7647
7648 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7649 (WM_EMACS_END): Increase by one.
7650
7651 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7652
7653 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7654 This avoids undefined behavior that might cause the eassert
7655 to not catch an out-of-range value.
7656
7657 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
7658
7659 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7660 Update dependencies.
7661
7662 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7663
7664 * bidi.c (bidi_mirror_char): Fix last change.
7665
7666 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7667
7668 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7669 when referring to sectname field in printf format.
7670
7671 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7672
7673 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7674 Only r_alloc_inhibit_buffer_relocation needed to be added;
7675 the others were already declared.
7676
7677 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7678 before checking whether it's out of range. Put the check inside
7679 eassert. See
7680 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7681
7682 2012-05-27 Ken Brown <kbrown@cornell.edu>
7683
7684 * callproc.c (Fcall_process): Restore a line that was accidentally
7685 commented out in the 2011-02-13 change (bug#11547).
7686
7687 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7688
7689 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7690 defined on ralloc.c.
7691
7692 * buffer.c [REL_ALLOC]: Remove prototypes of
7693 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7694 they are now on lisp.h.
7695
7696 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7697
7698 * search.c (search_buffer): Use it to inhibit relocation of buffer
7699 text while re_search_2 is doing its job, because re_search_2 is
7700 passed C pointers to buffer text. (Bug#11519)
7701
7702 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7703 Update value to 24.
7704
7705 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7706 state after an additional call to move_it_in_display_line_to, keep
7707 the values of it->max_ascent and it->max_descent found for the
7708 entire line.
7709 (pos_visible_p): Revert the comparison against bottom_y to what it
7710 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7711 (Bug#11464)
7712
7713 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7714
7715 Fix coding-related core dumps with gcc -ftrapv.
7716 The code was computing A - B, where A and B are pointers, and B is
7717 random garbage. This can lead to core dumps on platforms that
7718 have special pointer registers, and it also leads to core dumps on
7719 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7720 A - B only when B is initialized properly.
7721 * coding.c (coding_set_source, coding_set_destination): Return void.
7722 (coding_change_source, coding_change_destinations): New functions,
7723 with the old behaviors of coding_set_source and coding_set_destination.
7724 All callers that need an offset changed to use these new functions.
7725
7726 2012-05-26 Glenn Morris <rgm@gnu.org>
7727
7728 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7729
7730 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7731
7732 Extend mouse support on W32 text-mode console.
7733 * xdisp.c (draw_row_with_mouse_face):
7734 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7735
7736 * w32console.c: Include window.h.
7737 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7738 New functions.
7739 (initialize_w32_display): Initialize mouse-highlight data.
7740
7741 * w32inevt.c: Include termchar.h and window.h.
7742 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7743 moves, call note_mouse_highlight. If help_echo changed, call
7744 gen_help_event to produce help-echo message in the echo area.
7745 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7746 highlight info.
7747
7748 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7749
7750 * lread.c (read1): Simplify slightly to avoid an overflow warning
7751 with GCC 4.7.0 on x86-64.
7752
7753 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7754
7755 * bidi.c (bidi_mirror_char): Revert last change: an int is
7756 definitely wide enough here.
7757
7758 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
7759
7760 Fix integer width and related bugs (Bug#9874).
7761 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7762 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7763 (string_bytes, check_sblock, allocate_string_data):
7764 (compact_small_strings, Fmake_bool_vector, make_string)
7765 (make_unibyte_string, make_multibyte_string)
7766 (make_string_from_bytes, make_specified_string)
7767 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7768 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7769 (mark_vectorlike):
7770 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7771 (allocate_pseudovector):
7772 Use int, not EMACS_INT, where int is wide enough.
7773 (inhibit_garbage_collection, Fgarbage_collect):
7774 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7775 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7776 int might not be wide enough.
7777 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7778 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7779 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7780 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7781 (bidi_level_of_next_char, bidi_move_to_visually_next):
7782 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7783 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7784 (Fkill_buffer, Fset_buffer_major_mode)
7785 (advance_to_char_boundary, Fbuffer_swap_text)
7786 (Fset_buffer_multibyte, overlays_at, overlays_in)
7787 (overlay_touches_p, struct sortvec, record_overlay_string)
7788 (overlay_strings, recenter_overlay_lists)
7789 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7790 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7791 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7792 (Foverlay_recenter, last_overlay_modification_hooks_used)
7793 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7794 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7795 (validate_region): Omit unnecessary test for b <= e,
7796 since that's guaranteed by the previous test.
7797 (adjust_overlays_for_delete): Avoid pos + length overflow.
7798 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7799 (report_overlay_modification):
7800 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7801 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7802 Omit pointer cast, which isn't needed anyway, and doesn't work
7803 after the EMACS_INT -> ptrdiff_t change.
7804 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7805 * buffer.h: Adjust decls to match defn changes elsewhere.
7806 (struct buffer_text, struct buffer):
7807 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7808 Use EMACS_INT, not int, where int might not be wide enough.
7809 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7810 not int, to avoid needless 32-bit limit on 64-bit hosts.
7811 (exec_byte_code): Use tighter memory-full test, one that checks
7812 for alloca overflow. Don't compute the address of the object just
7813 before an array, as that's not portable. Use EMACS_INT, not
7814 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7815 * callint.c (Fcall_interactively):
7816 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7817 * callproc.c (call_process_kill, Fcall_process):
7818 Don't assume pid_t fits into an Emacs fixnum.
7819 (call_process_cleanup, Fcall_process, child_setup):
7820 Don't assume pid_t fits into int.
7821 (call_process_cleanup, Fcall_process, delete_temp_file)
7822 (Fcall_process_region):
7823 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7824 (Fcall_process): Simplify handling of volatile integers.
7825 Use int, not EMACS_INT, where int will do.
7826 * casefiddle.c (casify_object, casify_region, operate_on_word)
7827 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7828 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7829 (casify_object): Avoid integer overflow when overallocating buffer.
7830 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7831 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
7832 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7833 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7834 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7835 integers are now checked earlier. All uses replaced with XINT.
7836 (ccl_driver):
7837 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7838 For CCL_MapSingle, check that content and value are in int range.
7839 (ccl_driver, Fregister_code_conversion_map):
7840 Check that Vcode_version_map_vector is a vector.
7841 (resolve_symbol_ccl_program): Check that vector header is in range.
7842 Always copy the vector, so that we can check its contents reliably
7843 now rather than having to recheck each instruction as it's being
7844 executed. Check that vector words fit in 'int'.
7845 (ccl_get_compiled_code, Fregister_ccl_program)
7846 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7847 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7848 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7849 contents are in range.
7850 (Fccl_execute_on_string): Check that status is in range.
7851 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7852 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7853 Accept and return EMACS_INT, not int, because callers can pass values
7854 out of 'int' range.
7855 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7856 (multibyte_chars_in_text, parse_str_as_multibyte)
7857 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7858 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7859 (string_escape_byte8, Fget_byte):
7860 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7861 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7862 avoid mishandling large integers.
7863 * character.h: Adjust decls to match defn changes elsewhere.
7864 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7865 (Ffind_charset_region):
7866 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7867 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7868 (load_charset_map_from_vector, Fdefine_charset_internal):
7869 Don't assume fixnum fits in int.
7870 (load_charset_map_from_vector, Fmap_charset_chars):
7871 Remove now-unnecessary CHECK_NATNUMs.
7872 (Fdefine_charset_internal): Check ranges here, more carefully.
7873 Don't rely on undefined behavior with signed left shift overflow.
7874 Don't assume unsigned int fits into fixnum, or that fixnum fits
7875 into unsigned int. Don't require max_code to be a valid fixnum;
7876 that's not true for gb10830 4-byte on a 32-bit host. Allow
7877 invalid_code to be a cons, for the same reason. Require code_offset
7878 to be a character. Avoid int overflow if max_char is close
7879 to INT_MAX.
7880 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7881 this is intended anyway and avoids some undefined behavior.
7882 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7883 INDEX_TO_CODE_POINT, as that's what it expects.
7884 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
7885 * charset.h (DECODE_CHAR): Return int, not unsigned;
7886 this is what was intended anyway, and it avoids undefined behavior.
7887 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7888 integer-overflow issues.
7889 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7890 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7891 where the argument is EMACS_INT, and this behavior is not intended.
7892 * chartab.c (Fmake_char_table, Fset_char_table_range)
7893 (uniprop_get_decoder, uniprop_get_encoder):
7894 Don't assume fixnum fits in int.
7895 * cmds.c (move_point): New function, that does the gist of
7896 Fforward_char and Fbackward_char, but does so while checking
7897 for integer overflow more accurately.
7898 (Fforward_char, Fbackward_char): Use it.
7899 (Fforward_line, Fend_of_line, internal_self_insert)
7900 (internal_self_insert):
7901 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7902 Fix a FIXME, by checking for integer overflow when calculating
7903 target_clm and actual_clm.
7904 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
7905 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
7906 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7907 (coding_alloc_by_making_gap, alloc_destination)
7908 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7909 (encode_coding_utf_16, detect_coding_emacs_mule)
7910 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7911 (detect_coding_iso_2022, decode_coding_iso_2022)
7912 (encode_invocation_designation, encode_designation_at_bol)
7913 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7914 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7915 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7916 (encode_coding_ccl, encode_coding_raw_text)
7917 (detect_coding_charset, decode_coding_charset)
7918 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7919 (produce_composition, produce_charset, produce_annotation)
7920 (decode_coding, handle_composition_annotation)
7921 (handle_charset_annotation, consume_chars, decode_coding_gap)
7922 (decode_coding_object, encode_coding_object, detect_coding_system)
7923 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7924 (code_convert_region, code_convert_string)
7925 (Fdefine_coding_system_internal)
7926 (coding_set_source, coding_set_destination):
7927 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7928 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7929 (Fdefine_coding_system_internal):
7930 Don't assume fixnums fit in int.
7931 (decode_coding_gap, decode_coding_object, encode_coding_object)
7932 (Fread_coding_system, Fdetect_coding_region)
7933 (Funencodable_char_position, Fcheck_coding_systems_region)
7934 (get_translation, handle_composition_annotation, consume_chars):
7935 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7936 (consume_chars): Rewrite to not calculate an address outside buffer.
7937 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7938 Don't access memory outside of the args array.
7939 (Fdefine_coding_system_internal): Check for charset-id overflow.
7940 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7941 result of ENCODE_CHAR.
7942 * coding.h: Adjust decls to match defn changes elsewhere.
7943 (struct coding_system):
7944 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7945 * composite.c (get_composition_id, find_composition)
7946 (run_composition_function, update_compositions)
7947 (compose_text, composition_gstring_put_cache)
7948 (composition_gstring_p, composition_gstring_width)
7949 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7950 (composition_compute_stop_pos, composition_reseat_it)
7951 (composition_update_it, struct position_record)
7952 (find_automatic_composition, composition_adjust_point)
7953 (Fcomposition_get_gstring, Ffind_composition_internal):
7954 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7955 (update_compositions):
7956 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7957 * composite.h: Adjust decls to match defn changes elsewhere.
7958 (struct composition):
7959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7960 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7961 Do not attempt to compute the address of the object just before a
7962 buffer; this is not portable.
7963 (Faref, Faset):
7964 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7965 (Faset): Use int, not EMACS_INT, where int is wide enough.
7966 (Fstring_to_number): Don't assume fixnums fit in int.
7967 (Frem): Don't assume arg is nonnegative.
7968 * dbusbind.c (xd_append_arg): Check for integers out of range.
7969 (Fdbus_call_method): Don't overflow the timeout int.
7970 (extract_signed, extract_unsigned): New functions.
7971 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7972 (xd_get_connection_references): Return ptrdiff_t, not int.
7973 All uses changed.
7974 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7975 (xd_read_message_1):
7976 Use int, not unsigned, where the dbus API uses int.
7977 (Fdbus_message_internal): Don't overflow mtype.
7978 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7979 * dired.c (directory_files_internal, file_name_completion, scmp)
7980 (file_name_completion_stat):
7981 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7982 (file_name_completion): Don't overflow matchcount.
7983 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7984 * dispextern.h: Adjust decls to match defn changes elsewhere.
7985 (struct text_pos, struct glyph, struct bidi_saved_info)
7986 (struct bidi_string_data, struct bidi_it, struct composition_it)
7987 (struct it):
7988 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7989 (struct display_pos, struct composition_it, struct it):
7990 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7991 * dispnew.c (increment_matrix_positions)
7992 (increment_row_positions, mode_line_string)
7993 (marginal_area_string):
7994 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7995 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7996 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7997 (duration_to_sec_usec): New function, to check for overflow better.
7998 (Fsleep_for, sit_for): Use it.
7999 * doc.c (get_doc_string, store_function_docstring):
8000 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8001 (get_doc_string, Fsnarf_documentation):
8002 Use int, not EMACS_INT, where int is wide enough.
8003 (get_doc_string):
8004 Use SAFE_ALLOCA, not alloca.
8005 Check for overflow when converting EMACS_INT to off_t.
8006 * doprnt.c (doprnt):
8007 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8008 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8009 Don't assume uid_t fits into fixnum.
8010 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8011 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8012 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8013 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8014 (general_insert_function)
8015 (Finsert_char, make_buffer_string, make_buffer_string_both)
8016 (update_buffer_properties, Fbuffer_substring)
8017 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8018 (Fsubst_char_in_region, check_translation)
8019 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8020 (transpose_markers, Ftranspose_regions):
8021 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8022 (clip_to_bounds): Move to lisp.h as an inline function).
8023 (Fconstrain_to_field): Don't assume integers are nonnegative.
8024 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8025 (Fsubst_char_in_region, Fsave_restriction):
8026 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8027 (Femacs_pid): Don't assume pid_t fits into fixnum.
8028 (lo_time): Use int, not EMACS_INT, when int suffices.
8029 (lisp_time_argument): Check for usec out of range.
8030 (Fencode_time): Don't assume fixnum fits in int.
8031 (Fuser_login_name, Fuser_full_name): Signal an error
8032 if a uid argument is out of range, rather than relying on
8033 undefined behavior.
8034 (Fformat_time_string): Remove now-unnecessary check.
8035 lisp_time_argument checks for out-of-range usec now.
8036 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8037 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8038 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8039 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8040 (init_cmdargs, Fdump_emacs):
8041 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8042 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8043 the bottom (typically) 32 bits of the fixnum.
8044 * eval.c (specpdl_size, call_debugger):
8045 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8046 (when_entered_debugger, Fbacktrace_debug):
8047 Don't assume fixnum can fit in int.
8048 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8049 the object just before a buffer; this is not portable.
8050 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8051 (grow_specpdl, unbind_to):
8052 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8053 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8054 (grow_specpdl): Simplify allocation by using xpalloc.
8055 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8056 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8057 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8058 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8059 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8060 (a_write, e_write):
8061 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8062 (Fcopy_file, non_regular_nbytes, read_non_regular)
8063 (Finsert_file_contents):
8064 Use int, not EMACS_INT, where int is wide enough.
8065 (READ_BUF_SIZE): Verify that it fits in int.
8066 (Finsert_file_contents): Check that counts are in proper range,
8067 rather than assuming fixnums fit into ptrdiff_t etc.
8068 Don't assume fixnums fit into int.
8069 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8070 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8071 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8072 (string_char_to_byte, string_byte_to_char)
8073 (string_make_multibyte, string_to_multibyte)
8074 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8075 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8076 (substring_both, Fdelete, internal_equal, Ffillarray)
8077 (Fclear_string, mapcar1)
8078 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8079 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8080 (larger_vector, make_hash_table, maybe_resize_hash_table)
8081 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8082 (Fmaphash, secure_hash):
8083 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8084 (concat): Check for string index and length overflow.
8085 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8086 (Frequire):
8087 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8088 (larger_vector): New API (vec, incr_min, size_max) replaces old
8089 one (vec, new_size, init). This catches size overflow.
8090 INIT was removed because it was always Qnil.
8091 All callers changed.
8092 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8093 the upper bound on a hash table index size.
8094 (make_hash_table, maybe_resize_hash_table): Use it.
8095 (secure_hash): Computer start_byte and end_byte only after
8096 they're known to be in ptrdiff_t range.
8097 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8098 (Ffont_get_glyphs, Ffont_at):
8099 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8100 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8101 (Flist_fonts, Fopen_font):
8102 Don't assume fixnum can fit in int.
8103 (check_gstring): Don't assume index can fit in int.
8104 (font_match_p): Check that fixnum is a character, not a nonnegative
8105 fixnum, since the later code needs to stuff it into an int.
8106 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8107 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8108 conversion overflow issues.
8109 (Fopen_font): Check for integer out of range.
8110 (Ffont_get_glyphs): Don't assume index can fit in int.
8111 * font.h: Adjust decls to match defn changes elsewhere.
8112 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8113 integer overflow.
8114 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8115 printmax_t, where ptrdiff_t is wide enough.
8116 (Finternal_char_font):
8117 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8118 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8119 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8120 (Fset_frame_position, x_set_frame_parameters)
8121 (x_set_line_spacing, x_set_border_width)
8122 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8123 Check that fixnums are in proper range for system types.
8124 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8125 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8126 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8127 Use SAFE_ALLOCA_LISP, not alloca.
8128 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8129 intptr_t is wide enough.
8130 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8131 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8132 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8133 Check for fixnum out of range.
8134 * ftfont.c (ftfont_list): Don't assume index fits in int.
8135 Check that fixnums are in proper range for system types.
8136 (ftfont_shape_by_flt):
8137 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8138 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8139 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8140 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8141 Check that fixnums are in proper range for system types.
8142 * gnutls.h: Adjust decls to match defn changes elsewhere.
8143 * gtkutil.c (xg_dialog_run):
8144 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8145 (update_frame_tool_bar):
8146 Check that fixnums are in proper range for system types.
8147 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8148 (lookup_image): Check that fixnums are in range for system types.
8149 * indent.c (last_known_column, last_known_column_point):
8150 (current_column_bol_cache):
8151 (skip_invisible, current_column, check_display_width):
8152 (check_display_width, scan_for_column, current_column_1)
8153 (Findent_to, Fcurrent_indentation, position_indentation)
8154 (indented_beyond_p, Fmove_to_column, compute_motion):
8155 (Fcompute_motion, Fvertical_motion):
8156 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8157 (last_known_column_modified): Use EMACS_INT, not int.
8158 (check_display_width):
8159 (Fcompute_motion):
8160 Check that fixnums and floats are in proper range for system types.
8161 (compute_motion): Don't assume index or fixnum fits in int.
8162 (compute_motion, Fcompute_motion):
8163 Use int, not EMACS_INT, when it is wide enough.
8164 (vmotion): Omit local var start_hpos that is always 0; that way
8165 we don't need to worry about overflow in expressions involving it.
8166 * indent.h: Adjust decls to match defn changes elsewhere.
8167 (struct position):
8168 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8169 Use int, not EMACS_INT, where int is wide enough.
8170 Remove unused members ovstring_chars_done and tab_offset;
8171 all uses removed.
8172 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8173 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8174 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8175 (make_gap, copy_text, insert, insert_and_inherit)
8176 (insert_before_markers, insert_before_markers_and_inherit)
8177 (insert_1, count_combining_before, count_combining_after)
8178 (insert_1_both, insert_from_string)
8179 (insert_from_string_before_markers, insert_from_string_1)
8180 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8181 (adjust_after_replace, adjust_after_insert, replace_range)
8182 (replace_range_2, del_range, del_range_1, del_range_byte)
8183 (del_range_both, del_range_2, modify_region)
8184 (prepare_to_modify_buffer, signal_before_change)
8185 (signal_after_change, Fcombine_after_change_execute):
8186 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8187 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8188 (balance_an_interval, split_interval_right, split_interval_left)
8189 (find_interval, next_interval, update_interval)
8190 (adjust_intervals_for_insertion, delete_node, delete_interval)
8191 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8192 (static_offset_intervals, offset_intervals)
8193 (merge_interval_right, merge_interval_left, make_new_interval)
8194 (graft_intervals_into_buffer, temp_set_point_both)
8195 (temp_set_point, set_point, adjust_for_invis_intang)
8196 (set_point_both, move_if_not_intangible, get_property_and_range)
8197 (get_local_map, copy_intervals, copy_intervals_to_string)
8198 (compare_string_intervals, set_intervals_multibyte_1):
8199 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8200 * intervals.h: Adjust decls to match defn changes elsewhere.
8201 (struct interval):
8202 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8203 * keyboard.c (this_command_key_count, this_single_command_key_start)
8204 (before_command_key_count, before_command_echo_length, echo_now)
8205 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8206 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8207 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8208 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8209 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8210 (last_non_minibuf_size, last_point_position, echo_truncate)
8211 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8212 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8213 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8214 (stuff_buffered_input):
8215 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8216 (last_auto_save, command_loop_1, read_char):
8217 Use EMACS_INT, not int, to avoid integer overflow.
8218 (record_char): Avoid overflow in total_keys computation.
8219 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8220 * keyboard.h: Adjust decls to match defn changes elsewhere.
8221 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8222 (Fkey_description, Fdescribe_vector, Flookup_key):
8223 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8224 (click_position): New function, to check that positions are in range.
8225 (Fcurrent_active_maps):
8226 (describe_command):
8227 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8228 (Faccessible_keymaps, Fkey_description):
8229 (preferred_sequence_p):
8230 Don't assume fixnum can fit into int.
8231 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8232 Check for integer overflow in size calculations.
8233 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8234 avoid mishandling large integers.
8235 * lisp.h: Adjust decls to match defn changes elsewhere.
8236 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8237 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8238 (struct Lisp_Marker):
8239 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8240 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8241 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8242 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8243 All callers changed.
8244 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8245 Assume the arg has valid form, since it always does.
8246 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8247 unsigned integer system type.
8248 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8249 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8250 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8251 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8252 (duration_to_sec_usec): New decl.
8253 * lread.c (read_from_string_index, read_from_string_index_byte)
8254 (read_from_string_limit, readchar, unreadchar, openp)
8255 (read_internal_start, read1, oblookup):
8256 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8257 (Fload, readevalloop, Feval_buffer, Feval_region):
8258 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8259 (openp): Check for out-of-range argument to 'access'.
8260 (read1): Use int, not EMACS_INT, where int is wide enough.
8261 Don't assume fixnum fits into int.
8262 Fix off-by-one error that can read outside a buffer.
8263 (read_filtered_event): Use duration_to_sec_usec
8264 to do proper overflow checking on durations.
8265 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8266 in size calculation.
8267 (Fexecute_kbd_macro):
8268 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8269 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8270 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8271 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8272 (set_marker_both, set_marker_restricted_both, marker_position)
8273 (marker_byte_position, Fbuffer_has_markers_at):
8274 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8275 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8276 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8277 It now merely ensures that the menu is large enough, without
8278 necessarily growing it, as this avoids some integer overflow issues.
8279 All callers changed.
8280 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8281 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8282 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8283 Use SAFE_ALLOCA_LISP, not alloca.
8284 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8285 to EMACS_INT. Check that fixnums are in proper range for system types.
8286 * minibuf.c (minibuf_prompt_width, string_to_object)
8287 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8288 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8289 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8290 (get_minibuffer, read_minibuf_unwind):
8291 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8292 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8293 this simplifies overflow checking. All callers changed.
8294 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8295 (Ftest_completion):
8296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8297 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8298 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8299 Check that fixnums are in proper range for system types.
8300 (Fx_create_frame, Fx_show_tip):
8301 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8302 * nsfont.m (ns_findfonts, nsfont_list_family):
8303 Don't assume fixnum fits in long.
8304 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8305 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8306 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8307 wide enough.
8308 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8309 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8310 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8311 (PRINTDECLARE, PRINTPREPARE):
8312 (strout, print_string):
8313 (print, print_preprocess, print_check_string_charset_prop)
8314 (print_object):
8315 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8316 (PRINTDECLARE):
8317 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8318 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8319 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8320 (printchar, strout): Use xpalloc to catch size calculation overflow.
8321 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8322 (print_error_message): Use SAFE_ALLOCA, not alloca.
8323 (print_object): Use int, not EMACS_INT, where int is wide enough.
8324 (print_depth, new_backquote_output, print_number_index):
8325 Use ptrdiff_t, not int, where int might not be wide enough.
8326 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8327 (Fset_process_window_size, Fformat_network_address)
8328 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8329 (sigchld_handler):
8330 Check that fixnums are in proper range for system types.
8331 (Fsignal_process): Simplify by avoiding a goto.
8332 Check for process-ids out of pid_t range rather than relying on
8333 undefined behavior.
8334 (process_tick, update_tick): Use EMACS_INT, not int.
8335 (Fformat_network_address, read_process_output, send_process)
8336 (Fprocess_send_region, status_notify):
8337 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8338 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8339 (wait_reading_process_output, read_process_output, exec_sentinel):
8340 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8341 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8342 (Faccept_process_output): Use duration_to_sec_usec to do proper
8343 overflow checking on durations.
8344 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8345 Don't assume pid_t fits in int.
8346 * process.h (struct Lisp_Process): Members tick and update_tick
8347 are now of type EMACS_INT, not int.
8348 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8349 configured --with-wide-int.
8350 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8351 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8352 * search.c (looking_at_1, string_match_1):
8353 (fast_string_match, fast_c_string_match_ignore_case)
8354 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8355 (scan_newline, find_before_next_newline, search_command)
8356 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8357 (set_search_regs, wordify):
8358 (Freplace_match):
8359 (Fmatch_data):
8360 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8361 (string_match_1, search_buffer, set_search_regs):
8362 (Fmatch_data):
8363 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8364 (wordify): Check for overflow in size calculation.
8365 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8366 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8367 Check that fixnums are in proper range for system types.
8368 * sound.c (struct sound_device)
8369 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8370 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8371 (Fplay_sound_internal):
8372 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8373 * syntax.c (struct lisp_parse_state, find_start_modiff)
8374 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8375 (Fparse_partial_sexp):
8376 Don't assume fixnums can fit in int.
8377 (struct lisp_parse_state, find_start_pos, find_start_value)
8378 (find_start_value_byte, find_start_begv)
8379 (update_syntax_table, char_quoted, dec_bytepos)
8380 (find_defun_start, prev_char_comend_first, back_comment):
8381 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8382 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8383 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8384 (Finternal_describe_syntax_value): Check that match_lisp is a
8385 character, not an integer, since the code stuffs it into int.
8386 (scan_words, scan_sexps_forward):
8387 Check that fixnums are in proper range for system types.
8388 (Fforward_word):
8389 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8390 (scan_sexps_forward):
8391 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8392 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8393 * syntax.h: Adjust decls to match defn changes elsewhere.
8394 (struct gl_state_s):
8395 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8396 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8397 MOST_POSITIVE_FIXNUM.
8398 * sysdep.c (wait_for_termination_1, wait_for_termination)
8399 (interruptible_wait_for_termination, mkdir):
8400 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8401 (emacs_read, emacs_write):
8402 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8403 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8404 and double all fit in int.
8405 * term.c (set_tty_color_mode):
8406 Check that fixnums are in proper range for system types.
8407 * termhooks.h (struct input_event):
8408 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8409 * textprop.c (validate_interval_range, interval_of)
8410 (Fadd_text_properties, set_text_properties_1)
8411 (Fremove_text_properties, Fremove_list_of_text_properties)
8412 (Ftext_property_any, Ftext_property_not_all)
8413 (copy_text_properties, text_property_list, extend_property_ranges)
8414 (verify_interval_modification):
8415 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8416 (Fnext_single_char_property_change)
8417 (Fprevious_single_char_property_change):
8418 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8419 (copy_text_properties):
8420 Check for integer overflow in index calculation.
8421 * undo.c (last_boundary_position, record_point, record_insert)
8422 (record_delete, record_marker_adjustment, record_change)
8423 (record_property_change):
8424 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8425 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8426 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8427 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8428 (Fx_hide_tip, Fx_file_dialog):
8429 * w32menu.c (set_frame_menubar):
8430 Use ptrdiff_t, not int, for consistency with rest of code.
8431 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8432 (select_window, Fdelete_other_windows_internal)
8433 (window_scroll_pixel_based, window_scroll_line_based)
8434 (Frecenter, Fset_window_configuration):
8435 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8436 (Fset_window_hscroll, run_window_configuration_change_hook)
8437 (set_window_buffer, temp_output_buffer_show, scroll_command)
8438 (Fscroll_other_window, Frecenter):
8439 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8440 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8441 Don't assume fixnum fits in int.
8442 (Fset_window_scroll_bars):
8443 Check that fixnums are in proper range for system types.
8444 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8445 (string_pos, c_string_pos, number_of_chars, init_iterator)
8446 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8447 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8448 (compute_display_string_end, handle_face_prop)
8449 (face_before_or_after_it_pos, handle_invisible_prop)
8450 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8451 (display_prop_intangible_p, string_buffer_position_lim)
8452 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8453 (get_overlay_strings_1, get_overlay_strings)
8454 (iterate_out_of_display_property, forward_to_next_line_start)
8455 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8456 (get_next_display_element, set_iterator_to_next)
8457 (get_visually_first_element, compute_stop_pos_backwards)
8458 (handle_stop_backwards, next_element_from_buffer)
8459 (move_it_in_display_line_to, move_it_in_display_line)
8460 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8461 (add_to_log, message_dolog, message_log_check_duplicate)
8462 (message2, message2_nolog, message3, message3_nolog
8463 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8464 (current_message_1, truncate_echo_area, truncate_message_1)
8465 (set_message, set_message_1, store_mode_line_noprop)
8466 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8467 (text_outside_line_unchanged_p, check_point_in_composition)
8468 (reconsider_clip_changes)
8469 (redisplay_internal, set_cursor_from_row, try_scrolling)
8470 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8471 (redisplay_window, find_last_unchanged_at_beg_row)
8472 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8473 (trailing_whitespace_p, find_row_edges, display_line)
8474 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8475 (display_mode_element, store_mode_line_string)
8476 (pint2str, pint2hrstr, decode_mode_spec)
8477 (display_count_lines, display_string, draw_glyphs)
8478 (x_produce_glyphs, x_insert_glyphs)
8479 (rows_from_pos_range, mouse_face_from_buffer_pos)
8480 (fast_find_string_pos, mouse_face_from_string_pos)
8481 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8482 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8483 (safe_call, init_from_display_pos, handle_fontified_prop)
8484 (handle_single_display_spec, load_overlay_strings)
8485 (with_echo_area_buffer, setup_echo_area_for_printing)
8486 (display_echo_area, echo_area_display)
8487 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8488 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8489 (redisplay_window, dump_glyph_row, display_mode_line)
8490 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8491 (handle_display_spec, display_prop_string_p):
8492 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8493 (handle_single_display_spec, build_desired_tool_bar_string)
8494 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8495 (get_specified_cursor_type):
8496 Check that fixnums are in proper range for system types.
8497 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8498 (Flookup_image_map):
8499 Don't assume fixnums fit in int.
8500 (compare_overlay_entries):
8501 Avoid mishandling comparisons due to subtraction overflow.
8502 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8503 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8504 (handle_tool_bar_click):
8505 Use int, not unsigned, since we prefer signed and the signedness
8506 doesn't matter here.
8507 (get_next_display_element, next_element_from_display_vector):
8508 Use int, not EMACS_INT, when int is wide enough.
8509 (start_hourglass): Use duration_to_sec_usec to do proper
8510 overflow checking on durations.
8511 * xfaces.c (Fbitmap_spec_p):
8512 Check that fixnums are in proper range for system types.
8513 (compare_fonts_by_sort_order):
8514 Avoid mishandling comparisons due to subtraction overflow.
8515 (Fx_family_fonts, realize_basic_faces):
8516 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8517 (Fx_family_fonts):
8518 Don't assume fixnum fits in int.
8519 Use SAFE_ALLOCA_LISP, not alloca.
8520 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8521 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8522 (face_at_buffer_position, face_for_overlay_string)
8523 (face_at_string_position):
8524 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8525 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8526 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8527 (Fx_show_tip):
8528 Check that fixnums are in proper range for system types.
8529 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8530 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8531 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8532 (Fx_change_window_property): Don't assume fixnums fit in int.
8533 * xfont.c (xfont_chars_supported):
8534 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8535 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8536 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8537 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8538 * xml.c (parse_region):
8539 * xrdb.c (magic_file_p):
8540 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8541 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8542 (x_get_local_selection, x_reply_selection_request)
8543 (x_handle_selection_request, wait_for_property_change):
8544 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8545 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8546 short is wide enough.
8547 (x_send_client_event): Don't assume fixnum fits in int.
8548 * xterm.c (x_x_to_emacs_modifiers):
8549 Don't assume EMACS_INT overflows nicely into int.
8550 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8551 may come from Lisp.
8552 (handle_one_xevent): NATNUMP can eval its arg twice.
8553 (x_connection_closed):
8554 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8555 * xterm.h: Adjust decls to match defn changes elsewhere.
8556 (struct scroll_bar): Use struct vectorlike_header
8557 rather than rolling our own approximation.
8558 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8559
8560 2012-05-25 Glenn Morris <rgm@gnu.org>
8561
8562 * lisp.mk (lisp): Update for more files being compiled now.
8563
8564 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8565
8566 * lread.c: Remove `read_pure' which makes no difference.
8567 (read_pure): Remove var.
8568 (unreadpure): Remove function.
8569 (readevalloop): Don't call read_list with -1 flag.
8570 (read1, read_vector): Don't test read_pure any more.
8571 (read_list): Simplify.
8572
8573 * fileio.c, character.h: Minor style tweaks.
8574
8575 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8576
8577 * window.h (clip_changed): Remove useless declaration.
8578
8579 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8580
8581 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8582 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8583
8584 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8585
8586 Remove src/m/*.
8587 This directory predates autoconf and is no longer needed nowadays.
8588 Move its few remaining bits of functionality to where they're needed.
8589 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8590 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8591 * m/template.h: Remove.
8592 * Makefile.in (M_FILE): Remove. All uses removed.
8593 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8594 * lisp.h (USE_LSB_TAG):
8595 * mem-limits.h (EXCEEDS_LISP_PTR):
8596 Use VAL_MAX, not VALBITS, in #if.
8597 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8598 (EMACS_UINT): Define unconditionally now.
8599 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8600 (BITS_PER_EMACS_INT): New constants, replacing
8601 what used to be in config.h, but not useful in #if.
8602 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8603 define them any more.
8604 (VAL_MAX): New macro.
8605 (VALMASK): Use it.
8606 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8607 BITS_PER_EMACS_INT, in #if.
8608 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8609 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8610 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8611 * s/ms-w32.h (DATA_START):
8612 Move here from removed file m/intel386.h.
8613 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8614 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8615
8616 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8617
8618 Assume C89 or later.
8619 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8620 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8621 (xrealloc):
8622 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8623 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8624 * textprop.c, tparam.c (NULL): Remove.
8625 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8626 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8627 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8628 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8629 * xterm.c (input_signal_count): Assume volatile works.
8630
8631 2012-05-21 Ken Brown <kbrown@cornell.edu>
8632
8633 * xgselect.c (xg_select): Fix first argument in call to 'select'
8634 (bug#11508).
8635
8636 2012-05-20 Ken Brown <kbrown@cornell.edu>
8637
8638 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8639 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8640
8641 2012-05-19 Ken Brown <kbrown@cornell.edu>
8642
8643 * xfns.c (x_in_use): Remove `static' qualifier.
8644 * xterm.h (x_in_use): Declare.
8645 * xgselect.c: Include xterm.h.
8646 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8647 and `display_arg' (bug#9754).
8648
8649 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8650
8651 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8652
8653 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8654 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8655
8656 2012-05-18 Eli Zaretskii <eliz@gnu.org>
8657
8658 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8659
8660 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8661 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8662
8663 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8664 reference to image_cache->refcount.
8665 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8666
8667 2012-05-17 Juri Linkov <juri@jurta.org>
8668
8669 * search.c (Fword_search_regexp, Fword_search_backward)
8670 (Fword_search_forward, Fword_search_backward_lax)
8671 (Fword_search_forward_lax): Move functions to isearch.el
8672 (bug#10145, bug#11381).
8673
8674 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8675
8676 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8677
8678 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8679
8680 * lread.c (init_obarray): Declare Qt and Qnil as special.
8681
8682 2012-05-14 Glenn Morris <rgm@gnu.org>
8683
8684 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8685 Put "libexec" before "bin", for the sake of init_callproc_1.
8686
8687 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8688
8689 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8690
8691 * unexaix.c: Port to more-recent AIX compilers.
8692 (report_error, report_error_1, make_hdr, copy_sym)
8693 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8694 Make arguments const char *, not char *, to avoid violations of C
8695 standard and to fix some AIX warnings reported by Gilles Pion.
8696
8697 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8698
8699 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8700 already have overlays loaded.
8701 (handle_single_display_spec): Before returning without displaying
8702 fringe bitmap, synchronize the bidi iterator with the main display
8703 iterator, by calling iterate_out_of_display_property.
8704 (iterate_out_of_display_property): Detect buffer iteration by
8705 testing that it->string is a Lisp string.
8706 (get_next_display_element): When the current object is exhausted,
8707 and there's something on it->stack, call set_iterator_to_next to
8708 proceed with what's on the stack, instead of returning zero.
8709 (set_iterator_to_next): If called at the end of a Lisp string,
8710 proceed to consider_string_end without incrementing string
8711 position. Don't increment display vector index past the end of
8712 the display vector. (Bug#11417)
8713 (pos_visible_p): Don't report a position visible when move_it_to
8714 stopped at the last line of window, which happens to be scanned
8715 backwards by the bidi iteration. (Bug#11464)
8716
8717 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8718
8719 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8720 and right-margin display specs even if the spec is invalid or we
8721 are on a TTY, and thus unable to display on the fringes.
8722 That's because the text with the property will not be displayed anyway,
8723 so we need to signal to the caller that this is a "replacing"
8724 display spec. This fixes display when the spec is invalid or we
8725 are on a TTY.
8726
8727 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8728
8729 * unexaix.c (make_hdr): Fix typo in prototype.
8730 This bug broke the build on AIX. Problem reported by Gilles Pion.
8731
8732 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
8733
8734 * keyboard.c (kbd_buffer_get_event): Read special events also in
8735 batch mode. (Bug#11415)
8736
8737 2012-05-12 Glenn Morris <rgm@gnu.org>
8738
8739 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8740
8741 2012-05-12 Eli Zaretskii <eliz@gnu.org>
8742
8743 * lisp.mk (lisp): Add newcomment.elc.
8744
8745 2012-05-12 Glenn Morris <rgm@gnu.org>
8746
8747 * Makefile.in (MKDIR_P): New, set by configure.
8748 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8749
8750 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8751
8752 Remove unused function hourglass_started.
8753 * dispextern.h (hourglass_started):
8754 * w32fns.c (hourglass_started):
8755 * xdisp.c (hourglass_started): Remove.
8756
8757 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
8758
8759 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8760 Update dependencies.
8761
8762 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8763
8764 * xgselect.c (xg_select): Put maxfds+1 into a var.
8765 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8766
8767 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8768
8769 2012-05-10 Dave Abrahams <dave@boostpro.com>
8770
8771 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8772 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8773
8774 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
8775
8776 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8777 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8778 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8779 Initialize xd_registered_buses.
8780
8781 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8782
8783 Untag more efficiently if USE_LSB_TAG.
8784 This is based on a proposal by YAMAMOTO Mitsuharu in
8785 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8786 For an admittedly artificial (nth 8000 longlist) benchmark on
8787 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8788 Emacs's overall text size by 1%.
8789 * lisp.h (XUNTAG): New macro.
8790 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8791 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8792 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8793 * eval.c (Fautoload):
8794 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8795 * frame.h (XFRAME): Use XUNTAG.
8796
8797 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8798 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8799 Remove unportable assumptions about print widths of types like
8800 dbus_uint32_t.
8801 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8802 intptr_t when converting between pointer and integer, to avoid GCC
8803 warnings about wrong width.
8804
8805 2012-05-09 Eli Zaretskii <eliz@gnu.org>
8806
8807 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8808 stack for each reader_thread, instead of defaulting to 8MB
8809 determined by the linker. This avoids failures in creating
8810 subprocesses on Windows 7, see the discussion in this thread:
8811 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8812
8813 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8814
8815 Fix up display of the *Minibuf-0* buffer in the mini window.
8816 * keyboard.c (read_char): Don't clear the echo area if there's no
8817 message to clear.
8818 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8819 contents of *Minibuf-0*) if there's no message displayed in its stead.
8820
8821 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
8822
8823 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8824 batch mode.
8825
8826 2012-05-06 Chong Yidong <cyd@gnu.org>
8827
8828 * lisp.mk (lisp): Update.
8829
8830 2012-05-05 Jim Meyering <meyering@redhat.com>
8831
8832 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8833
8834 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8835
8836 * data.c (PUT_ERROR): New macro.
8837 (syms_of_data): Use it. Add new error type `user-error'.
8838 * undo.c (user_error): New function.
8839 (Fprimitive_undo): Use it.
8840 * print.c (print_error_message): Adjust print style for `user-error'.
8841 * keyboard.c (user_error): New function.
8842 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8843
8844 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8845
8846 Do not limit current-time-string to years 1000..9999.
8847 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8848 (Fcurrent_time_string): Support any year that is supported by the
8849 underlying localtime representation. Don't use asctime, as it
8850 has undefined behavior for years outside the range -999..9999.
8851
8852 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8853
8854 Fix race conditions involving setenv, gmtime, localtime, asctime.
8855 Without this fix, interrupts could mess up code that uses these
8856 nonreentrant functions, since setting TZ invalidates existing
8857 tm_zone or tzname values, and since most of these functions return
8858 pointers to static storage.
8859 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8860 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8861 Grow the critical sections to include not just invoking
8862 localtime/gmtime, but also accessing these functions' results
8863 including their tm_zone values if any, and any related TZ setting.
8864 (format_time_string): Last arg is now struct tm *, not struct tm **,
8865 so that the struct tm is saved in the critical section.
8866 All callers changed. Simplify allocation of initial buffer, partly
8867 motivated by the fact that memory allocation needs to be outside
8868 the critical section.
8869
8870 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8871
8872 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8873 with RESET_INTERVAL.
8874
8875 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8876 Remove duplicated buffer name initialization.
8877
8878 2012-05-02 Jim Meyering <jim@meyering.net>
8879
8880 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8881
8882 * xfns.c (x_window): Use xstrdup (Bug#11375).
8883
8884 2012-05-02 Eli Zaretskii <eliz@gnu.org>
8885
8886 * xdisp.c (pos_visible_p): If already at a newline from the
8887 display string before the 'while' loop, don't walk back the glyphs
8888 from it3.glyph_row. Solves assertion violation when the display
8889 string begins with a newline (egg.el). (Bug#11367)
8890
8891 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8892
8893 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8894 Move to simple.el.
8895
8896 2012-05-01 Glenn Morris <rgm@gnu.org>
8897
8898 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8899 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8900 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8901 All were removed before 23.1.
8902
8903 * dispnew.c: Remove HAVE_LIBNCURSES test;
8904 it is always true on relevant platforms.
8905
8906 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8907 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8908
8909 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8910
8911 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8912
8913 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8914 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8915 Remove.
8916
8917 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8918
8919 Do not avoid creating empty evaporating overlays (Bug#9642).
8920 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8921 That is, do not delete an evaporating overlay if it becomes
8922 empty after its bounds are adjusted to fit within its buffer.
8923 This fix caused other problems, and I'm reverting it until we get
8924 to the bottom of them.
8925
8926 2012-04-27 Chong Yidong <cyd@gnu.org>
8927
8928 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8929
8930 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8931
8932 * xdisp.c (pos_visible_p): If the window start position is beyond
8933 ZV, start the display from buffer beginning. Prevents assertion
8934 violation in init_iterator when the minibuffer window is scrolled
8935 via the scroll bar.
8936
8937 * window.c (window_scroll_pixel_based): Likewise.
8938
8939 2012-04-27 Chong Yidong <cyd@gnu.org>
8940
8941 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8942
8943 2012-04-27 Glenn Morris <rgm@gnu.org>
8944
8945 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8946 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8947
8948 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8949
8950 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8951 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
8952
8953 2012-04-26 Eli Zaretskii <eliz@gnu.org>
8954
8955 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8956 display element, check also the underlying string or buffer
8957 character. (Bug#11341)
8958
8959 * w32menu.c: Include w32heap.h.
8960 (add_menu_item): If the call to AppendMenuW (via
8961 unicode_append_menu) fails, disable Unicode menus only if we are
8962 running on Windows 9X/Me.
8963
8964 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8965
8966 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8967 (xgetint): Add missing shift for LSB tags.
8968
8969 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8970
8971 * keyboard.c (read_char): Don't wipe echo area for select window
8972 events: These might get delayed via `mouse-autoselect-window'
8973 (Bug#11304).
8974
8975 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8976
8977 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8978 manipulation of :loaded-from data.
8979
8980 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8981
8982 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8983 now a cons (bug#11311).
8984
8985 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8986
8987 Do not create empty overlays with the evaporate property (Bug#9642).
8988 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8989 if it becomes empty after its bounds are adjusted to fit within
8990 its buffer. Without this fix, in a nonempty buffer (let ((o
8991 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8992 yields an empty overlay that has the evaporate property, which is
8993 not supposed to happen.
8994
8995 Fix minor GTK3 problems found by static checking.
8996 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8997 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8998 (struct _EmacsFixedClass, emacs_fixed_get_type):
8999 Move decls here from emacsgtkfixed.h, since they needn't be public.
9000 (emacs_fixed_get_type): Now static.
9001 (emacs_fixed_class_init): Omit unused local.
9002 (emacs_fixed_child_type): Remove; unused.
9003 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9004 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9005 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9006 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9007 (EMACS_FIXED_GET_CLASS): Remove; unused.
9008 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9009
9010 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9011 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9012
9013 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9014
9015 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9016 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9017 (__malloc_size_t, __malloc_ptrdiff_t):
9018 Remove. All uses removed, replaced by the definiens if needed,
9019 since we can assume C89 or better now.
9020 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9021 (protect_malloc_state, align, get_contiguous_space)
9022 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9023 (malloc_atfork_handler_child, malloc_enable_thread)
9024 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9025 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9026 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9027 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9028 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9029 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9030 Define using prototypes, not old style.
9031 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9032 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9033 (align): Don't assume that signed integer overflow wraps around.
9034 Omit unused local var.
9035 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9036 (_free_internal_nolock, memalign, mallochook, reallochook):
9037 Omit no-longer-needed casts.
9038 (valloc): Use getpagesize, not __getpagesize.
9039 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9040 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9041
9042 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9043
9044 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9045
9046 Move functions from C to Lisp. Make non-blocking method calls
9047 the default. Implement further D-Bus standard interfaces.
9048
9049 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9050 (QCdbus_request_name_allow_replacement)
9051 (QCdbus_request_name_replace_existing)
9052 (QCdbus_request_name_do_not_queue)
9053 (QCdbus_request_name_reply_primary_owner)
9054 (QCdbus_request_name_reply_in_queue)
9055 (QCdbus_request_name_reply_exists)
9056 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9057 (QCdbus_registered_serial, QCdbus_registered_method)
9058 (QCdbus_registered_signal): New Lisp objects.
9059 (XD_DEBUG_MESSAGE): Use sizeof.
9060 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9061 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9062 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9063 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9064 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9065 (xd_signature, xd_append_arg): Allow float for integer types.
9066 (xd_get_connection_references): New function.
9067 (xd_get_connection_address): Rename from xd_initialize.
9068 Return cached address.
9069 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9070 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9071 level.
9072 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9073 Return number of refcounts.
9074 (Fdbus_get_unique_name): Make stronger parameter check.
9075 (Fdbus_message_internal): New defun.
9076 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9077 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9078 (Fdbus_send_signal, Fdbus_register_service)
9079 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9080 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9081 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9082 (Vdbus_compiled_version, Vdbus_runtime_version)
9083 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9084 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9085 (Vdbus_message_type_signal): New defvars.
9086 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9087 Adapt docstring.
9088
9089 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9090
9091 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9092 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9093 Do not assume ptrdiff_t is the same width as 'int'.
9094
9095 * alloc.c: Handle unusual debugging option combinations.
9096 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9097 since the two debugging options are incompatible.
9098 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9099 is defined.
9100 (mem_init, mem_insert, mem_insert_fixup):
9101 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9102 (NEED_MEM_INSERT): Remove; no longer needed.
9103
9104 2012-04-22 Leo Liu <sdl.web@gmail.com>
9105
9106 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9107
9108 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9109
9110 * sysdep.c [__FreeBSD__]: Minor cleanups.
9111 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9112 Use Emacs indenting style more consistently. Avoid some casts.
9113 Use 'double' consistently rather than mixing 'float' and 'double'.
9114
9115 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9116
9117 * sysdep.c (list_system_processes, system_process_attributes):
9118 Add implementation for FreeBSD (Bug#5243).
9119
9120 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9121
9122 * lisp.mk (lisp): Update.
9123
9124 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9125
9126 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9127 It is never used otherwise.
9128
9129 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9130
9131 * print.c (print_preprocess): Only check print_depth if print-circle
9132 is nil.
9133 (print_object): Check for cycles even when print-circle is nil and
9134 print-gensym is t, but only check print_depth if print-circle is nil.
9135
9136 2012-04-20 Chong Yidong <cyd@gnu.org>
9137
9138 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9139 set the status to "failed" and ensure that sentinel is run.
9140
9141 2012-04-20 Glenn Morris <rgm@gnu.org>
9142
9143 * process.c (Fset_process_inherit_coding_system_flag)
9144 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9145 (Fmake_network_process, Fmake_serial_process): Doc fix.
9146
9147 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9148
9149 * xdisp.c (string_buffer_position_lim): Limit starting position to
9150 BEGV.
9151 (set_cursor_from_row): If called for a mode-line or header-line
9152 row, return zero immediately.
9153 (try_cursor_movement): If inside continuation line, don't back up
9154 farther than the first row after the header line, if any.
9155 Don't consider the header-line row as "partially visible", even if
9156 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9157
9158 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9159
9160 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9161 (bug#11238).
9162
9163 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9164 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9165
9166 configure: new option --enable-gcc-warnings (Bug#11207)
9167 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9168 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9169 (ALL_CFLAGS): Use new macros rather than old.
9170 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9171 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9172 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9173 -Wunused-result, -Wunused-variable. This should go away once
9174 the Emacs and Gnulib regex code is merged.
9175 (xmalloc, xrealloc): Now static.
9176
9177 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9178
9179 * dired.c (Fsystem_groups): Remove unused local.
9180
9181 2012-04-17 Glenn Morris <rgm@gnu.org>
9182
9183 * dired.c (Fsystem_users): Doc fix.
9184
9185 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9186
9187 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9188 (syms_of_dired): Add them.
9189
9190 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9191
9192 Fix minor alloc.c problems found by static checking.
9193 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9194 New extern decls, to avoid calling undeclared functions.
9195 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9196 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9197 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9198 (NEED_MEM_INSERT): New macro.
9199 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9200 Remove one incorrect comment and fix another.
9201
9202 Fix minor ralloc.c problems found by static checking.
9203 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9204 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9205 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9206 (r_alloc_sbrk): Now static.
9207
9208 Improve ralloc.c interface checking.
9209 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9210 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9211 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9212 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9213 [REL_ALLOC]: ... to here, to check interface.
9214 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9215 Remove decls. This fixes an "It stinks!".
9216
9217 * alloc.c (which_symbols): Fix alignment issue / type clash.
9218
9219 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9220
9221 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9222 (struct Lisp_Misc_Any): Likewise.
9223 (struct Lisp_Free): Likewise.
9224 * alloc.c (union aligned_Lisp_Symbol): Define.
9225 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9226 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9227 (union aligned_Lisp_Misc): Define.
9228 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9229 aligned_Lisp_Misc instead of union Lisp_Misc.
9230 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9231
9232 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9233
9234 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9235 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9236 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9237 * s/netbsd.h, s/sol2-6.h:
9238 Remove definition of GC_MARK_STACK, since the default now works.
9239 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9240 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9241 no longer the default.
9242 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9243
9244 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9245
9246 * lread.c (lisp_file_lexically_bound_p):
9247 Fix hang at ";-*-\n" (bug#11238).
9248
9249 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9250
9251 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9252 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9253
9254 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9255
9256 * nsterm.m (constrainFrameRect): Always constrain when there is only
9257 one screen (Bug#10962).
9258
9259 2012-04-13 Ken Brown <kbrown@cornell.edu>
9260
9261 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9262
9263 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9264
9265 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9266
9267 2012-04-11 Daniel Colascione <dancol@dancol.org>
9268
9269 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9270 against is gone. It's better to use vfork now so that when Cygwin
9271 gains a new, working vfork, we use it automatically (bug#10398).
9272
9273 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9274
9275 * window.c (save_window_save): Obey window-point-insertion-type.
9276
9277 2012-04-11 Glenn Morris <rgm@gnu.org>
9278
9279 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9280
9281 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9282
9283 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9284
9285 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9286
9287 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9288 (force_quit_count): New var.
9289 (handle_interrupt): Use it.
9290
9291 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9292
9293 * w32.c (w32_delayed_load): Record the full path of the library
9294 being loaded (bug#10424).
9295
9296 2012-04-09 Glenn Morris <rgm@gnu.org>
9297
9298 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9299 not just in the obarray, before snarfing them. (Bug#11036)
9300
9301 * Makefile.in ($(leimdir)/leim-list.el):
9302 Pass EMACS rather than BUILT_EMACS.
9303
9304 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9305
9306 * process.c (make_process):
9307 * process.h: Add integer `gnutls_handshakes_tried' member to
9308 process struct.
9309
9310 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9311 Add convenience `GNUTLS_LOG2i' macro.
9312
9313 * gnutls.c (gnutls_log_function2i): Convenience log function.
9314 (emacs_gnutls_read): Use new log functions,
9315 `gnutls_handshakes_tried' process member, and
9316 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9317 attempts per process (connection).
9318
9319 2012-04-09 Chong Yidong <cyd@gnu.org>
9320
9321 * eval.c (Fuser_variable_p, user_variable_p_eh)
9322 (lisp_indirect_variable): Functions deleted.
9323 (Fdefvar): Caller changed.
9324
9325 * callint.c (Finteractive, Fcall_interactively):
9326 * minibuf.c (Fread_variable): Callers changed.
9327
9328 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9329
9330 * xdisp.c (set_cursor_from_row): If the display string appears in
9331 the buffer at position that is closer to point than the position
9332 after the display string, display the cursor on the first glyph of
9333 the display string. Fixes cursor display when a 'display' text
9334 property immediately follows invisible text. (Bug#11094)
9335
9336 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9337
9338 composite.c: use 'double' consistently
9339 * composite.c (get_composition_id): Use 'double' consistently
9340 instead of converting 'float' to 'double' and vice versa; this is
9341 easier to understand and avoids a GCC warning.
9342
9343 2012-04-09 Glenn Morris <rgm@gnu.org>
9344
9345 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9346 preparation for dumping it with emacs. (Bug#4789)
9347 (leimdir): New variable.
9348 ($(leimdir)/leim-list.el): New rule.
9349 (emacs$(EXEEXT)): Depend on leim-list.el.
9350
9351 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9352 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9353 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9354
9355 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9356
9357 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9358 proper alignment.
9359
9360 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9361
9362 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9363 Remove unused local variable.
9364
9365 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9366
9367 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9368 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9369 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9370 objects, as mark_maybe_pointer will catch them otherwise.
9371 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9372 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9373
9374 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9375
9376 Fix typo that broke non-Windows builds.
9377 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9378
9379 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9380
9381 Support building on MS-Windows with libxml2.
9382
9383 * makefile.w32-in (OBJ2): Add xml.$(O).
9384 (GLOBAL_SOURCES): Add xml.c.
9385 ($(BLD)/xml.$(O)): New dependency list.
9386
9387 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9388 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9389 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9390 [!WINDOWSNT]: New macros.
9391 (init_libxml2_functions, libxml2_loaded_p): New functions.
9392 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9393 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9394 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9395 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9396 linked in).
9397 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9398 Call init_libxml2_functions before calling libxml2 functions.
9399 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9400
9401 * emacs.c: Don't include libxml/parser.h.
9402 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9403 xmlCleanupParser directly.
9404
9405 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9406
9407 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9408
9409 * indent.c (Fvertical_motion): If there is a display string at
9410 point, use it.vpos to compute how many lines to backtrack after
9411 move_it_to point. (Bug#11133)
9412
9413 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9414
9415 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9416 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9417 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9418 macros related to unification of CJK characters. For the details,
9419 see the discussion following the message here:
9420 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9421
9422 2012-04-04 Chong Yidong <cyd@gnu.org>
9423
9424 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9425
9426 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9427
9428 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9429 instead of alloca. (Bug#11138)
9430
9431 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9432
9433 * w32menu.c (is_simple_dialog): Properly check lisp types.
9434 (Bug#11141)
9435
9436 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9437
9438 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9439 position we get to after a call to move_it_to fails the
9440 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9441 only if we wind up in a string from display property. (Bug#11063)
9442
9443 * window.c (Fdelete_other_windows_internal): Invalidate the row
9444 and column information about mouse highlight, so that redisplay
9445 restores it after reallocating the glyph matrices. (Bug#7464)
9446
9447 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9448 string comes from a `display' text property, use the buffer
9449 position of that property as if we actually saw that position in
9450 the row's glyphs.
9451 (move_it_by_lines): Remove the assertion that
9452 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9453 violated when there's a before-string at the beginning of a line.
9454 (Bug#11063)
9455
9456 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9457
9458 * xdisp.c (append_space_for_newline): If the default face was
9459 remapped, use the remapped face for the appended newline.
9460 (extend_face_to_end_of_line): Use the remapped default face for
9461 extending the face to the end of the line.
9462 (display_line): Call extend_face_to_end_of_line when the default
9463 face was remapped. (Bug#11068)
9464
9465 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9466
9467 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9468
9469 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9470
9471 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9472
9473 2012-03-27 Glenn Morris <rgm@gnu.org>
9474
9475 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9476 Doc fixes.
9477
9478 2012-03-26 Kenichi Handa <handa@m17n.org>
9479
9480 * dispextern.h (struct glyph): Fix previous change. Change the
9481 bit length of glyphless.ch to 25 (Bug#11082).
9482
9483 2012-03-26 Chong Yidong <cyd@gnu.org>
9484
9485 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9486 (command_loop_1): Use it; inhibit selection update for
9487 handle-select-window too (Bug#8996).
9488
9489 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9490
9491 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9492
9493 2012-03-25 Kenichi Handa <handa@m17n.org>
9494
9495 * dispextern.h (struct glyph): Change the bit length of
9496 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9497
9498 2012-03-24 Eli Zaretskii <eliz@gnu.org>
9499
9500 * s/ms-w32.h (tzname): Include time.h before redirecting to
9501 _tzname. Fixes the MSVC build. (Bug#9960)
9502
9503 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9504
9505 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9506 characters.
9507
9508 * xterm.c (XTread_socket): Only modify handling_signal if
9509 !SYNC_INPUT. (Bug#11080)
9510
9511 2012-03-23 Eli Zaretskii <eliz@gnu.org>
9512
9513 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9514 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9515 when fetching a multibyte character consumes more bytes than
9516 CHAR_BYTES returns, due to unification of CJK characters in
9517 string_char. (Bug#11073)
9518
9519 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9520
9521 * process.c (wait_reading_process_output): Handle pty disconnect
9522 by refraining from sending oneself a SIGCHLD (bug#10933).
9523
9524 2012-03-22 Chong Yidong <cyd@gnu.org>
9525
9526 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9527
9528 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9529 Mark string as coming from a prefix property.
9530 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9531 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9532
9533 2012-03-21 Chong Yidong <cyd@gnu.org>
9534
9535 * xfaces.c (Vface_remapping_alist): Doc fix.
9536
9537 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9538
9539 * w32proc.c (Fw32_set_console_codepage)
9540 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9541 Doc fixes.
9542
9543 2012-03-20 Chong Yidong <cyd@gnu.org>
9544
9545 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9546 to reflect default non-nil value of redisplay-dont-pause.
9547
9548 2012-03-19 Kenichi Handa <handa@m17n.org>
9549
9550 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9551 it fit in a valid range (Bug#11003).
9552
9553 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9554
9555 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9556 that is not from display property, accept the row as a "cursor
9557 row" if one of the string's character has a non-nil `cursor'
9558 property. Fixes cursor positioning when there are newlines in
9559 overlay strings, e.g. in icomplete.el. (Bug#11035)
9560
9561 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9562
9563 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9564
9565 2012-03-12 Chong Yidong <cyd@gnu.org>
9566
9567 * eval.c (inhibit_lisp_code): Rename from
9568 inhibit_window_configuration_change_hook; move from window.c.
9569
9570 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9571 * window.c (run_window_configuration_change_hook)
9572 (syms_of_window): Callers changed.
9573
9574 2012-03-11 Chong Yidong <cyd@gnu.org>
9575
9576 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9577
9578 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9579
9580 2012-03-10 Chong Yidong <cyd@gnu.org>
9581
9582 * frame.c (other_visible_frames): Don't assume the selected frame
9583 is visible (Bug#10955).
9584
9585 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9586
9587 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9588
9589 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9590
9591 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9592 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9593 zero (Bug#10954).
9594
9595 2012-03-03 Glenn Morris <rgm@gnu.org>
9596
9597 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9598
9599 2012-03-02 Eli Zaretskii <eliz@gnu.org>
9600
9601 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9602 position past the first glyph_row that ends at ZV. (Bug#10902)
9603 (redisplay_window, next_element_from_string): Fix typos in
9604 comments.
9605 (redisplay_window): Pass to move_it_vertically the margin in
9606 pixels, not in screen lines.
9607
9608 2012-03-02 Glenn Morris <rgm@gnu.org>
9609
9610 * buffer.c (buffer-list-update-hook): Doc fix.
9611
9612 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9613
9614 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9615 push_it before setting up the iterator for the first overlay
9616 string, even if we have an empty string loaded.
9617 (next_overlay_string): If there's an empty string on the iterator
9618 stack, pop the stack. (Bug#10903)
9619
9620 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9621
9622 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9623 Suggested by Stefan Monnier in
9624 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9625 * alloc.c (widen_to_Lisp_Object): New static function.
9626 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9627 and widening them to Lisp_Objects. This would work even if
9628 USE_LSB_TAG is defined and wide integers are used, which might
9629 happen in a future version of Emacs.
9630
9631 2012-02-25 Chong Yidong <cyd@gnu.org>
9632
9633 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9634 Doc fix.
9635
9636 * xselect.c (Fx_selection_exists_p): Doc fix.
9637 (x_clipboard_manager_save_all): Print an informative message
9638 before saving to clipboard manager.
9639
9640 2012-02-24 Chong Yidong <cyd@gnu.org>
9641
9642 * keyboard.c (process_special_events): Handle all X selection
9643 requests in kbd_buffer, not just the next one (Bug#8869).
9644
9645 2012-02-23 Chong Yidong <cyd@gnu.org>
9646
9647 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9648 call when setting menu-bar-lines and tool-bar-lines parameters.
9649 (unwind_create_frame_1): New helper function.
9650
9651 * window.c (inhibit_window_configuration_change_hook): New var.
9652 (run_window_configuration_change_hook): Obey it.
9653 (syms_of_window): Initialize it.
9654
9655 2012-02-22 Chong Yidong <cyd@gnu.org>
9656
9657 * xterm.c (x_draw_image_relief): Add missing type check for
9658 Vtool_bar_button_margin (Bug#10743).
9659
9660 2012-02-21 Chong Yidong <cyd@gnu.org>
9661
9662 * fileio.c (Vfile_name_handler_alist): Doc fix.
9663
9664 * buffer.c (Fget_file_buffer): Protect against invalid file
9665 handler return value.
9666
9667 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9668
9669 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9670 when computing $valmask.
9671
9672 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9673 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9674 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9675 It's useless in that case, and it can cause problems on hosts
9676 that allocate halves of EMACS_INT values separately.
9677 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9678 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9679 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9680 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9681 it avoids undefined behavior on hosts where shifting right by more
9682 than the word width has undefined behavior.
9683
9684 2012-02-19 Chong Yidong <cyd@gnu.org>
9685
9686 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9687 (Funhandled_file_name_directory, Ffile_name_as_directory)
9688 (Fdirectory_file_name, Fexpand_file_name)
9689 (Fsubstitute_in_file_name): Protect against invalid file handler
9690 return values (Bug#10845).
9691
9692 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9693
9694 * .gdbinit (pitx): Fix incorrect references to fields of the
9695 iterator stack.
9696
9697 2012-02-17 Chong Yidong <cyd@gnu.org>
9698
9699 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9700
9701 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9702
9703 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9704 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9705
9706 2012-02-15 Chong Yidong <cyd@gnu.org>
9707
9708 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9709 marked as special. Also, starting docstrings with * is obsolete.
9710
9711 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9712
9713 * gnutls.c (emacs_gnutls_write): Fix last change.
9714
9715 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9716
9717 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9718 send_process.
9719
9720 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9721
9722 * keymap.c (Fsingle_key_description): Handle char ranges.
9723
9724 2012-02-12 Chong Yidong <cyd@gnu.org>
9725
9726 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9727 as that creates a dangerous corner case.
9728
9729 * window.c (Fdelete_window_internal): Invalidate the mouse
9730 highlight (Bug#9904).
9731
9732 2012-02-12 Glenn Morris <rgm@gnu.org>
9733
9734 * xselect.c (Fx_own_selection_internal)
9735 (Fx_get_selection_internal, Fx_disown_selection_internal)
9736 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9737 * nsselect.m (Fx_own_selection_internal)
9738 (Fx_disown_selection_internal, Fx_selection_exists_p)
9739 (Fx_selection_owner_p, Fx_get_selection_internal):
9740 Sync docs and argument specs with the xselect.c versions.
9741
9742 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9743
9744 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9745
9746 2012-02-11 Eli Zaretskii <eliz@gnu.org>
9747
9748 * w32select.c (Fx_selection_exists_p): Sync doc string and
9749 argument list with xselect.c. (Bug#10783)
9750
9751 * w16select.c (Fx_selection_exists_p): Sync doc string and
9752 argument list with xselect.c. (Bug#10783)
9753
9754 2012-02-10 Glenn Morris <rgm@gnu.org>
9755
9756 * fns.c (Fsecure_hash): Doc fix.
9757
9758 2012-02-09 Kenichi Handa <handa@m17n.org>
9759
9760 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9761
9762 2012-02-07 Chong Yidong <cyd@gnu.org>
9763
9764 * buffer.c (Fbuffer_local_variables)
9765 (buffer_lisp_local_variables): Handle unbound vars correctly;
9766 don't let Qunbound leak into Lisp.
9767
9768 2012-02-07 Glenn Morris <rgm@gnu.org>
9769
9770 * image.c (Fimagemagick_types): Doc fix.
9771
9772 * image.c (imagemagick-render-type): Change it from a lisp object
9773 to an integer. Move the doc here from the lisp manual.
9774 Treat all values not equal to 0 the same.
9775
9776 2012-02-06 Chong Yidong <cyd@gnu.org>
9777
9778 * doc.c (store_function_docstring): Avoid applying docstring of
9779 alias to base function (Bug#2603).
9780
9781 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9782
9783 * .gdbinit (pp1, pv1): Remove redundant defines.
9784 (pr): Use pp.
9785
9786 2012-02-04 Chong Yidong <cyd@gnu.org>
9787
9788 * nsterm.m: Declare a global (Bug#10694).
9789
9790 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9791
9792 * w32.c (get_emacs_configuration_options):
9793 Include --enable-checking, if specified, in the return value.
9794
9795 2012-02-04 Martin Rudalics <rudalics@gmx.at>
9796
9797 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9798 after rounding frame sizes. (Bug#9723)
9799
9800 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9801
9802 * keyboard.c (adjust_point_for_property): Don't position point
9803 before BEGV. (Bug#10696)
9804
9805 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9806
9807 Handle overflow when computing char display width (Bug#9496).
9808 * character.c (char_width): Return EMACS_INT, not int.
9809 (char_width, c_string_width): Check for overflow when
9810 computing the width; this is possible now that individual
9811 characters can have unbounded width. Problem introduced
9812 by merge from Emacs 23 on 2012-01-19.
9813
9814 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
9815
9816 * dbusbind.c (Fdbus_register_method): Mention the return value
9817 :ignore in the docstring.
9818
9819 2012-02-02 Glenn Morris <rgm@gnu.org>
9820
9821 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9822
9823 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9824 Unconditionally set to t. (Bug#10673)
9825 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9826 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9827 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9828
9829 2012-02-02 Kenichi Handa <handa@m17n.org>
9830
9831 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9832 0, do not call append_composite_glyph.
9833
9834 2012-02-02 Kenichi Handa <handa@m17n.org>
9835
9836 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9837 NULL (Bug#6988).
9838 (x_produce_glyphs): If the component of a composition is a null
9839 string, set it->pixel_width to 1 to avoid zero-width glyph.
9840
9841 2012-02-01 Eli Zaretskii <eliz@gnu.org>
9842
9843 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9844 first 2 arguments are identical. This makes inserting large
9845 output from a subprocess an order of magnitude faster on
9846 MS-Windows, where all sbrk'ed memory is always contiguous.
9847
9848 2012-01-31 Glenn Morris <rgm@gnu.org>
9849
9850 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9851 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9852 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9853
9854 2012-01-29 Glenn Morris <rgm@gnu.org>
9855
9856 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9857
9858 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9859
9860 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9861
9862 2012-01-28 Chong Yidong <cyd@gnu.org>
9863
9864 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9865
9866 2012-01-26 Chong Yidong <cyd@gnu.org>
9867
9868 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9869
9870 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9871 repeat counts (Bug#10507).
9872
9873 2012-01-26 Glenn Morris <rgm@gnu.org>
9874
9875 * lread.c (syms_of_lread): Doc fix.
9876
9877 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9878
9879 * coding.c (encode_designation_at_bol): Change return value to
9880 EMACS_INT.
9881
9882 2012-01-25 Chong Yidong <cyd@gnu.org>
9883
9884 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9885
9886 2012-01-21 Chong Yidong <cyd@gnu.org>
9887
9888 * floatfns.c (Fcopysign): Make the second argument non-optional,
9889 since nil is not allowed anyway.
9890
9891 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9892
9893 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9894 (send_process): Likewise.
9895
9896 2012-01-19 Martin Rudalics <rudalics@gmx.at>
9897
9898 * window.c (save_window_save, Fcurrent_window_configuration)
9899 (Vwindow_persistent_parameters): Do not use Qstate.
9900 Rewrite doc-strings.
9901
9902 2012-01-19 Kenichi Handa <handa@m17n.org>
9903
9904 * character.c (char_width): New function.
9905 (Fchar_width, c_string_width, lisp_string_width):
9906 Use char_width (Bug#9496).
9907
9908 2012-01-16 Martin Rudalics <rudalics@gmx.at>
9909
9910 * window.c (Vwindow_persistent_parameters): New variable.
9911 (Fset_window_configuration, save_window_save): Handle persistent
9912 window parameters.
9913
9914 2012-01-14 Eli Zaretskii <eliz@gnu.org>
9915
9916 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9917 thrashing the stack of the thread. (Bug#9087)
9918
9919 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9920
9921 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9922
9923 2012-01-11 Eli Zaretskii <eliz@gnu.org>
9924
9925 * xdisp.c (rows_from_pos_range): Handle the case where the
9926 highlight ends on a newline. (Bug#10464)
9927 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9928 he end column for display of highlight that ends on a newline
9929 before a R2L line.
9930
9931 2012-01-11 Glenn Morris <rgm@gnu.org>
9932
9933 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9934 from load-path also when installation-directory is nil. (Bug#10208)
9935
9936 2012-01-10 Glenn Morris <rgm@gnu.org>
9937
9938 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9939
9940 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9941 Update template values to be closer to their typical values these days.
9942
9943 2012-01-09 Eli Zaretskii <eliz@gnu.org>
9944
9945 * xdisp.c (rows_from_pos_range): Accept additional argument
9946 DISP_STRING, and accept any glyph in a row whose object is that
9947 string as eligible for mouse highlight. Fixes mouse highlight of
9948 display strings from overlays. (Bug#10464)
9949
9950 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
9951
9952 emacs: fix an auto-save permissions race condition (Bug#10400)
9953 * fileio.c (auto_saving_dir_umask): New static var.
9954 (Fmake_directory_internal): Use it.
9955 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9956 creating the directory. The old code temporarily assigns
9957 too-generous permissions to the directory.
9958 (do_auto_save_eh): Clear it.
9959 (Fdo_auto_save): Catch all errors, not just file errors, so
9960 that the var is always cleared.
9961
9962 2012-01-07 Eli Zaretskii <eliz@gnu.org>
9963
9964 * search.c (scan_buffer): Pass character positions to
9965 know_region_cache, not byte positions. (Bug#6540)
9966
9967 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
9968
9969 * w32.c (sys_rename): Report EXDEV when rename of a directory
9970 fails because the target is on another logical disk. (Bug#10284)
9971
9972 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9973
9974 * xterm.c (x_embed_request_focus): New function.
9975
9976 * xterm.h: Add prototype.
9977
9978 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9979
9980 2012-01-05 Glenn Morris <rgm@gnu.org>
9981
9982 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9983
9984 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9985
9986 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9987 Load gnutls_transport_set_lowat only if GnuTLS version is below
9988 2.11.1.
9989 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9990 GnuTLS versions below 2.11.1.
9991
9992 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9993
9994 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9995 to the doc string advising against its use for altering the way
9996 windows are scrolled.
9997
9998 2011-12-28 Kenichi Handa <handa@m17n.org>
9999
10000 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10001 coding-system ASCII compatible only when it does not produce BOM
10002 on encoding (Bug#10383).
10003
10004 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10005
10006 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10007 can scroll.
10008 (create_and_show_popup_menu): Always use menu_position_func for
10009 Gtk3 (Bug#10361).
10010
10011 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10012
10013 * callint.c (Fcall_interactively): Don't truncate prompt string.
10014
10015 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10016
10017 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10018 property that ends at ZV, so that the bidi iteration could be
10019 resumed from there (after widening). (Bug#10360)
10020
10021 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10022
10023 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10024
10025 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10026
10027 * nsterm.m (x_free_frame_resources):
10028 Release f->output_data.ns->miniimage.
10029 (ns_index_color): Fix indentation. Do not retain
10030 color_table->colors[i].
10031
10032 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10033 before returning.
10034
10035 * nsfns.m (x_set_background_color): Assign return value from
10036 ns_index_color to face-background instead of NSColor*.
10037 (ns_implicitly_set_icon_type): Fix indentation.
10038 Change assignment in for loop to comparison.
10039
10040 * emacs.c (ns_pool): New variable.
10041 (main): Assign ns_pool.
10042 (Fkill_emacs): Call ns_release_autorelease_pool.
10043
10044 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10045 autorelease fdesc, release fdAttrs and tdict.
10046 (ns_get_covering_families): Release charset.
10047 (ns_findfonts): Release NSFontDescriptor created with new.
10048 (ns_uni_to_glyphs): Fix indentation.
10049 (setString): Release attrStr before assigning new value.
10050
10051 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10052
10053 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10054 and NS_IMPL_COCOA.
10055 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10056 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10057
10058 2011-12-18 David Reitter <reitter@cmu.edu>
10059
10060 * nsterm.m (ns_term_init): Subscribe for notifications
10061 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10062 to method trackingNotification in EmacsMenu.
10063
10064 * nsmenu.m (trackingMenu): New variable.
10065 (trackingNotification): New method (from Aquamacs).
10066 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10067 from Aquamacs (Bug#7030).
10068
10069 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10070
10071 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10072 (symbol_to_nsstring): Fix indentation.
10073 (ns_symbol_to_pb): New function.
10074 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10075 (Fns_rotate_cut_buffers_internal): Remove.
10076 (Fns_store_selection_internal): Rename from
10077 Fns_store_cut_buffer_internal.
10078 (ns_get_foreign_selection, Fx_own_selection_internal)
10079 (Fx_disown_selection_internal, Fx_selection_exists_p)
10080 (Fns_get_selection_internal, Fns_store_selection_internal):
10081 Use ns_symbol_to_pb and check if return value is nil.
10082 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10083 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10084 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10085 renamed to Sns_store_selection_internal.
10086 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10087 and remove this function.
10088 (ns_handle_selection_clear): Remove, never used.
10089 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10090 here.
10091
10092 2011-12-17 Ken Brown <kbrown@cornell.edu>
10093
10094 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10095 GID is unknown (Bug#10257).
10096
10097 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10098
10099 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10100 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10101 which caused a build failure on GNU/Linux IA-64. This problem was
10102 introduced by my 2011-10-07 patch.
10103
10104 2011-12-15 Juri Linkov <juri@jurta.org>
10105
10106 * image.c (imagemagick_error): New function. (Bug#10112)
10107 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10108 Use `imagemagick_error' where ImageMagick functions return
10109 `MagickFalse'.
10110 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10111 proper order.
10112
10113 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10114
10115 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10116 fill background (Bug#8992).
10117
10118 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10119
10120 * window.c (Vwindow_combination_resize)
10121 (Vwindow_combination_limit): Use t instead of non-nil in
10122 doc-strings.
10123 (Vrecenter_redisplay): Add first sentence of doc-string on
10124 separate line.
10125 (Frecenter): Fix doc-string typo.
10126
10127 2011-12-11 Kenichi Handa <handa@m17n.org>
10128
10129 * coding.c (Funencodable_char_position): Pay attention to the
10130 buffer text relocation (Bug#9389).
10131
10132 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10133
10134 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10135 gtk_init (Bug#10100).
10136
10137 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10138
10139 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10140 IT->string is nil. (Bug#10263)
10141
10142 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10143
10144 * nsterm.h (x_free_frame_resources): Declare.
10145
10146 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10147 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10148
10149 * nsterm.h (ns_get_defaults_value): Declare.
10150
10151 * nsterm.m (ns_default): Call ns_get_defaults_value.
10152
10153 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10154
10155 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10156 (Bug#10170)
10157
10158 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10159
10160 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10161 that where the value of an _OBJC_* symbol points to is in the .bss
10162 section (Bug#10240).
10163
10164 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10165
10166 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10167 after the loop to call ccl_driver at least once (Bug#8619).
10168
10169 2011-12-08 Kenichi Handa <handa@m17n.org>
10170
10171 * ftfont.c (get_adstyle_property): Fix previous change
10172 (Bug#10233).
10173
10174 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10175
10176 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10177 dirs from the default value of EMACSLOADPATH (bug#10208).
10178
10179 2011-12-07 Glenn Morris <rgm@gnu.org>
10180
10181 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10182 installation and source directories as well. (Bug#10208)
10183
10184 2011-12-06 Chong Yidong <cyd@gnu.org>
10185
10186 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10187
10188 2011-12-06 Glenn Morris <rgm@gnu.org>
10189
10190 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10191 as an error, not just -1. (Bug#10217)
10192
10193 2011-12-05 Chong Yidong <cyd@gnu.org>
10194
10195 * keyboard.c (process_special_events): New function.
10196 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10197
10198 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10199
10200 * coding.c (encode_designation_at_bol): Don't use uninitialized
10201 local variable (Bug#9318).
10202
10203 2011-12-05 Kenichi Handa <handa@m17n.org>
10204
10205 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10206 return Qnil (Bug#8046, Bug#10193).
10207
10208 2011-12-05 Kenichi Handa <handa@m17n.org>
10209
10210 * coding.c (encode_designation_at_bol): New args charbuf_end and
10211 dst. Return the number of produced bytes. Callers changed.
10212 (coding_set_source): Return how many bytes coding->source was
10213 relocated.
10214 (coding_set_destination): Return how many bytes
10215 coding->destination was relocated.
10216 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10217 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10218
10219 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10220
10221 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10222 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10223 macro (Bug#9318).
10224
10225 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10226
10227 The following changes are to fix Bug#9318.
10228
10229 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10230 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10231 (encode_coding_iso_2022, encode_coding_sjis)
10232 (encode_coding_big5, encode_coding_charset): Use the above macros.
10233
10234 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10235
10236 * lisp.h (process_quit_flag): Fix external declaration.
10237
10238 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10239
10240 Don't macro-inline non-performance-critical code.
10241 * eval.c (process_quit_flag): New function.
10242 * lisp.h (QUIT): Use it.
10243
10244 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10245
10246 * nsfns.m (get_geometry_from_preferences): New function.
10247 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10248
10249 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10250
10251 * emacs.c (Qkill_emacs): Define.
10252 (syms_of_emacs): Initialize it.
10253 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10254 Qquit_flag to `kill-emacs' instead.
10255 (quit_throw_to_read_char): Add parameter `from_signal'.
10256 All callers changed. Call Fkill_emacs if requested and safe.
10257 * lisp.h (QUIT): Call Fkill_emacs if requested.
10258
10259 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10260
10261 * widget.c (update_wm_hints): Return if wmshell is null.
10262 (widget_update_wm_size_hints): New function.
10263
10264 * widget.h (widget_update_wm_size_hints): Declare.
10265
10266 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10267 widget_update_wm_size_hints (Bug#10104).
10268
10269 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10270
10271 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10272 before a newline, prepare the bidi iterator for consuming the
10273 newline, and keep the current paragraph direction. (Bug#10183)
10274 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10275
10276 2011-12-02 Juri Linkov <juri@jurta.org>
10277
10278 * search.c (Fword_search_regexp): New Lisp function created from
10279 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10280 (Fword_search_backward, Fword_search_forward)
10281 (Fword_search_backward_lax, Fword_search_forward_lax):
10282 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10283 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10284
10285 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10286
10287 * fileio.c (Finsert_file_contents): Move after-change-function call
10288 to before the "handled:" label, since all "goto handled" appear in
10289 cases where the *-change-functions have already been properly called
10290 (bug#10117).
10291
10292 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10293
10294 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10295 waiting for input. (Bug#10169)
10296
10297 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10298
10299 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10300 verifies glyph row's hash code--we have just reallocated the
10301 glyphs, so their contents can be complete garbage. (Bug#10164)
10302
10303 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10304
10305 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10306
10307 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10308
10309 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10310 attributes are tested _before_ calling verify_row_hash, to protect
10311 against GCC re-ordering of the tests. (Bug#10164)
10312
10313 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10314
10315 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10316
10317 * xterm.c (handle_one_xevent): Only set async_visible and friends
10318 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10319 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10320 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10321
10322 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10323
10324 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10325 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10326 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10327 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10328 All uses changed to use GCPRO1 etc.
10329 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10330 Revert to old implementation (i.e., before 2011-03-11).
10331
10332 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10333
10334 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10335 of scroll runs so as to avoid assigning disabled bogus rows and
10336 unnecessary graphics copy operations.
10337
10338 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10339
10340 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10341 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10342 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10343 (malloc, free, realloc, calloc): Redirect to e_* only when
10344 compiling Emacs.
10345
10346 * lisp.h (GCTYPEBITS): Move before first use.
10347 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10348 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10349 this macro definition.
10350
10351 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10352 _MSC_VER.
10353
10354 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10355
10356 * gtkutil.c (xg_create_frame_widgets):
10357 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10358 present with Gtk+ 2.0.
10359
10360 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10361
10362 * fileio.c (Finsert_file_contents): Undo previous change; see
10363 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10364
10365 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10366
10367 Rename locals to avoid shadowing.
10368 * fileio.c (Finsert_file_contents):
10369 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10370 * process.c (wait_reading_process_output):
10371 Rename inner 'proc' to 'p' to avoid shadowing.
10372 Indent for consistency with usual Emacs style.
10373
10374 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10375
10376 * xdisp.c (redisplay_window): If cursor row is not fully visible
10377 after recentering, and scroll-conservatively is set to a large
10378 number, scroll window by a few more lines to make the cursor fully
10379 visible and out of scroll-margin. (Bug#10105)
10380 (start_display): Don't move to the next line if the display should
10381 start at a newline that is part of a display vector or an overlay
10382 string. (Bug#10119)
10383
10384 2011-11-24 Juri Linkov <juri@jurta.org>
10385
10386 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10387 after the `MagickPingImage' call. (Bug#10112)
10388
10389 2011-11-23 Chong Yidong <cyd@gnu.org>
10390
10391 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10392
10393 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10394
10395 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10396 making another buffer current. (Bug#10114)
10397
10398 2011-11-23 Glenn Morris <rgm@gnu.org>
10399
10400 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10401
10402 2011-11-23 Chong Yidong <cyd@gnu.org>
10403
10404 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10405 using it (Bug#5984).
10406
10407 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10408
10409 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10410 and header-lines, as they don't have one computed for them.
10411 (Bug#10098)
10412
10413 * .gdbinit (prow): Make displayed values more self-explaining.
10414 Add row's hash code.
10415
10416 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10417
10418 * process.c (wait_reading_process_output): Fix asynchrounous
10419 GnuTLS socket handling on some versions of the GnuTLS library.
10420 (wait_reading_process_output): Add comment and URL.
10421
10422 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10423
10424 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10425
10426 2011-11-21 Chong Yidong <cyd@gnu.org>
10427
10428 * window.c (Fnext_window, Fprevious_window): Doc fix.
10429
10430 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10431
10432 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10433
10434 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10435
10436 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10437
10438 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10439
10440 * window.c (Fset_window_combination_limit): Rename argument
10441 STATUS to LIMIT.
10442 (Vwindow_combination_limit): Remove "status" from doc-string.
10443
10444 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10445
10446 * m/ibms390.h: Remove.
10447 * m/ibms390x.h: Don't include "ibms390.h".
10448
10449 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10450
10451 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10452 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10453
10454 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10455
10456 * casetab.c (Fset_case_table):
10457 * charset.c (Fcharset_after): Fix typos.
10458
10459 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10460
10461 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10462 Otherwise, valgrind does not work on some platforms.
10463 Problem reported by Andreas Schwab in
10464 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10465 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10466 is set, removing the need for VIRT_ADDRESS_VARIES.
10467 (PURE_P): Use a more-efficient implementation that needs just one
10468 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10469 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10470 to 4 (xorl, subq, cmpq, setbe).
10471 * alloc.c (pure): Always extern now, since that's the
10472 VIRT_ADDR_VARIES behavior.
10473 (PURE_POINTER_P): Use a single comparison, not two, for
10474 consistency with the new puresize.h.
10475 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10476 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10477 Remove VIRT_ADDR_VARIES no longer needed.
10478
10479 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10480
10481 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10482 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10483 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10484 behave as if the cursor position were at the window margin.
10485
10486 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10487 and the cursor position is out of bounds, behave as if the cursor
10488 position were at the window margin. (Bug#10075)
10489
10490 2011-11-18 Chong Yidong <cyd@gnu.org>
10491
10492 * window.c (Fwindow_combination_limit): Make first argument
10493 non-optional, since it is meaningless for live windows like the
10494 selected window.
10495
10496 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10497
10498 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10499
10500 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10501
10502 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10503 (graft_intervals_into_buffer): Simplify.
10504
10505 2011-11-18 Eli Zaretskii <eliz@gnu.org>
10506
10507 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10508 hash values of the two rows.
10509 (copy_row_except_pointers): Preserve the used[] arrays and the
10510 hash values of the two rows. (Bug#10035)
10511 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10512
10513 * xdisp.c (row_hash): New function, body extracted from
10514 compute_line_metrics.
10515 (compute_line_metrics): Call row_hash, instead of computing the
10516 hash code inline.
10517
10518 * dispnew.c (verify_row_hash): Call row_hash for computing the
10519 hash code of a row, instead of duplicating code from xdisp.c.
10520
10521 * dispextern.h (row_hash): Add prototype.
10522
10523 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10524
10525 * frame.c (delete_frame): Don't delete the terminal when the last
10526 X frame is closed if emacs is built with GTK toolkit.
10527
10528 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
10529
10530 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10531
10532 2011-11-17 Martin Rudalics <rudalics@gmx.at>
10533
10534 * window.c (Vwindow_splits): Rename to
10535 Vwindow_combination_resize. Suggested by Juri Linkov.
10536 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10537 of Vwindow_splits.
10538
10539 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10540
10541 * nsfns.m (Fns_font_name):
10542 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10543
10544 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10545
10546 * window.h (window): Rename slot "nest" to "combination_limit".
10547 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10548 (Fset_window_nest): Rename to Fset_window_combination_limit.
10549 (Vwindow_nest): Rename to Vwindow_combination_limit.
10550 (recombine_windows, make_parent_window, make_window)
10551 (Fsplit_window_internal, saved_window)
10552 (Fset_window_configuration, save_window_save): Rename all
10553 occurrences of window_nest to window_combination_limit.
10554
10555 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10556
10557 * image.c (imagemagick_load_image): Fix typo.
10558
10559 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10560
10561 * xdisp.c (display_line): Move the call to
10562 highlight_trailing_whitespace before the call to
10563 compute_line_metrics, since the latter needs to see the final
10564 faces of all the glyphs to compute ROW's hash value.
10565 Fixes assertion violations in row_equal_p. (Bug#10035)
10566
10567 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10568
10569 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10570 just return (bug#10044).
10571
10572 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10573
10574 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10575 with user-defined heap size. Bump the default size of the temacs
10576 heap to 27MB, to avoid memory warning when running temacs.
10577 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10578
10579 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10580 current_matrix and desired_matrix. (Bug#9990)
10581 (verify_row_hash) [XASSERTS]: New function.
10582 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10583 that the hash value of glyph rows is correct.
10584
10585 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10586
10587 * window.h (window): Remove splits slot.
10588 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10589 (Fdelete_other_windows_internal, make_parent_window)
10590 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10591 (Fset_window_configuration, save_window_save): Don't deal with
10592 split status of windows.
10593 (saved_window): Remove splits slot.
10594 (Vwindow_splits): Rewrite doc-string.
10595
10596 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10597
10598 * xfns.c (unwind_create_frame):
10599 * nsfns.m (unwind_create_frame):
10600 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10601 Vframe_list (Bug#9999).
10602
10603 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10604
10605 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10606
10607 2011-11-11 Kenichi Handa <handa@m17n.org>
10608
10609 * callproc.c (Fcall_process): Set the member dst_multibyte of
10610 process_coding.
10611
10612 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10613
10614 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10615 avoid a crash (bug#9496).
10616
10617 2011-11-09 Chong Yidong <cyd@gnu.org>
10618
10619 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10620 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10621
10622 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10623
10624 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10625
10626 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10627
10628 Avoid some portability problems by eschewing 'extern inline' functions.
10629 The trivial performance wins aren't worth the portability hassles; see
10630 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10631 et seq.
10632 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10633 (window_box_width, window_box_left, window_box_left_offset)
10634 (window_box_right, window_box_right_offset): Undo previous change,
10635 by removing the "extern"s.
10636 * intervals.c (adjust_intervals_for_insertion)
10637 (adjust_intervals_for_deletion): Undo previous change,
10638 making these static again.
10639 (offset_intervals, temp_set_point_both, temp_set_point)
10640 (copy_intervals_to_string): No longer inline.
10641 * xdisp.c (window_text_bottom_y, window_box_width)
10642 (window_box_height, window_box_left_offset)
10643 (window_box_right_offset, window_box_left, window_box_right)
10644 (window_box): No longer inline.
10645
10646 2011-11-08 Chong Yidong <cyd@gnu.org>
10647
10648 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10649 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10650 Signal an error if not a live window.
10651 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10652 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10653
10654 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
10655
10656 * lisp.h (syms_of_abbrev): Remove declaration.
10657 Reported by CHENG Gao <chenggao@royau.me>.
10658
10659 2011-11-07 Eli Zaretskii <eliz@gnu.org>
10660
10661 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10662 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10663 of temacs in GUI mode.
10664
10665 2011-11-07 Martin Rudalics <rudalics@gmx.at>
10666
10667 * window.h: Declare delete_all_child_windows instead of
10668 delete_all_subwindows.
10669 * window.c (Fwindow_nest, Fset_window_nest)
10670 (Fset_window_new_total, Fset_window_new_normal)
10671 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10672 (delete_all_subwindows): Rename to delete_all_child_windows.
10673 (Fdelete_other_windows_internal, Fset_window_configuration):
10674 Call delete_all_child_windows instead of delete_all_subwindows.
10675 * frame.c (delete_frame): Call delete_all_child_windows instead
10676 of delete_all_subwindows.
10677
10678 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10679
10680 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10681 This is also needed for porting to any host where GC_MARK_STACK is
10682 not GC_MAKE_GCPROS_NOOPS.
10683 (which_symbols): Use it.
10684
10685 2011-11-07 Kenichi Handa <handa@m17n.org>
10686
10687 * coding.c (coding_set_destination): Check coding->src_pos only
10688 when coding->src_object is a buffer (bug#9910).
10689
10690 * process.c (send_process): Set the member src_multibyte of coding
10691 to 0 (bug#9911) when sending a unibyte text.
10692
10693 * callproc.c (Fcall_process): Set the member src_multibyte of
10694 process_coding to 0 (bug#9912).
10695
10696 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10697
10698 * xmenu.c (cleanup_widget_value_tree): New function.
10699 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10700 calling free_menubar_widget_value_tree directly (Bug#9830).
10701
10702 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10703
10704 Fix some portability problems with 'inline'.
10705 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10706 (window_box_width, window_box_left, window_box_left_offset)
10707 (window_box_right, window_box_right_offset): Declare extern.
10708 Otherwise, these inline functions do not conform to C99 and
10709 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10710 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10711 * intervals.c (adjust_intervals_for_insertion)
10712 (adjust_intervals_for_deletion): Now extern, because otherwise the
10713 extern inline functions 'offset_intervals' couldn't refer to it.
10714 (static_offset_intervals): Remove.
10715 (offset_intervals): Rewrite using the old contents of
10716 static_offset_intervals. The old version didn't conform to C99
10717 because an extern inline function contained a reference to an
10718 identifier with static linkage.
10719
10720 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10721
10722 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10723 GC.
10724
10725 2011-11-06 Eli Zaretskii <eliz@gnu.org>
10726
10727 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10728 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10729 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10730 return Qleft_to_right.
10731
10732 2011-11-06 Chong Yidong <cyd@gnu.org>
10733
10734 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10735 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10736 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10737 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10738 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10739 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10740 (Fwindow_vscroll): Doc fix.
10741 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10742 argument, since it makes no sense to pass a live window and for
10743 consistency with window-child.
10744
10745 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10746
10747 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10748 support MSVC.
10749
10750 2011-11-05 Jason Rumney <jasonr@gnu.org>
10751
10752 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10753 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10754 fonts (Bug#6029).
10755 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10756 bitwise arithmetic preventing use of unicode-sip and non-truetype
10757 opentype fonts.
10758
10759 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10760
10761 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10762 "emacs"-only part.
10763
10764 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10765 initialization code to keep similarity to xfns.c after changes
10766 from 2011-11-05.
10767
10768 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10769
10770 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10771 (unwind_create_frame): New function (Bug#9943).
10772 (Fx_create_frame): Restructure code to be more similar to the one in
10773 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10774 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10775 Move terminal->reference_count++ just before making the frame official
10776 (Bug#9943).
10777
10778 * nsterm.m (x_free_frame_resources): New function.
10779 (x_destroy_window): Move code to x_free_frame_resources.
10780
10781 * xfns.c (unwind_create_frame): Fix comment.
10782 (Fx_create_frame, x_create_tip_frame):
10783 Move terminal->reference_count++ just before making the frame
10784 official. Move initialization of image_cache_refcount and
10785 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10786
10787 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10788
10789 Support MSVC build with newer versions of Visual Studio.
10790 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10791 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10792 nt/gmake.defs.
10793
10794 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10795 which are not supported by MSVC.
10796 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10797 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10798 bitfields.
10799 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10800 types in bitfields.
10801 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10802
10803 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10804
10805 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
10806
10807 Support MSVC build with newer versions of Visual Studio.
10808 * w32.c: Don't include w32api.h for MSVC.
10809 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10810
10811 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10812 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10813 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10814 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10815 e_* cousins.
10816 (alloca) [_MSC_VER]: Define to _alloca.
10817
10818 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10819
10820 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10821
10822 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10823
10824 * xdisp.c (note_mouse_highlight): If either of
10825 previous/next-single-property-change returns nil, treat that as
10826 the beginning or the end of the buffer. (Bug#9955)
10827
10828 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10829
10830 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10831 label is not null (Bug#9951).
10832 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10833 may be NULL.
10834
10835 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10836
10837 * window.c (Fwindow_body_size): Mention in the doc string that the
10838 return value is in frame's canonical units. (Bug#9949)
10839
10840 2011-11-03 Eli Zaretskii <eliz@gnu.org>
10841
10842 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10843
10844 * w32fns.c (unwind_create_frame): If needed, free the glyph
10845 matrices of the partially constructed frame. (Bug#9943)
10846 * xfns.c (unwind_create_frame): Likewise.
10847
10848 2011-11-01 Eli Zaretskii <eliz@gnu.org>
10849
10850 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10851 Don't stop backward scan on the continuation glyph, even though
10852 its CHARPOS is positive.
10853 (mouse_face_from_buffer_pos, note_mouse_highlight):
10854 Rename cover_string to disp_string.
10855
10856 2011-11-01 Martin Rudalics <rudalics@gmx.at>
10857
10858 * window.c (temp_output_buffer_show): Don't use
10859 Vtemp_buffer_show_specifiers.
10860 (Vtemp_buffer_show_specifiers): Remove unused variable.
10861
10862 2011-10-30 Eli Zaretskii <eliz@gnu.org>
10863
10864 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10865 past the beginning of the current glyph matrix.
10866
10867 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
10868
10869 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10870 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10871 HAVE_GTK3 (Bug#9869).
10872
10873 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10874 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10875
10876 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10877
10878 * xterm.c: Declare x_handle_net_wm_state to return int.
10879 (handle_one_xevent): Check if we are iconified but don't have
10880 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10881 (get_current_wm_state): Return non-zero if not hidden,
10882 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10883 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10884 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10885 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10886
10887 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10888
10889 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10890 so that this new function doesn't get optimized away by a
10891 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10892
10893 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10894
10895 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10896
10897 2011-10-29 Eli Zaretskii <eliz@gnu.org>
10898
10899 Fix the `xbytecode' command.
10900 * .gdbinit (xprintbytestr): New command.
10901 (xwhichsymbols): Rename from `which'; all callers changed.
10902 (xbytecode): Print the byte-code string as well.
10903
10904 2011-10-29 Kim Storm <storm@cua.dk>
10905
10906 * alloc.c (which_symbols): New function.
10907
10908 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10909
10910 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10911 line. (Bug#9903)
10912
10913 2011-10-29 Glenn Morris <rgm@gnu.org>
10914
10915 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10916 Not clear what it was for, and it causes various bugs. (Bug#9839)
10917
10918 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10919
10920 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10921 possible random value that matches one of those tested as
10922 condition to clear the mouse face.
10923
10924 2011-10-28 Chong Yidong <cyd@gnu.org>
10925
10926 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10927
10928 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10929
10930 * window.c (make_window): Initialize phys_cursor_on_p.
10931
10932 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10933
10934 * lisp.h (struct Lisp_Symbol): Update comments.
10935
10936 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
10937
10938 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10939
10940 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10941
10942 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10943 <oslsachem@gmail.com> for helping to debug this.
10944
10945 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10946 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10947 (g_b_init_get_glyph_outline_w): New static variables.
10948 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10949 (GetGlyphOutlineW_Proc): New typedefs.
10950 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10951 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10952 New functions.
10953 (w32font_open_internal, compute_metrics):
10954 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10955 instead of calling the "wide" APIs directly.
10956
10957 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10958
10959 * w32.h (syms_of_w32font): Add prototype.
10960
10961 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10962
10963 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10964 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10965 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10966 (Fmove_to_window_line): Doc fix.
10967
10968 2011-10-27 Chong Yidong <cyd@gnu.org>
10969
10970 * process.c (make_process): Set gnutls_state to NULL.
10971
10972 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10973 non-NULL, regardless of GNUTLS_INITSTAGE.
10974 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10975 an error. Set process slots as soon as we allocate them.
10976
10977 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10978
10979 2011-10-27 Chong Yidong <cyd@gnu.org>
10980
10981 * gnutls.c (emacs_gnutls_deinit): New function.
10982 Deallocate credentials structures as well as calling gnutls_deinit.
10983 (Fgnutls_deinit, Fgnutls_boot): Use it.
10984
10985 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10986 (deactivate_process): Call emacs_gnutls_deinit.
10987
10988 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10989
10990 * image.c (x_create_x_image_and_pixmap):
10991 * w32.c (sys_rename, w32_delayed_load):
10992 * w32font.c (fill_in_logfont):
10993 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10994
10995 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10996
10997 * w32fns.c (w32_default_color_map): New function,
10998 extracted from Fw32_default_color_map.
10999 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11000
11001 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11002
11003 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11004
11005 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11006
11007 * keyboard.c (test_undefined): New function (bug#9751).
11008 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11009
11010 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11011
11012 * sysdep.c (init_sys_modes): Fix the check for the controlling
11013 terminal (Bug#6649).
11014
11015 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11016
11017 * dispextern.h (struct bidi_it): New member next_en_type.
11018
11019 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11020 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11021 current character, check also for next_en_type being WEAK_EN.
11022 (bidi_resolve_weak): Don't enter the expensive loop if the current
11023 position is before next_en_pos. Record the bidi type of the first
11024 non-ET, non-BN character we find, in addition to its position.
11025 (bidi_level_of_next_char): Invalidate next_en_type when
11026 next_en_pos is over-stepped.
11027
11028 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11029
11030 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11031 * editfns.c: Rewrite current-time-zone so that it invokes
11032 the equivalent of (format-time-string "%Z") to get the time zone name.
11033 This fixes a bug when the time zone name contains characters that
11034 need converting from the system time locale to Emacs internal format.
11035 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11036 that patch fixed format-time-string to do the conversion, but
11037 I forgot to fix current-time-zone.
11038 (format_time_string): New function, containing most of
11039 what Fformat_time_string used to contain.
11040 (Fformat_time_string): Rewrite in terms of format_time_string.
11041 This doesn't change this function's behavior.
11042 (current-time-zone): Rewrite to use format_time_string.
11043 This fixes the bug reported by Michael Schierl in
11044 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11045 Jason Rumney's 2007-06-07 change worked around this bug, but
11046 didn't fix it.
11047 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11048
11049 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11050
11051 * xdisp.c (start_display): If the character at POS is displayed
11052 via a display vector, reset IT->current.dpvec_index to zero.
11053 (try_window_reusing_current_matrix): If a line ends in a display
11054 vector or the next line starts in a display vector, continue
11055 redrawing the window even though the character position of
11056 start_row was reached.
11057 (Bug#9771, part 2)
11058
11059 2011-10-18 Chong Yidong <cyd@gnu.org>
11060
11061 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11062 with nobreak-char-display too.
11063
11064 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11065
11066 Fix part 3 of bug#9771.
11067 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11068 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11069 non-neutral characters if the current character is a paragraph
11070 separator (a.k.a. Newline). This avoids running the same
11071 expensive loop twice, once when we consume the preceding newline
11072 and the other time when the line actually needs to be displayed.
11073 Avoid the loop when we see neutrals on the base embedding level
11074 following a character whose directionality is the same as the
11075 paragraph's. This avoids running the expensive loop when a line
11076 ends in a long sequence of neutrals, like control characters.
11077 Add assertion against STRONG_AL type. Slightly rearrange code
11078 that determines the type of a neutral given the first non-neutral
11079 that follows it.
11080 (bidi_level_of_next_char): Set next_en_pos to zero when
11081 invalidating its info.
11082
11083 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11084
11085 * xdisp.c (push_display_prop): Determine whether to record string
11086 or buffer position by IT->string, not by IT->method. Allow
11087 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11088 (move_it_vertically_backward): Don't look for character position
11089 immediately after the newline when in a continuation line.
11090 (Bug#9771, part 1)
11091
11092 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11093
11094 * window.c (coordinates_in_window): Rewrite and delabelize
11095 vertical border check. (Bug#5357) (Bug#9618)
11096
11097 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11098
11099 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11100 errors in XSetWindowBorder (bug#9310).
11101
11102 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11103
11104 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11105 avoid crash when xmalloc overrun checking is enabled.
11106
11107 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11108
11109 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11110 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11111 cursor motion with <left> and <right> arrow keys.
11112
11113 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11114 some callers set that themselves.
11115
11116 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11117
11118 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11119 display string and the previous row comes from the same string and
11120 is empty. (Bug#9739) (Bug#9738)
11121
11122 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11123
11124 * doc.c (get_doc_string): Encode file name (bug#9735).
11125
11126 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11127
11128 * bidi.c (bidi_level_of_next_char):
11129 * xdisp.c (get_visually_first_element): Remove old incorrect
11130 comments regarding the Unicode Line Separator character.
11131
11132 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11133
11134 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11135
11136 * alloc.c (Fgc_status): Do not access beyond zombies array
11137 boundary if nzombies > MAX_ZOMBIES.
11138 * alloc.c (dump_zombies): Add missing format specifier.
11139
11140 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11141
11142 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11143 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11144
11145 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11146 Some packages use them to denote characters with modifiers.
11147
11148 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11149
11150 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11151 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11152 matching a pp-number. Rename parameter var to var1.
11153
11154 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11155
11156 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11157
11158 2011-10-08 Glenn Morris <rgm@gnu.org>
11159
11160 * callint.c (Fcall_interactively): Give a more explicit error for the
11161 'c' case with a non-character input. (Bug#8479)
11162
11163 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11164
11165 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11166 lines.
11167 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11168 lines that are hscrolled on the left.
11169
11170 * dispnew.c (buffer_posn_from_coords): Account for a possible
11171 presence of header-line. (Bug#4426)
11172
11173 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11174
11175 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11176 Don't advertise functionality which we discourage or doesn't work.
11177
11178 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11179
11180 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11181 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11182 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11183 this makes Emacs dump core during garbage collection on rare
11184 occasions. sizeof is obviously inferior to offsetof here, so
11185 stick with offsetof.
11186 (GC_POINTER_ALIGNMENT): New macro.
11187 (mark_memory): Omit 3rd (offset) arg; caller changed.
11188 Don't assume EMACS_INT alignment is the same as pointer alignment.
11189
11190 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11191
11192 * keyboard.c (read_key_sequence_remapped): New var.
11193 (read_key_sequence): Compute remapping in the right buffer.
11194 (command_loop_1): Use read_key_sequence's remapping directly.
11195
11196 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11197
11198 * dired.c (file_name_completion): Don't expand file name.
11199 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11200 before checking file name handler.
11201
11202 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11203 they've been requested explicitly (bug#9591).
11204
11205 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11206
11207 * keymap.c (Fsingle_key_description): Use make_specified_string
11208 instead of build_string to build string from push_key_description.
11209 (Bug#5193)
11210
11211 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11212
11213 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11214 This fixes a Y2038 bug on 64-bit hosts.
11215 * buffer.c (reset_buffer):
11216 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11217 (Fclear_buffer_auto_save_failure):
11218 Use 0, not -1, to represent an unset failure time, since time_t
11219 might not be signed.
11220
11221 Remove dependency on glibc malloc internals.
11222 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11223 Move back here from lisp.h, but with their new implementations.
11224 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11225 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11226 * charset.c (charset_table_init): New static var.
11227 (syms_of_charset): Use it instead of xmalloc. This removes a
11228 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11229 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11230 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11231 Move back to alloc.c.
11232 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11233 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11234
11235 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11236
11237 * nsterm.m (windowDidResize): Call x_set_window_size only when
11238 ns_in_resize is true. Otherwise set pixelwidth/height and
11239 call change_frame_size (Bug#9628).
11240
11241 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11242
11243 Port --enable-checking=all to Fedora 14 x86-64.
11244 * charset.c (syms_of_charset): Also account for glibc malloc's
11245 internal overhead when calculating the initial malloc maximum.
11246
11247 Port --enable-checking=all to Fedora 14 x86.
11248 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11249 Move to lisp.h.
11250 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11251 (overrun_check_realloc, overrun_check_free):
11252 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11253 That way, xmalloc returns a properly-aligned pointer even if
11254 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11255 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11256 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11257 into account when calculating the initial malloc maximum.
11258 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11259 Move here from alloc.c, so that charset.c can use it too.
11260 Properly align; the old code wasn't right for common 32-bit hosts
11261 when configured with --enable-checking=all.
11262 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11263 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11264
11265 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11266
11267 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11268 use EDOM.
11269
11270 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11271
11272 * xdisp.c (compute_display_string_end): If there's no display
11273 string at CHARPOS, return -1.
11274
11275 * bidi.c (bidi_fetch_char): When compute_display_string_end
11276 returns a negative value, treat the character as a normal
11277 character not covered by a display string. (Bug#9624)
11278
11279 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11280
11281 * lread.c (Fread_from_string): Fix typo in docstring.
11282
11283 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11284
11285 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11286 newline, reseat the iterator instead of bidi-iterating there one
11287 character at a time. (Bug#9610)
11288 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11289 TO_CHARPOS if the bidi iterator is at base embedding level.
11290
11291 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11292
11293 * lread.c (readevalloop): Use correct code for NBSP.
11294 (read1): Likewise. (Bug#9608)
11295
11296 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11297
11298 * dbusbind.c (Fdbus_register_signal): When service is not
11299 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11300
11301 2011-09-25 Glenn Morris <rgm@gnu.org>
11302
11303 * buffer.c (truncate-lines): Doc fix.
11304
11305 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11306
11307 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11308 (Fset_window_next_buffers): Doc fix.
11309
11310 2011-09-24 Glenn Morris <rgm@gnu.org>
11311
11312 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11313
11314 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11315
11316 Fix minor problems found by static checking.
11317 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11318 * indent.c (Fvertical_motion): Fix == vs = typo.
11319
11320 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11321
11322 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11323 Default value is now t. Doc fix.
11324
11325 * indent.c (Fvertical_motion): Compute and apply the overshoot
11326 logic when moving up, not only when moving down. Fix the
11327 confusing name and values of the it_overshoot_expected variable;
11328 logic changes accordingly. (Bug#9254) (Bug#9549)
11329
11330 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11331 CHARPOS is covered by a display string which includes newlines.
11332 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11333 is covered by a display string with embedded newlines.
11334
11335 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11336
11337 * dbusbind.c (Fdbus_register_signal): Add match rule to
11338 Vdbus_registered_objects_table. (Bug#9581)
11339 (Fdbus_register_method, Vdbus_registered_objects_table):
11340 Fix docstring.
11341
11342 2011-09-24 Jim Meyering <meyering@redhat.com>
11343
11344 do not ignore write error for any output size
11345 The previous change was incomplete.
11346 While it makes emacs --batch detect the vast majority of stdout
11347 write failures, errors were still ignored whenever the output size is
11348 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11349 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11350 && echo FAIL: ignored write error
11351 FAIL: ignored write error
11352 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11353 && echo FAIL: ignored write error
11354 FAIL: ignored write error
11355 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11356
11357 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11358
11359 * emacs.c (Fkill_emacs): In noninteractive mode exit
11360 non-successfully if a write error occurred on stdout. (Bug#9574)
11361
11362 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11363
11364 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11365 the xassert test.
11366
11367 * dispextern.h (struct it): Update the comment documenting what
11368 can it->OBJECT be.
11369
11370 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11371
11372 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11373 a display string, extend search for cursor position to end of row.
11374 (find_row_edges): If the row ends in a newline from a display
11375 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11376 Handle the case of a display string with multiple newlines.
11377 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11378 non-empty line. Fixes confusing cursor motion with arrow keys at
11379 the beginning of a line that starts with whitespace.
11380
11381 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11382
11383 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11384 (bug#9493).
11385
11386 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11387
11388 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11389 boolean (Bug#9154).
11390
11391 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11392
11393 * xdisp.c (display_line): Record maximum and minimum buffer
11394 positions even if no glyphs were produced (e.g., by a zero-width
11395 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11396 buffer positions that will be removed from the glyph row because
11397 they don't fit.
11398 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11399 column is beyond frame width: don't subtract 1 "pixel" when
11400 computing width of the stretch.
11401 (reseat_at_next_visible_line_start): Undo the change made on
11402 2011-09-17 that saved paragraph information and restored it after
11403 the call to `reseat'. (Bug#9545)
11404
11405 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11406
11407 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11408 and turn window cursor on if cleared (Bug#9415).
11409
11410 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11411
11412 * search.c (boyer_moore): Take unibyte characters from pattern
11413 literally. (Bug#9458)
11414
11415 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11416
11417 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11418
11419 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11420
11421 Fix minor problem found by static checking.
11422 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11423 initialized, to pacify gcc -Wuninitialized.
11424
11425 * fileio.c: Report proper errno when syscall falls.
11426 (Finsert_file_contents): Save and restore errno,
11427 so that report_file_error outputs the correct diagnostic.
11428 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11429
11430 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11431
11432 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11433
11434 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11435
11436 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11437 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11438
11439 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11440
11441 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11442 about the current paragraph and restore it after the call to reseat.
11443
11444 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11445 (bidi_find_paragraph_start): Search back for paragraph beginning
11446 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11447 (bidi_move_to_visually_next): Only trigger paragraph-related
11448 computations when the last character is a newline or at EOB, not
11449 just any NEUTRAL_B. (Bug#9470)
11450
11451 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11452 truncated lines if point is covered by a display string. (Bug#9524)
11453
11454 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11455
11456 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11457 (cons_to_x_long): New function.
11458 (lisp_data_to_selection_data): Use it. Correct the test for
11459 short-versus-long data; it was negated. Break out of vector
11460 loop, for efficiency, when a long datum is discovered.
11461
11462 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11463
11464 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11465
11466 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11467
11468 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11469 GCC PR/17406) by declaring this function with external scope.
11470
11471 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11472
11473 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11474 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11475
11476 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11477
11478 * editfns.c (Fformat): Correctly handle text properties on "%%".
11479
11480 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11481
11482 * xterm.c (x_draw_composite_glyph_string_foreground):
11483 * w32term.c (x_draw_composite_glyph_string_foreground):
11484 * term.c (encode_terminal_code):
11485 * composite.c (composition_update_it, get_composition_id):
11486 * xdisp.c (get_next_display_element)
11487 (fill_composite_glyph_string): Add comments about special meaning
11488 of TAB characters in a composition.
11489
11490 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11491
11492 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11493 This occurs when processing a multibyte format.
11494 Problem reported by Wolfgang Jenker.
11495
11496 2011-09-15 Johan Bockgård <bojohan@gnu.org>
11497
11498 * xdisp.c (try_cursor_movement): Only check for exact match if
11499 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11500
11501 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11502
11503 Remove unused external symbols.
11504 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11505 * xdisp.c (calc_pixel_width_or_height): Now static.
11506 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11507 * indent.c (check_display_width):
11508 * w32term.c: Fix comment to match code.
11509 * xterm.c, xterm.h (x_catching_errors): Remove.
11510
11511 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11512
11513 * xselect.c: Use signed conversions more consistently (Bug#9498).
11514 (selection_data_to_lisp_data): Assume incoming selection data are
11515 signed integers, not unsigned. This is to be consistent with
11516 outgoing selection data, which was modified to use signed integers
11517 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11518 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11519 expects long, not unsigned long.
11520
11521 2011-09-14 Eli Zaretskii <eliz@gnu.org>
11522
11523 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11524 computation of loop end. Reported by Johan Bockgård
11525 <bojohan@gnu.org>.
11526
11527 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
11528
11529 * frame.c (Fother_visible_frames_p): Function deleted.
11530
11531 2011-09-12 Eli Zaretskii <eliz@gnu.org>
11532
11533 * indent.c (compute_motion): Process display vector front to back
11534 rather than the other way around. (Bug#2496)
11535
11536 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11537
11538 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11539
11540 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11541
11542 * minibuf.c (Fread_from_minibuffer): Doc fix.
11543
11544 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11545
11546 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11547 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11548
11549 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11550
11551 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11552 value for non-existent files.
11553
11554 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11555
11556 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11557 set its "size" to -1. This will set the modtime_size field of
11558 the corresponding buffer to -1, which is what
11559 verify-visited-file-modtime expects for files that do not exist.
11560 (Bug#9139)
11561
11562 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11563
11564 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11565 here ...
11566 * lisp.h: ... from here. push_key_description is no longer
11567 defined in keyboard.c, so its declaration should not be in
11568 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11569 logically belongs with push_key_description.
11570
11571 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11572
11573 * buffer.h: Include <sys/types.h> instead of <time.h>.
11574 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11575 Problem reported by Herbert J. Skuhra.
11576
11577 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11578
11579 * xml.c (parse_region): Make the parsing work for
11580 non-comment-starting XML files again (bug#9144).
11581
11582 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11583
11584 * image.c (gif_load): Fix calculation of bottom and right corner.
11585 (Bug#9468)
11586
11587 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11588
11589 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11590 redisplay in small windows.
11591
11592 2011-09-09 Eli Zaretskii <eliz@gnu.org>
11593
11594 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11595
11596 2011-09-08 Martin Rudalics <rudalics@gmx.at>
11597
11598 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11599 Operate on live windows only.
11600
11601 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
11602
11603 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11604
11605 2011-09-07 Eli Zaretskii <eliz@gnu.org>
11606
11607 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11608 only under bidi iteration.
11609
11610 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11611
11612 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11613
11614 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11615
11616 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11617 Without this fix, the command to link temacs failed due to an
11618 undefined symbol __builtin_isnan. This is because
11619 /usr/include/iso/math_c99.h #defines isnan(x) to
11620 __builtin_isnan(x), but the bundled gcc, which identifies itself
11621 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11622 a __builtin_isnan.
11623 * floatfns.c (isnan): #undef, and then #define to a clone of
11624 what's in data.c.
11625 (Fisnan): Always define, since it's always available now.
11626 (syms_of_floatfns): Always define isnan at the Lisp level.
11627
11628 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11629
11630 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11631
11632 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11633
11634 * fileio.c: Fix bugs with large file offsets (Bug#9428).
11635 The previous code assumed that file offsets (off_t values) fit in
11636 EMACS_INT variables, which is not true on typical 32-bit hosts.
11637 The code messed up by falsely reporting buffer overflow in cases
11638 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11639 when "big" contains more than 2**29 bytes, even though this
11640 inserts just one byte and does not overflow the buffer.
11641 (Finsert_file_contents): Store file offsets as off_t
11642 values, not as EMACS_INT values. Check for overflow when
11643 converting between EMACS_INT and off_t. When checking for
11644 buffer overflow or for overlap, take the offsets into account.
11645 Don't use EMACS_INT for small values where int suffices.
11646 When checking for overlap, fix a typo: ZV was used where
11647 ZV_BYTE was intended.
11648 (Fwrite_region): Don't assume off_t fits into 'long'.
11649 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11650
11651 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
11652
11653 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11654
11655 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11656
11657 sprintf-related integer and memory overflow issues (Bug#9412).
11658
11659 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11660 (esprintf, exprintf, evxprintf): New functions.
11661 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11662 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11663 (modify_event_symbol): Do not assume that the length of
11664 name_alist_or_stem is safe to alloca and fits in int.
11665 (Fexecute_extended_command): Likewise for function name and binding.
11666 (Frecursion_depth): Wrap around reliably on integer overflow.
11667 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11668 since some callers pass EMACS_INT values.
11669 (Fsingle_key_description): Don't crash if symbol name contains more
11670 than MAX_ALLOCA bytes.
11671 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11672 (get_minibuffer): Arg is now EMACS_INT, not int.
11673 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11674 (esprintf, exprintf, evxprintf): New decls.
11675 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11676
11677 * dbusbind.c (signature_cat): New function.
11678 (xd_signature, Fdbus_register_signal):
11679 Do not overrun buffer; instead, report string overflow.
11680
11681 * dispnew.c (add_window_display_history): Don't overrun buffer.
11682 Truncate instead; this is OK since it's just a log.
11683
11684 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11685 even if the time zone offset is outlandishly large.
11686 Don't mishandle offset == INT_MIN.
11687
11688 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11689 when creating daemon; the previous buffer-overflow check was incorrect.
11690
11691 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11692 which has the guts of the old verror function.
11693
11694 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11695 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11696
11697 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11698 (font_unparse_xlfd): Don't blindly alloca long strings.
11699 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11700 fits in int, when using sprintf. Use single snprintf to count
11701 length of string rather than counting it via multiple sprintfs;
11702 that's simpler and more reliable.
11703 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11704 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11705 sprintf, in case result does not fit in int.
11706
11707 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11708 (fontset_from_font): Print it.
11709
11710 * frame.c (tty_frame_count): Now printmax_t, not int.
11711 (make_terminal_frame, set_term_frame_name): Print it.
11712 (x_report_frame_params): In X, window IDs are unsigned long,
11713 not signed long, so print them as unsigned.
11714 (validate_x_resource_name): Check for implausibly long names,
11715 and don't assume name length fits in 'int'.
11716 (x_get_resource_string): Don't blindly alloca invocation name;
11717 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11718 not fit in int.
11719
11720 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11721 (xg_check_special_colors, xg_set_geometry):
11722 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11723
11724 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11725 Use esprintf, not sprintf, in case result does not fit in int.
11726
11727 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11728 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11729 it as a large positive number.
11730 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11731 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11732
11733 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11734 in case result does not fit in int.
11735
11736 * print.c (float_to_string): Detect width overflow more reliably.
11737 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11738 buffer overrun. Don't assume list length fits in 'int'. Treat
11739 print length of 0 as 0, not as infinity; to be consistent with other
11740 uses of print length in this function. Don't overflow print length
11741 index. Don't assume hash table size fits in 'long', or that
11742 vectorlike size fits in 'unsigned long'.
11743
11744 * process.c (make_process): Use printmax_t, not int, to format
11745 process-name gensyms.
11746
11747 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11748
11749 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11750 to avoid potential buffer overrun.
11751
11752 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11753 if X resource line is longer than 512 bytes.
11754
11755 * xfns.c (x_window): Make sprintf buffer a bit bigger
11756 to avoid potential buffer overrun.
11757
11758 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11759
11760 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11761
11762 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11763
11764 Integer overflow fixes for scrolling, etc.
11765 Without these, Emacs silently mishandles large integers sometimes.
11766 For example, "C-u 4294967297 M-x recenter" was treated as if
11767 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11768
11769 * xdisp.c (try_window_id): Check Emacs fixnum range before
11770 converting to 'int'.
11771
11772 * window.c (window_scroll_line_based, Frecenter):
11773 Check that an Emacs fixnum is in range before assigning it to 'int'.
11774 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11775 values converted from Emacs fixnums.
11776 (Frecenter): Don't wrap around a line count if it is out of 'int'
11777 range; instead, treat it as an extreme value.
11778 (Fset_window_configuration, compare_window_configurations):
11779 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11780
11781 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11782 that can exceed INT_MAX. Check that EMACS_INT value is in range
11783 before assigning it to the (possibly-narrower) index.
11784 (match_limit): Don't assume that a fixnum can fit in 'int'.
11785
11786 * print.c (print_object): Use ptrdiff_t, not int, for index that can
11787 exceed INT_MAX.
11788
11789 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11790 (Fvertical_motion): Don't wrap around LINES values that don't fit
11791 in 'int'. Instead, treat them as extreme values. This is good
11792 enough for windows, which can't have more than INT_MAX lines anyway.
11793
11794 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11795
11796 * Require libxml/parser.h to avoid compilation warning.
11797
11798 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11799
11800 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11801 since this reportedly can destroy thread storage.
11802
11803 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
11804
11805 * syntax.c (find_defun_start): Update all cache variables if
11806 exiting early (Bug#9401).
11807
11808 2011-08-30 Eli Zaretskii <eliz@gnu.org>
11809
11810 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11811
11812 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11813 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11814 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11815
11816 * term.c (tty_append_glyph): New function.
11817 (produce_stretch_glyph): Static function and its prototype deleted.
11818
11819 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11820 Add prototypes.
11821
11822 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11823
11824 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11825 when checking :margin (Bug#9390).
11826 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11827 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11828 so that the name doesn't mislead. All uses changed.
11829
11830 2011-08-28 Johan Bockgård <bojohan@gnu.org>
11831
11832 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11833 set_tty_hooks.
11834
11835 2011-08-27 Eli Zaretskii <eliz@gnu.org>
11836
11837 * xdisp.c (move_it_to): Don't bail out early when reaching
11838 position beyond to_charpos, if we are scanning backwards.
11839 (move_it_vertically_backward): When DY == 0, make sure we get to
11840 the first character in the line after the newline.
11841
11842 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11843
11844 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11845 (ccl_driver): Do not generate an out-of-range pointer.
11846 (Fccl_execute_on_string): Remove unnecessary check for
11847 integer overflow, noted by Stefan Monnier in
11848 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11849 Remove a FIXME that didn't need fixing.
11850 Simplify the newly-introduced buffer reallocation code.
11851
11852 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
11853
11854 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11855
11856 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
11857
11858 Integer and memory overflow issues (Bug#9196).
11859
11860 * doc.c (get_doc_string): Rework so that
11861 get_doc_string_buffer_size is the actual buffer size, rather than
11862 being 1 less than the actual buffer size; this makes xpalloc more
11863 convenient.
11864
11865 * image.c (x_allocate_bitmap_record, cache_image):
11866 * xselect.c (Fx_register_dnd_atom):
11867 Simplify previous changes by using xpalloc.
11868
11869 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11870 since either will do and ptrdiff_t is convenient with xpalloc.
11871
11872 * charset.c (charset_table_size)
11873 (struct charset_sort_data.priority): Now ptrdiff_t.
11874 (charset_compare): Don't overflow if priorities differ greatly.
11875 (Fsort_charsets): Don't assume list length fits in int.
11876 Check for size-calculation overflow when allocating sort data.
11877 (syms_of_charset): Allocate an initial charset table that is
11878 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11879
11880 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11881
11882 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11883 The actual value is always <= INT_MAX, and leaving it unsigned made
11884 overflow checking harder.
11885
11886 * dispextern.h (struct glyph_matrix.rows_allocated)
11887 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11888 with xpalloc. The values are still always <= INT_MAX.
11889
11890 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11891
11892 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11893 (SAFE_NALLOCA): New macro.
11894
11895 * region-cache.c (struct boundary.pos, find_cache_boundary)
11896 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11897 (set_cache_region, invalidate_region_cache)
11898 (revalidate_region_cache, know_region_cache, region_cache_forward)
11899 (region_cache_backward, pp_cache):
11900 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11901 so that ptrdiff_t * can be passed to xpalloc.
11902 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11903 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11904 (pp_cache): Don't assume cache_len fits in int.
11905 * region-cache.h: Adjust extern decls to match.
11906
11907 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11908 EMACS_INT, since either will do, for xpalloc.
11909
11910 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11911 (xnmalloc, xnrealloc, xpalloc): New functions.
11912
11913 * bidi.c (bidi_shelve_header_size): New constant.
11914 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11915 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11916
11917 * bidi.c (bidi_cache_shrink):
11918 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11919 (overlay_strings):
11920 Don't update size of array until after memory allocation succeeds,
11921 because xmalloc/xrealloc may not return.
11922 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11923 now that we have proper integer overflow checking.
11924 (record_overlay_string, overlay_strings): Catch overflows when
11925 calculating size of overlay_str_buf.
11926
11927 * callproc.c (Fcall_process): Check for size overflow when
11928 calculating size of args2.
11929 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11930 Normally we prefer signed values, but sticking with ptrdiff_t would
11931 require adding more-complicated checks.
11932
11933 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11934 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11935 Redo buffer-overflow calculations to avoid integer overflow.
11936 Add a FIXME comment where memory seems to be over-allocated.
11937
11938 * character.c (Fstring): Check for size-calculation overflow.
11939
11940 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11941 unnecessary integer overflow. Check for size overflow.
11942 (encode_coding_object): Don't update size until xmalloc succeeds.
11943
11944 * composite.c (get_composition_id): Check for overflow in glyph
11945 length calculations.
11946
11947 Integer and memory overflow fixes for display code.
11948 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11949 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11950 (scrolling_window): Check for overflow in size calculations.
11951 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11952 Don't assume glyph table len fits in int.
11953 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11954 (row_table_size): Now ptrdiff_t, not int.
11955 (scrolling_window): Avoid overflow in size calculations.
11956 Don't update size until allocation succeeds.
11957 * fns.c (concat): Check for overflow in size calculations.
11958 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11959 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11960 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11961
11962 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11963 (get_doc_string): Check for size calculation overflow.
11964 Don't update size until allocation succeeds.
11965 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11966 EMACS_INT, where ptrdiff_t will do.
11967 (Fsubstitute_command_keys): Check for string overflow.
11968
11969 * editfns.c (set_time_zone_rule): Don't assume environment length
11970 fits in int.
11971 (message_length): Now ptrdiff_t, not int.
11972 (Fmessage_box): Don't update size until allocation succeeds.
11973 Don't assume message length fits in int.
11974 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11975
11976 * emacs.c (main): Do not reallocate argv, since there is a null at
11977 the end that can be overwritten, and this way there's no need to
11978 worry about size-calculation overflow.
11979 (sort_args): Check for size-calculation overflow.
11980
11981 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11982 alloc succeeds.
11983 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11984
11985 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11986 (x_set_scroll_bar_width, x_figure_window_size):
11987 Check for integer overflow.
11988 (x_set_alpha): Do not assume XINT fits in int.
11989
11990 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11991 This is for the members text_lines, text_cols, total_lines, total_cols,
11992 where the system imposes an 'int' limit.
11993
11994 * fringe.c (Fdefine_fringe_bitmap):
11995 Don't update size until alloc works.
11996
11997 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11998 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11999
12000 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12001 Check for size-calculation overflow.
12002 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12003 do, as we prefer signed integers.
12004 (id_to_widget.max_size, id_to_widget.used)
12005 (xg_store_widget_in_map, xg_remove_widget_from_map)
12006 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12007 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12008 Use and return ptrdiff_t, not int.
12009 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12010 * gtkutil.h: Change prototypes to match the above.
12011
12012 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12013 are duplicate now that they've been promoted to lisp.h.
12014 (x_allocate_bitmap_record, x_alloc_image_color)
12015 (make_image_cache, cache_image, xpm_load):
12016 Don't update size until alloc is done.
12017 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12018 (x_detect_edges):
12019 Check for size calculation overflow.
12020 (ct_colors_allocated_max): New constant.
12021 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12022 overflow.
12023
12024 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12025 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12026 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12027 Use ptrdiff_t, not int, to count maps.
12028 (read_char_minibuf_menu_prompt): Check for overflow in size
12029 calculations. Don't update size until allocation succeeds.
12030 Redo calculations to avoid overflow.
12031 * keyboard.h: Change prototypes to match the above.
12032
12033 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12034 to count maps.
12035 (current_minor_maps): Check for size calculation overflow.
12036 * keymap.h: Change prototypes to match the above.
12037
12038 * lread.c (read1, init_obarray): Don't update size until alloc done.
12039
12040 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12041 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12042
12043 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12044 Now ptrdiff_t, not int.
12045 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12046 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12047
12048 * process.c (Fnetwork_interface_list): Check for overflow
12049 in size calculation.
12050
12051 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12052
12053 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12054 overflow. Don't bother calling xmalloc when xrealloc will do.
12055
12056 * search.c (Freplace_match): Check for size calculation overflow.
12057 (Fset_match_data): Don't assume list lengths fit in 'int'.
12058
12059 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12060 for command line length. Do not attempt to address one before the
12061 beginning of an array, as that's not portable.
12062
12063 * term.c (max_frame_lines): Remove; unused.
12064 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12065 not int.
12066 (encode_terminal_code, calculate_costs): Check for size
12067 calculation overflow.
12068 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12069 table lengths and related sizes. Don't update size until alloc
12070 done. Redo calculations to avoid overflow.
12071 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12072
12073 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12074 subtracting pointers.
12075 (gobble_line): Check for overflow more carefully. Don't update size
12076 until alloc done.
12077
12078 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12079 Don't update size until alloc done.
12080 Redo size calculations to avoid overflow.
12081 Check for size calculation overflow.
12082 (main) [DEBUG]: Fix typo in invoking tparam1.
12083
12084 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12085 Use ptrdiff_t, not int, for sizes.
12086 (store_mode_line_noprop_char): Don't update size until alloc done.
12087
12088 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12089 Use ptrdiff_t, not int, for sizes.
12090 (Finternal_make_lisp_face, cache_face):
12091 Check for size calculation overflow.
12092 (cache_face): Treat size calculation overflows as if they were
12093 memory exhaustion (the usual treatment), rather than aborting.
12094
12095 * xfns.c (x_encode_text, x_set_name_internal)
12096 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12097 sizes, since they can exceed INT_MAX in size. Check for size
12098 calculation overflow.
12099
12100 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12101 (xg_select): Check for size calculation overflow.
12102 Don't update size until alloc done.
12103
12104 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12105 as sprintf is limited to int lengths.
12106
12107 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12108 (X_LONG_MIN): New macros.
12109 Use them to make the following changes clearer.
12110 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12111 This change doesn't affect the value now, but it may help remind
12112 future maintainers not to raise the value too much later.
12113 (SELECTION_QUANTUM): Remove, replacing with ...
12114 (selection_quantum): ... new function, which avoids overflow.
12115 All uses changed.
12116 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12117 assumption that selection length fits in 'int'.
12118 (x_reply_selection_request, x_handle_selection_request)
12119 (x_get_window_property, receive_incremental_selection)
12120 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12121 (lisp_data_to_selection_data, clean_local_selection_data):
12122 Use ptrdiff_t, not int, to record length of selection.
12123 (x_reply_selection_request, x_get_window_property)
12124 (receive_incremental_selection, x_property_data_to_lisp):
12125 Redo calculations to avoid overflow.
12126 (x_reply_selection_request): When sending hint, ceiling it at
12127 X_LONG_MAX rather than relying on wraparound overflow to send
12128 something.
12129 (x_get_window_property, receive_incremental_selection)
12130 (lisp_data_to_selection_data, x_property_data_to_lisp):
12131 Check for size-calculation overflow.
12132 (x_get_window_property, receive_incremental_selection)
12133 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12134 Don't store size until memory allocation succeeds.
12135 (x_get_window_property): Plug memory leak on memory exhaustion.
12136 Don't double-block input; malloc is safe here. Don't assume 2**34
12137 - 4 fits in unsigned long. Add an xassert to check
12138 XGetWindowProperty overflow. Be more careful about overflow
12139 calculations, and distinguish size from memory overflow better.
12140 (receive_incremental_selection): When tracing, don't assume
12141 unsigned int is less than INT_MAX.
12142 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12143 harmful) conversions of unsigned short to int.
12144 (lisp_data_to_selection_data): Don't assume that integers
12145 in the range -65535 through -1 fit in an X unsigned short.
12146 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12147 result parameters unless successful. Rely on cons_to_unsigned
12148 to report problems with elements; the old code wasn't right anyway.
12149 (x_check_property_data): Check for int overflow; we cannot use
12150 a wider type due to X limits.
12151 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12152
12153 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12154
12155 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12156 (x_term_init): Check for size calculation overflow.
12157 (x_color_cells): Don't store size until memory allocation succeeds.
12158 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12159 Don't assume alloca size is less than MAX_ALLOCA.
12160 (x_term_init): Don't assume length fits in int (sprintf is limited
12161 to int size).
12162
12163 Use ptrdiff_t for composition IDs.
12164 * character.c (lisp_string_width):
12165 * composite.c (composition_table_size, n_compositions)
12166 (get_composition_id, composition_gstring_from_id):
12167 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12168 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12169 * window.c (Frecenter):
12170 Use ptrdiff_t, not int, for composition IDs.
12171 * composite.c (get_composition_id): Check for integer overflow.
12172 * composite.h: Adjust prototypes to match the above changes.
12173
12174 Use ptrdiff_t for hash table indexes.
12175 * category.c (hash_get_category_set):
12176 * ccl.c (ccl_driver):
12177 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12178 * coding.c (coding_system_charset_list, detect_coding_system):
12179 * coding.h (struct coding_system.id):
12180 * composite.c (get_composition_id, gstring_lookup_cache):
12181 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12182 * image.c (xpm_get_color_table_h):
12183 * lisp.h (hash_lookup, hash_put):
12184 * minibuf.c (Ftest_completion):
12185 Use ptrdiff_t for hash table indexes, not int (which is too
12186 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12187 32-bit --with-wide-int hosts).
12188
12189 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12190 Add a FIXME comment about memory leaks.
12191 (syms_of_charset): Don't assume xmalloc returns.
12192
12193 Don't assume that stated character widths fit in int.
12194 * character.c (Fchar_width, c_string_width, lisp_string_width):
12195 * character.h (CHAR_WIDTH):
12196 * indent.c (MULTIBYTE_BYTES_WIDTH):
12197 Use sanitize_char_width to avoid undefined and/or bad behavior
12198 with outlandish widths.
12199 * character.h (sanitize_tab_width): Rename from sanitize_width,
12200 now that we have two such functions. All uses changed.
12201 (sanitize_char_width): New inline function.
12202
12203 Don't assume that tab-width fits in int.
12204 * character.h (sanitize_width): New inline function.
12205 (SANE_TAB_WIDTH): New macro.
12206 (ASCII_CHAR_WIDTH): Use it.
12207 * indent.c (sane_tab_width): Remove. All uses replaced by
12208 SANE_TAB_WIDTH (current_buffer).
12209 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12210
12211 * fileio.c: Integer overflow issues with file modes.
12212 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12213
12214 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12215 Remove unreachable code.
12216 (read_hex, load_charset_map_from_file): Check for integer overflow.
12217
12218 * xterm.c: Don't go over XClientMessageEvent limit.
12219 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12220 (x_send_scroll_bar_event): Likewise. Check that the size does not
12221 exceed limits imposed by XClientMessageEvent, as well as the usual
12222 ptrdiff_t and size_t limits.
12223
12224 * keyboard.c: Overflow, signedness and related fixes.
12225 (make_lispy_movement): Use same integer type in forward decl
12226 that is used in the definition.
12227 (read_key_sequence, keyremap_step):
12228 Change bufsize argument back to int, undoing my 2011-03-30 change.
12229 We prefer signed types, and int is wide enough here.
12230 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12231 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12232 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12233 length, not size_t. Use ptrdiff_t for index, not int.
12234 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12235 possibility of integer overflow.
12236
12237 Overflow, signedness and related fixes for images.
12238
12239 * dispextern.h (struct it.stack[0].u.image.image_id)
12240 (struct_it.image_id, struct image.id, struct image_cache.size)
12241 (struct image_cache.used, struct image_cache.ref_count):
12242 * gtkutil.c (update_frame_tool_bar):
12243 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12244 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12245 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12246 * nsmenu.m (update_frame_tool_bar):
12247 * xdisp.c (calc_pixel_width_or_height):
12248 * xfns.c (image_cache_refcount):
12249 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12250 on typical 64-bit hosts.
12251
12252 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12253 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12254 Omit unnecessary casts to int.
12255 (parse_image_spec): Check that integers fall into 'int' range
12256 when the callers expect that.
12257 (image_ascent): Redo ascent calculation to avoid int overflow.
12258 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12259 (lookup_image): Remove unnecessary tests.
12260 (xbm_image_p): Locals are now of int, not EMACS_INT,
12261 since parse_image_check makes sure they fit into int.
12262 (png_load, gif_load, svg_load_image):
12263 Prefer int to unsigned where either will do.
12264 (tiff_handler): New function, combining the cores of the
12265 old tiff_error_handler and tiff_warning_handler.
12266 This function is rewritten to use vsnprintf and thereby avoid
12267 stack buffer overflows. It uses only the features of vsnprintf
12268 that are common to both POSIX and native Microsoft.
12269 (tiff_error_handler, tiff_warning_handler): Use it.
12270 (tiff_load, gif_load, imagemagick_load_image):
12271 Don't assume :index value fits in 'int'.
12272 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12273 (imagemagick_load_image): Check that crop parameters fit into
12274 the integer types that MagickCropImage accepts. Don't assume
12275 Vimagemagick_render_type has a nonnegative value. Don't assume
12276 size_t fits in 'long'.
12277 (gs_load): Use printmax_t to print the widest integers possible.
12278 Check for integer overflow when computing image height and width.
12279
12280 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12281
12282 * xdisp.c (redisplay_window): Don't force window start if point
12283 will be invisible in the resulting window. (Bug#9324)
12284
12285 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12286
12287 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12288 the display spec is of the form `(space ...)'.
12289 (handle_display_spec): Return the value returned by
12290 handle_single_display_spec, not just 1 or zero.
12291 (handle_single_display_spec): If the display spec is of the form
12292 `(space ...)', and specifies display in the text area, return 2
12293 rather than 1.
12294 (try_cursor_movement): Check for the need to scroll more
12295 accurately, and prefer exact match for point under bidi.
12296 Don't advance `row' beyond the last row of the window.
12297
12298 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12299 into disp_prop; all users changed.
12300
12301 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12302 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12303 for the text covered by the display property.
12304
12305 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12306
12307 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12308 Change return value to nil.
12309 (Frecord_buffer): Delete unused function.
12310
12311 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12312
12313 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12314 buffers, return left-to-right.
12315 (set_cursor_from_row): Consider candidate row a win if its glyph
12316 represents a newline and point is on that newline. Fixes cursor
12317 positioning on the newline at EOL of R2L text within L2R
12318 paragraph, and vice versa.
12319 (try_cursor_movement): Check continued rows, in addition to
12320 continuation rows. Fixes unwarranted scroll when point enters a
12321 continued line of R2L text within an L2R paragraph, or vice versa.
12322 (cursor_row_p): Consider the case of point being equal to
12323 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12324 from the end of a short line to the beginning of a continued line
12325 of R2L text within L2R paragraph.
12326 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12327 composed characters.
12328
12329 * bidi.c (bidi_check_type): Use xassert.
12330 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12331 members.
12332
12333 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12334
12335 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12336 a character.
12337
12338 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12339
12340 * nsfont.m (ns_otf_to_script): Fix typo.
12341
12342 2011-08-22 Kenichi Handa <handa@m17n.org>
12343
12344 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12345 extra slot even if the purpose is char-code-property-table.
12346
12347 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12348
12349 * xdisp.c (redisplay_window): When computing centering_position,
12350 account for the height of the header line. (Bug#8874)
12351
12352 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12353 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12354 candidate is selected by the mouse, and that candidate has a
12355 composed character under the mouse.
12356
12357 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12358 coordinates reported by pos-visible-in-window-p for a composed
12359 character in column zero.
12360
12361 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12362
12363 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12364
12365 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12366
12367 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12368 consider it a hit if to_charpos is anywhere in the range of the
12369 composed buffer positions.
12370
12371 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12372
12373 * image.c (gif_load): Don't assume that each subimage has the same
12374 dimensions as the base image. Handle disposal method that is
12375 "undefined" by the gif spec (Bug#9335).
12376
12377 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12378
12379 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12380 (Fcondition_case): Document `debug' symbol in error handler.
12381
12382 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12383
12384 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12385 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12386 from an Org mode buffer to a Speedbar frame.
12387
12388 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12389 a composition, take its buffer position from IT->cmp_it.charpos.
12390 Fixes cursor positioning at the beginning of a line that begins
12391 with a composed character.
12392
12393 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12394
12395 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12396 character bidirectional type, use STRONG_L instead. Fixes crashes
12397 in a buffer produced by `describe-categories'.
12398
12399 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12400 members before the level stack, so they would be saved and
12401 restored when copying iterator state. Fixes incorrect reordering
12402 around TABs covered by display properties.
12403
12404 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12405
12406 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12407
12408 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12409
12410 * eval.c (internal_condition_case, internal_condition_case_1)
12411 (internal_condition_case_2, internal_condition_case_n):
12412 Remove unnecessary aborts (Bug#9081).
12413
12414 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12415
12416 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12417 has no `load' handler, try opening the file locally. (Bug#9311)
12418
12419 2011-08-16 Ken Brown <kbrown@cornell.edu>
12420
12421 * gmalloc.c: Expand comment.
12422
12423 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12424
12425 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12426 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12427
12428 2011-08-16 Ken Brown <kbrown@cornell.edu>
12429
12430 Fix memory allocation problems in Cygwin build (Bug#9273).
12431
12432 * unexcw.c ( __malloc_initialized): Declare external variable.
12433 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12434
12435 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12436 New variables.
12437 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12438 dumped emacs.
12439 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12440 in the static heap.
12441 [CYGWIN] (special_realloc): New function.
12442 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12443 requests to realloc storage in the static heap.
12444
12445 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12446
12447 * bidi.c (bidi_initialize): Remove unused local.
12448
12449 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12450
12451 * bidimirror.h:
12452 * biditype.h: Remove file.
12453 * makefile.w32-in ($(BLD)/bidi.$(O)):
12454 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12455
12456 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12457
12458 * chartab.c: Improve commentary for the uniprop_table API.
12459
12460 * bidi.c (bidi_paragraph_init): Support zero value of
12461 bidi_ignore_explicit_marks_for_paragraph_level.
12462 (bidi_initialize): Use uniprop_table instead of including
12463 biditype.h and bidimirror.h.
12464
12465 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12466 coordinates of the iterator when restoring from ppos_it.
12467 (Bug#9296)
12468
12469 2011-08-14 Kenichi Handa <handa@m17n.org>
12470
12471 * process.c (create_process): Call setup_process_coding_systems
12472 after the pid of the process is set to -1 (Bug#8162).
12473
12474 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12475
12476 * xdisp.c (move_it_in_display_line_to): Don't invoke
12477 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12478 ppos_it. Fixes vertical cursor motion when line beginning is
12479 covered by an image. (Bug#9296)
12480
12481 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12482
12483 * nsterm.h (ns_run_ascript): Declare.
12484 (NSAPP_DATA2_RUNASSCRIPT): Define.
12485
12486 * nsfns.m (as_script, as_result, as_status): New static variables.
12487 (ns_run_ascript): New function.
12488 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12489 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12490 the event loop. Get status from as_status (Bug#7276).
12491
12492 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12493 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12494 the event loop (Bug#7276).
12495
12496 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12497
12498 * gnutls.c (QCgnutls_bootprop_priority)
12499 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12500 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12501 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12502 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12503 (QCgnutls_bootprop_verify_hostname_error)
12504 (QCgnutls_bootprop_callbacks_verify): Rename from
12505 Qgnutls_bootprop_..., all uses changed.
12506
12507 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12508 uses changed.
12509
12510 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12511
12512 * xfaces.c (Qframe_set_background_mode): Now static.
12513 * dispextern.h (Qframe_set_background_mode): Remove decl.
12514
12515 * process.c (Fnetwork_interface_info): Declare local only if needed.
12516
12517 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12518
12519 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12520 (Fnetwork_interface_list): Allocate in increments of bytes instead
12521 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12522 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12523 sockaddr.
12524 (struct ifflag_def): notrailers is smart on OSX.
12525 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12526 Get hardware address with getifaddrs if available.
12527
12528 2011-08-12 Eli Zaretskii <eliz@gnu.org>
12529
12530 * xdisp.c (iterate_out_of_display_property): xassert that
12531 IT->position is set to within IT->object's boundaries. Break from
12532 the loop as soon as EOB is reached; avoids infloops in redisplay
12533 when IT->position is set up wrongly due to some bug.
12534 Set IT->current to match the bidi iterator unconditionally.
12535 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12536 entry. Force push_it to save on the stack the current
12537 buffer/string position, to be restored by pop_it. Fix flags in
12538 the iterator structure wrt the object coming from a display
12539 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12540 properties. (Bug#9284)
12541
12542 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12543
12544 * fontset.c (fontset_get_font_group): Add proper type checks.
12545 (Bug#9172)
12546
12547 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12548
12549 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12550 and LC_VERSION_MIN_MACOSX.
12551 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12552 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12553
12554 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12555
12556 * xdisp.c (forward_to_next_line_start): Allow to use the
12557 no-display-properties-and-no-overlays under bidi display.
12558 Set disp_pos in the bidi iterator to avoid searches for display
12559 properties and overlays.
12560
12561 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12562
12563 * editfns.c (Fset_time_zone_rule): Document relationship with the
12564 setenv function.
12565
12566 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12567 the font entity extracted from the cache (Bug#8109).
12568
12569 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12570
12571 * composite.c (autocmp_chars): Don't reset point. That is done by
12572 restore_point_unwind (Bug#5984).
12573
12574 2011-08-07 Juri Linkov <juri@jurta.org>
12575
12576 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12577 to show the arg `TIME' instead of `TIMEVAL'.
12578
12579 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12580
12581 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12582 display property strides EOL and includes a newline, as in
12583 longlines-mode. (Bug#9254)
12584 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12585 word-wrap under bidirectional display. (Bug#9224)
12586
12587 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12588 is non-zero, even if the data buffer is NULL. Fixes a crash in
12589 vertical-motion with longlines-mode. (Bug#9254)
12590
12591 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12592
12593 * bidi.c <bidi_cache_total_alloc>: Now static.
12594 (bidi_initialize): Initialize bidi_cache_total_alloc.
12595
12596 * xdisp.c (display_line): Release buffer allocated for shelved bidi
12597 cache. (Bug#9221)
12598
12599 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12600 amount allocated this far in `bidi_cache_total_alloc'.
12601 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12602 non-zero, only free the data buffer without restoring the cache
12603 contents. All callers changed.
12604
12605 * dispextern.h (bidi_unshelve_cache): Update prototype.
12606
12607 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12608 (move_it_in_display_line, move_it_to)
12609 (move_it_vertically_backward, move_it_by_lines): Replace the call
12610 to xfree to an equivalent call to bidi_unshelve_cache.
12611 (move_it_in_display_line_to): Fix logic of returning
12612 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12613
12614 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12615
12616 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12617 came from a string character with a `cursor' property. (Bug#9229)
12618
12619 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12620
12621 * Makefile.in (LIB_PTHREAD): New variable.
12622 (LIBES): Add LIB_PTHREAD (Bug#9216).
12623
12624 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12625 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12626
12627 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12628
12629 * regex.c (re_iswctype): Remove some redundant boolean conversions.
12630
12631 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12632
12633 * xterm.c (x_find_topmost_parent): New function.
12634 (x_set_frame_alpha): Find topmost parent window with
12635 x_find_topmost_parent and set the property there also (bug#9181).
12636 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12637
12638 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12639
12640 * callproc.c (Fcall_process): Avoid vfork clobbering
12641 the local vars buffer, coding_systems, current_dir.
12642
12643 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12644
12645 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12646
12647 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12648
12649 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12650 so that it is not optimized away.
12651
12652 * xdisp.c (compute_display_string_pos): Remove unused local.
12653
12654 2011-08-02 Eli Zaretskii <eliz@gnu.org>
12655
12656 Fix slow cursor motion and scrolling in large buffers with
12657 selective display, like Org Mode buffers. (Bug#9218)
12658
12659 * dispextern.h (struct bidi_it): New member disp_prop_p.
12660
12661 * xdisp.c: Remove one-slot cache of display string positions.
12662 (compute_display_string_pos): Accept an additional argument
12663 DISP_PROP_P; callers changed. Scan at most 5K characters forward
12664 for a display string or property. If found, set DISP_PROP_P
12665 non-zero.
12666
12667 * bidi.c (bidi_fetch_char): Accept an additional argument
12668 DISP_PROP_P, and pass it to compute_display_string_pos.
12669 Only handle text covered by a display string if DISP_PROP_P is returned
12670 non-zero. All callers of bidi_fetch_char changed.
12671
12672 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12673
12674 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12675
12676 2010-12-03 Don March <don@ohspite.net>
12677
12678 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12679 last character M-[char] is translated to ESC [char] (bug#7541).
12680
12681 2011-08-02 Kenichi Handa <handa@m17n.org>
12682
12683 * lisp.h (uniprop_table): Extern it.
12684
12685 * chartab.c (uniprop_table): Make it non-static.
12686
12687 2011-08-01 Eli Zaretskii <eliz@gnu.org>
12688
12689 * xdisp.c (forward_to_next_line_start): Accept additional argument
12690 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12691 on the newline.
12692 (reseat_at_next_visible_line_start): Use the bidi iterator state
12693 returned by forward_to_next_line_start to restore the state of
12694 it->bidi_it after backing up to previous newline. (Bug#9212)
12695
12696 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12697
12698 * regex.c (re_comp): Protoize.
12699 (re_exec): Fix return type.
12700 (regexec): Fix type of `ret'. (Bug#9203)
12701
12702 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12703
12704 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12705 This is needed if max-image-size is a floating-point number.
12706
12707 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12708
12709 * print.c (print_object): Print empty symbol as ##.
12710
12711 * lread.c (read1): Read ## as empty symbol.
12712
12713 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12714
12715 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12716 setting frame foreground color (Bug#9175).
12717 (x_set_background_color): Likewise.
12718
12719 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12720 contents (Bug#9176).
12721 (EmacsTooltip -init): Remove bezels and add shadows to
12722 tooltip windows.
12723
12724 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12725 or scroll bar (Bug#8470).
12726
12727 * nsfont.m (nsfont_open): Remove assignment to voffset and
12728 unnecessary vars hshink, expand, hd, full_height, min_height.
12729 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12730
12731 * nsterm.h (nsfont_info): Remove voffset field.
12732
12733 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12734
12735 Implement strike-through and overline on NextStep (Bug#8863).
12736
12737 * nsfont.m (nsfont_open): Use underline position provided by font,
12738 instead of hard-coded value of 2.
12739 (nsfont_draw): Call ns_draw_text_decoration instead.
12740
12741 * nsterm.h: Add declaration for ns_draw_text_decoration.
12742
12743 * nsterm.m (ns_draw_text_decoration): New function for drawing
12744 underline, overline, and strike-through.
12745 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12746 ns_draw_text_decoration. Change treatment of cursor drawing to
12747 accommodate underlining, etc.
12748
12749 2011-07-28 Eli Zaretskii <eliz@gnu.org>
12750
12751 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12752 default.
12753
12754 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12755
12756 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12757 Without this fix, if a signal arrives just after memory fills up,
12758 'malloc' might be invoked reentrantly.
12759
12760 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12761 In other words, assume that every image size is allowed, on non-X
12762 hosts. This assumption is probably wrong, but it lets Emacs compile.
12763
12764 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12765
12766 * regex.c (re_iswctype): Convert return values to boolean.
12767
12768 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12769
12770 * xdisp.c (compute_display_string_pos): Don't use cached display
12771 string position if the buffer had its restriction changed.
12772 (Bug#9184)
12773
12774 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12775
12776 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12777
12778 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12779
12780 Integer signedness and overflow and related fixes. (Bug#9079)
12781
12782 * bidi.c: Integer size and overflow fixes.
12783 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12784 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12785 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12786 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12787 (bidi_find_other_level_edge):
12788 Use ptrdiff_t instead of EMACS_INT where either will do.
12789 This works better on 32-bit hosts configured --with-wide-int.
12790 (bidi_cache_ensure_space): Check for size-calculation overflow.
12791 Use % rather than repeated addition, for better worst-case speed.
12792 Don't set bidi_cache_size until after xrealloc returns, because it
12793 might not return.
12794 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12795 (bidi_cache_ensure_space): Also check that the bidi cache size
12796 does not exceed that of the largest Lisp string or buffer. See Eli
12797 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12798
12799 * alloc.c (__malloc_size_t): Remove.
12800 All uses replaced by size_t. See Andreas Schwab's note
12801 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12802
12803 * image.c: Improve checking for integer overflow.
12804 (check_image_size): Assume that f is nonnull, since
12805 it is always nonnull in practice. This is one less thing to
12806 worry about when checking for integer overflow later.
12807 (x_check_image_size): New function, which checks for integer
12808 overflow issues inside X.
12809 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12810 This removes the need for a memory_full check.
12811 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12812 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12813 (xbm_read_bitmap_data): Change locals back to 'int', since
12814 their values must fit in 'int'.
12815 (xpm_load_image, png_load, tiff_load):
12816 Invoke x_create_x_image_and_pixmap earlier,
12817 to avoid much needless work if the image is too large.
12818 (tiff_load): Treat overly large images as if
12819 x_create_x_image_and_pixmap failed, not as malloc failures.
12820 (gs_load): Use x_check_image_size.
12821
12822 * gtkutil.c: Omit integer casts.
12823 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12824 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12825
12826 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12827
12828 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12829 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12830 would wrongly return t on a 64-bit host.
12831
12832 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12833 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12834 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12835 and therefore cause GCC to emit a bogus diagnostic in some cases.
12836
12837 * image.c: Integer signedness and overflow and related fixes.
12838 This is not an exhaustive set of fixes, but it's time to
12839 record what I've got.
12840 (lookup_pixel_color, check_image_size): Remove redundant decls.
12841 (check_image_size): Don't assume that arbitrary EMACS_INT values
12842 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12843 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12844 (tiff_load, imagemagick_load_image):
12845 Check for overflow in size calculations.
12846 (x_create_x_image_and_pixmap): Remove unnecessary test for
12847 xmalloc returning NULL; that can't happen.
12848 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12849 (xpm_color_bucket): Use better integer hashing function.
12850 (xpm_cache_color): Don't possibly over-allocate memory.
12851 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12852 (gif_memory_source):
12853 Use ptrdiff_t, not int or size_t, to record sizes.
12854 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12855 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12856 either works, as we prefer signed integers.
12857 (tiff_read_from_memory, tiff_write_from_memory):
12858 Return tsize_t, not size_t, since that's what the TIFF API wants.
12859 (tiff_read_from_memory): Don't fail simply because the read would
12860 go past EOF; instead, return a short read.
12861 (tiff_load): Omit no-longer-needed casts.
12862 (Fimagemagick_types): Don't assume size fits into 'int'.
12863
12864 Improve hashing quality when configured --with-wide-int.
12865 * fns.c (hash_string): New function, taken from sxhash_string.
12866 Do not discard information about ASCII character case; this
12867 discarding is no longer needed.
12868 (sxhash-string): Use it. Change sig to match it. Caller changed.
12869 * lisp.h: Declare it.
12870 * lread.c (hash_string): Remove, since we now use fns.c's version.
12871 The fns.c version returns a wider integer if --with-wide-int is
12872 specified, so this should help the quality of the hashing a bit.
12873
12874 * emacs.c: Integer overflow minor fix.
12875 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12876 Define only if GNU_LINUX.
12877 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12878
12879 * dispnew.c: Integer signedness and overflow fixes.
12880 Remove unnecessary forward decls, that were a maintenance hassle.
12881 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12882 All uses changed.
12883 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12884 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12885 (prepare_desired_row, line_draw_cost):
12886 Use int, not unsigned, where either works.
12887 (save_current_matrix, restore_current_matrix):
12888 Use ptrdiff_t, not size_t, where either works.
12889 (init_display): Check for overflow more accurately, and without
12890 relying on undefined behavior.
12891
12892 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12893 Remove, replacing with the new symbols in lisp.h. All uses changed.
12894 * fileio.c (make_temp_name):
12895 * filelock.c (lock_file_1, lock_file):
12896 * xdisp.c (message_dolog):
12897 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12898 Use pMd etc. instead.
12899 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12900 replacing the pWIDE etc. symbols removed from editfns.c.
12901
12902 * keyboard.h (num_input_events): Now uintmax_t.
12903 This is (very slightly) less likely to mess up due to wraparound.
12904 All uses changed.
12905
12906 * buffer.c: Integer signedness fixes.
12907 (alloc_buffer_text, enlarge_buffer_text):
12908 Use ptrdiff_t rather than size_t when either will do, as we prefer
12909 signed integers.
12910
12911 * alloc.c: Integer signedness and overflow fixes.
12912 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12913 (__malloc_size_t): Default to size_t, not to int.
12914 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12915 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12916 Prefer ptrdiff_t to size_t when either would do, as we prefer
12917 signed integers.
12918 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12919 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12920 Now const. Initialize with values that are in range even if char
12921 is signed.
12922 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12923 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12924 These functions do the right thing with sizes > 2**32.
12925 (check_depth): Now ptrdiff_t, not int.
12926 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12927 Adjust to new way of storing sizes. Check for size overflow bugs
12928 in rest of code.
12929 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12930 slightly wrong anyway, as it missed one instance of
12931 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12932 (refill_memory_reserve): Omit needless cast to size_t.
12933 (mark_object_loop_halt): Mark as externally visible.
12934
12935 * xselect.c: Integer signedness and overflow fixes.
12936 (Fx_register_dnd_atom, x_handle_dnd_message):
12937 Use ptrdiff_t, not size_t, since we prefer signed.
12938 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12939 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12940 x_dnd_atoms_size and x_dnd_atoms_length.
12941
12942 * doprnt.c: Prefer signed to unsigned when either works.
12943 * eval.c (verror):
12944 * doprnt.c (doprnt):
12945 * lisp.h (doprnt):
12946 * xdisp.c (vmessage):
12947 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12948 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12949 prefer signed arithmetic to avoid comparison confusion.
12950 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12951 but is a bit tricky.
12952
12953 Assume freestanding C89 headers, string.h, stdlib.h.
12954 * data.c, doprnt.c, floatfns.c, print.c:
12955 Include float.h unconditionally.
12956 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12957 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12958 * regex.c: Likewise for stddef.h, string.h.
12959 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12960 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12961 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12962 (STDC_HEADERS): Remove obsolete defines.
12963 * sysdep.c: Include limits.h unconditionally.
12964
12965 Assume support for memcmp, memcpy, memmove, memset.
12966 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12967 * regex.c (memcmp, memcpy):
12968 Remove; we assume C89 now.
12969
12970 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12971 (__malloc_safe_bcopy): Remove; no longer needed.
12972
12973 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12974 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12975 well either way, and we prefer signed to unsigned.
12976
12977 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12978
12979 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12980 closes the connection while we're reading (bug#9182).
12981
12982 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12983
12984 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12985 are specified (Bug#9168).
12986
12987 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12988
12989 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12990 Found by GCC static checking and --with-wide-int on a 32-bit host.
12991
12992 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12993
12994 * xdisp.c (compute_display_string_pos): Fix logic of caching
12995 previous display string position. Initialize cached_prev_pos to
12996 -1. Fixes slow-down at the beginning of a buffer.
12997
12998 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12999
13000 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13001 for attrs[LFACE_FONTSET_INDEX].
13002
13003 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13004
13005 * xml.c (parse_region): Remove unused local
13006 that was recently introduced.
13007
13008 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13009
13010 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13011 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13012
13013 * xdisp.c (move_it_in_display_line_to): Record the best matching
13014 position for TO_CHARPOS while scanning the line, and restore it on
13015 exit if none of the characters scanned was an exact match.
13016 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13017 when exact match is impossible due to invisible text, and the
13018 lines are truncated.
13019
13020 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13021
13022 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13023 for OSX >= 10.7.
13024
13025 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13026
13027 Fix a significant slow-down of cursor motion with C-n, C-p,
13028 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13029 auto-repeat under bidi redisplay in fontified buffers.
13030 * xdisp.c (compute_stop_pos_backwards): New function.
13031 (next_element_from_buffer): Call compute_stop_pos_backwards to
13032 find a suitable prev_stop when we find ourselves before
13033 base_level_stop.
13034 (reseat): Don't look for prev_stop, as that could mean a very long
13035 run.
13036 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13037 <cached_disp_overlay_modiff>: Cache for last found display string
13038 position.
13039 (compute_display_string_pos): Return the cached position if asked
13040 about the same buffer in the same area of character positions, and
13041 the buffer wasn't changed since the time the display string
13042 position was cached.
13043
13044 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13045
13046 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13047 is an integer, which is important for empty lines. (Bug#9149)
13048
13049 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13050
13051 * frame.c (Fmodify_frame_parameters): In tty case, update the
13052 default face if necessary (Bug#4238).
13053
13054 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13055
13056 * editfns.c (Fstring_to_char): No need to explain what a character
13057 is in the docstring (Bug#6576).
13058
13059 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13060
13061 * xml.c (parse_region): Make sure we always return a tree.
13062
13063 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13064
13065 * xml.c (parse_region): If a document contains only comments,
13066 return that, too.
13067
13068 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13069
13070 * xml.c (make_dom): Return comments, too.
13071
13072 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13073
13074 Port to OpenBSD.
13075 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13076 and the surrounding thread.
13077 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13078 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13079 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13080 timer goes off.
13081 * s/openbsd.h (BROKEN_SIGIO): Define.
13082 * unexelf.c (unexec) [__OpenBSD__]:
13083 Don't update the .mdebug section of the Alpha COFF symbol table.
13084
13085 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13086
13087 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13088 (bug#8460).
13089
13090 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13091
13092 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13093 This fixes some race conditions on the permissions of any newly
13094 created file.
13095
13096 * alloc.c (valid_pointer_p): Use pipe, not open.
13097 This fixes some permissions issues when debugging.
13098
13099 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13100 If fchown fails to set both uid and gid, try to set just gid,
13101 as that is sometimes allowed. Adjust the file's mode to eliminate
13102 setuid or setgid bits that are inappropriate if fchown fails.
13103
13104 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13105
13106 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13107 to compare Lisp_Objects.
13108 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13109 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13110 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13111
13112 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13113
13114 * lread.c (read_integer): Unread even EOF character.
13115 (read1): Likewise. Properly record start position of symbol.
13116
13117 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13118 symbol character follows.
13119
13120 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13121
13122 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13123 This works around a problem with the previous change to Fcopy_file.
13124 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13125 and without this change, GCC might complain about discarding
13126 fchown's return value.
13127
13128 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13129
13130 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13131
13132 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13133
13134 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13135
13136 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13137
13138 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13139 it's used from the C level.
13140
13141 * process.c: Use the same condition for POLL_FOR_INPUT in both
13142 keyboard.c and process.c (bug#1858).
13143
13144 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13145
13146 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13147 (Fgnutls_boot): Use it.
13148
13149 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13150
13151 * doc.c (Fsubstitute_command_keys): Revert last change.
13152
13153 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13154
13155 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13156 quotes the next character, and doesn't affect other longer
13157 sequences (bug#8935).
13158
13159 * lread.c (syms_of_lread): Clarify that is isn't only
13160 `eval-buffer' and `eval-defun' that's affected by
13161 `lexical-binding' (bug#8460).
13162
13163 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13164
13165 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13166 bidi redisplay when a line includes both an image and is truncated.
13167
13168 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13169
13170 Fix minor problems found by static checking.
13171 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13172 (elsz): Now a signed constant, not a size_t var. We prefer signed
13173 types to unsigned, to avoid integer comparison confusion. Without
13174 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13175 "cannot optimize loop, the loop counter may overflow", a symptom
13176 of the confusion.
13177 * indent.c (Fvertical_motion): Mark locals as initialized.
13178 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13179
13180 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13181
13182 * search.c (Fre_search_backward): Mention `case-fold-search' in
13183 all the re_search_* functions (bug#8138).
13184
13185 * keyboard.c (Fopen_dribble_file): Document when the file is
13186 closed (bug#8056).
13187
13188 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13189
13190 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13191 bidi_cache_idx.
13192
13193 Support bidi reordering of display and overlay strings.
13194 * xdisp.c (compute_display_string_pos)
13195 (compute_display_string_end): Accept additional argument STRING.
13196 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13197 (reseat_to_string): Initialize bidi_it->string.s and
13198 bidi_it->string.schars.
13199 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13200 NULL (avoids a crash in bidi_paragraph_init).
13201 Initialize itb.string.lstring.
13202 (init_iterator): Call bidi_init_it only of a valid
13203 buffer position was specified. Initialize paragraph_embedding to
13204 L2R.
13205 (reseat_to_string): Initialize the bidi iterator.
13206 (display_string): If we need to ignore text properties of
13207 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13208 original value of -1 will not work with bidi.)
13209 (compute_display_string_pos): First arg is now struct
13210 `text_pos *'; all callers changed. Support display properties on
13211 Lisp strings.
13212 (compute_display_string_end): Support display properties on Lisp
13213 strings.
13214 (init_iterator, reseat_1, reseat_to_string): Initialize the
13215 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13216 when iterating on a string not from display properties).
13217 (compute_display_string_pos, compute_display_string_end):
13218 Fix calculation of the object to scan. Fixes an error when using
13219 arrow keys.
13220 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13221 base_level_stop; instead, set base_level_stop to BEGV.
13222 Fixes crashes in vertical-motion.
13223 (next_element_from_buffer): Improve commentary for when
13224 the iterator is before prev_stop.
13225 (init_iterator): Initialize bidi_p from the default value of
13226 bidi-display-reordering, not from buffer-local value. Use the
13227 buffer-local value only if initializing for buffer iteration.
13228 (handle_invisible_prop): Support invisible properties on strings
13229 that are being bidi-reordered.
13230 (set_iterator_to_next): Support bidi reordering of C strings and
13231 Lisp strings.
13232 (next_element_from_string): Support bidi reordering of Lisp
13233 strings.
13234 (handle_stop_backwards): Support Lisp strings as well.
13235 (display_string): Support display of R2L glyph rows.
13236 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13237 (init_iterator): Don't initialize it->bidi_p for strings
13238 here.
13239 (reseat_to_string): Initialize it->bidi_p for strings here.
13240 (next_element_from_string, next_element_from_c_string)
13241 (next_element_from_buffer): Add xassert's for correspondence
13242 between IT's object being iterated and it->bidi_it.string
13243 structure.
13244 (face_before_or_after_it_pos): Support bidi iteration.
13245 (next_element_from_c_string): Handle the case of the first string
13246 character that is not the first one in the visual order.
13247 (get_visually_first_element): New function, refactored from common
13248 parts of next_element_from_buffer, next_element_from_string, and
13249 next_element_from_c_string.
13250 (tool_bar_lines_needed, redisplay_tool_bar)
13251 (display_menu_bar): Force left-to-right direction. Add a FIXME
13252 comment for making that be controlled by a user option.
13253 (push_it, pop_it): Save and restore the state of the
13254 bidi iterator. Save and restore the bidi_p flag.
13255 (pop_it): Iterate out of display property for string iteration as
13256 well.
13257 (iterate_out_of_display_property): Support iteration over strings.
13258 (handle_single_display_spec): Set up it->bidi_it for iteration
13259 over a display string, and call bidi_init_it.
13260 (handle_single_display_spec, next_overlay_string)
13261 (get_overlay_strings_1, push_display_prop): Set up the bidi
13262 iterator for displaying display or overlay strings.
13263 (forward_to_next_line_start): Don't use the shortcut if
13264 bidi-iterating.
13265 (back_to_previous_visible_line_start): If handle_display_prop
13266 pushed the iterator stack, restore the internal state of the bidi
13267 iterator by calling bidi_pop_it same number of times.
13268 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13269 and we are bidi-iterating, don't decrement the iterator position;
13270 instead, set the first_elt flag in the bidi iterator, to produce
13271 the same effect.
13272 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13273 (push_display_prop): xassert that we are iterating a buffer.
13274 (push_it, pop_it): Save and restore paragraph_embedding member.
13275 (handle_single_display_spec, next_overlay_string)
13276 (get_overlay_strings_1, reseat_1, reseat_to_string)
13277 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13278 correctly. Don't assume unibyte strings are not bidi-reordered.
13279 (compute_display_string_pos)
13280 (compute_display_string_end): Fix handling the case of C string.
13281 (push_it, pop_it): Save and restore from_disp_prop_p.
13282 (handle_single_display_spec, push_display_prop): Set the
13283 from_disp_prop_p flag.
13284 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13285 (pop_it): Call iterate_out_of_display_property only if we are
13286 popping after iteration over a string that came from a display
13287 property. Fix a typo in popping stretch info. Add an assertion
13288 for verifying that the iterator position is in sync with the bidi
13289 iterator.
13290 (handle_single_display_spec, get_overlay_strings_1)
13291 (push_display_prop): Fix initialization of paragraph direction for
13292 string when that of the parent object is not yet determined.
13293 (reseat_1): Call bidi_init_it to resync the bidi
13294 iterator with IT's position. (Bug#7616)
13295 (find_row_edges): If ROW->start.pos gives position
13296 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13297 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13298 Reset the from_disp_prop_p flag.
13299 (SAVE_IT, RESTORE_IT): New macros.
13300 (pos_visible_p, face_before_or_after_it_pos)
13301 (back_to_previous_visible_line_start)
13302 (move_it_in_display_line_to, move_it_in_display_line)
13303 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13304 (try_scrolling, redisplay_window, display_line): Use them when
13305 saving a temporary copy of the iterator and restoring it back.
13306 (back_to_previous_visible_line_start, reseat_1)
13307 (init_iterator): Empty the bidi cache "stack".
13308 (move_it_in_display_line_to): If iterator ended up at
13309 EOL, but we never saw any buffer positions smaller than
13310 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13311 motion in bidi-reordered lines.
13312 (move_it_in_display_line_to): Record prev_method and prev_pos
13313 immediately before the call to set_iterator_to_next. Fixes cursor
13314 motion in bidi-reordered lines with stretch glyphs and strings
13315 displayed in margins. (Bug#8133) (Bug#8867)
13316 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13317 TO_CHARPOS.
13318 (pos_visible_p): Support positions in bidi-reordered lines.
13319 Save and restore bidi cache.
13320
13321 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13322 (bidi_paragraph_info): Delete unused struct.
13323 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13324 (bidi_cache_start): New variable.
13325 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13326 to zero.
13327 (bidi_cache_fetch_state, bidi_cache_search)
13328 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13329 (bidi_cache_find, bidi_peek_at_next_level)
13330 (bidi_level_of_next_char, bidi_find_other_level_edge)
13331 (bidi_move_to_visually_next): Compare cache index with
13332 bidi_cache_start rather than with zero.
13333 (bidi_fetch_char): Accept new argument STRING; all callers
13334 changed. Support iteration over a string. Support strings with
13335 display properties. Support unibyte strings. Fix the type of
13336 `len' according to what STRING_CHAR_AND_LENGTH expects.
13337 (bidi_paragraph_init, bidi_resolve_explicit_1)
13338 (bidi_resolve_explicit, bidi_resolve_weak)
13339 (bidi_level_of_next_char, bidi_move_to_visually_next):
13340 Support iteration over a string.
13341 (bidi_set_sor_type, bidi_resolve_explicit_1)
13342 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13343 can now be zero (for strings); special values 0 and -1 were
13344 changed to -1 and -2, respectively.
13345 (bidi_char_at_pos): New function.
13346 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13347 Call it instead of FETCH_MULTIBYTE_CHAR.
13348 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13349 initialized to valid values.
13350 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13351 values.
13352 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13353 the test for valid cached positions. Fix the logic for looking up
13354 the sentinel state in the cache. GCPRO the Lisp string we are
13355 iterating.
13356 (bidi_push_it, bidi_pop_it): New functions.
13357 (bidi_initialize): Initialize the bidi cache start stack pointer.
13358 (bidi_cache_ensure_space): New function, refactored from part of
13359 bidi_cache_iterator_state. Don't assume the required size is just
13360 one BIDI_CACHE_CHUNK away.
13361 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13362 (bidi_count_bytes, bidi_char_at_pos): New functions.
13363 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13364 always valid if bidi_cache_idx is valid.
13365 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13366 is valid if it's going to be used.
13367 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13368 (bidi_cache_fetch_state, bidi_cache_search)
13369 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13370 (bidi_cache_iterator_state, bidi_cache_find)
13371 (bidi_find_other_level_edge, bidi_cache_start_stack):
13372 All variables related to cache indices are now EMACS_INT.
13373
13374 * dispextern.h (struct bidi_string_data): New structure.
13375 (struct bidi_it): New member `string'. Make flag members be 1-bit
13376 fields, and put them last in the struct.
13377 (compute_display_string_pos, compute_display_string_end):
13378 Update prototypes.
13379 (bidi_push_it, bidi_pop_it): Add prototypes.
13380 (struct iterator_stack_entry): New members bidi_p,
13381 paragraph_embedding, and from_disp_prop_p.
13382 (struct it): Member bidi_p is now a bit field 1 bit wide.
13383 (bidi_shelve_cache, bidi_unshelve_cache):
13384 Declare prototypes.
13385
13386 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13387 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13388 and vector-like objects.
13389
13390 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13391 cache around display iteration.
13392
13393 * window.c (Fwindow_end, window_scroll_pixel_based)
13394 (displayed_window_lines, Frecenter): Save and restore the bidi
13395 cache around display iteration.
13396
13397 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13398
13399 * editfns.c (Fdelete_region): Clarify the use of the named
13400 parameters (bug#6788).
13401
13402 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13403
13404 * indent.c (Fvertical_motion): Set and restore w->pointm when
13405 saving and restoring the window's buffer (Bug#9006).
13406
13407 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13408
13409 * editfns.c (Fstring_to_char): Clarify just what is returned
13410 (bug#6576). Text by Eli Zaretskii.
13411
13412 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13413
13414 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13415
13416 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13417
13418 * buffer.c (mmap_find): Fix a typo.
13419
13420 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13421
13422 Fix execution of x selection hooks.
13423 * xselect.c (Qx_lost_selection_functions)
13424 (Qx_sent_selection_functions): New vars.
13425 (syms_of_xselect): DEFSYM them.
13426 (x_handle_selection_request): Pass Qx_sent_selection_functions
13427 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13428 (x_handle_selection_clear,x_clear_frame_selections):
13429 Pass Qx_lost_selection_functions rather than
13430 Vx_lost_selection_functions to Frun_hook_with_args.
13431
13432 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13433
13434 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13435 The old code sometimes used this field without initializing it.
13436
13437 * alloc.c (gc_sweep): Don't read past end of array.
13438 In theory, the old code could also have corrupted Emacs internals,
13439 though it'd be very unlikely.
13440
13441 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13442
13443 * character.c (Fcharacterp): Don't advertise optional ignored
13444 argument. (Bug#4026)
13445
13446 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13447
13448 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13449 key" (bug#4257).
13450
13451 * window.c (Fset_window_start): Doc fix (bug#4199).
13452 (Fset_window_hscroll): Ditto.
13453
13454 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13455
13456 Fix minor new problems caught by GCC 4.6.1.
13457 * term.c (init_tty): Remove unused local.
13458 * xsettings.c (store_monospaced_changed): Define this function only
13459 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13460 not used otherwise.
13461
13462 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13463
13464 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13465
13466 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13467
13468 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13469 are the mini-buffer and the echo area (bug#3320).
13470
13471 * term.c (init_tty): Remove support for supdup, c10 and perq
13472 terminals, which are no longer supported (bug#1482).
13473
13474 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13475
13476 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13477
13478 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13479
13480 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13481 for non-popups (Bug#3642).
13482
13483 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13484
13485 * alloc.c (reset_malloc_hooks): Protoize.
13486 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13487 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13488 * cm.c (losecursor): Likewise.
13489 * data.c (fmod): Likewise.
13490 * dispnew.c (swap_glyphs_in_rows): Likewise.
13491 * emacs.c (memory_warning_signal): Likewise.
13492 * floatfns.c (float_error): Likewise.
13493 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13494 (otf_open, font_otf_capability, generate_otf_features)
13495 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13496 Likewise.
13497 * image.c (pbm_read_file): Likewise.
13498 * indent.c (string_display_width): Likewise.
13499 * intervals.c (check_for_interval, search_for_interval)
13500 (inc_interval_count, count_intervals, root_interval)
13501 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13502 * lread.c (defalias): Likewise.
13503 * ralloc.c (r_alloc_check): Likewise.
13504 * regex.c (set_image_of_range_1, set_image_of_range)
13505 (regex_grow_registers): Likewise.
13506 * sysdep.c (strerror): Likewise.
13507 * termcap.c (valid_filename_p, tprint, main): Likewise.
13508 * tparam.c (main): Likewise.
13509 * unexhp9k800.c (run_time_remap, save_data_space)
13510 (update_file_ptrs, read_header, write_header, calculate_checksum)
13511 (copy_file, copy_rest, display_header): Likewise.
13512 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13513 Likewise.
13514 * xdisp.c (check_it): Likewise.
13515 * xfaces.c (register_color, unregister_color, unregister_colors):
13516 Likewise.
13517 * xfns.c (print_fontset_result): Likewise.
13518 * xrdb.c (member, fatal, main): Likewise.
13519
13520 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13521
13522 Fix minor problems found by static checking (Bug#9031).
13523 * chartab.c (char_table_set_range, map_sub_char_table):
13524 Remove unused locals.
13525 (uniprop_table): Now static.
13526 * composite.c (_work_char): Remove unused static var.
13527
13528 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
13529
13530 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13531
13532 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13533
13534 * gtkutil.c (qttip_cb): Remove code without function.
13535
13536 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13537
13538 * w32.c (pthread_sigmask): New stub.
13539
13540 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13541
13542 Use pthread_sigmask, not sigprocmask (Bug#9010).
13543 sigprocmask is portable only for single-threaded applications, and
13544 Emacs can be multi-threaded when it uses GTK.
13545 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13546 (LIBES): Use it.
13547 * callproc.c (Fcall_process):
13548 * process.c (create_process):
13549 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13550 Use pthread_sigmask, not sigprocmask.
13551
13552 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13553
13554 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13555 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13556 wrong (Bug#8591).
13557
13558 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13559
13560 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13561 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13562 (xg_hide_tooltip): Fix comment.
13563
13564 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13565 in registerServicesMenuSendTypes.
13566 (validRequestorForSendType): Don't check ns_return_types.
13567
13568 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13569 ns_return_type.
13570
13571 2011-07-08 Jason Rumney <jasonr@gnu.org>
13572
13573 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13574 SH_SHOW for hidden windows (Bug#5482).
13575
13576 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13577 frame struct members of non-existent frames (Bug#6284).
13578
13579 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13580
13581 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13582 variable firstTime not needed on OSX >= 10.6.
13583 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13584 >= 10.5. Use setKnobProportion, setDoubleValue.
13585
13586 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13587 (MAC_OS_X_VERSION_10_5): Define if not defined.
13588 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13589 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13590 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13591
13592 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13593 cString and lossyCString on OSX >= 10.4.
13594
13595 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13596 sizeToFit on OSX >= 10.2.
13597
13598 * nsimage.m (allocInitFromFile): Don't use deprecated method
13599 bestRepresentationForDevice on OSX >= 10.6.
13600
13601 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13602 to avoid warning.
13603
13604 * emacs.c: Declare unexec_init_emacs_zone.
13605
13606 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13607
13608 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13609
13610 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13611 on svcsMenu (Bug#8842).
13612
13613 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13614 ns_return_types.
13615 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13616
13617 * nsterm.m (QUTF8_STRING): Declare.
13618 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13619 (validRequestorForSendType): Return type is (id).
13620 Change indexOfObjectIdenticalTo to indexOfObject.
13621 Check if we have local selection before returning self (Bug#8842).
13622 (writeSelectionToPasteboard): Put local selection into paste board
13623 if we have a local selection (Bug#8842).
13624 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13625
13626 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13627 (ns_get_local_selection): Declare.
13628
13629 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13630
13631 * keymap.c (describe_map_tree): Don't insert a double newline at
13632 the end of the buffer (bug#1169) and return whether we inserted
13633 something.
13634
13635 * callint.c (Fcall_interactively): Change "reading args" to
13636 "providing args" to try to clarify what it does (bug#1010).
13637
13638 2011-07-07 Kenichi Handa <handa@m17n.org>
13639
13640 * composite.c (composition_compute_stop_pos): Ignore a static
13641 composition starting before CHARPOS (Bug#8915).
13642
13643 * xdisp.c (handle_composition_prop): Likewise.
13644
13645 2011-07-07 Eli Zaretskii <eliz@gnu.org>
13646
13647 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13648 (Bug#9015)
13649
13650 2011-07-07 Kenichi Handa <handa@m17n.org>
13651
13652 * character.h (unicode_category_t): New enum type.
13653
13654 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13655 (Qchar_code_property_table): New variable.
13656 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13657 (UNIPROP_COMPRESSED_FORM_P): New macros.
13658 (char_table_ascii): Uncompress the compressed values.
13659 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13660 Uncompress the compressed values.
13661 (sub_char_table_ref_and_range): Likewise.
13662 (char_table_ref_and_range): Uncompress the compressed values.
13663 (sub_char_table_set): New arg is_uniprop. Callers changed.
13664 Uncompress the compressed values.
13665 (sub_char_table_set_range): Args changed. Callers changed.
13666 (char_table_set_range): Adjuted for the above change.
13667 (map_sub_char_table): Delete args default_val and parent. Add arg
13668 top. Give decoded values to a Lisp function.
13669 (map_char_table): Adjust for the above change. Give decoded
13670 values to a Lisp function. Gcpro more variables.
13671 (uniprop_table_uncompress)
13672 (uniprop_decode_value_run_length): New functions.
13673 (uniprop_decoder, uniprop_decoder_count): New variables.
13674 (uniprop_get_decoder, uniprop_encode_value_character)
13675 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13676 New functions.
13677 (uniprop_encoder, uniprop_encoder_count): New variables.
13678 (uniprop_get_encoder, uniprop_table)
13679 (Funicode_property_table_internal, Fget_unicode_property_internal)
13680 (Fput_unicode_property_internal): New functions.
13681 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13682 Sunicode_property_table_internal, Sget_unicode_property_internal,
13683 and Sput_unicode_property_internal. Defvar_lisp
13684 char-code-property-alist.
13685
13686 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13687 Vunicode_category_table.
13688
13689 * font.c (font_range): Adjust for the change of
13690 Vunicode_category_table.
13691
13692 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13693
13694 * m/iris4d.h: Remove file, move contents ...
13695 * s/irix6-5.h: ... here.
13696
13697 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13698
13699 Remove unportable assumption about struct layout (Bug#8884).
13700 * alloc.c (mark_buffer):
13701 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13702 (clone_per_buffer_values): Don't assume that
13703 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13704 This isn't true in general, and it's particularly not true
13705 if Emacs is configured with --with-wide-int.
13706 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13707 New macros, used in the buffer.c change.
13708
13709 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13710
13711 * xsettings.c: Use both GConf and GSettings if both are available.
13712 (store_config_changed_event): Add comment.
13713 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13714 (store_tool_bar_style_changed): New functions.
13715 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
13716 (struct xsettings): Move font inside HAVE_XFT.
13717 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13718 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13719 Move inside HAVE_XFT.
13720 (something_changed_gsettingsCB): Rename from something_changedCB.
13721 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13722 also.
13723 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13724 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
13725 (something_changed_gconfCB): Rename from something_changedCB.
13726 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13727 (parse_settings): Move check for font inside HAVE_XFT.
13728 (read_settings, apply_xft_settings): Add comment.
13729 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13730 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13731 call store_font_name_changed.
13732 (xft_settings_event): Add comment.
13733 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13734 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13735 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13736 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13737 (xsettings_initialize): Call init_gsettings last.
13738 (xsettings_get_system_font, xsettings_get_system_normal_font):
13739 Add comment.
13740
13741 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13742
13743 Random fixes. E.g., (random) never returned negative values.
13744 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13745 subseconds part to the entropy, as that's a bit more random.
13746 Prefer signed to unsigned, since the signedness doesn't matter and
13747 in general we prefer signed. When given a limit, use a
13748 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13749 latter isn't right if USE_2_TAGS_FOR_INTS.
13750 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13751 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13752
13753 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13754
13755 * textprop.c (text_property_stickiness):
13756 Obey Vtext_property_default_nonsticky.
13757 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13758 * w32fns.c (syms_of_w32fns):
13759 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13760
13761 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13762
13763 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13764 This is more efficient than Ffile_directory_p and avoids a minor race.
13765
13766 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13767
13768 * buffer.c (Foverlay_put): Say what the return value is
13769 (bug#7835).
13770
13771 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13772 is a directory before asking whether to use the file name
13773 (bug#7564).
13774 (barf_or_query_if_file_exists): Make the "File is a directory"
13775 error be more correct.
13776
13777 * fns.c (Frequire): Remove the mention of the .gz files, since
13778 that's installation-specific, but keep the mention of
13779 `get-load-suffixes'.
13780
13781 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13782
13783 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13784 Report string overflow if the output is too long.
13785
13786 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
13787
13788 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13789 (syms_of_gnutls): Remove duplicate DEFSYM for
13790 Qgnutls_bootprop_verify_hostname_error, an error for
13791 Qgnutls_bootprop_verify_error (which is no longer used).
13792
13793 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13794 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13795 Also (re)move comments that are misplaced or no longer relevant.
13796
13797 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13798
13799 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13800
13801 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
13802
13803 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13804 and background color parameters if they have been changed.
13805
13806 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13807
13808 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13809
13810 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13811
13812 * xsettings.c (SYSTEM_FONT): Define only when used.
13813 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13814
13815 * keymap.c (access_keymap_1): Now static.
13816
13817 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
13818
13819 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13820 leave any prefix arg for the up event (Bug#1586).
13821
13822 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13823
13824 * lread.c (syms_of_lread): Mention single symbols defined by
13825 `defvar' or `defconst' (bug#7154).
13826
13827 * fns.c (Frequire): Mention .el.gz files (bug#7314).
13828 (Frequire): Mention get-load-suffixes.
13829
13830 2011-07-02 Martin Rudalics <rudalics@gmx.at>
13831
13832 * window.h (window): Remove clone_number slot.
13833 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13834 Remove.
13835 (make_parent_window, make_window, saved_window)
13836 (Fset_window_configuration, save_window_save): Don't deal with
13837 clone numbers.
13838 * buffer.c (Qclone_number): Remove declaration.
13839 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13840
13841 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13842
13843 Add multiple inheritance to keymaps.
13844 * keymap.c (Fmake_composed_keymap): New function.
13845 (Fset_keymap_parent): Simplify.
13846 (fix_submap_inheritance): Remove.
13847 (access_keymap_1): New function extracted from access_keymap to handle
13848 embedded parents and handle lists of maps.
13849 (access_keymap): Use it.
13850 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13851 (Fcopy_keymap): Handle embedded parents.
13852 (Fcommand_remapping, define_as_prefix): Simplify.
13853 (Fkey_binding): Simplify.
13854 (syms_of_keymap): Move minibuffer-local-completion-map,
13855 minibuffer-local-filename-completion-map,
13856 minibuffer-local-must-match-map, and
13857 minibuffer-local-filename-must-match-map to Elisp.
13858 (syms_of_keymap): Defsubr make-composed-keymap.
13859 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13860 (parse_menu_item): Trivial simplification.
13861
13862 2011-07-01 Glenn Morris <rgm@gnu.org>
13863
13864 * Makefile.in (SETTINGS_LIBS): Fix typo.
13865
13866 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13867
13868 * coding.c (Fencode_coding_string): Record the last coding system
13869 used, as the function doc string says (bug#8738).
13870
13871 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13872
13873 * xsettings.c (store_monospaced_changed): Take new font as arg and
13874 check for change against current_mono_font.
13875 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13876 (emacs_settings_constructor, emacs_settings_get_property)
13877 (emacs_settings_set_property, emacs_settings_class_init)
13878 (emacs_settings_init, gsettings_obj): Remove.
13879 (something_changedCB): New function for HAVE_GSETTINGS.
13880 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13881 with value as argument.
13882 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13883 g_settings_new (Bug#8967). Do not create gsettings_obj.
13884 Remove calls to g_settings_bind. Connect something_changedCB to
13885 "changed".
13886
13887 * xgselect.c: Add defined (HAVE_GSETTINGS).
13888 (xgselect_initialize): Ditto.
13889
13890 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13891 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13892 xg_select.
13893
13894 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13895
13896 * eval.c (struct backtrace): Simplify and port the data structure.
13897 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13898 signed bit field, as this assumption is not portable and it makes
13899 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13900 "char debug_on_exit : 1" as this is not portable either; instead,
13901 use the portable "unsigned int debug_on_exit : 1". Remove unused
13902 member evalargs. Remove obsolete comments about cc bombing out.
13903
13904 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13905
13906 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
13907 Let HAVE_GSETTINGS override HAVE_GCONF.
13908 (store_monospaced_changed): New function.
13909 (EMACS_SETTINGS): A new type derived from GObject to handle
13910 GSettings notifications.
13911 (emacs_settings_constructor, emacs_settings_get_property)
13912 (emacs_settings_set_property, emacs_settings_class_init):
13913 New functions.
13914 (gsettings_client, gsettings_obj): New variables.
13915 (GSETTINGS_SCHEMA): New define.
13916 (something_changedCB): Call store_monospaced_changed.
13917 (init_gsettings): New function.
13918 (xsettings_initialize): Call init_gsettings.
13919 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13920 to NULL.
13921
13922 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13923 GCONF_CFLAGS/LIBS.
13924
13925 2011-06-29 Martin Rudalics <rudalics@gmx.at>
13926
13927 * window.c (resize_root_window, grow_mini_window)
13928 (shrink_mini_window): Rename Qresize_root_window to
13929 Qwindow_resize_root_window and Qresize_root_window_vertically to
13930 Qwindow_resize_root_window_vertically.
13931
13932 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13933
13934 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13935
13936 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
13937
13938 * makefile.w32-in: Redesign dependencies so they reflect more
13939 clearly which files are directly included by each source file,
13940 and not through other includes.
13941
13942 2011-06-27 Martin Rudalics <rudalics@gmx.at>
13943
13944 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13945 (sort_overlays, overlay_strings): When an overlay's clone number
13946 matches the window's clone number process the overlay even if
13947 the overlay's window property doesn't match the current window.
13948
13949 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13950 (Fwindow_hchild): Rename to Fwindow_left_child.
13951 (Fwindow_next): Rename to Fwindow_next_sibling.
13952 (Fwindow_prev): Rename to Fwindow_prev_sibling.
13953 (resize_window_check): Rename to window_resize_check.
13954 (resize_window_apply): Rename to window_resize_apply.
13955 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13956 (Fdelete_other_windows_internal, resize_frame_windows)
13957 (Fsplit_window_internal, Fdelete_window_internal)
13958 (grow_mini_window, shrink_mini_window)
13959 (Fresize_mini_window_internal): Fix callers accordingly.
13960
13961 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13962
13963 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13964 (emacs_fixed_set_min_size): Remove.
13965 (emacs_fixed_new): Take frame as argument.
13966
13967 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13968 (_EmacsFixedPrivate): Remove minwidth/height.
13969 Add struct frame *f.
13970 (emacs_fixed_init): Initialize priv->f.
13971 (get_parent_class, emacs_fixed_set_min_size): Remove.
13972 (emacs_fixed_new): Set priv->f to argument.
13973 (emacs_fixed_get_preferred_width)
13974 (emacs_fixed_get_preferred_height): Use min_width/height from
13975 frames size_hint to set minimum and natural (Bug#8919).
13976 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13977 and use min_width/height from frames size_hint to set
13978 min_width/height (Bug#8919).
13979
13980 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13981 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13982 Fix indentation.
13983
13984 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13985
13986 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13987 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13988 called at ZV.
13989
13990 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13991
13992 * process.c (wait_reading_process_output): Bypass select if
13993 waiting for a cell while ignoring keyboard input, and input is
13994 pending. Suggested by Jan Djärv (Bug#8869).
13995
13996 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13997
13998 Use gnulib's dup2 module instead of rolling our own.
13999 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14000
14001 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14002
14003 * dispnew.c (scrolling_window): Before scrolling, turn off a
14004 mouse-highlight in the window being scrolled.
14005
14006 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14007
14008 Move DEFSYM to lisp.h and use everywhere.
14009
14010 * character.h (DEFSYM): Move declaration...
14011 * lisp.h (DEFSYM): ...here.
14012
14013 * gnutls.c:
14014 * minibuf.c:
14015 * w32menu.c:
14016 * w32proc.c:
14017 * w32select.c: Don't include character.h.
14018
14019 * alloc.c (syms_of_alloc):
14020 * buffer.c (syms_of_buffer):
14021 * bytecode.c (syms_of_bytecode):
14022 * callint.c (syms_of_callint):
14023 * casefiddle.c (syms_of_casefiddle):
14024 * casetab.c (init_casetab_once):
14025 * category.c (init_category_once, syms_of_category):
14026 * ccl.c (syms_of_ccl):
14027 * cmds.c (syms_of_cmds):
14028 * composite.c (syms_of_composite):
14029 * dbusbind.c (syms_of_dbusbind):
14030 * dired.c (syms_of_dired):
14031 * dispnew.c (syms_of_display):
14032 * doc.c (syms_of_doc):
14033 * editfns.c (syms_of_editfns):
14034 * emacs.c (syms_of_emacs):
14035 * eval.c (syms_of_eval):
14036 * fileio.c (syms_of_fileio):
14037 * fns.c (syms_of_fns):
14038 * frame.c (syms_of_frame):
14039 * fringe.c (syms_of_fringe):
14040 * insdel.c (syms_of_insdel):
14041 * keymap.c (syms_of_keymap):
14042 * lread.c (init_obarray, syms_of_lread):
14043 * macros.c (syms_of_macros):
14044 * msdos.c (syms_of_msdos):
14045 * print.c (syms_of_print):
14046 * process.c (syms_of_process):
14047 * search.c (syms_of_search):
14048 * sound.c (syms_of_sound):
14049 * syntax.c (init_syntax_once, syms_of_syntax):
14050 * terminal.c (syms_of_terminal):
14051 * textprop.c (syms_of_textprop):
14052 * undo.c (syms_of_undo):
14053 * w32.c (globals_of_w32):
14054 * window.c (syms_of_window):
14055 * xdisp.c (syms_of_xdisp):
14056 * xfaces.c (syms_of_xfaces):
14057 * xfns.c (syms_of_xfns):
14058 * xmenu.c (syms_of_xmenu):
14059 * xsettings.c (syms_of_xsettings):
14060 * xterm.c (syms_of_xterm): Use DEFSYM.
14061
14062 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14063
14064 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14065
14066 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14067
14068 Integer and buffer overflow fixes (Bug#8873).
14069
14070 * print.c (printchar, strout): Check for string overflow.
14071 (PRINTPREPARE, printchar, strout):
14072 Don't set size unless allocation succeeds.
14073
14074 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14075 for sizes. Check for string overflow more accurately.
14076 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14077
14078 * macros.c: Integer and buffer overflow fixes.
14079 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14080 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14081 Use ptrdiff_t, not int, for sizes.
14082 Don't increment bufsize until after realloc succeeds.
14083 Check for size-calculation overflow.
14084 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14085
14086 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14087
14088 * lread.c: Integer overflow fixes.
14089 (read_integer): Radix is now EMACS_INT, not int,
14090 to improve quality of diagnostics for out-of-range radices.
14091 Calculate buffer size correctly for out-of-range radices.
14092 (read1): Check for integer overflow in radices, and in
14093 read-circle numbers.
14094 (read_escape): Avoid int overflow.
14095 (Fload, openp, read_buffer_size, read1)
14096 (substitute_object_recurse, read_vector, read_list, map_obarray):
14097 Use ptrdiff_t, not int, for sizes.
14098 (read1): Use EMACS_INT, not int, for sizes.
14099 Check for size overflow.
14100
14101 * image.c (cache_image): Check for size arithmetic overflow.
14102
14103 * lread.c: Integer overflow issues.
14104 (saved_doc_string_size, saved_doc_string_length)
14105 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14106 Now ptrdiff_t, not int.
14107 (read1): Don't assume doc string length fits in int. Check for
14108 out-of-range doc string lengths.
14109 (read_list): Don't assume file position fits in int.
14110 (read_escape): Check for hex character overflow.
14111
14112 2011-06-22 Leo Liu <sdl.web@gmail.com>
14113
14114 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14115 Move to minibuffer.el.
14116
14117 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14118
14119 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14120 The following patches are for when GLYPH_DEBUG && !XASSERT.
14121 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14122 * dispnew.c (flush_stdout):
14123 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14124 Mark as externally visible.
14125 * dispnew.c (check_window_matrix_pointers): Now static.
14126 * dispnew.c (window_to_frame_vpos):
14127 * xfns.c (unwind_create_frame):
14128 * xterm.c (x_check_font): Remove unused local.
14129 * scroll.c (CHECK_BOUNDS):
14130 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14131 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14132 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14133 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14134 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14135 Now static.
14136 (debug_method_add): Use va_list and vsprintf rather than relying
14137 on undefined behavior with wrong number of arguments.
14138 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14139 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14140 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14141 since we're not interested in debugging glyphs with old libraries.
14142 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14143 GCC 4.6.0's static checking.
14144
14145 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14146
14147 Integer overflow and signedness fixes (Bug#8873).
14148 A few related buffer overrun fixes, too.
14149
14150 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14151
14152 * dispextern.h (struct face.stipple):
14153 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14154 (x_bitmap_mask, x_allocate_bitmap_record)
14155 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14156 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14157 (x_create_bitmap_from_xpm_data):
14158 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14159 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14160 (.bitmaps_last):
14161 * xfaces.c (load_pixmap):
14162 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14163 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14164 (.bitmaps_last, struct x_output.icon_bitmap):
14165 Use ptrdiff_t, not int, for bitmap indexes.
14166 (x_allocate_bitmap_record): Check for size overflow.
14167 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14168
14169 Use ptrdiff_t, not int, for overlay counts.
14170 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14171 * editfns.c (overlays_around, get_pos_property):
14172 * textprop.c (get_char_property_and_overlay):
14173 * xdisp.c (next_overlay_change, note_mouse_highlight):
14174 * xfaces.c (face_at_buffer_position):
14175 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14176 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14177 (Fnext_overlay_change, Fprevious_overlay_change)
14178 (mouse_face_overlay_overlaps, Foverlays_in):
14179 Use ptrdiff_t, not int, for sizes.
14180 (overlays_at, overlays_in): Check for size-calculation overflow.
14181
14182 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14183
14184 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14185 (x_session_initialize): Do not assume string length fits in int.
14186
14187 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14188 This is unlikely, but can occur if DPI is outlandish.
14189
14190 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14191 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14192
14193 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14194 * xrdb.c (magic_file_p, search_magic_path):
14195 Omit last arg SUFFIX; it was always 0. All callers changed.
14196 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14197
14198 * xfont.c (xfont_match): Avoid need for strlen.
14199
14200 * xfns.c: Don't assume strlen fits in int.
14201 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14202
14203 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14204 not unsigned long, as we prefer signed integers. All callers changed.
14205 Detect integer overflow in repeat count.
14206 (message_dolog): Don't assume print length fits in 39 bytes.
14207 (display_mode_element): Don't assume strlen fits in int.
14208
14209 * termcap.c: Don't assume sizes fit in int and never overflow.
14210 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14211 (gobble_line): Check for size-calculation overflow.
14212
14213 * minibuf.c (Fread_buffer):
14214 * lread.c (intern, intern_c_string):
14215 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14216 Don't assume string length fits in int.
14217
14218 * keyboard.c (parse_tool_bar_item):
14219 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14220
14221 * font.c: Don't assume string length fits in int.
14222 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14223 Use ptrdiff_t, not int.
14224 (font_intern_prop): Don't assume string length fits in int.
14225 Don't assume integer property fits in fixnum.
14226 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14227
14228 * filelock.c: Fix some buffer overrun and integer overflow issues.
14229 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14230 Reformulate so as not to need the command string.
14231 Invoke gzip -cd rather than gunzip, as it's more portable.
14232 (lock_info_type, lock_file_1, lock_file):
14233 Don't assume pid_t and time_t fit in unsigned long.
14234 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14235 (current_lock_owner): Prefer signed type for sizes.
14236 Use memcpy, not strncpy, where memcpy is what is really wanted.
14237 Don't assume (via atoi) that time_t and pid_t fit in int.
14238 Check for time_t and/or pid_t out of range, e.g., via a network share.
14239 Don't alloca where an auto var works fine.
14240
14241 * fileio.c: Fix some integer overflow issues.
14242 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14243 Don't assume string length fits in int.
14244 (directory_file_name): Don't assume string length fits in long.
14245 (make_temp_name): Don't assume pid fits in int, or that its print
14246 length is less than 20.
14247
14248 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14249
14250 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14251
14252 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14253
14254 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14255 We prefer signed integers, even for size calculations.
14256
14257 * emacs.c: Don't assume string length fits in 'int'.
14258 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14259 (main): Don't invoke strlen when not needed.
14260
14261 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14262 (XD_DEBUG_MESSAGE): Don't waste a byte.
14263
14264 * callproc.c (getenv_internal_1, getenv_internal)
14265 (Fgetenv_internal):
14266 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14267
14268 * lread.c (invalid_syntax): Omit length argument.
14269 All uses changed. This doesn't fix a bug, but it simplifies the
14270 code away from its former Hollerith-constant appearance, and it's
14271 one less 'int' to worry about when looking at integer-overflow issues.
14272 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14273
14274 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14275 This didn't break anything, but it didn't help either.
14276 It's confusing to put a bogus integer in a place where the actual
14277 value does not matter.
14278 (LIST_END_P): Remove unused macro and its bogus comment.
14279 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14280
14281 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14282 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14283 implementation.
14284 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14285 We prefer signed types, and the value cannot exceed the EMACS_INT
14286 range anyway (because otherwise the length would not be representable).
14287 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14288 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14289 This avoids a GCC warning when WIDE_EMACS_INT.
14290
14291 * indent.c (sane_tab_width): New function.
14292 (current_column, scan_for_column, Findent_to, position_indentation)
14293 (compute_motion): Use it. This is just for clarity.
14294 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14295
14296 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14297
14298 * lisp.h (lint_assume): New macro.
14299 * composite.c (composition_gstring_put_cache):
14300 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14301
14302 * editfns.c, insdel.c:
14303 Omit unnecessary forward decls, to simplify future changes.
14304
14305 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14306
14307 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14308
14309 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14310 Use much-faster test for byte-length change.
14311 Don't assume string byte-length fits in 'int'.
14312 Check that character arg fits in 'int'.
14313 (mapcar1): Declare byte as byte, for clarity.
14314
14315 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14316
14317 * fns.c (concat): Catch string overflow earlier.
14318 Do not rely on integer wraparound.
14319
14320 * dispextern.h (struct it.overlay_strings_charpos)
14321 (struct it.selective): Now EMACS_INT, not int.
14322 * xdisp.c (forward_to_next_line_start)
14323 (back_to_previous_visible_line_start)
14324 (reseat_at_next_visible_line_start, next_element_from_buffer):
14325 Don't arbitrarily truncate the value of 'selective' to int.
14326
14327 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14328
14329 * composite.c: Don't truncate sizes to 'int'.
14330 (composition_gstring_p, composition_reseat_it)
14331 (composition_adjust_point): Use EMACS_INT, not int.
14332 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14333 not EMACS_UINT, for indexes.
14334
14335 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14336
14337 * buffer.c: Include <verify.h>.
14338 (struct sortvec.priority, struct sortstr.priority):
14339 Now EMACS_INT, not int.
14340 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14341 (struct sortstr.size, record_overlay_string)
14342 (struct sortstrlist.size, struct sortlist.used):
14343 Don't truncate size to int.
14344 (record_overlay_string): Check for size-calculation overflow.
14345 (init_buffer_once): Check at compile-time, not run-time.
14346
14347 2011-06-22 Jim Meyering <meyering@redhat.com>
14348
14349 Don't leak an XBM-image-sized buffer
14350 * image.c (xbm_load): Free the image buffer after using it.
14351
14352 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14353
14354 Port to Sun C.
14355 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14356 that Sun C diagnosed.
14357 * fns.c (secure_hash): Fix pointer signedness issue.
14358 * intervals.c (static_offset_intervals): New function.
14359 (offset_intervals): Use it.
14360
14361 2011-06-21 Leo Liu <sdl.web@gmail.com>
14362
14363 * deps.mk (fns.o):
14364 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14365 sha512.h.
14366
14367 * fns.c (secure_hash): Rename from crypto_hash_function and change
14368 the first arg to accept symbols.
14369 (Fsecure_hash): New primitive.
14370 (syms_of_fns): New symbols.
14371
14372 2011-06-20 Deniz Dogan <deniz@dogan.se>
14373
14374 * process.c (Fset_process_buffer): Clarify return value in
14375 docstring.
14376
14377 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14378
14379 * dispnew.c (add_window_display_history): Use BVAR.
14380
14381 * xdisp.c (debug_method_add): Use BVAR.
14382 (check_window_end, dump_glyph_matrix, dump_glyph)
14383 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14384
14385 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14386 Likewise.
14387
14388 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14389 check till after the cache is created in init_frame_faces.
14390
14391 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14392
14393 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14394
14395 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14396
14397 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14398 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14399 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14400
14401 Improve buffer-overflow checking (Bug#8873).
14402 * fileio.c (Finsert_file_contents):
14403 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14404 Remove the old (too-loose) buffer overflow checks.
14405 They weren't needed, since make_gap checks for buffer overflow.
14406 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14407 The old code merely checked for Emacs fixnum overflow, and relied
14408 on undefined (wraparound) behavior. The new code avoids undefined
14409 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14410
14411 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14412 Tune. Don't use wider integers than needed. Don't use alloca.
14413 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14414
14415 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14416
14417 * insdel.c, lisp.h (buffer_overflow): New function.
14418 (insert_from_buffer_1, replace_range, replace_range_2):
14419 * insdel.c (make_gap_larger):
14420 * editfns.c (Finsert_char):
14421 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14422
14423 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14424
14425 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14426
14427 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14428
14429 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14430 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14431
14432 * fileio.c: Don't assume EMACS_INT fits in off_t.
14433 (emacs_lseek): New static function.
14434 (Finsert_file_contents, Fwrite_region): Use it.
14435 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14436
14437 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14438
14439 * fns.c: Don't overflow int when computing a list length.
14440 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14441 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14442 truncation on 64-bit hosts. Check for QUIT every
14443 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14444 faster and is responsive enough.
14445 (Flength): Report an error instead of overflowing an integer.
14446 (Fsafe_length): Return a float if the value is not representable
14447 as a fixnum. This shouldn't happen except in contrived situations.
14448 (Fnthcdr, Fsort): Don't assume list length fits in int.
14449 (Fcopy_sequence): Don't assume vector length fits in int.
14450
14451 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14452 (header_size, word_size): New constants.
14453 (allocate_vectorlike): Don't check size overflow here.
14454 (allocate_vector): Check it here instead, since this is the only
14455 caller of allocate_vectorlike that could cause overflow.
14456 Check that the new vector's length is representable as a fixnum.
14457
14458 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14459 The previous code was bogus. For example, next_almost_prime (32)
14460 returned 39, which is undesirable as it is a multiple of 3; and
14461 next_almost_prime (24) returned 25, which is a multiple of 5 so
14462 why was the code bothering to check for multiples of 7?
14463
14464 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14465
14466 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14467
14468 Variadic C functions now count arguments with ptrdiff_t.
14469 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14470 Back then I didn't know that the Emacs coding style prefers signed int.
14471 Also, in the meantime I found a few more instances where arguments
14472 were being counted with int, which may truncate counts on 64-bit
14473 machines, or EMACS_INT, which may be unnecessarily wide.
14474 * lisp.h (struct Lisp_Subr.function.aMANY)
14475 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14476 Arg counts are now ptrdiff_t, not size_t.
14477 All variadic functions and their callers changed accordingly.
14478 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14479 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14480 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14481 * callint.c (Fcall_interactively): Check arg count for overflow,
14482 to avoid potential buffer overrun. Use signed char, not 'int',
14483 for 'varies' array, so that we needn't bother to check its size
14484 calculation for overflow.
14485 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14486 * eval.c (apply_lambda):
14487 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14488 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14489 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14490
14491 * callint.c (Fcall_interactively): Don't use index var as event count.
14492
14493 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14494 * mem-limits.h (SIZE): Remove; no longer used.
14495
14496 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14497
14498 Remove unnecessary casts.
14499 * xterm.c (x_term_init):
14500 * xfns.c (x_set_border_pixel):
14501 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14502 These aren't needed now that we assume ANSI C.
14503
14504 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14505 It's more likely to cause problems (due to unsigned overflow)
14506 than to cure them.
14507
14508 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14509
14510 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14511
14512 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14513
14514 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14515
14516 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14517
14518 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14519
14520 GLYPH_CODE_FACE returns EMACS_INT, not int.
14521 * dispextern.h (merge_faces):
14522 * xfaces.c (merge_faces):
14523 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14524 Don't assume EMACS_INT fits in int.
14525
14526 * character.h (CHAR_VALID_P): Remove unused parameter.
14527 * fontset.c, lisp.h, xdisp.c: All uses changed.
14528
14529 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14530
14531 * fns.c (concat): Minor tuning based on overflow analysis.
14532 This doesn't fix any bugs. Use int to hold character, instead
14533 of constantly refetching from Emacs object. Use XFASTINT, not
14534 XINT, for value known to be a character. Don't bother comparing
14535 a single byte to 0400, as it's always less.
14536
14537 * floatfns.c (Fexpt):
14538 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14539
14540 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14541 for characters.
14542
14543 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14544
14545 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14546 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14547 incorrectly succeed when S was a string, because 4294967386 was
14548 truncated before it was used.
14549
14550 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14551 Otherwise, an out-of-range integer could cause undefined behavior
14552 on a 64-bit host.
14553
14554 * composite.c: Use int, not EMACS_INT, for characters.
14555 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14556 EMACS_INT, for values that are known to be in character range.
14557 This doesn't fix any bugs but is the usual style inside Emacs and
14558 may generate better code on 32-bit machines.
14559
14560 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14561 This is for reasons similar to the recent CHAR_STRING fix.
14562 * charset.c (Fencode_char): Check that character arg is actually
14563 a character. Pass an int to ENCODE_CHAR.
14564 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14565 wider than 'int', as a compile-time check to prevent future regressions
14566 in this area.
14567
14568 * character.c (char_string): Remove unnecessary casts.
14569
14570 Make sure a 64-bit char is never passed to CHAR_STRING.
14571 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14572 by silently ignoring the top 32 bits, allowing some values
14573 that were far too large to be valid characters.
14574 * character.h: Include <verify.h>.
14575 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14576 arguments are no wider than unsigned, as a compile-time check
14577 to prevent future regressions in this area.
14578 * data.c (Faset):
14579 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14580 (Fsubst_char_in_region):
14581 * fns.c (concat):
14582 * xdisp.c (decode_mode_spec_coding):
14583 Adjust to CHAR_STRING's new requirement.
14584 * editfns.c (Finsert_char, Fsubst_char_in_region):
14585 * fns.c (concat): Check that character args are actually
14586 characters. Without this test, these functions did the wrong
14587 thing with wildly out-of-range values on 64-bit hosts.
14588
14589 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14590 These casts should not be needed on 32-bit hosts, either.
14591 * keyboard.c (read_char):
14592 * lread.c (Fload): Remove casts to unsigned.
14593
14594 * lisp.h (UNSIGNED_CMP): New macro.
14595 This fixes comparison bugs on 64-bit hosts.
14596 (ASCII_CHAR_P): Use it.
14597 * casefiddle.c (casify_object):
14598 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14599 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14600 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14601 * dispextern.h (FACE_FROM_ID):
14602 * keyboard.c (read_char): Use UNSIGNED_CMP.
14603
14604 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14605 not to EMACS_INT, to avoid GCC warning.
14606
14607 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14608
14609 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14610 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14611 isn't needed on 32-bit machines.
14612
14613 * buffer.c (Fgenerate_new_buffer_name):
14614 Use EMACS_INT for count, not int.
14615 (advance_to_char_boundary): Return EMACS_INT, not int.
14616
14617 * data.c (Qcompiled_function): Now static.
14618
14619 * window.c (window_body_lines): Now static.
14620
14621 * image.c (gif_load): Rename local to avoid shadowing.
14622
14623 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14624 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14625 * alloc.c (make_save_value): Integer argument is now of type
14626 ptrdiff_t, not int.
14627 (mark_object): Use ptrdiff_t, not int.
14628 * lisp.h (pD): New macro.
14629 * print.c (print_object): Use it.
14630
14631 * alloc.c: Use EMACS_INT, not int, to count objects.
14632 (total_conses, total_markers, total_symbols, total_vector_size)
14633 (total_free_conses, total_free_markers, total_free_symbols)
14634 (total_free_floats, total_floats, total_free_intervals)
14635 (total_intervals, total_strings, total_free_strings):
14636 Now EMACS_INT, not int. All uses changed.
14637 (Fgarbage_collect): Compute overall total using a double, so that
14638 integer overflow is less likely to be a problem. Check for overflow
14639 when converting back to an integer.
14640 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14641 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14642 These were 'int' variables that could overflow on 64-bit hosts;
14643 they were never used, so remove them instead of repairing them.
14644 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14645 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14646 Previously, this ceilinged at INT_MAX, but that doesn't work on
14647 64-bit machines.
14648 (allocate_pseudovector): Don't use EMACS_INT when int would do.
14649
14650 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14651 (allocate_vectorlike): Check for ptrdiff_t overflow.
14652 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14653 when a (possibly-narrower) signed value would do just as well.
14654 We prefer using signed arithmetic, to avoid comparison confusion.
14655
14656 * alloc.c: Catch some string size overflows that we were missing.
14657 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14658 for convenience in STRING_BYTES_MAX.
14659 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14660 The definition here is exact; the one in lisp.h was approximate.
14661 (allocate_string_data): Check for string overflow. This catches
14662 some instances we weren't catching before. Also, it catches
14663 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14664 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14665 and ptrdiff_t and EMACS_INT are both 64 bits.
14666
14667 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14668 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14669 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14670
14671 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14672
14673 * alloc.c (Fmake_string): Check for out-of-range init.
14674
14675 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14676
14677 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14678
14679 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14680
14681 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14682 xg_get_default_scrollbar_width.
14683
14684 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14685 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14686 (style_changed_cb): Call update_theme_scrollbar_width and call
14687 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14688 all frames (Bug#8505).
14689 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14690 Call gtk_window_set_resizable if HAVE_GTK3.
14691 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14692 and height if HAVE_GTK3 (Bug#8505).
14693 (scroll_bar_width_for_theme): New variable.
14694 (update_theme_scrollbar_width): New function.
14695 (xg_get_default_scrollbar_width): Move code to
14696 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14697 (xg_initialize): Call update_theme_scrollbar_width.
14698
14699 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14700
14701 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14702
14703 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14704
14705 * frame.c (make_frame): Call other_buffer_safely instead of
14706 other_buffer.
14707
14708 * window.c (temp_output_buffer_show): Call display_buffer with
14709 second argument Vtemp_buffer_show_specifiers and reset latter
14710 immediately after the call.
14711 (Vtemp_buffer_show_specifiers): New variable.
14712 (auto_window_vscroll_p, next_screen_context_lines)
14713 (Vscroll_preserve_screen_position): Remove leading asterisks from
14714 doc-strings.
14715
14716 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
14717
14718 Fix minor problems found by GCC 4.6.0 static checking.
14719 * buffer.c (Qclone_number): Remove for now, as it's unused.
14720 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14721 (record_buffer): Remove unused local.
14722 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14723 (set_frame_buffer_list): Remove; unused.
14724 * frame.h (other_visible_frames): Remove decl.
14725 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14726 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14727 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14728 if HAVE_GPM.
14729 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14730 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14731 Define only if HAVE_GPM.
14732 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14733 (update_hints_inhibit): Remove; never set. All uses removed.
14734 * widgetprv.h (emacsFrameClassRec): Remove decl.
14735 * window.c (delete_deletable_window): Now returns void, since it
14736 wasn't returning anything.
14737 (compare_window_configurations): Remove unused locals.
14738 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14739 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14740 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14741 the same widths as pointers. This follows up on the 2011-05-06 patch.
14742 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14743 * xterm.h: Likewise.
14744 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14745
14746 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
14747
14748 * makefile.w32-in: Update dependencies.
14749 (LISP_H): Add lib/intprops.h.
14750
14751 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14752
14753 * image.c (gif_load): Add animation frame delay to the metadata.
14754 (syms_of_image): Use DEFSYM. New symbol `delay'.
14755
14756 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14757
14758 * window.c (delete_deletable_window): Re-add.
14759 (Fset_window_configuration): Rewrite to handle dead buffers and
14760 consequently deletable windows.
14761 (window_tree, Fwindow_tree): Remove. Supply functionality in
14762 window.el.
14763 (compare_window_configurations): Simplify code.
14764
14765 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14766
14767 * image.c (imagemagick_load_image): Fix type mismatch.
14768 (Fimagemagick_types): Likewise.
14769
14770 * window.h (replace_buffer_in_windows): Declare.
14771
14772 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14773
14774 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14775 Qclone_number. Remove external declaration of Qdelete_window.
14776 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14777 code.
14778 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14779 Run Qbuffer_list_update_hook if allowed.
14780 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14781 buffer list implementation.
14782 (other_buffer_safely): New function.
14783 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14784 calls to replace_buffer_in_windows and
14785 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14786 if allowed.
14787 (record_buffer): Inhibit quitting and rewrite using quittable
14788 functions. Run Qbuffer_list_update_hook if allowed.
14789 (Frecord_buffer, Funrecord_buffer): New functions.
14790 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14791 Move switch-to-buffer to window.el.
14792 (bury-buffer): Move to window.el.
14793 (Vbuffer_list_update_hook): New variable.
14794
14795 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14796 section.
14797
14798 * window.h (resize_frame_windows): Move up in code.
14799 (Fwindow_frame): Remove EXFUN.
14800 (replace_buffer_in_all_windows): Remove prototype.
14801 (replace_buffer_in_windows_safely): Add prototype.
14802
14803 * window.c: Declare Qdelete_window static again. Move down
14804 declaration of select_count.
14805 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14806 (Fother_window): Move to window.el.
14807 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14808 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14809 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14810 window.el.
14811 (replace_buffer_in_windows): Implement by calling
14812 Qreplace_buffer_in_windows.
14813 (replace_buffer_in_all_windows): Remove with some functionality
14814 moved into replace_buffer_in_windows_safely.
14815 (replace_buffer_in_windows_safely): New function.
14816 (select_window_norecord, select_frame_norecord): Move in front
14817 of run_window_configuration_change_hook. Remove now obsolete
14818 declarations.
14819 (Fset_window_buffer): Rewrite doc-string.
14820 Call Qrecord_window_buffer.
14821 (keys_of_window): Move binding for other-window to window.el.
14822
14823 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14824
14825 * dispextern.h (struct image): Replace data member, whose int_val
14826 and ptr_val fields were not used by anything, with a single
14827 lisp_val object.
14828
14829 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14830 (gif_clear_image, gif_load, imagemagick_load_image)
14831 (gs_clear_image, gs_load): Callers changed.
14832
14833 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14834
14835 * buffer.h: Include <time.h>, for time_t.
14836 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14837
14838 Fix minor problems found by static checking.
14839
14840 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14841
14842 Make identifiers static if they are not used in other modules.
14843 * data.c (Qcompiled_function, Qframe, Qvector):
14844 * image.c (QimageMagick, Qsvg):
14845 * minibuf.c (Qmetadata):
14846 * window.c (resize_window_check, resize_root_window): Now static.
14847 * window.h (resize_window_check, resize_root_window): Remove decls.
14848
14849 * window.c (window_deletion_count, delete_deletable_window):
14850 Remove; unused.
14851 (window_body_lines): Now static.
14852 (Fdelete_other_windows_internal): Mark vars as initialized.
14853 Make sure 'resize_failed' is initialized.
14854 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14855 (resize_window_apply): Remove unused local.
14856 * window.h (delete_deletable_window): Remove decl.
14857
14858 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14859 (imagemagick_load_image): Fix pointer signedness problem by changing
14860 last arg from unsigned char * to char *. All uses changed.
14861 Also, fix a local for similar reasons.
14862 Remove unused locals. Remove locals to avoid shadowing.
14863 (fn_rsvg_handle_free): Remove; unused.
14864 (svg_load, svg_load_image): Fix pointer signedness problem.
14865 (imagemagick_load_image): Don't use garbage pointer image_wand.
14866
14867 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14868
14869 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
14870
14871 * image.c (gif_load): Fix omitted cast error introduced by
14872 2011-06-06 change.
14873
14874 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14875
14876 * window.h (resize_proportionally, orig_total_lines)
14877 (orig_top_line): Remove from window structure.
14878 (set_window_height, set_window_width, change_window_heights)
14879 (Fdelete_window): Remove prototypes.
14880 (resize_frame_windows): Remove duplicate declaration.
14881
14882 2011-06-10 Eli Zaretskii <eliz@gnu.org>
14883
14884 * window.h (resize_frame_windows, resize_window_check)
14885 (delete_deletable_window, resize_root_window)
14886 (resize_frame_windows): Declare prototypes.
14887
14888 * window.c (resize_window_apply): Make definition be "static" to
14889 match the prototype.
14890
14891 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14892
14893 * window.c: Remove declarations of Qwindow_size_fixed,
14894 window_min_size_1, window_min_size_2, window_min_size,
14895 size_window, window_fixed_size_p, enlarge_window, delete_window.
14896 Remove static from declaration of Qdelete_window, it's
14897 temporarily needed by Fbury_buffer.
14898 (replace_window): Don't assign orig_top_line and
14899 orig_total_lines.
14900 (Fdelete_window, delete_window): Remove. Window deletion is
14901 handled by window.el.
14902 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14903 Replace Fdelete_window calls with calls to Qdelete_window.
14904 (Fdelete_other_windows): Remove. Deleting other windows is
14905 handled by window.el.
14906 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14907 handled in window.el.
14908 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14909 Window minimum sizes are handled in window.el.
14910 (shrink_windows, size_window, set_window_height)
14911 (set_window_width, change_window_heights, window_height)
14912 (window_width, CURBEG, CURSIZE, enlarge_window)
14913 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14914 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14915 handled in window.el.
14916 (make_dummy_parent): Rename to make_parent_window and give it a
14917 second argument horflag.
14918 (make_window): Don't set resize_proportionally any more.
14919 (Fsplit_window): Remove. Windows are split in window.el.
14920 (save_restore_action, save_restore_orig_size)
14921 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14922 Resize mini windows in window.el.
14923 (grow_mini_window, shrink_mini_window): Implement by calling
14924 Qresize_root_window_vertically, resize_window_check and
14925 resize_window_apply.
14926 (saved_window, Fset_window_configuration, save_window_save):
14927 Do not handle orig_top_line, orig_total_lines, and
14928 resize_proportionally.
14929 (window_min_height, window_min_width): Move to window.el.
14930 (keys_of_window): Move bindings for delete-other-windows,
14931 split-window, delete-window and enlarge-window to window.el.
14932
14933 * buffer.c: Temporarily extern Qdelete_window.
14934 (Fbury_buffer): Temporarily call Qdelete_window instead of
14935 Fdelete_window (Fbury_buffer will move to window.el soon).
14936
14937 * frame.c (set_menu_bar_lines_1): Remove code handling
14938 orig_top_line and orig_total_lines.
14939
14940 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14941 set_window_height but set heights directly.
14942 (change_frame_size_1): Use resize_frame_windows.
14943
14944 * xdisp.c (init_xdisp): Don't use set_window_height but set
14945 heights directly.
14946
14947 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14948 Use resize_frame_windows instead of change_window_heights and run
14949 run_window_configuration_change_hook.
14950
14951 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14952 instead of change_window_heights and run
14953 run_window_configuration_change_hook.
14954
14955 2011-06-09 Martin Rudalics <rudalics@gmx.at>
14956
14957 * window.c (replace_window): Rename second argument REPLACEMENT to
14958 NEW. New third argument SETFLAG. Rewrite.
14959 (delete_window, make_dummy_parent): Call replace_window with
14960 third argument 1.
14961 (window_list_1): Move down in code.
14962 (run_window_configuration_change_hook): Move set_buffer part
14963 before select_frame_norecord part in order to unwind correctly.
14964 Rename count1 to count.
14965 (recombine_windows, delete_deletable_window, resize_root_window)
14966 (Fdelete_other_windows_internal)
14967 (Frun_window_configuration_change_hook, make_parent_window)
14968 (resize_window_check, resize_window_apply, Fresize_window_apply)
14969 (resize_frame_windows, Fsplit_window_internal)
14970 (Fdelete_window_internal, Fresize_mini_window_internal):
14971 New functions.
14972 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14973
14974 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14975
14976 * window.h (window): Add some new members to window structure -
14977 normal_lines, normal_cols, new_total, new_normal, clone_number,
14978 splits, nest, prev_buffers, next_buffers.
14979 (WINDOW_TOTAL_SIZE): Move here from window.c.
14980 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14981
14982 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14983 Remove.
14984 (make_dummy_parent): Set new members of windows structure.
14985 (make_window): Move down in code. Handle new members of window
14986 structure.
14987 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14988 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14989 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14990 (Fset_window_prev_buffers, Fwindow_next_buffers)
14991 (Fset_window_next_buffers, Fset_window_clone_number):
14992 New functions.
14993 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14994 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14995 Doc-string fixes.
14996 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14997 Argument WINDOW can be now internal window too.
14998 (Fwindow_use_time): Move up in code.
14999 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15000 Rewrite doc-string.
15001 (Fset_window_configuration, saved_window)
15002 (Fcurrent_window_configuration, save_window_save): Handle new
15003 members of window structure.
15004 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15005 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15006 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15007 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15008 Qget_mru_window, Qresize_root_window,
15009 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15010 Qauto_buffer_name; staticpro them.
15011
15012 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15013
15014 * window.c (Fwindow_total_size, Fwindow_left_column)
15015 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15016 (Fwindow_list_1): New functions.
15017 (window_box_text_cols): Replace with window_body_cols.
15018 (Fwindow_width, Fscroll_left, Fscroll_right):
15019 Use window_body_cols instead of window_box_text_cols.
15020 (delete_window, Fset_window_configuration):
15021 Call delete_all_subwindows with window as argument.
15022 (delete_all_subwindows): Take a window as argument and not a
15023 structure. Rewrite.
15024 (window_loop): Remove handling of GET_LRU_WINDOW and
15025 GET_LARGEST_WINDOW.
15026 (Fget_lru_window, Fget_largest_window): Move to window.el.
15027
15028 * window.h: Extern window_body_cols instead of
15029 window_box_text_cols. delete_all_subwindows now takes a
15030 Lisp_Object as argument.
15031
15032 * indent.c (compute_motion, Fcompute_motion):
15033 Use window_body_cols instead of window_box_text_cols.
15034
15035 * frame.c (delete_frame): Call delete_all_subwindows with root
15036 window as argument.
15037
15038 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15039
15040 * fns.c (Fputhash): Document return value.
15041
15042 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15043
15044 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15045
15046 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15047
15048 Cons<->int and similar integer overflow fixes (Bug#8794).
15049
15050 Check for overflow when converting integer to cons and back.
15051 * charset.c (Fdefine_charset_internal, Fdecode_char):
15052 Use cons_to_unsigned to catch overflow.
15053 (Fencode_char): Use INTEGER_TO_CONS.
15054 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15055 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15056 * data.c (long_to_cons, cons_to_long): Remove.
15057 (cons_to_unsigned, cons_to_signed): New functions.
15058 These signal an error for invalid or out-of-range values.
15059 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15060 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15061 * font.c (Ffont_variation_glyphs):
15062 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15063 * lisp.h: Include <intprops.h>.
15064 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15065 (cons_to_signed, cons_to_unsigned): New decls.
15066 (long_to_cons, cons_to_long): Remove decls.
15067 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15068 (Fprimitive_undo): Use CONS_TO_INTEGER.
15069 * xfns.c (Fx_window_property): Likewise.
15070 * xselect.c: Include <limits.h>.
15071 (x_own_selection, selection_data_to_lisp_data):
15072 Use INTEGER_TO_CONS.
15073 (x_handle_selection_request, x_handle_selection_clear)
15074 (x_get_foreign_selection, Fx_disown_selection_internal)
15075 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15076 (lisp_data_to_selection_data): Use cons_to_unsigned.
15077 (x_fill_property_data): Use cons_to_signed.
15078 Report values out of range.
15079
15080 Check for buffer and string overflow more precisely.
15081 * buffer.h (BUF_BYTES_MAX): New macro.
15082 * lisp.h (STRING_BYTES_MAX): New macro.
15083 * alloc.c (Fmake_string):
15084 * character.c (string_escape_byte8):
15085 * coding.c (coding_alloc_by_realloc):
15086 * doprnt.c (doprnt):
15087 * editfns.c (Fformat):
15088 * eval.c (verror):
15089 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15090 since they may not be the same number.
15091 * editfns.c (Finsert_char):
15092 * fileio.c (Finsert_file_contents):
15093 Likewise for BUF_BYTES_MAX.
15094
15095 * image.c: Use ptrdiff_t, not int, for sizes.
15096 (slurp_file): Switch from int to ptrdiff_t.
15097 All uses changed.
15098 (slurp_file): Check that file size fits in both size_t (for
15099 malloc) and ptrdiff_t (for sanity and safety).
15100
15101 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15102 if b->modtime has its maximal value.
15103
15104 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15105
15106 Don't assume time_t can fit into int.
15107 * buffer.h (struct buffer.modtime): Now time_t, not int.
15108 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15109 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15110
15111 Minor fixes for signed vs unsigned integers.
15112 * character.h (MAYBE_UNIFY_CHAR):
15113 * charset.c (maybe_unify_char):
15114 * keyboard.c (read_char, reorder_modifiers):
15115 XINT -> XFASTINT, since the integer must be nonnegative.
15116 * ftfont.c (ftfont_spec_pattern):
15117 * keymap.c (access_keymap, silly_event_symbol_error):
15118 XUINT -> XFASTINT, since the integer must be nonnegative.
15119 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15120 since it makes no difference and we prefer signed.
15121 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15122 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15123 nonnegative.
15124
15125 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15126
15127 * window.h (Fwindow_frame): Declare.
15128
15129 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15130
15131 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15132 (SPARE_MEMORY): Always define.
15133 (LARGE_REQUEST): Remove.
15134 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15135
15136 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15137
15138 * lisp.h: Move EXFUNS for Fframe_root_window,
15139 Fframe_first_window and Fset_frame_selected_window to window.h.
15140
15141 * window.h: Move EXFUNS for Fframe_root_window,
15142 Fframe_first_window and Fset_frame_selected_window here from
15143 lisp.h.
15144
15145 * frame.c (Fwindow_frame, Fframe_first_window)
15146 (Fframe_root_window, Fframe_selected_window)
15147 (Fset_frame_selected_window): Move to window.c.
15148 (Factive_minibuffer_window): Move to minibuf.c.
15149 (Fother_visible_frames_p): New function.
15150
15151 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15152
15153 * window.c (decode_window, decode_any_window): Move up in code.
15154 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15155 (inhibit_frame_unsplittable): Remove unused variable.
15156 (Fwindow_buffer): Move up and rewrite doc-string.
15157 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15158 (Fwindow_prev): New functions.
15159 (Fwindow_frame): Move here from frame.c. Accept any window as
15160 argument.
15161 (Fframe_root_window, Fframe_first_window)
15162 (Fframe_selected_window): Move here from frame.c. Accept frame
15163 or arbitrary window as argument. Update doc-strings.
15164 (Fminibuffer_window): Move up in code.
15165 (Fwindow_minibuffer_p): Move up in code and simplify.
15166 (Fset_frame_selected_window): Move here from frame.c.
15167 Marginal rewrite.
15168 (Fselected_window, select_window, Fselect_window): Move up in
15169 code. Minor doc-string fixes.
15170
15171 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15172
15173 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15174 Do not assume that spare memory exists; that assumption is valid
15175 only if SYSTEM_MALLOC.
15176 (LARGE_REQUEST): New macro, so that the issue of large requests
15177 is separated from the issue of spare memory.
15178
15179 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15180
15181 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15182 format. (Bug#8806)
15183
15184 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15185
15186 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15187 before statements.
15188
15189 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15190
15191 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15192
15193 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15194
15195 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15196 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15197
15198 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15199
15200 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15201
15202 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15203
15204 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15205 (x_clipboard_manager_save): Add return value.
15206 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15207 New error handlers.
15208 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15209 Obey Vx_select_enable_clipboard_manager. Catch errors in
15210 x_clipboard_manager_save (Bug#8779).
15211 (Vx_select_enable_clipboard_manager): New variable.
15212 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15213
15214 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15215
15216 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15217
15218 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15219
15220 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15221 in the current matrix if keep_current_p is non-zero.
15222
15223 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15224
15225 * bidi.c (bidi_level_of_next_char): Fix last change.
15226
15227 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15228
15229 Support bidi reordering of text covered by display properties.
15230
15231 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15232 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15233 (bidi_cache_search, bidi_cache_iterator_state)
15234 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15235 (bidi_level_of_next_char, bidi_move_to_visually_next):
15236 Support character positions inside a run of characters covered by a
15237 display string.
15238 (bidi_paragraph_init, bidi_resolve_explicit_1)
15239 (bidi_level_of_next_char): Call bidi_fetch_char and
15240 bidi_fetch_char_advance instead of FETCH_CHAR and
15241 FETCH_CHAR_ADVANCE.
15242 (bidi_init_it): Initialize new members.
15243 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15244 definitions.
15245 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15246 instead of using explicit *_CHAR codes.
15247 (bidi_resolve_explicit, bidi_resolve_weak):
15248 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15249 bidirectional text is supported only in multibyte buffers.
15250 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15251 it to initialize the frame_window_p member of struct bidi_it.
15252 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15253 (bidi_resolve_explicit, bidi_resolve_weak)
15254 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15255 bidi_it->nchars is non-positive.
15256 (bidi_level_of_next_char): Don't try to lookup the cache for the
15257 next/previous character if nothing is cached there yet, or if we
15258 were just reseat()'ed to a new position.
15259
15260 * xdisp.c (set_cursor_from_row): Set start and stop points
15261 according to the row's direction when priming the loop that looks
15262 for the glyph on which to display cursor.
15263 (single_display_spec_intangible_p): Function deleted.
15264 (display_prop_intangible_p): Reimplement to call
15265 handle_display_spec instead of single_display_spec_intangible_p.
15266 Accept 3 additional arguments needed by handle_display_spec.
15267 This fixes incorrect cursor motion across display property with complex
15268 values: lists, `(when COND...)' forms, etc.
15269 (single_display_spec_string_p): Support property values that are
15270 lists with the argument STRING its top-level element.
15271 (display_prop_string_p): Fix the condition for processing a
15272 property that is a list to be consistent with handle_display_spec.
15273 (handle_display_spec): New function, refactored from the
15274 last portion of handle_display_prop.
15275 (compute_display_string_pos): Accept additional argument
15276 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15277 value of a `display' property is a "replacing spec".
15278 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15279 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15280 the display property, but just return a value indicating whether
15281 the display property will replace the characters it covers.
15282 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15283 frame_window_p members of struct bidi_it.
15284 (compute_display_string_pos, compute_display_string_end):
15285 New functions.
15286 (push_it): Accept second argument POSITION, where pop_it should
15287 jump to continue iteration.
15288 (reseat_1): Initialize bidi_it.disp_pos.
15289
15290 * keyboard.c (adjust_point_for_property): Adjust the call to
15291 display_prop_intangible_p to its new signature.
15292
15293 * dispextern.h (struct bidi_it): New member frame_window_p.
15294 (bidi_init_it): Update prototypes.
15295 (display_prop_intangible_p): Update prototype.
15296 (compute_display_string_pos, compute_display_string_end):
15297 Declare prototypes.
15298 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15299 EMACS_INT.
15300
15301 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15302
15303 Malloc failure behavior now depends on size of allocation.
15304 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15305 * lisp.h: Change signatures accordingly.
15306 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15307 All callers changed. (Bug#8762)
15308
15309 * gnutls.c: Use Emacs's memory allocators.
15310 Without this change, the gnutls library would invoke malloc etc.
15311 directly, which causes problems on non-SYNC_INPUT hosts, and which
15312 runs afoul of improving memory_full behavior. (Bug#8761)
15313 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15314 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15315 xfree instead of the default malloc, realloc, free.
15316 (Fgnutls_boot): No need to check for memory allocation failure,
15317 since xmalloc does that for us.
15318
15319 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15320 * category.c (hash_get_category_set):
15321 * ccl.c (ccl_driver):
15322 * charset.c (Fdefine_charset_internal):
15323 * charset.h (struct charset.hash_index):
15324 * composite.c (get_composition_id, gstring_lookup_cache)
15325 (composition_gstring_put_cache):
15326 * composite.h (struct composition.hash_index):
15327 * dispextern.h (struct image.hash):
15328 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15329 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15330 (hashfn_equal, hashfn_user_defined, make_hash_table)
15331 (maybe_resize_hash_table, hash_lookup, hash_put)
15332 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15333 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15334 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15335 * image.c (make_image, search_image_cache, lookup_image)
15336 (xpm_put_color_table_h):
15337 * lisp.h (struct Lisp_Hash_Table):
15338 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15339 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15340 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15341 * alloc.c (allocate_vectorlike):
15342 Check for overflow in vector size calculations.
15343 * ccl.c (ccl_driver):
15344 Check for overflow when converting EMACS_INT to int.
15345 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15346 need to be updated by these changes.
15347 * fns.c (make_hash_table, maybe_resize_hash_table):
15348 Check for integer overflow with large hash tables.
15349 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15350 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15351 (SXHASH_REDUCE): New macro.
15352 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15353 Use it instead of discarding useful hash info with large hash values.
15354 (sxhash_float): New function.
15355 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15356 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15357 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15358 Rewrite to use FIXNUM_BITS, as this simplifies things.
15359 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15360 Adjust signatures to match updated version of code.
15361 (consing_since_gc): Now EMACS_INT, since a single hash table can
15362 use more than INT_MAX bytes.
15363
15364 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15365
15366 Make it possible to build with GCC-4.6+ -O2 -flto.
15367
15368 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15369
15370 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15371
15372 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15373 Call minibuffer-inactive-mode.
15374
15375 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15376
15377 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15378 Update dependencies.
15379
15380 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15381
15382 * data.c (init_data): Remove code for UTS, this system is not
15383 supported anymore.
15384
15385 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15386
15387 Don't force ./temacs to start in terminal mode.
15388
15389 * frame.c (make_initial_frame): Initialize faces in all cases, not
15390 only when CANNOT_DUMP is defined.
15391 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15392
15393 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15394
15395 * dispnew.c (add_window_display_history): Use const for the string
15396 pointer. Remove declaration, not needed.
15397
15398 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15399
15400 Use 'inline', not 'INLINE'.
15401 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15402 * alloc.c, fontset.c (INLINE): Remove.
15403 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15404 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15405 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15406 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15407 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15408
15409 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15410
15411 Make it possible to run ./temacs.
15412
15413 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15414 syms_of_callproc does the same thing. Remove test for
15415 "initialized", do it in the caller.
15416 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15417
15418 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15419
15420 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15421 (read_minibuf): Use get_minibuffer.
15422 (syms_of_minibuf): Use DEFSYM.
15423 (Qmetadata): New var.
15424 * data.c (Qbuffer): Don't make it static.
15425 (syms_of_data): Use DEFSYM.
15426
15427 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15428
15429 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15430 (CCL_CODE_MIN): New macro.
15431
15432 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15433
15434 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15435
15436 * eval.c (Qdebug): Now static.
15437 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15438 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15439 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15440
15441 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15442
15443 * image.c: Various fixes to ImageMagick code comments.
15444 (Fimagemagick_types): Doc fix.
15445
15446 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15447
15448 Minor fixes prompted by GCC 4.6.0 warnings.
15449
15450 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15451
15452 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15453 (x_clipboard_manager_save_all): Move extern decl to ...
15454 * xterm.h: ... here, so that it can be checked for consistency.
15455
15456 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15457
15458 * xselect.c (x_clipboard_manager_save_frame)
15459 (x_clipboard_manager_save_all): New functions.
15460 (Fx_clipboard_manager_save): Lisp function deleted.
15461
15462 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15463 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15464
15465 * xterm.h: Update prototype.
15466
15467 2011-05-28 William Xu <william.xwl@gmail.com>
15468
15469 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15470 exiting (Bug#8239).
15471
15472 2011-05-28 Jim Meyering <meyering@redhat.com>
15473
15474 Avoid a sign-extension bug in crypto_hash_function.
15475 * fns.c (to_uchar): Define.
15476 (crypto_hash_function): Use it to convert some newly-signed
15477 variables to unsigned, to avoid sign-extension bugs. For example,
15478 without this change, (md5 "truc") would evaluate to
15479 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15480 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15481 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15482
15483 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15484
15485 Integer overflow fixes.
15486
15487 * dbusbind.c: Serial number integer overflow fixes.
15488 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15489 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15490 to hold a serial number that is too large for a fixnum.
15491 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15492 Check for serial numbers out of range. Decode any serial number
15493 that was so large that it became a float. (Bug#8722)
15494
15495 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15496 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15497 Use XFASTINT rather than XUINT when numbers are nonnegative.
15498 (xd_append_arg, Fdbus_method_return_internal):
15499 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15500 arguments, check that Lisp number is nonnegative, rather than
15501 silently wrapping negative numbers around. (Bug#8722)
15502 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15503 (Bug#8722)
15504
15505 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15506
15507 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15508
15509 ccl: Add integer overflow checks.
15510 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15511 (IN_INT_RANGE): New macros.
15512 (ccl_driver): Use them to check for integer overflow when
15513 decoding a CCL program. Many of the new checks are whether XINT (x)
15514 fits in int; it doesn't always, on 64-bit hosts. The new version
15515 doesn't catch all possible integer overflows, but it's an
15516 improvement. (Bug#8719)
15517
15518 * alloc.c (make_event_array): Use XINT, not XUINT.
15519 There's no need for unsigned here.
15520
15521 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15522 This follows up to the 2011-05-06 change that substituted uintptr_t
15523 for EMACS_INT. This case wasn't caught back then.
15524
15525 Rework Fformat to avoid integer overflow issues.
15526 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15527 now (part of C89). Include <verify.h>.
15528 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15529 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15530 (Fformat): Avoid the prepass trying to compute sizes; it was only
15531 approximate and thus did not catch overflow reliably. Instead, walk
15532 through the format just once, formatting and computing sizes as we go,
15533 checking for integer overflow at every step, and allocating a larger
15534 buffer as needed. Keep track separately whether the format is
15535 multibyte. Keep only the most-recently calculated precision, rather
15536 than them all. Record whether each argument has been converted to
15537 string. Use EMACS_INT, not int, for byte and char and arg counts.
15538 Support field widths and precisions larger than INT_MAX. Avoid
15539 sprintf's undefined behavior with conversion specifications such as %#d
15540 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15541 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15542 formatting out-of-range floating point numbers with int
15543 formats. (Bug#8668)
15544
15545 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15546
15547 * data.c: Avoid integer truncation in expressions involving floats.
15548 * data.c: Include <intprops.h>.
15549 (arith_driver): When there's an integer overflow in an expression
15550 involving floating point, convert the integers to floating point
15551 so that the resulting value does not suffer from catastrophic
15552 integer truncation. For example, on a 64-bit host (* 4
15553 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15554 Do not rely on undefined behavior after integer overflow.
15555
15556 merge count_size_as_multibyte, parse_str_to_multibyte
15557 * character.c, character.h (count_size_as_multibyte):
15558 Rename from parse_str_to_multibyte; all uses changed.
15559 Check for integer overflow.
15560 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15561 since it's now a duplicate of the other. This is more of
15562 a character than a buffer op, so better that it's in character.c.
15563 * fns.c, print.c: Adjust to above changes.
15564
15565 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15566
15567 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15568
15569 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15570
15571 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15572 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15573 (x_clipboard_manager_save): Now static.
15574 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15575
15576 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15577 (crypto_hash_function): Now static.
15578 Fix pointer signedness problems. Avoid unnecessary initializations.
15579
15580 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15581
15582 * termhooks.h (Vselection_alist): Make it terminal-local.
15583
15584 * terminal.c (create_terminal): Initialize it.
15585
15586 * xselect.c: Support for clipboard managers.
15587 (Vselection_alist): Move to termhooks.h as terminal-local var.
15588 (LOCAL_SELECTION): New macro.
15589 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15590 (symbol_to_x_atom): Remove gratuitous arg.
15591 (x_handle_selection_request, lisp_data_to_selection_data)
15592 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15593 (x_own_selection, x_get_local_selection, x_convert_selection):
15594 New arg, specifying work frame. Use terminal-local Vselection_alist.
15595 (some_frame_on_display): Delete unused function.
15596 (Fx_own_selection_internal, Fx_get_selection_internal)
15597 (Fx_disown_selection_internal, Fx_selection_owner_p)
15598 (Fx_selection_exists_p): New optional frame arg.
15599 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15600 (x_handle_selection_clear): Don't treat other terminals with the
15601 same keyboard specially. Use the terminal-local Vselection_alist.
15602 (x_clear_frame_selections): Use Frun_hook_with_args.
15603
15604 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15605
15606 * xterm.h: Add support for those atoms.
15607
15608 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
15609
15610 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15611 (converted_selections, conversion_fail_tag): New global variables.
15612 (x_selection_request_lisp_error): Free the above.
15613 (x_get_local_selection): Remove unnecessary code.
15614 (x_reply_selection_request): Args changed; handle arbitrary array
15615 of converted selections stored in converted_selections.
15616 Separate the XChangeProperty and SelectionNotify steps.
15617 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15618 (x_convert_selection): New function.
15619 (x_handle_selection_event): Simplify.
15620 (x_get_foreign_selection): Don't ignore incoming requests while
15621 waiting for an answer; this will fail when we implement
15622 SAVE_TARGETS, and seems unnecessary anyway.
15623 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15624 (Vx_sent_selection_functions): Doc fix.
15625
15626 2011-05-26 Leo Liu <sdl.web@gmail.com>
15627
15628 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15629
15630 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15631
15632 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15633
15634 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15635 for fringe update if it has periodic bitmap.
15636 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15637 and fringe_bitmap_periodic_p.
15638
15639 * fringe.c (get_fringe_bitmap_data): New function.
15640 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15641 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15642 row. Mark glyph row for fringe update if periodicity changed.
15643
15644 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15645 for fringe update unless it has periodic bitmap.
15646
15647 2011-05-25 Kenichi Handa <handa@m17n.org>
15648
15649 * xdisp.c (get_next_display_element): Set correct it->face_id for
15650 a static composition.
15651
15652 2011-05-24 Leo Liu <sdl.web@gmail.com>
15653
15654 * deps.mk (fns.o):
15655 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15656
15657 * fns.c (crypto_hash_function, Fsha1): New function.
15658 (Fmd5): Use crypto_hash_function.
15659 (syms_of_fns): Add Ssha1.
15660
15661 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15662
15663 * gnutls.c: Remove unused macros.
15664 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15665 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15666 Remove macros that are defined and never used.
15667 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15668
15669 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15670
15671 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15672 (Fx_get_selection_internal): Minor cleanup.
15673 (Fx_own_selection_internal): Rename arguments for consistency with
15674 select.el.
15675
15676 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15677
15678 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15679
15680 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15681
15682 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15683
15684 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15685
15686 * dispnew.c (scrolling_window): Don't exclude the case that the
15687 last enabled row in the desired matrix touches the bottom boundary.
15688
15689 2011-05-21 Glenn Morris <rgm@gnu.org>
15690
15691 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15692 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15693 and add some more files.
15694
15695 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15696
15697 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15698 report_file_error introduced by the change from 2011-05-07.
15699
15700 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15701
15702 * systime.h (Time): Define only if emacs is defined.
15703 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15704 where the include path doesn't have X11/X.h by default. See
15705 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15706
15707 2011-05-20 Kenichi Handa <handa@m17n.org>
15708
15709 * composite.c (find_automatic_composition): Fix previous change.
15710
15711 2011-05-20 Glenn Morris <rgm@gnu.org>
15712
15713 * lisp.mk: New file, split from Makefile.in.
15714 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15715 (shortlisp): Remove.
15716 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15717
15718 2011-05-19 Glenn Morris <rgm@gnu.org>
15719
15720 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15721 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15722 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15723 (lisp): Set the order to that of loadup.el.
15724 (shortlisp): Make it a copy of $lisp.
15725 (SOME_MACHINE_LISP): Remove.
15726 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15727 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15728
15729 2011-05-18 Kenichi Handa <handa@m17n.org>
15730
15731 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15732 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15733 (find_automatic_composition): Mostly rewrite for efficiency.
15734
15735 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
15736
15737 * makefile.w32-in: Update dependencies.
15738
15739 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15740
15741 * menu.c: Include limits.h (fixes the MS-Windows build broken by
15742 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15743
15744 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
15745
15746 Fix some integer overflow issues, such as string length overflow.
15747
15748 * insdel.c (count_size_as_multibyte): Check for string overflow.
15749
15750 * character.c (lisp_string_width): Check for string overflow.
15751 Use EMACS_INT, not int, for string indexes and lengths; in
15752 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15753 the resulting string length overflows an EMACS_INT; instead,
15754 report a string overflow if no precision given. When checking for
15755 precision exhaustion, use a check that cannot possibly have
15756 integer overflow. (Bug#8675)
15757 * character.h (lisp_string_width): Adjust to new signature.
15758
15759 * alloc.c (string_overflow): New function.
15760 (Fmake_string): Use it. This doesn't change behavior, but saves
15761 a few bytes and will simplify future changes.
15762 * character.c (string_escape_byte8): Likewise.
15763 * lisp.h (string_overflow): New decl.
15764
15765 Fixups, following up to the user-interface timestamp change.
15766 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15767 for UI timestamps, instead of unsigned long.
15768 * msdos.c (mouse_get_pos): Likewise.
15769 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15770 * w32gui.h (Time): Define by including "systime.h" rather than by
15771 declaring it ourselves. (Bug#8664)
15772
15773 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15774 * image.c (clear_image_cache): Likewise.
15775
15776 * term.c (term_mouse_position): Don't assume time_t wraparound.
15777
15778 Be more systematic about user-interface timestamps.
15779 Before, the code sometimes used 'Time', sometimes 'unsigned long',
15780 and sometimes 'EMACS_UINT', to represent these timestamps.
15781 This change causes it to use 'Time' uniformly, as that's what X uses.
15782 This makes the code easier to follow, and makes it easier to catch
15783 integer overflow bugs such as Bug#8664.
15784 * frame.c (Fmouse_position, Fmouse_pixel_position):
15785 Use Time, not unsigned long, for user-interface timestamps.
15786 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15787 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15788 * keyboard.h (last_event_timestamp): Likewise.
15789 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15790 * menu.h (xmenu_show): Likewise.
15791 * term.c (term_mouse_position): Likewise.
15792 * termhooks.h (struct input_event.timestamp): Likewise.
15793 (struct terminal.mouse_position_hook): Likewise.
15794 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15795 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15796 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15797 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15798 what it was before.
15799 * menu.h, termhooks.h: Include "systime.h", for Time.
15800
15801 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15802 Don't assume that the difference between two unsigned long values
15803 can fit into an integer. At this point, we know button_down_time
15804 <= event->timestamp, so the difference must be nonnegative, so
15805 there's no need to cast the result if double-click-time is
15806 nonnegative, as it should be; check that it's nonnegative, just in
15807 case. This bug is triggered when events are more than 2**31 ms
15808 apart (about 25 days). (Bug#8664)
15809
15810 * xselect.c (last_event_timestamp): Remove duplicate decl.
15811 (x_own_selection): Remove needless cast to unsigned long.
15812
15813 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15814 that always fit in int. Use a sentinel instead of a counter, to
15815 avoid a temp and to allay GCC's concerns about possible int overflow.
15816 * frame.h (struct frame): Use int for menu_bar_items_used
15817 instead of EMACS_INT, since it always fits in int.
15818
15819 * menu.c (grow_menu_items): Check for int overflow.
15820
15821 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15822
15823 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15824 Before, the code was not consistent. These values cannot exceed
15825 2**31 - 1 so there's no need to make them unsigned.
15826 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15827 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15828 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15829 as modifiers.
15830 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15831
15832 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15833 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15834 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15835 presumably because the widths might not match.
15836
15837 * window.c (size_window): Avoid needless test at loop start.
15838
15839 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15840
15841 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15842
15843 2011-05-12 Drew Adams <drew.adams@oracle.com>
15844
15845 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15846
15847 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15848
15849 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15850 `width' to `bar_area_x' and `bar_area_width', respectively.
15851 (x_scroll_run): Take account of fringe background extension.
15852
15853 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15854 Rename local vars `left' and `width' to `bar_area_x' and
15855 `bar_area_width', respectively.
15856 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15857 background extension.
15858
15859 2011-05-10 Jim Meyering <meyering@redhat.com>
15860
15861 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15862
15863 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
15864
15865 * image.c (Finit_image_library): Return t for built-in image types,
15866 like pbm and xbm. (Bug#8640)
15867
15868 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15869
15870 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15871
15872 2011-05-07 Eli Zaretskii <eliz@gnu.org>
15873
15874 * w32console.c (Fset_screen_color): Doc fix.
15875 (Fget_screen_color): New function.
15876 (syms_of_ntterm): Defsubr it.
15877
15878 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15879 unlink the temporary file if Fcall_process didn't create it in the
15880 first place.
15881 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15882 child process will be redirected to a file specified with `:file'.
15883 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15884 cue to call_process_cleanup not to close that handle.
15885
15886 2011-05-07 Ben Key <bkey76@gmail.com>
15887
15888 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15889 one of two shell specific rules, either bootstrap-temacs-CMD or
15890 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15891 to the previous implementation of the bootstrap-temacs rule.
15892 The bootstrap-temacs-CMD rule is similar to the previous
15893 implementation of the bootstrap-temacs rule except that it
15894 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15895 variable.
15896
15897 These changes, along with some changes to nt/configure.bat,
15898 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15899 earlier fix to add support for --cflags and --ldflags options
15900 that include quotes so that it works whether make uses cmd or
15901 sh as the shell.
15902
15903 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
15904
15905 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15906 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15907 is a constant.
15908 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15909 a string. Handle both cases.
15910 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15911 (Fdbus_register_method): Use Qinvalid_function.
15912
15913 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15914
15915 * makefile.w32-in: Update dependencies.
15916 (LISP_H): Add inttypes.h and stdin.h.
15917 (PROCESS_H): Add unistd.h.
15918
15919 2011-05-06 Eli Zaretskii <eliz@gnu.org>
15920
15921 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15922 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15923
15924 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
15925
15926 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15927
15928 * term.c (vfatal): Remove stray call to va_end.
15929 It's not needed and the C Standard doesn't allow it here anyway.
15930
15931 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15932 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15933
15934 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15935 bytes.
15936
15937 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15938
15939 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15940
15941 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15942
15943 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15944
15945 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15946
15947 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15948 * charset.c (Fdefine_charset_internal): Don't initialize
15949 charset.code_space[15]. The value was garbage, on hosts with
15950 32-bit int (Bug#8600).
15951
15952 * lread.c (read_integer): Be more consistent with string-to-number.
15953 Use string_to_number to do the actual conversion; this avoids
15954 rounding errors and fixes some other screwups. Without this fix,
15955 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15956 (digit_to_number): Move earlier, for benefit of read_integer.
15957 Return -1 if the digit is out of range for the base, -2 if it is
15958 not a digit in any supported base. (Bug#8602)
15959
15960 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15961
15962 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15963 to match comment at start of function. This also removes a
15964 GCC warning about overflow in a 32+64-bit port.
15965
15966 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15967
15968 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15969 Reported by Stefan Monnier in
15970 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15971 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15972 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15973
15974 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15975 (EMACS_UINTPTR): Likewise, with uintptr_t.
15976
15977 * lisp.h: Prefer 64-bit EMACS_INT if available.
15978 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15979 on 32-bit hosts that have 64-bit int, so that they can access
15980 large files.
15981 However, temporarily disable this change unless the temporary
15982 symbol WIDE_EMACS_INT is defined.
15983
15984 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15985
15986 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15987 This removes an assumption that EMACS_INT and long are the same
15988 width as pointers. The assumption is true for Emacs porting targets
15989 now, but we want to make other targets possible.
15990 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15991 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15992 In the rest of the code, change types of integers that hold casted
15993 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15994 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15995 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15996 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15997 No need to cast type when ORing.
15998 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15999 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16000 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16001 assume EMACS_INT is the same width as char *.
16002 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16003 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16004 Remove no-longer-needed casts.
16005 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16006 (xg_tool_bar_help_callback, xg_make_tool_item):
16007 Use EMACS_INTPTR to hold an integer
16008 that will be cast to void *; this can avoid a GCC warning
16009 if EMACS_INT is not the same width as void *.
16010 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16011 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16012 (current_message_1, set_message_1):
16013 Use a local to convert to proper width without a cast.
16014 * xmenu.c (dialog_selection_callback): Likewise.
16015
16016 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16017 Also, don't assume VALBITS / RAND_BITS is less than 5,
16018 and don't rely on undefined behavior when shifting a 1 left into
16019 the sign bit.
16020 * lisp.h (get_random): Change signature to match.
16021
16022 * lread.c (hash_string): Use size_t, not int, for hash computation.
16023 Normally we prefer signed values; but hashing is special, because
16024 it's better to use unsigned division on hash table sizes so that
16025 the remainder is nonnegative. Also, size_t is the natural width
16026 for hashing into memory. The previous code used 'int', which doesn't
16027 retain enough info to hash well into very large tables.
16028 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16029
16030 * dbusbind.c: Don't possibly lose pointer info when converting.
16031 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16032 Use XPNTR rather than XHASH, so that the high-order bits of
16033 the pointer aren't lost when converting through void *.
16034
16035 * eval.c (Fautoload): Don't double-shift a pointer.
16036
16037 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16038
16039 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16040
16041 * gnutls.c (DEF_GNUTLS_FN):
16042 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16043
16044 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16045
16046 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16047 marker. (Bug#8610)
16048
16049 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16050
16051 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16052 New version that can reserve upto 2GB of heap space.
16053
16054 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16055
16056 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16057
16058 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16059
16060 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16061 `gnutls_certificate_set_x509_key_file'.
16062
16063 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16064
16065 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16066 Update dependencies.
16067
16068 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16069
16070 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16071 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16072 Remove unused parameter `fildes'.
16073 * process.c (read_process_output, send_process): Don't pass it.
16074
16075 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16076
16077 Fix previous change: the library cache is defined in w32.c.
16078 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16079 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16080
16081 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16082
16083 Implement dynamic loading of GnuTLS on Windows.
16084
16085 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16086 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16087 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16088 Declare.
16089
16090 * gnutls.c (Qgnutls_dll): Define.
16091 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16092 (gnutls_*): Declare function pointers.
16093 (init_gnutls_functions): New function to initialize function pointers.
16094 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16095 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16096 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16097 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16098 (emacs_gnutls_write, emacs_gnutls_read)
16099 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16100 (Fgnutls_available_p): New function.
16101 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16102 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16103 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16104
16105 * image.c: Include w32.h.
16106 (Vimage_type_cache): Delete.
16107 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16108 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16109 (w32_delayed_load): Move to w32.c.
16110
16111 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16112
16113 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16114 (w32_delayed_load): Move from image.c. When loading a library, record
16115 its filename in the :loaded-from property of the library id.
16116 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16117 Initialize and staticpro them.
16118 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16119
16120 * process.c: Include lisp.h before w32.h, not after.
16121 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16122 instead of gnutls_record_check_pending.
16123
16124 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16125
16126 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16127
16128 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16129 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16130 as passed in.
16131
16132 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16133
16134 * xterm.c (x_set_frame_alpha): Do not set property on anything
16135 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16136
16137 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16138
16139 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16140
16141 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16142
16143 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16144 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16145 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16146 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16147 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16148 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16149 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16150 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16151 (Qgnutls_bootprop_callbacks_verify): Make static.
16152
16153 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16154
16155 * callproc.c: Indentation fixup.
16156
16157 * sysdep.c (wait_for_termination_1): Make static.
16158 (wait_for_termination, interruptible_wait_for_termination):
16159 Move after wait_for_termination_1.
16160
16161 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16162
16163 * sysdep.c (interruptible_wait_for_termination): New function
16164 which is like wait_for_termination, but allows keyboard
16165 interruptions.
16166
16167 * callproc.c (Fcall_process): Add (:file "file") as an option for
16168 the STDOUT buffer.
16169 (Fcall_process_region): Ditto.
16170
16171 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16172
16173 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16174 rather than `XVECTOR (FOO)->size'.
16175
16176 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16177 inttypes.h, as a gnulib replacement is used if it not available in
16178 system headers.
16179
16180 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16181
16182 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16183 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16184 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16185
16186 * coding.c (coding_alloc_by_realloc): Error out if destination
16187 will grow beyond MOST_POSITIVE_FIXNUM.
16188 (decode_coding_emacs_mule): Abort if there isn't enough place in
16189 charbuf for the composition carryover bytes. Reserve an extra
16190 space for up to 2 characters produced in a loop.
16191 (decode_coding_iso_2022): Abort if there isn't enough place in
16192 charbuf for the composition carryover bytes.
16193
16194 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16195
16196 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16197 aborting when %lld or %lll format is passed.
16198 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16199 %llo or %llx format is passed. (Bug#8545)
16200
16201 * window.c (window_scroll_line_based): Use a marker instead of
16202 simple variables to record original value of point. (Bug#7952)
16203
16204 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16205 produced by %s or %c overflows available buffer space. (Bug#8545)
16206
16207 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16208
16209 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16210 (SIZE_MAX): Move defn after all includes, as they might #define it.
16211
16212 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16213
16214 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16215
16216 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16217
16218 * keyboard.c (Qdelayed_warnings_hook): Define.
16219 (command_loop_1): Run `delayed-warnings-hook'
16220 if Vdelayed_warnings_list is non-nil.
16221 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16222 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16223
16224 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16225
16226 * doprnt.c (doprnt): Don't return value smaller than the buffer
16227 size if the message was truncated. (Bug#8545).
16228
16229 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16230
16231 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16232 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16233
16234 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16235
16236 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16237
16238 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16239
16240 * makefile.w32-in: Update dependencies.
16241
16242 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16243
16244 Improve `doprnt' and its usage. (Bug#8545)
16245 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16246 `format_end'. Remove support for %l as a conversion specifier.
16247 Don't use xrealloc. Improve diagnostics when the %l size modifier
16248 is used. Update the commentary.
16249
16250 * eval.c (verror): Simplify calculation of size_t.
16251
16252 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16253 messages.
16254
16255 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16256
16257 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16258 change.
16259
16260 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16261
16262 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16263 This makes this file independent of the recent pseudovector change.
16264
16265 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16266
16267 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16268
16269 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16270 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16271 Remove unused local.
16272 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16273
16274 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16275 GCC 4.6.0 optimizes based on type-based alias analysis.
16276 For example, if b is of type struct buffer * and v of type struct
16277 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16278 != &v->size, and therefore "v->size = 1; b->size = 2; return
16279 v->size;" must therefore return 1. This assumption is incorrect
16280 for Emacs, since it type-puns struct Lisp_Vector * with many other
16281 types. To fix this problem, this patch adds a new type struct
16282 vectorlike_header that documents the constraints on layout of vectors
16283 and pseudovectors, and helps optimizing compilers not get fooled
16284 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16285 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16286 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16287 the size member.
16288 (XSETPVECTYPE): Rewrite in terms of new macro.
16289 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16290 This is a bit clearer, and further avoids the possibility of
16291 undesirable aliasing.
16292 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16293 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16294 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16295 since Lisp_Subr is a special case (no "next" field).
16296 (ASIZE): Now uses header.size rather than size.
16297 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16298 to avoid the hassle of writing XVECTOR (foo)->header.size.
16299 (struct vectorlike_header): New type.
16300 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16301 object, to help avoid aliasing.
16302 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16303 (SUBRP): Likewise, since Lisp_Subr is a special case.
16304 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16305 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16306 (struct Lisp_Hash_Table): Combine first two members into a single
16307 struct vectorlike_header member. All uses of "size" and "next" members
16308 changed to be "header.size" and "header.next".
16309 * buffer.h (struct buffer): Likewise.
16310 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16311 * frame.h (struct frame): Likewise.
16312 * process.h (struct Lisp_Process): Likewise.
16313 * termhooks.h (struct terminal): Likewise.
16314 * window.c (struct save_window_data, struct saved_window): Likewise.
16315 * window.h (struct window): Likewise.
16316 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16317 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16318 * buffer.c (init_buffer_once): Likewise.
16319 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16320 special case.
16321 * process.c (Fformat_network_address): Use local var for size,
16322 for brevity.
16323
16324 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16325
16326 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16327 * data.c (atof): Remove decl; no longer used or needed.
16328 (digit_to_number): Move to lread.c.
16329 (Fstring_to_number): Use new string_to_number function, to be
16330 consistent with how the Lisp reader treats infinities and NaNs.
16331 Do not assume that floating-point numbers represent EMACS_INT
16332 without losing information; this is not true on most 64-bit hosts.
16333 Avoid double-rounding errors, by insisting on integers when
16334 parsing non-base-10 numbers, as the documentation specifies.
16335 * lisp.h (string_to_number): New decl, replacing ...
16336 (isfloat_string): Remove.
16337 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16338 (read1): Do not accept +. and -. as integers; this
16339 appears to have been a coding error. Similarly, do not accept
16340 strings like +-1e0 as floating point numbers. Do not report
16341 overflow for integer overflows unless the base is not 10 which
16342 means we have no simple and reliable way to continue.
16343 Break out the floating-point parsing into a new
16344 function string_to_number, so that Fstring_to_number parses
16345 floating point numbers consistently with the Lisp reader.
16346 (digit_to_number): Move here from data.c. Make it static inline.
16347 (E_CHAR, EXP_INT): Remove, replacing with ...
16348 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16349 (string_to_number): New function, replacing isfloat_string.
16350 This function checks for valid syntax and produces the resulting
16351 Lisp float number too. Rework it so that string-to-number
16352 no longer mishandles examples like "1.0e+". Use strtoumax,
16353 so that overflow for non-base-10 numbers is reported only when
16354 there's no portable and simple way to convert to floating point.
16355
16356 * textprop.c (set_text_properties_1): Rewrite for clarity,
16357 and to avoid GCC warning about integer overflow.
16358
16359 * intervals.h (struct interval): Use EMACS_INT for members
16360 where EMACS_UINT might cause problems. See
16361 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16362 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16363 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16364 All uses changed.
16365 (offset_intervals): Tell GCC not to worry about length overflow
16366 when negating a negative length.
16367
16368 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16369 (overrun_check_free): Likewise.
16370
16371 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16372 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16373 word size.
16374
16375 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16376 (gnutls_make_error): Rename local to avoid shadowing.
16377 (gnutls_emacs_global_deinit): ifdef out; not used.
16378 (Fgnutls_boot): Use const for pointer to readonly storage.
16379 Comment out unused local. Fix pointer signedness problems.
16380
16381 * lread.c (openp): Don't stuff size_t into an 'int'.
16382 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16383 about possible signed overflow.
16384
16385 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16386 (GDK_KEY_g): Don't define if already defined.
16387 (xg_prepare_tooltip): Avoid pointer signedness problem.
16388 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16389
16390 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16391 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16392
16393 * xfns.c (Fx_window_property): Simplify a bit,
16394 to make a bit faster and to avoid GCC 4.6.0 warning.
16395 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16396
16397 * fns.c (internal_equal): Don't assume size_t fits in int.
16398
16399 * alloc.c (compact_small_strings): Tighten assertion a little.
16400
16401 Replace pEd with more-general pI, and fix some printf arg casts.
16402 * lisp.h (pI): New macro, generalizing old pEd macro to other
16403 conversion specifiers. For example, use "...%"pI"d..." rather
16404 than "...%"pEd"...".
16405 (pEd): Remove. All uses replaced with similar uses of pI.
16406 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16407 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16408 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16409 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16410 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16411 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16412 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16413 64-bit hosts.
16414 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16415 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16416 * print.c (safe_debug_print, print_object): Likewise.
16417 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16418 to int.
16419 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16420 avoiding the 0 flag, which is not portable.
16421 * process.c (Fmake_network_process): Use pI to avoid cast.
16422 * region-cache.c (pp_cache): Likewise.
16423 * xdisp.c (decode_mode_spec): Likewise.
16424 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16425 behavior on 64-bit hosts with printf arg.
16426 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16427 (x_stop_queuing_selection_requests): Likewise.
16428 (x_get_window_property): Don't truncate byte count to an 'int'
16429 when tracing.
16430
16431 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16432 here, since it parses constructs like leading '-' and spaces,
16433 which are not wanted; and it overflows with large numbers.
16434 Instead, simply match F[0-9]+, which is what is wanted anyway.
16435
16436 * alloc.c: Remove unportable assumptions about struct layout.
16437 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16438 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16439 (allocate_vectorlike, make_pure_vector): Use the new macros,
16440 plus offsetof, to remove unportable assumptions about struct layout.
16441 These assumptions hold on all porting targets that I know of, but
16442 they are not guaranteed, they're easy to remove, and removing them
16443 makes further changes easier.
16444
16445 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16446 This doesn't fix a bug but makes the code clearer.
16447 (string_overrun_cookie): Now const. Use initializers that
16448 don't formally overflow signed char, to avoid warnings.
16449 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16450 can cause Emacs to crash when string overrun checking is enabled.
16451 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16452 multiple of sizeof (EMACS_INT); it need not be, if
16453 alignof(EMACS_INT) < sizeof (EMACS_INT).
16454 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16455
16456 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16457
16458 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16459
16460 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16461
16462 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16463 supposed to be handshaking. (Bug#8556)
16464 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16465
16466 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16467
16468 * lisp.h (Qdebug): List symbol.
16469 * eval.c (Qdebug): Restore global linkage.
16470 * keyboard.c (debug-on-event): New variable.
16471 (handle_user_signal): Break into debugger when debug-on-event
16472 matches the current signal symbol.
16473
16474 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16475
16476 * alloc.c (check_sblock, check_string_bytes)
16477 (check_string_free_list): Convert to standard C.
16478
16479 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16480
16481 * w32.c (emacs_gnutls_push): Fix typo.
16482
16483 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16484
16485 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16486 "cast to pointer from integer of different size".
16487
16488 Improve doprnt and its use in verror. (Bug#8545)
16489 * doprnt.c (doprnt): Document the set of format control sequences
16490 supported by the function. Use SAFE_ALLOCA instead of always
16491 using `alloca'.
16492
16493 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16494 is one byte too soon. Don't use xrealloc; instead xfree and
16495 xmalloc anew.
16496
16497 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16498
16499 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16500 callbacks stage.
16501
16502 * gnutls.c: Renamed global_initialized to
16503 gnutls_global_initialized. Added internals for the
16504 :verify-hostname-error, :verify-error, and :verify-flags
16505 parameters of `gnutls-boot' and documented those parameters in the
16506 docstring. Start callback support.
16507 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16508 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16509 on error. Return error code.
16510 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16511 (emacs_gnutls_read): Likewise.
16512 (Fgnutls_boot): Return handshake error code.
16513 (emacs_gnutls_handle_error): New function.
16514 (wsaerror_to_errno): Likewise.
16515
16516 * w32.h (emacs_gnutls_pull): Add prototype.
16517 (emacs_gnutls_push): Likewise.
16518
16519 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16520 (emacs_gnutls_push): Likewise.
16521
16522 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16523
16524 * process.c (wait_reading_process_output): Check if GnuTLS
16525 buffered some data internally if no FDs are set for TLS
16526 connections.
16527
16528 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16529 (LIBS): Link to USER_LIBS.
16530 ($(BLD)/gnutls.$(0)): New target.
16531
16532 2011-04-24 Eli Zaretskii <eliz@gnu.org>
16533
16534 * xdisp.c (handle_single_display_spec): Rename the
16535 display_replaced_before_p argument into display_replaced_p, to
16536 make it consistent with the commentary. Fix typos in the
16537 commentary.
16538
16539 * textprop.c (syms_of_textprop): Remove dead code.
16540 (copy_text_properties): Delete obsolete commentary about an
16541 interface that was deleted long ago. Fix typos in the description
16542 of arguments.
16543
16544 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16545 to changes in oldXMenu/XMenu.h from 2011-04-16.
16546 <menu_help_message, prev_menu_help_message>: Constify.
16547 (IT_menu_make_room): menu->help_text is now `const char **';
16548 adjust.
16549
16550 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16551 to changes in oldXMenu/XMenu.h from 2011-04-16.
16552 (struct XMenu): Declare `help_text' `const char **'.
16553
16554 * xfaces.c <Qunspecified>: Make extern again.
16555
16556 * syntax.c: Include sys/types.h before including regex.h, as
16557 required by POSIX.
16558
16559 * doc.c (get_doc_string): Improve the format passed to `error'.
16560
16561 * doprnt.c (doprnt): Improve commentary.
16562
16563 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16564
16565 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16566 them with etags.
16567
16568 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16569 changes in globals.h immediately force recompilation.
16570 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16571 $(CURDIR)/s/ms-w32.h.
16572 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16573
16574 * character.c (Fchar_direction): Function deleted.
16575 (syms_of_character): Don't defsubr it.
16576 <char-direction-table>: Deleted.
16577
16578 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16579
16580 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16581 * doprnt.c: Include limits.h.
16582 (SIZE_MAX): New macro.
16583 (doprnt): Return a size_t value. 2nd arg is now size_t.
16584 Many local variables are now size_t instead of int or unsigned.
16585 Improve overflow protection. Support `l' modifier for integer
16586 conversions. Support %l conversion. Don't assume an EMACS_INT
16587 argument for integer conversions and for %c.
16588
16589 * lisp.h (doprnt): Restore prototype.
16590
16591 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16592 $(SRC)/character.h.
16593
16594 * Makefile.in (base_obj): Add back doprnt.o.
16595
16596 * deps.mk (doprnt.o): Add back prerequisites.
16597 (callint.o): Depend on character.h.
16598
16599 * eval.c (internal_lisp_condition_case): Include the handler
16600 representation in the error message.
16601 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16602 when breaking from the loop.
16603
16604 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16605
16606 * callint.c (Fcall_interactively): When displaying error message
16607 about invalid control letter, pass the character's codepoint, not
16608 a pointer to its multibyte form. Improve display of the character
16609 in octal and display also its hex code.
16610
16611 * character.c (char_string): Use %x to display the (unsigned)
16612 codepoint of an invalid character, to avoid displaying a bogus
16613 negative value.
16614
16615 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16616 `error', not SYMBOL_NAME itself.
16617
16618 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16619 character arguments to `error'.
16620
16621 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16622 to `error' in error message about FINAL_CHAR argument. Make sure
16623 FINAL_CHAR is a character, and use %c when it is passed as
16624 argument to `error'.
16625
16626 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16627
16628 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16629
16630 * w32.c: Include <time.h>.
16631 (sys_localtime): New function.
16632
16633 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
16634
16635 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16636
16637 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16638
16639 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
16640
16641 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16642 zombies (Bug#8467).
16643
16644 2011-04-19 Eli Zaretskii <eliz@gnu.org>
16645
16646 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16647 gl_state.e_property when gl_state.object is Qt.
16648
16649 * insdel.c (make_gap_larger): Remove limitation of buffer size
16650 to <= INT_MAX.
16651
16652 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
16653
16654 * xdisp.c (lookup_glyphless_char_display)
16655 (produce_glyphless_glyph): Handle cons cell entry in
16656 glyphless-char-display.
16657 (Vglyphless_char_display): Document it.
16658
16659 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16660 glyphless-char-display.
16661
16662 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
16663
16664 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16665
16666 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16667
16668 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16669 definition for no-X builds.
16670
16671 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
16672
16673 Static checks with GCC 4.6.0 and non-default toolkits.
16674
16675 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16676
16677 * process.c (keyboard_bit_set): Define only if SIGIO.
16678 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16679 (send_process): Repair possible setjmp clobbering.
16680
16681 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16682
16683 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16684
16685 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16686
16687 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16688 Define only if needed.
16689
16690 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16691 by pacifying GCC about it. Maybe it's time to retire it?
16692 * xfaces.c (USG, __TIMEVAL__): Likewise.
16693
16694 * dispextern.h (struct redisplay_interface): Rename param
16695 to avoid shadowing.
16696 * termhooks.h (struct terminal): Likewise.
16697 * xterm.c (xembed_send_message): Likewise.
16698
16699 * insdel.c (make_gap_smaller): Define only if
16700 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16701
16702 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16703 it.
16704
16705 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16706 so that we aren't warned about unused symbols.
16707
16708 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16709
16710 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16711
16712 * xfns.c (x_real_positions): Mark locals as initialized.
16713
16714 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16715
16716 * xterm.c: Fix problems found by static analysis with other toolkits.
16717 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16718 (x_dispatch_event): Declare static if USE_GTK, and
16719 define if USE_GTK || USE_X_TOOLKIT.
16720 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16721 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16722 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16723 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16724
16725 * xmenu.c (menu_help_callback): Pointer type fixes.
16726 Use const pointers when pointing at readonly data. Avoid pointer
16727 signedness clashes.
16728 (FALSE): Remove unused macro.
16729 (update_frame_menubar): Remove unused decl.
16730
16731 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16732
16733 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16734 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16735 (single_menu_item): Rename local to avoid shadowing.
16736
16737 * keyboard.c (make_lispy_event): Remove unused local var.
16738
16739 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16740 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16741
16742 * bitmaps: Change bitmaps from unsigned char back to the X11
16743 compatible char. Avoid the old compiler warnings about
16744 out-of-range initializers by using, for example, '\xab' rather
16745 than 0xab.
16746
16747 * xgselect.c (xgselect_initialize): Check vs interface
16748 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16749
16750 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16751
16752 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16753 to read-only memory.
16754
16755 * fns.c (vector): Remove; this old hack is no longer needed.
16756
16757 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16758 Remove unused var.
16759 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16760
16761 * xrdb.c (x_load_resources): Omit unused local.
16762
16763 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16764 (x_window): Rename locals to avoid shadowing.
16765 (USG): Use the kludged USG macro, to pacify gcc.
16766
16767 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16768 (x_term_init): Remove local to avoid shadowing.
16769
16770 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16771
16772 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16773 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16774
16775 2011-04-16 Eli Zaretskii <eliz@gnu.org>
16776
16777 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16778
16779 Fix regex.c, syntax.c and friends for buffers > 2GB.
16780 * syntax.h (struct gl_state_s): Declare character position members
16781 EMACS_INT.
16782
16783 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16784
16785 * textprop.c (verify_interval_modification, interval_of):
16786 Declare arguments EMACS_INT.
16787
16788 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16789 EMACS_INT.
16790
16791 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16792
16793 * indent.c (Fvertical_motion): Local variable it_start is now
16794 EMACS_INT.
16795
16796 * regex.c (re_match, re_match_2, re_match_2_internal)
16797 (bcmp_translate, regcomp, regexec, print_double_string)
16798 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16799 (re_compile_pattern, re_exec): Declare arguments and local
16800 variables `size_t' and `ssize_t' and return values `regoff_t', as
16801 appropriate.
16802 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16803 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16804 <compile_stack_type>: `size' and `avail' are now `size_t'.
16805
16806 * regex.h <regoff_t>: Use ssize_t, not int.
16807 (re_search, re_search_2, re_match, re_match_2): Arguments that
16808 specify buffer/string position and length are now ssize_t and
16809 size_t. Return type is regoff_t.
16810
16811 2011-04-16 Ben Key <bkey76@gmail.com>
16812
16813 * nsfont.m: Fixed bugs in ns_get_family and
16814 ns_descriptor_to_entity that were caused by using free to
16815 deallocate memory blocks that were allocated by xmalloc (via
16816 xstrdup). This caused Emacs to crash when compiled with
16817 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16818 --enable-checking=xmallocoverrun). xfree is now used to
16819 deallocate these memory blocks.
16820
16821 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
16822
16823 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16824
16825 emacs_write: Accept and return EMACS_INT for sizes.
16826 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16827 et seq.
16828 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16829 Accept and return EMACS_INT.
16830 (emacs_gnutls_write): Return the number of bytes written on
16831 partial writes.
16832 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16833 (emacs_read, emacs_write): Remove check for negative size, as the
16834 Emacs source code has been audited now.
16835 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16836 (emacs_read, emacs_write): Use it.
16837 * process.c (send_process): Adjust to the new signatures of
16838 emacs_write and emacs_gnutls_write. Do not attempt to store
16839 a byte offset into an 'int'; it might overflow.
16840 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16841
16842 * sound.c: Don't assume sizes fit in 'int'.
16843 (struct sound_device.period_size, alsa_period_size):
16844 Return EMACS_INT, not int.
16845 (struct sound_device.write, vox_write, alsa_write):
16846 Accept EMACS_INT, not int.
16847 (wav_play, au_play): Use EMACS_INT to store sizes and to
16848 record read return values.
16849
16850 2011-04-15 Ben Key <bkey76@gmail.com>
16851
16852 * keyboard.c (Qundefined): Don't declare static since it is used
16853 in nsfns.m.
16854 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16855 static since they are used in nsfont.m.
16856
16857 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16858
16859 * process.c (Qprocessp): Don't declare static.
16860 * lisp.h (Qprocessp): Declare again.
16861
16862 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
16863
16864 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16865
16866 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16867
16868 Improve C-level modularity by making more things 'static'.
16869
16870 Don't publish debugger-only interfaces to other modules.
16871 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16872 (verify_bytepos, count_markers): Move decls to the only modules
16873 that need them.
16874 * region-cache.h (pp_cache): Likewise.
16875 * window.h (check_all_windows): Likewise.
16876 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16877
16878 * sysdep.c (croak): Now static, if
16879 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16880 * syssignal.h (croak): Declare only if not static.
16881
16882 * alloc.c (refill_memory_reserve): Now static if
16883 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16884 * lisp.h (refill_memory_reserve): Declare only if not static.
16885
16886 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16887 Define only if USE_LUCID.
16888
16889 * xrdb.c (x_customization_string, x_rm_string): Now static.
16890
16891 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16892 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16893
16894 * xdisp.c (draw_row_with_mouse_face): Now static.
16895 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16896
16897 * window.h (check_all_windows): Mark externally visible.
16898
16899 * window.c (window_deletion_count): Now static.
16900
16901 * undo.c: Make symbols static if they're not exported.
16902 (last_undo_buffer, last_boundary_position, pending_boundary):
16903 Now static.
16904
16905 * textprop.c (interval_insert_behind_hooks): Now static.
16906 (interval_insert_in_front_hooks): Likewise.
16907
16908 * term.c: Make symbols static if they're not exported.
16909 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16910 (max_frame_lines, tty_set_terminal_modes):
16911 (tty_reset_terminal_modes, tty_turn_off_highlight):
16912 (get_tty_terminal): Now static.
16913 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16914 * termhooks.h (term_mouse_moveto): Do not declare if
16915 HAVE_WINDOW_SYSTEM.
16916 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16917 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16918
16919 * sysdep.c: Make symbols static if they're not exported.
16920 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16921 Now static.
16922 (sigprocmask_set, full_mask): Remove; unused.
16923 (wait_debugging): Mark as visible.
16924 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16925 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16926
16927 * syntax.c (syntax_temp): Define only if !__GNUC__.
16928
16929 * sound.c (current_sound_device, current_sound): Now static.
16930
16931 * search.c (searchbufs, searchbuf_head): Now static.
16932
16933 * scroll.c (scroll_cost): Remove; unused.
16934 * dispextern.h (scroll_cost): Remove decl.
16935
16936 * region-cache.h (pp_cache): Mark as externally visible.
16937
16938 * process.c: Make symbols static if they're not exported.
16939 (process_tick, update_tick, create_process, chan_process):
16940 (Vprocess_alist, proc_buffered_char, datagram_access):
16941 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16942 (deactivate_process): Mark defn as static, as well as decl.
16943 * lisp.h (create_process): Remove decl.
16944 * process.h (chan_process, Vprocess_alist): Remove decls.
16945
16946 * print.c: Make symbols static if they're not exported.
16947 (print_depth, new_backquote_output, being_printed, print_buffer):
16948 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16949 (print_interval, print_number_index, initial_stderr_stream):
16950 Now static.
16951 * lisp.h (Fprinc): Remove decl.
16952 (debug_output_compilation_hack): Mark as externally visible.
16953
16954 * sysdep.c (croak): Move decl from here to syssignal.h.
16955 * syssignal.h (croak): Put it here, so the API can be checked when
16956 'croak' is called from dissociate_if_controlling_tty.
16957
16958 * minibuf.c: Make symbols static if they're not exported.
16959 (minibuf_save_list, choose_minibuf_frame): Now static.
16960 * lisp.h (choose_minibuf_frame): Remove decl.
16961
16962 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16963
16964 * lread.c: Make symbols static if they're not exported.
16965 (read_objects, initial_obarray, oblookup_last_bucket_number):
16966 Now static.
16967 (make_symbol): Remove; unused.
16968 * lisp.h (initial_obarray, make_symbol): Remove decls.
16969
16970 * keyboard.c: Make symbols static if they're not exported.
16971 (single_kboard, recent_keys_index, total_keys, recent_keys):
16972 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16973 (this_single_command_key_start, echoing, last_auto_save):
16974 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16975 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16976 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16977 (Vlispy_mouse_stem, double_click_count):
16978 Now static.
16979 (force_auto_save_soon): Define only if SIGDANGER.
16980 (ignore_mouse_drag_p): Now static if
16981 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16982 (print_help): Remove; unused.
16983 (stop_character, last_timer_event): Mark as externally visible.
16984 * keyboard.h (ignore_mouse_drag_p): Declare only if
16985 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16986 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16987 * lisp.h (echoing): Remove decl.
16988 (force_auto_save_soon): Declare only if SIGDANGER.
16989 * xdisp.c (redisplay_window): Simplify code, to make it more
16990 obvious that ignore_mouse_drag_p is not accessed if !defined
16991 USE_GTK && !defined HAVE_NS.
16992
16993 * intervals.c: Make symbols static if they're not exported.
16994 (merge_properties_sticky, merge_interval_right, delete_interval):
16995 Now static.
16996 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16997
16998 * insdel.c: Make symbols static if they're not exported.
16999 However, leave prepare_to_modify_buffer alone. It's never
17000 called from outside this function, but that appears to be a bug.
17001 (combine_after_change_list, combine_after_change_buffer):
17002 (adjust_after_replace, signal_before_change): Now static.
17003 (adjust_after_replace_noundo): Remove; unused.
17004 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17005 (signal_before_change): Remove decls.
17006
17007 * indent.c (val_compute_motion, val_vmotion): Now static.
17008
17009 * image.c: Make symbols static if they're not exported.
17010 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17011 if USE_GTK.
17012 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17013 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17014
17015 * fringe.c (standard_bitmaps): Now static.
17016 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17017
17018 * frame.c: Make symbols static if they're not exported.
17019 (x_report_frame_params, make_terminal_frame): Now static.
17020 (get_frame_param): Now static, unless HAVE_NS.
17021 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17022 (x_get_resource_string): Remove; not used.
17023 * frame.h (make_terminal_frame, x_report_frame_params):
17024 (x_get_resource_string); Remove decls.
17025 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17026 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17027
17028 * font.c, fontset.c: Make symbols static if they're not exported.
17029 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17030 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17031 * font.c (font_close_object): Now static.
17032 * font.h (font_close_object): Remove.
17033 * fontset.c (FONTSET_OBJLIST): Remove.
17034 (free_realized_fontset) #if-0 the body, which does nothing.
17035 (face_suitable_for_char_p): #if-0, as it's never called.
17036 * fontset.h (face_suitable_for_char_p): Remove decl.
17037 * xfaces.c (face_at_string_position):
17038 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17039 since 0 is always ASCII.
17040
17041 * fns.c (weak_hash_tables): Now static.
17042
17043 * fileio.c: Make symbols static if they're not exported.
17044 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17045 (Vwrite_region_annotation_buffers): Now static.
17046
17047 * eval.c: Make symbols static if they're not exported.
17048 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17049 * lisp.h (backtrace_list): Remove decl.
17050
17051 * emacs.c: Make symbols static if they're not exported.
17052 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17053 (fatal_error_code, fatal_error_signal_hook, standard_args):
17054 Now static.
17055 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17056 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17057 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17058 * lisp.h (fatal_error_signal_hook): Remove decl.
17059 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17060
17061 * editfns.c: Move a (normally-unused) function to its only use.
17062 * editfns.c, lisp.h (get_operating_system_release): Remove.
17063 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17064 worth the hassle of breaking this out.
17065
17066 * xterm.c: Make symbols static if they're not exported.
17067 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17068 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17069 (x_destroy_window, x_delete_display):
17070 Now static.
17071 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17072 (x_mouse_leave): Remove; unused.
17073 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17074 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17075 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17076 Remove decls.
17077 (x_mouse_leave): Declare only if WINDOWSNT.
17078 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17079 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17080 USE_X_TOOLKIT.
17081
17082 * ftxfont.c: Make symbols static if they're not exported.
17083 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17084 HAVE_FREETYPE.
17085 * font.h (ftxfont_driver): Likewise.
17086
17087 * xfns.c: Make symbols static if they're not exported.
17088 (x_last_font_name, x_display_info_for_name):
17089 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17090 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17091 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17092 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17093 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17094 (last_show_tip_args): Now static.
17095 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17096 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17097 (x_screen_planes): Remove; unused.
17098 * dispextern.h (x_screen_planes): Remove decl.
17099
17100 * dispnew.c: Make symbols static if they're not exported.
17101 * dispextern.h (redraw_garbaged_frames, scrolling):
17102 (increment_row_positions): Remove.
17103 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17104 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17105 Now static.
17106 (redraw_garbaged_frames): Remove; unused.
17107
17108 * xfaces.c: Make symbols static if they're not exported.
17109 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17110 Remove decls.
17111 * xterm.h (defined_color): Remove decls.
17112 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17113 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17114 (menu_face_changed_default, defined_color, free_realized_face):
17115 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17116 (ascii_face_of_lisp_face): Remove; unused.
17117
17118 * xdisp.c: Make symbols static if they're not exported.
17119 * dispextern.h (scratch_glyph_row, window_box_edges):
17120 (glyph_to_pixel_coords, set_cursor_from_row):
17121 (get_next_display_element, set_iterator_to_next):
17122 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17123 (show_mouse_face): Remove decls
17124 * frame.h (message_buf_print): Likewise.
17125 * lisp.h (pop_message, set_message, check_point_in_composition):
17126 Likewise.
17127 * xterm.h (set_vertical_scroll_bar): Likewise.
17128 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17129 (message_buf_print, scratch_glyph_row, displayed_buffer):
17130 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17131 (get_next_display_element, show_mouse_face, window_box_edges):
17132 (frame_to_window_pixel_xy, check_point_in_composition):
17133 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17134 (glyph_to_pixel_coords): Remove; unused.
17135
17136 * dired.c (file_name_completion): Now static.
17137
17138 * dbusbind.c (xd_in_read_queued_messages): Now static.
17139
17140 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17141 * data.c (circular_list_error): Remove.
17142
17143 * commands.h (last_point_position, last_point_position_buffer):
17144 (last_point_position_window): Remove decls.
17145 * keyboard.c: Make these variables static.
17146
17147 * coding.h (coding, code_convert_region, encode_coding_gap):
17148 Remove decls.
17149 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17150 (iso_code_class, detect_coding, code_convert_region): Now static.
17151 (encode_coding_gap): Remove; unused.
17152
17153 * chartab.c (chartab_chars, chartab_bits): Now static.
17154
17155 * charset.h (charset_iso_8859_1): Remove decl.
17156 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17157 Now static.
17158
17159 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17160 * ccl.c (Vccl_program_table): Now static.
17161 (check_ccl_update): Remove; unused.
17162
17163 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17164 * category.h: ... from here.
17165 * category.c (check_category_table, set_category_set): Now static.
17166
17167 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17168 * lisp.h: Remove these decls.
17169
17170 * buffer.c (buffer_count): Remove unused var.
17171
17172 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17173 so that it's not optimized away.
17174 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17175 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17176 exported only to the debugger.
17177
17178 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17179 * atimer.h (run_all_atimers): Remove; not exported.
17180
17181 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17182 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17183 was inaccessible from Lisp.
17184 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17185 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17186
17187 alloc.c: Import and export fewer symbols, and remove unused items.
17188 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17189 is defined.
17190 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17191 it's not optimized away by whole-program optimization.
17192 (message_enable_multibyte, free_misc): Remove.
17193 (catchlist, handlerlist, mark_backtrace):
17194 Declare only if BYTE_MARK_STACK.
17195 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17196 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17197 (message_enable_multibyte): Remove decl.
17198 (free_misc, interval_free_list, float_block, float_block_index):
17199 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17200 (cons_free_list, last_marked_index):
17201 Now static.
17202 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17203 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17204 (mark_backtrace): Define only if BYTE_MARK_STACK.
17205 * xdisp.c (message_enable_multibyte): Now static.
17206
17207 Declare Lisp_Object Q* variables to be 'static' if not exported.
17208 This makes it easier for human readers (and static analyzers)
17209 to see whether these variables are used from other modules.
17210 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17211 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17212 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17213 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17214 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17215 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17216 * xmenu.c, xselect.c:
17217 Declare Q* vars static if they are not used in other modules.
17218 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17219 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17220 Remove decls of unexported vars.
17221 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17222
17223 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17224
17225 Make Emacs functions such as Fatom 'static' by default.
17226 This makes it easier for human readers (and static analyzers)
17227 to see whether these functions can be called from other modules.
17228 DEFUN now defines a static function. To make the function external
17229 so that it can be used in other C modules, use the new macro DEFUE.
17230 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17231 (Finit_image_library):
17232 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17233 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17234 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17235 Remove decls, since these functions are now static.
17236 (Funintern, Fget_internal_run_time): New decls, since these functions
17237 were already external.
17238
17239 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17240 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17241 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17242 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17243 * keyboard.c, keymap.c, lread.c:
17244 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17245 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17246 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17247 Mark functions with DEFUE instead of DEFUN,
17248 if they are used in other modules.
17249 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17250 decls for now-static functions.
17251 * buffer.h (Fdelete_overlay): Remove decl.
17252 * callproc.c (Fgetenv_internal): Mark as internal.
17253 * composite.c (Fremove_list_of_text_properties): Remove decl.
17254 (Fcomposition_get_gstring): New forward static decl.
17255 * composite.h (Fcomposite_get_gstring): Remove decl.
17256 * dired.c (Ffile_attributes): New forward static decl.
17257 * doc.c (Fdocumntation_property): New forward static decl.
17258 * eval.c (Ffetch_bytecode): New forward static decl.
17259 (Funintern): Remove extern decl; now in .h file where it belongs.
17260 * fileio.c (Fmake_symbolic_link): New forward static decl.
17261 * image.c (Finit_image_library): New forward static decl.
17262 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17263 * intervals.h (Fprevious_property_change):
17264 (Fremove_list_of_text_properties): Remove decls.
17265 * keyboard.c (Fthis_command_keys): Remove decl.
17266 (Fcommand_execute): New forward static decl.
17267 * keymap.c (Flookup_key): New forward static decl.
17268 (Fcopy_keymap): Now static.
17269 * keymap.h (Flookup_key): Remove decl.
17270 * process.c (Fget_process): New forward static decl.
17271 (Fprocess_datagram_address): Mark as internal.
17272 * syntax.c (Fsyntax_table_p): New forward static decl.
17273 (skip_chars): Remove duplicate decl.
17274 * textprop.c (Fprevious_property_change): New forward static decl.
17275 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17276 Now internal.
17277 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17278 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17279
17280 * editfns.c (Fformat): Remove unreachable code.
17281
17282 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17283
17284 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17285 change. (Bug#8496)
17286
17287 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17288
17289 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17290 when at ZV. (Bug#8487)
17291
17292 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17293
17294 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17295 (Bug#8437)
17296 * keyboard.c (parse_tool_bar_item): Likewise.
17297 * sound.c (sound_cleanup, alsa_close): Likewise.
17298 * termcap.c (tgetent): Likewise.
17299 * xfns.c (x_default_font_parameter): Likewise.
17300 * xsettings.c (read_and_apply_settings): Likewise.
17301
17302 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17303 (overrun_check_free): Protoize.
17304
17305 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17306
17307 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17308 since callers should never pass a negative size.
17309 Change the signature to match that of plain 'read' and 'write'; see
17310 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17311 * lisp.h: Update prototypes of emacs_write and emacs_read.
17312
17313 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17314
17315 * xdisp.c (redisplay_window): Don't try to determine the character
17316 position of the scroll margin if the window start point w->startp
17317 is outside the buffer's accessible region. (Bug#8468)
17318
17319 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17320
17321 Fix write-region and its subroutines for buffers > 2GB.
17322 * fileio.c (a_write, e_write): Modify declaration of arguments and
17323 local variables to support buffers larger than 2GB.
17324 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17325
17326 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17327 argument, local variables, and return value.
17328
17329 * lisp.h: Update prototypes of emacs_write and emacs_read.
17330
17331 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17332
17333 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17334
17335 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17336
17337 Fix more problems found by GCC 4.6.0's static checks.
17338
17339 * xdisp.c (vmessage): Use a better test for character truncation.
17340
17341 * charset.c (load_charset_map): <, not <=, for optimization,
17342 and to avoid potential problems with integer overflow.
17343 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17344 * casetab.c (set_identity, shuffle): Likewise.
17345 * editfns.c (Fformat): Likewise.
17346 * syntax.c (skip_chars): Likewise.
17347
17348 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17349 This also lets GCC 4.6.0 generate slightly better loop code.
17350
17351 * callint.c (Fcall_interactively): <, not <=, for optimization.
17352 (Fcall_interactively): Count the number of arguments produced,
17353 not the number of arguments given. This is simpler and lets GCC
17354 4.6.0 generate slightly better code.
17355
17356 * ftfont.c: Distingish more carefully between FcChar8 and char.
17357 The previous code passed unsigned char * to a functions like
17358 strlen and xstrcasecmp that expect char *, which does not
17359 conform to the C standard.
17360 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17361 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17362 char * when the C standard requires it.
17363
17364 * keyboard.c (read_char): Remove unused var.
17365
17366 * eval.c: Port to Windows vsnprintf (Bug#8435).
17367 Include <limits.h>.
17368 (SIZE_MAX): Define if the headers do not.
17369 (verror): Do not give up if vsnprintf returns a negative count.
17370 Instead, grow the buffer. This ports to Windows vsnprintf, which
17371 does not conform to C99. Problem reported by Eli Zaretskii.
17372 Also, simplify the allocation scheme, by avoiding the need for
17373 calling realloc, and removing the ALLOCATED variable.
17374
17375 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17376
17377 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17378 But keep the doprint source code for now, as we might revamp it
17379 and use it again (Bug#8435).
17380 * lisp.h (doprnt): Remove.
17381 * Makefile.in (base_obj): Remove doprnt.o.
17382 * deps.mk (doprnt.o): Remove.
17383
17384 error: Print 32- and 64-bit integers portably (Bug#8435).
17385 Without this change, on typical 64-bit hosts error ("...%d...", N)
17386 was used to print both 32- and 64-bit integers N, which relied on
17387 undefined behavior.
17388 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17389 * lisp.h (error, verror): Mark as printf-like functions.
17390 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17391 Report overflow in size calculations when allocating printf buffer.
17392 Do not truncate output string at its first null byte.
17393 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17394 Truncate the output at a character boundary, since vsnprintf does not
17395 do that.
17396 * charset.c (check_iso_charset_parameter): Convert internal
17397 character to string before calling 'error', since %c now has the
17398 printf meaning.
17399 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17400 overflow when computing char to be passed to 'error'. Do not
17401 pass Lisp_Object to 'error'; pass the integer instead.
17402 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17403 formatted with plain %d.
17404
17405 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17406
17407 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17408
17409 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17410
17411 * xterm.c (x_catch_errors): Remove duplicate declaration.
17412
17413 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17414
17415 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17416
17417 2011-04-10 Jim Meyering <meyering@redhat.com>
17418
17419 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17420 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17421 return ssize_t not "int", and use size_t as the buffer length.
17422 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17423 * gnutls.h: Update declarations.
17424 * process.c (read_process_output): Use ssize_t, to match.
17425 (send_process): Likewise.
17426
17427 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17428
17429 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17430
17431 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17432
17433 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17434 Use unsigned char, to match FcChar8 type definition.
17435
17436 * xterm.c (handle_one_xevent):
17437 * xmenu.c (create_and_show_popup_menu):
17438 * xselect.c (x_decline_selection_request)
17439 (x_reply_selection_request): Avoid type-punned deref of X events.
17440
17441 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17442
17443 Fix some uses of `int' instead of EMACS_INT.
17444 * search.c (string_match_1, fast_string_match)
17445 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17446 (scan_buffer, find_next_newline_no_quit)
17447 (find_before_next_newline, search_command, Freplace_match)
17448 (Fmatch_data): Make some `int' variables be EMACS_INT.
17449
17450 * xdisp.c (display_count_lines): 3rd argument and return value now
17451 EMACS_INT. All callers changed.
17452 (pint2hrstr): Last argument is now EMACS_INT.
17453
17454 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17455 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17456 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17457 (decode_coding_utf_16, decode_coding_emacs_mule)
17458 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17459 (decode_coding_ccl, decode_coding_charset)
17460 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17461 (decode_coding_iso_2022, decode_coding_emacs_mule)
17462 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17463 <char_offset, last_offset>: Declare EMACS_INT.
17464 (encode_coding_utf_8, encode_coding_utf_16)
17465 (encode_coding_emacs_mule, encode_invocation_designation)
17466 (encode_designation_at_bol, encode_coding_iso_2022)
17467 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17468 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17469 Declare EMACS_INT.
17470 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17471 (encode_invocation_designation): Last argument P_NCHARS is now
17472 EMACS_INT.
17473 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17474 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17475
17476 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17477 All users changed.
17478
17479 * ccl.c (Fccl_execute_on_string): Declare some variables
17480 EMACS_INT.
17481
17482 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17483
17484 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17485
17486 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17487
17488 * process.c (Fformat_network_address): Doc fix.
17489
17490 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17491
17492 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17493
17494 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
17495
17496 * keyboard.c (read_char): Call Lisp function help-form-show,
17497 instead of using internal_with_output_to_temp_buffer.
17498 (Qhelp_form_show): New var.
17499 (syms_of_keyboard): Use DEFSYM macro.
17500
17501 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17502
17503 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17504
17505 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
17506
17507 * process.c (Flist_processes): Remove to Lisp.
17508 (list_processes_1): Delete.
17509
17510 2011-04-06 Eli Zaretskii <eliz@gnu.org>
17511
17512 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17513
17514 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17515
17516 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
17517
17518 Fix more problems found by GCC 4.6.0's static checks.
17519
17520 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17521
17522 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17523
17524 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17525
17526 * xdisp.c (vmessage): Mark as a printf-like function.
17527
17528 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17529
17530 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17531
17532 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17533 printf-like functions.
17534 (tiff_load): Add casts to remove these marks before passing them
17535 to system-supplied API.
17536
17537 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17538
17539 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17540 This avoids several warnings with gcc -Wstrict-overflow.
17541 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17542 directly, rather than having caller test rule sign. This avoids
17543 some unnecessary tests.
17544 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17545 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17546 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17547
17548 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17549 (xfont_open): Avoid unnecessary tests.
17550
17551 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17552
17553 * composite.h, composite.c (composition_gstring_put_cache):
17554 Use EMACS_INT, not int, for length.
17555
17556 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17557 breaking out part of COMPOSITION_DECODE_RULE.
17558 (COMPOSITION_DECODE_RULE): Use it.
17559 * composite.c (get_composition_id): Remove unused local vars,
17560 by using the new macro.
17561
17562 * textprop.c (set_text_properties_1): Change while to do-while,
17563 since the condition is always true at first.
17564
17565 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17566 (interval_deletion_adjustment): Return unsigned value.
17567 All uses changed.
17568
17569 * process.c (list_processes_1, create_pty, read_process_output):
17570 (exec_sentinel): Remove vars that were set but not used.
17571 (create_pty): Remove unnecessary "volatile"s.
17572 (Fnetwork_interface_info): Avoid possibility of int overflow.
17573 (read_process_output): Do adaptive read buffering even if carryover.
17574 (read_process_output): Simplify nbytes computation if buffered.
17575
17576 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17577
17578 * syntax.c (scan_words): Remove var that was set but not used.
17579 (update_syntax_table): Use unsigned instead of int.
17580
17581 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17582 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17583 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17584
17585 * print.c (print_error_message): Avoid int overflow.
17586
17587 * font.c (font_list_entities): Redo for clarity,
17588 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17589
17590 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17591 (font_score): Avoid potential overflow in diff calculation.
17592
17593 * fns.c (substring_both): Remove var that is set but not used.
17594 (sxhash): Redo loop for clarity and to avoid wraparound warning.
17595
17596 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17597
17598 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17599 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17600 can always succeed if overflow has undefined behavior.
17601
17602 * search.c (boyer_moore, wordify): Remove vars set but not used.
17603 (wordify): Omit three unnecessary tests.
17604
17605 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17606 All callers changed. This avoids the need for an unused var.
17607
17608 * casefiddle.c (casify_region): Remove var that is set but not used.
17609
17610 * dired.c (file_name_completion): Remove var that is set but not used.
17611
17612 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17613
17614 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17615 (Finsert_file_contents): Remove unnecessary code checking fd.
17616
17617 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17618 Check for integer overflow on size calculations.
17619
17620 * buffer.c (Fprevious_overlay_change): Remove var that is set
17621 but not used.
17622
17623 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17624 Remove vars that are set but not used.
17625 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17626 (timer_check_2): Mark vars as initialized.
17627
17628 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17629
17630 * image.c (lookup_image): Remove var that is set but not used.
17631 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17632
17633 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17634 that are set but not used.
17635
17636 * xfns.c (make_invisible_cursor): Don't return garbage
17637 if XCreateBitmapFromData fails (Bug#8410).
17638
17639 * xselect.c (x_get_local_selection, x_handle_property_notify):
17640 Remove vars that are set but not used.
17641
17642 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17643 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17644
17645 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17646 Remove var that is set but not used.
17647 (scroll_bar_windows_size): Now size_t, not int.
17648 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17649 Check for overflow.
17650
17651 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17652 (map_tty_color) [!defined MSDOS]: Likewise.
17653
17654 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17655
17656 * coding.c: Remove vars that are set but not used.
17657 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17658 All callers changed.
17659 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17660 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17661 (decode_coding_charset): Remove vars that are set but not used.
17662
17663 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17664 that is set but not used.
17665
17666 * print.c (print_object): Remove var that is set but not used.
17667
17668 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17669 The gnulib version avoids calling malloc in the usual case,
17670 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17671 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17672 * filelock.c (current_lock_owner): Likewise.
17673 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17674 * sysdep.c: Include allocator.h, careadlinkat.h.
17675 (emacs_no_realloc_allocator): New static constant.
17676 (emacs_readlink): New function.
17677 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17678 ../lib/careadlinkat.h.
17679
17680 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17681
17682 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17683 first non-nil return value).
17684
17685 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17686
17687 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17688 if not defined (Bug#8403).
17689
17690 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17691
17692 * xdisp.c (display_count_lines): Remove parameter `start',
17693 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17694 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17695 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17696 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17697 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17698 and thereabouts. All callers changed.
17699 (get_per_char_metric): Remove parameter `f', unused since
17700 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17701
17702 2011-04-02 Jim Meyering <meyering@redhat.com>
17703
17704 do not dereference NULL upon failed strdup
17705 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17706 (ns_get_family): Likewise.
17707
17708 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17709
17710 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17711
17712 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17713
17714 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17715 later (Bug#8403).
17716
17717 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17718
17719 Add lexical binding.
17720
17721 * window.c (Ftemp_output_buffer_show): New fun.
17722 (Fsave_window_excursion):
17723 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17724
17725 * lread.c (lisp_file_lexically_bound_p): New function.
17726 (Fload): Bind Qlexical_binding.
17727 (readevalloop): Remove `evalfun' arg.
17728 Bind Qinternal_interpreter_environment.
17729 (Feval_buffer): Bind Qlexical_binding.
17730 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17731 Mark as dynamic.
17732 (syms_of_lread): Declare `lexical-binding'.
17733
17734 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17735
17736 * keyboard.c (eval_dyn): New fun.
17737 (menu_item_eval_property): Use it.
17738
17739 * image.c (parse_image_spec): Use Ffunctionp.
17740
17741 * fns.c (concat, mapcar1): Accept byte-code-functions.
17742
17743 * eval.c (Fsetq): Handle lexical vars.
17744 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17745 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17746 (FletX, Flet): Obey lexical binding.
17747 (Fcommandp): Handle closures.
17748 (Feval): New `lexical' arg.
17749 (eval_sub): New function extracted from Feval. Use it almost
17750 everywhere where Feval was used. Look up vars in lexical env.
17751 Handle closures.
17752 (Ffunctionp): Move from subr.el.
17753 (Ffuncall): Handle closures.
17754 (apply_lambda): Remove `eval_flags'.
17755 (funcall_lambda): Handle closures and new byte-code-functions.
17756 (Fspecial_variable_p): New function.
17757 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17758 but without exporting it to Lisp.
17759
17760 * doc.c (Fdocumentation, store_function_docstring):
17761 * data.c (Finteractive_form): Handle closures.
17762
17763 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17764 interactive spec.
17765
17766 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17767 New byte-codes.
17768 (exec_byte_code): New function extracted from Fbyte_code to handle new
17769 calling convention for byte-code-functions. Add new byte-codes.
17770
17771 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17772
17773 * alloc.c (Fmake_symbol): Init new `declared_special' field.
17774
17775 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17776
17777 * xdisp.c (redisplay_internal): Fix prototype.
17778
17779 2011-03-31 Eli Zaretskii <eliz@gnu.org>
17780
17781 * xdisp.c (SCROLL_LIMIT): New macro.
17782 (try_scrolling): Use it when setting scroll_limit.
17783 Limit scrolling to 100 screen lines.
17784 (redisplay_window): Even when falling back on "recentering",
17785 position point in the window according to scroll-conservatively,
17786 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17787
17788 (try_scrolling): When point is above the window, allow searching
17789 as far as scroll_max, or one screenful, to compute vertical
17790 distance from PT to the scroll margin position. This prevents
17791 try_scrolling from unnecessarily failing when
17792 scroll-conservatively is set to a value slightly larger than the
17793 window height. Clean up the case of PT below the margin at bottom
17794 of window: scroll_max can no longer be INT_MAX. When aggressive
17795 scrolling is in use, don't let point enter the opposite scroll
17796 margin as result of the scroll.
17797 (syms_of_xdisp) <scroll-conservatively>: Document the
17798 threshold of 100 lines for never-recentering scrolling.
17799
17800 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17801
17802 * dispextern.h (move_it_by_lines):
17803 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17804 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17805 (message_log_check_duplicate): Remove parameters `prev_bol' and
17806 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17807 (redisplay_internal): Remove parameter `preserve_echo_area',
17808 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17809
17810 * indent.c (Fvertical_motion):
17811 * window.c (window_scroll_pixel_based, Frecenter):
17812 Don't pass `need_y_p' to `move_it_by_lines'.
17813
17814 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17815
17816 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17817 steal a few bits to be more compact.
17818 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17819 Remove unneeded casts.
17820
17821 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17822
17823 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17824
17825 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17826 binding" message (bug#7967).
17827
17828 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17829
17830 Fix more problems found by GCC 4.6.0's static checks.
17831
17832 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17833 Remove unused local var.
17834
17835 * editfns.c (Fmessage_box): Remove unused local var.
17836
17837 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17838 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17839 Omit unused local vars.
17840 * window.c (shrink_windows): Omit unused local var.
17841 * menu.c (digest_single_submenu): Omit unused local var.
17842 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17843 Omit unused local var.
17844
17845 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17846 Don't assume string length fits in int.
17847 (keyremap_step, read_key_sequence): Use size_t for sizes.
17848 (read_key_sequence): Don't check last_real_key_start redundantly.
17849
17850 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17851 instead of alloca (Bug#8344).
17852
17853 * eval.c (Fbacktrace): Don't assume nargs fits in int.
17854 (Fbacktrace_frame): Don't assume nframes fits in int.
17855
17856 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17857
17858 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17859 concerns.
17860
17861 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17862
17863 * cm.c (calccost): Turn while-do into do-while, for clarity.
17864
17865 * keyboard.c (syms_of_keyboard): Use the same style as later
17866 in this function when indexing through an array. This also
17867 works around GCC bug 48267.
17868
17869 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17870
17871 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17872
17873 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17874 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17875
17876 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17877 This avoids undefined behavior on integer overflow, and is a bit
17878 more convenient anyway since it is compared to a size_t variable.
17879
17880 Variadic C functions now count arguments with size_t, not int.
17881 This avoids an unnecessary limitation on 64-bit machines, which
17882 caused (substring ...) to crash on large vectors (Bug#8344).
17883 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17884 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
17885 All variadic functions and their callers changed accordingly.
17886 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17887 * data.c (arith_driver, float_arith_driver): Likewise.
17888 * editfns.c (general_insert_function): Likewise.
17889 * eval.c (struct backtrace.nargs, interactive_p)
17890 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17891 (funcall_lambda, mark_backtrace): Likewise.
17892 * fns.c (concat): Likewise.
17893 * frame.c (x_set_frame_parameters): Likewise.
17894 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17895 0 if not found, not -1. All callers changed.
17896
17897 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17898 (stack_copy_size): Now size_t, not int.
17899 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17900
17901 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17902
17903 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17904 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17905 All callers changed.
17906
17907 * lisp.h (multibyte_char_to_unibyte):
17908 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17909 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17910 * character.h (CHAR_TO_BYTE8):
17911 * cmds.c (internal_self_insert):
17912 * editfns.c (general_insert_function):
17913 * keymap.c (push_key_description):
17914 * search.c (Freplace_match):
17915 * xdisp.c (message_dolog, set_message_1): All callers changed.
17916
17917 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17918
17919 * keyboard.c (safe_run_hook_funcall): New function.
17920 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17921 don't set the hook to nil, but remove the offending function instead.
17922 (Qcommand_hook_internal): Remove, unused.
17923 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17924 Vcommand_hook_internal.
17925
17926 * eval.c (enum run_hooks_condition): Remove.
17927 (funcall_nil, funcall_not): New functions.
17928 (run_hook_with_args): Call each function through a `funcall' argument.
17929 Remove `cond' argument, now redundant.
17930 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17931 (Frun_hook_with_args_until_failure): Adjust accordingly.
17932 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17933
17934 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17935
17936 * dispextern.h (string_buffer_position): Remove declaration.
17937
17938 * print.c (strout): Remove parameter `multibyte', unused since
17939 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17940
17941 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17942 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17943 All callers changed.
17944
17945 * w32.c (_wsa_errlist): Use braces for struct initializers.
17946
17947 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17948 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17949 All callers changed.
17950 (string_buffer_position): Likewise. Also, make static (it's never
17951 used outside xdisp.c).
17952 (cursor_row_p): Remove parameter `w', unused since
17953 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17954 (decode_mode_spec): Remove parameter `precision', introduced during
17955 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17956 All callers changed.
17957
17958 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17959
17960 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17961
17962 2011-03-27 Anders Lindgren <andlind@gmail.com>
17963
17964 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17965 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17966 (ns_update_auto_hide_menu_bar): New functions.
17967 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17968 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17969 ns_constrain_all_frames.
17970 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17971 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17972
17973 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17974
17975 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17976
17977 2011-03-27 Glenn Morris <rgm@gnu.org>
17978
17979 * syssignal.h: Replace RETSIGTYPE with void.
17980 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17981 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17982 Replace SIGTYPE with void everywhere.
17983 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17984 * s/template.h (SIGTYPE): Remove commented out definition.
17985
17986 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17987
17988 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17989 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17990
17991 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17992
17993 * w32.c (read_unc_volume): Use parameter `henum', instead of
17994 global variable `wget_enum_handle'.
17995
17996 * keymap.c (describe_vector): Remove parameters `indices' and
17997 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17998 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17999
18000 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18001
18002 * keyboard.c (timer_check): Remove parameter `do_it_now',
18003 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18004 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18005 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18006
18007 * keyboard.c (read_char):
18008 * w32menu.c (w32_menu_display_help):
18009 * xmenu.c (show_help_event, menu_help_callback):
18010 Adjust calls to `show_help_echo'.
18011
18012 * gtkutil.c (xg_maybe_add_timer):
18013 * keyboard.c (readable_events):
18014 * process.c (wait_reading_process_output):
18015 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18016
18017 * insdel.c (adjust_markers_gap_motion):
18018 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18019 (gap_left, gap_right): Don't call it.
18020
18021 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18022
18023 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18024 incurred during fontification.
18025
18026 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18027
18028 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18029 (DEFVAR_PER_BUFFER): Don't pass it.
18030
18031 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18032 (scrolling_window): Don't pass it.
18033
18034 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18035
18036 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18037
18038 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18039 and `suffix'.
18040 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18041 of variables specific to SELinux and computation of `encoded_absname'.
18042
18043 * image.c (XPutPixel): Remove unused variable `height'.
18044
18045 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18046
18047 * unexw32.c (get_section_info): Remove unused variable `section'.
18048
18049 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18050 (system_process_attributes): Remove unused variable `sess'.
18051 (sys_read): Remove unused variable `err'.
18052
18053 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18054 (w32_wnd_proc): Remove unused variable `isdead'.
18055 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18056 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18057 (x_create_tip_frame): Remove unused variable `tem'.
18058
18059 * w32inevt.c (w32_console_read_socket):
18060 Remove unused variable `no_events'.
18061
18062 * w32term.c (x_draw_composite_glyph_string_foreground):
18063 Remove unused variable `width'.
18064
18065 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18066
18067 * w32term.c (x_set_glyph_string_clipping):
18068 Don't pass uninitialized region to CombineRgn.
18069
18070 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18071
18072 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18073 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18074 (Fx_close_connection): Remove unused variable `i'.
18075
18076 * w32font.c (w32font_draw): Return number of glyphs.
18077 (w32font_open_internal): Remove unused variable `i'.
18078 (w32font_driver): Add missing initializer.
18079
18080 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18081 (fill_in_menu): Remove unused variable `items_added'.
18082
18083 * w32term.c (last_mouse_press_frame): Remove static global variable.
18084 (w32_clip_to_row): Remove unused variable `f'.
18085 (x_delete_terminal): Remove unused variable `i'.
18086
18087 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18088 (NOTHING): Remove unused static global variable.
18089 (uniscribe_check_otf): Remove unused variable `table'.
18090 (uniscribe_font_driver): Add missing initializers.
18091
18092 2011-03-23 Julien Danjou <julien@danjou.info>
18093
18094 * term.c (Fsuspend_tty, Fresume_tty):
18095 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18096 * window.c (temp_output_buffer_show):
18097 * insdel.c (signal_before_change):
18098 * frame.c (Fhandle_switch_frame):
18099 * fileio.c (Fdo_auto_save):
18100 * emacs.c (Fkill_emacs):
18101 * editfns.c (save_excursion_restore):
18102 * cmds.c (internal_self_insert):
18103 * callint.c (Fcall_interactively):
18104 * buffer.c (Fkill_all_local_variables):
18105 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18106 Use Frun_hooks.
18107 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18108 unconditionally since it does the check itself.
18109
18110 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18111
18112 Fix more problems found by GCC 4.5.2's static checks.
18113
18114 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18115 the first time through the loop, since we know p0 < p1 then.
18116 This also avoids a gcc -Wstrict-overflow warning.
18117
18118 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18119 leading to a memory leak, possible in functions like
18120 load_charset_map_from_file that can allocate an unbounded number
18121 of objects (Bug#8318).
18122
18123 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18124 that could (at least in theory) be that large.
18125
18126 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18127 This is less likely to overflow, and avoids undefined behavior if
18128 overflow does occur. All callers changed. Use strtoul to scan
18129 for the unsigned long integer.
18130 (pint2hrstr): Simplify and tune code slightly.
18131 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18132
18133 * scroll.c (do_scrolling): Work around GCC bug 48228.
18134 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18135
18136 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18137 This also avoids a warning with gcc -Wstrict-overflow.
18138 (validate_x_resource_name): Simplify count usage.
18139 This also avoids a warning with gcc -Wstrict-overflow.
18140
18141 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18142 fail (Bug#8306).
18143
18144 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18145
18146 * process.c (Fmake_network_process): Use socklen_t, not int,
18147 where POSIX says socklen_t is required in portable programs.
18148 This fixes a porting bug on hosts like 64-bit HP-UX, where
18149 socklen_t is wider than int (Bug#8277).
18150 (Fmake_network_process, server_accept_connection):
18151 (wait_reading_process_output, read_process_output):
18152 Likewise.
18153
18154 * process.c: Rename or move locals to avoid shadowing.
18155 (list_processes_1, Fmake_network_process):
18156 (read_process_output_error_handler, exec_sentinel_error_handler):
18157 Rename or move locals.
18158 (Fmake_network_process): Define label "retry_connect" only if needed.
18159 (Fnetwork_interface_info): Fix pointer signedness.
18160 (process_send_signal): Add cast to avoid pointer signedness problem.
18161 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18162 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18163
18164 Make tparam.h and terminfo.c consistent.
18165 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18166 Include tparam.h instead, since it declares them.
18167 * cm.h (PC): Remove extern decl; tparam.h now does this.
18168 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18169 * terminfo.c: Include tparam.h, to check interfaces.
18170 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18171 (tparam): Adjust signature to match interface in tparam.h;
18172 this removes some undefined behavior. Check that outstring and len
18173 are zero, which they always are with Emacs.
18174 * tparam.h (PC, BC, UP): New extern decls.
18175
18176 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18177 (xftfont_open): Rename locals to avoid shadowing.
18178
18179 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18180 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18181 (OTF_TAG_SYM): Omit macro if not needed.
18182 (ftfont_list): Remove unused local.
18183 (get_adstyle_property, ftfont_pattern_entity):
18184 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18185 Rename locals to avoid shadowing.
18186
18187 * xfont.c (xfont_list_family): Mark var as initialized.
18188
18189 * xml.c (make_dom): Now static.
18190
18191 * composite.c (composition_compute_stop_pos): Rename local to
18192 avoid shadowing.
18193 (composition_reseat_it): Remove unused locals.
18194 (find_automatic_composition, composition_adjust_point): Likewise.
18195 (composition_update_it): Mark var as initialized.
18196 (find_automatic_composition): Mark vars as initialized,
18197 with a FIXME (Bug#8290).
18198
18199 character.h: Rename locals to avoid shadowing.
18200 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18201 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18202 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18203 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18204 to avoid shadowing.
18205
18206 * textprop.c (property_change_between_p): Remove; unused.
18207
18208 * intervals.c (interval_start_pos): Now static.
18209
18210 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18211
18212 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18213 Rename locals to avoid shadowing.
18214
18215 * sound.c (wav_play, au_play, Fplay_sound_internal):
18216 Fix pointer signedness.
18217 (alsa_choose_format): Remove unused local var.
18218 (wav_play): Initialize a variable to 0, to prevent undefined
18219 behavior (Bug#8278).
18220
18221 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18222
18223 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18224
18225 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18226 clobbering (Bug#8298).
18227 * sysdep.c (sys_subshell): Likewise.
18228 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18229
18230 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18231 This should get cleaned up, so that child_setup has the
18232 same signature on all platforms.
18233
18234 * callproc.c (call_process_cleanup): Now static.
18235 (relocate_fd): Rename locals to avoid shadowing.
18236
18237 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18238
18239 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18240 not to be necessary, and produces flickering.
18241
18242 2011-03-20 Glenn Morris <rgm@gnu.org>
18243
18244 * config.in: Remove file.
18245
18246 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18247
18248 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18249 are now in src/globals.h.
18250 (syms_of_minibuf): Remove spurious & from previous change.
18251
18252 2011-03-20 Leo Liu <sdl.web@gmail.com>
18253
18254 * minibuf.c (completing-read-function): New variable.
18255 (completing-read-default): Rename from completing-read.
18256 (completing-read): Call completing-read-function.
18257
18258 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18259
18260 * xfaces.c (Fx_load_color_file):
18261 Read color file from absolute filename (bug#8250).
18262
18263 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18264
18265 * makefile.w32-in: Update dependencies.
18266
18267 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18268
18269 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18270
18271 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18272
18273 Fix more problems found by GCC 4.5.2's static checks.
18274
18275 * process.c (make_serial_process_unwind, send_process_trap):
18276 (sigchld_handler): Now static.
18277
18278 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18279 That way, the code declares only the vars that it needs.
18280 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18281 * s/cygwin.h (PTY_ITERATION): Likewise.
18282 * s/darwin.h (PTY_ITERATION): Likewise.
18283 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18284
18285 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18286 * process.c (allocate_pty): Don't declare stb unless it's needed.
18287
18288 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18289 (CONSTANTLIM): Remove; unused.
18290 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18291 Define only if needed.
18292
18293 * unexelf.c (unexec): Name an expression,
18294 to avoid gcc -Wbad-function-cast warning.
18295 Use a different way to cause a compilation error if anyone uses
18296 n rather than nn, a way that does not involve shadowing.
18297 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18298
18299 * deps.mk (unexalpha.o): Remove; unused.
18300
18301 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18302 * unexec.h: New file.
18303 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18304 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18305 Depend on unexec.h.
18306 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18307 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18308 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18309 Change as necessary to match prototype in unexec.h.
18310
18311 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18312 shadowing.
18313 (back_comment, skip_chars): Mark vars as initialized.
18314
18315 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18316 Rename locals to avoid shadowing.
18317
18318 * lread.c (read1): Rewrite so as not to use empty "else".
18319 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18320
18321 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18322
18323 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18324 warning when compiling print.c.
18325
18326 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18327 instead of using an uninitialized var.
18328 (font_sort_entities): Mark var as initialized.
18329
18330 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18331
18332 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18333 pointers to constants.
18334 (font_parse_fcname): Remove unused vars.
18335 (font_delete_unmatched): Now static.
18336 (font_get_spec): Remove; unused.
18337 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18338 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18339 Rename or move locals to avoid shadowing.
18340
18341 * fns.c (require_nesting_list, require_unwind): Now static.
18342 (Ffillarray): Rename locals to avoid shadowing.
18343
18344 * floatfns.c (domain_error2): Define only if needed.
18345 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18346
18347 * alloc.c (mark_backtrace): Move decl from here ...
18348 * lisp.h: ... to here, so that it can be checked.
18349
18350 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18351 (Fdefvar): Rewrite so as not to use empty "else".
18352 (lisp_indirect_variable): Name an expression,
18353 to avoid gcc -Wbad-function-cast warning.
18354 (Fdefvar): Rename locals to avoid shadowing.
18355
18356 * callint.c (quotify_arg, quotify_args): Now static.
18357 (Fcall_interactively): Rename locals to avoid shadowing.
18358 Use const pointer when appropriate.
18359
18360 * lisp.h (get_system_name, get_operating_system_release):
18361 Move decls here, to check interfaces.
18362 * process.c (get_operating_system_release): Move decl to lisp.h.
18363 * xrdb.c (get_system_name): Likewise.
18364 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18365 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18366 some of which prompt warnings from gcc -Wbad-function-cast.
18367 (Fformat_time_string, Fencode_time, Finsert_char):
18368 (Ftranslate_region_internal, Fformat):
18369 Rename or remove local vars to avoid shadowing.
18370 (Ftranslate_region_internal): Mark var as initialized.
18371
18372 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18373 avoid shadowing.
18374
18375 * lisp.h (eassert): Check that the argument compiles, even if
18376 ENABLE_CHECKING is not defined.
18377
18378 * data.c (Findirect_variable): Name an expression, to avoid
18379 gcc -Wbad-function-cast warning.
18380 (default_value, arithcompare, arith_driver, arith_error): Now static.
18381 (store_symval_forwarding): Rename local to avoid shadowing.
18382 (Fmake_variable_buffer_local, Fmake_local_variable):
18383 Mark variables as initialized.
18384 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18385
18386 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18387 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18388 Rename locals to avoid shadowing.
18389 (mark_stack): Move local variables into the #ifdef region where
18390 they're used.
18391 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18392 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18393 needed otherwise.
18394 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18395 (GC_STRING_CHARS): Remove; not used.
18396 (Fmemory_limit): Cast sbrk's returned value to char *.
18397
18398 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18399 avoids undefined behavior in theory.
18400
18401 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18402
18403 Use functions, not macros, for up- and down-casing (Bug#8254).
18404 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18405 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18406 to use the following functions instead of these macros.
18407 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18408 EMACS_INT, since callers assume the returned value fits in int.
18409 (upcase1): Likewise, for UPCASE_TABLE.
18410 (uppercasep, lowercasep, upcase): New static inline functions.
18411 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18412 the race-condition problem in the old DOWNCASE.
18413
18414 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18415 Rename locals to avoid shadowing.
18416 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18417 (regex_compile, re_search_2, re_match_2_internal):
18418 Remove unused local vars.
18419 (FREE_VAR): Rewrite so as not to use empty "else",
18420 which gcc can warn about.
18421 (regex_compile, re_match_2_internal): Mark locals as initialized.
18422 (RETALLOC_IF): Define only if needed.
18423 (WORDCHAR_P): Likewise. This one is never needed, but is used
18424 only in a comment talking about a compiler bug, so put inside
18425 the #if 0 of that comment.
18426 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18427 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18428 Remove; unused.
18429
18430 * search.c (boyer_moore): Rename locals to avoid shadowing.
18431 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18432 (PREV_CHAR_BOUNDARY): Likewise.
18433
18434 * search.c (simple_search): Remove unused var.
18435
18436 * dired.c (compile_pattern): Move decl from here ...
18437 * lisp.h: ... to here, so that it can be checked.
18438 (struct re_registers): New forward decl.
18439
18440 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18441
18442 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18443 All uses changed.
18444 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18445 Rename locals to avoid shadowing.
18446 (Fvertical_motion): Mark locals as initialized.
18447
18448 * casefiddle.c (casify_object, casify_region): Now static.
18449 (casify_region): Mark local as initialized.
18450
18451 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18452
18453 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18454 New macros, so that the caller can use some names other than
18455 gcpro1, gcpro2, etc.
18456 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18457 of the new macros.
18458 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18459 argument, for consistency with GCPRO2_VAR, etc: it is now the
18460 prefix of the variable, not the variable itself. All uses
18461 changed.
18462 * dired.c (directory_files_internal, file_name_completion):
18463 Rename locals to avoid shadowing.
18464
18465 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18466 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18467 dired.c's scmp function, had undefined behavior.
18468 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18469 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18470 * buffer.h: ... to here, because these macros use current_buffer,
18471 and the new implementation with inline functions needs to have
18472 current_buffer in scope now, rather than later when the macros
18473 are used.
18474 (downcase, upcase1): New static inline functions.
18475 (DOWNCASE, UPCASE1): Reimplement using these functions.
18476 This avoids undefined behavior in expressions like
18477 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18478 from race conditions in accessing the global variables
18479 case_temp1 and case_temp2.
18480 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18481 * lisp.h (case_temp1, case_temp2): Remove their decls.
18482 * character.h (ASCII_CHAR_P): Move from here ...
18483 * lisp.h: ... to here, so that the inline functions mentioned
18484 above can use them.
18485
18486 * dired.c (directory_files_internal_unwind): Now static.
18487
18488 * fileio.c (file_name_as_directory, directory_file_name):
18489 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18490 Now static.
18491 (file_name_as_directory): Use const pointers when appropriate.
18492 (Fexpand_file_name): Likewise. In particular, newdir might
18493 point at constant storage, so make it a const pointer.
18494 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18495 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18496 signedness issues.
18497 (Fset_file_times, Finsert_file_contents, auto_save_error):
18498 Rename locals to avoid shadowing.
18499
18500 * minibuf.c (choose_minibuf_frame_1): Now static.
18501 (Ftry_completion, Fall_completions): Rename or remove locals
18502 to avoid shadowing.
18503
18504 * marker.c (bytepos_to_charpos): Remove; unused.
18505
18506 * lisp.h (verify_bytepos, count_markers): New decls,
18507 so that gcc does not warn that these functions aren't declared.
18508
18509 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18510 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18511 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18512 (copy_text): Remove unused local var.
18513
18514 * filelock.c (within_one_second): Now static.
18515 (lock_file_1): Rename local to avoid shadowing.
18516
18517 * buffer.c (fix_overlays_before): Mark locals as initialized.
18518 (fix_start_end_in_overlays): Likewise. This function should be
18519 simplified by using pointers-to-pointers, but that's a different
18520 matter.
18521 (switch_to_buffer_1): Now static.
18522 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18523 (report_overlay_modification): Rename locals to avoid shadowing.
18524
18525 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18526 Fix pointer signedness issue.
18527 (sys_subshell): Mark local as volatile if checking for lint,
18528 to suppress a gcc -Wclobbered warning that does not seem to be right.
18529 (MAXPATHLEN): Define only if needed.
18530
18531 * process.c (serial_open, serial_configure): Move decls from here ...
18532 * systty.h: ... to here, so that they can be checked.
18533
18534 * fns.c (get_random, seed_random): Move extern decls from here ...
18535 * lisp.h: ... to here, so that they can be checked.
18536
18537 * sysdep.c (reset_io): Now static.
18538 (wait_for_termination_signal): Remove; unused.
18539
18540 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18541 (copy_keymap_item, append_key, push_text_char_description):
18542 Now static.
18543 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18544 (DENSE_TABLE_SIZE): Remove; unused.
18545 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18546 (describe_map_tree):
18547 Rename locals to avoid shadowing.
18548
18549 * keyboard.c: Declare functions static if they are not used elsewhere.
18550 (echo_char, echo_dash, cmd_error, top_level_2):
18551 (poll_for_input, handle_async_input): Now static.
18552 (read_char, kbd_buffer_get_event, make_lispy_position):
18553 (make_lispy_event, make_lispy_movement, apply_modifiers):
18554 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18555 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18556 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18557 (read_key_sequence, read_char): Mark locals as initialized.
18558 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18559
18560 * keyboard.h (make_ctrl_char): New decl.
18561 (mark_kboards): Move decl here ...
18562 * alloc.c (mark_kboards): ... from here.
18563
18564 * lisp.h (force_auto_save_soon): New decl.
18565
18566 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18567 (DEFINE_DUMMY_FUNCTION): New macro.
18568 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18569 Use it.
18570 (main): Add casts to avoid warnings
18571 if GCC considers string literals to be constants.
18572
18573 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18574
18575 * dbusbind.c: Pointer signedness fixes.
18576 (xd_signature, xd_append_arg, xd_initialize):
18577 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18578 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18579 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18580 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18581
18582 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18583 if GCC considers string literals to be constants.
18584 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18585
18586 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18587
18588 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18589 (print_preprocess, print_object): New macro to fix last change.
18590
18591 * print.c (print_preprocess): Don't forget font objects.
18592
18593 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
18594
18595 * emacs.c (USAGE3): Doc fixes.
18596
18597 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18598
18599 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18600 structure.
18601
18602 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
18603
18604 * lisp.h (VWindow_system, Qfile_name_history):
18605 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18606 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18607 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18608
18609 * w32select.c: Don't #include "keyboard.h".
18610 (run_protected): Add extern declaration for waiting_for_input.
18611
18612 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18613 * w32console.c (detect_input_pending, read_input_pending)
18614 (encode_terminal_code):
18615 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18616 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18617 (w32_system_caret_y, Qfile_name_history):
18618 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18619 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18620 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18621 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18622 * w32proc.c (Qlocal, report_file_error):
18623 * w32term.c (Vwindow_system, updating_frame):
18624 * w32uniscribe.c (initialized, uniscribe_font_driver):
18625 Remove unneeded extern declarations.
18626
18627 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
18628
18629 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18630
18631 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
18632
18633 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18634 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18635 These macros can no longer be used for assignment.
18636
18637 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18638 Assign struct members directly, instead of using BUF_BEGV etc.
18639 (record_buffer_markers, fetch_buffer_markers): New functions for
18640 recording and fetching special buffer markers.
18641 (set_buffer_internal_1, set_buffer_temp): Use them.
18642
18643 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18644
18645 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18646
18647 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18648 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18649
18650 * xdisp.c (hscroll_window_tree):
18651 (reconsider_clip_changes): Use PT instead of BUF_PT.
18652
18653 2011-03-13 Eli Zaretskii <eliz@gnu.org>
18654
18655 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18656 $(EMACS_ROOT)/lib/intprops.h.
18657
18658 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18659
18660 Fix more problems found by GCC 4.5.2's static checks.
18661
18662 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18663 to unsigned char * to avoid compiler diagnostic.
18664 (xg_free_frame_widgets): Make it clear that a local variable is
18665 needed only if USE_GTK_TOOLTIP.
18666 (gdk_window_get_screen): Make it clear that this macro is needed
18667 only if USE_GTK_TOOLTIP.
18668 (int_gtk_range_get_value): New function, which avoids a diagnostic
18669 from gcc -Wbad-function-cast.
18670 (xg_set_toolkit_scroll_bar_thumb): Use it.
18671 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18672 diagnostic from gcc -Wbad-function-cast.
18673 (get_utf8_string, xg_get_file_with_chooser):
18674 Rename locals to avoid shadowing.
18675 (create_dialog): Move locals to avoid shadowing.
18676
18677 * xgselect.c (xg_select): Remove unused var.
18678
18679 * image.c (four_corners_best): Mark locals as initialized.
18680 (gif_load): Initialize transparent_p to zero (Bug#8238).
18681 Mark another local as initialized.
18682 (my_png_error, my_error_exit): Mark with NO_RETURN.
18683
18684 * image.c (clear_image_cache): Now static.
18685 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18686 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18687 (x_edge_detection): Remove unnecessary cast that
18688 gcc -Wbad-function-cast diagnoses.
18689 (gif_load): Fix pointer signedness.
18690 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18691 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18692
18693 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18694
18695 Improve quality of tests for time stamp overflow.
18696 For example, without this patch (encode-time 0 0 0 1 1
18697 1152921504606846976) returns the obviously-bogus value (-948597
18698 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18699 reports time overflow. See
18700 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18701 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18702 * editfns.c: Include limits.h and intprops.h.
18703 (TIME_T_MIN, TIME_T_MAX): New macros.
18704 (time_overflow): Move earlier, to before first use.
18705 (hi_time, lo_time): New functions, for an accurate test for
18706 out-of-range times.
18707 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18708 (Fget_internal_run_time): Don't assume time_t fits in int.
18709 (make_time): Use list2 instead of Fcons twice.
18710 (Fdecode_time): More accurate test for out-of-range times.
18711 (check_tm_member): New function.
18712 (Fencode_time): Use it, to test for out-of-range times.
18713 (lisp_time_argument): Don't rely on undefined left-shift and
18714 right-shift behavior when checking for time stamp overflow.
18715
18716 * editfns.c (time_overflow): New function, refactoring common code.
18717 (Fformat_time_string, Fdecode_time, Fencode_time):
18718 (Fcurrent_time_string): Use it.
18719
18720 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18721 * dired.c (make_time): Move to ...
18722 * editfns.c (make_time): ... here.
18723 * systime.h: Note the move.
18724
18725 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18726
18727 * fringe.c (update_window_fringes): Remove unused variables.
18728
18729 * unexmacosx.c (copy_data_segment): Also copy __got section.
18730 (Bug#8223)
18731
18732 2011-03-12 Eli Zaretskii <eliz@gnu.org>
18733
18734 * termcap.c [MSDOS]: Include "msdos.h".
18735 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18736 Constify `char *' arguments and their references according to
18737 prototypes in tparam.h.
18738
18739 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18740
18741 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18742 Adapt all references accordingly.
18743
18744 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18745
18746 2011-03-11 Tom Tromey <tromey@redhat.com>
18747
18748 * buffer.c (syms_of_buffer): Remove obsolete comment.
18749
18750 2011-03-11 Eli Zaretskii <eliz@gnu.org>
18751
18752 * termhooks.h (encode_terminal_code): Declare prototype.
18753
18754 * msdos.c (encode_terminal_code): Don't declare prototype.
18755
18756 * term.c (encode_terminal_code): Now external again, used by
18757 w32console.c and msdos.c.
18758
18759 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18760 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18761
18762 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
18763
18764 Fix some minor problems found by GCC 4.5.2's static checks.
18765
18766 * fringe.c (update_window_fringes): Mark locals as initialized
18767 (Bug#8227).
18768 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18769
18770 * alloc.c (mark_fringe_data): Move decl from here ...
18771 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18772 to check its interface.
18773 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18774
18775 * fontset.c (free_realized_fontset): Now static.
18776 (Fset_fontset_font): Rename local to avoid shadowing.
18777 (fontset_font): Mark local as initialized.
18778 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18779
18780 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18781
18782 * xselect.c (x_disown_buffer_selections): Remove; not used.
18783 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18784 (x_own_selection, Fx_disown_selection_internal): Rename locals
18785 to avoid shadowing.
18786 (x_handle_dnd_message): Remove local to avoid shadowing.
18787
18788 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18789 so that the caller can use some name other than gcpro1.
18790 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18791 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18792 (Fx_backspace_delete_keys_p):
18793 Use them to avoid shadowing, and rename vars to avoid shadowing.
18794 (x_decode_color, x_set_name, x_window): Now static.
18795 (Fx_create_frame): Add braces to silence GCC warning.
18796 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18797 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18798 Remove unused locals.
18799 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18800 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18801 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18802 macros.
18803
18804 * xterm.h (x_mouse_leave): New decl.
18805
18806 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18807 Remove unused functions.
18808 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18809 (x_calc_absolute_position): Now static.
18810 (XTread_socket): Don't define label "out" unless it's used.
18811 Don't declare local "event" unless it's used.
18812 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18813 unless they are used.
18814 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18815 (x_fatal_error_signal): Remove; not used.
18816 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18817 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18818 (x_error_catcher, x_connection_closed, x_error_handler):
18819 (x_error_quitter, xembed_send_message, x_iconify_frame):
18820 (my_log_handler): Rename locals to avoid shadowing.
18821 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18822 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18823
18824 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18825 Rename or move locals to avoid shadowing.
18826 (tty_defined_color, merge_face_heights): Now static.
18827 (free_realized_faces_for_fontset): Remove; not used.
18828 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18829 does not deduce is never used uninitialized.
18830 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18831 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18832
18833 * terminal.c (store_terminal_param): Now static.
18834
18835 * xmenu.c (menu_highlight_callback): Now static.
18836 (set_frame_menubar): Remove unused local.
18837 (xmenu_show): Rename parameter to avoid shadowing.
18838 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18839 since they might point to immutable storage.
18840 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18841 since it's unused otherwise.
18842
18843 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18844 Add a FIXME, since the code still doesn't look right. (Bug#8215)
18845 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18846 avoids a gcc -Wuninitialized diagnostic.
18847 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18848 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18849 does not deduce are never used uninitialized.
18850
18851 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18852
18853 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18854 * window.c (window_loop, size_window):
18855 (run_window_configuration_change_hook, enlarge_window): Likewise.
18856
18857 * window.c (display_buffer): Now static.
18858 (size_window): Mark variables that gcc -Wuninitialized
18859 does not deduce are never used uninitialized.
18860 * window.h (check_all_windows): New decl, to forestall
18861 gcc -Wmissing-prototypes diagnostic.
18862 * dispextern.h (bidi_dump_cached_states): Likewise.
18863
18864 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18865 shadowing.
18866 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18867 Include <limits.h>.
18868 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18869 and to avoid gcc -Wuninitialized warning.
18870 (load_charset_map): Mark variables that gcc -Wuninitialized
18871 does not deduce are never used uninitialized.
18872 (load_charset): Abort instead of using uninitialized var (Bug#8229).
18873
18874 * coding.c (coding_set_source, coding_set_destination):
18875 Use "else { /* comment */ }" rather than "else /* comment */;"
18876 for clarity, and to avoid gcc -Wempty-body warning.
18877 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18878 a block, when the outer 'i' will do.
18879 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18880 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18881 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18882 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18883 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18884 Rename locals to avoid shadowing.
18885 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
18886 * coding.c (emacs_mule_char, encode_invocation_designation):
18887 Now static, since they're not used elsewhere.
18888 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
18889 (decode_coding_object, encode_coding_object, detect_coding_system):
18890 (decode_coding_emacs_mule): Mark variables that gcc
18891 -Wuninitialized does not deduce are never used uninitialized.
18892 (detect_coding_iso_2022): Initialize a local variable that might
18893 be used uninitialized. Leave a FIXME because it's not clear that
18894 this initialization is needed. (Bug#8211)
18895 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18896 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18897 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18898 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18899 Remove unused macros.
18900
18901 * category.c (hash_get_category_set): Remove unused local var.
18902 (copy_category_table): Now static, since it's not used elsewhere.
18903 * character.c (string_count_byte8): Likewise.
18904
18905 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18906 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18907
18908 * chartab.c (copy_sub_char_table): Now static, since it's not used
18909 elsewhere.
18910 (sub_char_table_ref_and_range, char_table_ref_and_range):
18911 Rename locals to avoid shadowing.
18912 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
18913
18914 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18915 (BIDI_BOB): Remove unused macro.
18916
18917 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18918 deduce are never used uninitialized.
18919 * term.c (encode_terminal_code): Likewise.
18920
18921 * term.c (encode_terminal_code): Now static. Remove unused local.
18922
18923 * tparam.h: New file.
18924 * term.c, tparam.h: Include it.
18925 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18926 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18927 Move these decls to tparam.h, and make them agree with what
18928 is actually in tparam.c. The previous trick of using incompatible
18929 decls in different modules does not conform to the C standard.
18930 All callers of tparam changed to use tparam's actual API.
18931 * tparam.c (tparam1, tparam, tgoto):
18932 Use const pointers where appropriate.
18933
18934 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18935 * cm.h (struct cm): Likewise.
18936 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18937 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18938 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18939 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18940 (turn_on_face, init_tty): Likewise.
18941 * termchar.h (struct tty_display_info): Likewise.
18942
18943 * term.c (term_mouse_position): Rename local to avoid shadowing.
18944
18945 * alloc.c (mark_ttys): Move decl from here ...
18946 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18947
18948 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18949
18950 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18951
18952 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
18953
18954 * search.c (compile_pattern_1): Remove argument regp, unused since
18955 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18956 (compile_pattern): Don't pass it.
18957
18958 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18959
18960 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18961 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18962 for ! HAVE_GTK3.
18963 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18964
18965 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18966
18967 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18968 gdk_window_get_screen, gdk_window_get_geometry,
18969 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18970 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18971 (xg_get_pixbuf_from_pixmap): New function.
18972 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18973 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18974 Call xg_get_pixbuf_from_pixmap instead of
18975 gdk_pixbuf_get_from_drawable.
18976 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18977 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18978 (xg_check_special_colors): Use GtkStyleContext and its functions
18979 for HAVE_GTK3.
18980 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18981 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18982 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18983 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18984 Call gtk_widget_get_preferred_size.
18985 (xg_frame_resized): gdk_window_get_geometry only takes 5
18986 parameters.
18987 (xg_win_to_widget, xg_event_is_for_menubar):
18988 Call gdk_x11_window_lookup_for_display.
18989 (xg_set_widget_bg): New function.
18990 (delete_cb): New function.
18991 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18992 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18993 (xg_set_background_color): Call xg_set_widget_bg.
18994 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18995 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18996 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18997 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18998 if ! HAVE_GTK3.
18999 (update_frame_tool_bar): Call gtk_widget_hide.
19000 (xg_initialize): Use GDK_KEY_g.
19001
19002 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19003 if ! HAVE_GTK3
19004 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19005
19006 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19007 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19008 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19009
19010 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19011
19012 * w32xfns.c (select_palette): Check success of RealizePalette against
19013 GDI_ERROR, not zero.
19014
19015 See ChangeLog.11 for earlier changes.
19016
19017 ;; Local Variables:
19018 ;; coding: utf-8
19019 ;; End:
19020
19021 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19022
19023 This file is part of GNU Emacs.
19024
19025 GNU Emacs is free software: you can redistribute it and/or modify
19026 it under the terms of the GNU General Public License as published by
19027 the Free Software Foundation, either version 3 of the License, or
19028 (at your option) any later version.
19029
19030 GNU Emacs is distributed in the hope that it will be useful,
19031 but WITHOUT ANY WARRANTY; without even the implied warranty of
19032 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19033 GNU General Public License for more details.
19034
19035 You should have received a copy of the GNU General Public License
19036 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.