* src/fns.c (Fnreverse): Include the problem element when signalling an error.
[bpt/emacs.git] / src / ChangeLog
1 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * fns.c (Fnreverse): Include the problem element when signalling an
4 error (bug#12677).
5
6 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
7
8 * nsterm.m (ns_select): Check writefds before call to
9 FD_ISSET (Bug#12668).
10
11 2012-10-18 Daniel Colascione <dancol@dancol.org>
12
13 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
14 (staticpro): If we run out of staticpro slots, die with an
15 informative error instead of just calling emacs_abort.
16
17 2012-10-18 Martin Rudalics <rudalics@gmx.at>
18
19 Fix two flaws reported by Dmitry Antipov.
20 * window.c (Ftemp_output_buffer_show): Remove.
21 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
22 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
23
24 2012-10-17 Eli Zaretskii <eliz@gnu.org>
25
26 * makefile.w32-in ($(BLD)/w32.$(O)):
27 ($(BLD)/vm-limit.$(O)):
28 ($(BLD)/term.$(O)):
29 ($(BLD)/unexw32.$(O)):
30 ($(BLD)/fileio.$(O)):
31 ($(BLD)/dispnew.$(O)): Update dependencies.
32
33 * w32term.h (w32_initialize_display_info, initialize_w32_display):
34 Add prototypes.
35
36 * w32proc.c: Include ctype.h.
37
38 * w32.h (init_environment, check_windows_init_file)
39 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
40 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
41 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
42 (sys_link): Add prototypes.
43
44 * w32.c: Include w32select.h.
45 (sys_access, e_malloc, sys_select): Add prototypes.
46 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
47
48 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
49
50 * unexw32.c: Include lisp.h and w32.h.
51
52 * term.c [WINDOWSNT]: Include w32term.h.
53
54 * process.c [WINDOWSNT]: Add prototype of sys_select.
55
56 * fileio.c [WINDOWSNT]: Include w32.h.
57
58 * dispnew.c [WINDOWSNT]: Include w32.h.
59
60 * cygw32.c (Fcygwin_convert_path_to_windows)
61 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
62 Lisp_Object values. (Bug#12661)
63
64 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
65 to Lisp_Object. (Bug#12661)
66
67 2012-10-17 Kenichi Handa <handa@gnu.org>
68
69 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
70 invalidate.
71
72 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
73
74 * buffer.c (Fkill_buffer): When unchaining the marker,
75 reset its buffer pointer to NULL (Bug#12652).
76
77 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
78
79 Do not verify indirection counters of killed buffers (Bug#12579).
80 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
81 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
82
83 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
84
85 * alloc.c (Fmake_byte_code): Fix typo in comment.
86 * print.c (print_interval): Define as static to match prototype.
87 * indent.c (disptab_matches_widthtab, recompute_width_table):
88 Convert to eassert.
89
90 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
91
92 * editfns.c (get_system_name): Remove.
93 * lisp.h (get_system_name): Remove prototype.
94 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
95 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
96
97 2012-10-15 Daniel Colascione <dancol@dancol.org>
98
99 * dbusbind.c: Add comment explaining reason for previous change.
100
101 2012-10-15 Martin Rudalics <rudalics@gmx.at>
102
103 * window.c (Fwindow_end): Rewrite check whether cached position
104 can be used (Bug#12600).
105 (resize_frame_windows, grow_mini_window, shrink_mini_window):
106 Set windows_or_buffers_changed.
107
108 2012-10-15 Daniel Colascione <dancol@dancol.org>
109
110 * dbusbind.c: Fix cygw32 build break when compiling with dbus
111 enabled by undefining the symbol "interface", which the platform
112 headers define to something incompatible.
113
114 2012-10-14 Daniel Colascione <dancol@dancol.org>
115
116 * image.c (init_tiff_functions, init_imagemagick_functions)
117 (init_svg_functions): Fix cygw32 build break by using these
118 functions only when WINDOWSNT _and_ HAVE_NTGUI.
119
120 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
121
122 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
123
124 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
125
126 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
127
128 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
129
130 * coding.c (detect_coding): Set coding->id before calling
131 this->detector.
132
133 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
134
135 * fileio.c: Formatting fixes.
136
137 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
138
139 Fix some stat-related races.
140 * fileio.c (Fwrite_region): Avoid race condition if a file is
141 removed or renamed by some other process immediately after Emacs
142 writes it but before Emacs stats it. Do not assume that stat (or
143 fstat) succeeds.
144 * image.c (slurp_file): Resolve the file name with fopen + fstat
145 rather than stat + fopen.
146 (pbm_read_file) [0]: Remove unused code with stat race.
147 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
148 Remove ineffective code with stat race.
149
150 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
151
152 * doc.c (get_doc_string): Don't signal an error if the file is missing.
153
154 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
155
156 * nsterm.m (hold_event_q): New static variable.
157 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
158 ! q_event_ptr.
159 (hold_event): New function.
160 (ns_read_socket): If hold_event_q have events, store them and
161 return (Bug#12384).
162 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
163 is zero (Bug#12384).
164
165 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
166
167 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
168
169 2012-10-12 Eli Zaretskii <eliz@gnu.org>
170
171 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
172
173 * fileio.c (check_existing): New function.
174 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
175 instead of calling 'stat', when what's needed is to check whether
176 a file exists. This avoids expensive system calls on MS-Windows.
177 (Bug#12587)
178
179 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
180
181 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
182 determine whether a file exists and is not a directory.
183
184 * lisp.h (check_existing): Add prototype.
185
186 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
187
188 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
189
190 2012-10-12 Glenn Morris <rgm@gnu.org>
191
192 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
193
194 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
195
196 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
197
198 * eval.c (Fautoload): Remember previous autoload status in load-history.
199
200 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
201
202 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
203 * lread.c (load_each_byte, new_backquote_flag, readchar)
204 (read_filtered_event, lisp_file_lexically_bound_p)
205 (safe_to_load_version, Fload, complete_filename_p, openp)
206 (build_load_history, readevalloop, read_escape, read1)
207 (string_to_number, read_vector, read_list):
208 * macros.c (Fstart_kbd_macro):
209 * marker.c (CONSIDER):
210 * menu.c (parse_single_submenu, digest_single_submenu)
211 (find_and_return_menu_selection, Fx_popup_menu):
212 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
213 (Ftry_completion):
214 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
215 (ns_menu_show):
216 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
217 (xmenu_show, xdialog_show):
218 Use bool for booleans.
219 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
220 as it's not a predicate. All uses changed. Omit unnecessary
221 buffer termination.
222
223 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
224
225 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
226 (save_excursion_restore): Do not restore mark if it was not saved.
227
228 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
229
230 * marker.c (cached_modiff): EMACS_INT, not int.
231
232 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
233 instead of having a wrong decl.
234 * nsmenu.m (waiting_for_input): Remove wrong decl.
235
236 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
237
238 keyboard.c, keymap.c: Use bool for booleans.
239 * dispnew.c (sit_for): Distinguish between 3-way display_option
240 and boolean do_display.
241 * keyboard.c (single_kboard, this_command_key_count_reset)
242 (waiting_for_input, echoing, immediate_quit, input_pending)
243 (interrupt_input, interrupts_deferred, pop_kboard)
244 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
245 (command_loop_1, adjust_point_for_property)
246 (safe_run_hooks_error, input_polling_used, read_char):
247 (help_char_p, readable_events, kbd_buffer_events_waiting)
248 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
249 (lucid_event_type_list_p, get_input_pending):
250 (gobble_input, menu_separator_name_p, menu_bar_item)
251 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
252 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
253 (keyremap_step, test_undefined, read_key_sequence)
254 (detect_input_pending, detect_input_pending_ignore_squeezables)
255 (detect_input_pending_run_timers, requeued_events_pending_p)
256 (quit_throw_to_read_char, Fset_input_interrupt_mode):
257 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
258 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
259 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
260 (accessible_keymaps_1, Fkey_description, push_key_description):
261 (shadow_lookup, struct where_is_internal_data)
262 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
263 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
264 (describe_map, describe_vector):
265 * menu.c (single_menu_item):
266 * nsmenu.m (ns_update_menubar):
267 * process.c (wait_reading_process_output):
268 * search.c (scan_buffer, scan_newline):
269 Use bool for boolean.
270 * keyboard.c (timers_run, swallow_events)
271 (detect_input_pending_run_timers):
272 * process.c (wait_reading_process_output):
273 Use unsigned for counter where wraparound-on-overflow is desired,
274 since unsigned is guaranteed to have that behavior and signed is not.
275 (read_char): Use ptrdiff_t for string length.
276 (get_input_pending): Remove first argument, since it was always
277 the same pointer-to-int (now pointer-to-boolean) &input_pending,
278 and behave as if it had that value. Return new value of
279 input_pending. All callers changed.
280 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
281 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
282 a string length.
283 * keymap.c (push_key_description): Omit last arg, which was always 1.
284 All callers changed.
285
286 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
287
288 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
289
290 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
291 ($(BLD)/term.$(O)): Update dependencies.
292
293 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
294
295 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
296 * lisp.h (enum pvec_type): Adjust comments and omit explicit
297 initializer for PVEC_NORMAL_VECTOR.
298
299 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
300
301 Clean out old termopts cruft.
302 * termopts.h (flow_control, meta_key): Remove unused decls.
303 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
304 Don't include termopts.h.
305
306 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
307
308 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
309
310 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
311
312 * commands.h (immediate_quit): Remove duplicate decl.
313
314 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
315
316 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
317 caching.
318 (nsfont_open): Remove setting of Vfonts_in_cache.
319 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
320
321 2012-10-09 Eli Zaretskii <eliz@gnu.org>
322
323 * w32fns.c (w32_last_error): Change the return value to DWORD, to
324 match what GetLastError returns. Explain why the function is
325 needed.
326
327 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
328 'is_tooltip_frame', to avoid confusion with its global namesake.
329
330 2012-10-08 Daniel Colascione <dancol@dancol.org>
331
332 * xdisp.c (start_hourglass): Call w32_note_current_window when
333 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
334 build that caused Emacs to display the hourglass cursor forever.
335
336 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
337 which is broken under remote desktop, calculate the number of
338 colors available for a display based on the display's number of
339 planes and number of bits per pixel per plane. (bug#10397).
340
341 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
342
343 * nsfont.m (Vfonts_in_cache): New variable.
344 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
345 are used. Add cached fonts to Vfonts_in_cache.
346 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
347
348 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
349
350 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
351 in nt/config.nt.
352 (FONT_H): Define after FRAME_H.
353 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
354 Update dependencies.
355
356 * w32term.c: Remove leftover declaration of keyboard_codepage.
357
358 2012-10-08 Eli Zaretskii <eliz@gnu.org>
359
360 * makefile.w32-in (FONT_H): Add $(FRAME_H).
361 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
362 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
363 (GLOBAL_SOURCES): Add cygw32.c.
364 ($(BLD)/unexw32.$(O)):
365 ($(BLD)/w32.$(O)):
366 ($(BLD)/w32console.$(O)):
367 ($(BLD)/w32fns.$(O)):
368 ($(BLD)/w32heap.$(O)):
369 ($(BLD)/w32menu.$(O)):
370 ($(BLD)/w32proc.$(O)): Add w32common.h.
371
372 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
373 'const char *'.
374 (x_to_w32_color): Don't modify the argument, modify a copy instead.
375
376 2012-10-08 Daniel Colascione <dancol@dancol.org>
377
378 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
379 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
380 accidental message numbering hole. Change other messages to
381 match.
382
383 * w32select.h (HAVE_W32SELECT): Remove.
384
385 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
386 w32common.h instead of w32heap.h.
387
388 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
389 (get_allocation_unit, get_processor_type, get_w32_major_version)
390 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
391 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
392 (OS_NT, os_subtype, cache_system_info): Move declarations to
393 w32common.
394
395 * w32heap.c: Include w32common.h.
396 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
397 (w32_minor_version, w32_build_number, w32_subtype):
398 Remove duplicate definitions.
399
400 * w32fns.c: Include w32common.h; include w32heap.h only in
401 WINDOWSNT.
402
403 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
404 Use `report_file_error' instead of `error' in order to better
405 inform users of what went wrong. Increase NTGUI_UNICODE file
406 dialog box file name length to 32k, the maximum allowed by the NT
407 kernel.
408
409 * w32common.h: New file.
410 (ROUND_UP, ROUND_DOWN, get_page_size)
411 (get_allocation_unit, get_processor_type, get_w32_major_version)
412 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
413 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
414 (OS_NT, os_subtype, cache_system_info): Move here.
415
416 * unexw32.c, unexcw.c: Include w32common.h.
417
418 * emacs.c (main): Use (defined (WINDOWSNT) || defined
419 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
420 to call syms_of_w32select.
421
422 * cygw32.h: Remove obsolete EXFUN declarations.
423
424 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
425
426 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
427 of w32inevt.o from SOME_MACHINE_OBJECTS.
428
429 2012-10-08 Daniel Colascione <dancol@dancol.org>
430
431 * image.c: Permanent fix for JPEG compilation issue --- limit
432 jpeglib `boolean' redefinition to Cygwin builds.
433
434 2012-10-08 Eli Zaretskii <eliz@gnu.org>
435
436 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
437
438 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
439 Cygwin.
440
441 2012-10-08 Daniel Colascione <dancol@dancol.org>
442
443 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
444 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
445 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
446 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
447 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
448 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
449 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
450 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
451 now a supported configuration.
452
453 * Makefile.in: consolidate image variables into LIBIMAGE; add
454 W32_OBJ and W32_LIBS. Compile new files.
455
456 * conf_post.h:
457 (_DebPrint) declare tracing facility for W32 debugging. We need
458 to unify tracing later.
459
460 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
461 unconditional use of W32 Unicode functions. Cygwin runs only on
462 100% Unicode operating systems.
463
464 * cygw32.c: New file. Define Cygwin-specific facilities.
465 (Fcygwin_convert_path_to_windows)
466 (Fcygwin_convert_path_from_windows): New user functions for
467 accessing Cygwin path-munging routines.
468
469 * cygw32.h: New file.
470 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
471 UTF-16LE strings temporarily inside non-Lisp-visible string
472 objects.
473
474 (w32_strerror): Just what it says on the tin.
475
476 * emacs.c: Make the NS fork-then-exec code for daemon-launching
477 also run for Cygwin; both systems have the same problem with using
478 GUI facilities in a forked child. Also call syms_of_cygw32,
479 syms_of_w32select in correct places.
480
481 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
482 needs fork-then-exec for daemon launching.
483
484 * font.h: Include frame.h.
485
486 * image.c: Use the image library cache machinery only when we're
487 compiling for native WINDOWSNT; Cygwin can use shared libraries
488 like any other Unixlike system.
489
490 * keyboard.c: Clarify a comment regarding the input loop.
491
492 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
493 functions directly instead of trying to detect at runtime that our
494 host operating system supports them. We make this change for two
495 reasons: Cygwin lacks support for the multibyte character
496 conversion functions used by the legacy menu code, and Cygwin
497 never needs to rely on non-Unicode APIs.
498
499 * unexw32.c (hinst): Declare extern.
500
501 * w32.c: Change header order;
502 (w32_strerror): Move to w32fns.c because we need it for
503 non-WINDOWSNT builds.
504
505 * w32.h: Add #error macro to make sure we don't include w32.h for
506 Cygwin builds. Remove w32select declarations.
507
508 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
509 w32fns.c. w32console.c is WINDOWSNT-only.
510
511 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
512 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
513 POSIXy alternative.
514 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
515 (w32_major_version, w32_minor_version, w32_build_number)
516 (os_subtype, sound_type): Define here
517 (w32_defined_color): Make color parameter const for consistency
518 with other _defined_color functions.
519 (w32_createwindow): Unconditionally call w32_init_class instead of
520 doing so only when hprevinst is non-NULL. Plumbing hprevinst
521 through the code is complex and unnecessary because class
522 registration is practically free.
523 (w32_name_of_message): New EMACSDEBUG-only function.
524 (Fset_message_beep): Move here
525 (Fx_open_connection): Require that the display name for Windows be
526 "w32" for consistency, emacsclient disambiguation, and maybe, one
527 day, multi-window-system support.
528 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
529 Cygwin files for W32 GUI facilities, since these clearly don't
530 expect Cygwin names.
531 (_DebPrint): Define.
532 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
533 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
534 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
535 (w32_last_error): Remove.
536
537 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
538
539 * w32heap.c (syspage_mask): Declare here.
540 (cache_system_info): Remove.
541
542 * w32inevt.c (faked_key): Define globally, not statically.
543 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
544 (w32_console_toggle_lock_key): Move to w32fns.c.
545
546 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
547
548 * w32proc.c (_DebPrint): Move to w32fns.c.
549 * w32select.c: Include string.h, stdio.h for Cygwin.
550 * w32select.h: New File.
551
552 * w32term.c: Include io.h for non-CYGWIN builds; needed for
553 get_osfhandle.
554 (w32_message_fd): New variable. Under Cygwin, holds the file
555 descriptor the system used to tell us about pending thread
556 messages.
557
558 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
559 that prevented compilation under non-WINDOWSNT systems.
560
561 (w32_initialize): Open /dev/windows and assign it to
562 w32_message_fd. Provide w32 feature.
563
564 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
565 (WM_EMACS_INPUT_READY): add.
566 (prepend_msg, w32_message_fd): Declare globally.
567
568 * w32xfns.c:
569 (keyboard_handle): Use only when WINDOWSNT.
570 (notify_msg_ready): New function. Posts a message to the main
571 thread's message queue under CYGWIN, which wakes up the main
572 thread from select(2) by making the /dev/windows file descriptor
573 ready. Under WINDOWSNT, it sets an event the same way the old
574 code did.
575
576 (post, prepend_msg): Actually call notify_msg_ready instead of
577 setting the input event directly.
578
579 2012-10-07 Eli Zaretskii <eliz@gnu.org>
580
581 * ralloc.c (relinquish): If a heap is ready to be relinquished,
582 but it still has blocs in it, don't return it to the system,
583 instead of aborting. (Bug#12402)
584
585 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
586
587 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
588
589 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
590 MAC_OS_X_VERSION_10_6.
591 (syms_of_nsterm): Remove comment about Panther and above for
592 ns-antialias-text.
593 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
594 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
595 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
596
597 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
598 MAC_OS_X_VERSION_10_4.
599
600 * nsmenu.m (fillWithWidgetValue:): Remove code for <
601 MAC_OS_X_VERSION_10_2.
602
603 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
604
605 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
606 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
607
608 * nsterm.m (ns_in_resize): Remove (Bug#12479).
609 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
610 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
611 Remove ns_in_resize check.
612 (ns_clear_frame_area): Remove resize handle code.
613
614 * nsfns.m (ns_in_resize): Remove.
615 (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
616 ns_in_resize check.
617
618 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
619
620 Improve sys_siglist detection.
621 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
622 defined as a macro, as is done in Solaris.
623 (sys_siglist_entries): New macro.
624 (save_strsignal): Use it.
625 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
626 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
627
628 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
629
630 * nsfns.m (Fx_create_frame): Call x_default_parameter with
631 fullscreen/Fullscreen.
632
633 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
634 tobar_height is new.
635
636 * nsterm.m (x_make_frame_visible): Check for fullscreen.
637 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
638 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
639 (windowDidResize:): Check for correct window if old style fullscreen.
640 Capitalize word in comment. Remove incorrect comment.
641 (initFrameFromEmacs:): tbar_height renamed tibar_height.
642 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
643 error in drawing background.
644 (toggleFullScreen:): Remove comment. Rearrange calls.
645 Set toolbar values to zero, save old height in tobar_height.
646 Restore tool bar height when leaving fullscreen.
647 (canBecomeMainWindow): New function.
648
649 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
650
651 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
652
653 2012-10-05 Eli Zaretskii <eliz@gnu.org>
654
655 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
656
657 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
658 that time stamps of directories could also be changed.
659 Don't request the too broad GENERIC_WRITE, only the more restrictive
660 FILE_WRITE_ATTRIBUTES access rights.
661
662 * fileio.c (Fset_file_times): Special-case ignoring errors for
663 directories only on MSDOS, not on MS-Windows.
664
665 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
666
667 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
668
669 2012-10-04 Eli Zaretskii <eliz@gnu.org>
670
671 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
672 see whether CreateFile failed.
673
674 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
675
676 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
677 to avoid similar races.
678 * keyboard.c (pending_signals): Now bool, not int.
679
680 Port timers to OpenBSD, plus check for timer failures.
681 OpenBSD problem reported by Han Boetes.
682 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
683 and/or setitimer.
684 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
685 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
686 like OpenBSD, which has timer_settime but does not declare it.
687 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
688 whether to use itimerspec-related primitives. All uses of
689 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
690
691 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
692
693 * profiler.c (handle_profiler_signal): Fix a malloc race
694 that caused Emacs to hang on Fedora 17 when profiling Lisp.
695
696 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
697
698 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
699
700 2012-10-02 Eli Zaretskii <eliz@gnu.org>
701
702 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
703 consistent with the change in return value of 'safe_strsignal'.
704
705 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
706
707 Prefer plain 'static' to 'static inline' (Bug#12541).
708 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
709 (bidi_set_sor_type, bidi_push_embedding_level)
710 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
711 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
712 (bidi_cache_search, bidi_cache_ensure_space)
713 (bidi_cache_iterator_state, bidi_cache_find)
714 (bidi_peek_at_next_level, bidi_set_paragraph_end)
715 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
716 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
717 Now 'static', not 'static inline'.
718
719 Count overruns when profiling; change units to ns.
720 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
721 Give extra weight to samples after overruns, to attempt to count
722 the time more accurately.
723 (setup_cpu_timer): Change sampling interval units from ms to ns, since
724 the underlying primitives nominally do ns.
725 (Fprofiler_cpu_start): Document the change. Mention that
726 the sampling intervals are only approximate.
727
728 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
729
730 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
731
732 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
733 case for the special 0 coding-system.
734
735 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
736 (Fmake_overlay): Remove redundant tests.
737 (fix_start_end_in_overlays): Remove redundant recentering.
738
739 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
740
741 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
742 Update dependencies.
743
744 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
745
746 Fix a malloc race condition involving strsignal.
747 A signal can arrive in the middle of a malloc, and Emacs's signal
748 handler can invoke strsignal, which can invoke malloc, which is
749 not portable. This race condition bug makes Emacs hang on GNU/Linux.
750 Fix it by altering the signal handler so that it does not invoke
751 strsignal.
752 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
753 * process.c (status_message): Use const pointer, in case strsignal
754 is #defined to safe_strsignal.
755 * sysdep.c (sys_siglist, init_signals): Always define and
756 initialize a substitute sys_siglist if the system does not define
757 one, even if HAVE_STRSIGNAL.
758 (safe_strsignal): Rename from strsignal. Always define,
759 using sys_siglist. Return a const pointer.
760 * syssignal.h (safe_strsignal): New decl.
761 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
762
763 2012-10-01 Eli Zaretskii <eliz@gnu.org>
764
765 * w32proc.c (timer_loop): Fix code that waits for timer
766 expiration, to avoid high CPU usage.
767
768 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
769
770 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
771 (sweep_weak_table): Remove redundant prototypes.
772
773 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
774
775 * emacs.c: Move the inclusion of TERM_HEADER after including
776 windows.h on WINDOWSNT. This avoids compilation problems with
777 MSVC.
778
779 2012-10-01 Eli Zaretskii <eliz@gnu.org>
780
781 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
782 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
783 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
784 as the previous version used 'void *'.
785
786 * ralloc.c (ROUNDUP): Fix last change.
787 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
788 'size_t'.
789
790 * w32proc.c <disable_itimers>: New static flag.
791 (init_timers): Initialize it to zero, after creating the critical
792 sections used by the timer threads.
793 (term_timers): Set to 1 before deleting the critical sections.
794 (getitimer, setitimer): If disable_itimers is non-zero, return an
795 error indication without doing anything. Reported by Fabrice
796 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
797 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
798 return results.
799 [!HAVE_SETITIMER]: Behave as the previous version that didn't
800 support timers.
801
802 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
803 term_ntproc after all the other bookkeeping, to get timers working
804 as long as possible.
805
806 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
807
808 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
809 Suggested by Juri Linkov in
810 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
811
812 Prefer plain 'static' to 'static inline' (Bug#12541).
813 With static functions, modern compilers inline pretty well by
814 themselves; advice from programmers often hurts as much as it helps.
815 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
816 this change shrinks the text size of the Emacs executable by 1.1%
817 without affecting CPU significantly in my benchmark.
818 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
819 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
820 (mark_maybe_object, mark_maybe_pointer, bounded_number):
821 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
822 (bset_auto_fill_function, bset_auto_save_file_format)
823 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
824 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
825 (bset_cache_long_line_scans, bset_case_fold_search)
826 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
827 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
828 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
829 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
830 (bset_header_line_format, bset_indicate_buffer_boundaries)
831 (bset_indicate_empty_lines, bset_invisibility_spec)
832 (bset_left_fringe_width, bset_major_mode, bset_mark)
833 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
834 (bset_name, bset_overwrite_mode, bset_pt_marker)
835 (bset_right_fringe_width, bset_save_length)
836 (bset_scroll_bar_width, bset_scroll_down_aggressively)
837 (bset_scroll_up_aggressively, bset_selective_display)
838 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
839 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
840 (set_buffer_overlays_after):
841 * category.c (bset_category_table):
842 * charset.c (read_hex):
843 * coding.c (produce_composition, produce_charset)
844 (handle_composition_annotation, handle_charset_annotation)
845 (char_encodable_p):
846 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
847 (assign_row, set_frame_matrix_frame, make_current)
848 (add_row_entry):
849 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
850 * fns.c (maybe_resize_hash_table):
851 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
852 * gmalloc.c (register_heapinfo):
853 * image.c (lookup_image_type):
854 * intervals.c (set_interval_object, set_interval_left)
855 (set_interval_right, copy_interval_parent, rotate_right)
856 (rotate_left, balance_possible_root_interval):
857 * keyboard.c (kset_echo_string, kset_kbd_queue)
858 (kset_keyboard_translate_table, kset_last_prefix_arg)
859 (kset_last_repeatable_command, kset_local_function_key_map)
860 (kset_overriding_terminal_local_map, kset_real_last_command)
861 (kset_system_key_syms, clear_event, set_prop):
862 * lread.c (digit_to_number):
863 * marker.c (attach_marker, live_buffer, set_marker_internal):
864 * nsterm.m (ns_compute_glyph_string_overhangs):
865 * process.c (pset_buffer, pset_command)
866 (pset_decode_coding_system, pset_decoding_buf)
867 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
868 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
869 (pset_status, pset_tty_name, pset_type, pset_write_queue):
870 * syntax.c (bset_syntax_table, dec_bytepos):
871 * terminal.c (tset_param_alist):
872 * textprop.c (interval_has_some_properties)
873 (interval_has_some_properties_list):
874 * window.c (wset_combination_limit, wset_dedicated)
875 (wset_display_table, wset_hchild, wset_left_fringe_width)
876 (wset_left_margin_cols, wset_new_normal, wset_new_total)
877 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
878 (wset_right_fringe_width, wset_right_margin_cols)
879 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
880 (wset_vertical_scroll_bar_type, wset_window_parameters):
881 * xdisp.c (wset_base_line_number, wset_base_line_pos)
882 (wset_column_number_displayed, wset_region_showing)
883 (window_box_edges, run_window_scroll_functions)
884 (append_glyph_string_lists, prepend_glyph_string_lists)
885 (append_glyph_string, set_glyph_string_background_width)
886 (append_glyph, append_composite_glyph)
887 (take_vertical_position_into_account):
888 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
889 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
890 (lface_hash, lface_same_font_attributes_p, lookup_face):
891 * xml.c (libxml2_loaded_p):
892 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
893 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
894 Now 'static', not 'static inline'.
895
896 * bidi.c: Tune.
897 (bidi_copy_it): Do the whole copy with a single memcpy.
898 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
899
900 Revert the FOLLOW-SYMLINKS change for file-attributes.
901 Doing it right would require several changes to Tramp, and there's
902 not enough time to get that tested before the freeze today.
903 * dired.c (directory_files_internal, Ffile_attributes):
904 Undo last change.
905
906 * frame.c (x_report_frame_params): Port better to wider ints.
907 Do not assume that EMACS_UINT is the same width as uprintmax_t,
908 or that pointers can be printed in 15 decimal digits.
909 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
910
911 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
912
913 Support x64 build on MS-Windows.
914 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
915 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
916 compatibility with x64.
917 (x_get_focus_frame): Add prototype.
918
919 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
920 defining an XRectangle structure.
921
922 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
923 arithmetics for compatibility with x64.
924
925 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
926 compatibility with x64.
927
928 * w32heap.h: Adjust prototypes and declarations.
929
930 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
931 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
932 DWORD, long, and unsigned long, for compatibility with x64.
933 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
934 (sbrk): Argument is now of type ptrdiff_t.
935
936 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
937 less than 0x0500.
938 (w32_msg_pump): Use WPARAM type for 'result'.
939
940 * w32.c (init_environment, get_emacs_configuration): Support AMD64
941 architecture.
942 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
943 compatibility with x64.
944
945 * vm-limit.c (lim_data): Now size_t.
946 (check_memory_limits): Adjust prototypes of real_morecore and
947 __morecore to receive argument of type ptrdiff_t. Use size_t for
948 five_percent and data_size.
949
950 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
951 variables, for compatibility with x64.
952 (rva_to_section, offset_to_section, relocate_offset)
953 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
954 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
955 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
956 for compatibility with x64.
957
958 * sysdep.c (STDERR_FILENO): Define if not already defined.
959
960 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
961 (__morecore): Argument type is now ptrdiff_t.
962 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
963 (relinquish): Use ptrdiff_t type for 'excess'.
964 (r_alloc_sbrk): Argument type is now ptrdiff_t.
965
966 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
967 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
968 instead of a literal number.
969
970 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
971 (min): Define only if not already defined.
972
973 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
974 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
975 hosts.
976
977 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
978 'bitmaps' is a pointer.
979
980 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
981
982 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
983
984 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
985
986 file-attributes has a new optional arg FOLLOW-SYMLINKS.
987 * dired.c (directory_files_internal, Ffile_attributes):
988 New arg follow_symlinks. All uses changed.
989
990 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
991
992 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
993
994 2012-09-30 Eli Zaretskii <eliz@gnu.org>
995
996 Support atimers and CPU profiler via profile.c on MS-Windows.
997 * w32proc.c (sig_mask, crit_sig): New static variables.
998 (sys_signal): Support SIGALRM and SIGPROF.
999 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1000 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1001 sigfillset, and sigprocmask are no longer no-ops.
1002 (sigismember): New function.
1003 (struct itimer_data): New definition.
1004 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1005 (crit_prof): New static variables.
1006 (MAX_SINGLE_SLEEP): New definition.
1007 (timer_loop, stop_timer_thread, term_timers, init_timers)
1008 (start_timer_thread, getitimer, setitimer): New functions.
1009 (alarm): No longer a no-op, calls setitimer.
1010
1011 * w32.c (term_ntproc): Call term_timers.
1012 (init_ntproc): Make sure all signals are unblocked at startup, to
1013 erase any traces of dumping. Call init_timers.
1014
1015 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1016 Windows-specific code to display the hourglass mouse pointer is no
1017 longer used.
1018 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1019 to hourglass timer expiration.
1020 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1021 Remove, no longer used.
1022 (w32_note_current_window, show_hourglass, hide_hourglass):
1023 New functions, in support of hourglass cursor display similar to other
1024 window systems.
1025 (syms_of_w32fns): Don't initialize hourglass_timer.
1026
1027 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1028 WINDOWSNT as well.
1029 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1030
1031 * w32.h (init_timers, term_timers): Add prototypes.
1032
1033 2012-09-30 Kenichi Handa <handa@gnu.org>
1034
1035 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1036 to the buffer relocation which may be caused by ccl_driver.
1037
1038 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1039
1040 * xfns.c (Fx_file_dialog): Update comment.
1041
1042 * w32fns.c (Fx_file_dialog): Update comment.
1043
1044 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1045 Initialize panel name field if OSX >= 10.6.
1046
1047 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1048
1049 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1050
1051 * nsterm.m (NEW_STYLE_FS): New define.
1052 (ns_fullscreen_hook, windowWillEnterFullScreen)
1053 (windowDidEnterFullScreen, windowWillExitFullScreen)
1054 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1055 (setFSValue): New functions.
1056 (EmacsFSWindow): New implementation.
1057 (canBecomeKeyWindow): New function for EmacsFSWindow.
1058 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1059 (dealloc): Release nonfs_window if in fullscreen.
1060 (updateFrameSize:): Call windowDidMove to update top/left.
1061 (windowWillResize:toSize:): Check if frame is still maximized.
1062 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1063 next_maximized, maximized_width, maximized_height and nonfs_window.
1064 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1065 tbar_height.
1066 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1067 fullscreen. Set maximized_width/height. Act on next_maximized.
1068
1069 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1070 (EmacsView): Add variables for fullscreen.
1071 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1072 (EmacsFSWindow): New interface for fullscreen.
1073
1074 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1075
1076 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1077
1078 2012-09-30 Chong Yidong <cyd@gnu.org>
1079
1080 * fns.c (Frandom): Doc fix.
1081
1082 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1083
1084 * window.c (Vwindow_combination_limit): New default value.
1085 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1086
1087 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1088
1089 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1090 Suggested by Eli Zaretskii in
1091 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1092
1093 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1094
1095 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1096 HAVE_TIMER_SETTIME is defined.
1097
1098 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1099
1100 Profiler improvements: more-accurate timers, overflow checks.
1101 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1102 signal.h, setjmp.h. Include systime.h instead.
1103 (saturated_add): New function.
1104 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1105 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1106 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1107 New static vars.
1108 (enum profiler_cpu_running): New enum.
1109 (profiler_cpu_running): Now of that enum type, not bool.
1110 All uses changed to store the new value.
1111 (handle_profiler_signal): Rename from sigprof_handler_1,
1112 for consistency with other handlers. Do not check whether
1113 cpu_log is a hash-table if garbage collecting, since it
1114 doesn't matter in that case.
1115 (deliver_profiler_signal): Rename from sigprof_handler,
1116 for consistency with other handlers.
1117 (setup_cpu_timer): New function, with much of what used to be in
1118 Fprofiler_cpu_start. Check for out-of-range argument.
1119 Prefer timer_settime if available, and prefer
1120 thread cputime clocks, then process cputime clocks, then
1121 monotonic clocks, to the old realtime clock. Use make_timeval
1122 to round more-correctly when falling back to setitimer.
1123 (Fprofiler_cpu_start): Use it.
1124 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1125 Don't assume that passing NULL as the 2nd argument of setitimer
1126 is the same as passing a pointer to all-zero storage.
1127 Ignore SIGPROF afterwards.
1128 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1129 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1130 non-fatal signal handlers. Ignore SIGPROF on startup.
1131 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1132 in profiler.c, since sysdep.c now uses it.
1133
1134 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1135 Suggested by Eli Zaretskii in
1136 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1137
1138 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1139
1140 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1141
1142 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1143
1144 * lisp.h (struct backtrace): Remove indirection for `function' field.
1145 * xdisp.c (redisplay_internal):
1146 * profiler.c (record_backtrace, sigprof_handler_1):
1147 * alloc.c (Fgarbage_collect):
1148 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1149 (Fbacktrace_frame): Adjust accordingly.
1150
1151 2012-09-28 Glenn Morris <rgm@gnu.org>
1152
1153 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1154 (Frun_hook_with_args_until_failure): Doc fixes.
1155
1156 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1157
1158 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1159 Qautomatic_redisplay and change the symbol name. All users changed.
1160
1161 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1162
1163 * profiler.c (sigprof_handler): Fix race condition.
1164
1165 2012-09-28 Glenn Morris <rgm@gnu.org>
1166
1167 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1168
1169 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1170
1171 Check more robustly for timer_settime.
1172 * Makefile.in (LIB_TIMER_TIME): New macro.
1173 (LIBES): Add it.
1174 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1175 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1176 call timer_settime.
1177
1178 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1179
1180 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1181
1182 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1183
1184 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1185
1186 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1187
1188 * character.h (MAYBE_UNIFY_CHAR): Remove.
1189 * charset.c, charset.h (maybe_unify_char): Now static.
1190 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1191 Since this stuff is now private to charset.c, there's no need for
1192 a public macro and no need to inline by hand.
1193
1194 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1195 Stefan Monnier <monnier@iro.umontreal.ca>
1196 Juanma Barranquero <lekktu@gmail.com>
1197
1198 * profiler.c: New file.
1199 * Makefile.in (base_obj): Add profiler.o.
1200 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1201 ($(BLD)/profiler.$(O)): New target.
1202 * emacs.c (main): Call syms_of_profiler.
1203 * alloc.c (Qautomatic_gc): New constant.
1204 (MALLOC_PROBE): New macro.
1205 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1206 (total_bytes_of_live_objects): New function.
1207 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1208 Call malloc_probe for the memory profiler.
1209 (syms_of_alloc): Define Qautomatic_gc.
1210 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1211 race condition.
1212 (struct backtrace): Move definition...
1213 * lisp.h (struct backtrace): ..here.
1214 (Qautomatic_gc, profiler_memory_running): Declare vars.
1215 (malloc_probe, syms_of_profiler): Declare functions.
1216 * xdisp.c (Qautomatic_redisplay): New constant.
1217 (redisplay_internal): Record itself in backtrace_list.
1218 (syms_of_xdisp): Define Qautomatic_redisplay.
1219
1220 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1221 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1222
1223 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1224
1225 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1226
1227 Prefer POSIX timers if available.
1228 They avoid a race if the timer is too close to the current time.
1229 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1230 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1231 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1232
1233 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1234
1235 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1236 CHAR_STRING_ADVANCE.
1237 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1238 STRING_CHAR_ADVANCE.
1239
1240 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1241
1242 Move Vlibrary_cache to emacs.c and reset before dumping.
1243
1244 * lisp.h (reset_image_types): Declare.
1245 [WINDOWSNT] (Vlibrary_cache): Declare.
1246
1247 * image.c (reset_image_types): New function.
1248
1249 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1250 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1251 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1252
1253 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1254 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1255
1256 * w32.h (Vlibrary_cache): Do not declare.
1257
1258 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1259
1260 * w32proc.c (sys_signal): Handle all signals defined by the
1261 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1262 handlers for signals supported by Windows. Don't override
1263 term_ntproc as the handler for SIGABRT.
1264 (sigaction): Rewrite to call sys_signal instead of duplicating its
1265 code.
1266 (sys_kill): Improve commentary.
1267
1268 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1269 consistency with a signature of a signal handler. All callers
1270 changed.
1271 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1272 install term_ntproc as a signal handler for SIGABRT, as that
1273 should be done by the dumped Emacs.
1274
1275 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1276
1277 * w32select.c (term_w32select): Protect against repeated
1278 invocation by setting clipboard_owner to NULL after calling
1279 DestroyWindow.
1280
1281 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1282 and term_ntproc to their modified signatures.
1283
1284 * character.c (char_string, string_char): Remove calls to
1285 MAYBE_UNIFY_CHAR. See the discussion starting at
1286 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1287 for the details.
1288
1289 2012-09-25 Chong Yidong <cyd@gnu.org>
1290
1291 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1292
1293 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1294
1295 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1296 when encountering an unknown bytecode.
1297
1298 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1299
1300 image.c, indent.c: Use bool for booleans.
1301 * dispextern.h (struct image_type): Members valid_p, load, init
1302 now return bool, not int. All uses changed.
1303 * image.c: Omit unnecessary static decls.
1304 (x_create_bitmap_mask, x_build_heuristic_mask):
1305 Return void, not int, since callers don't care about the return value.
1306 (x_create_bitmap_mask, define_image_type, valid_image_p)
1307 (struct image_keyword, parse_image_spec, image_spec_value)
1308 (check_image_size, image_background)
1309 (image_background_transparent, x_clear_image_1)
1310 (postprocess_image, lookup_image, x_check_image_size)
1311 (x_create_x_image_and_pixmap, xbm_image_p)
1312 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1313 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1314 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1315 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1316 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1317 (png_image_p, init_png_functions, png_load_body, png_load)
1318 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1319 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1320 (init_gif_functions, gif_load, imagemagick_image_p)
1321 (imagemagick_load_image, imagemagick_load, svg_image_p)
1322 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1323 (gs_load):
1324 * nsimage.m (ns_load_image):
1325 * nsterm.m (ns_defined_color):
1326 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1327 * xfns.c (x_defined_color):
1328 * xterm.c (x_alloc_lighter_color_for_widget)
1329 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1330 (x_alloc_lighter_color):
1331 * indent.c (disptab_matches_widthtab, current_column)
1332 (scan_for_column, string_display_width, indented_beyond_p)
1333 (compute_motion, vmotion, Fvertical_motion):
1334 Use bool for booleans.
1335
1336 2012-09-24 Chong Yidong <cyd@gnu.org>
1337
1338 * chartab.c (Fset_char_table_default): Obsolete function removed.
1339
1340 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1341
1342 Move pid_t related decls out of lisp.h.
1343 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1344 (interruptible_wait_for_termination):
1345 Move these decls from lisp.h to syswait.h, since they use pid_t.
1346 Needed on FreeBSD; see Herbert J. Skuhra in
1347 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1348 * callproc.c: Include syswait.h.
1349
1350 gnutls.c, gtkutil.c: Use bool for boolean.
1351 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1352 (emacs_gnutls_handle_error):
1353 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1354 (xg_hide_tooltip, xg_create_frame_widgets)
1355 (create_dialog, xg_uses_old_file_dialog)
1356 (xg_get_file_with_chooser, xg_get_file_with_selection)
1357 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1358 (xg_item_label_same_p, xg_update_menubar)
1359 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1360 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1361 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1362 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1363 (update_frame_tool_bar, free_frame_tool_bar):
1364 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1365 * nsmenu.m (ns_update_menubar):
1366 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1367 * xfns.c (Fx_show_tip) [USE_GTK]:
1368 Use bool for boolean.
1369 * gtkutil.c (xg_update_frame_menubar):
1370 * xmenu.c (update_frame_menubar):
1371 Return void, not int, since caller ignores return value.
1372 * gtkutil.c (xg_change_toolbar_position):
1373 Return void, not 1.
1374
1375 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1376
1377 * makefile.w32-in (BLOCKINPUT_H): Remove.
1378 (SYSSIGNAL_H): New macro.
1379 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1380 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1381 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1382 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1383 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1384 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1385 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1386 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1387 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1388 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1389 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1390 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1391 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1392 ($(BLD)/w32xfns.$(O)): Update dependencies.
1393
1394 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1395
1396 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1397 fatal_error_backtrace.
1398
1399 * w32proc.c (sys_kill): Undo last change: don't do anything when
1400 invoked to deliver SIGABRT to our own process. This is now
1401 handled by emacs_raise.
1402
1403 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1404
1405 * w32term.c (w32_read_socket): Remove leftover reference to
1406 interrupt_input_pending.
1407
1408 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1409
1410 Do not use SA_NODEFER.
1411 Problem reported by Dani Moncayo in
1412 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1413 * alloc.c (die):
1414 * sysdep.c (emacs_abort): Do not reset signal handler.
1415 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1416 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1417 wanted even on POSIXish hosts, and it doesn't work on Windows.
1418
1419 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1420
1421 * xterm.c (x_term_init): Call fixup_locale before and after calling
1422 gtk_init (Bug#12392).
1423
1424 2012-09-23 Chong Yidong <cyd@gnu.org>
1425
1426 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1427 Vdynamic_library_alist.
1428
1429 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1430 (Fgnutls_available_p): Caller changed.
1431
1432 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1433 (Flibxml_parse_xml_region): Likewise.
1434
1435 * dispextern.h (struct image_type): Remove arg from init function.
1436
1437 * image.c (Finit_image_library, lookup_image_type)
1438 (define_image_type): Remove now-unneeded second arg.
1439 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1440 (init_tiff_functions, init_gif_functions, init_svg_functions):
1441 Arglist and w32_delayed_load calling convention changed.
1442 (gs_type): Remove init_gs_functions; there is no such function.
1443 (valid_image_p, make_image): Fix caller to lookup_image_type.
1444
1445 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1446
1447 Simplify and avoid signal-handling races (Bug#12471).
1448 * alloc.c (die):
1449 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1450 Avoid recursive loop if there's a fatal error in the function itself.
1451 * atimer.c (pending_atimers):
1452 * blockinput.h: Don't include "atimer.h"; no longer needed.
1453 (interrupt_input_pending): Remove. All uses removed.
1454 pending_signals now counts both atimers and ordinary interrupts.
1455 This is less racy than having three separate pending-signal flags.
1456 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1457 (input_blocked_p):
1458 Rename from their upper-case counterparts BLOCK_INPUT,
1459 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1460 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1461 This makes it easier to access volatile variables more accurately.
1462 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1463 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1464 that's more reliable if the code is buggy and sets
1465 interrupt_input_blocked to a negative value. All uses changed.
1466 * atimer.c (deliver_alarm_signal):
1467 Remove. No need to deliver this to the parent; any thread can
1468 handle this signal now. All uses replaced by underlying handler.
1469 * atimer.c (turn_on_atimers):
1470 * dispnew.c (handle_window_change_signal):
1471 * emacs.c (handle_danger_signal):
1472 * keyboard.c (kbd_buffer_get_event):
1473 Don't reestablish signal handler; not needed with sigaction.
1474 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1475 (UNBLOCK_INPUT_TO):
1476 Rework to avoid unnecessary accesses to volatile variables.
1477 (UNBLOCK_INPUT_TO): Now a function.
1478 (totally_unblock_input, unblock_input): New decls.
1479 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1480 (init_data): Remove. Necessary stuff now done in init_signal.
1481 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1482 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1483 (fatal_error_code): Remove; no longer needed.
1484 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1485 it doesn't always backtrace. All uses changed. No need to reset
1486 signal to default, since sigaction and/or die does that for us now.
1487 Use emacs_raise (FOO), not kill (getpid (), FOO).
1488 (main): Check more-accurately whether we're dumping.
1489 Move fatal-error setup to sysdep.c
1490 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1491 * gtkutil.c (xg_get_file_name, xg_get_font):
1492 Remove no-longer-needed signal-mask manipulation.
1493 * keyboard.c, process.c (POLL_FOR_INPUT):
1494 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1495 * keyboard.c (read_avail_input): Remove.
1496 All uses replaced by gobble_input.
1497 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1498 (kbd_buffer_store_event_hold, gobble_input):
1499 (record_asynch_buffer_change) [USABLE_SIGIO]:
1500 (store_user_signal_events):
1501 No need to mess with signal mask.
1502 (gobble_input): If blocking input and there are terminals, simply
1503 set pending_signals to 1 and return. All hooks changed to not
1504 worry about whether input is blocked.
1505 (process_pending_signals): Clear pending_signals before processing
1506 them, in case a signal comes in while we're processing.
1507 By convention callers now test pending_signals before calling us.
1508 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1509 New functions, to support changes to blockinput.h.
1510 (handle_input_available_signal): Now extern.
1511 (reinvoke_input_signal): Remove. All uses replaced by
1512 handle_async_input.
1513 (quit_count): Now volatile, since a signal handler uses it.
1514 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1515 All callers changed. Block SIGINT only if not already blocked.
1516 Clear sigmask reliably, even if Fsignal returns, which it can.
1517 Omit unnecessary accesses to volatile var.
1518 (quit_throw_to_read_char): No need to restore sigmask.
1519 * keyboard.c (gobble_input, handle_user_signal):
1520 * process.c (wait_reading_process_output):
1521 Call signal-handling code rather than killing ourselves.
1522 * lisp.h: Include <float.h>, for...
1523 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1524 (pending_signals): Now volatile.
1525 (syms_of_data): Now const if IEEE floating point.
1526 (handle_input_available_signal) [USABLE_SIGIO]:
1527 (terminate_due_to_signal, record_child_status_change): New decls.
1528 * process.c (create_process): Avoid disaster if memory is exhausted
1529 while we're processing a vfork, by tightening the critical section
1530 around the vfork.
1531 (send_process_frame, process_sent_to, handle_pipe_signal)
1532 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1533 ignores SIGPIPE.
1534 (send_process): No need for setjmp/longjmp any more, since the
1535 SIGPIPE stuff is now gone. Instead, report an error if errno
1536 is EPIPE.
1537 (record_child_status_change): Now extern. PID and W are now args.
1538 Return void, not bool. All callers changed.
1539 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1540 Remove. All uses removed. This bug should be fixed now in a
1541 different way.
1542 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1543 and record the child status change directly. This avoids the
1544 need to futz with the signal mask.
1545 (process_fatal_action): Move here from emacs.c.
1546 (emacs_sigaction_flags): New function, containing
1547 much of what used to be in emacs_sigaction_init.
1548 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1549 caught by emacs, to make races less likely.
1550 (deliver_process_signal): Rename from handle_on_main_thread.
1551 All uses changed.
1552 (BACKTRACE_LIMIT_MAX): Now at top level.
1553 (thread_backtrace_buffer, threadback_backtrace_pointers):
1554 New static vars.
1555 (deliver_thread_signal, deliver_fatal_thread_signal):
1556 New functions, for more-accurate delivery of thread-specific signals.
1557 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1558 (deliver_arith_signal): Handle in this thread, not
1559 in the main thread, since it's triggered by this thread.
1560 (maybe_fatal_sig): New function.
1561 (init_signals): New arg DUMPING so that we can be more accurate
1562 about whether we're dumping. Caller changed.
1563 Treat thread-specific signals differently from process-general signals.
1564 Block all signals while handling fatal error; that's safer.
1565 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1566 on IEEE hosts.
1567 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1568 Ignore SIGPIPE unless batch.
1569 (emacs_backtrace): Output backtrace for the appropriate thread,
1570 which is not necessarily the main thread.
1571 * syssignal.h: Include <stdbool.h>.
1572 (emacs_raise): New macro.
1573 * xterm.c (x_connection_signal): Remove; no longer needed
1574 now that we use sigaction.
1575 (x_connection_closed): No need to mess with sigmask now.
1576 (x_initialize): No need to reset SIGPIPE handler here, since
1577 init_signals does this for us now.
1578
1579 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1580
1581 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1582 background rect may be larger (Bug#12245).
1583
1584 2012-09-23 Chong Yidong <cyd@gnu.org>
1585
1586 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1587
1588 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1589
1590 * .gdbinit: Just stop at fatal_error_backtrace.
1591 See Stefan Monnier's request in
1592 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1593 Remove no-longer-used query of system type.
1594
1595 2012-09-22 Chong Yidong <cyd@gnu.org>
1596
1597 * search.c (Freplace_match): Doc fix (Bug#12325).
1598
1599 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1600
1601 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1602 (Fline_end_position): Doc fix.
1603
1604 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1605
1606 2012-09-22 Chong Yidong <cyd@gnu.org>
1607
1608 * dispextern.h (struct image_type): Add new slot, storing a type
1609 initialization function.
1610
1611 * image.c (define_image_type): Call the image initializer function
1612 if it is defined. Arguments and return value changed.
1613 (valid_image_p, make_image): Callers changed.
1614 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1615 (gif_type, imagemagick_type, svg_type, gs_type):
1616 Add initialization functions.
1617 (Finit_image_library): Call lookup_image_type.
1618 (CHECK_LIB_AVAILABLE): Macro deleted.
1619 (lookup_image_type): Call define_image_type here, rather than via
1620 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1621 (syms_of_image): Move define_image_type calls for xbm_type and
1622 pbm_type to lookup_image_type.
1623
1624 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1625
1626 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1627 'idle_timers' from here ...
1628 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1629 lists, to avoid infloops when the timer does something stupid,
1630 like reinvoke itself with the same or smaller time-out.
1631 (Bug#12447)
1632
1633 2012-09-22 Martin Rudalics <rudalics@gmx.at>
1634
1635 * window.c (Fsplit_window_internal): Handle only Qt value of
1636 Vwindow_combination_limit separately.
1637 (Qtemp_buffer_resize): New symbol.
1638 (Vwindow_combination_limit): New default value.
1639 Rewrite doc-string.
1640
1641 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1642
1643 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1644 the new overlay string. (Bug#10159)
1645
1646 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1647
1648 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1649 or that fprintf is async-signal-safe. POSIX doesn't require
1650 either assumption.
1651
1652 2012-09-22 Chong Yidong <cyd@gnu.org>
1653
1654 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1655 (Bug#8207).
1656
1657 2012-09-22 Kenichi Handa <handa@gnu.org>
1658
1659 * composite.c (composition_reseat_it): Handle the case that a
1660 grapheme cluster is not covered by a single font (Bug#12352).
1661
1662 2012-09-21 Chong Yidong <cyd@gnu.org>
1663
1664 * image.c (define_image_type): Avoid adding duplicate types to
1665 image_types (Bug#12463). Suggested by Jörg Walter.
1666
1667 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1668
1669 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1670 (print_load_command_name): Add case LC_DATA_IN_CODE.
1671 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1672
1673 2012-09-21 Glenn Morris <rgm@gnu.org>
1674
1675 * eval.c (Frun_hook_with_args_until_success)
1676 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1677
1678 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1679
1680 * fileio.c (Ffile_selinux_context): Only call freecon when
1681 lgetfilecon succeeded.
1682 (Fset_file_selinux_context): Likewise. (Bug#12444)
1683
1684 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1685
1686 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1687 reordering, locate the cursor by calling set_cursor_from_row; if
1688 that fails, clear the desired glyph matrix before returning a
1689 failure indication to the caller. Fixes leaving garbled display
1690 when fast scrolling with a down-key. (Bug#12403)
1691 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1692 scrolling through multibyte text.
1693
1694 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1695
1696 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1697 calling mark_vectorlike since that's the one that marks the window.
1698 (mark_discard_killed_buffers): Mark the final cdr.
1699 * window.h (struct window): Move prev/next_buffers to the
1700 non-standard fields.
1701 * window.c (make_window): Initialize prev/next_buffers manually.
1702
1703 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1704
1705 Omit unused arg EXPECTED from socket hooks.
1706 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1707 * nsterm.m (ns_term_init):
1708 * termhooks.h (struct terminal.read_socket_hook):
1709 * w32inevt.c (w32_console_read_socket):
1710 * w32term.c (w32_read_socket):
1711 * xterm.c (XTread_socket):
1712 Omit unused arg EXPECTED. All callers changed.
1713 (store_user_signal_events): Return void, not int, since callers no
1714 longer care about the return value. All uses changed.
1715
1716 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
1717
1718 * w32gui.h (XParseGeometry): Do not declare.
1719
1720 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1721
1722 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1723 Ignore 'expected'. See Eli Zaretskii in
1724 <http://bugs.gnu.org/12471#8> (last line).
1725
1726 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1727 (XParseGeometry): Now static. Substitute extremal values for
1728 values that are out of range.
1729
1730 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1731
1732 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1733
1734 * nsfns.m (XParseGeometry): Remove.
1735 (Fx_create_frame): Call x_set_offset to correctly interpret
1736 top_pos in geometry.
1737
1738 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1739 (Fx_parse_geometry): If there is a space in string, call
1740 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1741
1742 2012-09-17 Eli Zaretskii <eliz@gnu.org>
1743
1744 * search.c (scan_buffer): Use character positions in calls to
1745 region_cache_forward and region_cache_backward, not byte
1746 positions. (Bug#12196)
1747
1748 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1749 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1750
1751 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1752 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1753 emacs_blocked_malloc, now deleted.
1754
1755 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1756
1757 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1758 The workaround was for improving performance on Solaris 2.4, but
1759 is getting in the way now. Emacs will still work if someone is
1760 still running Solaris 2.4 in a museum somewhere; Sun dropped
1761 support for Solaris 2.4 in 2003.
1762 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1763 * process.c (create_process) [HAVE_WORKING_VFORK]:
1764 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1765 since Emacs no longer uses vfork on that platform.
1766
1767 2012-09-17 Glenn Morris <rgm@gnu.org>
1768
1769 * emacs.c: Use COPYRIGHT.
1770
1771 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1772
1773 Remove configure's --without-sync-input option (Bug#12450).
1774 When auditing signal-handling in preparation for cleaning it up,
1775 I found that SYNC_INPUT has race conditions and would be a real
1776 pain to fix. Since it's an undocumented and deprecated
1777 configure-time option, now seems like a good time to remove it.
1778 Also see <http://bugs.gnu.org/11080#16>.
1779 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1780 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1781 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1782 (malloc_hysteresis):
1783 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1784 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1785 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1786 (dont_register_blocks, bytes_used_when_reconsidered)
1787 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1788 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1789 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1790 Remove. All uses removed.
1791 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1792 implementation, one that depends on whether the new macro
1793 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1794 is defined.
1795 * atimer.c (run_timers, handle_alarm_signal):
1796 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1797 (handle_async_input, process_pending_signals)
1798 (handle_input_available_signal, init_keyboard):
1799 * nsterm.m (ns_read_socket):
1800 * process.c (wait_reading_process_output):
1801 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1802 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1803 (emacs_write):
1804 * xterm.c (XTread_socket):
1805 Assume SYNC_INPUT.
1806 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1807 * eval.c (handling_signal): Remove. All uses removed.
1808 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1809 All uses replaced with the SYNC_INPUT version.
1810 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1811 Remove decls.
1812 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1813 Now static.
1814
1815 * font.c (Ffont_shape_gstring): Remove unused local.
1816
1817 2012-09-16 Glenn Morris <rgm@gnu.org>
1818
1819 * Makefile.in (clean): No longer run nextstep's clean.
1820
1821 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1822 (ns_frag): Remove.
1823 (ns-app): Move here from ns.mk, and simplify.
1824 (clean): Simplify nextstep entry.
1825 * ns.mk: Remove file.
1826
1827 2012-09-17 Kenichi Handa <handa@gnu.org>
1828
1829 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1830 not covert the last few charactes.
1831
1832 2012-09-16 Kenichi Handa <handa@gnu.org>
1833
1834 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1835 here, but just check the validity of glyphs in the glyph-string.
1836
1837 2012-09-16 Martin Rudalics <rudalics@gmx.at>
1838
1839 * window.c (Fwindow_parameter, Fset_window_parameter):
1840 Accept any window as argument (Bug#12452).
1841
1842 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1843
1844 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1845 to ns_term_init to avoid memory leak.
1846
1847 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1848 explicit retain/release.
1849 (ns_term_init): Only allow one display. Initialize outerpool and
1850 ns_*_types.
1851
1852 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1853
1854 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1855 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1856 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1857 the Microsoft problem in a different way, by altering ../nt/config.nt.
1858
1859 2012-09-15 Eli Zaretskii <eliz@gnu.org>
1860
1861 * w32xfns.c:
1862 * w32uniscribe.c:
1863 * w32term.c:
1864 * w32select.c:
1865 * w32reg.c:
1866 * w32proc.c:
1867 * w32menu.c:
1868 * w32inevt.c:
1869 * w32heap.c:
1870 * w32font.c:
1871 * w32fns.c:
1872 * w32console.c:
1873 * w32.c:
1874 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1875 by lisp.h. This completes removal of setjmp.h inclusion
1876 erroneously announced in the previous commit. (Bug#12446)
1877
1878 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1879 more accurate.
1880
1881 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1882 not defined as a macro. The latter happens on MS-Windows.
1883 (Bug#12446)
1884
1885 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1886
1887 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1888 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1889 Some instances of '#include <setjmp.h>' removed, if the
1890 only reason for the instance was because "lisp.h" was included.
1891 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1892 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1893 and _longjmp with the new symbols. Emacs already uses _setjmp if
1894 available, so this change affects only POSIXish hosts that have
1895 sigsetjmp but not _setjmp, such as some versions of Solaris and
1896 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1897 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1898 (png_load_body) [HAVE_PNG]:
1899 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1900 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1901 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1902 since PNG requires jmp_buf. This is the only exception to the
1903 general rule that we now use sys_setjmp and sys_longjmp.
1904 This exception is OK since this code does not change the signal
1905 mask or longjmp out of a signal handler.
1906
1907 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1908
1909 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1910 Include "syssignal.h", for 'main_thread'.
1911
1912 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1913
1914 Avoid out-of-range marker position (Bug#12426).
1915 * insdel.c (replace_range, replace_range_2):
1916 Adjust markers before overlays, as suggested by comments.
1917 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1918 Remove redundant check before calling offset_intervals.
1919
1920 2012-09-14 Martin Rudalics <rudalics@gmx.at>
1921
1922 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1923 current buffer (Bug#12387).
1924
1925 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
1926
1927 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1928
1929 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1930
1931 Use a more backwards-compatible timer format (Bug#12430).
1932 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1933 vector element, not from the 4th, since PSECS is now at the end.
1934 (Fcurrent_idle_time): Doc fix.
1935
1936 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1937
1938 Function to mark objects and remove killed buffers at once.
1939 * alloc.c (discard_killed_buffers): Rename to ...
1940 (mark_discard_killed buffers) ... new name. Add marking
1941 of remaining objects. Fix comment. Adjust users.
1942 (mark_object): Do not touch frame buffer lists here.
1943 * frame.c (delete_frame): Reset frame buffer lists here.
1944
1945 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1946
1947 Better workaround for GNOME bug when --enable-gcc-warnings.
1948 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1949 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1950 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1951
1952 Simplify SIGIO usage (Bug#12408).
1953 The code that dealt with SIGIO was crufty and confusing, e.g., it
1954 played tricks like "#undef SIGIO" but these tricks were not used
1955 consistently. Simplify mostly by not #undeffing standard symbols,
1956 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1957 or not as we please) rather than "defined SIGIO" (standard symbol
1958 that we probably shouldn't #undef).
1959 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1960 Modules that need it can include it.
1961 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1962 * dispextern.h (ignore_sigio): New decl.
1963 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1964 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1965 * emacs.c (shut_down_emacs):
1966 * keyboard.c (kbd_buffer_store_event_hold):
1967 Use ignore_sigio rather than invoking 'signal' directly.
1968 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1969 for FIONREAD.
1970 (FIONREAD, SIGIO): Do not #undef.
1971 (tty_read_avail_input): Use #error rather than a syntax error.
1972 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1973 for I_PIPE, used by SETUP_SLAVE_PTY.
1974 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1975 * sysdep.c (croak): Remove; no longer needed. This bit of
1976 temporary code, with Fred N. Fish's comment that it's temporary,
1977 has been in Emacs since at least 1992!
1978 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1979 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1980 * syssignal.h (croak): Remove decl.
1981 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1982 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1983 now that we're termios-only.
1984 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1985 * term.c (dissociate_if_controlling_tty): Use #error rather than
1986 a run-time error.
1987
1988 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1989 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1990 to work around GNOME bug 683906.
1991 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1992 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1993 This works around GCC bug 54561.
1994
1995 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1996
1997 More fixes for 'volatile' and setjmp/longjmp.
1998 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1999 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2000 (png_load_body) [HAVE_PNG]:
2001 (jpeg_load_body) [HAVE_JPEG]:
2002 New function, with most of the old parent function's body.
2003 (png_load) [HAVE_PNG]:
2004 (jpeg_load) [HAVE_JPEG]:
2005 Invoke the new function, to avoid longjmp munging our locals.
2006 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2007 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2008 longjmp is passed 2, as the C standard doesn't guarantee this.
2009 Instead, store the failure code into mgr->failure_code.
2010
2011 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2012
2013 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2014 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2015 (syms_of_keyboard): Remove support for unread-command-char.
2016
2017 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2018
2019 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2020 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2021 violation. (Bug#12426)
2022
2023 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2024
2025 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2026
2027 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2028
2029 * eval.c: Add `inhibit-debugger'.
2030 (Qinhibit_debugger): New symbol.
2031 (call_debugger): Bind it instead of Qdebug_on_error.
2032 (maybe_call_debugger): Test Vinhibit_debugger.
2033 (syms_of_eval): Define inhibit-debugger.
2034 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2035 (syms_of_xdisp): Remove inhibit-debug-on-message.
2036
2037 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2038
2039 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2040 If a nonvolatile local variable is written before a _longjmp to
2041 the frame containing the variable, and is read after the _longjmp,
2042 the value read is indeterminate. Some local variables of type
2043 'struct handler' and 'struct catchtag' are used in this way, so
2044 mark each of their slots as volatile if the slot can be set before
2045 _longjmp and read afterwards.
2046 * lisp.h (struct handler): var and chosen_clause are now volatile.
2047 (struct catchtag): val, next, and pdlcount are now volatile.
2048
2049 * bidi.c (bidi_push_it, bidi_pop_it):
2050 * fns.c (copy_hash_table):
2051 * image.c (define_image_type):
2052 * keyboard.c (kbd_buffer_store_event_hold):
2053 * process.c (Fprocess_send_eof):
2054 * xfaces.c (x_create_gc) [HAVE_NS]:
2055 * xgselect.c (xg_select):
2056 Prefer assignment to memcpy when either will do.
2057
2058 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2059 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2060 time an item is removed. No need to mark this function 'inline';
2061 the compiler knows better than we do.
2062
2063 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2064
2065 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2066 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2067 to change_frame_size (Bug#12388).
2068 (windowDidResize:): Pass YES to updateFrameSize.
2069
2070 * nsterm.h: Add delay parameter to updateFrameSize.
2071
2072 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2073
2074 Discard killed buffers from deleted window and frame objects.
2075 This reduces an amount of references to killed buffers and
2076 helps GC to reclaim them faster.
2077 * alloc.c (discard_killed_buffers): New function.
2078 (mark_object): Use it for deleted windows and frames.
2079 (mark_object): If symbol's value is set up for a killed buffer
2080 or deleted frame, restore its global binding.
2081 * data.c (swap_in_global_binding): Add GC notice.
2082 (swap_in_symval_forwarding): Use convenient set_blv_where.
2083 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2084 * window.h: ... to here.
2085
2086 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2087
2088 Convenient macro to check whether the buffer is live.
2089 * buffer.h (BUFFER_LIVE_P): New macro.
2090 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2091 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2092
2093 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2094
2095 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2096 composition cases (Bug#12364).
2097
2098 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2099 overhang of succeeding glyphs overlapping box cursor.
2100
2101 * w32term.c (x_draw_glyph_string): Likewise.
2102
2103 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2104
2105 Simplify, document, and port floating-point (Bug#12381).
2106 The porting part of this patch fixes bugs on non-IEEE platforms
2107 with frexp, ldexp, logb.
2108 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2109 Now static.
2110 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2111 support, by removing commented-out code and briefly listing the
2112 C89 functions excluded. The commented-out stuff was confusing
2113 maintenance, e.g., we thought we needed cbrt but it was commented out.
2114 (logb): Remove decl; no longer needed.
2115 (isfinite): New macro, if not already supplied.
2116 (isnan): Don't replace any existing macro.
2117 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2118 are present on all C89 platforms.
2119 (Ffrexp): Do not special-case zero, as frexp does the right thing
2120 for that case.
2121 (Flogb): Do not use logb, as it doesn't have the desired meaning
2122 on hosts that use non-base-2 floating point. Instead, stick with
2123 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2124 frexp, to avoid getting an unspecified result.
2125
2126 * xdisp.c (Qinhibit_debug_on_message): Now static.
2127
2128 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2129
2130 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2131 NSBezierPath (Bug#12131).
2132
2133 2012-09-10 Chong Yidong <cyd@gnu.org>
2134
2135 * fns.c (Fdelq, Fdelete): Doc fix.
2136
2137 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2138
2139 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2140 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2141
2142 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2143
2144 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2145 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2146 Use it.
2147
2148 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2149
2150 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2151 left fringe if the window has a left margin. This avoids leaving
2152 traces of the cursor because its leftmost pixel is not drawn over.
2153
2154 * dispnew.c (update_window_line): When the left margin area of a
2155 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2156 that screen line. (Bug#12277)
2157
2158 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2159
2160 Assume C89 or later for math functions (Bug#12381).
2161 This simplifies the code, and makes it a bit smaller and faster,
2162 and (most important) makes it easier to clean up signal handling
2163 since we can stop worring about floating-point exceptions in
2164 library code. That was a problem before C89, but the problem
2165 went away many years ago on all practical Emacs targets.
2166 * data.c, image.c, lread.c, print.c:
2167 Don't include <math.h>; no longer needed.
2168 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2169 might be autoconfigured, as that never happens.
2170 * data.c (fmod):
2171 * doprnt.c (DBL_MAX_10_EXP):
2172 * print.c (DBL_DIG):
2173 Remove. C89 or later always defines these.
2174 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2175 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2176 (arith_error, domain_error, domain_error2):
2177 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2178 no longer needed -- we simply return what C returns. All uses removed.
2179 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2180 the wrapped code.
2181 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2182 Remove. All uses expanded, as these macros are no longer used
2183 more than once and are now more trouble than they're worth.
2184 (Ftan): Use tan, not sin / cos.
2185 (Flogb): Assume C89 frexp.
2186 (fmod_float): Assume C89 fmod.
2187 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2188 (init_floatfns): Remove. All uses removed.
2189
2190 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2191
2192 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2193 compositeToPoint for OSX < 10.6 (Bug#12390).
2194
2195 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2196
2197 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2198 This produces more-accurate results.
2199
2200 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2201
2202 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2203 changes (Bug#12088).
2204
2205 2012-09-08 Chong Yidong <cyd@gnu.org>
2206
2207 * syntax.c (Fstring_to_syntax): Doc fix.
2208
2209 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2210
2211 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2212 in the internal border.
2213 (x_set_window_size): Remove static variables and their usage.
2214 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2215 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2216 Remove fringe/internal border adjustment (Bug#11052).
2217 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2218 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2219 (ns_fix_rect_ibw): Remove.
2220 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2221 (ns_dumpglyphs_box_or_relief): Ditto.
2222 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2223 adjustment.
2224 (ns_dumpglyphs_image): Ditto.
2225 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2226 border adjustment.
2227 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2228 their usage. Add fringe_extended_p and its use as in other terms.
2229 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2230 scroll bar was removed.
2231 (updateFrameSize): New function.
2232 (windowDidResize): Move code to updateFrameSize and call it.
2233
2234 * nsterm.h (EmacsView): Add updateFrameSize.
2235
2236 2012-09-07 Chong Yidong <cyd@gnu.org>
2237
2238 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2239
2240 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2241
2242 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2243
2244 More signal-handler cleanup (Bug#12327).
2245 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2246 Problem introduced when merging patches. Noted by Eli Zaretskii in
2247 <http://bugs.gnu.org/12327#67>.
2248 * floatfns.c: Comment fix.
2249 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2250 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2251 and anyway the declaration is harmless even if SIGDANGER is not defined.
2252 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2253 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2254 source files not surprisingly expected syssignal.h to define, or
2255 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2256 Include <sys/ioctl.h>, for FIONREAD.
2257 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2258 This eliminates a problem whereby other files mysteriously had
2259 to include "syssignal.h" before including "systty.h" if they
2260 wanted to use "#ifdef SIGIO".
2261
2262 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2263
2264 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2265
2266 * w32.c (sigemptyset): Empty the set.
2267 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2268
2269 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2270
2271 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2272
2273 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2274 (mark_object): Likewise for frame objects.
2275
2276 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2277
2278 * syssignal.h (handle_on_main_thread): Always declare,
2279 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2280 This ports to platforms without HAVE_PTHREAD.
2281
2282 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2283
2284 Signal-handler cleanup (Bug#12327).
2285 Emacs's signal handlers were written in the old 4.2BSD style with
2286 sigblock and sigmask and so forth, and this led to some
2287 inefficiencies and confusion. Rewrite these to use
2288 pthread_sigmask etc. without copying signal sets around. Also,
2289 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2290 'signal', and instead use functions that do not attempt to take
2291 over the system name space. This patch causes Emacs's text
2292 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2293 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2294 Do not include <signal.h> or "syssignal.h", as these
2295 modules do not use signals.
2296 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2297 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2298 Do not include <signal.h>, as "syssignal.h" does that for us now.
2299 * atimer.c (sigmask_atimers): New function.
2300 (block_atimers, unblock_atimers): New functions,
2301 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2302 All uses replaced.
2303 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2304 no longer needed here.
2305 * emacs.c (main): Inspect existing signal handler with sigaction,
2306 so that there's no need to block and unblock SIGHUP.
2307 * sysdep.c (struct save_signal): New member 'action', replacing
2308 old member 'handler'.
2309 (save_signal_handlers, restore_signal_handlers):
2310 Use sigaction instead of 'signal' to save and restore.
2311 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2312 New function. All users of 'signal' modified to use set_sighandler
2313 if they're writeonly, and to use sys_signal if they're read+write.
2314 (emacs_sigaction_init, forwarded_signal): New functions.
2315 (sys_signal): Remove. All uses replaced by calls to sigaction
2316 and emacs_sigaction_init, or by direct calls to 'signal'.
2317 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2318 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2319 all uses replaced by pthread_sigmask etc. calls.
2320 * syssignal.h: Include <signal.h>.
2321 (emacs_sigaction_init, forwarded_signal): New decls.
2322 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2323 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2324 (sigmask, sys_sigmask): Remove; no longer needed.
2325 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2326 (sigblock, sigunblock, sigfree):
2327 (sigsetmask) [!defined sigsetmask]:
2328 Remove. All uses replaced by pthread_sigmask.
2329 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2330 no longer need to be replaced, and its typical old uses
2331 are now done via emacs_sigaction_init and sigaction.
2332 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2333 (sys_sigdel): Remove; unused.
2334 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2335
2336 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2337
2338 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2339 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2340
2341 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2342
2343 Explicitly mark buffer_defaults and buffer_local_symbols.
2344 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2345 mark_local_symbols here.
2346 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2347 since special buffers aren't marked here any more.
2348 (allocate_buffer): Chain new buffer with all_buffers here...
2349 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2350 not here.
2351 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2352 (syms_of_buffer): Remove staticpro of the above.
2353 (init_buffer_once): Set names for buffer_defaults and
2354 buffer_local_symbols.
2355
2356 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2357
2358 Use bool for booleans in font-related modules.
2359 * font.c (font_intern_prop, font_style_to_value)
2360 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2361 (generate_otf_features, font_check_otf_features, font_check_otf)
2362 (font_match_p, font_list_entities, font_at):
2363 * fontset.c (fontset_id_valid_p, reorder_font_vector
2364 (fontset_find_font, Fset_fontset_font)
2365 (face_suitable_for_char_p) [0]:
2366 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2367 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2368 (m17n_flt_initialized, ftfont_shape_by_flt):
2369 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2370 * nsfont.m (nsfont_draw):
2371 * w32font.c (w32font_draw):
2372 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2373 Use bool for booleans.
2374 * font.h: Adjust to above API changes.
2375 (struct font, struct font_driver, struct font_driver_list):
2376 Use bool for booleans.
2377 (struct font): Remove useless member encoding_type.
2378 All users removed.
2379 * fontset.c, xftfont.c: Omit unnecessary static decls.
2380
2381 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2382
2383 * alloc.c (mark_object): Revert window marking code
2384 since it's unsafe for the Fset_window_configuration.
2385
2386 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2387
2388 Fix race conditions with signal handlers and errno (Bug#12327).
2389 Be more systematic about preserving errno whenever a signal
2390 handler returns, even if it's not in the main thread. Do this by
2391 renaming signal handlers to distinguish between signal delivery
2392 and signal handling. All uses changed.
2393 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2394 * data.c (deliver_arith_signal): Rename from arith_error.
2395 * dispnew.c (deliver_window_change_signal): Rename from
2396 window_change_signal.
2397 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2398 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2399 * keyboard.c (deliver_input_available_signal): Rename from
2400 input_available_signal.
2401 (deliver_user_signal): Rename from handle_user_signal.
2402 (deliver_interrupt_signal): Rename from interrupt_signal.
2403 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2404 (deliver_child_signal): Rename from sigchld_handler.
2405 * atimer.c (handle_alarm_signal):
2406 * data.c (handle_arith_signal):
2407 * dispnew.c (handle_window_change_signal):
2408 * emacs.c (handle_fatal_signal, handle_danger_signal):
2409 * keyboard.c (handle_input_available_signal):
2410 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2411 * process.c (handle_pipe_signal, handle_child_signal):
2412 New functions, with the actual signal-handling code taken from the
2413 original respective signal handlers, sans the sporadic attempts to
2414 preserve errno, since that's now done by handle_on_main_thread.
2415 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2416 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2417 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2418 Move to sysdep.c.
2419 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2420 Move initialization of main_thread to sysdep.c's init_signals.
2421 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2422 our usage, and simplifies the mainline code.
2423 (record_child_status_change): New static function, as a helper
2424 for handle_child_signal, and with most of the old child handler's
2425 contents.
2426 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2427 (handle_child_signal): Use the above.
2428 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2429 Moved here from emacs.c.
2430 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2431 code moved here from emacs.c's main function.
2432 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2433 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2434 This lets callers save and restore errno properly.
2435
2436 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2437
2438 Remove redundant or unused things here and there.
2439 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2440 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2441 * editfns.c (Fcompare_buffer_substrings): Likewise.
2442 * frame.h (struct terminal, struct font_driver_list):
2443 Remove redundant declarations.
2444 * window.h (Qleft, Qright): Likewise.
2445
2446 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2447
2448 Do not mark objects from deleted buffers, windows and frames.
2449 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2450 (mark_object): Likewise for windows and frames.
2451
2452 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2453
2454 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2455 buffer_defaults and buffer_local_symbols as valid objects.
2456 Return special value to denote them.
2457
2458 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2459
2460 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2461 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2462 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2463 (file_name_absolute_p, Fsubstitute_in_file_name):
2464 (check_executable, check_writable, Ffile_accessible_directory_p)
2465 (Fset_file_selinux_context, Fdefault_file_modes)
2466 (Finsert_file_contents, choose_write_coding_system)
2467 (Fwrite_region, build_annotations, a_write, e_write)
2468 (Fdo_auto_save):
2469 * filelock.c (boot_time_initialized, get_boot_time)
2470 (get_boot_time_1, lock_file_1, within_one_second):
2471 * floatfns.c (in_float):
2472 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2473 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2474 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2475 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2476 * window.c (compare_window_configurations):
2477 Use bool for booleans.
2478 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2479 (Fdefault_file_modes): Now mode_t, not int, for modes.
2480 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2481 (internal_delete_file): Now returns void, not a (boolean) int,
2482 since nobody was looking at the return value.
2483 * lisp.h, window.h: Adjust to above API changes.
2484
2485 * xdisp.c (set_message): Simplify and reindent last change.
2486
2487 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2488
2489 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2490
2491 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2492
2493 * eval.c (call_debugger): Make the function non-static so that we
2494 can call it from set_message.
2495
2496 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2497 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2498
2499 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2500
2501 Give more-useful info on a fatal error (Bug#12328).
2502 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2503 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2504 of doing the work ourselves.
2505 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2506 do most of the work.
2507 (fatal_error_backtrace): New function, taken from the guts
2508 of the old fatal_error_signal, but with a new option to output
2509 a backtrace.
2510 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2511 info about the signal than just its number.
2512 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2513 * sysdep.c: Include <execinfo.h>
2514 (emacs_backtrace): New function, taken partly from the previous
2515 code of the 'die' function.
2516 (emacs_abort): Call fatal_error_backtrace rather than abort.
2517
2518 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2519
2520 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2521 eager (load-time) macro-expansion.
2522 * lisp.mk (lisp): Add macroexp.
2523
2524 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2525
2526 Simplify redefinition of 'abort' (Bug#12316).
2527 Do not try to redefine the 'abort' function. Instead, redo
2528 the code so that it calls 'emacs_abort' rather than 'abort'.
2529 This removes the need for the NO_ABORT configure-time macro
2530 and makes it easier to change the abort code to do a backtrace.
2531 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2532 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2533 Remove; sysdep.c's emacs_abort now takes its place.
2534 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2535 'abort' changed to use 'emacs_abort'.
2536 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2537 (abort) [!defined abort]: Rename to ...
2538 (emacs_abort): ... new name.
2539 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2540 the place of the old 'abort' in emacs.c.
2541 * w32.c, w32fns.c (abort): Do not #undef.
2542 * w32.c (emacs_abort): Rename from w32_abort.
2543
2544 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2545
2546 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2547 offsets[j].dv, since the y axis of the screen coordinates points
2548 down, while the y axis of the font definition coordinates points
2549 up. This fixes display of Arabic diacritics such as KASRA and
2550 KASRATAN. (Bug#11860)
2551
2552 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2553
2554 Be more systematic about _setjmp vs setjmp.
2555 * alloc.c (test_setjmp, mark_stack):
2556 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2557 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2558 (png_load, my_error_exit, jpeg_load):
2559 * process.c (send_process_trap, send_process):
2560 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2561 The underscored versions are up to 30x faster on some hosts.
2562 Formerly, the code used setjmp+longjmp sometimes and
2563 _setjmp+_longjmp at other times, with no particular reason to
2564 prefer setjmp+longjmp.
2565
2566 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2567
2568 Fix minor problem found by static checking.
2569 * buffer.c (Fdelete_all_overlays): Return nil.
2570
2571 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2572
2573 * buffer.c (Fdelete_all_overlays): New function.
2574
2575 2012-09-03 Chong Yidong <cyd@gnu.org>
2576
2577 * gtkutil.c: Add extern decl for Qxft.
2578
2579 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2580
2581 * emacs.c, eval.c: Use bool for boolean.
2582 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2583 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2584 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2585 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2586 (main, decode_env_path, Fdaemon_initialized):
2587 * eval.c (call_debugger, Finteractive_p, interactive_p):
2588 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2589 (maybe_call_debugger, Fbacktrace):
2590 * process.c (read_process_output, exec_sentinel):
2591 Use bool for booleans.
2592 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2593 All callers changed.
2594 * eval.c (interactive_p): Omit always-true boolean argument
2595 EXCLUDE_SUBRS_P. All callers changed.
2596 * dispextern.h, lisp.h: Reflect above API changes.
2597 * firstfile.c (dummy): Use the address of 'main', whose signature
2598 won't change, instead of the address of 'initialize', whose
2599 signature just changed from int to bool.
2600 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2601 * msdos.c (fatal_error_in_progress): ... from here.
2602 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2603 of incrementing it.
2604 (redisplay_internal, unwind_redisplay): Simply clear
2605 REDISPLAYING_P when unwinding, instead of saving its previous,
2606 always-false value and then restoring it.
2607
2608 Clean up some extern decls.
2609 Mostly, this hoists extern decls out of .c files and into .h files.
2610 That way, we're more likely to catch errors if the interfaces change.
2611 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2612 declare xg_mark_data.
2613 * dispextern.h (x_frame_parm_handlers):
2614 * font.h (Qxft):
2615 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2616 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2617 (Qultra_bold, Qoblique, Qitalic):
2618 Move extern decl here from .c file.
2619 * alloc.c (xg_mark_data) [USE_GTK]:
2620 * doc.c (Qclosure):
2621 * eval.c (Qlexical_binding):
2622 * fns.c (time) [!HAVE_UNISTD_H]:
2623 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2624 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2625 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2626 * lread.c (Qinternal_interpreter_environment):
2627 * minibuf.c (Qbuffer):
2628 * process.c (QCfamily, QCfilter):
2629 * widget.c (free_frame_faces):
2630 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2631 * xfont.c (x_clear_errors):
2632 * xterm.c (x_frame_parm_handlers):
2633 Remove now-redundant extern decls.
2634 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2635 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2636 Now static.
2637 * xfaces.c: Remove unnecessary static decls.
2638 * xterm.c (updating_frame): Remove decl of nonexistent object.
2639
2640 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2641 when building globals.h, as the objects that are not built on
2642 this host are not needed to compile C files on this host.
2643
2644 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2645
2646 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2647
2648 * frame.h: Add missing prototype for x_wm_set_size_hint.
2649
2650 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2651
2652 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2653 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2654 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2655 (Fsubstitute_command_keys):
2656 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2657 (save_excursion_save, save_excursion_restore)
2658 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2659 (format_time_string, general_insert_function)
2660 (make_buffer_string, make_buffer_string_both)
2661 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2662 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2663 (copy_text, insert_1, insert_1_both, insert_from_string)
2664 (insert_from_string_before_markers, insert_from_string_1)
2665 (insert_from_buffer, insert_from_buffer_1, replace_range)
2666 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2667 (del_range_2, modify_region):
2668 * intervals.c (intervals_equal, balance_possible_root_interval)
2669 (adjust_intervals_for_insertion, merge_properties_sticky)
2670 (graft_intervals_into_buffer, lookup_char_property)
2671 (adjust_for_invis_intang, set_point_both)
2672 (get_property_and_range, compare_string_intervals)
2673 (set_intervals_multibyte_1, set_intervals_multibyte):
2674 * keyboard.c (decode_timer):
2675 Use bool for boolean.
2676 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2677 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2678
2679 2012-09-02 Chong Yidong <cyd@gnu.org>
2680
2681 * keymap.c (push_key_description): Print M-TAB as C-M-i
2682 (Bug#11758).
2683
2684 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2685
2686 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2687 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2688 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2689 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2690 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2691 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2692 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2693
2694 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2695
2696 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2697 more than one grapheme cluster passed to the shaper: compute the
2698 offset adjustment values separately for each cluster. (Bug#11860)
2699
2700 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2701 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2702 about implicit conversions from integer to pointer.
2703
2704 2012-09-01 Daniel Colascione <dancol@dancol.org>
2705
2706 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2707 system used too early.
2708
2709 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2710
2711 Better seed support for (random).
2712 * emacs.c (main): Call init_random.
2713 * fns.c (Frandom): Set the seed from a string argument, if given.
2714 Remove long-obsolete Gentzel cruft.
2715 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2716 (init_random): New function.
2717
2718 2012-09-01 Daniel Colascione <dancol@dancol.org>
2719
2720 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2721 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2722 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2723 x_wm_set_size_hint, x_query_colors, x_real_positions,
2724 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2725 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2726 all of which have been moved to common code.
2727
2728 * xfaces.c: Include TERM_HEADER instead of listing all possible
2729 window-system headers.
2730
2731 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2732 to match header.
2733
2734 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2735 directly accessing frame internals.
2736
2737 * w32font.h: Include font.h. Define syms_of_w32font and
2738 globals_of_w32font.
2739
2740 * process.c: Include TERM_HEADER instead of listing all possible
2741 window-system headers.
2742
2743 * nsterm.h: Remove declarations now in frame.h.
2744 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2745
2746 * menu.c: Include TERM_HEADER instead of listing all possible
2747 window-system headers.
2748
2749 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2750 window system.
2751
2752 * keyboard.c: Include TERM_HEADER instead of listing all possible
2753 window-system headers.
2754
2755 * image.c: Include TERM_HEADER instead of listing all possible
2756 window-system headers. Declare Vlibrary_cache when compiling for
2757 Windows.
2758
2759 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2760 window system declarations.
2761
2762 * frame.h: Move common functions here: set_frame_menubar,
2763 x_set_window_size, x_sync, x_get_focus_frame,
2764 x_set_mouse_position, x_set_mouse_pixel_position,
2765 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2766 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2767 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2768 x_activate_menubar, x_real_positions, x_bitmap_icon,
2769 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2770 and x_query_colors.
2771
2772 * frame.c: Include TERM_HEADER instead of listing all possible
2773 window-system headers.
2774
2775 * font.c: Include TERM_HEADER instead of listing all possible
2776 window-system headers.
2777
2778 * emacs.c: Include TERM_HEADER.
2779
2780 * dispnew.c: Include TERM_HEADER instead of listing all possible
2781 window-system headers.
2782
2783 * ccl.h: Include character.h.
2784
2785 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2786 the current window system; include in list of objects to link into
2787 Emacs.
2788
2789 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2790
2791 Remove mark_ttys function and fix tty_display_info initialization.
2792 * lisp.h (mark_ttys): Remove prototype.
2793 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2794 to mark_ttys because all possible values of 'top_frame' slot are
2795 the frames which are reachable from Vframe_list.
2796 * term.c (mark_ttys): Remove.
2797 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2798
2799 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2800
2801 Change struct frame bitfields from unsigned char to unsigned.
2802 * frame.h (struct frame): Change type of 'display_preempted',
2803 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2804 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2805 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2806 bitfields from unsigned char to unsigned.
2807
2808 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2809
2810 Remove unused member of struct x_output and struct w32_output.
2811 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2812 * w32term.h (struct w32_output): Likewise.
2813
2814 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2815
2816 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2817 does not become zero (Bug#12234).
2818
2819 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2820
2821 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2822 for GCC 4.7.1 x86-64.
2823
2824 2012-08-30 Glenn Morris <rgm@gnu.org>
2825
2826 * lread.c (init_lread): For out-of-tree builds, only add the
2827 source directory's site-lisp dir to the load-path if it exists,
2828 consistent with in-tree builds. (Bug#12302)
2829
2830 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2831
2832 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2833 button_values to NULL. Call setStykeMask so dialogs get a close button.
2834 (windowShouldClose:): Set window_closed.
2835 (dealloc): New member, free button_values.
2836 (process_dialog:): Make member function. Remove window argument,
2837 replace window with self. Count buttons and allocate and store values
2838 in button_values.
2839 (addButton:value:row:): value is int with the name tag. Call setTag
2840 with tag. Remove return self, declare return value as void.
2841 (addString:row:): Remove return self, declare return value as void.
2842 (addSplit): Remove return self, declare return value as void.
2843 (clicked:): Remove return self, declare return value as void.
2844 Set dialog_return to button_values[seltag]. Code formatting change.
2845 (initFromContents:isQuestion:): Adjust call to process_dialog.
2846 Code formatting change.
2847 (timeout_handler:): Set timer_fired to YES.
2848 (runDialogAt:): Set timer_fired to NO.
2849 Handle click on close button as quit.
2850
2851 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2852 Add window_closed and button_values. Add void as return value for
2853 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2854 Add process_dialog as new member.
2855
2856 2012-08-28 Eli Zaretskii <eliz@gnu.org>
2857
2858 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2859 is not one of the heaps we manage. (Bug#12242)
2860
2861 2012-08-28 Glenn Morris <rgm@gnu.org>
2862
2863 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2864
2865 2012-08-28 Martin Rudalics <rudalics@gmx.at>
2866
2867 * window.c (Fset_window_configuration): Remove handling of
2868 auto-buffer-name window parameter. Install revision of reverted
2869 fix.
2870
2871 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2872
2873 Do not allow to set major mode for a dead buffer.
2874 * buffer.c (Fset_buffer_major_mode): Signal an error
2875 if the buffer is dead.
2876 (Fother_buffer, other_buffer_safely): Remove redundant
2877 nested declaration.
2878
2879 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2880
2881 Always use set_buffer_if_live to restore original buffer at unwind.
2882 * buffer.h (record_unwind_current_buffer): New function.
2883 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2884 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2885 * undo.c, window.c: Adjust users.
2886 * buffer.c (set_buffer_if_live): Fix comment.
2887
2888 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2889
2890 Fix usage of set_buffer_internal.
2891 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2892 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2893 * coding.c (decode_coding): Omit redundant test.
2894 * fileio.c (decide_coding_unwind): Likewise.
2895 * fns.c (secure_hash): Likewise.
2896 * insdel.c (modify_region): Likewise.
2897 * keyboard.c (command_loop_1): Likewise.
2898 * print.c (PRINTFINISH): Likewise.
2899 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2900
2901 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2902
2903 * dispnew.c: Use bool for boolean.
2904 (frame_garbaged, display_completed, delayed_size_change)
2905 (fonts_changed_p, add_window_display_history)
2906 (add_frame_display_history, verify_row_hash)
2907 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2908 (row_equal_p, realloc_glyph_pool)
2909 (allocate_matrices_for_frame_redisplay)
2910 (showing_window_margins_p)
2911 (adjust_frame_glyphs_for_frame_redisplay)
2912 (build_frame_matrix_from_leaf_window, make_current)
2913 (mirrored_line_dance, mirror_line_dance, update_frame)
2914 (update_window_tree, update_single_window)
2915 (check_current_matrix_flags, update_window, update_text_area)
2916 (update_window_line, set_window_update_flags, scrolling_window)
2917 (update_frame_1, scrolling, buffer_posn_from_coords)
2918 (do_pending_window_change, change_frame_size)
2919 (change_frame_size_1, sit_for):
2920 Use bool for boolean.
2921 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2922 and remove last int (actually boolean) argument, which was always 0.
2923 All callers changed.
2924 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2925 * dispextern.h (struct composition_it): Use bool for boolean.
2926 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2927 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2928 * dired.c (file_name_completion):
2929 Use bool for boolean. (This was missed in an earlier change.)
2930
2931 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2932
2933 * window.c (Fset_window_configuration): Revert first part of
2934 last change.
2935
2936 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2937
2938 * nsterm.h (NSPanel): New class variable dialog_return.
2939
2940 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2941 Initialize dialog_return.
2942 (windowShouldClose:): Use stop instead of stopModalWithCode.
2943 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2944 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2945 event.
2946 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2947 modal loop returns.
2948
2949 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2950
2951 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2952 * composite.c (find_composition, composition_gstring_p)
2953 (composition_reseat_it, find_automatic_composition):
2954 * data.c (let_shadows_buffer_binding_p)
2955 (let_shadows_global_binding_p, set_internal, make_blv)
2956 (Fmake_variable_buffer_local, Fmake_local_variable)
2957 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2958 (cons_to_signed, arith_driver):
2959 * dbusbind.c (xd_in_read_queued_messages):
2960 * dired.c (directory_files_internal, file_name_completion):
2961 Use bool for booleans.
2962 * dired.c (file_name_completion):
2963 * process.h (fd_callback):
2964 Omit int (actually boolean) argument. It wasn't being used.
2965 All uses changed.
2966 * composite.h, lisp.h: Reflect above API changes.
2967
2968 * cmds.c, coding.c: Use bool for booleans.
2969 * cmds.c (move_point, Fself_insert_command):
2970 * coding.h (struct composition status, struct coding_system):
2971 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2972 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2973 (emacs_mule_char, decode_coding_emacs_mule)
2974 (encode_coding_emacs_mule, detect_coding_iso_2022)
2975 (decode_coding_iso_2022, encode_invocation_designation)
2976 (encode_designation_at_bol, encode_coding_iso_2022)
2977 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2978 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2979 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2980 (encode_coding_raw_text, detect_coding_charset)
2981 (decode_coding_charset, encode_coding_charset, detect_eol)
2982 (detect_coding, get_translation_table, produce_chars)
2983 (consume_chars, reused_workbuf_in_use)
2984 (make_conversion_work_buffer, code_conversion_save)
2985 (decode_coding_object, encode_coding_object)
2986 (detect_coding_system, char_encodable_p)
2987 (Funencodable_char_position, code_convert_region)
2988 (code_convert_string, code_convert_string_norecord)
2989 (Fset_coding_system_priority):
2990 * fileio.c (Finsert_file_contents):
2991 Use bool for booleans.
2992 * coding.h, lisp.h: Reflect above API changes.
2993 * coding.c: Remove unnecessary static function decls.
2994 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2995 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2996 not a boolean 'int', since callers never look at the return value.
2997 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2998 * coding.h (decoding_buffer_size, encoding_buffer_size)
2999 (emacs_mule_string_char): Remove unused extern decls.
3000 (struct iso_2022_spec, struct coding_system):
3001 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3002 (struct emacs_mule_spec): Remove unused field 'full_support'.
3003 All initializations removed.
3004 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3005
3006 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3007
3008 Fix spare memory change (Bug#12286).
3009 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3010 (valid_lisp_object_p): Likewise.
3011
3012 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3013
3014 * window.c (Fset_window_configuration): Record any window's old
3015 buffer if it's replaced (see Bug#8789). If the new current
3016 buffer doesn't appear in the selected window, go to its old
3017 point (Bug#12208).
3018
3019 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3020
3021 Special MEM_TYPE_SPARE to denote reserved memory.
3022 * alloc.c (enum mem_type): New memory type.
3023 (refill_memory_reserve): Use new type for spare memory.
3024 This prevents live_cons_p and live_string_p from incorrect
3025 detection of uninitialized objects from spare memory as live.
3026
3027 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3028
3029 Spelling fixes.
3030 * Makefile.in (.PHONY): versioclean -> versionclean.
3031
3032 Remove unused external symbols.
3033 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3034 * window.c (Qwindow_valid_p, decode_valid_window):
3035 Now static, not extern.
3036 * data.c (Qinterval): Remove; unused.
3037 (syms_of_data): Do not define 'interval'.
3038 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3039 * window.h (decode_valid_window):
3040 Remove decls.
3041
3042 * character.c, charset.c, chartab.c: Use bool for booleans.
3043 * character.c (lisp_string_width, string_count_byte8)
3044 (string_escape_byte8):
3045 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3046 (load_charset_map_from_file, map_charset_chars)
3047 (Fdefine_charset_internal, define_charset_internal)
3048 (Fdeclare_equiv_charset, find_charsets_in_text)
3049 (Ffind_charset_region, char_charset, Fiso_charset):
3050 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3051 (sub_char_table_set, sub_char_table_set_range)
3052 (char_table_set_range, optimize_sub_char_table)
3053 (map_sub_char_table):
3054 Use bool for boolean.
3055 * character.c (str_to_unibyte): Omit last boolean argument; it was
3056 always 0. All callers changed.
3057 * character.h, charset.h: Adjust to match previous changes.
3058 * character.h (char_printable_p): Remove decl of nonexistent function.
3059 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3060 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3061 are all boolean, so make them single-bit bitfields.
3062
3063 * lisp.h (ASET): Remove attempt to detect side effects.
3064 It was meant to be temporary and it often doesn't work,
3065 because when IDX has side effects the behavior of IDX==IDX
3066 is undefined. See Stefan Monnier in
3067 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3068
3069 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3070
3071 * lisp.h (functionp): New function (extracted from Ffunctionp).
3072 (FUNCTIONP): Use it.
3073 * eval.c (Ffunctionp): Use it.
3074
3075 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3076
3077 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3078 as that's faster and simpler than static storage. Don't bother
3079 with the g_main_context_query overhead if g_main_context_pending
3080 says no events are pending.
3081 (gfds, gfds_size): Remove these static vars.
3082 (xgselect_initialize): Remove; no longer needed.
3083 All uses and decls removed.
3084
3085 * emacs.c (fatal_error_signal_hook): Remove.
3086 All uses removed. This leftover from old code was always 0.
3087
3088 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3089 * casefiddle.c (casify_object, casify_region):
3090 * casetab.c (set_case_table):
3091 * category.c, category.h (word_boundary_p):
3092 * category.h (CHAR_HAS_CATEGORY):
3093 Use bool for booleans, instead of int.
3094
3095 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3096
3097 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3098
3099 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3100
3101 On assertion failure, print backtrace if available.
3102 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3103 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3104 * Makefile.in (LIB_EXECINFO): New macro.
3105 (LIBES): Use it.
3106
3107 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3108 * bytecode.c (exec_byte_code):
3109 * callint.c (check_mark, Fcall_interactively):
3110 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3111 (getenv_internal, sync_process_alive, call_process_exited):
3112 * lisp.h (USE_SAFE_ALLOCA):
3113 Use bool for booleans, instead of int.
3114 * lisp.h, process.h: Adjust prototypes to match above changes.
3115 * callint.c (Fcall_interactively): Don't assume the mark's
3116 offset fits in 'int'.
3117
3118 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3119
3120 * buffer.c, buffer.h: Use bool for boolean.
3121 * buffer.c (reset_buffer_local_variables)
3122 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3123 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3124 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3125 (overlay_touches_p, overlay_strings, Foverlay_put)
3126 (report_overlay_modification, call_overlay_mod_hooks):
3127 (mmap_enlarge, mmap_set_vars):
3128 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3129 Use bool for booleans, instead of int.
3130 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3131 since the 1-or-0 return value is always ignored anyway.
3132 (mmap_initialized_p):
3133 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3134 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3135
3136 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3137
3138 * bidi.c: Use bool for boolean.
3139 This is a bit more readable, and makes the text segment of bidi.o
3140 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3141 Presumably it's faster too.
3142 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3143 Now bool.
3144 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3145 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3146 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3147 (bidi_explicit_dir_char, bidi_level_of_next_char)
3148 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3149 Use bool for booleans, instead of int.
3150 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3151 (bidi_unshelve_cache): Adjust decls to match code.
3152
3153 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3154
3155 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3156 argument.
3157
3158 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3159
3160 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3161 * atimer.h: Include <stdbool.h>.
3162
3163 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3164
3165 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3166 compile time tests instead of run time tests on systems that do
3167 not use them.
3168 (FRAME_MAC_P): Remove leftover from deleted code.
3169 * frame.c (syms_of_frame): Remove leftover from deleted code.
3170
3171 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3172
3173 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3174
3175 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3176
3177 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3178 Otherwise, the compiler complains about (A?B:C) where B is void
3179 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3180 (fontset_add): Return void, for FONTSET_ADD.
3181
3182 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3183
3184 * alloc.c: Use bool for booleans.
3185 (gc_in_progress, abort_on_gc)
3186 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3187 (dont_register_blocks) [GC_MALLOC_CHECK]:
3188 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3189 (check_string_bytes, make_specified_string, memory_full)
3190 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3191 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3192 (mark_stack, valid_pointer_p, make_pure_string)
3193 (Fgarbage_collect, survives_gc_p, gc_sweep):
3194 Use bool for booleans, instead of int.
3195 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3196 Remove unused local.
3197 * alloc.c (PURE_POINTER_P):
3198 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3199 * editfns.c (Fformat):
3200 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3201 (Fdo_auto_save):
3202 * fns.c (sweep_weak_table):
3203 * lisp.h (suppress_checking, push_message, survives_gc_p)
3204 (make_pure_string, gc_in_progress, abort_on_gc):
3205 * lread.c (readchar, read1):
3206 * print.c (Fprin1_to_string):
3207 * xdisp.c (push_message):
3208 Use bool for booleans affected directly or indirectly by
3209 alloc.c's changes.
3210
3211 Make recently-introduced setters macros.
3212 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3213 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3214 (set_fontset_default, set_fontset_fallback): Rename from their
3215 upper-case counterparts, and make them functions rather than macros.
3216 This is more consistent with the other recently-introduced setters.
3217 These don't need to be inline, since they're local.
3218
3219 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3220
3221 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3222 the loop (Bug#12247).
3223
3224 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3225
3226 * lisp.h (vcopy): Use memcpy rather than our own loop.
3227 This fixes a performance regression introduced by the recent
3228 addition of vcopy. This means 'vcopy' will need to be modified
3229 for a copying collector, but that's OK. Also, tighten the
3230 checking in the assertion.
3231
3232 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3233
3234 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3235 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3236 non-base glyph for the width of the base character, according to
3237 what x_draw_composite_glyph_string_foreground expects.
3238 Generate WADJUST value according to composition_gstring_width's
3239 expectations, to produce correct width of the composed character.
3240 Reverse the sign of the DU offset produced by ScriptPlace.
3241
3242 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3243
3244 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3245
3246 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3247
3248 Avoid direct writes to contents member of struct Lisp_Vector.
3249 * lisp.h (vcopy): New function to copy data into vector.
3250 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3251 * fns.c (Ffillarray): Use ASET.
3252 * keyboard.c (timer_check_2): Use AREF and ASET.
3253 (append_tool_bar_item, Frecent_keys): Use vcopy.
3254 * lread.c (read_vector): Use ASET.
3255 * msdos.c (Frecent_doskeys): Use vcopy.
3256 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3257 (Finternal_merge_in_global_face): Use ASET and vcopy.
3258 * xfont.c (xfont_list_pattern): Likewise.
3259
3260 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3261
3262 * window.c (Fwindow_point): For the selected window always return
3263 the position of its buffer's point.
3264 (Fset_window_point): For the selected window always go in its
3265 buffer to the specified position.
3266
3267 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3268
3269 Setter macros for fontsets.
3270 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3271 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3272 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3273 Adjust users.
3274
3275 2012-08-20 Glenn Morris <rgm@gnu.org>
3276
3277 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3278 Don't assume that `ln -f' works.
3279
3280 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3281
3282 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3283 and later about non-assignments with no effect. See discussion at
3284 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3285 details.
3286
3287 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3288
3289 Inline setter functions for Lisp_Objects slots of struct specbinding.
3290 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3291 Adjust users.
3292
3293 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3294
3295 * window.c (select_window): Always make selected window's buffer
3296 current.
3297
3298 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3299
3300 Use AREF and ASET for docstrings of category tables.
3301 * category.h (CATEGORY_DOCSTRING): Use AREF.
3302 (SET_CATEGORY_DOCSTRING): Use ASET.
3303 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3304
3305 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3306
3307 Inline setter functions for hash table members.
3308 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3309 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3310 (set_hash_key_and_value, set_hash_index, set_hash_next)
3311 (set_hash_hash): New functions.
3312 * charset.c, fns.c: Adjust users.
3313
3314 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3315
3316 Inline getter and setter functions for per-buffer values.
3317 * buffer.h (per_buffer_default, set_per_buffer_default)
3318 (per_buffer_value, set_per_buffer_value): New functions.
3319 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3320 * buffer.c, data.c: Adjust users.
3321
3322 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3323
3324 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3325
3326 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3327
3328 Rely on <config.h> + <unistd.h> to declare 'environ',
3329 as gnulib does this if the system doesn't.
3330 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3331 Remove declaration. MS-Windows declares it on stdlib.h which is
3332 included by conf_post.h.
3333 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3334 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3335 * vm-limit.c: Include <unistd.h>, for 'environ'.
3336
3337 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3338 (start_of_data): Remove decl; mem-limits.h provides it.
3339
3340 * xdisp.c (handle_invisible_prop): Make it a bit faster
3341 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3342
3343 2012-08-19 Chong Yidong <cyd@gnu.org>
3344
3345 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3346 ends (Bug#3874).
3347
3348 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3349
3350 * .gdbinit: Use call instead of set when calling a function in the
3351 inferior.
3352
3353 * data.c (set_internal): Don't use set_blv_found.
3354 (Fkill_local_variable): Likewise.
3355
3356 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3357
3358 * nsfont.m (ns_ascii_average_width): Ensure the string
3359 ascii_printable is initialized with a null-terminated character
3360 array. Otherwise, it can contain undesired extra characters.
3361
3362 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3363
3364 port new setting code to Sun C 5.8 2005/10/13
3365 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3366 Return void, not Lisp_Object. Otherwise, the compiler
3367 complains about (A?B:C) where B is void and C is Lisp_Object
3368 when compiling CHAR_TABLE_SET, due to the recent change to
3369 the API of sub_char_table_set_contents.
3370
3371 2012-08-18 Chong Yidong <cyd@gnu.org>
3372
3373 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3374 for the string case (Bug#3874).
3375
3376 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3377
3378 * buffer.h (BSET): Remove (Bug#12215).
3379 Replace all uses with calls to new setter functions.
3380 (bset_bidi_paragraph_direction, bset_case_canon_table)
3381 (bset_case_eqv_table, bset_directory, bset_display_count)
3382 (bset_display_time, bset_downcase_table)
3383 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3384 (bset_last_selected_window, bset_local_var_alist)
3385 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3386 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3387 (bset_width_table):
3388 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3389 (bset_auto_fill_function, bset_auto_save_file_format)
3390 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3391 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3392 (bset_cache_long_line_scans, bset_case_fold_search)
3393 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3394 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3395 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3396 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3397 (bset_header_line_format, bset_indicate_buffer_boundaries)
3398 (bset_indicate_empty_lines, bset_invisibility_spec)
3399 (bset_left_fringe_width, bset_major_mode, bset_mark)
3400 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3401 (bset_name, bset_overwrite_mode, bset_pt_marker)
3402 (bset_right_fringe_width, bset_save_length)
3403 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3404 (bset_scroll_up_aggressively, bset_selective_display)
3405 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3406 (bset_word_wrap, bset_zv_marker):
3407 * category.c (bset_category_table):
3408 * syntax.c (bset_syntax_table):
3409 New setter functions.
3410
3411 * process.h (PSET): Remove (Bug#12215).
3412 Replace all uses with calls to new setter functions.
3413 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3414 (PROCESS_INLINE): New macro.
3415 (pset_childp): New setter function.
3416 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3417 * process.c (PROCESS_INLINE):
3418 Define to EXTERN_INLINE, so that the corresponding functions
3419 are compiled into code.
3420 (pset_buffer, pset_command, pset_decode_coding_system)
3421 (pset_decoding_buf, pset_encode_coding_system)
3422 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3423 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3424 (pset_type, pset_write_queue): New setter functions.
3425
3426 * window.h (WSET): Remove (Bug#12215).
3427 Replace all uses with calls to new setter functions.
3428 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3429 (WINDOW_INLINE): New macro.
3430 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3431 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3432 (wset_total_lines, wset_vertical_scroll_bar)
3433 (wset_window_end_pos, wset_window_end_valid)
3434 (wset_window_end_vpos): New setter functions.
3435 * window.c (WINDOW_INLINE):
3436 Define to EXTERN_INLINE, so that the corresponding functions
3437 are compiled into code.
3438 (wset_combination_limit, wset_dedicated, wset_display_table)
3439 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3440 (wset_new_normal, wset_new_total, wset_next_buffers)
3441 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3442 (wset_prev_buffers, wset_right_fringe_width)
3443 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3444 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3445 (wset_window_parameters):
3446 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3447 (wset_column_number_displayed, wset_region_showing):
3448 New setter functions.
3449
3450 * termhooks.h (TSET): Remove (Bug#12215).
3451 Replace all uses with calls to new setter functions.
3452 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3453 (TERMHOOKS_INLINE): New macro.
3454 (tset_charset_list, tset_selection_alist): New setter functions.
3455 * terminal.c (TERMHOOKS_INLINE):
3456 Define to EXTERN_INLINE, so that the corresponding functions
3457 are compiled into code.
3458 (tset_param_alist): New setter function.
3459
3460 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3461
3462 * keyboard.h (KSET): Remove (Bug#12215).
3463 Replace all uses with calls to new setter functions.
3464 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3465 (KEYBOARD_INLINE): New macro.
3466 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3467 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3468 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3469 New setter functions.
3470 * keyboard.c (KEYBOARD_INLINE):
3471 Define to EXTERN_INLINE, so that the corresponding functions
3472 are compiled into code.
3473 (kset_echo_string, kset_kbd_queue)
3474 (kset_keyboard_translate_table, kset_last_prefix_arg)
3475 (kset_last_repeatable_command, kset_local_function_key_map)
3476 (kset_overriding_terminal_local_map, kset_real_last_command)
3477 (kset_system_key_syms): New setter functions.
3478
3479 * frame.h (FSET): Remove (Bug#12215).
3480 Replace all uses with calls to new setter functions.
3481 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3482 (FRAME_INLINE): New macro.
3483 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3484 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3485 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3486 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3487 (fset_param_alist, fset_root_window, fset_scroll_bars)
3488 (fset_selected_window, fset_title, fset_tool_bar_items)
3489 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3490 * frame.c (FRAME_INLINE):
3491 Define to EXTERN_INLINE, so that the corresponding functions
3492 are compiled into code.
3493 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3494
3495 A few more naming-convention fixes for getters and setters.
3496 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3497 and rename from buffer_overlays_set_before.
3498 (set_buffer_overlays_after): Move here from buffer.h, and rename
3499 from buffer_overlays_set_after.
3500 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3501 All uses changed.
3502 (set_buffer_intervals): Rename from buffer_set_intervals.
3503 * intervals.c (set_interval_object): Move here from intervals.h,
3504 and rename from interval_set_object.
3505 (set_interval_left): Move here from intervals.h, and rename from
3506 interval_set_left.
3507 (set_interval_right): Move here from intervals.h, and rename from
3508 interval_set_right.
3509 (copy_interval_parent): Move here from intervals.h, and rename from
3510 interval_copy_parent.
3511 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3512 (set_interval_plist): Rename from interval_set_plist.
3513 Return void, not Lisp_Object, since no caller uses the result.
3514 * lisp.h (string_intervals): Rename from string_get_intervals.
3515 (set_string_intervals): Rename from string_set_intervals.
3516
3517 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3518 (set_char_table_contents): Rename from char_table_set_contents.
3519 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3520 All uses changed. See the end of
3521 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3522
3523 * lisp.h (CSET): Remove (Bug#12215).
3524 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3525 (set_char_table_purpose): New functions,
3526 replacing CSET. All uses changed. For example, replace
3527 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3528 "set_char_table_parent (char_table, parent);".
3529 The old version was confusing because it used the same name
3530 'parent' for two different things.
3531
3532 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3533
3534 Functions to get and set Lisp_Object fields of buffer-local variables.
3535 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3536 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3537 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3538 * data.c, eval.c, frame.c: Adjust users.
3539
3540 2012-08-17 Chong Yidong <cyd@gnu.org>
3541
3542 * xfaces.c (merge_face_vectors): If the target font specfies a
3543 font spec, make the font's attributes take precedence over
3544 directly-specified attributes.
3545 (merge_face_ref): Recognize :font.
3546
3547 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3548
3549 Do not use memcpy for copying intervals.
3550 * intervals.c (reproduce_interval): New function.
3551 (reproduce_tree, reproduce_tree_obj): Use it.
3552 (reproduce_tree_obj): Remove prototype.
3553
3554 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3555
3556 * lisp.h (duration_to_sec_usec): Remove unused decl.
3557
3558 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3559
3560 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3561 to an allocated instance of NSString, not to the class itself.
3562
3563 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3564
3565 * makefile.w32-in (C_CTYPE_H): New macro.
3566 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3567 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3568 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3569
3570 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3571
3572 Use ASCII tests for character types.
3573 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3574 * xfns.c, xterm.c:
3575 Don't include <ctype.h>; was not needed.
3576 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3577 * sysdep.c, xfaces.c:
3578 Include <c-ctype.h> instead of <ctype.h>.
3579 * nsterm.m: Include <c-ctype.h>.
3580 * charset.c (read_hex):
3581 * doc.c (Fsnarf_documentation):
3582 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3583 (DRIVE_LETTER) [DOS_NT]:
3584 (Ffile_name_directory, Fexpand_file_name)
3585 (Fsubstitute_in_file_name):
3586 * font.c (font_parse_xlfd, font_parse_fcname):
3587 * frame.c (x_set_font_backend):
3588 * gtkutil.c (xg_get_font):
3589 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3590 * nsimage.m (hexchar):
3591 * nsterm.m (ns_xlfd_to_fontname):
3592 * sysdep.c (system_process_attributes):
3593 * xfaces.c (hash_string_case_insensitive):
3594 Use C-locale tests instead of locale-specific tests for character
3595 types, since we want the ASCII interpretation here, not the
3596 interpretation suitable for whatever happens to be the current locale.
3597
3598 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3599
3600 Consistently check windows for validity/liveness
3601 (Bug#11984, Bug#12025, Bug#12026).
3602 * lisp.h (CHECK_VALID_WINDOW): New macro.
3603 * window.c (decode_window): Rename to decode_live_window.
3604 (decode_valid_window, Fwindow_valid_p): New functions.
3605 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3606 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3607 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3608 (Fwindow_prev_sibling, Fwindow_combination_limit)
3609 (Fset_window_combination_limit, Fwindow_use_time)
3610 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3611 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3612 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3613 (Fwindow_hscroll, Fset_window_hscroll)
3614 (Fwindow_redisplay_end_trigger)
3615 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3616 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3617 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3618 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3619 (Fwindow_end, Fset_window_point, Fset_window_start)
3620 (Fpos_visible_in_window_p, Fwindow_line_height)
3621 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3622 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3623 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3624 (Fset_window_parameter, Fwindow_display_table)
3625 (Fset_window_display_table, Fdelete_other_windows_internal)
3626 (Fset_window_buffer, Fset_window_new_total)
3627 (Fset_window_new_normal, Fdelete_window_internal)
3628 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3629 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3630 (Fwindow_scroll_bars): Check whether argument window is a valid or
3631 live window. Update doc-strings.
3632 (syms_of_window): New symbol Qwindow_valid_p.
3633 * keyboard.c (Fposn_at_x_y): Check whether argument
3634 frame_or_window denotes a valid window.
3635
3636 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3637
3638 Fix previous char table change.
3639 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3640 * chartab.c (optimize_sub_char_table): Likewise.
3641
3642 2012-08-16 Chong Yidong <cyd@gnu.org>
3643
3644 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3645
3646 * xfont.c (xfont_open):
3647 * xftfont.c (xftfont_open): Set the font's max_width field.
3648
3649 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3650 min_width to space_width and average_width to the average over
3651 printable ASCII characters.
3652 (ns_char_width): Code cleanup.
3653 (ns_ascii_average_width): New utility function.
3654
3655 * font.h (struct font): Update comments.
3656
3657 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3658
3659 Simple interface to set Lisp_Object fields of character tables.
3660 * lisp.h (CSET): New macro.
3661 (char_table_set_extras, char_table_set_contents)
3662 (sub_char_table_set_contents): New function.
3663 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3664 * syntax.c: Adjust users.
3665
3666 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3667
3668 * eval.c (eval_sub): Bind lexical-binding.
3669 * lread.c (Qlexical_binding): Make non-static.
3670
3671 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3672
3673 * nsmenu.m (popupSession): Remove.
3674 (pop_down_menu): Remove endModalSession.
3675 (timeout_handler:): New method.
3676 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3677 Call runModalForWindow. Check timer_fired when it returns.
3678 If not set, cancel timer and break out of loop.
3679 Otherwise loop again, with a new timeout.
3680
3681 * nsterm.m: Include fcntl.h if present.
3682 (fd_entry, t_readfds, inNsSelect): Remove.
3683 (select_writefds, select_valid, select_timeout, selfds)
3684 (select_mutex, apploopnr): Add.
3685 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3686 Otherwise call kbd_buffer_store_event.
3687 (ns_send_appdefined): Remove release of fd_entry.
3688 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3689 Increment and decrement apploopnr.
3690 (ns_select): If no file descriptors, just do a NSTimer.
3691 Otherwise copy read/write masks and start select thread (fd_handler).
3692 Start main loop and wait for application defined event.
3693 Inform select thread to stop selecting after main loop is exited.
3694 (ns_term_init): Create selfds pipe and set non-blocking.
3695 Initialize select_mutex. Start the select thread (fd_handler).
3696 (fd_handler:): Loop forever, wait for info from the main thread
3697 to either start or stop selecting. When select returns, send
3698 and appdefined event.
3699 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3700 If not call kbd_buffer_store_event.
3701
3702 * nsterm.h (EmacsApp): fd_handler takes id argument.
3703 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3704
3705 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3706
3707 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3708
3709 * region-cache.c (move_cache_gap): Update gap_len using the actual
3710 growth of the boundaries array. Do not change cache_len.
3711 (Bug#12196)
3712
3713 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3714
3715 Generalize and cleanup font subsystem checks.
3716 * font.h (FONT_DEBUG, font_assert): Remove.
3717 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3718 Change font_assert to eassert. Use eassert where appropriate.
3719
3720 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3721
3722 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3723
3724 2012-08-15 Chong Yidong <cyd@gnu.org>
3725
3726 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3727 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3728 extract the font descriptor instead of just the font name.
3729 In that case, return a font spec instead of a string.
3730 (x_last_font_name): Move to this file from xfns.c.
3731
3732 * xfns.c (Fx_select_font): The return value can also be a font
3733 spec. Move x_last_font_name management to gtkutil.c.
3734
3735 * xfaces.c: Make font weight and style symbols non-static.
3736
3737 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3738
3739 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3740 (bug#12117).
3741
3742 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3743
3744 * alloc.c (Fgarbage_collect): Use plural form consistently.
3745
3746 2012-08-14 Eli Zaretskii <eliz@gnu.org>
3747
3748 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3749 iteration through the command loop. Fixes a problem whereby mouse
3750 movements are ignored until the first mouse click.
3751
3752 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3753
3754 Use bool, not int, for Lisp booleans.
3755 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3756 makes Emacs a bit smaller and presumably a bit faster.
3757 * lisp.h: Include <stdbool.h>.
3758 (struct Lisp_Boolfwd, defvar_bool):
3759 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3760 * regex.c [!emacs]: Include <stdbool.h>.
3761 (false, true): Remove; <stdbool.h> does this for us now.
3762
3763 2012-08-14 Chong Yidong <cyd@gnu.org>
3764
3765 * character.c (Fcharacterp): Doc fix (Bug#12076).
3766
3767 * data.c (Findirect_variable): Doc fix (Bug#11040).
3768
3769 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3770
3771 * editfns.c (Fformat): Doc fix (Bug#12059).
3772 (Fsave_current_buffer): Doc fix (Bug#11542).
3773
3774 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3775
3776 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3777 (bug#12022).
3778
3779 2012-08-14 Martin Rudalics <rudalics@gmx.at>
3780
3781 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3782 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3783 * minibuf.c (choose_minibuf_frame, read_minibuf):
3784 * w32fns.c (x_create_tip_frame):
3785 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3786 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3787
3788 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3789
3790 * intervals.c (offset_intervals): Remove obsolete comment.
3791
3792 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3793
3794 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3795
3796 2012-08-14 Gergely Risko <gergely@risko.hu>
3797
3798 * coding.c (decode_coding): Record buffer modification before
3799 disabling undo_list (Bug#11773).
3800
3801 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3802
3803 Revert and cleanup some recent overlay changes.
3804 * buffer.h (enum overlay_type): Remove.
3805 (buffer_get_overlays, buffer_set_overlays): Likewise.
3806 (buffer_set_overlays_before, buffer_set_overlays_after):
3807 New function. Adjust users.
3808 (unchain_both): Add eassert.
3809
3810 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3811
3812 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3813
3814 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3815
3816 * gtkutil.c (xg_mark_data): Don't assume C99.
3817
3818 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3819
3820 * gtkutil.c (xg_frame_tb_info): New struct.
3821 (TB_INFO_KEY): New define.
3822 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3823 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3824 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3825 if not present.
3826 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3827 is up to date. Otherwise store new data.
3828 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3829
3830 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3831
3832 Use KSET for write access to Lisp_Object members of struct kboard.
3833 * keyboard.h (KSET): New macro.
3834 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3835 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3836 * xterm.c: Adjust users.
3837
3838 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3839
3840 Use BSET for write access to Lisp_Object members of struct buffer.
3841 * buffer.h (BSET): New macro.
3842 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3843 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3844 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3845 * window.c, xdisp.c, xfns.c: Adjust users.
3846
3847 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3848
3849 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3850
3851 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3852
3853 * nsterm.m (not_in_argv): New function.
3854 (application:openFile, application:openTempFile:):
3855 (application:openFileWithoutUI:, application:openFiles:): Open file
3856 if not_in_argv returns non-zero (bug#12171).
3857
3858 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3859 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3860 Define for Gtk+ versions less than 3.2.
3861 (xg_get_font_name): Use those functions/macros here.
3862 Reported by Frans Oilinki <moilinki@gmail.com>.
3863
3864 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3865
3866 * unexmacosx.c (copy_data_segment): Copy initialized data in
3867 statically linked libraries from input file rather than memory.
3868
3869 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3870 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3871 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3872
3873 2012-08-10 Glenn Morris <rgm@gnu.org>
3874
3875 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3876 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3877
3878 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3879
3880 Fix last change to allow compilation with low optimization levels.
3881 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3882 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3883
3884 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3885
3886 Use common inline syntax in intervals.h.
3887 * intervals.h (INTERVALS_INLINE): New macro.
3888 Change all users from LISP_INLINE.
3889
3890 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3891
3892 Define Qnone once for all platforms.
3893 * frame.c (Qnone): Define here.
3894 (syms_of_frame): DEFSYM it.
3895 * lisp.h (Qnone): New declaration.
3896 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3897 * xfns.c: Remove duplication. Adjust users.
3898
3899 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3900
3901 Remove unused macros from intervals.h.
3902 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3903 * intervals.c: Adjust comment.
3904
3905 2012-08-10 Eli Zaretskii <eliz@gnu.org>
3906
3907 * w32fns.c <w32_unicode_gui>: New static variable.
3908 (globals_of_w32fns): Initialize it according to os_subtype.
3909 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3910 testing os_subtype.
3911
3912 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
3913 Eli Zaretskii <eliz@gnu.org>
3914
3915 Fix bug #10299 with Unicode characters sent by customized
3916 keyboards created by MSKLC.
3917 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3918 (w32_init_class): Use it to initialize the Emacs class with either
3919 ANSI or Unicode API calls.
3920 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3921 later.
3922 (w32_wnd_proc): If the character code sent by WM_CHAR or
3923 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3924 original message. Call DefWindowProcW on NT and later.
3925
3926 2012-08-10 Glenn Morris <rgm@gnu.org>
3927
3928 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3929
3930 * lisp.h (DIRECTORY_SEP): Let configure set it.
3931
3932 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3933
3934 Use TSET for write access to Lisp_Object slots of struct terminal.
3935 * termhooks.h (TSET): New macro.
3936 * coding.c, terminal.c, xselect.c: Adjust users.
3937
3938 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3939
3940 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3941 the failing expression, include them in the error message.
3942 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3943 * lisp.h (internal_condition_case_n): Update declaration.
3944
3945 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3946
3947 Inline functions to examine and change buffer overlays.
3948 * buffer.c (unchain_both): New function.
3949 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3950 (buffer_has_overlays): New function.
3951 (enum overlay_type): New enum.
3952 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3953 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3954
3955 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3956
3957 Inline functions to examine and change buffer intervals.
3958 * alloc.c (mark_interval_tree): Remove.
3959 (MARK_INTERVAL_TREE): Simplify.
3960 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3961 * intervals.c (buffer_balance_intervals): New function.
3962 (graft_intervals_into_buffer): Adjust indentation.
3963 (set_intervals_multibyte): Simplify.
3964 * buffer.h (BUF_INTERVALS): Remove.
3965 (buffer_get_intervals, buffer_set_intervals): New function.
3966 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3967 * intervals.c, textprop.c: Adjust users.
3968
3969 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3970
3971 Inline functions to examine and change string intervals.
3972 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3973 (string_get_intervals, string_set_intervals): New function.
3974 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3975 * lread.c, print.c, textprop.c: Adjust users.
3976
3977 2012-08-08 Glenn Morris <rgm@gnu.org>
3978
3979 * lisp.mk (lisp): Remove language/persian.elc.
3980
3981 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3982
3983 Cleanup intervals.
3984 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3985 (NULL_INTERVAL_P): Likewise. Adjust users.
3986 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3987 Adjust comment. Move under #if 0.
3988 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3989 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3990
3991 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3992
3993 Check total length of intervals with eassert.
3994 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3995 * intervals.c: Change all users to eassert.
3996
3997 2012-08-07 Eli Zaretskii <eliz@gnu.org>
3998
3999 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4000 Rename fields to match removal of FGET and WGET and disuse of
4001 INTERNAL_FIELD in Lisp_Cons.
4002
4003 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4004
4005 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4006 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4007 name since all xname users are fixed long time ago. Do not
4008 use INTERNAL_FIELD.
4009 (set_symbol_name, set_symbol_function, set_symbol_plist):
4010 (set_symbol_next, set_overlay_plist): New function.
4011 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4012 (struct Lisp_Overlay): Likewise.
4013 (CVAR, MVAR, SVAR): Remove.
4014 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4015 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4016 * xterm.c: Adjust users.
4017 * .gdbinit: Change to use name field of struct Lisp_Symbol
4018 where appropriate.
4019
4020 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4021
4022 Basic functions to set Lisp_Object and pointer slots of intervals.
4023 * intervals.h (interval_set_parent, interval_set_object):
4024 (interval_set_left, interval_set_right, interval_set_plist):
4025 (interval_copy_parent): New function.
4026 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4027 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4028 Adjust indentation.
4029 (INTERVAL_SIZE): Remove. Adjust users.
4030 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4031
4032 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4033
4034 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4035 * process.h (PGET): Remove.
4036 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4037 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4038
4039 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4040
4041 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4042 * window.h (WGET): Remove.
4043 (struct window): Do not use INTERNAL_FIELD.
4044 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4045 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4046 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4047 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4048 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4049 Adjust users.
4050
4051 2012-08-07 Chong Yidong <cyd@gnu.org>
4052
4053 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4054 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4055 (Fdelete_window_internal): Signal an error if the window is not on
4056 a live frame (Bug#12025).
4057
4058 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4059
4060 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4061 * frame.h (FGET): Remove.
4062 (struct frame): Do not use INTERNAL_FIELD.
4063 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4064 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4065 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4066 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4067
4068 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4069
4070 * w32.c: Silence compiler warnings.
4071 (map_w32_filename): Remove unused variable `is_fat'.
4072 (chase_symlinks): Add parentheses around expression.
4073
4074 2012-08-06 Glenn Morris <rgm@gnu.org>
4075
4076 * sysdep.c: Respect BROKEN_GETWD.
4077
4078 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4079 Let configure handle it.
4080 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4081
4082 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4083
4084 Use GCALIGNMENT where appropriate.
4085 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4086 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4087 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4088
4089 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4090
4091 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4092 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4093
4094 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4095
4096 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4097 that should be sufficient for everyone.
4098
4099 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4100
4101 * keyboard.c (timer_check_2): Add break so timer_check returns next
4102 timeout.
4103
4104 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4105
4106 Fix Windows build errors introduced after converting to WGET and WSET.
4107 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4108 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4109
4110 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4111
4112 * nsterm.m (ns_frame_rehighlight): Use FSET.
4113
4114 * nsmenu.m (ns_update_menubar): Use FSET.
4115
4116 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4117
4118 Separate read and write access to Lisp_Object slots of Lisp_Process.
4119 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4120 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4121
4122 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4123
4124 Separate read and write access to Lisp_Object slots of struct window.
4125 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4126 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4127 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4128 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4129 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4130 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4131 Adjust users.
4132
4133 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4134
4135 Fix Windows build errors introduced after converting to FGET and FSET.
4136 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4137 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4138 (w32_judge_scroll_bars): Change to use FSET.
4139 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4140
4141 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4142
4143 Fix replacement typo.
4144 * window.c (replace_window): Set root_window instead of
4145 selected_window. This fixes a total window subsystem
4146 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4147
4148 2012-08-06 Glenn Morris <rgm@gnu.org>
4149
4150 * lisp.mk (lisp): Add language/persian.elc.
4151
4152 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4153
4154 Separate read and write access to Lisp_Object slots of struct frame.
4155 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4156 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4157 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4158 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4159 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4160
4161 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4162
4163 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4164
4165 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4166
4167 Generalize common compile-time constants.
4168 * lisp.h (header_size, bool_header_size, word_size): Now here.
4169 (struct Lisp_Vector): Add comment.
4170 (struct Lisp_Bool_Vector): Move up to define handy constants.
4171 (VECSIZE, PSEUDOVECSIZE): Simplify.
4172 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4173 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4174 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4175 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4176 * xfont.c, xmenu.c: Use word_size where appropriate.
4177
4178 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4179
4180 * search.c (Freplace_match): Treat \? in the replacement text
4181 literally (Bug#8161).
4182
4183 2012-08-05 Chong Yidong <cyd@gnu.org>
4184
4185 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4186 * frame.c (Vdelete_frame_functions):
4187 * emacs.c (Vkill_emacs_hook): Doc fix.
4188
4189 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4190
4191 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4192 --with-x-toolkit=no builds.
4193 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4194
4195 2012-08-04 Chong Yidong <cyd@gnu.org>
4196
4197 * syntax.c (Fmodify_syntax_entry): Doc fix.
4198
4199 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4200
4201 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4202 * w32.c (init_environment): Change the default values of many
4203 environment variables in dflt_envvars[] to NULL, to avoid pushing
4204 them into environment when they were not already defined.
4205 Remove the code that deletes site-lisp subdirectories from the default
4206 value of EMACSLOADPATH, as it is no longer needed.
4207 (check_windows_init_file): Now external, not static.
4208 Use Vload_path as is, without adding anything, as this function is now
4209 called when Vload_path is already set up.
4210
4211 * w32.h (check_windows_init_file): Add prototype.
4212
4213 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4214 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4215 compatibility with Posix platforms.
4216 (main): Move the call to check_windows_init_file to here from
4217 w32.c.
4218 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4219 any, in the DEFALT argument into the root of the Emacs build or
4220 installation tree, as appropriate.
4221
4222 * callproc.c (init_callproc_1): Call decode_env_path instead of
4223 doing its equivalent by hand.
4224 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4225 the code that sets Vexec_path run on MS-Windows.
4226
4227 * lread.c (init_lread): Add comments to #ifdef's.
4228
4229 * msdos.c (dos_set_window_size, IT_update_begin)
4230 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4231 instead of direct references.
4232
4233 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4234
4235 Export DEFAULT_REHASH_* to GDB.
4236 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4237 Now constants, not macros.
4238
4239 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4240
4241 Remove unnecessary casts involving pointers.
4242 These casts are no longer needed now that we assume C89 or later,
4243 since they involve casting to or from void *.
4244 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4245 (make_pure_float, make_pure_vector):
4246 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4247 * macros.c (Fstart_kbd_macro):
4248 * menu.c (find_and_return_menu_selection):
4249 * minibuf.c (read_minibuf_noninteractive):
4250 * sysdep.c (closedir):
4251 * xdisp.c (x_produce_glyphs):
4252 * xfaces.c (compare_fonts_by_sort_order):
4253 * xfns.c (x_real_positions, select_visual):
4254 * xselect.c (x_stop_queuing_selection_requests)
4255 (x_get_window_property, x_get_window_property_as_lisp_data):
4256 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4257 Remove unnecessary pointer casts.
4258 * alloc.c (record_xmalloc): New function.
4259 * lisp.h (record_xmalloc): New decl.
4260 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4261 more like a function. This is because the pointer cast is not
4262 needed. All uses changed.
4263 * print.c (print_string, print_error_message): Avoid length recalc.
4264
4265 Improve fix for macroexp crash with debugging (Bug#12118).
4266 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4267 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4268 not supposed to be invoked from the garbage collector.
4269 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4270 (gc_aset): New function, which is like ASET but can be
4271 used in the garbage collector.
4272 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4273 (set_hash_index): Use it instead of ASET.
4274
4275 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4276
4277 Support symlinks on latest versions of MS-Windows.
4278 * w32.c: Include winioctl.h and aclapi.h.
4279 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4280 (revert_to_self): Forward declarations of static functions.
4281 <static BOOL g_b_init_get_security_info>:
4282 <g_b_init_create_symbolic_link>: New static flags.
4283 (globals_of_w32): Initialize them to zero.
4284 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4285 (map_w32_filename): Improve commentary. Simplify switch.
4286 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4287 headers (most versions of MinGW w32api don't).
4288 (get_security_info, create_symbolic_link)
4289 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4290 New functions.
4291 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4292 in the argument file name.
4293 (sys_access): Call unc_volume_file_attributes only if
4294 GetFileAttributes fails with network-related error codes.
4295 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4296 have the required privileges.
4297 (get_file_security_desc_by_name): Rename from
4298 get_file_security_desc.
4299 (stat_worker): New function, with most of the guts of 'stat', and
4300 with addition of handling of symlinks and support for 'lstat'.
4301 If possible, get file's attributes and security information by
4302 handle, not by name. Produce S_IFLNK bit for symlinks, when
4303 called from 'lstat'.
4304 (stat, lstat): New functions, call 'stat_worker'.
4305 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4306 symlinks when the underlying filesystem supports them.
4307
4308 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4309
4310 Fix macroexp crash on Windows with debugging (Bug#12118).
4311 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4312 checking subscripts; problem introduced with the recent
4313 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4314 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4315 since it's used in non-static inline functions now.
4316
4317 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4318 Don't assume buffer size fits in 'int'. Remove unused local.
4319
4320 Use C99-style 'extern inline' if available.
4321 * buffer.h (BUFFER_INLINE):
4322 * category.h (CATEGORY_INLINE):
4323 * character.h (CHARACTER_INLINE):
4324 * charset.h (CHARSET_INLINE):
4325 * composite.h (COMPOSITE_INLINE):
4326 * dispextern.h (DISPEXTERN_INLINE):
4327 * lisp.h (LISP_INLINE):
4328 * systime.h (SYSTIME_INLINE):
4329 New macro, replacing 'static inline' in this header.
4330 * buffer.h, category.h, character.h, charset.h, composite.h:
4331 * dispextern.h, lisp.h, systime.h:
4332 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4333 * alloc.c (LISP_INLINE):
4334 * buffer.c (BUFFER_INLINE):
4335 * category.c (CATEGORY_INLINE):
4336 * character.c (CHARACTER_INLINE):
4337 * charset.c (CHARSET_INLINE):
4338 * composite.c (COMPOSITE_INLINE):
4339 * dispnew.c (DISPEXTERN_INLINE):
4340 * sysdep.c (SYSTIME_INLINE):
4341 Define to EXTERN_INLINE, so that the corresponding functions
4342 are compiled into code.
4343 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4344 (INLINE_HEADER_END): New macros.
4345 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4346 since it's used in non-static inline functions now.
4347 (VALMASK) [!USE_LSB_TAG]: Likewise.
4348
4349 2012-08-02 Glenn Morris <rgm@gnu.org>
4350
4351 * s/: Remove empty directory.
4352
4353 * s/ms-w32.h: Move to ../nt/inc.
4354 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4355 Update for new ms-w32.h location.
4356
4357 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4358
4359 Port to Solaris 8.
4360 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4361
4362 2012-08-02 Glenn Morris <rgm@gnu.org>
4363
4364 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4365 hard-coding the path separator.
4366
4367 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4368
4369 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4370 This how ASET and AREF are supposed to work, and makes
4371 it easier to think about future improvements. See
4372 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4373 * charset.h (set_charset_attr): New function.
4374 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4375 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4376 (aref_addr): New function. All uses of &AREF(...) changed.
4377 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4378 (set_hash_index): New functions. All lvalue-style uses of
4379 HASH_KEY etc. changed.
4380 * keyboard.c (set_prop): New function. All lvalue-style uses
4381 of PROP changed.
4382
4383 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4384
4385 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4386 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4387 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4388 * nsfns.m (ns_set_name_as_filename): Likewise.
4389 * nsmenu.m (ns_update_menubar): Likewise.
4390 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4391
4392 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4393
4394 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4395 Adapt to latest changes in field names of the corresponding Lisp
4396 objects.
4397
4398 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4399
4400 2012-08-01 Glenn Morris <rgm@gnu.org>
4401
4402 * s/msdos.h: Remove file.
4403 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4404 * Makefile.in (S_FILE): Remove.
4405 (config_h): Remove S_FILE.
4406
4407 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4408
4409 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4410 Remove; moved to nt/config.nt.
4411
4412 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4413
4414 Use INTERNAL_FIELD for conses and overlays.
4415 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4416 Remove obsolete comment.
4417 (MVAR): New macro.
4418 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4419 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4420
4421 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4422
4423 Use INTERNAL_FIELD for symbols.
4424 * lisp.h (SVAR): New macro. Adjust users.
4425 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4426 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4427
4428 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4429
4430 Use INTERNAL_FIELD for processes.
4431 * process.h (PVAR): New macro. Adjust style.
4432 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4433 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4434
4435 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4436
4437 Use INTERNAL_FIELD for windows.
4438 * window.h (WVAR): New macro.
4439 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4440 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4441 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4442 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4443 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4444 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4445
4446 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4447
4448 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4449
4450 2012-08-01 Glenn Morris <rgm@gnu.org>
4451
4452 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4453 Move to configure.ac.
4454
4455 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4456
4457 * makefile.w32-in (CONFIG_H): Update dependencies.
4458 (CONF_POST_H): New macro.
4459
4460 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4461
4462 2012-07-31 Glenn Morris <rgm@gnu.org>
4463
4464 * Makefile.in (S_FILE): No longer set by configure.
4465
4466 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4467 is available.
4468 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4469
4470 * process.h (NULL_DEVICE):
4471 * emacs.c (SEPCHAR):
4472 * editfns.c (USER_FULL_NAME): Let configure set them.
4473
4474 * s/README, s/template.h: Remove files.
4475
4476 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4477
4478 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4479 Move to configure.ac.
4480
4481 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4482
4483 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4484 resulting renaming of 'struct frame' members.
4485
4486 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4487
4488 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4489 after introduction of FVAR.
4490
4491 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4492
4493 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4494
4495 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4496 instead of compositeToPoint.
4497 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4498
4499 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4500
4501 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4502
4503 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4504 * lisp.h (INTERNAL_FIELD): New macro.
4505 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4506 (BVAR): Change to use INTERNAL_FIELD.
4507 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4508 (KVAR): Change to use INTERNAL_FIELD.
4509 * frame.h (FVAR): New macro.
4510 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4511 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4512 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4513 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4514 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4515
4516 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4517
4518 Miscellaneous fixes for non-default X toolkits.
4519 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4520 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4521 Move under #ifdef USE_LUCID.
4522 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4523 definition and usage to avoid warnings.
4524
4525 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4526
4527 * nsterm.m (openFiles): Fix previous checkin.
4528
4529 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4530
4531 * indent.c (compute_motion): Remove unused local.
4532
4533 2012-07-31 Glenn Morris <rgm@gnu.org>
4534
4535 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4536
4537 * conf_post.h [USG5_4]:
4538 Move remaining contents of s/usg5-4-common.h here.
4539 * s/usg5-4-common.h: Remove file.
4540
4541 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4542 * s/irix6-5.h: Remove file.
4543
4544 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4545 * s/darwin.h: Remove file.
4546
4547 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4548 * s/hpux10-20.h: Remove file, which is now empty.
4549
4550 2012-07-30 Glenn Morris <rgm@gnu.org>
4551
4552 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4553 * Makefile.in (config_h): Add conf_post.h.
4554 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4555
4556 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4557
4558 * nsterm.m (ns_do_open_file): New variable.
4559 (ns_term_init): Set ns_do_open_file to YES after run returns.
4560 (openFile, openTempFile, openFileWithoutUI, openFiles):
4561 Open files only if ns_do_open_file.
4562
4563 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4564
4565 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4566 This no-op macro hasn't been needed for many years.
4567 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4568
4569 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4570 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4571 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4572 gdb_make_enums_visible.
4573 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4574 (DIRECTORY_SEP): Now a constant, not a macro.
4575
4576 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4577
4578 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4579 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4580
4581 * w32term.c <w32_keyboard_codepage>: Renamed from
4582 keyboard_codepage and now external. All users changed.
4583
4584 * w32term.h: Add declaration of w32_keyboard_codepage.
4585
4586 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4587 the codepage to translate keys to Unicode. If this argument is
4588 -1, use the value returned by GetConsoleCP. All callers changed.
4589
4590 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4591
4592 Update .PHONY listings in makefiles.
4593 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4594 bootstrap-clean, distclean, maintainer-clean, versioclean,
4595 extraclean, frc.
4596
4597 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4598 This is a bit clearer. Fix some commentary typos.
4599
4600 2012-07-30 Glenn Morris <rgm@gnu.org>
4601
4602 * s/netbsd.h: Let configure include signal.h if needed.
4603 Remove file, which is now empty.
4604
4605 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4606 Let configure set them.
4607 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4608 No more need to undefine.
4609
4610 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4611
4612 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4613 non-single-byte char when adding meta modifier. (Bug#12090)
4614
4615 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4616
4617 Convert safe_call to use variable number of arguments.
4618 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4619 (safe_call2): Fix comment.
4620 * lisp.h (safe_call): Adjust prototype.
4621 * coding.c (encode_coding_object): Change to use safe_call2.
4622 * xfaces.c (merge_face_heights): Change to use safe_call1.
4623
4624 2012-07-30 Glenn Morris <rgm@gnu.org>
4625
4626 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4627 does that unconditionally. Remove file, which is now empty.
4628
4629 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4630 Remove empty files.
4631
4632 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4633
4634 Export to GDB most of lisp.h's remaining object-like macros.
4635 * lisp.h (min, max): Move earlier, because they're used earlier now.
4636 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4637 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4638 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4639 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4640 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4641 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4642 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4643 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4644 Now constants, for GDB. They need not be macros.
4645 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4646 Now constants, for GDB, as well as macros, for static initializers.
4647 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4648 Move to after the definition of struct Lisp_Char_Table,
4649 since the former now needs that type defined.
4650 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4651 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4652 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4653 New enums, for gdb_make_enums_visible.
4654 (GLYPH_MODE_LINE_FACE): Remove; unused.
4655 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4656 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4657 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4658 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4659 enum maxargs, enum MAX_ALLOCA.
4660 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4661 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4662 no longer needed, now that they are done in lisp.h.
4663
4664 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4665
4666 Cleanup string bytes checking.
4667 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4668 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4669 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4670 (check_sblock, compact_small_strings): Simplify.
4671
4672 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4673
4674 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4675 These macros are confusing and no longer need to be defined, as
4676 the enum values now suffice. All uses replaced with definiens.
4677 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4678
4679 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4680
4681 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4682 ($(BLD)/w32console.$(O)): Update dependencies.
4683
4684 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4685
4686 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4687 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4688 time. Adjust users.
4689 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4690
4691 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4692
4693 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4694 setting sitelisp (Bug#12010).
4695
4696 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4697
4698 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4699
4700 * w32heap.c (cache_system_info):
4701 * w32.c (sys_rename):
4702 * w32proc.c (find_child_console, sys_kill): All users changed.
4703
4704 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4705
4706 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4707
4708 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4709
4710 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4711
4712 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4713
4714 Cleanup statistics calculation in Fgarbage_collect.
4715 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4716 Fix zombies percentage calculation. Simplify elapsed time calculation.
4717
4718 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4719
4720 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4721 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4722 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4723 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4724 (replace_range, replace_range_2, del_range_2): Change to eassert.
4725 * marker.c (byte_char_debug_check): Adjust style.
4726
4727 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4728
4729 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4730 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4731 long-ago-commented-out code that talks about "WIN32".
4732 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4733 All uses changed.
4734
4735 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4736
4737 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4738 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4739 Simplify by using alignof.
4740 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4741 * lisp.h: Include <stdalign.h>.
4742 (GCALIGNMENT): New macro and constant.
4743 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4744 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4745 (stdalign): New macro, if not already defined.
4746
4747 2012-07-28 Eli Zaretskii <eliz@gnu.org>
4748
4749 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4750 * w32inevt.c: Include w32inevt.h.
4751 (w32_read_console_input): New inline function, calls either
4752 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4753 w32_console_unicode_input.
4754 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4755 (w32_kbd_patch_key, key_event): Use the codepage returned by
4756 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4757 (key_event): use uChar.UnicodeChar only if
4758 w32_console_unicode_input is non-zero.
4759
4760 * w32console.c: Include w32heap.h.
4761 <w32_console_unicode_input>: New global variable.
4762 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4763 family of Windows, zero otherwise.
4764
4765 * w32inevt.h: Declare w32_console_unicode_input.
4766
4767 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4768 --without-x. (Bug#11742)
4769
4770 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4771
4772 Adjust GDB to reflect pvec_type changes (Bug#12036).
4773 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4774 2012-07-04 changes to pseudovector representation.
4775 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4776
4777 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
4778
4779 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4780 bus address.
4781 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4782
4783 2012-07-27 Eli Zaretskii <eliz@gnu.org>
4784
4785 * alloc.c (listn): Fix the order the arguments are consed onto the
4786 list.
4787
4788 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4789 enumeration constants, as PURE and HEAP are too general, and clash
4790 with other headers and sources, such as gmalloc.c and the
4791 MS-Windows system headers. All users changed.
4792
4793 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4794
4795 Revert last save_excursion_save and save_excursion_restore changes.
4796 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4797 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4798
4799 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4800
4801 Fix recently-introduced typos in Windows port.
4802 Reported by Martin Rudalics <rudalics@gmx.at>.
4803 * w32.c (init_environment): Replace comma with semicolon.
4804 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4805
4806 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4807
4808 Improve GDB symbol export (Bug#12036).
4809 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4810 arms of an 'if', not using conditional expressions; otherwise GDB
4811 complains about the types in the unevaluated arm when the argument
4812 is an integer literal.
4813 (xgetint): Simplify expression.
4814 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4815 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4816 Zaretskii in <http://bugs.gnu.org/12036#13>.
4817 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4818 needed now that we have gdb_make_enums_visible.
4819 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4820 (enum enum_USE_LSB_TAG):
4821 New enum types, packaging up enums that need to be exported to GDB.
4822
4823 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4824
4825 Utility function to make a list from specified amount of objects.
4826 * lisp.h (enum constype): New datatype.
4827 (listn): New prototype.
4828 * alloc.c (listn): New function.
4829 (Fmemory_use_count, syms_of_alloc): Use it.
4830 * buffer.c (syms_of_buffer): Likewise.
4831 * callint.c (syms_of_callint): Likewise.
4832 * charset.c (define_charset_internal): Likewise.
4833 * coding.c (syms_of_coding): Likewise.
4834 * keymap.c (syms_of_keymap): Likewise.
4835 * search.c (syms_of_search): Likewise.
4836 * syntax.c (syms_of_syntax): Likewise.
4837 * w32.c (init_environment): Likewise.
4838 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4839 * xdisp.c (syms_of_xdisp): Likewise.
4840 * xfns.c (syms_of_xfns): Likewise.
4841
4842 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4843
4844 Fast save_excursion_save and save_excursion_restore.
4845 * lisp.h (struct Lisp_Excursion): New data type.
4846 (PVEC_EXCURSION): New pseudovector type.
4847 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4848 to deal with it. Adjust comments.
4849 (init_marker, attach_marker): New prototype.
4850 (unchain_marker): Adjust prototype.
4851 * marker.c (attach_marker): Change to global.
4852 (init_marker): New function.
4853 * alloc.c (Fmake_marker, build_marker): Use it.
4854 (build_marker): More easserts.
4855 (mark_object): Handle struct Lisp_Excursion.
4856 * editfns.c (save_excursion_save, save_excursion_restore):
4857 Reimplement to use struct Lisp_Excursion. Add comments.
4858
4859 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4860
4861 Fix export of symbols to GDB (Bug#12036).
4862 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4863 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4864 emacs.c, as this is a more-suitable home. Had this been done earlier
4865 the fix for 12036 would have avoided some of the problems noted in
4866 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4867 would have been more obvious.
4868 * emacs.c: Do not include <verify.h>; no longer needed.
4869 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4870 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4871 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4872 Remove; now done in lisp.h.
4873 * lisp.h (PUBLISH_TO_GDB): New macro.
4874 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4875 (DATA_SEG_BITS): Use it.
4876 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4877 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4878 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4879 not be usable in #if. This simplifies things.
4880
4881 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
4882
4883 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4884
4885 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4886
4887 Simplify export of symbols to GDB (Bug#12036).
4888 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4889 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4890 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4891 Adjust to changes in lisp.h and emacs.c, by using
4892 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4893 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4894 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4895 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4896 instead of gdb_valbits.
4897 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4898 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4899 instead of gdb_array_mark_flag.
4900 (xboolvector): Get size from $->size, not $->header.size.
4901 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4902 (xreload, hook-run, hookpost-run): Remove.
4903 * emacs.c: Include <verify.h>.
4904 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4905 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4906 Remove.
4907 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4908 (gdb_USE_LSB_TAG): New enum constants.
4909 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4910 Also define these as enum constants, so they're visible to GDB.
4911 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4912 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4913 as constants, so they're visible to GDB.
4914 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4915 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4916 Now enum constants, not macros, so they're visible to GDB.
4917 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4918 more convenient now. All uses changed.
4919 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4920 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4921
4922 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4923
4924 Explicitly free restriction data that are not needed anymore.
4925 * editfns.c (save_restriction_restore): Free restriction data.
4926
4927 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4928
4929 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4930 add argument, tune behavior, and adjust all callers.
4931
4932 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4933
4934 Use typedef for EMACS_INT, EMACS_UINT.
4935 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4936 than macros. This simplifies debugging in the usual case, since
4937 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4938 and it allows expressions involving EMACS_INT casts.
4939 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4940
4941 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4942
4943 * nsterm.m (ns_read_socket): Return early if there is a modal
4944 window (Bug#12043).
4945
4946 2012-07-25 Martin Rudalics <rudalics@gmx.at>
4947
4948 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4949 that FOCUS-FRAME can be omitted.
4950
4951 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4952
4953 Adjust buffer text indirection counters at the end of Fkill_buffer.
4954 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4955 buffer is definitely dead. This should really fix an issue reported
4956 by Christoph Scholtes again. (Bug#12007).
4957 (init_buffer_once): Initialize indirection counters of
4958 buffer_defaults and buffer_local_symbols (for sanity and safety).
4959
4960 2012-07-24 Eli Zaretskii <eliz@gnu.org>
4961
4962 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4963 and continuation glyphs on tooltip frames, leave them at zero.
4964 Avoids continued lines in tooltips. (Bug#11832)
4965
4966 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4967
4968 Simplify copy_overlay.
4969 * buffer.c (copy_overlay): Simplify. Use build_marker.
4970 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4971
4972 2012-07-23 Eli Zaretskii <eliz@gnu.org>
4973
4974 * print.c (print_object): Don't crash when a frame's name is nil
4975 or invalid. (Bug#12025)
4976
4977 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4978 it signals an error when a tooltip frame is being created.
4979
4980 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4981
4982 Cleanup miscellaneous objects allocation and initialization.
4983 * alloc.c (allocate_misc): Change to static. Add argument to
4984 specify the subtype. Adjust comment and users.
4985 (build_overlay): New function.
4986 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4987 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4988 (allocate_misc): Remove prototype.
4989 (build_overlay): Add prototype.
4990
4991 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4992
4993 Swap buffer text indirection counters in Fbuffer_swap_text.
4994 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4995 This avoids crash reported by Christoph Scholtes at
4996 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4997
4998 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4999
5000 * nsmenu.m (Popdown_data): New struct.
5001 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5002 free Popdown_data.
5003 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5004 (initWithContentRect): Make imgView and contentView non-static
5005 and autorelease them. Also autorelease img and matrix (Bug#12005).
5006 (dealloc): Remove (Bug#12005).
5007
5008 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5009
5010 Adjust consing_since_gc when objects are explicitly freed.
5011 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5012 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5013 (free_cons, free_misc): Subtract object size from consing_since_gc.
5014
5015 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5016
5017 Simplify and cleanup markers positioning code.
5018 * marker.c (attach_marker): More useful eassert.
5019 (live_buffer, set_marker_internal): New function.
5020 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5021 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5022
5023 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5024
5025 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5026 as it's limited by the amount of memory, not by INT_MAX.
5027
5028 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5029
5030 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5031 in special-event-map. See the discussion at
5032 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5033 for the reasons.
5034
5035 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5036 info.dwItemData. Fixes crashes on 64-bit Windows.
5037 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5038
5039 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5040
5041 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5042 (conversationIdentifier): Return value is NSInteger.
5043 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5044
5045 2012-07-21 Chong Yidong <cyd@gnu.org>
5046
5047 * window.c (decode_any_window): Signal an error if the window is
5048 on a dead frame (Bug#11984).
5049
5050 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5051
5052 Add indirection counting to speed up Fkill_buffer.
5053 * buffer.h (struct buffer): New member.
5054 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5055 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5056 base buffer indirection counter.
5057 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5058 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5059 through buffer list if indirection counter is 0.
5060
5061 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5062
5063 Extend the value returned by Fgarbage_collect with heap statistics.
5064 * alloc.c (Qheap): New symbol.
5065 (syms_of_alloc): DEFSYM it.
5066 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5067 (Fmemory_free): Remove.
5068 (syms_of_alloc): Don't defsubr it.
5069 * buffer.c (Fcompact_buffer): Remove.
5070 (syms_of_buffer): Don't defsubr it.
5071
5072 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5073
5074 Make maybe_gc inline.
5075 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5076 * lisp.h (consing_since_gc, gc_relative_threshold)
5077 (memory_full_cons_threshold): Revert declaration.
5078 (maybe_gc): Remove prototype, define as inline.
5079 * alloc.c: Remove old commented-out code.
5080 (consing_since_gc, gc_relative_threshold)
5081 (memory_full_cons_threshold): Revert to global.
5082 (maybe_gc): Remove.
5083
5084 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5085
5086 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5087 * lisp.h (build_unibyte_string): New function.
5088 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5089 * sysdep.c, w32fns.c, xfns.c: Use it.
5090 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5091 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5092 Adjust users accordingly.
5093 * font.h (font_open_by_name): Adjust prototype.
5094
5095 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5096
5097 Cleanup calls to Fgarbage_collect.
5098 * lisp.h (maybe_gc): New prototype.
5099 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5100 Remove declarations.
5101 * alloc.c (maybe_gc): New function.
5102 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5103 Make them static.
5104 * bytecode.c (MAYBE_GC): Use maybe_gc.
5105 * eval.c (eval_sub, Ffuncall): Likewise.
5106 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5107 to avoid dependency from auto-save feature.
5108
5109 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5110
5111 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5112 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5113 'for_each_per_buffer_object_at'.
5114 All uses changed. It's better to use upper-case for macros that
5115 cannot be implemented as functions, to give the reader a clue
5116 that they're special.
5117
5118 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5119
5120 * alloc.c (Fgarbage_collect): Tweak docstring.
5121
5122 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5123
5124 Tweak the value returned from Fgarbage_collect again.
5125 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5126 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5127 Adjust documentation.
5128 (total_vector_bytes): Rename to total_vector_slots, adjust
5129 accounting.
5130 (total_free_vector_bytes): Rename to total_free_vector_slots,
5131 adjust accounting.
5132 (Qstring_bytes, Qvector_slots): New symbols.
5133 (syms_of_alloc): DEFSYM them.
5134
5135 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5136
5137 Buffer compaction primitive which may be used from Lisp.
5138 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5139 (syms_of_buffer): Register Fcompact_buffer.
5140 * alloc.c (Fgarbage_collect): Use compact_buffer.
5141 * buffer.h (compact_buffer): New prototype.
5142 (struct buffer_text): New member.
5143
5144 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5145
5146 New macro to iterate over all buffers, miscellaneous cleanups.
5147 * lisp.h (all_buffers): Remove declaration.
5148 * buffer.h (all_buffers): Add declaration, with comment.
5149 (for_each_buffer): New macro.
5150 * alloc.c (Fgarbage_collect, mark_object): Use it.
5151 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5152 (init_buffer): Likewise.
5153 * data.c (Fset_default): Likewise.
5154 * coding.c (code_conversion_restore): Remove redundant check
5155 for dead buffer.
5156 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5157
5158 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5159
5160 Fix bug that created negative-length intervals.
5161 * intervals.c (merge_interval_right, merge_interval_left):
5162 Do not zero out this interval if it is absorbed by its children,
5163 as this interval's total length doesn't change in that case. See
5164 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5165
5166 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5167
5168 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5169 when invoking (make-bool-vector N t) and N is a positive
5170 multiple of 8 -- the last 8 bits were mistakenly cleared.
5171
5172 Remove some struct layout assumptions in bool vectors.
5173 * alloc.c (bool_header_size): New constant.
5174 (header_size, word_size): Move earlier, as they're now used earlier.
5175 Use 'word_size' in a few more places, where it's appropriate.
5176 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5177 padding before the data member of a bool vector.
5178 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5179 than doing the check by hand with an abort ().
5180
5181 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5182
5183 * eval.c (Fdefvar): Don't check constants since we only set the var if
5184 it's not yet defined anyway (bug#11904).
5185
5186 * lisp.h (last_undo_boundary): Declare new var.
5187 * keyboard.c (command_loop_1): Set it.
5188 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5189 were auto-added by the command loop (bug#11774).
5190
5191 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5192
5193 * w32font.c (Qsymbol): Remove local definition.
5194 (syms_of_w32font): Don't DEFSYM it.
5195
5196 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5197
5198 Fix sweep_vectors to handle large bool vectors correctly.
5199 * alloc.c (sweep_vectors): Account total_vector_bytes for
5200 bool vectors larger than VBLOCK_BYTES_MAX.
5201
5202 2012-07-18 Chong Yidong <cyd@gnu.org>
5203
5204 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5205 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5206
5207 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5208
5209 Return more descriptive data from Fgarbage_collect.
5210 Suggested by Stefan Monnier in
5211 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5212 * alloc.c (bounded_number): New function.
5213 (total_buffers, total_vectors): New variable.
5214 (total_string_size): Rename to total_string_bytes, adjust users.
5215 (total_vector_size): Rename to total_vector_bytes, adjust users.
5216 (sweep_vectors): Account total_vectors and total_vector_bytes.
5217 (Fgarbage_collect): New return value. Adjust documentation.
5218 (gc_sweep): Account total_buffers.
5219 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5220 (VECTOR_SIZE): Remove.
5221 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5222 (Qinterval, Qmisc): New symbols.
5223 (syms_of_data): Initialize them.
5224 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5225 (Qcons, Qbuffer): New declarations.
5226
5227 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5228
5229 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5230 Round up, not down. Improve doc.
5231
5232 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5233
5234 Restore old code in allocate_string_data to avoid Faset breakage.
5235 Reported by Julien Danjou <julien@danjou.info> in
5236 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5237 * alloc.c (allocate_string_data): Restore old code with minor
5238 adjustments, fix comment to explain this subtle issue.
5239
5240 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5241
5242 Remove FILE_SYSTEM_CASE.
5243 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5244
5245 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5246 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5247 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5248 call-process-region passes it through expand-file-name.
5249
5250 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5251
5252 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5253
5254 Fix crash when creating indirect buffer (Bug#11917)
5255 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5256 Don't handle unbound variables specially if non-zero.
5257 (Fbuffer_local_variables): Pass zero.
5258 (clone_per_buffer_values): Pass non-zero.
5259
5260 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5261
5262 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5263 to make the loop interruptible.
5264
5265 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5266
5267 * gnutls.c (emacs_gnutls_handshake): Only retry if
5268 GNUTLS_E_INTERRUPTED.
5269
5270 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5271
5272 Cleanup and convert miscellaneous checks to eassert.
5273 * alloc.c (mark_interval): Fix comment, partially rephrase
5274 old comment from intervals.h (see below).
5275 * intervals.c (find_interval, adjust_intervals_for_insertion)
5276 (delete_interval, adjust_intervals_for_deletion)
5277 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5278 Convert to eassert.
5279 (adjust_intervals_for_insertion, make_new_interval):
5280 Remove obsolete and unused code.
5281 * intervals.h (struct interval): Remove obsolete comment.
5282 * textprotp.c (erase_properties): Remove unused code.
5283 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5284 (Fremove_list_of_text_properties): Convert to eassert.
5285
5286 2012-07-17 Chong Yidong <cyd@gnu.org>
5287
5288 * editfns.c (Finsert_char): Doc fix.
5289
5290 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5291
5292 Fix previous change to make Fmemory_free always accurate.
5293 * alloc.c (make_interval): Update total_free_intervals.
5294 (make_float): Likewise for total_free_floats.
5295 (free_cons, Fcons): Likewise for total_free_conses.
5296 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5297 Likewise for total_free_vector_bytes.
5298 (Fmake_symbol): Likewise for total_free_symbols.
5299 (bytes_free): Remove.
5300
5301 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5302
5303 Simple free memory accounting feature.
5304 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5305 (sweep_vectors): Accumulate size of free vectors.
5306 (Fgarbage_collect): Setup bytes_free.
5307 (Fmemory_free): New function.
5308 (syms_of_alloc): Register it.
5309
5310 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5311
5312 Cleanup overlays checking.
5313 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5314 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5315 eassert and OVERLAYP.
5316 (sort_overlays): Change to use OVERLAYP.
5317
5318 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5319
5320 * editfns.c (Finsert_char): Make it interactive, and make the
5321 second arg optional. Copy interactive spec and docstring from
5322 ucs-insert.
5323
5324 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5325
5326 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5327 Unlike the other wrapped functions, fabs has an unspecified
5328 effect on errno.
5329
5330 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5331
5332 * nsterm.m (keyDown): Interpret flags without left/right bits
5333 as the left key (Bug#11670).
5334
5335 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5336
5337 Remove empty and useless init functions.
5338 * lisp.h (init_character_once, init_fns, init_image)
5339 (init_filelock, init_sound): Remove prototype.
5340 * character.c (init_character_once): Remove.
5341 * filelock.c (init_filelock): Likewise.
5342 * fns.c (init_fns): Likewise.
5343 * image.c (init_image): Likewise.
5344 * sound.c (init_sound): Likewise.
5345 * emacs.c (main): Adjust accordingly.
5346
5347 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5348
5349 * gtkutil.h: Tiny cleanups.
5350 (use_old_gtk_file_dialog): Remove useless declaration.
5351 (xg_uses_old_file_dialog): Add suggested const attribute.
5352
5353 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5354
5355 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5356 (bidi_paragraph_init): Use it to limit search forward for a strong
5357 directional character in abnormally large paragraphs full of
5358 neutral or weak characters. (Bug#11943)
5359
5360 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5361
5362 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5363 the toolbar (Bug#9451).
5364 (xg_make_tool_item): Give the widget event box a transparent
5365 background.
5366
5367 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5368
5369 Cleanup basic allocation variables and functions.
5370 * alloc.c (ignore_warnings, init_intervals, init_float)
5371 (init_cons, init_symbol, init_marker): Remove.
5372 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5373 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5374 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5375 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5376 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5377 (staticidx, init_alloc_once, init_strings, free_ablock):
5378 Remove redundant initialization.
5379 * fns.c (init_weak_hash_tables): Remove.
5380 * lisp.h (init_weak_hash_tables): Remove prototype.
5381
5382 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5383
5384 Use zero_vector where appropriate.
5385 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5386 accordingly.
5387 * lisp.h (zero_vector): New declaration.
5388 * font.c (null_vector): Remove.
5389 (syms_of_font): Remove initialization and staticpro.
5390 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5391 * keymap.c (Faccessible_keymaps): Likewise.
5392
5393 2012-07-15 Leo Liu <sdl.web@gmail.com>
5394
5395 * fringe.c: Fix typo in comments.
5396
5397 2012-07-14 Leo Liu <sdl.web@gmail.com>
5398
5399 * fringe.c: Add a new bitmap exclamation-mark.
5400
5401 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5402
5403 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5404
5405 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5406 (HAVE_MENUS): Don't define, defined by editing config.in with
5407 msdos/sed2v2.inp.
5408 (GMALLOC_INHIBIT_VALLOC): Don't define.
5409 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5410
5411 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5412
5413 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5414
5415 2012-07-14 Glenn Morris <rgm@gnu.org>
5416
5417 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5418 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5419 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5420
5421 2012-07-13 Glenn Morris <rgm@gnu.org>
5422
5423 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5424
5425 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5426 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5427
5428 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5429
5430 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5431 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5432 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5433 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5434 where appropriate.
5435 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5436 as boolean expression.
5437 (x_set_window_size): Remove unused variable toolbar.
5438 (ns_get_color_default, ns_mod_to_lisp): Remove.
5439 (ns_mouse_position): Remove unused variables xchar and ychar.
5440 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5441 (ns_set_vertical_scroll_bar): Remove unused variable count.
5442 (ns_delete_terminal): Remove unused variable i.
5443 (ns_term_init): Remove unused variables r, g and b.
5444 (mouseDown): Remove unused variable window.
5445 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5446 (initFrameFromEmacs): Remove unused variable vbextra.
5447 (mouseEntered): Remove unused variables p and dpyinfo.
5448 (mouseExited): Remove unused variables p and r.
5449 (ns_define_frame_cursor, ns_clear_frame_area)
5450 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5451 (menuDown): Assign [sender tag] to variable and cast the variable.
5452
5453 * nsterm.h (menuDown): Add id as type to argument sender.
5454 (ns_display_info_for_name): Add Lisp_Object argument.
5455 (ns_term_init): Add Lisp_Object argument.
5456 (ns_map_event_to_object): Add void argument.
5457 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5458 prototype with arguments and only declare if __OBJC__.
5459 (nxatoms_of_nsselect): Add void argument.
5460 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5461 (ns_alloc_autorelease_pool): Add void argument.
5462 (ns_release_autorelease_pool): Add void* argument.
5463 (ns_get_defaults_value): Add const char* argument.
5464
5465 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5466 (initFromContents): Use SSDATA where appropriate.
5467 (ns_update_menubar): Add braces to ambigous if-else.
5468 (initWithTitle): Put () around assignment in if statement.
5469 (ns_menu_show): Remove unused variables window and keymap.
5470 (update_frame_tool_bar): Remove unused variable selected_p.
5471 (initWithContentRect): Remove unused variable this_cmd_name.
5472
5473 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5474 appropriate.
5475 (setXBMColor): Remove unused variable len.
5476 (setPixmapData): Put () around assignment in loop statement.
5477
5478 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5479 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5480 where appropriate.
5481 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5482 around assignment in loop statement.
5483 (nsfont_open): Remove unused variable i.
5484 (nsfont_open): Remove unused variable len.
5485 (nsfont_draw): Remove unused variable cs.
5486
5487 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5488 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5489 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5490 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5491 (Fns_font_name, Fns_perform_service)
5492 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5493 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5494 (ns_set_name): Remove unused variable view.
5495 (x_set_menu_bar_lines): Remove unused variable olines.
5496 (x_set_tool_bar_lines): Remove unused variable root_window.
5497 (Fns_list_colors): Put () around assignment in while statement.
5498 (Fns_perform_service): Remove unused variable len.
5499 (Fns_display_usable_bounds): Remove unused variable top.
5500 (syms_of_nsfns): Remove unused variable i.
5501
5502 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5503 memcpy (Bug#11907).
5504
5505 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5506
5507 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5508 and free it with DestroyExceptionInfo (Bug#11558).
5509
5510 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5511
5512 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5513 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5514 Set here, not in nt/config.nt.
5515
5516 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5517
5518 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5519 cursor overflow into the last glyph on display line when the right
5520 fringe is off. (Bug#11832)
5521
5522 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5523
5524 * xdisp.c (produce_special_glyphs): Now static.
5525 * dispextern.h (produce_special_glyphs): Remove decl.
5526
5527 2012-07-13 Glenn Morris <rgm@gnu.org>
5528
5529 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5530 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5531
5532 * s/usg5-4-common.h (USG, USG5):
5533 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5534 * s/sol2-6.h (SOLARIS2):
5535 * s/irix6-5.h (IRIX6_5):
5536 * s/hpux10-20.h (USG, USG5, HPUX):
5537 * s/gnu-linux.h (USG, GNU_LINUX):
5538 * s/freebsd.h (BSD_SYSTEM):
5539 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5540 * s/cygwin.h (CYGWIN):
5541 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5542 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5543
5544 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5545
5546 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5547
5548 2012-07-13 Glenn Morris <rgm@gnu.org>
5549
5550 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5551
5552 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5553
5554 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5555 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5556
5557 2012-07-12 Glenn Morris <rgm@gnu.org>
5558
5559 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5560
5561 * process.c (init_process_emacs): Rename from init_process.
5562 The old name is also the name of a Mach system call.
5563 * lisp.h, emacs.c: Update for this name change.
5564 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5565 longer needed.
5566
5567 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5568
5569 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5570 memmove call that removes glyphs covered by the left truncation
5571 glyph. Improve commentary.
5572 (display_line): Fix display of continuation glyphs on GUI frames
5573 when the right fringe is turned off and variable-size fonts are
5574 used in the window. Move the code that appends a stretch glyph to
5575 produce_special_glyphs, so that it could be used for truncation
5576 and continuation glyphs alike.
5577 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5578 glyph of a suitably computed width, to align the special glyphs at
5579 the window margin. Code moved from display_line. (Bug#11832)
5580
5581 2012-07-12 Glenn Morris <rgm@gnu.org>
5582
5583 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5584
5585 * s/gnu-linux.h, s/hpux10-20.h:
5586 Do not unconditionally define HAVE_XRMSETDATABASE.
5587
5588 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5589
5590 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5591
5592 Fix typos that broke OS X build.
5593 Reported by Randal L. Schwartz in
5594 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5595 * nsterm.m (ns_timeout): Add missing local decl.
5596 (ns_get_color): snprintf -> sprintf, to fix typo.
5597
5598 2012-07-12 Glenn Morris <rgm@gnu.org>
5599
5600 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5601 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5602 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5603 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5604
5605 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5606 Move PTY_OPEN to configure.
5607
5608 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5609 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5610 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5611
5612 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5613
5614 Use empty_unibyte_string where applicable.
5615 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5616 * lread.c (read1): Likewise.
5617 * xsettings.c (syms_of_xsettings): Likewise.
5618
5619 2012-07-12 Glenn Morris <rgm@gnu.org>
5620
5621 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5622 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5623 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5624 * s/hpux10-20.h (RUN_TIME_REMAP):
5625 * s/bsd-common.h (TABDLY): Move to configure.
5626
5627 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5628
5629 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5630
5631 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5632 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5633
5634 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5635
5636 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5637 * s/template.h: Move NARROWPROTO to configure.
5638
5639 2012-07-11 Glenn Morris <rgm@gnu.org>
5640
5641 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5642 unused since 2011-01-17 change to systty.h.
5643
5644 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5645 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5646 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5647
5648 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5649
5650 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5651
5652 2012-07-11 Glenn Morris <rgm@gnu.org>
5653
5654 * s/darwin.h, s/gnu-linux.h, s/template.h:
5655 Move INTERRUPT_INPUT to configure.
5656
5657 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5658
5659 Minor adjustments to interning code.
5660 * lisp.h (intern, intern_c_string): Redefine as static inline
5661 wrappers for intern_1 and intern_c_string_1, respectively.
5662 (intern_1, intern_c_string_1): Rename prototypes.
5663 * lread.c (intern_1, intern_c_string_1, oblookup):
5664 Simplify Vobarray checking.
5665 * font.c (font_intern_prop): Likewise. Adjust comment.
5666 * w32font.c (intern_font_name): Likewise.
5667
5668 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5669
5670 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5671
5672 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5673 of Fcar/Fcdr if possible.
5674 * font.c (check_otf_features): Likewise.
5675 * fontset.c (Fnew_fontset): Likewise.
5676 * gnutls.c (Fgnutls_boot): Likewise.
5677 * minibuf.c (read_minibuf): Likewise.
5678 * msdos.c (IT_set_frame_parameters): Likewise.
5679 * xmenu.c (Fx_popup_dialog): Likewise.
5680 * w32menu.c (Fx_popup_dialog): Likewise.
5681
5682 2012-07-11 Glenn Morris <rgm@gnu.org>
5683
5684 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5685 since nothing has defined it on these platforms.
5686
5687 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5688 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5689
5690 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5691 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5692 Move CLASH_DETECTION to configure.
5693
5694 * s/gnu.h: Remove file, which is now empty.
5695
5696 * s/gnu.h, s/gnu-linux.h:
5697 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5698
5699 2012-07-11 John Wiegley <johnw@newartisans.com>
5700
5701 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5702 function attribute, so we only use it if it exists in the
5703 compiler.
5704
5705 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5706
5707 Avoid call to strlen in fast_c_string_match_ignore_case.
5708 * search.c (fast_c_string_match_ignore_case): Change to use
5709 length argument. Adjust users accordingly.
5710 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5711
5712 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5713
5714 Assume mkdir, rmdir.
5715 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5716 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5717
5718 Assume rename.
5719 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5720
5721 Assume perror.
5722 * s/hpux10-20.h (HAVE_PERROR): Remove.
5723 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5724 Remove dummy definition, as this problem was obsolete long ago.
5725
5726 Assume strerror.
5727 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5728
5729 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5730
5731 Avoid calls to strlen in font processing functions.
5732 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5733 (font_open_by_name): Change to use length argument.
5734 Adjust users accordingly.
5735 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5736 Adjust prototypes.
5737 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5738 Change to return ptrdiff_t.
5739 (xfont_list_pattern, xfont_match): Use length returned by
5740 xfont_decode_coding_xlfd.
5741 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5742
5743 2012-07-11 Glenn Morris <rgm@gnu.org>
5744
5745 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5746 Move DONT_REOPEN_PTY to configure.
5747
5748 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5749 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5750
5751 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5752
5753 Remove "#define unix" that is no longer needed (Bug#11905).
5754 * s/aix4-2.h (unix): Remove; no longer needed.
5755
5756 EMACS_TIME simplification (Bug#11875).
5757 This replaces macros (which typically do not work in GDB)
5758 with functions, typedefs and enums, making the code easier to debug.
5759 The functional style also makes code easier to read and maintain.
5760 * systime.h: Include <sys/time.h> on all hosts, not just if
5761 WINDOWSNT, since 'struct timeval' is needed in general.
5762 (EMACS_TIME): Now a typedef, not a macro.
5763 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5764 not macros.
5765 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5766 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5767 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5768 (EMACS_TIME_LE): Now functions, not macros.
5769 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5770 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5771 which are not functions. All uses rewritten to use:
5772 (make_emacs_time): New function.
5773 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5774 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5775 not functions. All uses rewritten to use the following, respectively:
5776 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5777 (add_emacs_time, sub_emacs_time): New functions.
5778 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5779 * fileio.c (Fcopy_file):
5780 * xterm.c (XTflash): Get the current time closer to when it's used.
5781 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5782
5783 * bytecode.c (targets): Suppress -Woverride-init warnings.
5784
5785 Simplify by avoiding confusing use of strncpy etc.
5786 * doc.c (Fsnarf_documentation):
5787 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5788 * frame.c (Fmake_terminal_frame):
5789 * gtkutil.c (get_utf8_string):
5790 * lread.c (openp):
5791 * nsmenu.m (ns_update_menubar):
5792 * regex.c (regerror):
5793 Prefer memcpy to strncpy and strncat when either will do.
5794 * fileio.c (Fsubstitute_in_file_name):
5795 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5796 (menu_separator_name_p):
5797 * nsmenu.m (ns_update_menubar):
5798 Prefer memcmp to strncmp when either will do.
5799 * nsterm.m: Include <ftoastr.h>.
5800 (ns_get_color):
5801 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5802 Prefer snprintf to strncpy.
5803 * nsterm.m (ns_term_init):
5804 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5805 * nsterm.m (ns_term_init):
5806 Avoid the need for strncpy, by using build_string or
5807 make_unibyte_string directly. Use dtoastr, not snprintf.
5808 * process.c (Fmake_network_process): Diagnose service names that
5809 are too long, rather than silently truncating them or creating
5810 non-null-terminated names.
5811 (Fnetwork_interface_info): Likewise, for interface names.
5812 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5813 Prefer sprintf to strncat.
5814 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5815 Prefer vsnprintf to vsprintf + strncpy.
5816
5817 2012-07-10 Glenn Morris <rgm@gnu.org>
5818
5819 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5820 Clarify fallback case.
5821
5822 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5823
5824 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5825 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5826 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5827 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5828 where argument type is known to be a Lisp_Cons.
5829
5830 2012-07-10 Tom Tromey <tromey@redhat.com>
5831
5832 * bytecode.c (BYTE_CODE_THREADED): New macro.
5833 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5834 (enum byte_code_op): New type.
5835 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5836 (exec_byte_code): Use them. Use token threading when applicable.
5837
5838 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5839
5840 Optimize pure C strings initialization.
5841 * lisp.h (make_pure_string): Fix prototype.
5842 (build_pure_c_string): New function, defined as static inline. This
5843 provides a better opportunity to optimize away calls to strlen when
5844 the function is called with compile-time constant argument.
5845 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5846 argument, adjust users accordingly. Use build_pure_c_string where
5847 appropriate.
5848 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5849 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5850 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5851
5852 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5853
5854 Avoid calls to strlen in miscellaneous functions.
5855 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5856 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5857 * lread.c (openp): Likewise.
5858
5859 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5860
5861 Avoid calls to strlen in path processing functions.
5862 * fileio.c (file_name_as_directory): Add comment. Change to add
5863 srclen argument and return the length of result. Adjust users
5864 accordingly.
5865 (directory_file_name): Fix comment. Change to add srclen argument,
5866 swap 1st and 2nd arguments to obey the common convention.
5867 Adjust users accordingly.
5868 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5869
5870 2012-07-10 Glenn Morris <rgm@gnu.org>
5871
5872 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5873 Move PENDING_OUTPUT_COUNT definition to configure.
5874
5875 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5876 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5877 * s/gnu.h (DATA_START): Move definitions to configure.
5878
5879 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5880 We include usg5-4-common.h, which defines them both.
5881
5882 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5883 O_RDONLY already includes it).
5884
5885 Stop ns builds setting the EMACSLOADPATH environment variable.
5886 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5887 Now it does not set EMACSLOADPATH, just returns the load-path string.
5888 * nsterm.h: Update accordingly.
5889 * lread.c [HAVE_NS]: Include nsterm.h.
5890 (init_lread) [HAVE_NS]: Use ns_load_path.
5891 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5892
5893 2012-07-09 Glenn Morris <rgm@gnu.org>
5894
5895 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5896 since the included bsd-common.h does so.
5897
5898 Stop ns builds setting the EMACSPATH environment variable.
5899 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5900 (ns_init_paths): Do not set EMACSPATH.
5901 * nsterm.h (ns_exec_path): Add it.
5902 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5903 Use ns_exec_path.
5904
5905 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5906
5907 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5908
5909 * process.c (wait_reading_process_output): 'waitchannels' was unset
5910 when read_kbd || !NILP (wait_for_cell); fix this.
5911
5912 Add GCC-style 'const' attribute to functions that can use it.
5913 * character.h (char_resolve_modifier_mask):
5914 * keyboard.h (make_ctrl_char):
5915 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5916 (init_character_once, next_almost_prime, init_fns, init_image)
5917 (flush_pending_output, init_sound):
5918 * mem-limits.h (start_of_data):
5919 * menu.h (finish_menu_items):
5920 Add ATTRIBUTE_CONST.
5921 * emacs.c (DEFINE_DUMMY_FUNCTION):
5922 Declare the dummy function with ATTRIBUTE_CONST.
5923 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5924 Add decls with ATTRIBUTE_CONST.
5925
5926 Minor improvements to make_formatted_string.
5927 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5928 where int is good enough, as vsprintf returns an int.
5929 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5930
5931 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5932
5933 Use make_formatted_string to avoid double length calculation.
5934 * lisp.h (make_formatted_string): New prototype.
5935 * alloc.c (make_formatted_string): New function.
5936 * buffer.c (Fgenerate_new_buffer_name): Use it.
5937 * dbus.c (syms_of_dbusbind): Likewise.
5938 * editfns.c (Fcurrent_time_zone): Likewise.
5939 * filelock.c (get_boot_time): Likewise.
5940 * frame.c (make_terminal_frame, set_term_frame_name)
5941 (x_report_frame_params): Likewise.
5942 * image.c (gs_load): Likewise.
5943 * minibuf.c (get_minibuffer): Likewise.
5944 * msdos.c (dos_set_window_size): Likewise.
5945 * process.c (make_process): Likewise.
5946 * xdisp.c (ensure_echo_area_buffers): Likewise.
5947 * xsettings.c (apply_xft_settings): Likewise.
5948
5949 2012-07-09 Glenn Morris <rgm@gnu.org>
5950
5951 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5952 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5953 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5954 * nsterm.h (ns_etc_directory): Add it.
5955 * callproc.c [HAVE_NS]: Include nsterm.h.
5956 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5957
5958 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5959
5960 Move marker debugging code under MARKER_DEBUG.
5961 * marker.c (MARKER_DEBUG): Move marker debugging code under
5962 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5963 for bootstrap with --enable-checking (~3x slowdown reported
5964 by Juanma Barranquero <lekktu@gmail.com>).
5965 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5966
5967 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5968
5969 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5970 See <http://bugs.gnu.org/11825#29>.
5971
5972 2012-07-08 Eli Zaretskii <eliz@gnu.org>
5973
5974 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5975 has no font, use the frame's font. (Bug#11813)
5976 (display_line): Add commentary about displaying truncation glyphs
5977 on GUI frames.
5978 (produce_special_glyphs): Move here from term.c.
5979
5980 * term.c (produce_special_glyphs): Move to xdisp.c.
5981
5982 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5983 section.
5984
5985 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5986
5987 * xdisp.c (display_line): Avoid warning about implicit declaration
5988 of FRAME_FONT.
5989
5990 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5991
5992 * lisp.h: Remove empty conditional.
5993
5994 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5995
5996 * lread.c (load_path_check): Now static.
5997
5998 Fix some minor --with-ns problems found by static checking.
5999 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6000 (x_set_font) [!HAVE_X_WINDOWS]:
6001 * image.c (xpm_load_image) [HAVE_NS]:
6002 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6003 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6004 Remove unused local.
6005 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6006 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6007 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6008 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6009 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6010 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6011 Fix pointer signedness problem.
6012 * xfaces.c (FRAME_X_FONT_TABLE):
6013 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6014
6015 2012-07-07 Glenn Morris <rgm@gnu.org>
6016
6017 * lread.c (load_path_check): New function, split from init_lread.
6018 (init_lread): Reorganize. Motivation:
6019 If EMACSLOADPATH is set, check/warn about that rather than the
6020 defaults, which we are not going to use. Hence we can remove
6021 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6022 Don't warn if site-lisp directories are missing.
6023 If not installed, start from a blank load-path, since
6024 PATH_LOADSEARCH refers to the eventual installation directories.
6025
6026 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6027
6028 Support truncation and continuation glyphs on GUI frames, when
6029 fringes are disabled. (Bug#11832)
6030 * xdisp.c (init_iterator): Get dimensions of truncation and
6031 continuation glyphs even if on GUI frames.
6032 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6033 or both, are absent.
6034 (start_display, move_it_in_display_line_to): Handle the case of a
6035 GUI frame without a fringe to display continuation or truncation
6036 glyphs.
6037 (insert_left_trunc_glyphs): Support GUI frames: make sure
6038 truncation glyphs overwrite enough glyphs from the current line to
6039 have sufficient space in pixels.
6040 (display_line): Support truncation and continuation glyphs on GUI
6041 frames. If some spare pixels are left on the line after inserting
6042 the truncation glyphs, fill that space with a stretch glyph of a
6043 suitably computed width.
6044
6045 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6046 produce_glyphs, to support GUI sessions.
6047
6048 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6049
6050 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6051
6052 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6053
6054 Do not require float-time's arg to fit in time_t (Bug#11825).
6055 This works better on hosts where time_t is unsigned, and where
6056 float-time is applied to the (negative) difference between two times.
6057 * editfns.c (decode_time_components): Last arg is now double *,
6058 not int *, and means to store all the result as a double, without
6059 worrying about whether the seconds part fits in time_t.
6060 All callers changed.
6061 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6062 All callers changed.
6063 (Ffloat_time): Do not fail merely because the specified time falls
6064 outside of time_t range.
6065
6066 2012-07-07 Glenn Morris <rgm@gnu.org>
6067
6068 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6069 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6070 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6071
6072 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6073
6074 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6075 Update dependencies.
6076
6077 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6078
6079 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6080
6081 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6082 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6083 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6084 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6085 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6086 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6087
6088 * xfont.c (compare_font_names): Redo to omit the need for casts.
6089
6090 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6091
6092 * xfns.c (Fx_change_window_property): Doc fix.
6093 * w32fns.c (Fx_change_window_property): Doc fix.
6094
6095 * w32fns.c (Fx_window_property): Accept the same arguments as the
6096 X Windows version. Doc fix.
6097 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6098
6099 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6100 Eli Zaretskii <eliz@gnu.org>
6101
6102 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6103 Windows-specific code from nt/config.nt moved here.
6104 Obsolete settings removed.
6105
6106 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6107
6108 * process.c: Avoid unnecessary calls to gettime.
6109 (wait_reading_process_output): Don't get the time of day
6110 when gobbling data immediately and not waiting, as there's no need
6111 for it in that case. This removes a FIXME.
6112
6113 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6114
6115 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6116 is defined (Bug#11768).
6117
6118 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6119
6120 Fix marker debugging code.
6121 * marker.c (byte_char_debug_check): Do not perform the check
6122 if buffer is not multibyte.
6123 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6124 Call byte_char_debug_check with correct arguments.
6125
6126 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6127
6128 Compile marker debugging code only if ENABLE_CHECKING is defined.
6129 * marker.c (byte_char_debug_check, count_markers):
6130 Use only if ENABLE_CHECKING is defined.
6131 (byte_debug_flag): Remove.
6132 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6133 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6134
6135 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6136
6137 Avoid code repetition in marker-related functions.
6138 * marker.c (attach_marker): New function.
6139 (Fset_marker, set_marker_restricted, set_marker_both)
6140 (set_marker_restricted_both): Use it.
6141 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6142 Consistently rename charno to charpos.
6143 (marker_position): Add eassert.
6144 (marker_byte_position): Convert to eassert.
6145
6146 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6147
6148 Simplify list operations in unchain_overlay and unchain_marker.
6149 * buffer.c (unchain_overlay): Simplify. Add comment.
6150 * marker.c (unchain_marker): Simplify. Fix comments.
6151
6152 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6153
6154 Introduce fast path for the widely used marker operation.
6155 * alloc.c (build_marker): New function.
6156 * lisp.h (build_marker): New prototype.
6157 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6158 * composite.c (autocmp_chars): Likewise.
6159 * editfns.c (buildmark): Remove.
6160 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6161 (save_restriction_save): Use build_marker.
6162 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6163 * window.c (save_window_save): Likewise.
6164
6165 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6166
6167 Do not use Fdelete_overlay in delete_all_overlays
6168 to avoid redundant calls to unchain_overlay.
6169 * buffer.c (drop_overlay): New function.
6170 (delete_all_overlays, Fdelete_overlay): Use it.
6171 * minibuf.c (get_minibuffer): Fix comment.
6172
6173 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6174
6175 Port to OpenBSD 5.1 amd64.
6176 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6177 This is needed for OpenBSD, and should be harmless on all BSD systems.
6178 Also, include <sys/sysctl.h>, as it should be available on all
6179 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6180 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6181 use p_pid member, not kp_proc.pid.
6182
6183 2012-07-06 Glenn Morris <rgm@gnu.org>
6184
6185 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6186
6187 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6188
6189 More xmalloc and related cleanup.
6190 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6191 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6192 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6193 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6194 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6195 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6196 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6197 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6198 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6199 * xterm.c:
6200 Omit needless casts involving void * pointers and allocation.
6201 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6202 as the former is more robust if P's type is changed.
6203 Prefer xzalloc to xmalloc + memset 0.
6204 Simplify malloc-or-realloc to realloc.
6205 Don't worry about xmalloc returning a null pointer.
6206 Prefer xstrdup to xmalloc + strcpy.
6207 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6208 growing it.
6209 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6210 alloca of a constant.
6211
6212 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6213
6214 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6215 hscroll is larger than the line width. Fixes long and futile
6216 looping inside extend_face_to_end_of_line (on a TTY) producing
6217 glyphs that are not needed and thrown away.
6218
6219 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6220
6221 * marker.c (set_marker_restricted_both): Simplify by using
6222 clip_to_bounds.
6223
6224 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6225
6226 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6227
6228 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6229
6230 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6231 not defined (Bug#11768).
6232 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6233 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6234 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6235 followed by gtk_box_set_homogeneous (Bug#11768).
6236 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6237 (update_theme_scrollbar_width, xg_create_scroll_bar):
6238 Use gtk_scrollbar_new (Bug#11768).
6239 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6240 (is_box_type): New function (Bug#11768).
6241 (xg_tool_item_stale_p): Call is_box_type.
6242 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6243 with default display (Bug#11768).
6244
6245 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6246
6247 * xdisp.c (window_hscroll_limited): New function.
6248 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6249 coordinates when window's hscroll is set to insanely large
6250 values. (Bug#11857)
6251
6252 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6253
6254 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6255 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6256
6257 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6258
6259 Cleanup xmalloc.
6260 * lisp.h (xzalloc): New prototype. Omit needless casts.
6261 * alloc.c (xzalloc): New function. Omit needless casts.
6262 * charset.c: Omit needless casts. Convert all calls to
6263 xmalloc with following memset to xzalloc.
6264 * dispnew.c: Likewise.
6265 * fringe.c: Likewise.
6266 * image.c: Likewise.
6267 * sound.c: Likewise.
6268 * term.c: Likewise.
6269 * w32fns.c: Likewise.
6270 * w32font.c: Likewise.
6271 * w32term.c: Likewise.
6272 * xfaces.c: Likewise.
6273 * xfns.c: Likewise.
6274 * xterm.c: Likewise.
6275 * atimer.c: Omit needless casts.
6276 * buffer.c: Likewise.
6277 * callproc.c: Likewise.
6278 * ccl.c: Likewise.
6279 * coding.c: Likewise.
6280 * composite.c: Likewise.
6281 * doc.c: Likewise.
6282 * doprnt.c: Likewise.
6283 * editfns.c: Likewise.
6284 * emacs.c: Likewise.
6285 * eval.c: Likewise.
6286 * filelock.c: Likewise.
6287 * fns.c: Likewise.
6288 * gtkutil.c: Likewise.
6289 * keyboard.c: Likewise.
6290 * lisp.h: Likewise.
6291 * lread.c: Likewise.
6292 * minibuf.c: Likewise.
6293 * msdos.c: Likewise.
6294 * print.c: Likewise.
6295 * process.c: Likewise.
6296 * region-cache.c: Likewise.
6297 * search.c: Likewise.
6298 * sysdep.c: Likewise.
6299 * termcap.c: Likewise.
6300 * terminal.c: Likewise.
6301 * tparam.c: Likewise.
6302 * w16select.c: Likewise.
6303 * w32.c: Likewise.
6304 * w32reg.c: Likewise.
6305 * w32select.c: Likewise.
6306 * w32uniscribe.c: Likewise.
6307 * widget.c: Likewise.
6308 * xdisp.c: Likewise.
6309 * xmenu.c: Likewise.
6310 * xrdb.c: Likewise.
6311 * xselect.c: Likewise.
6312
6313 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6314
6315 * fileio.c (time_error_value): Check the right error number.
6316 Problem reported by Troels Nielsen in
6317 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6318
6319 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6320
6321 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6322 This should be fixed in a better way; see Eli Zaretskii in
6323 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6324 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6325
6326 * fileio.c (time_error_value): Rename from special_mtime.
6327 The old name's problems were noted by Eli Zaretskii in
6328 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6329
6330 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6331 This variable's comment says Emacs needs at least one GDB-visible
6332 symbol of type enum pvec_type, to work around GDB problems.
6333 The symbol's value doesn't matter.
6334
6335 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6336 that causes compilation to fail on pre-C99 compilers.
6337
6338 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6339
6340 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6341 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6342
6343 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6344
6345 * buffer.c (init_buffer_once): Fix initialization of
6346 headers for buffer_defaults and buffer_local_symbols.
6347 Reported by Juanma Barranquero <lekktu@gmail.com>.
6348
6349 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6350
6351 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6352 * lisp.h (enum pvec_type): Use fewer bits.
6353 (PSEUDOVECTOR_SIZE_BITS): New constant.
6354 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6355 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6356 change in pvec_type.
6357 (PSEUDOVECTOR_TYPEP): New macro.
6358 (TYPED_PSEUDOVECTORP): Use it.
6359 * fns.c (internal_equal): Adapt code to extract pvectype.
6360 * emacs.c (gdb_pvec_type): Update type.
6361 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6362 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6363 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6364 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6365 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6366 abusing vector->header.next.nbytes.
6367 (live_vector_p): Use PVEC_TYPE.
6368 (mark_object): Adapt code to extract pvectype. Use switch.
6369
6370 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6371
6372 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6373 Tighten new eassert a bit.
6374
6375 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6376
6377 Fix compilation with --enable-gcc-warnings and -O1
6378 optimization level.
6379 * doprnt.c (doprnt): Change type of tem to int, initialize
6380 to avoid compiler warning. Add eassert.
6381 * search.c (simple_search): Initialize match_byte to avoid
6382 compiler warning. Add eassert.
6383
6384 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6385
6386 Avoid weird behavior with large horizontal scrolls.
6387 Without this change, for example, large hscroll values would
6388 mess up Emacs's display on Fedora 15 x86, presumably due to
6389 overflows in int calculations in the display code.
6390 Also, if buffers had long lines, Emacs would freeze.
6391 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6392 (set_window_hscroll): New function, containing the old guts of
6393 Fset_window_hscroll. Return the clipped value.
6394 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6395 This avoids the need to check against PTRDIFF_MAX.
6396
6397 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6398
6399 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6400
6401 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6402
6403 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6404
6405 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6406 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6407 since GCC 4.4.6 issues a bogus warning for them.
6408
6409 Fix bugs in file timestamp newness comparisons.
6410 * fileio.c (Ffile_newer_than_file_p):
6411 * lread.c (Fload): Use full timestamp resolution of files,
6412 not just the 1-second resolution, so that files that are only
6413 slightly newer still count as newer.
6414 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6415 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6416
6417 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6418
6419 * fileio.c: Improve handling of file time marker. (Bug#11852)
6420 (special_mtime): New function.
6421 (Finsert_file_contents, Fverify_visited_file_modtime):
6422 Use it to set special mtime values consistently.
6423
6424 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6425
6426 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6427 marker for non-existing file. (Bug#11852)
6428
6429 2012-07-03 Glenn Morris <rgm@gnu.org>
6430
6431 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6432 and did not make it into globals.h).
6433
6434 2012-07-03 Tom Tromey <tromey@redhat.com>
6435
6436 * window.c (Fset_window_margins, Fset_window_fringes)
6437 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6438 * textprop.c (Fprevious_property_change): No longer static.
6439 * syntax.c (Fsyntax_table_p): No longer static.
6440 * process.c (Fget_process, Fprocess_datagram_address): No longer
6441 static.
6442 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6443 * keyboard.c (Fcommand_execute): No longer static.
6444 Remove EXFUN.
6445 * insdel.c (Fcombine_after_change_execute): No longer static.
6446 * image.c (Finit_image_library): No longer static.
6447 * fileio.c (Fmake_symbolic_link): No longer static.
6448 * eval.c (Ffetch_bytecode): No longer static.
6449 * editfns.c (Fuser_full_name): No longer static.
6450 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6451 No longer static.
6452 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6453 static.
6454 * dired.c (Ffile_attributes): No longer static.
6455 * composite.c (Fcomposition_get_gstring): No longer static.
6456 * callproc.c (Fgetenv_internal): No longer static.
6457
6458 * ccl.h: Remove EXFUNs.
6459 * buffer.h: Remove EXFUNs.
6460 * dispextern.h: Remove EXFUNs.
6461 * intervals.h: Remove EXFUNs.
6462 * fontset.h: Remove EXFUN.
6463 * font.h: Remove EXFUNs.
6464 * dosfns.c (system_process_attributes): Remove EXFUN.
6465 * keymap.h: Remove EXFUNs.
6466 * lisp.h: Remove EXFUNs.
6467 * w32term.h: Remove EXFUNs.
6468 * window.h: Remove EXFUNs.
6469 * xsettings.h: Remove EXFUN.
6470 * xterm.h: Remove EXFUN.
6471
6472 2012-07-03 Glenn Morris <rgm@gnu.org>
6473
6474 * lisp.h (Frandom): Make it visible to C.
6475 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6476 buffer for invisible buffers. (Bug#1229)
6477
6478 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6479
6480 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6481 values which aren't power of 2.
6482 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6483 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
6484 accordingly.
6485
6486 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6487
6488 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6489
6490 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6491
6492 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6493
6494 * alloc.c (allocate_vector_block): Remove redundant
6495 calls to mallopt if DOUG_LEA_MALLOC is defined.
6496 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6497 avoid calls to mallopt if zero_vector is returned.
6498
6499 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6500
6501 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6502 is enabled, avoid dereferencing NULL current_sblock if
6503 running undumped.
6504
6505 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6506
6507 Cleanup basic buffer management.
6508 * buffer.h (struct buffer): Change layout to use generic vector
6509 marking code. Fix some comments. Change type of 'clip_changed'
6510 to bitfield. Remove unused #ifndef old.
6511 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6512 (GET_OVERLAYS_AT): Fix indentation.
6513 (for_each_per_buffer_object_at): New macro.
6514 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6515 (Fbuffer_local_variables): Use it.
6516 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6517 * alloc.c (allocate_buffer): Adjust to match new layout of
6518 struct buffer. Fix comment.
6519 (mark_overlay): New function.
6520 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6521 Lisp area of struct buffer.
6522 (mark_object): Use it. Adjust marking of misc objects
6523 and related comments.
6524
6525 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6526
6527 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6528 wrapper that is not needed because the wrapped code is a no-op (zero
6529 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6530 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6531
6532 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6533
6534 * alloc.c (mark_buffer): Simplify. Remove prototype.
6535 (mark_object): Add comment. Reorganize marking of vector-like
6536 objects. Use CHECK_LIVE for all vector-like objects except buffers
6537 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6538 Avoid redundant calls to mark_vectorlike for bool vectors.
6539
6540 2012-06-30 Glenn Morris <rgm@gnu.org>
6541
6542 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6543
6544 * epaths.in (PATH_SITELOADSEARCH): New.
6545 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6546 This is rather than relying on --enable-locallisppath elements
6547 having "site-lisp" in their names. (Bug#10208#25, 11658)
6548
6549 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6550
6551 * w32proc.c (sys_select): Accept and ignore one more argument.
6552
6553 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6554
6555 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6556 (pselect) [!MS_DOS]: Redirect to sys_select.
6557
6558 * sysdep.c: Don't include dos.h and dosfns.h.
6559
6560 * process.c (sys_select):
6561 * msdos.c (sys_select): Accept one more argument and ignore it.
6562
6563 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6564 adapt data types and code to that.
6565
6566 * dosfns.c:
6567 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6568 which clashes with the gnulib function of the same name.
6569
6570 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6571
6572 * font.c (font_style_to_value, font_style_symbolic)
6573 (font_prop_validate_style): Add type checks for values in
6574 font_style_table.
6575
6576 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6577 argument.
6578 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6579 uses.
6580
6581 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6582
6583 * xdisp.c (try_window_id): Undo last change.
6584
6585 * w32.c (getwd): Adjust commentary about startup_dir.
6586 (init_environment): Always call sys_access, even in non-MSVC
6587 builds. Don't chdir to the directory of the Emacs executable.
6588 This undoes code from 1997 which was justified by the need to
6589 "avoid conflicts when removing and renaming directories". But its
6590 downside was that every relative file name was being interpreted
6591 relative to the directory of the Emacs executable, which can never
6592 be TRT. In particular, it broke sys_access when called with
6593 relative file names.
6594 (sys_access): Map GetLastError to errno.
6595
6596 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6597
6598 * window.h (struct window): Change type of 'fringes_outside_margins'
6599 to bitfield. Fix comment. Adjust users accordingly.
6600 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6601 Adjust comment.
6602 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6603 to ptrdiff_t.
6604
6605 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6606
6607 * gnutls.c (emacs_gnutls_handshake):
6608 Add QUIT to make the loop interruptible.
6609
6610 2012-06-29 Glenn Morris <rgm@gnu.org>
6611
6612 * charset.c (init_charset): Make lack of etc/charsets fatal.
6613
6614 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6615
6616 * editfns.c (region_limit): Fix type mismatch.
6617
6618 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6619
6620 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6621 undefined. Convert from xassert to eassert.
6622 * nsmenu.m: Convert from xassert to eassert.
6623 * nsterm.m: Likewise.
6624
6625 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6626
6627 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6628
6629 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6630
6631 Avoid integer overflow on scroll-left and scroll-right.
6632 * window.c (HSCROLL_MAX): New macro.
6633 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6634 overflow when requested scroll falls outside ptrdiff_t range.
6635
6636 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6637
6638 * window.h (struct window): Change type of 'hscroll',
6639 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6640 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6641 Adjust users accordingly.
6642 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6643 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6644 from EMACS_INT to ptrdiff_t.
6645 (make_window): Omit redundant initialization.
6646
6647 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
6648
6649 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6650
6651 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6652
6653 * window.h (struct window): Change type of 'use_time' and
6654 'sequence_number' from Lisp_Object to int.
6655 * frame.c (make_frame): Adjust users accordingly.
6656 * print.c (print_object): Likewise.
6657 * window.c (select_window, Fwindow_use_time, make_parent_window)
6658 (make_window): Likewise.
6659
6660 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6661
6662 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6663 enabled with --enable-checking=[all,glyphs] configure option.
6664 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6665 adjust comments accordingly.
6666 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6667 undefined, adjust comments accordingly.
6668 * image.c: Likewise.
6669 * scroll.c: Likewise.
6670 * w32fns.c: Likewise.
6671 * w32term.c: Likewise.
6672 * xdisp.c: Likewise.
6673 * xfaces.c: Likewise.
6674 * xfns.c: Likewise.
6675 * xterm.c: Likewise.
6676
6677 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6678
6679 Generalize run-time debugging checks.
6680 * dispextern.h (XASSERTS): Remove.
6681 * fontset.c (xassert): Remove.
6682 Convert from xassert to eassert.
6683 * alloc.c: Convert from xassert to eassert.
6684 * bidi.c: Likewise.
6685 * dispnew.c: Likewise.
6686 * fns.c: Likewise.
6687 * fringe.c: Likewise.
6688 * ftfont.c: Likewise.
6689 * gtkutil.c: Likewise.
6690 * image.c: Likewise.
6691 * keyboard.c: Likewise.
6692 * menu.c: Likewise.
6693 * process.c: Likewise.
6694 * scroll.c: Likewise.
6695 * sound.c: Likewise.
6696 * term.c: Likewise.
6697 * w32console.c: Likewise.
6698 * w32fns.c: Likewise.
6699 * w32term.c: Likewise.
6700 * window.c: Likewise.
6701 * xdisp.c: Likewise.
6702 * xfaces.c: Likewise.
6703 * xfns.c: Likewise.
6704 * xselect.c: Likewise.
6705 * xterm.c: Likewise.
6706
6707 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6708
6709 * fns.c (maybe_resize_hash_table): Output message when growing the
6710 purify-hashtable.
6711
6712 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6713
6714 * alloc.c (allocate_string_data): Remove dead code.
6715 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6716 avoid GCC warning about unused macro.
6717
6718 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6719
6720 * alloc.c (allocate_string): Omit intervals initialization.
6721 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6722 as in make_pure_string and make_pure_c_string.
6723
6724 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6725
6726 * alloc.c (allocate_string): Fix last change.
6727
6728 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6729
6730 * alloc.c (allocate_string): Remove two redundant calls
6731 to memset, add explicit initialization where appropriate.
6732
6733 2012-06-27 Glenn Morris <rgm@gnu.org>
6734
6735 * lisp.mk (lisp): Remove paths.elc.
6736
6737 2012-06-27 Chong Yidong <cyd@gnu.org>
6738
6739 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6740
6741 2012-06-26 John Wiegley <johnw@newartisans.com>
6742
6743 * unexmacosx.c (copy_data_segment): Add two section names used
6744 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6745
6746 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6747 when building with Clang.
6748
6749 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6750
6751 * eval.c (Fapply): Allow calling it with a single argument.
6752
6753 2012-06-26 Eli Zaretskii <eliz@gnu.org>
6754
6755 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6756 _stricmp and _strnicmp.
6757 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6758
6759 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6760
6761 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6762 allocated window.
6763 (allocate_process): Likewise for new process.
6764 (allocate_terminal): Change to use offsetof.
6765 (allocate_frame): Likewise.
6766 * frame.c (make_frame): Omit redundant initialization.
6767 * window.c (make_parent_window): Use memset.
6768 (make_window): Omit redundant initialization.
6769 * process.c (make_process): Omit redundant initialization.
6770 * terminal.c (create_terminal): Likewise.
6771
6772 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6773
6774 * term.c (delete_tty): Remove redundant call to memset.
6775
6776 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6777
6778 * alloc.c: Remove build_string.
6779 * lisp.h: Define build_string as static inline. This provides
6780 a better opportunity to optimize away calls to strlen when the
6781 function is called with compile-time constant argument.
6782 * image.c (imagemagick_error): Convert to build_string.
6783 * w32proc.c (sys_spawnve): Likewise.
6784 * xterm.c (x_term_init): Likewise.
6785
6786 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6787
6788 Use sprintf return value instead of invoking strlen on result.
6789 In the old days this wasn't portable, since some sprintf
6790 implementations returned char *. But they died out years ago and
6791 Emacs already assumes sprintf returns int.
6792 Similarly for float_to_string.
6793 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6794 * ccl.c (ccl_driver):
6795 * character.c (string_escape_byte8):
6796 * data.c (Fnumber_to_string):
6797 * doprnt.c (doprnt):
6798 * print.c (print_object):
6799 * xdisp.c (message_dolog):
6800 * xfns.c (syms_of_xfns):
6801 Use sprintf or float_to_string result to avoid need to call strlen.
6802 * data.c (Fnumber_to_string):
6803 Use make_unibyte_string, since the string must be ASCII.
6804 * lisp.h, print.c (float_to_string): Now returns int length.
6805 * term.c (produce_glyphless_glyph):
6806 Use sprintf result rather than recomputing it.
6807
6808 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6809 * Makefile.in (ALL_CFLAGS):
6810 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6811 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6812
6813 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6814
6815 * dispextern.h (xstrcasecmp): Define to library function
6816 strcasecmp if available.
6817 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6818
6819 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6820
6821 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6822 Avoid comma operator.
6823 * menu.c (push_submenu_start, push_submenu_end)
6824 (push_left_right_boundary, push_menu_pane): Likewise.
6825 * msdos.c (dos_rawgetc): Likewise.
6826
6827 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6828
6829 * xfns.c (xic_create_fontsetname): Remove redundant calls
6830 to memset.
6831
6832 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6833
6834 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6835 sprintf already null-terminates its output.
6836
6837 * xfns.c (x_window): Remove redundant cast.
6838
6839 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6840
6841 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6842 `const char *' to `char *' to avoid compiler warning.
6843
6844 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6845
6846 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6847 instead of truncating it to 63 (admittedly a generous limit).
6848
6849 * process.c: Fix spelling and caps in comments.
6850
6851 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6852
6853 * emacs.c (setpgrp): Remove definition, unused.
6854 * sysdep.c (setpgrp): Remove definition, not used in this file.
6855
6856 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
6857
6858 * makefile.w32-in: Update dependencies.
6859
6860 2012-06-24 Eli Zaretskii <eliz@gnu.org>
6861
6862 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6863 (SYSTIME_H): Add nt/inc/sys/time.h.
6864
6865 * systime.h [WINDOWSNT]: Include sys/time.h.
6866
6867 * s/ms-w32.h (struct timespec): Definition moved from
6868 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6869
6870 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6871
6872 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6873 * buffer.h (buffer_slot_type_mismatch):
6874 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6875 * eval.c (unwind_to_catch):
6876 * image.c (my_png_error, my_error_exit):
6877 * keyboard.c (quit_throw_to_read_char, user_error)
6878 (Fexit_recursive_edit, Fabort_recursive_edit):
6879 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6880 (wrong_type_argument, buffer_overflow, __executable_start)
6881 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6882 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6883 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6884 (fatal):
6885 (child_setup) [!DOS_NT]:
6886 * lread.c (end_of_file_error, invalid_syntax):
6887 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6888 * puresize.h (pure_write_error):
6889 * search.c (matcher_overflow):
6890 * sound.c (sound_perror, alsa_sound_perror):
6891 * sysdep.c, syssignal.h (croak):
6892 * term.c (maybe_fatal, vfatal):
6893 * textprop.c (text_read_only):
6894 * undo.c (user_error):
6895 * unexmacosx.c (unexec_error):
6896 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6897 Use _Noreturn rather than NO_RETURN.
6898 No need for separate decl merely because of _Noreturn.
6899 * sound.c (sound_warning, parse_sound):
6900 Remove unnecessary forward decls.
6901
6902 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6903
6904 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6905 * lisp.h (WAIT_READING_MAX): New macro.
6906 * dispnew.c (Fsleep_for, sit_for):
6907 * keyboard.c (kbd_buffer_get_event):
6908 * process.c (Faccept_process_output):
6909 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6910 This improves on the previous patch, which introduced a bug
6911 when time_t is unsigned and as wide as intmax_t.
6912 See <http://bugs.gnu.org/9000#51>.
6913
6914 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6915
6916 * dispnew.c (sit_for, Fsleep_for):
6917 * keyboard.c (kbd_buffer_get_event):
6918 * process.c (Faccept_process_output): Avoid compiler warnings when
6919 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6920
6921 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
6922
6923 * makefile.w32-in: Update dependencies.
6924
6925 * w32.c (ltime): Add return type and declare static.
6926 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6927
6928 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6929
6930 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6931 Privately reported by Herbert J. Skuhra.
6932 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6933 All uses changed.
6934 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6935 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6936
6937 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6938
6939 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6940 last argument of make_unibyte_string.
6941
6942 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6943 language ID in the event parameters.
6944
6945 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6946 event.code, not the obscure "character set ID".
6947
6948 2012-06-23 Chong Yidong <cyd@gnu.org>
6949
6950 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6951
6952 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6953
6954 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6955 * w32.c (fdutimens): New function.
6956
6957 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6958
6959 * s/ms-w32.h (pselect): Redirect to sys_select.
6960
6961 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6962
6963 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6964 in the logic of incrementing and decrementing the value of
6965 use_relocatable_buffers.
6966
6967 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6968
6969 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6970 Privately reported by Herbert J. Skuhra.
6971 [__FreeBSD__]: Remove "*/" typo after "#include".
6972 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6973 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6974 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6975 Don't assume EMACS_TIME and struct timeval are the same type.
6976
6977 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6978
6979 Support higher-resolution time stamps (Bug#9000).
6980 The time stamps are only nanosecond-resolution at the C level,
6981 since that's the best that any real-world system supports now.
6982 But they are picosecond-resolution at the Lisp level, as that's
6983 easy, and leaves room for future OS improvements.
6984
6985 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6986 (LIBES): Use it.
6987
6988 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6989 Don't get current time unless it's needed.
6990
6991 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6992 now provides it if it's absent.
6993 (start_atimer): Port to higher-res time stamps.
6994 Check for time stamp overflow. Don't get current time more
6995 often than is needed.
6996
6997 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6998 Include systime.h, not time.h.
6999 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7000
7001 * dired.c: Include stat-time.h.
7002 (Ffile-attributes): File times now have higher resolution.
7003
7004 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7005 (struct image): Timestamp now has higher resolution.
7006
7007 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7008 has at least microseconds now. All uses removed.
7009 (update_frame, update_single_window, update_window, update_frame_1)
7010 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7011 (duration_to_sec_usec): Remove; no longer needed.
7012
7013 * editfns.c (time_overflow): Now extern.
7014 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7015 (float-time, Fformat_time_string, Fcurrent_time_string)
7016 (Fcurrent_time_zone): Accept and generate higher-resolution
7017 time stamps.
7018 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7019 (decode_time_components, lisp_seconds_argument): New functions.
7020 (make_time): Now static.
7021 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7022 Report an error if the time is invalid, rather than having the caller
7023 do that.
7024
7025 * fileio.c: Include <stat-time.h>
7026 (Fcopy_file): Copy higher-resolution time stamps.
7027 Prefer to set the time stamp via a file descriptor if that works.
7028 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7029 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7030 (Fvisited_file_modtime, Fset_visited_file_modtime):
7031 Support higher-resolution time stamps.
7032
7033 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7034
7035 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7036
7037 * image.c (prepare_image_for_display, clear_image_cache)
7038 (lookup_image): Port to higer-resolution time stamps.
7039
7040 * keyboard.c (start_polling, bind_polling_period):
7041 Check for time stamp overflow.
7042 (read_char, kbd_buffer_get_event, timer_start_idle)
7043 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7044 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7045 Port to higher-resolution time stamps. Do not assume time_t is signed.
7046 (decode_timer): New function. Timers are now vectors of length 9,
7047 not 8, to accommodate the picosecond component.
7048 (timer_check_2): Use it.
7049
7050 * nsterm.m (select_timeout, timeval_subtract): Remove.
7051 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7052 as they're a bit more accurate and handle overflow better.
7053 (ns_select): Change prototype to be compatible with pselect.
7054 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7055 * nsterm.h (ns_select): Adjust prototype.
7056
7057 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7058 us-resolution time stamps.
7059 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7060
7061 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7062
7063 * lisp.h (time_overflow): New decl.
7064 (wait_reading_process_output): First arg is now intmax_t, not int,
7065 to accommodate larger waits.
7066
7067 * process.h (struct Lisp_Process.read_output_delay):
7068 Now counts nanoseconds, not microseconds.
7069 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7070 EMACS_HAS_USECS.
7071 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7072 (wait_reading_process_output):
7073 Port to ns-resolution time stamps.
7074 (Faccept_process_output, wait_reading_process_output):
7075 Check for time stamp overflow. Do not assume time_t is signed.
7076 (select_wrapper): Remove; we now use pselect.
7077 (Fprocess_attributes): Now generates ns-resolution time stamps.
7078
7079 * sysdep.c: Include utimens.h. Don't include utime.h
7080 or worry about struct utimbuf; gnulib does that for us now.
7081 (gettimeofday): Remove; gnulib provides a substitute.
7082 (make_timeval): New function.
7083 (set_file_times): Now sets ns-resolution time stamps.
7084 New arg FD; all uses changed.
7085 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7086 (system_process_attributes):
7087 Now returns ns-resolution time stamp. All uses changed.
7088 Check for time stamp overflow.
7089
7090 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7091 provides a substitute now.
7092
7093 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7094 since it guarantees struct timespec.
7095 (EMACS_TIME): Now struct timespec, so that we can support
7096 ns-resolution time stamps.
7097 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7098 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7099 (EMACS_USECS): Remove.
7100 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7101 so multiply the arg by 1000 before storing it.
7102 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7103 New macros.
7104 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7105 Port to ns-resolution time stamps.
7106 (EMACS_TIME_NEG_P): Remove; replaced by....
7107 (EMACS_TIME_SIGN): New macro.
7108 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7109 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7110 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7111 (make_timeval, make_lisp_time, decode_time_components): New decls.
7112 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7113 that it mishandled time_t overflow. You can't compare by subtracting!
7114 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7115 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7116
7117 * term.c: Include <sys/time.h>.
7118 (timeval_to_Time): New function, for proper overflow wraparound.
7119 (term_mouse_position, term_mouse_click): Use it.
7120
7121 * undo.c (record_first_change): Support higher-resolution time stamps
7122 in the undo buffer.
7123 (Fprimitive_undo): Use them when restoring time stamps.
7124
7125 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7126 (w32_get_internal_run_time):
7127 Port to higher-resolution Emacs time stamps.
7128 (ltime): Now accepts single 64-bit integer, as that's more convenient
7129 for callers.
7130
7131 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7132
7133 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7134 for compatibility with pselect. Support ns-resolution time stamps.
7135
7136 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7137
7138 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7139 Check for time stamp overflow, and support ns-resolution time stamps.
7140
7141 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7142 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7143 (timeval_subtract): Remove; no longer needed.
7144 (XTflash, XTring_bell, x_wait_for_event):
7145 Port to ns-resolution time stamps. Don't assume time_t is signed.
7146
7147 2012-06-22 Chong Yidong <cyd@gnu.org>
7148
7149 * xdisp.c (x_consider_frame_title): Revert last change.
7150
7151 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7152
7153 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7154 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7155 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7156 staticidx goes up to 1597 out of 1600 = 0x640.)
7157
7158 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7159
7160 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7161 Otherwise, the umask might be mistakenly 0 while handling input signals.
7162
7163 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7164
7165 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7166
7167 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7168
7169 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7170 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7171 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7172 access to `contents' member of Lisp_Vector objects with AREF and ASET
7173 where appropriate.
7174
7175 2012-06-19 Chong Yidong <cyd@gnu.org>
7176
7177 * frame.c (delete_frame): When selecting a frame on a different
7178 text terminal, do not alter the terminal's top-frame.
7179
7180 * xdisp.c (format_mode_line_unwind_data): Record the target
7181 frame's selected window and its terminal's top-frame.
7182 (unwind_format_mode_line): Restore them.
7183 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7184 Callers changed.
7185 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7186 since tty frames can be explicitly named.
7187 (prepare_menu_bars): Likewise.
7188
7189 * term.c (Ftty_top_frame): New function.
7190
7191 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7192
7193 Port byte-code-meter to modern targets.
7194 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7195 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7196 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7197 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7198 (METER_1, METER_2): Simplify.
7199
7200 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7201
7202 * data.c (Fdefalias): Return `symbol' (bug#11686).
7203
7204 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7205
7206 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7207 gets killed during executing of this function (Bug#11665).
7208 Try to always return Qt when the buffer has been actually killed.
7209 (Vkill_buffer_query_functions): In doc-string say that functions
7210 run by this hook should not change the current buffer.
7211
7212 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7213
7214 Fix recently-introduced process.c problems found by static checking.
7215 * process.c (write_queue_push, write_queue_pop, send_process):
7216 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7217 (write_queue_pop): Fix pointer signedness problem.
7218 (send_process): Remove unused local.
7219
7220 2012-06-17 Chong Yidong <cyd@gnu.org>
7221
7222 * xdisp.c (redisplay_internal): No need to redisplay terminal
7223 frames that are not on top.
7224
7225 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7226
7227 * process.c (make_process): Initialize write_queue.
7228 (write_queue_push, write_queue_pop): New functions.
7229 (send_process): Use them to maintain correct ordering of process
7230 writes (Bug#10815).
7231
7232 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7233
7234 * lisp.h (eassert): Assume C89 or later.
7235 This removes the need for CHECK.
7236 (CHECK): Remove. Its comments about always evaluating its
7237 argument were confusing, as 'eassert' typically does not evaluate
7238 its argument.
7239
7240 * coding.c (produce_chars): Use ptrdiff_t, not int.
7241
7242 * xterm.c (x_draw_underwave): Check for integer overflow.
7243 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7244
7245 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7246
7247 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7248 referenced (Bug#11583).
7249
7250 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7251
7252 Implement wave-style variant of underlining.
7253 * dispextern.h (face_underline_type): New enum.
7254 (face): Add field for underline type.
7255 * nsterm.m (ns_draw_underwave): New function.
7256 (ns_draw_text_decoration): Use it.
7257 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7258 New functions.
7259 (x_draw_glyph_string): Use them.
7260 * xfaces.c (Qline, Qwave): New Lisp objects.
7261 (check_lface_attrs, merge_face_ref)
7262 (Finternal_set_lisp_face_attribute, realize_x_face):
7263 Handle wave-style underline face attributes.
7264 * xterm.c (x_draw_underwave): New function.
7265 (x_draw_glyph_string): Use it.
7266
7267 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7268
7269 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7270 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7271 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7272 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7273 ($(BLD)/w32select.$(O)): Update dependencies.
7274
7275 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7276
7277 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7278 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7279 * character.c (_fetch_multibyte_char_p): Remove.
7280 * alloc.c: Include "character.h" before "buffer.h".
7281 * bidi.c: Likewise.
7282 * buffer.c: Likewise.
7283 * bytecode.c: Likewise.
7284 * callint.c: Likewise.
7285 * callproc.c: Likewise.
7286 * casefiddle.c: Likewise.
7287 * casetab.c: Likewise.
7288 * category.c: Likewise.
7289 * cmds.c: Likewise.
7290 * coding.c: Likewise.
7291 * composite.c: Likewise.
7292 * dired.c: Likewise.
7293 * dispnew.c: Likewise.
7294 * doc.c: Likewise.
7295 * dosfns.c: Likewise.
7296 * editfns.c: Likewise.
7297 * emacs.c: Likewise.
7298 * fileio.c: Likewise.
7299 * filelock.c: Likewise.
7300 * font.c: Likewise.
7301 * fontset.c: Likewise.
7302 * fringe.c: Likewise.
7303 * indent.c: Likewise.
7304 * insdel.c: Likewise.
7305 * intervals.c: Likewise.
7306 * keyboard.c: Likewise.
7307 * keymap.c: Likewise.
7308 * lread.c: Likewise.
7309 * macros.c: Likewise.
7310 * marker.c: Likewise.
7311 * minibuf.c: Likewise.
7312 * nsfns.m: Likewise.
7313 * nsmenu.m: Likewise.
7314 * print.c: Likewise.
7315 * process.c: Likewise.
7316 * regex.c: Likewise.
7317 * region-cache.c: Likewise.
7318 * search.c: Likewise.
7319 * syntax.c: Likewise.
7320 * term.c: Likewise.
7321 * textprop.c: Likewise.
7322 * undo.c: Likewise.
7323 * unexsol.c: Likewise.
7324 * w16select.c: Likewise.
7325 * w32fns.c: Likewise.
7326 * w32menu.c: Likewise.
7327 * window.c: Likewise.
7328 * xdisp.c: Likewise.
7329 * xfns.c: Likewise.
7330 * xmenu.c: Likewise.
7331 * xml.c: Likewise.
7332 * xselect.c: Likewise.
7333
7334 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7335
7336 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7337 If all the glyphs of the glyph row came from strings, and we have no
7338 cursor positioning clues, put the cursor on the first glyph of the
7339 row.
7340 (handle_face_prop): Use chunk-relative overlay string index when
7341 indexing into it->string_overlays array. (Bug#11653)
7342 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7343 the rightmost. (Bug#11720)
7344
7345 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7346
7347 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7348 (CATEGORY_MEMBER): Enforce 1/0 value.
7349 * category.c (_temp_category_set): Remove.
7350
7351 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7352
7353 * window.c (Fdelete_other_windows_internal)
7354 (Fdelete_window_internal): Don't access frame's mouse highlight
7355 info of the initial frame. (Bug#11677)
7356
7357 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7358
7359 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7360 Assume USE_2_TAGS_FOR_INTS.
7361 (xreload): Adjust $tagmask width to match recent lisp.h change.
7362
7363 Simplify lisp.h in minor ways that should not affect code.
7364 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7365 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7366 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7367 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7368 (INTTYPEBITS): New macro, for clarity.
7369 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7370 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7371 Simplify now that USE_LSB_TAG is always defined.
7372 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7373 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7374
7375 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7376
7377 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7378
7379 2012-06-13 Glenn Morris <rgm@gnu.org>
7380
7381 * s/bsd-common.h (BSD4_3):
7382 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7383
7384 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7385
7386 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7387 instead of union.
7388 (XLI, XIL): Define.
7389 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7390 Use them.
7391 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7392 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7393 * alloc.c (widen_to_Lisp_Object): Remove.
7394 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7395 * frame.c (delete_frame): Remove outdated comment.
7396 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7397 USE_LISP_UNION_TYPE.
7398 (Fw32_unregister_hot_key): Likewise.
7399 (Fw32_toggle_lock_key): Likewise.
7400 * w32menu.c (add_menu_item): Likewise.
7401 (w32_menu_display_help): Use XIL instead of checking
7402 USE_LISP_UNION_TYPE.
7403 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7404 (init_heap): Likewise.
7405 * w32term.c (w32_read_socket): Update comment.
7406
7407 2012-06-13 Glenn Morris <rgm@gnu.org>
7408
7409 * s/usg5-4-common.h, src/s/unixware.h:
7410 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7411
7412 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7413
7414 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7415
7416 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7417 * alloc.c (make_number) [!defined make_number]:
7418 Remove, as lisp.h always defines this now.
7419 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7420 (roundup_size): Verify that it is a power of 2.
7421 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7422 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7423 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7424 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7425 USE_LSB_TAG now is always defined to be either 0 or 1.
7426 All uses changed.
7427 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7428 code works fine either way, and efficiency is not a concern here,
7429 as the union type is for debugging, not for production.
7430 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7431 Use an inline function on all platforms when using the union type,
7432 since this is simpler and 'static inline' can be used portably
7433 within Emacs now.
7434 (LISP_INITIALLY_ZERO): New macro.
7435 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7436 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7437
7438 2012-06-12 Glenn Morris <rgm@gnu.org>
7439
7440 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7441
7442 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7443
7444 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7445 Move BROKEN_SIGIO to configure.
7446
7447 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7448 Move NO_TERMIO to configure.
7449
7450 2012-06-12 Chong Yidong <cyd@gnu.org>
7451
7452 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7453 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7454 MagickExportImagePixels is undefined.
7455
7456 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7457
7458 * image.c (imagemagick_load_image): Remove unused label.
7459
7460 2012-06-11 Glenn Morris <rgm@gnu.org>
7461
7462 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7463 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7464 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7465 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7466
7467 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7468
7469 * alloc.c (make_byte_code): New function.
7470 (Fmake_byte_code): Use it. Don't purify here.
7471 * lread.c (read1): Use it as well to avoid extra allocation.
7472
7473 2012-06-11 Chong Yidong <cyd@gnu.org>
7474
7475 * image.c (imagemagick_load_image): Implement transparency.
7476
7477 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7478
7479 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7480 account for preceding backslashes. (Bug#11663)
7481
7482 2012-06-09 Chong Yidong <cyd@gnu.org>
7483
7484 * term.c: Support italics in capable terminals (Bug#9652).
7485 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7486 (turn_on_face): Output using TS_enter_italic_mode if available.
7487 Don't handle unused blinking and alt-charset cases.
7488 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7489 and tty_alt_charset_p cases.
7490 (tty_capable_p, init_tty): Support italics.
7491
7492 * termchar.h (struct tty_display_info): Add field for italics.
7493 Remove unused blink field.
7494
7495 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7496 Handle slant.
7497
7498 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7499 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7500 tty_alt_charset_p. Add tty_italic_p.
7501
7502 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7503
7504 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7505 dbus_type_is_basic if available.
7506 (xd_extract_signed, xd_extract_unsigned): Rename from
7507 extract_signed and extract_unsigned, respectively. Adapt callers.
7508
7509 2012-06-09 Chong Yidong <cyd@gnu.org>
7510
7511 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7512
7513 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7514 case (Bug#9752).
7515
7516 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7517
7518 * xdisp.c (vmessage): Treat frame message as multibyte.
7519 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7520 would generate the diagnostic "Making \302\247 buffer-local while
7521 let-bound!".
7522
7523 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7524
7525 * dispnew.c (showing_window_margins_p): Undo last change, which
7526 was done due to an inadvertent commit.
7527 (adjust_frame_glyphs_for_frame_redisplay): Do call
7528 showing_window_margins_p.
7529
7530 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7531
7532 * eval.c (Fmake_var_non_special): New primitive.
7533 (syms_of_eval): Defsubr it.
7534 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7535
7536 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7537
7538 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7539 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7540
7541 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7542
7543 * alloc.c (allocate_vectorlike): Fix last change.
7544
7545 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7546
7547 Block-based vector allocation of small vectors.
7548 * lisp.h (struct vectorlike_header): New field `nbytes',
7549 adjust comment accordingly.
7550 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7551 to denote vector blocks. Adjust users (live_vector_p,
7552 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7553 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7554 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7555 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7556 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7557 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7558 (roundup_size): New constant.
7559 (struct vector_block): New data type.
7560 (vector_blocks, vector_free_lists, zero_vector): New variables.
7561 (all_vectors): Rename to `large_vectors'.
7562 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7563 (sweep_vectors): New functions.
7564 (allocate_vectorlike): Return `zero_vector' as the only vector of
7565 0 items. Allocate new vector from block if vector size is less than
7566 or equal to VBLOCK_BYTES_MAX.
7567 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7568 (init_alloc_once): Add call to init_vectors.
7569
7570 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7571
7572 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7573
7574 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7575
7576 * doprnt.c (doprnt): Truncate multibyte char correctly.
7577 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7578 would mishandle a string argument "Xc" if X was a multibyte
7579 character of length 2: it would truncate after X's first byte
7580 rather than including all of X.
7581
7582 2012-06-06 Chong Yidong <cyd@gnu.org>
7583
7584 * buffer.c (word_wrap): Doc fix.
7585
7586 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7587
7588 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7589
7590 2012-06-03 Glenn Morris <rgm@gnu.org>
7591
7592 * xdisp.c (tool-bar-style): Doc fix.
7593
7594 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7595
7596 * Makefile.in (PAXCTL): Define.
7597 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7598 binary via PaX flags if the paxctl utility is available.
7599 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7600 Restore PaX flags to their default. (Bug#11398)
7601
7602 2012-06-03 Chong Yidong <cyd@gnu.org>
7603
7604 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7605 buffer (Bug#11226).
7606
7607 2012-06-03 Chong Yidong <cyd@gnu.org>
7608
7609 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7610 (note_mode_line_or_margin_highlight): If there is no help echo,
7611 use mode-line-default-help-echo. Handle the case where the mouse
7612 position is past the end of the mode line string.
7613
7614 * buffer.c (buffer_local_value_1): New function, split from
7615 Fbuffer_local_value; can return Qunbound.
7616 (Fbuffer_local_value): Use it.
7617 (Vmode_line_format): Docstring tweaks.
7618
7619 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7620
7621 * sysdep.c (system_process_attributes): Improve comment.
7622
7623 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7624
7625 * keyboard.c: Export real-this-command to Elisp.
7626 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7627 and DEFVAR it. Update all users.
7628
7629 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7630
7631 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7632
7633 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7634 Convert pctcpu and pctmem to Lisp float properly.
7635 Let the compiler fold better, as 100.0/0x8000 is exact.
7636
7637 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7638
7639 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7640 cons_block.
7641
7642 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7643
7644 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7645
7646 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7647
7648 For a 'struct window', replace some Lisp_Object fields to
7649 bitfields where appropriate, remove unused fields.
7650 * window.h (struct window): Remove unused 'last_mark_x' and
7651 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7652 change its type from Lisp_Object to bitfield.
7653 Change type of 'force_start', 'optional_new_start',
7654 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7655 fields from Lisp_Object to bitfield. Adjust users accordingly.
7656
7657 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7658
7659 Pacify gcc -Wdouble-precision when using Xaw.
7660 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7661 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7662 Use 'float' consistently, rather than 'float' in most places
7663 and 'double' in a couple of places.
7664
7665 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7666
7667 * xdisp.c (handle_stop): Detect whether we have overlay strings
7668 loaded by testing it->current.overlay_string_index to be
7669 non-negative, instead of checking whether n_overlay_strings is
7670 positive. (Bug#11587)
7671
7672 2012-05-31 Chong Yidong <cyd@gnu.org>
7673
7674 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7675
7676 * doc.c (Fsubstitute_command_keys): Doc fix.
7677
7678 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7679
7680 * search.c (search_buffer): Remove calls to
7681 r_alloc_inhibit_buffer_relocation, as it is now called by
7682 maybe_unify_char, which was the cause of relocation of buffer text
7683 in bug#11519.
7684
7685 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7686
7687 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7688 for the duration of call to load_charset, to avoid problems with
7689 callers of maybe_unify_char that access buffer text through C
7690 pointers.
7691
7692 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7693 decrement the inhibition flag, instead of just setting or
7694 resetting it.
7695
7696 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7697
7698 Remove obsolete '#define static' cruft.
7699 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7700 This #undef was "temporary" in 2000; it is no longer needed
7701 now that '#define static' has gone away.
7702 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7703 (gray_bitmap_bits): Remove; no longer needed.
7704 All uses replaced with definiens.
7705 * xterm.c: Include "bitmaps/gray.xbm".
7706
7707 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7708
7709 Clean up __executable_start, monstartup when --enable-profiling.
7710 The following changes affect the code only when profiling.
7711 * dispnew.c (__executable_start): Rename from safe_bcopy.
7712 Define only on platforms that need it.
7713 * emacs.c: Include <sys/gmon.h> when profiling.
7714 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7715 (__executable_start): Remove decl, since lisp.h does it now.
7716 (safe_bcopy): Remove decl; no longer has that name.
7717 (main): Coalesce #if into single bit of code, for simplicity.
7718 Cast pointers to uintptr_t, since standard libraries want integers
7719 and not pointers.
7720 * lisp.h (__executable_start): New decl.
7721
7722 2012-05-31 Glenn Morris <rgm@gnu.org>
7723
7724 * image.c (Fimagemagick_types): Doc fix.
7725
7726 2012-05-30 Jim Meyering <meyering@redhat.com>
7727
7728 * callproc.c (Fcall_process_region): Include directory component
7729 in mkstemp error message (Bug#11586).
7730
7731 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7732
7733 * alloc.c, lisp.h (make_pure_vector): Now static.
7734
7735 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7736
7737 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7738 Move to byte-run.el.
7739 (Fautoload): Do the hash-doc more carefully.
7740 * data.c (Fdefalias): Purify definition, except for keymaps.
7741 (Qdefun): Move from eval.c.
7742 * lisp.h (Qdefun): Remove.
7743 * lread.c (read1): Tiny simplification.
7744
7745 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
7746
7747 Do not create empty overlays with the evaporate property (Bug#9642).
7748 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7749 Bug#9642, but explicitly check that the buffer the overlay would
7750 be moved to is live and rearrange lines to make sure that errors
7751 will not put the overlay in an inconsistent state.
7752 (Fdelete_overlay): Cosmetics.
7753
7754 2012-05-28 Eli Zaretskii <eliz@gnu.org>
7755
7756 * w32term.c (my_bring_window_to_top): New function.
7757 (x_raise_frame): Use handle returned by DeferWindowPos, which
7758 could be different from the original one.
7759 Call my_bring_window_to_top instead of my_set_foreground_window.
7760 (Bug#11513)
7761
7762 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7763 by calling BringWindowToTop.
7764
7765 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7766 (WM_EMACS_END): Increase by one.
7767
7768 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7769
7770 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7771 This avoids undefined behavior that might cause the eassert
7772 to not catch an out-of-range value.
7773
7774 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
7775
7776 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7777 Update dependencies.
7778
7779 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7780
7781 * bidi.c (bidi_mirror_char): Fix last change.
7782
7783 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7784
7785 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7786 when referring to sectname field in printf format.
7787
7788 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7789
7790 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7791 Only r_alloc_inhibit_buffer_relocation needed to be added;
7792 the others were already declared.
7793
7794 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7795 before checking whether it's out of range. Put the check inside
7796 eassert. See
7797 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7798
7799 2012-05-27 Ken Brown <kbrown@cornell.edu>
7800
7801 * callproc.c (Fcall_process): Restore a line that was accidentally
7802 commented out in the 2011-02-13 change (bug#11547).
7803
7804 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7805
7806 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7807 defined on ralloc.c.
7808
7809 * buffer.c [REL_ALLOC]: Remove prototypes of
7810 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7811 they are now on lisp.h.
7812
7813 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7814
7815 * search.c (search_buffer): Use it to inhibit relocation of buffer
7816 text while re_search_2 is doing its job, because re_search_2 is
7817 passed C pointers to buffer text. (Bug#11519)
7818
7819 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7820 Update value to 24.
7821
7822 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7823 state after an additional call to move_it_in_display_line_to, keep
7824 the values of it->max_ascent and it->max_descent found for the
7825 entire line.
7826 (pos_visible_p): Revert the comparison against bottom_y to what it
7827 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7828 (Bug#11464)
7829
7830 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7831
7832 Fix coding-related core dumps with gcc -ftrapv.
7833 The code was computing A - B, where A and B are pointers, and B is
7834 random garbage. This can lead to core dumps on platforms that
7835 have special pointer registers, and it also leads to core dumps on
7836 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7837 A - B only when B is initialized properly.
7838 * coding.c (coding_set_source, coding_set_destination): Return void.
7839 (coding_change_source, coding_change_destinations): New functions,
7840 with the old behaviors of coding_set_source and coding_set_destination.
7841 All callers that need an offset changed to use these new functions.
7842
7843 2012-05-26 Glenn Morris <rgm@gnu.org>
7844
7845 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7846
7847 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7848
7849 Extend mouse support on W32 text-mode console.
7850 * xdisp.c (draw_row_with_mouse_face):
7851 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7852
7853 * w32console.c: Include window.h.
7854 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7855 New functions.
7856 (initialize_w32_display): Initialize mouse-highlight data.
7857
7858 * w32inevt.c: Include termchar.h and window.h.
7859 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7860 moves, call note_mouse_highlight. If help_echo changed, call
7861 gen_help_event to produce help-echo message in the echo area.
7862 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7863 highlight info.
7864
7865 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7866
7867 * lread.c (read1): Simplify slightly to avoid an overflow warning
7868 with GCC 4.7.0 on x86-64.
7869
7870 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7871
7872 * bidi.c (bidi_mirror_char): Revert last change: an int is
7873 definitely wide enough here.
7874
7875 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
7876
7877 Fix integer width and related bugs (Bug#9874).
7878 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7879 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7880 (string_bytes, check_sblock, allocate_string_data):
7881 (compact_small_strings, Fmake_bool_vector, make_string)
7882 (make_unibyte_string, make_multibyte_string)
7883 (make_string_from_bytes, make_specified_string)
7884 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7885 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7886 (mark_vectorlike):
7887 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7888 (allocate_pseudovector):
7889 Use int, not EMACS_INT, where int is wide enough.
7890 (inhibit_garbage_collection, Fgarbage_collect):
7891 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7892 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7893 int might not be wide enough.
7894 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7895 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7896 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7897 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7898 (bidi_level_of_next_char, bidi_move_to_visually_next):
7899 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7900 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7901 (Fkill_buffer, Fset_buffer_major_mode)
7902 (advance_to_char_boundary, Fbuffer_swap_text)
7903 (Fset_buffer_multibyte, overlays_at, overlays_in)
7904 (overlay_touches_p, struct sortvec, record_overlay_string)
7905 (overlay_strings, recenter_overlay_lists)
7906 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7907 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7908 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7909 (Foverlay_recenter, last_overlay_modification_hooks_used)
7910 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7911 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7912 (validate_region): Omit unnecessary test for b <= e,
7913 since that's guaranteed by the previous test.
7914 (adjust_overlays_for_delete): Avoid pos + length overflow.
7915 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7916 (report_overlay_modification):
7917 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7918 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7919 Omit pointer cast, which isn't needed anyway, and doesn't work
7920 after the EMACS_INT -> ptrdiff_t change.
7921 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7922 * buffer.h: Adjust decls to match defn changes elsewhere.
7923 (struct buffer_text, struct buffer):
7924 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7925 Use EMACS_INT, not int, where int might not be wide enough.
7926 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7927 not int, to avoid needless 32-bit limit on 64-bit hosts.
7928 (exec_byte_code): Use tighter memory-full test, one that checks
7929 for alloca overflow. Don't compute the address of the object just
7930 before an array, as that's not portable. Use EMACS_INT, not
7931 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7932 * callint.c (Fcall_interactively):
7933 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7934 * callproc.c (call_process_kill, Fcall_process):
7935 Don't assume pid_t fits into an Emacs fixnum.
7936 (call_process_cleanup, Fcall_process, child_setup):
7937 Don't assume pid_t fits into int.
7938 (call_process_cleanup, Fcall_process, delete_temp_file)
7939 (Fcall_process_region):
7940 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7941 (Fcall_process): Simplify handling of volatile integers.
7942 Use int, not EMACS_INT, where int will do.
7943 * casefiddle.c (casify_object, casify_region, operate_on_word)
7944 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7945 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7946 (casify_object): Avoid integer overflow when overallocating buffer.
7947 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7948 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
7949 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7950 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7951 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7952 integers are now checked earlier. All uses replaced with XINT.
7953 (ccl_driver):
7954 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7955 For CCL_MapSingle, check that content and value are in int range.
7956 (ccl_driver, Fregister_code_conversion_map):
7957 Check that Vcode_version_map_vector is a vector.
7958 (resolve_symbol_ccl_program): Check that vector header is in range.
7959 Always copy the vector, so that we can check its contents reliably
7960 now rather than having to recheck each instruction as it's being
7961 executed. Check that vector words fit in 'int'.
7962 (ccl_get_compiled_code, Fregister_ccl_program)
7963 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7964 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7965 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7966 contents are in range.
7967 (Fccl_execute_on_string): Check that status is in range.
7968 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7969 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7970 Accept and return EMACS_INT, not int, because callers can pass values
7971 out of 'int' range.
7972 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7973 (multibyte_chars_in_text, parse_str_as_multibyte)
7974 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7975 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7976 (string_escape_byte8, Fget_byte):
7977 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7978 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7979 avoid mishandling large integers.
7980 * character.h: Adjust decls to match defn changes elsewhere.
7981 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7982 (Ffind_charset_region):
7983 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7984 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7985 (load_charset_map_from_vector, Fdefine_charset_internal):
7986 Don't assume fixnum fits in int.
7987 (load_charset_map_from_vector, Fmap_charset_chars):
7988 Remove now-unnecessary CHECK_NATNUMs.
7989 (Fdefine_charset_internal): Check ranges here, more carefully.
7990 Don't rely on undefined behavior with signed left shift overflow.
7991 Don't assume unsigned int fits into fixnum, or that fixnum fits
7992 into unsigned int. Don't require max_code to be a valid fixnum;
7993 that's not true for gb10830 4-byte on a 32-bit host. Allow
7994 invalid_code to be a cons, for the same reason. Require code_offset
7995 to be a character. Avoid int overflow if max_char is close
7996 to INT_MAX.
7997 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7998 this is intended anyway and avoids some undefined behavior.
7999 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8000 INDEX_TO_CODE_POINT, as that's what it expects.
8001 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8002 * charset.h (DECODE_CHAR): Return int, not unsigned;
8003 this is what was intended anyway, and it avoids undefined behavior.
8004 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8005 integer-overflow issues.
8006 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8007 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8008 where the argument is EMACS_INT, and this behavior is not intended.
8009 * chartab.c (Fmake_char_table, Fset_char_table_range)
8010 (uniprop_get_decoder, uniprop_get_encoder):
8011 Don't assume fixnum fits in int.
8012 * cmds.c (move_point): New function, that does the gist of
8013 Fforward_char and Fbackward_char, but does so while checking
8014 for integer overflow more accurately.
8015 (Fforward_char, Fbackward_char): Use it.
8016 (Fforward_line, Fend_of_line, internal_self_insert)
8017 (internal_self_insert):
8018 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8019 Fix a FIXME, by checking for integer overflow when calculating
8020 target_clm and actual_clm.
8021 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8022 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8023 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8024 (coding_alloc_by_making_gap, alloc_destination)
8025 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8026 (encode_coding_utf_16, detect_coding_emacs_mule)
8027 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8028 (detect_coding_iso_2022, decode_coding_iso_2022)
8029 (encode_invocation_designation, encode_designation_at_bol)
8030 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8031 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8032 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8033 (encode_coding_ccl, encode_coding_raw_text)
8034 (detect_coding_charset, decode_coding_charset)
8035 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8036 (produce_composition, produce_charset, produce_annotation)
8037 (decode_coding, handle_composition_annotation)
8038 (handle_charset_annotation, consume_chars, decode_coding_gap)
8039 (decode_coding_object, encode_coding_object, detect_coding_system)
8040 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8041 (code_convert_region, code_convert_string)
8042 (Fdefine_coding_system_internal)
8043 (coding_set_source, coding_set_destination):
8044 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8045 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8046 (Fdefine_coding_system_internal):
8047 Don't assume fixnums fit in int.
8048 (decode_coding_gap, decode_coding_object, encode_coding_object)
8049 (Fread_coding_system, Fdetect_coding_region)
8050 (Funencodable_char_position, Fcheck_coding_systems_region)
8051 (get_translation, handle_composition_annotation, consume_chars):
8052 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8053 (consume_chars): Rewrite to not calculate an address outside buffer.
8054 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8055 Don't access memory outside of the args array.
8056 (Fdefine_coding_system_internal): Check for charset-id overflow.
8057 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8058 result of ENCODE_CHAR.
8059 * coding.h: Adjust decls to match defn changes elsewhere.
8060 (struct coding_system):
8061 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8062 * composite.c (get_composition_id, find_composition)
8063 (run_composition_function, update_compositions)
8064 (compose_text, composition_gstring_put_cache)
8065 (composition_gstring_p, composition_gstring_width)
8066 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8067 (composition_compute_stop_pos, composition_reseat_it)
8068 (composition_update_it, struct position_record)
8069 (find_automatic_composition, composition_adjust_point)
8070 (Fcomposition_get_gstring, Ffind_composition_internal):
8071 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8072 (update_compositions):
8073 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8074 * composite.h: Adjust decls to match defn changes elsewhere.
8075 (struct composition):
8076 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8077 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8078 Do not attempt to compute the address of the object just before a
8079 buffer; this is not portable.
8080 (Faref, Faset):
8081 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8082 (Faset): Use int, not EMACS_INT, where int is wide enough.
8083 (Fstring_to_number): Don't assume fixnums fit in int.
8084 (Frem): Don't assume arg is nonnegative.
8085 * dbusbind.c (xd_append_arg): Check for integers out of range.
8086 (Fdbus_call_method): Don't overflow the timeout int.
8087 (extract_signed, extract_unsigned): New functions.
8088 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8089 (xd_get_connection_references): Return ptrdiff_t, not int.
8090 All uses changed.
8091 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8092 (xd_read_message_1):
8093 Use int, not unsigned, where the dbus API uses int.
8094 (Fdbus_message_internal): Don't overflow mtype.
8095 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8096 * dired.c (directory_files_internal, file_name_completion, scmp)
8097 (file_name_completion_stat):
8098 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8099 (file_name_completion): Don't overflow matchcount.
8100 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8101 * dispextern.h: Adjust decls to match defn changes elsewhere.
8102 (struct text_pos, struct glyph, struct bidi_saved_info)
8103 (struct bidi_string_data, struct bidi_it, struct composition_it)
8104 (struct it):
8105 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8106 (struct display_pos, struct composition_it, struct it):
8107 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8108 * dispnew.c (increment_matrix_positions)
8109 (increment_row_positions, mode_line_string)
8110 (marginal_area_string):
8111 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8112 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8113 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8114 (duration_to_sec_usec): New function, to check for overflow better.
8115 (Fsleep_for, sit_for): Use it.
8116 * doc.c (get_doc_string, store_function_docstring):
8117 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8118 (get_doc_string, Fsnarf_documentation):
8119 Use int, not EMACS_INT, where int is wide enough.
8120 (get_doc_string):
8121 Use SAFE_ALLOCA, not alloca.
8122 Check for overflow when converting EMACS_INT to off_t.
8123 * doprnt.c (doprnt):
8124 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8125 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8126 Don't assume uid_t fits into fixnum.
8127 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8128 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8129 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8130 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8131 (general_insert_function)
8132 (Finsert_char, make_buffer_string, make_buffer_string_both)
8133 (update_buffer_properties, Fbuffer_substring)
8134 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8135 (Fsubst_char_in_region, check_translation)
8136 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8137 (transpose_markers, Ftranspose_regions):
8138 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8139 (clip_to_bounds): Move to lisp.h as an inline function).
8140 (Fconstrain_to_field): Don't assume integers are nonnegative.
8141 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8142 (Fsubst_char_in_region, Fsave_restriction):
8143 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8144 (Femacs_pid): Don't assume pid_t fits into fixnum.
8145 (lo_time): Use int, not EMACS_INT, when int suffices.
8146 (lisp_time_argument): Check for usec out of range.
8147 (Fencode_time): Don't assume fixnum fits in int.
8148 (Fuser_login_name, Fuser_full_name): Signal an error
8149 if a uid argument is out of range, rather than relying on
8150 undefined behavior.
8151 (Fformat_time_string): Remove now-unnecessary check.
8152 lisp_time_argument checks for out-of-range usec now.
8153 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8154 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8155 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8156 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8157 (init_cmdargs, Fdump_emacs):
8158 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8159 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8160 the bottom (typically) 32 bits of the fixnum.
8161 * eval.c (specpdl_size, call_debugger):
8162 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8163 (when_entered_debugger, Fbacktrace_debug):
8164 Don't assume fixnum can fit in int.
8165 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8166 the object just before a buffer; this is not portable.
8167 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8168 (grow_specpdl, unbind_to):
8169 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8170 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8171 (grow_specpdl): Simplify allocation by using xpalloc.
8172 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8173 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8174 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8175 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8176 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8177 (a_write, e_write):
8178 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8179 (Fcopy_file, non_regular_nbytes, read_non_regular)
8180 (Finsert_file_contents):
8181 Use int, not EMACS_INT, where int is wide enough.
8182 (READ_BUF_SIZE): Verify that it fits in int.
8183 (Finsert_file_contents): Check that counts are in proper range,
8184 rather than assuming fixnums fit into ptrdiff_t etc.
8185 Don't assume fixnums fit into int.
8186 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8187 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8188 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8189 (string_char_to_byte, string_byte_to_char)
8190 (string_make_multibyte, string_to_multibyte)
8191 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8192 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8193 (substring_both, Fdelete, internal_equal, Ffillarray)
8194 (Fclear_string, mapcar1)
8195 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8196 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8197 (larger_vector, make_hash_table, maybe_resize_hash_table)
8198 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8199 (Fmaphash, secure_hash):
8200 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8201 (concat): Check for string index and length overflow.
8202 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8203 (Frequire):
8204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8205 (larger_vector): New API (vec, incr_min, size_max) replaces old
8206 one (vec, new_size, init). This catches size overflow.
8207 INIT was removed because it was always Qnil.
8208 All callers changed.
8209 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8210 the upper bound on a hash table index size.
8211 (make_hash_table, maybe_resize_hash_table): Use it.
8212 (secure_hash): Computer start_byte and end_byte only after
8213 they're known to be in ptrdiff_t range.
8214 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8215 (Ffont_get_glyphs, Ffont_at):
8216 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8217 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8218 (Flist_fonts, Fopen_font):
8219 Don't assume fixnum can fit in int.
8220 (check_gstring): Don't assume index can fit in int.
8221 (font_match_p): Check that fixnum is a character, not a nonnegative
8222 fixnum, since the later code needs to stuff it into an int.
8223 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8224 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8225 conversion overflow issues.
8226 (Fopen_font): Check for integer out of range.
8227 (Ffont_get_glyphs): Don't assume index can fit in int.
8228 * font.h: Adjust decls to match defn changes elsewhere.
8229 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8230 integer overflow.
8231 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8232 printmax_t, where ptrdiff_t is wide enough.
8233 (Finternal_char_font):
8234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8235 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8236 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8237 (Fset_frame_position, x_set_frame_parameters)
8238 (x_set_line_spacing, x_set_border_width)
8239 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8240 Check that fixnums are in proper range for system types.
8241 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8242 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8243 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8244 Use SAFE_ALLOCA_LISP, not alloca.
8245 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8246 intptr_t is wide enough.
8247 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8248 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8249 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8250 Check for fixnum out of range.
8251 * ftfont.c (ftfont_list): Don't assume index fits in int.
8252 Check that fixnums are in proper range for system types.
8253 (ftfont_shape_by_flt):
8254 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8255 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8256 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8257 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8258 Check that fixnums are in proper range for system types.
8259 * gnutls.h: Adjust decls to match defn changes elsewhere.
8260 * gtkutil.c (xg_dialog_run):
8261 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8262 (update_frame_tool_bar):
8263 Check that fixnums are in proper range for system types.
8264 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8265 (lookup_image): Check that fixnums are in range for system types.
8266 * indent.c (last_known_column, last_known_column_point):
8267 (current_column_bol_cache):
8268 (skip_invisible, current_column, check_display_width):
8269 (check_display_width, scan_for_column, current_column_1)
8270 (Findent_to, Fcurrent_indentation, position_indentation)
8271 (indented_beyond_p, Fmove_to_column, compute_motion):
8272 (Fcompute_motion, Fvertical_motion):
8273 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8274 (last_known_column_modified): Use EMACS_INT, not int.
8275 (check_display_width):
8276 (Fcompute_motion):
8277 Check that fixnums and floats are in proper range for system types.
8278 (compute_motion): Don't assume index or fixnum fits in int.
8279 (compute_motion, Fcompute_motion):
8280 Use int, not EMACS_INT, when it is wide enough.
8281 (vmotion): Omit local var start_hpos that is always 0; that way
8282 we don't need to worry about overflow in expressions involving it.
8283 * indent.h: Adjust decls to match defn changes elsewhere.
8284 (struct position):
8285 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8286 Use int, not EMACS_INT, where int is wide enough.
8287 Remove unused members ovstring_chars_done and tab_offset;
8288 all uses removed.
8289 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8290 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8291 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8292 (make_gap, copy_text, insert, insert_and_inherit)
8293 (insert_before_markers, insert_before_markers_and_inherit)
8294 (insert_1, count_combining_before, count_combining_after)
8295 (insert_1_both, insert_from_string)
8296 (insert_from_string_before_markers, insert_from_string_1)
8297 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8298 (adjust_after_replace, adjust_after_insert, replace_range)
8299 (replace_range_2, del_range, del_range_1, del_range_byte)
8300 (del_range_both, del_range_2, modify_region)
8301 (prepare_to_modify_buffer, signal_before_change)
8302 (signal_after_change, Fcombine_after_change_execute):
8303 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8304 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8305 (balance_an_interval, split_interval_right, split_interval_left)
8306 (find_interval, next_interval, update_interval)
8307 (adjust_intervals_for_insertion, delete_node, delete_interval)
8308 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8309 (static_offset_intervals, offset_intervals)
8310 (merge_interval_right, merge_interval_left, make_new_interval)
8311 (graft_intervals_into_buffer, temp_set_point_both)
8312 (temp_set_point, set_point, adjust_for_invis_intang)
8313 (set_point_both, move_if_not_intangible, get_property_and_range)
8314 (get_local_map, copy_intervals, copy_intervals_to_string)
8315 (compare_string_intervals, set_intervals_multibyte_1):
8316 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8317 * intervals.h: Adjust decls to match defn changes elsewhere.
8318 (struct interval):
8319 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8320 * keyboard.c (this_command_key_count, this_single_command_key_start)
8321 (before_command_key_count, before_command_echo_length, echo_now)
8322 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8323 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8324 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8325 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8326 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8327 (last_non_minibuf_size, last_point_position, echo_truncate)
8328 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8329 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8330 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8331 (stuff_buffered_input):
8332 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8333 (last_auto_save, command_loop_1, read_char):
8334 Use EMACS_INT, not int, to avoid integer overflow.
8335 (record_char): Avoid overflow in total_keys computation.
8336 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8337 * keyboard.h: Adjust decls to match defn changes elsewhere.
8338 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8339 (Fkey_description, Fdescribe_vector, Flookup_key):
8340 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8341 (click_position): New function, to check that positions are in range.
8342 (Fcurrent_active_maps):
8343 (describe_command):
8344 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8345 (Faccessible_keymaps, Fkey_description):
8346 (preferred_sequence_p):
8347 Don't assume fixnum can fit into int.
8348 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8349 Check for integer overflow in size calculations.
8350 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8351 avoid mishandling large integers.
8352 * lisp.h: Adjust decls to match defn changes elsewhere.
8353 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8354 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8355 (struct Lisp_Marker):
8356 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8357 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8358 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8359 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8360 All callers changed.
8361 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8362 Assume the arg has valid form, since it always does.
8363 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8364 unsigned integer system type.
8365 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8366 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8367 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8368 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8369 (duration_to_sec_usec): New decl.
8370 * lread.c (read_from_string_index, read_from_string_index_byte)
8371 (read_from_string_limit, readchar, unreadchar, openp)
8372 (read_internal_start, read1, oblookup):
8373 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8374 (Fload, readevalloop, Feval_buffer, Feval_region):
8375 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8376 (openp): Check for out-of-range argument to 'access'.
8377 (read1): Use int, not EMACS_INT, where int is wide enough.
8378 Don't assume fixnum fits into int.
8379 Fix off-by-one error that can read outside a buffer.
8380 (read_filtered_event): Use duration_to_sec_usec
8381 to do proper overflow checking on durations.
8382 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8383 in size calculation.
8384 (Fexecute_kbd_macro):
8385 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8386 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8387 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8388 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8389 (set_marker_both, set_marker_restricted_both, marker_position)
8390 (marker_byte_position, Fbuffer_has_markers_at):
8391 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8392 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8393 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8394 It now merely ensures that the menu is large enough, without
8395 necessarily growing it, as this avoids some integer overflow issues.
8396 All callers changed.
8397 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8398 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8399 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8400 Use SAFE_ALLOCA_LISP, not alloca.
8401 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8402 to EMACS_INT. Check that fixnums are in proper range for system types.
8403 * minibuf.c (minibuf_prompt_width, string_to_object)
8404 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8405 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8407 (get_minibuffer, read_minibuf_unwind):
8408 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8409 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8410 this simplifies overflow checking. All callers changed.
8411 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8412 (Ftest_completion):
8413 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8414 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8415 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8416 Check that fixnums are in proper range for system types.
8417 (Fx_create_frame, Fx_show_tip):
8418 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8419 * nsfont.m (ns_findfonts, nsfont_list_family):
8420 Don't assume fixnum fits in long.
8421 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8422 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8423 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8424 wide enough.
8425 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8426 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8427 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8428 (PRINTDECLARE, PRINTPREPARE):
8429 (strout, print_string):
8430 (print, print_preprocess, print_check_string_charset_prop)
8431 (print_object):
8432 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8433 (PRINTDECLARE):
8434 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8435 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8436 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8437 (printchar, strout): Use xpalloc to catch size calculation overflow.
8438 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8439 (print_error_message): Use SAFE_ALLOCA, not alloca.
8440 (print_object): Use int, not EMACS_INT, where int is wide enough.
8441 (print_depth, new_backquote_output, print_number_index):
8442 Use ptrdiff_t, not int, where int might not be wide enough.
8443 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8444 (Fset_process_window_size, Fformat_network_address)
8445 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8446 (sigchld_handler):
8447 Check that fixnums are in proper range for system types.
8448 (Fsignal_process): Simplify by avoiding a goto.
8449 Check for process-ids out of pid_t range rather than relying on
8450 undefined behavior.
8451 (process_tick, update_tick): Use EMACS_INT, not int.
8452 (Fformat_network_address, read_process_output, send_process)
8453 (Fprocess_send_region, status_notify):
8454 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8455 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8456 (wait_reading_process_output, read_process_output, exec_sentinel):
8457 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8458 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8459 (Faccept_process_output): Use duration_to_sec_usec to do proper
8460 overflow checking on durations.
8461 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8462 Don't assume pid_t fits in int.
8463 * process.h (struct Lisp_Process): Members tick and update_tick
8464 are now of type EMACS_INT, not int.
8465 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8466 configured --with-wide-int.
8467 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8468 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8469 * search.c (looking_at_1, string_match_1):
8470 (fast_string_match, fast_c_string_match_ignore_case)
8471 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8472 (scan_newline, find_before_next_newline, search_command)
8473 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8474 (set_search_regs, wordify):
8475 (Freplace_match):
8476 (Fmatch_data):
8477 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8478 (string_match_1, search_buffer, set_search_regs):
8479 (Fmatch_data):
8480 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8481 (wordify): Check for overflow in size calculation.
8482 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8483 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8484 Check that fixnums are in proper range for system types.
8485 * sound.c (struct sound_device)
8486 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8487 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8488 (Fplay_sound_internal):
8489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8490 * syntax.c (struct lisp_parse_state, find_start_modiff)
8491 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8492 (Fparse_partial_sexp):
8493 Don't assume fixnums can fit in int.
8494 (struct lisp_parse_state, find_start_pos, find_start_value)
8495 (find_start_value_byte, find_start_begv)
8496 (update_syntax_table, char_quoted, dec_bytepos)
8497 (find_defun_start, prev_char_comend_first, back_comment):
8498 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8499 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8500 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8501 (Finternal_describe_syntax_value): Check that match_lisp is a
8502 character, not an integer, since the code stuffs it into int.
8503 (scan_words, scan_sexps_forward):
8504 Check that fixnums are in proper range for system types.
8505 (Fforward_word):
8506 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8507 (scan_sexps_forward):
8508 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8509 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8510 * syntax.h: Adjust decls to match defn changes elsewhere.
8511 (struct gl_state_s):
8512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8513 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8514 MOST_POSITIVE_FIXNUM.
8515 * sysdep.c (wait_for_termination_1, wait_for_termination)
8516 (interruptible_wait_for_termination, mkdir):
8517 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8518 (emacs_read, emacs_write):
8519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8520 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8521 and double all fit in int.
8522 * term.c (set_tty_color_mode):
8523 Check that fixnums are in proper range for system types.
8524 * termhooks.h (struct input_event):
8525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8526 * textprop.c (validate_interval_range, interval_of)
8527 (Fadd_text_properties, set_text_properties_1)
8528 (Fremove_text_properties, Fremove_list_of_text_properties)
8529 (Ftext_property_any, Ftext_property_not_all)
8530 (copy_text_properties, text_property_list, extend_property_ranges)
8531 (verify_interval_modification):
8532 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8533 (Fnext_single_char_property_change)
8534 (Fprevious_single_char_property_change):
8535 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8536 (copy_text_properties):
8537 Check for integer overflow in index calculation.
8538 * undo.c (last_boundary_position, record_point, record_insert)
8539 (record_delete, record_marker_adjustment, record_change)
8540 (record_property_change):
8541 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8542 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8543 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8544 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8545 (Fx_hide_tip, Fx_file_dialog):
8546 * w32menu.c (set_frame_menubar):
8547 Use ptrdiff_t, not int, for consistency with rest of code.
8548 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8549 (select_window, Fdelete_other_windows_internal)
8550 (window_scroll_pixel_based, window_scroll_line_based)
8551 (Frecenter, Fset_window_configuration):
8552 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8553 (Fset_window_hscroll, run_window_configuration_change_hook)
8554 (set_window_buffer, temp_output_buffer_show, scroll_command)
8555 (Fscroll_other_window, Frecenter):
8556 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8557 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8558 Don't assume fixnum fits in int.
8559 (Fset_window_scroll_bars):
8560 Check that fixnums are in proper range for system types.
8561 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8562 (string_pos, c_string_pos, number_of_chars, init_iterator)
8563 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8564 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8565 (compute_display_string_end, handle_face_prop)
8566 (face_before_or_after_it_pos, handle_invisible_prop)
8567 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8568 (display_prop_intangible_p, string_buffer_position_lim)
8569 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8570 (get_overlay_strings_1, get_overlay_strings)
8571 (iterate_out_of_display_property, forward_to_next_line_start)
8572 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8573 (get_next_display_element, set_iterator_to_next)
8574 (get_visually_first_element, compute_stop_pos_backwards)
8575 (handle_stop_backwards, next_element_from_buffer)
8576 (move_it_in_display_line_to, move_it_in_display_line)
8577 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8578 (add_to_log, message_dolog, message_log_check_duplicate)
8579 (message2, message2_nolog, message3, message3_nolog
8580 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8581 (current_message_1, truncate_echo_area, truncate_message_1)
8582 (set_message, set_message_1, store_mode_line_noprop)
8583 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8584 (text_outside_line_unchanged_p, check_point_in_composition)
8585 (reconsider_clip_changes)
8586 (redisplay_internal, set_cursor_from_row, try_scrolling)
8587 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8588 (redisplay_window, find_last_unchanged_at_beg_row)
8589 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8590 (trailing_whitespace_p, find_row_edges, display_line)
8591 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8592 (display_mode_element, store_mode_line_string)
8593 (pint2str, pint2hrstr, decode_mode_spec)
8594 (display_count_lines, display_string, draw_glyphs)
8595 (x_produce_glyphs, x_insert_glyphs)
8596 (rows_from_pos_range, mouse_face_from_buffer_pos)
8597 (fast_find_string_pos, mouse_face_from_string_pos)
8598 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8599 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8600 (safe_call, init_from_display_pos, handle_fontified_prop)
8601 (handle_single_display_spec, load_overlay_strings)
8602 (with_echo_area_buffer, setup_echo_area_for_printing)
8603 (display_echo_area, echo_area_display)
8604 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8605 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8606 (redisplay_window, dump_glyph_row, display_mode_line)
8607 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8608 (handle_display_spec, display_prop_string_p):
8609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8610 (handle_single_display_spec, build_desired_tool_bar_string)
8611 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8612 (get_specified_cursor_type):
8613 Check that fixnums are in proper range for system types.
8614 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8615 (Flookup_image_map):
8616 Don't assume fixnums fit in int.
8617 (compare_overlay_entries):
8618 Avoid mishandling comparisons due to subtraction overflow.
8619 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8620 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8621 (handle_tool_bar_click):
8622 Use int, not unsigned, since we prefer signed and the signedness
8623 doesn't matter here.
8624 (get_next_display_element, next_element_from_display_vector):
8625 Use int, not EMACS_INT, when int is wide enough.
8626 (start_hourglass): Use duration_to_sec_usec to do proper
8627 overflow checking on durations.
8628 * xfaces.c (Fbitmap_spec_p):
8629 Check that fixnums are in proper range for system types.
8630 (compare_fonts_by_sort_order):
8631 Avoid mishandling comparisons due to subtraction overflow.
8632 (Fx_family_fonts, realize_basic_faces):
8633 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8634 (Fx_family_fonts):
8635 Don't assume fixnum fits in int.
8636 Use SAFE_ALLOCA_LISP, not alloca.
8637 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8638 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8639 (face_at_buffer_position, face_for_overlay_string)
8640 (face_at_string_position):
8641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8642 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8643 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8644 (Fx_show_tip):
8645 Check that fixnums are in proper range for system types.
8646 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8647 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8648 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8649 (Fx_change_window_property): Don't assume fixnums fit in int.
8650 * xfont.c (xfont_chars_supported):
8651 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8652 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8653 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8654 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8655 * xml.c (parse_region):
8656 * xrdb.c (magic_file_p):
8657 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8658 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8659 (x_get_local_selection, x_reply_selection_request)
8660 (x_handle_selection_request, wait_for_property_change):
8661 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8662 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8663 short is wide enough.
8664 (x_send_client_event): Don't assume fixnum fits in int.
8665 * xterm.c (x_x_to_emacs_modifiers):
8666 Don't assume EMACS_INT overflows nicely into int.
8667 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8668 may come from Lisp.
8669 (handle_one_xevent): NATNUMP can eval its arg twice.
8670 (x_connection_closed):
8671 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8672 * xterm.h: Adjust decls to match defn changes elsewhere.
8673 (struct scroll_bar): Use struct vectorlike_header
8674 rather than rolling our own approximation.
8675 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8676
8677 2012-05-25 Glenn Morris <rgm@gnu.org>
8678
8679 * lisp.mk (lisp): Update for more files being compiled now.
8680
8681 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8682
8683 * lread.c: Remove `read_pure' which makes no difference.
8684 (read_pure): Remove var.
8685 (unreadpure): Remove function.
8686 (readevalloop): Don't call read_list with -1 flag.
8687 (read1, read_vector): Don't test read_pure any more.
8688 (read_list): Simplify.
8689
8690 * fileio.c, character.h: Minor style tweaks.
8691
8692 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8693
8694 * window.h (clip_changed): Remove useless declaration.
8695
8696 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8697
8698 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8699 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8700
8701 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8702
8703 Remove src/m/*.
8704 This directory predates autoconf and is no longer needed nowadays.
8705 Move its few remaining bits of functionality to where they're needed.
8706 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8707 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8708 * m/template.h: Remove.
8709 * Makefile.in (M_FILE): Remove. All uses removed.
8710 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8711 * lisp.h (USE_LSB_TAG):
8712 * mem-limits.h (EXCEEDS_LISP_PTR):
8713 Use VAL_MAX, not VALBITS, in #if.
8714 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8715 (EMACS_UINT): Define unconditionally now.
8716 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8717 (BITS_PER_EMACS_INT): New constants, replacing
8718 what used to be in config.h, but not useful in #if.
8719 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8720 define them any more.
8721 (VAL_MAX): New macro.
8722 (VALMASK): Use it.
8723 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8724 BITS_PER_EMACS_INT, in #if.
8725 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8726 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8727 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8728 * s/ms-w32.h (DATA_START):
8729 Move here from removed file m/intel386.h.
8730 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8731 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8732
8733 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8734
8735 Assume C89 or later.
8736 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8737 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8738 (xrealloc):
8739 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8740 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8741 * textprop.c, tparam.c (NULL): Remove.
8742 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8743 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8744 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8745 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8746 * xterm.c (input_signal_count): Assume volatile works.
8747
8748 2012-05-21 Ken Brown <kbrown@cornell.edu>
8749
8750 * xgselect.c (xg_select): Fix first argument in call to 'select'
8751 (bug#11508).
8752
8753 2012-05-20 Ken Brown <kbrown@cornell.edu>
8754
8755 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8756 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8757
8758 2012-05-19 Ken Brown <kbrown@cornell.edu>
8759
8760 * xfns.c (x_in_use): Remove `static' qualifier.
8761 * xterm.h (x_in_use): Declare.
8762 * xgselect.c: Include xterm.h.
8763 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8764 and `display_arg' (bug#9754).
8765
8766 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8767
8768 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8769
8770 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8771 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8772
8773 2012-05-18 Eli Zaretskii <eliz@gnu.org>
8774
8775 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8776
8777 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8778 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8779
8780 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8781 reference to image_cache->refcount.
8782 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8783
8784 2012-05-17 Juri Linkov <juri@jurta.org>
8785
8786 * search.c (Fword_search_regexp, Fword_search_backward)
8787 (Fword_search_forward, Fword_search_backward_lax)
8788 (Fword_search_forward_lax): Move functions to isearch.el
8789 (bug#10145, bug#11381).
8790
8791 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8792
8793 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8794
8795 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8796
8797 * lread.c (init_obarray): Declare Qt and Qnil as special.
8798
8799 2012-05-14 Glenn Morris <rgm@gnu.org>
8800
8801 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8802 Put "libexec" before "bin", for the sake of init_callproc_1.
8803
8804 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8805
8806 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8807
8808 * unexaix.c: Port to more-recent AIX compilers.
8809 (report_error, report_error_1, make_hdr, copy_sym)
8810 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8811 Make arguments const char *, not char *, to avoid violations of C
8812 standard and to fix some AIX warnings reported by Gilles Pion.
8813
8814 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8815
8816 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8817 already have overlays loaded.
8818 (handle_single_display_spec): Before returning without displaying
8819 fringe bitmap, synchronize the bidi iterator with the main display
8820 iterator, by calling iterate_out_of_display_property.
8821 (iterate_out_of_display_property): Detect buffer iteration by
8822 testing that it->string is a Lisp string.
8823 (get_next_display_element): When the current object is exhausted,
8824 and there's something on it->stack, call set_iterator_to_next to
8825 proceed with what's on the stack, instead of returning zero.
8826 (set_iterator_to_next): If called at the end of a Lisp string,
8827 proceed to consider_string_end without incrementing string
8828 position. Don't increment display vector index past the end of
8829 the display vector. (Bug#11417)
8830 (pos_visible_p): Don't report a position visible when move_it_to
8831 stopped at the last line of window, which happens to be scanned
8832 backwards by the bidi iteration. (Bug#11464)
8833
8834 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8835
8836 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8837 and right-margin display specs even if the spec is invalid or we
8838 are on a TTY, and thus unable to display on the fringes.
8839 That's because the text with the property will not be displayed anyway,
8840 so we need to signal to the caller that this is a "replacing"
8841 display spec. This fixes display when the spec is invalid or we
8842 are on a TTY.
8843
8844 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8845
8846 * unexaix.c (make_hdr): Fix typo in prototype.
8847 This bug broke the build on AIX. Problem reported by Gilles Pion.
8848
8849 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
8850
8851 * keyboard.c (kbd_buffer_get_event): Read special events also in
8852 batch mode. (Bug#11415)
8853
8854 2012-05-12 Glenn Morris <rgm@gnu.org>
8855
8856 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8857
8858 2012-05-12 Eli Zaretskii <eliz@gnu.org>
8859
8860 * lisp.mk (lisp): Add newcomment.elc.
8861
8862 2012-05-12 Glenn Morris <rgm@gnu.org>
8863
8864 * Makefile.in (MKDIR_P): New, set by configure.
8865 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8866
8867 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8868
8869 Remove unused function hourglass_started.
8870 * dispextern.h (hourglass_started):
8871 * w32fns.c (hourglass_started):
8872 * xdisp.c (hourglass_started): Remove.
8873
8874 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
8875
8876 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8877 Update dependencies.
8878
8879 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8880
8881 * xgselect.c (xg_select): Put maxfds+1 into a var.
8882 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8883
8884 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8885
8886 2012-05-10 Dave Abrahams <dave@boostpro.com>
8887
8888 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8889 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8890
8891 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
8892
8893 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8894 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8895 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8896 Initialize xd_registered_buses.
8897
8898 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8899
8900 Untag more efficiently if USE_LSB_TAG.
8901 This is based on a proposal by YAMAMOTO Mitsuharu in
8902 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8903 For an admittedly artificial (nth 8000 longlist) benchmark on
8904 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8905 Emacs's overall text size by 1%.
8906 * lisp.h (XUNTAG): New macro.
8907 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8908 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8909 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8910 * eval.c (Fautoload):
8911 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8912 * frame.h (XFRAME): Use XUNTAG.
8913
8914 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8915 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8916 Remove unportable assumptions about print widths of types like
8917 dbus_uint32_t.
8918 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8919 intptr_t when converting between pointer and integer, to avoid GCC
8920 warnings about wrong width.
8921
8922 2012-05-09 Eli Zaretskii <eliz@gnu.org>
8923
8924 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8925 stack for each reader_thread, instead of defaulting to 8MB
8926 determined by the linker. This avoids failures in creating
8927 subprocesses on Windows 7, see the discussion in this thread:
8928 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8929
8930 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8931
8932 Fix up display of the *Minibuf-0* buffer in the mini window.
8933 * keyboard.c (read_char): Don't clear the echo area if there's no
8934 message to clear.
8935 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8936 contents of *Minibuf-0*) if there's no message displayed in its stead.
8937
8938 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
8939
8940 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8941 batch mode.
8942
8943 2012-05-06 Chong Yidong <cyd@gnu.org>
8944
8945 * lisp.mk (lisp): Update.
8946
8947 2012-05-05 Jim Meyering <meyering@redhat.com>
8948
8949 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8950
8951 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8952
8953 * data.c (PUT_ERROR): New macro.
8954 (syms_of_data): Use it. Add new error type `user-error'.
8955 * undo.c (user_error): New function.
8956 (Fprimitive_undo): Use it.
8957 * print.c (print_error_message): Adjust print style for `user-error'.
8958 * keyboard.c (user_error): New function.
8959 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8960
8961 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8962
8963 Do not limit current-time-string to years 1000..9999.
8964 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8965 (Fcurrent_time_string): Support any year that is supported by the
8966 underlying localtime representation. Don't use asctime, as it
8967 has undefined behavior for years outside the range -999..9999.
8968
8969 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8970
8971 Fix race conditions involving setenv, gmtime, localtime, asctime.
8972 Without this fix, interrupts could mess up code that uses these
8973 nonreentrant functions, since setting TZ invalidates existing
8974 tm_zone or tzname values, and since most of these functions return
8975 pointers to static storage.
8976 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8977 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8978 Grow the critical sections to include not just invoking
8979 localtime/gmtime, but also accessing these functions' results
8980 including their tm_zone values if any, and any related TZ setting.
8981 (format_time_string): Last arg is now struct tm *, not struct tm **,
8982 so that the struct tm is saved in the critical section.
8983 All callers changed. Simplify allocation of initial buffer, partly
8984 motivated by the fact that memory allocation needs to be outside
8985 the critical section.
8986
8987 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8988
8989 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8990 with RESET_INTERVAL.
8991
8992 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8993 Remove duplicated buffer name initialization.
8994
8995 2012-05-02 Jim Meyering <jim@meyering.net>
8996
8997 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8998
8999 * xfns.c (x_window): Use xstrdup (Bug#11375).
9000
9001 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9002
9003 * xdisp.c (pos_visible_p): If already at a newline from the
9004 display string before the 'while' loop, don't walk back the glyphs
9005 from it3.glyph_row. Solves assertion violation when the display
9006 string begins with a newline (egg.el). (Bug#11367)
9007
9008 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9009
9010 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9011 Move to simple.el.
9012
9013 2012-05-01 Glenn Morris <rgm@gnu.org>
9014
9015 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9016 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9017 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9018 All were removed before 23.1.
9019
9020 * dispnew.c: Remove HAVE_LIBNCURSES test;
9021 it is always true on relevant platforms.
9022
9023 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9024 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9025
9026 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9027
9028 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9029
9030 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9031 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9032 Remove.
9033
9034 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9035
9036 Do not avoid creating empty evaporating overlays (Bug#9642).
9037 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9038 That is, do not delete an evaporating overlay if it becomes
9039 empty after its bounds are adjusted to fit within its buffer.
9040 This fix caused other problems, and I'm reverting it until we get
9041 to the bottom of them.
9042
9043 2012-04-27 Chong Yidong <cyd@gnu.org>
9044
9045 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9046
9047 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9048
9049 * xdisp.c (pos_visible_p): If the window start position is beyond
9050 ZV, start the display from buffer beginning. Prevents assertion
9051 violation in init_iterator when the minibuffer window is scrolled
9052 via the scroll bar.
9053
9054 * window.c (window_scroll_pixel_based): Likewise.
9055
9056 2012-04-27 Chong Yidong <cyd@gnu.org>
9057
9058 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9059
9060 2012-04-27 Glenn Morris <rgm@gnu.org>
9061
9062 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9063 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9064
9065 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9066
9067 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9068 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9069
9070 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9071
9072 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9073 display element, check also the underlying string or buffer
9074 character. (Bug#11341)
9075
9076 * w32menu.c: Include w32heap.h.
9077 (add_menu_item): If the call to AppendMenuW (via
9078 unicode_append_menu) fails, disable Unicode menus only if we are
9079 running on Windows 9X/Me.
9080
9081 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9082
9083 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9084 (xgetint): Add missing shift for LSB tags.
9085
9086 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9087
9088 * keyboard.c (read_char): Don't wipe echo area for select window
9089 events: These might get delayed via `mouse-autoselect-window'
9090 (Bug#11304).
9091
9092 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9093
9094 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9095 manipulation of :loaded-from data.
9096
9097 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9098
9099 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9100 now a cons (bug#11311).
9101
9102 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9103
9104 Do not create empty overlays with the evaporate property (Bug#9642).
9105 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9106 if it becomes empty after its bounds are adjusted to fit within
9107 its buffer. Without this fix, in a nonempty buffer (let ((o
9108 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9109 yields an empty overlay that has the evaporate property, which is
9110 not supposed to happen.
9111
9112 Fix minor GTK3 problems found by static checking.
9113 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9114 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9115 (struct _EmacsFixedClass, emacs_fixed_get_type):
9116 Move decls here from emacsgtkfixed.h, since they needn't be public.
9117 (emacs_fixed_get_type): Now static.
9118 (emacs_fixed_class_init): Omit unused local.
9119 (emacs_fixed_child_type): Remove; unused.
9120 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9121 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9122 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9123 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9124 (EMACS_FIXED_GET_CLASS): Remove; unused.
9125 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9126
9127 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9128 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9129
9130 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9131
9132 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9133 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9134 (__malloc_size_t, __malloc_ptrdiff_t):
9135 Remove. All uses removed, replaced by the definiens if needed,
9136 since we can assume C89 or better now.
9137 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9138 (protect_malloc_state, align, get_contiguous_space)
9139 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9140 (malloc_atfork_handler_child, malloc_enable_thread)
9141 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9142 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9143 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9144 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9145 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9146 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9147 Define using prototypes, not old style.
9148 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9149 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9150 (align): Don't assume that signed integer overflow wraps around.
9151 Omit unused local var.
9152 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9153 (_free_internal_nolock, memalign, mallochook, reallochook):
9154 Omit no-longer-needed casts.
9155 (valloc): Use getpagesize, not __getpagesize.
9156 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9157 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9158
9159 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9160
9161 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9162
9163 Move functions from C to Lisp. Make non-blocking method calls
9164 the default. Implement further D-Bus standard interfaces.
9165
9166 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9167 (QCdbus_request_name_allow_replacement)
9168 (QCdbus_request_name_replace_existing)
9169 (QCdbus_request_name_do_not_queue)
9170 (QCdbus_request_name_reply_primary_owner)
9171 (QCdbus_request_name_reply_in_queue)
9172 (QCdbus_request_name_reply_exists)
9173 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9174 (QCdbus_registered_serial, QCdbus_registered_method)
9175 (QCdbus_registered_signal): New Lisp objects.
9176 (XD_DEBUG_MESSAGE): Use sizeof.
9177 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9178 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9179 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9180 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9181 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9182 (xd_signature, xd_append_arg): Allow float for integer types.
9183 (xd_get_connection_references): New function.
9184 (xd_get_connection_address): Rename from xd_initialize.
9185 Return cached address.
9186 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9187 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9188 level.
9189 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9190 Return number of refcounts.
9191 (Fdbus_get_unique_name): Make stronger parameter check.
9192 (Fdbus_message_internal): New defun.
9193 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9194 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9195 (Fdbus_send_signal, Fdbus_register_service)
9196 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9197 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9198 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9199 (Vdbus_compiled_version, Vdbus_runtime_version)
9200 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9201 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9202 (Vdbus_message_type_signal): New defvars.
9203 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9204 Adapt docstring.
9205
9206 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9207
9208 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9209 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9210 Do not assume ptrdiff_t is the same width as 'int'.
9211
9212 * alloc.c: Handle unusual debugging option combinations.
9213 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9214 since the two debugging options are incompatible.
9215 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9216 is defined.
9217 (mem_init, mem_insert, mem_insert_fixup):
9218 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9219 (NEED_MEM_INSERT): Remove; no longer needed.
9220
9221 2012-04-22 Leo Liu <sdl.web@gmail.com>
9222
9223 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9224
9225 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9226
9227 * sysdep.c [__FreeBSD__]: Minor cleanups.
9228 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9229 Use Emacs indenting style more consistently. Avoid some casts.
9230 Use 'double' consistently rather than mixing 'float' and 'double'.
9231
9232 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9233
9234 * sysdep.c (list_system_processes, system_process_attributes):
9235 Add implementation for FreeBSD (Bug#5243).
9236
9237 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9238
9239 * lisp.mk (lisp): Update.
9240
9241 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9242
9243 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9244 It is never used otherwise.
9245
9246 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9247
9248 * print.c (print_preprocess): Only check print_depth if print-circle
9249 is nil.
9250 (print_object): Check for cycles even when print-circle is nil and
9251 print-gensym is t, but only check print_depth if print-circle is nil.
9252
9253 2012-04-20 Chong Yidong <cyd@gnu.org>
9254
9255 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9256 set the status to "failed" and ensure that sentinel is run.
9257
9258 2012-04-20 Glenn Morris <rgm@gnu.org>
9259
9260 * process.c (Fset_process_inherit_coding_system_flag)
9261 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9262 (Fmake_network_process, Fmake_serial_process): Doc fix.
9263
9264 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9265
9266 * xdisp.c (string_buffer_position_lim): Limit starting position to
9267 BEGV.
9268 (set_cursor_from_row): If called for a mode-line or header-line
9269 row, return zero immediately.
9270 (try_cursor_movement): If inside continuation line, don't back up
9271 farther than the first row after the header line, if any.
9272 Don't consider the header-line row as "partially visible", even if
9273 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9274
9275 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9276
9277 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9278 (bug#11238).
9279
9280 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9281 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9282
9283 configure: new option --enable-gcc-warnings (Bug#11207)
9284 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9285 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9286 (ALL_CFLAGS): Use new macros rather than old.
9287 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9288 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9289 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9290 -Wunused-result, -Wunused-variable. This should go away once
9291 the Emacs and Gnulib regex code is merged.
9292 (xmalloc, xrealloc): Now static.
9293
9294 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9295
9296 * dired.c (Fsystem_groups): Remove unused local.
9297
9298 2012-04-17 Glenn Morris <rgm@gnu.org>
9299
9300 * dired.c (Fsystem_users): Doc fix.
9301
9302 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9303
9304 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9305 (syms_of_dired): Add them.
9306
9307 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9308
9309 Fix minor alloc.c problems found by static checking.
9310 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9311 New extern decls, to avoid calling undeclared functions.
9312 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9313 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9314 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9315 (NEED_MEM_INSERT): New macro.
9316 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9317 Remove one incorrect comment and fix another.
9318
9319 Fix minor ralloc.c problems found by static checking.
9320 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9321 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9322 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9323 (r_alloc_sbrk): Now static.
9324
9325 Improve ralloc.c interface checking.
9326 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9327 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9328 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9329 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9330 [REL_ALLOC]: ... to here, to check interface.
9331 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9332 Remove decls. This fixes an "It stinks!".
9333
9334 * alloc.c (which_symbols): Fix alignment issue / type clash.
9335
9336 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9337
9338 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9339 (struct Lisp_Misc_Any): Likewise.
9340 (struct Lisp_Free): Likewise.
9341 * alloc.c (union aligned_Lisp_Symbol): Define.
9342 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9343 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9344 (union aligned_Lisp_Misc): Define.
9345 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9346 aligned_Lisp_Misc instead of union Lisp_Misc.
9347 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9348
9349 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9350
9351 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9352 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9353 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9354 * s/netbsd.h, s/sol2-6.h:
9355 Remove definition of GC_MARK_STACK, since the default now works.
9356 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9357 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9358 no longer the default.
9359 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9360
9361 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9362
9363 * lread.c (lisp_file_lexically_bound_p):
9364 Fix hang at ";-*-\n" (bug#11238).
9365
9366 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9367
9368 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9369 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9370
9371 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9372
9373 * nsterm.m (constrainFrameRect): Always constrain when there is only
9374 one screen (Bug#10962).
9375
9376 2012-04-13 Ken Brown <kbrown@cornell.edu>
9377
9378 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9379
9380 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9381
9382 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9383
9384 2012-04-11 Daniel Colascione <dancol@dancol.org>
9385
9386 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9387 against is gone. It's better to use vfork now so that when Cygwin
9388 gains a new, working vfork, we use it automatically (bug#10398).
9389
9390 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9391
9392 * window.c (save_window_save): Obey window-point-insertion-type.
9393
9394 2012-04-11 Glenn Morris <rgm@gnu.org>
9395
9396 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9397
9398 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9399
9400 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9401
9402 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9403
9404 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9405 (force_quit_count): New var.
9406 (handle_interrupt): Use it.
9407
9408 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9409
9410 * w32.c (w32_delayed_load): Record the full path of the library
9411 being loaded (bug#10424).
9412
9413 2012-04-09 Glenn Morris <rgm@gnu.org>
9414
9415 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9416 not just in the obarray, before snarfing them. (Bug#11036)
9417
9418 * Makefile.in ($(leimdir)/leim-list.el):
9419 Pass EMACS rather than BUILT_EMACS.
9420
9421 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9422
9423 * process.c (make_process):
9424 * process.h: Add integer `gnutls_handshakes_tried' member to
9425 process struct.
9426
9427 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9428 Add convenience `GNUTLS_LOG2i' macro.
9429
9430 * gnutls.c (gnutls_log_function2i): Convenience log function.
9431 (emacs_gnutls_read): Use new log functions,
9432 `gnutls_handshakes_tried' process member, and
9433 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9434 attempts per process (connection).
9435
9436 2012-04-09 Chong Yidong <cyd@gnu.org>
9437
9438 * eval.c (Fuser_variable_p, user_variable_p_eh)
9439 (lisp_indirect_variable): Functions deleted.
9440 (Fdefvar): Caller changed.
9441
9442 * callint.c (Finteractive, Fcall_interactively):
9443 * minibuf.c (Fread_variable): Callers changed.
9444
9445 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9446
9447 * xdisp.c (set_cursor_from_row): If the display string appears in
9448 the buffer at position that is closer to point than the position
9449 after the display string, display the cursor on the first glyph of
9450 the display string. Fixes cursor display when a 'display' text
9451 property immediately follows invisible text. (Bug#11094)
9452
9453 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9454
9455 composite.c: use 'double' consistently
9456 * composite.c (get_composition_id): Use 'double' consistently
9457 instead of converting 'float' to 'double' and vice versa; this is
9458 easier to understand and avoids a GCC warning.
9459
9460 2012-04-09 Glenn Morris <rgm@gnu.org>
9461
9462 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9463 preparation for dumping it with emacs. (Bug#4789)
9464 (leimdir): New variable.
9465 ($(leimdir)/leim-list.el): New rule.
9466 (emacs$(EXEEXT)): Depend on leim-list.el.
9467
9468 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9469 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9470 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9471
9472 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9473
9474 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9475 proper alignment.
9476
9477 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9478
9479 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9480 Remove unused local variable.
9481
9482 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9483
9484 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9485 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9486 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9487 objects, as mark_maybe_pointer will catch them otherwise.
9488 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9489 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9490
9491 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9492
9493 Fix typo that broke non-Windows builds.
9494 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9495
9496 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9497
9498 Support building on MS-Windows with libxml2.
9499
9500 * makefile.w32-in (OBJ2): Add xml.$(O).
9501 (GLOBAL_SOURCES): Add xml.c.
9502 ($(BLD)/xml.$(O)): New dependency list.
9503
9504 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9505 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9506 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9507 [!WINDOWSNT]: New macros.
9508 (init_libxml2_functions, libxml2_loaded_p): New functions.
9509 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9510 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9511 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9512 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9513 linked in).
9514 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9515 Call init_libxml2_functions before calling libxml2 functions.
9516 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9517
9518 * emacs.c: Don't include libxml/parser.h.
9519 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9520 xmlCleanupParser directly.
9521
9522 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9523
9524 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9525
9526 * indent.c (Fvertical_motion): If there is a display string at
9527 point, use it.vpos to compute how many lines to backtrack after
9528 move_it_to point. (Bug#11133)
9529
9530 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9531
9532 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9533 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9534 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9535 macros related to unification of CJK characters. For the details,
9536 see the discussion following the message here:
9537 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9538
9539 2012-04-04 Chong Yidong <cyd@gnu.org>
9540
9541 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9542
9543 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9544
9545 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9546 instead of alloca. (Bug#11138)
9547
9548 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9549
9550 * w32menu.c (is_simple_dialog): Properly check lisp types.
9551 (Bug#11141)
9552
9553 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9554
9555 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9556 position we get to after a call to move_it_to fails the
9557 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9558 only if we wind up in a string from display property. (Bug#11063)
9559
9560 * window.c (Fdelete_other_windows_internal): Invalidate the row
9561 and column information about mouse highlight, so that redisplay
9562 restores it after reallocating the glyph matrices. (Bug#7464)
9563
9564 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9565 string comes from a `display' text property, use the buffer
9566 position of that property as if we actually saw that position in
9567 the row's glyphs.
9568 (move_it_by_lines): Remove the assertion that
9569 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9570 violated when there's a before-string at the beginning of a line.
9571 (Bug#11063)
9572
9573 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9574
9575 * xdisp.c (append_space_for_newline): If the default face was
9576 remapped, use the remapped face for the appended newline.
9577 (extend_face_to_end_of_line): Use the remapped default face for
9578 extending the face to the end of the line.
9579 (display_line): Call extend_face_to_end_of_line when the default
9580 face was remapped. (Bug#11068)
9581
9582 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9583
9584 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9585
9586 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9587
9588 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9589
9590 2012-03-27 Glenn Morris <rgm@gnu.org>
9591
9592 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9593 Doc fixes.
9594
9595 2012-03-26 Kenichi Handa <handa@m17n.org>
9596
9597 * dispextern.h (struct glyph): Fix previous change. Change the
9598 bit length of glyphless.ch to 25 (Bug#11082).
9599
9600 2012-03-26 Chong Yidong <cyd@gnu.org>
9601
9602 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9603 (command_loop_1): Use it; inhibit selection update for
9604 handle-select-window too (Bug#8996).
9605
9606 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9607
9608 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9609
9610 2012-03-25 Kenichi Handa <handa@m17n.org>
9611
9612 * dispextern.h (struct glyph): Change the bit length of
9613 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9614
9615 2012-03-24 Eli Zaretskii <eliz@gnu.org>
9616
9617 * s/ms-w32.h (tzname): Include time.h before redirecting to
9618 _tzname. Fixes the MSVC build. (Bug#9960)
9619
9620 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9621
9622 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9623 characters.
9624
9625 * xterm.c (XTread_socket): Only modify handling_signal if
9626 !SYNC_INPUT. (Bug#11080)
9627
9628 2012-03-23 Eli Zaretskii <eliz@gnu.org>
9629
9630 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9631 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9632 when fetching a multibyte character consumes more bytes than
9633 CHAR_BYTES returns, due to unification of CJK characters in
9634 string_char. (Bug#11073)
9635
9636 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9637
9638 * process.c (wait_reading_process_output): Handle pty disconnect
9639 by refraining from sending oneself a SIGCHLD (bug#10933).
9640
9641 2012-03-22 Chong Yidong <cyd@gnu.org>
9642
9643 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9644
9645 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9646 Mark string as coming from a prefix property.
9647 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9648 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9649
9650 2012-03-21 Chong Yidong <cyd@gnu.org>
9651
9652 * xfaces.c (Vface_remapping_alist): Doc fix.
9653
9654 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9655
9656 * w32proc.c (Fw32_set_console_codepage)
9657 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9658 Doc fixes.
9659
9660 2012-03-20 Chong Yidong <cyd@gnu.org>
9661
9662 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9663 to reflect default non-nil value of redisplay-dont-pause.
9664
9665 2012-03-19 Kenichi Handa <handa@m17n.org>
9666
9667 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9668 it fit in a valid range (Bug#11003).
9669
9670 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9671
9672 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9673 that is not from display property, accept the row as a "cursor
9674 row" if one of the string's character has a non-nil `cursor'
9675 property. Fixes cursor positioning when there are newlines in
9676 overlay strings, e.g. in icomplete.el. (Bug#11035)
9677
9678 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9679
9680 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9681
9682 2012-03-12 Chong Yidong <cyd@gnu.org>
9683
9684 * eval.c (inhibit_lisp_code): Rename from
9685 inhibit_window_configuration_change_hook; move from window.c.
9686
9687 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9688 * window.c (run_window_configuration_change_hook)
9689 (syms_of_window): Callers changed.
9690
9691 2012-03-11 Chong Yidong <cyd@gnu.org>
9692
9693 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9694
9695 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9696
9697 2012-03-10 Chong Yidong <cyd@gnu.org>
9698
9699 * frame.c (other_visible_frames): Don't assume the selected frame
9700 is visible (Bug#10955).
9701
9702 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9703
9704 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9705
9706 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9707
9708 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9709 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9710 zero (Bug#10954).
9711
9712 2012-03-03 Glenn Morris <rgm@gnu.org>
9713
9714 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9715
9716 2012-03-02 Eli Zaretskii <eliz@gnu.org>
9717
9718 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9719 position past the first glyph_row that ends at ZV. (Bug#10902)
9720 (redisplay_window, next_element_from_string): Fix typos in
9721 comments.
9722 (redisplay_window): Pass to move_it_vertically the margin in
9723 pixels, not in screen lines.
9724
9725 2012-03-02 Glenn Morris <rgm@gnu.org>
9726
9727 * buffer.c (buffer-list-update-hook): Doc fix.
9728
9729 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9730
9731 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9732 push_it before setting up the iterator for the first overlay
9733 string, even if we have an empty string loaded.
9734 (next_overlay_string): If there's an empty string on the iterator
9735 stack, pop the stack. (Bug#10903)
9736
9737 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9738
9739 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9740 Suggested by Stefan Monnier in
9741 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9742 * alloc.c (widen_to_Lisp_Object): New static function.
9743 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9744 and widening them to Lisp_Objects. This would work even if
9745 USE_LSB_TAG is defined and wide integers are used, which might
9746 happen in a future version of Emacs.
9747
9748 2012-02-25 Chong Yidong <cyd@gnu.org>
9749
9750 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9751 Doc fix.
9752
9753 * xselect.c (Fx_selection_exists_p): Doc fix.
9754 (x_clipboard_manager_save_all): Print an informative message
9755 before saving to clipboard manager.
9756
9757 2012-02-24 Chong Yidong <cyd@gnu.org>
9758
9759 * keyboard.c (process_special_events): Handle all X selection
9760 requests in kbd_buffer, not just the next one (Bug#8869).
9761
9762 2012-02-23 Chong Yidong <cyd@gnu.org>
9763
9764 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9765 call when setting menu-bar-lines and tool-bar-lines parameters.
9766 (unwind_create_frame_1): New helper function.
9767
9768 * window.c (inhibit_window_configuration_change_hook): New var.
9769 (run_window_configuration_change_hook): Obey it.
9770 (syms_of_window): Initialize it.
9771
9772 2012-02-22 Chong Yidong <cyd@gnu.org>
9773
9774 * xterm.c (x_draw_image_relief): Add missing type check for
9775 Vtool_bar_button_margin (Bug#10743).
9776
9777 2012-02-21 Chong Yidong <cyd@gnu.org>
9778
9779 * fileio.c (Vfile_name_handler_alist): Doc fix.
9780
9781 * buffer.c (Fget_file_buffer): Protect against invalid file
9782 handler return value.
9783
9784 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9785
9786 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9787 when computing $valmask.
9788
9789 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9790 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9791 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9792 It's useless in that case, and it can cause problems on hosts
9793 that allocate halves of EMACS_INT values separately.
9794 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9795 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9796 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9797 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9798 it avoids undefined behavior on hosts where shifting right by more
9799 than the word width has undefined behavior.
9800
9801 2012-02-19 Chong Yidong <cyd@gnu.org>
9802
9803 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9804 (Funhandled_file_name_directory, Ffile_name_as_directory)
9805 (Fdirectory_file_name, Fexpand_file_name)
9806 (Fsubstitute_in_file_name): Protect against invalid file handler
9807 return values (Bug#10845).
9808
9809 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9810
9811 * .gdbinit (pitx): Fix incorrect references to fields of the
9812 iterator stack.
9813
9814 2012-02-17 Chong Yidong <cyd@gnu.org>
9815
9816 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9817
9818 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9819
9820 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9821 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9822
9823 2012-02-15 Chong Yidong <cyd@gnu.org>
9824
9825 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9826 marked as special. Also, starting docstrings with * is obsolete.
9827
9828 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9829
9830 * gnutls.c (emacs_gnutls_write): Fix last change.
9831
9832 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9833
9834 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9835 send_process.
9836
9837 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9838
9839 * keymap.c (Fsingle_key_description): Handle char ranges.
9840
9841 2012-02-12 Chong Yidong <cyd@gnu.org>
9842
9843 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9844 as that creates a dangerous corner case.
9845
9846 * window.c (Fdelete_window_internal): Invalidate the mouse
9847 highlight (Bug#9904).
9848
9849 2012-02-12 Glenn Morris <rgm@gnu.org>
9850
9851 * xselect.c (Fx_own_selection_internal)
9852 (Fx_get_selection_internal, Fx_disown_selection_internal)
9853 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9854 * nsselect.m (Fx_own_selection_internal)
9855 (Fx_disown_selection_internal, Fx_selection_exists_p)
9856 (Fx_selection_owner_p, Fx_get_selection_internal):
9857 Sync docs and argument specs with the xselect.c versions.
9858
9859 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9860
9861 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9862
9863 2012-02-11 Eli Zaretskii <eliz@gnu.org>
9864
9865 * w32select.c (Fx_selection_exists_p): Sync doc string and
9866 argument list with xselect.c. (Bug#10783)
9867
9868 * w16select.c (Fx_selection_exists_p): Sync doc string and
9869 argument list with xselect.c. (Bug#10783)
9870
9871 2012-02-10 Glenn Morris <rgm@gnu.org>
9872
9873 * fns.c (Fsecure_hash): Doc fix.
9874
9875 2012-02-09 Kenichi Handa <handa@m17n.org>
9876
9877 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9878
9879 2012-02-07 Chong Yidong <cyd@gnu.org>
9880
9881 * buffer.c (Fbuffer_local_variables)
9882 (buffer_lisp_local_variables): Handle unbound vars correctly;
9883 don't let Qunbound leak into Lisp.
9884
9885 2012-02-07 Glenn Morris <rgm@gnu.org>
9886
9887 * image.c (Fimagemagick_types): Doc fix.
9888
9889 * image.c (imagemagick-render-type): Change it from a lisp object
9890 to an integer. Move the doc here from the lisp manual.
9891 Treat all values not equal to 0 the same.
9892
9893 2012-02-06 Chong Yidong <cyd@gnu.org>
9894
9895 * doc.c (store_function_docstring): Avoid applying docstring of
9896 alias to base function (Bug#2603).
9897
9898 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9899
9900 * .gdbinit (pp1, pv1): Remove redundant defines.
9901 (pr): Use pp.
9902
9903 2012-02-04 Chong Yidong <cyd@gnu.org>
9904
9905 * nsterm.m: Declare a global (Bug#10694).
9906
9907 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9908
9909 * w32.c (get_emacs_configuration_options):
9910 Include --enable-checking, if specified, in the return value.
9911
9912 2012-02-04 Martin Rudalics <rudalics@gmx.at>
9913
9914 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9915 after rounding frame sizes. (Bug#9723)
9916
9917 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9918
9919 * keyboard.c (adjust_point_for_property): Don't position point
9920 before BEGV. (Bug#10696)
9921
9922 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9923
9924 Handle overflow when computing char display width (Bug#9496).
9925 * character.c (char_width): Return EMACS_INT, not int.
9926 (char_width, c_string_width): Check for overflow when
9927 computing the width; this is possible now that individual
9928 characters can have unbounded width. Problem introduced
9929 by merge from Emacs 23 on 2012-01-19.
9930
9931 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
9932
9933 * dbusbind.c (Fdbus_register_method): Mention the return value
9934 :ignore in the docstring.
9935
9936 2012-02-02 Glenn Morris <rgm@gnu.org>
9937
9938 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9939
9940 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9941 Unconditionally set to t. (Bug#10673)
9942 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9943 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9944 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9945
9946 2012-02-02 Kenichi Handa <handa@m17n.org>
9947
9948 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9949 0, do not call append_composite_glyph.
9950
9951 2012-02-02 Kenichi Handa <handa@m17n.org>
9952
9953 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9954 NULL (Bug#6988).
9955 (x_produce_glyphs): If the component of a composition is a null
9956 string, set it->pixel_width to 1 to avoid zero-width glyph.
9957
9958 2012-02-01 Eli Zaretskii <eliz@gnu.org>
9959
9960 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9961 first 2 arguments are identical. This makes inserting large
9962 output from a subprocess an order of magnitude faster on
9963 MS-Windows, where all sbrk'ed memory is always contiguous.
9964
9965 2012-01-31 Glenn Morris <rgm@gnu.org>
9966
9967 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9968 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9969 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9970
9971 2012-01-29 Glenn Morris <rgm@gnu.org>
9972
9973 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9974
9975 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9976
9977 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9978
9979 2012-01-28 Chong Yidong <cyd@gnu.org>
9980
9981 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9982
9983 2012-01-26 Chong Yidong <cyd@gnu.org>
9984
9985 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9986
9987 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9988 repeat counts (Bug#10507).
9989
9990 2012-01-26 Glenn Morris <rgm@gnu.org>
9991
9992 * lread.c (syms_of_lread): Doc fix.
9993
9994 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9995
9996 * coding.c (encode_designation_at_bol): Change return value to
9997 EMACS_INT.
9998
9999 2012-01-25 Chong Yidong <cyd@gnu.org>
10000
10001 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10002
10003 2012-01-21 Chong Yidong <cyd@gnu.org>
10004
10005 * floatfns.c (Fcopysign): Make the second argument non-optional,
10006 since nil is not allowed anyway.
10007
10008 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10009
10010 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10011 (send_process): Likewise.
10012
10013 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10014
10015 * window.c (save_window_save, Fcurrent_window_configuration)
10016 (Vwindow_persistent_parameters): Do not use Qstate.
10017 Rewrite doc-strings.
10018
10019 2012-01-19 Kenichi Handa <handa@m17n.org>
10020
10021 * character.c (char_width): New function.
10022 (Fchar_width, c_string_width, lisp_string_width):
10023 Use char_width (Bug#9496).
10024
10025 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10026
10027 * window.c (Vwindow_persistent_parameters): New variable.
10028 (Fset_window_configuration, save_window_save): Handle persistent
10029 window parameters.
10030
10031 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10032
10033 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10034 thrashing the stack of the thread. (Bug#9087)
10035
10036 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10037
10038 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10039
10040 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10041
10042 * xdisp.c (rows_from_pos_range): Handle the case where the
10043 highlight ends on a newline. (Bug#10464)
10044 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10045 he end column for display of highlight that ends on a newline
10046 before a R2L line.
10047
10048 2012-01-11 Glenn Morris <rgm@gnu.org>
10049
10050 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10051 from load-path also when installation-directory is nil. (Bug#10208)
10052
10053 2012-01-10 Glenn Morris <rgm@gnu.org>
10054
10055 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10056
10057 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10058 Update template values to be closer to their typical values these days.
10059
10060 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10061
10062 * xdisp.c (rows_from_pos_range): Accept additional argument
10063 DISP_STRING, and accept any glyph in a row whose object is that
10064 string as eligible for mouse highlight. Fixes mouse highlight of
10065 display strings from overlays. (Bug#10464)
10066
10067 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10068
10069 emacs: fix an auto-save permissions race condition (Bug#10400)
10070 * fileio.c (auto_saving_dir_umask): New static var.
10071 (Fmake_directory_internal): Use it.
10072 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10073 creating the directory. The old code temporarily assigns
10074 too-generous permissions to the directory.
10075 (do_auto_save_eh): Clear it.
10076 (Fdo_auto_save): Catch all errors, not just file errors, so
10077 that the var is always cleared.
10078
10079 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10080
10081 * search.c (scan_buffer): Pass character positions to
10082 know_region_cache, not byte positions. (Bug#6540)
10083
10084 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10085
10086 * w32.c (sys_rename): Report EXDEV when rename of a directory
10087 fails because the target is on another logical disk. (Bug#10284)
10088
10089 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10090
10091 * xterm.c (x_embed_request_focus): New function.
10092
10093 * xterm.h: Add prototype.
10094
10095 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10096
10097 2012-01-05 Glenn Morris <rgm@gnu.org>
10098
10099 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10100
10101 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10102
10103 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10104 Load gnutls_transport_set_lowat only if GnuTLS version is below
10105 2.11.1.
10106 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10107 GnuTLS versions below 2.11.1.
10108
10109 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10110
10111 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10112 to the doc string advising against its use for altering the way
10113 windows are scrolled.
10114
10115 2011-12-28 Kenichi Handa <handa@m17n.org>
10116
10117 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10118 coding-system ASCII compatible only when it does not produce BOM
10119 on encoding (Bug#10383).
10120
10121 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10122
10123 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10124 can scroll.
10125 (create_and_show_popup_menu): Always use menu_position_func for
10126 Gtk3 (Bug#10361).
10127
10128 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10129
10130 * callint.c (Fcall_interactively): Don't truncate prompt string.
10131
10132 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10133
10134 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10135 property that ends at ZV, so that the bidi iteration could be
10136 resumed from there (after widening). (Bug#10360)
10137
10138 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10139
10140 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10141
10142 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10143
10144 * nsterm.m (x_free_frame_resources):
10145 Release f->output_data.ns->miniimage.
10146 (ns_index_color): Fix indentation. Do not retain
10147 color_table->colors[i].
10148
10149 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10150 before returning.
10151
10152 * nsfns.m (x_set_background_color): Assign return value from
10153 ns_index_color to face-background instead of NSColor*.
10154 (ns_implicitly_set_icon_type): Fix indentation.
10155 Change assignment in for loop to comparison.
10156
10157 * emacs.c (ns_pool): New variable.
10158 (main): Assign ns_pool.
10159 (Fkill_emacs): Call ns_release_autorelease_pool.
10160
10161 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10162 autorelease fdesc, release fdAttrs and tdict.
10163 (ns_get_covering_families): Release charset.
10164 (ns_findfonts): Release NSFontDescriptor created with new.
10165 (ns_uni_to_glyphs): Fix indentation.
10166 (setString): Release attrStr before assigning new value.
10167
10168 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10169
10170 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10171 and NS_IMPL_COCOA.
10172 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10173 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10174
10175 2011-12-18 David Reitter <reitter@cmu.edu>
10176
10177 * nsterm.m (ns_term_init): Subscribe for notifications
10178 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10179 to method trackingNotification in EmacsMenu.
10180
10181 * nsmenu.m (trackingMenu): New variable.
10182 (trackingNotification): New method (from Aquamacs).
10183 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10184 from Aquamacs (Bug#7030).
10185
10186 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10187
10188 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10189 (symbol_to_nsstring): Fix indentation.
10190 (ns_symbol_to_pb): New function.
10191 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10192 (Fns_rotate_cut_buffers_internal): Remove.
10193 (Fns_store_selection_internal): Rename from
10194 Fns_store_cut_buffer_internal.
10195 (ns_get_foreign_selection, Fx_own_selection_internal)
10196 (Fx_disown_selection_internal, Fx_selection_exists_p)
10197 (Fns_get_selection_internal, Fns_store_selection_internal):
10198 Use ns_symbol_to_pb and check if return value is nil.
10199 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10200 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10201 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10202 renamed to Sns_store_selection_internal.
10203 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10204 and remove this function.
10205 (ns_handle_selection_clear): Remove, never used.
10206 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10207 here.
10208
10209 2011-12-17 Ken Brown <kbrown@cornell.edu>
10210
10211 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10212 GID is unknown (Bug#10257).
10213
10214 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10215
10216 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10217 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10218 which caused a build failure on GNU/Linux IA-64. This problem was
10219 introduced by my 2011-10-07 patch.
10220
10221 2011-12-15 Juri Linkov <juri@jurta.org>
10222
10223 * image.c (imagemagick_error): New function. (Bug#10112)
10224 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10225 Use `imagemagick_error' where ImageMagick functions return
10226 `MagickFalse'.
10227 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10228 proper order.
10229
10230 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10231
10232 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10233 fill background (Bug#8992).
10234
10235 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10236
10237 * window.c (Vwindow_combination_resize)
10238 (Vwindow_combination_limit): Use t instead of non-nil in
10239 doc-strings.
10240 (Vrecenter_redisplay): Add first sentence of doc-string on
10241 separate line.
10242 (Frecenter): Fix doc-string typo.
10243
10244 2011-12-11 Kenichi Handa <handa@m17n.org>
10245
10246 * coding.c (Funencodable_char_position): Pay attention to the
10247 buffer text relocation (Bug#9389).
10248
10249 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10250
10251 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10252 gtk_init (Bug#10100).
10253
10254 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10255
10256 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10257 IT->string is nil. (Bug#10263)
10258
10259 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10260
10261 * nsterm.h (x_free_frame_resources): Declare.
10262
10263 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10264 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10265
10266 * nsterm.h (ns_get_defaults_value): Declare.
10267
10268 * nsterm.m (ns_default): Call ns_get_defaults_value.
10269
10270 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10271
10272 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10273 (Bug#10170)
10274
10275 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10276
10277 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10278 that where the value of an _OBJC_* symbol points to is in the .bss
10279 section (Bug#10240).
10280
10281 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10282
10283 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10284 after the loop to call ccl_driver at least once (Bug#8619).
10285
10286 2011-12-08 Kenichi Handa <handa@m17n.org>
10287
10288 * ftfont.c (get_adstyle_property): Fix previous change
10289 (Bug#10233).
10290
10291 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10292
10293 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10294 dirs from the default value of EMACSLOADPATH (bug#10208).
10295
10296 2011-12-07 Glenn Morris <rgm@gnu.org>
10297
10298 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10299 installation and source directories as well. (Bug#10208)
10300
10301 2011-12-06 Chong Yidong <cyd@gnu.org>
10302
10303 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10304
10305 2011-12-06 Glenn Morris <rgm@gnu.org>
10306
10307 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10308 as an error, not just -1. (Bug#10217)
10309
10310 2011-12-05 Chong Yidong <cyd@gnu.org>
10311
10312 * keyboard.c (process_special_events): New function.
10313 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10314
10315 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10316
10317 * coding.c (encode_designation_at_bol): Don't use uninitialized
10318 local variable (Bug#9318).
10319
10320 2011-12-05 Kenichi Handa <handa@m17n.org>
10321
10322 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10323 return Qnil (Bug#8046, Bug#10193).
10324
10325 2011-12-05 Kenichi Handa <handa@m17n.org>
10326
10327 * coding.c (encode_designation_at_bol): New args charbuf_end and
10328 dst. Return the number of produced bytes. Callers changed.
10329 (coding_set_source): Return how many bytes coding->source was
10330 relocated.
10331 (coding_set_destination): Return how many bytes
10332 coding->destination was relocated.
10333 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10334 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10335
10336 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10337
10338 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10339 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10340 macro (Bug#9318).
10341
10342 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10343
10344 The following changes are to fix Bug#9318.
10345
10346 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10347 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10348 (encode_coding_iso_2022, encode_coding_sjis)
10349 (encode_coding_big5, encode_coding_charset): Use the above macros.
10350
10351 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10352
10353 * lisp.h (process_quit_flag): Fix external declaration.
10354
10355 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10356
10357 Don't macro-inline non-performance-critical code.
10358 * eval.c (process_quit_flag): New function.
10359 * lisp.h (QUIT): Use it.
10360
10361 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10362
10363 * nsfns.m (get_geometry_from_preferences): New function.
10364 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10365
10366 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10367
10368 * emacs.c (Qkill_emacs): Define.
10369 (syms_of_emacs): Initialize it.
10370 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10371 Qquit_flag to `kill-emacs' instead.
10372 (quit_throw_to_read_char): Add parameter `from_signal'.
10373 All callers changed. Call Fkill_emacs if requested and safe.
10374 * lisp.h (QUIT): Call Fkill_emacs if requested.
10375
10376 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10377
10378 * widget.c (update_wm_hints): Return if wmshell is null.
10379 (widget_update_wm_size_hints): New function.
10380
10381 * widget.h (widget_update_wm_size_hints): Declare.
10382
10383 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10384 widget_update_wm_size_hints (Bug#10104).
10385
10386 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10387
10388 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10389 before a newline, prepare the bidi iterator for consuming the
10390 newline, and keep the current paragraph direction. (Bug#10183)
10391 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10392
10393 2011-12-02 Juri Linkov <juri@jurta.org>
10394
10395 * search.c (Fword_search_regexp): New Lisp function created from
10396 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10397 (Fword_search_backward, Fword_search_forward)
10398 (Fword_search_backward_lax, Fword_search_forward_lax):
10399 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10400 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10401
10402 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10403
10404 * fileio.c (Finsert_file_contents): Move after-change-function call
10405 to before the "handled:" label, since all "goto handled" appear in
10406 cases where the *-change-functions have already been properly called
10407 (bug#10117).
10408
10409 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10410
10411 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10412 waiting for input. (Bug#10169)
10413
10414 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10415
10416 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10417 verifies glyph row's hash code--we have just reallocated the
10418 glyphs, so their contents can be complete garbage. (Bug#10164)
10419
10420 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10421
10422 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10423
10424 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10425
10426 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10427 attributes are tested _before_ calling verify_row_hash, to protect
10428 against GCC re-ordering of the tests. (Bug#10164)
10429
10430 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10431
10432 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10433
10434 * xterm.c (handle_one_xevent): Only set async_visible and friends
10435 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10436 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10437 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10438
10439 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10440
10441 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10442 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10443 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10444 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10445 All uses changed to use GCPRO1 etc.
10446 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10447 Revert to old implementation (i.e., before 2011-03-11).
10448
10449 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10450
10451 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10452 of scroll runs so as to avoid assigning disabled bogus rows and
10453 unnecessary graphics copy operations.
10454
10455 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10456
10457 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10458 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10459 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10460 (malloc, free, realloc, calloc): Redirect to e_* only when
10461 compiling Emacs.
10462
10463 * lisp.h (GCTYPEBITS): Move before first use.
10464 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10465 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10466 this macro definition.
10467
10468 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10469 _MSC_VER.
10470
10471 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10472
10473 * gtkutil.c (xg_create_frame_widgets):
10474 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10475 present with Gtk+ 2.0.
10476
10477 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10478
10479 * fileio.c (Finsert_file_contents): Undo previous change; see
10480 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10481
10482 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10483
10484 Rename locals to avoid shadowing.
10485 * fileio.c (Finsert_file_contents):
10486 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10487 * process.c (wait_reading_process_output):
10488 Rename inner 'proc' to 'p' to avoid shadowing.
10489 Indent for consistency with usual Emacs style.
10490
10491 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10492
10493 * xdisp.c (redisplay_window): If cursor row is not fully visible
10494 after recentering, and scroll-conservatively is set to a large
10495 number, scroll window by a few more lines to make the cursor fully
10496 visible and out of scroll-margin. (Bug#10105)
10497 (start_display): Don't move to the next line if the display should
10498 start at a newline that is part of a display vector or an overlay
10499 string. (Bug#10119)
10500
10501 2011-11-24 Juri Linkov <juri@jurta.org>
10502
10503 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10504 after the `MagickPingImage' call. (Bug#10112)
10505
10506 2011-11-23 Chong Yidong <cyd@gnu.org>
10507
10508 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10509
10510 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10511
10512 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10513 making another buffer current. (Bug#10114)
10514
10515 2011-11-23 Glenn Morris <rgm@gnu.org>
10516
10517 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10518
10519 2011-11-23 Chong Yidong <cyd@gnu.org>
10520
10521 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10522 using it (Bug#5984).
10523
10524 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10525
10526 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10527 and header-lines, as they don't have one computed for them.
10528 (Bug#10098)
10529
10530 * .gdbinit (prow): Make displayed values more self-explaining.
10531 Add row's hash code.
10532
10533 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10534
10535 * process.c (wait_reading_process_output): Fix asynchrounous
10536 GnuTLS socket handling on some versions of the GnuTLS library.
10537 (wait_reading_process_output): Add comment and URL.
10538
10539 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10540
10541 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10542
10543 2011-11-21 Chong Yidong <cyd@gnu.org>
10544
10545 * window.c (Fnext_window, Fprevious_window): Doc fix.
10546
10547 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10548
10549 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10550
10551 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10552
10553 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10554
10555 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10556
10557 * window.c (Fset_window_combination_limit): Rename argument
10558 STATUS to LIMIT.
10559 (Vwindow_combination_limit): Remove "status" from doc-string.
10560
10561 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10562
10563 * m/ibms390.h: Remove.
10564 * m/ibms390x.h: Don't include "ibms390.h".
10565
10566 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10567
10568 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10569 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10570
10571 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10572
10573 * casetab.c (Fset_case_table):
10574 * charset.c (Fcharset_after): Fix typos.
10575
10576 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10577
10578 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10579 Otherwise, valgrind does not work on some platforms.
10580 Problem reported by Andreas Schwab in
10581 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10582 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10583 is set, removing the need for VIRT_ADDRESS_VARIES.
10584 (PURE_P): Use a more-efficient implementation that needs just one
10585 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10586 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10587 to 4 (xorl, subq, cmpq, setbe).
10588 * alloc.c (pure): Always extern now, since that's the
10589 VIRT_ADDR_VARIES behavior.
10590 (PURE_POINTER_P): Use a single comparison, not two, for
10591 consistency with the new puresize.h.
10592 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10593 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10594 Remove VIRT_ADDR_VARIES no longer needed.
10595
10596 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10597
10598 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10599 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10600 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10601 behave as if the cursor position were at the window margin.
10602
10603 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10604 and the cursor position is out of bounds, behave as if the cursor
10605 position were at the window margin. (Bug#10075)
10606
10607 2011-11-18 Chong Yidong <cyd@gnu.org>
10608
10609 * window.c (Fwindow_combination_limit): Make first argument
10610 non-optional, since it is meaningless for live windows like the
10611 selected window.
10612
10613 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10614
10615 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10616
10617 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10618
10619 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10620 (graft_intervals_into_buffer): Simplify.
10621
10622 2011-11-18 Eli Zaretskii <eliz@gnu.org>
10623
10624 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10625 hash values of the two rows.
10626 (copy_row_except_pointers): Preserve the used[] arrays and the
10627 hash values of the two rows. (Bug#10035)
10628 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10629
10630 * xdisp.c (row_hash): New function, body extracted from
10631 compute_line_metrics.
10632 (compute_line_metrics): Call row_hash, instead of computing the
10633 hash code inline.
10634
10635 * dispnew.c (verify_row_hash): Call row_hash for computing the
10636 hash code of a row, instead of duplicating code from xdisp.c.
10637
10638 * dispextern.h (row_hash): Add prototype.
10639
10640 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10641
10642 * frame.c (delete_frame): Don't delete the terminal when the last
10643 X frame is closed if emacs is built with GTK toolkit.
10644
10645 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
10646
10647 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10648
10649 2011-11-17 Martin Rudalics <rudalics@gmx.at>
10650
10651 * window.c (Vwindow_splits): Rename to
10652 Vwindow_combination_resize. Suggested by Juri Linkov.
10653 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10654 of Vwindow_splits.
10655
10656 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10657
10658 * nsfns.m (Fns_font_name):
10659 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10660
10661 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10662
10663 * window.h (window): Rename slot "nest" to "combination_limit".
10664 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10665 (Fset_window_nest): Rename to Fset_window_combination_limit.
10666 (Vwindow_nest): Rename to Vwindow_combination_limit.
10667 (recombine_windows, make_parent_window, make_window)
10668 (Fsplit_window_internal, saved_window)
10669 (Fset_window_configuration, save_window_save): Rename all
10670 occurrences of window_nest to window_combination_limit.
10671
10672 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10673
10674 * image.c (imagemagick_load_image): Fix typo.
10675
10676 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10677
10678 * xdisp.c (display_line): Move the call to
10679 highlight_trailing_whitespace before the call to
10680 compute_line_metrics, since the latter needs to see the final
10681 faces of all the glyphs to compute ROW's hash value.
10682 Fixes assertion violations in row_equal_p. (Bug#10035)
10683
10684 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10685
10686 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10687 just return (bug#10044).
10688
10689 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10690
10691 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10692 with user-defined heap size. Bump the default size of the temacs
10693 heap to 27MB, to avoid memory warning when running temacs.
10694 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10695
10696 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10697 current_matrix and desired_matrix. (Bug#9990)
10698 (verify_row_hash) [XASSERTS]: New function.
10699 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10700 that the hash value of glyph rows is correct.
10701
10702 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10703
10704 * window.h (window): Remove splits slot.
10705 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10706 (Fdelete_other_windows_internal, make_parent_window)
10707 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10708 (Fset_window_configuration, save_window_save): Don't deal with
10709 split status of windows.
10710 (saved_window): Remove splits slot.
10711 (Vwindow_splits): Rewrite doc-string.
10712
10713 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10714
10715 * xfns.c (unwind_create_frame):
10716 * nsfns.m (unwind_create_frame):
10717 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10718 Vframe_list (Bug#9999).
10719
10720 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10721
10722 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10723
10724 2011-11-11 Kenichi Handa <handa@m17n.org>
10725
10726 * callproc.c (Fcall_process): Set the member dst_multibyte of
10727 process_coding.
10728
10729 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10730
10731 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10732 avoid a crash (bug#9496).
10733
10734 2011-11-09 Chong Yidong <cyd@gnu.org>
10735
10736 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10737 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10738
10739 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10740
10741 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10742
10743 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10744
10745 Avoid some portability problems by eschewing 'extern inline' functions.
10746 The trivial performance wins aren't worth the portability hassles; see
10747 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10748 et seq.
10749 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10750 (window_box_width, window_box_left, window_box_left_offset)
10751 (window_box_right, window_box_right_offset): Undo previous change,
10752 by removing the "extern"s.
10753 * intervals.c (adjust_intervals_for_insertion)
10754 (adjust_intervals_for_deletion): Undo previous change,
10755 making these static again.
10756 (offset_intervals, temp_set_point_both, temp_set_point)
10757 (copy_intervals_to_string): No longer inline.
10758 * xdisp.c (window_text_bottom_y, window_box_width)
10759 (window_box_height, window_box_left_offset)
10760 (window_box_right_offset, window_box_left, window_box_right)
10761 (window_box): No longer inline.
10762
10763 2011-11-08 Chong Yidong <cyd@gnu.org>
10764
10765 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10766 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10767 Signal an error if not a live window.
10768 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10769 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10770
10771 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
10772
10773 * lisp.h (syms_of_abbrev): Remove declaration.
10774 Reported by CHENG Gao <chenggao@royau.me>.
10775
10776 2011-11-07 Eli Zaretskii <eliz@gnu.org>
10777
10778 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10779 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10780 of temacs in GUI mode.
10781
10782 2011-11-07 Martin Rudalics <rudalics@gmx.at>
10783
10784 * window.h: Declare delete_all_child_windows instead of
10785 delete_all_subwindows.
10786 * window.c (Fwindow_nest, Fset_window_nest)
10787 (Fset_window_new_total, Fset_window_new_normal)
10788 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10789 (delete_all_subwindows): Rename to delete_all_child_windows.
10790 (Fdelete_other_windows_internal, Fset_window_configuration):
10791 Call delete_all_child_windows instead of delete_all_subwindows.
10792 * frame.c (delete_frame): Call delete_all_child_windows instead
10793 of delete_all_subwindows.
10794
10795 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10796
10797 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10798 This is also needed for porting to any host where GC_MARK_STACK is
10799 not GC_MAKE_GCPROS_NOOPS.
10800 (which_symbols): Use it.
10801
10802 2011-11-07 Kenichi Handa <handa@m17n.org>
10803
10804 * coding.c (coding_set_destination): Check coding->src_pos only
10805 when coding->src_object is a buffer (bug#9910).
10806
10807 * process.c (send_process): Set the member src_multibyte of coding
10808 to 0 (bug#9911) when sending a unibyte text.
10809
10810 * callproc.c (Fcall_process): Set the member src_multibyte of
10811 process_coding to 0 (bug#9912).
10812
10813 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10814
10815 * xmenu.c (cleanup_widget_value_tree): New function.
10816 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10817 calling free_menubar_widget_value_tree directly (Bug#9830).
10818
10819 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10820
10821 Fix some portability problems with 'inline'.
10822 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10823 (window_box_width, window_box_left, window_box_left_offset)
10824 (window_box_right, window_box_right_offset): Declare extern.
10825 Otherwise, these inline functions do not conform to C99 and
10826 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10827 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10828 * intervals.c (adjust_intervals_for_insertion)
10829 (adjust_intervals_for_deletion): Now extern, because otherwise the
10830 extern inline functions 'offset_intervals' couldn't refer to it.
10831 (static_offset_intervals): Remove.
10832 (offset_intervals): Rewrite using the old contents of
10833 static_offset_intervals. The old version didn't conform to C99
10834 because an extern inline function contained a reference to an
10835 identifier with static linkage.
10836
10837 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10838
10839 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10840 GC.
10841
10842 2011-11-06 Eli Zaretskii <eliz@gnu.org>
10843
10844 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10845 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10846 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10847 return Qleft_to_right.
10848
10849 2011-11-06 Chong Yidong <cyd@gnu.org>
10850
10851 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10852 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10853 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10854 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10855 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10856 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10857 (Fwindow_vscroll): Doc fix.
10858 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10859 argument, since it makes no sense to pass a live window and for
10860 consistency with window-child.
10861
10862 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10863
10864 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10865 support MSVC.
10866
10867 2011-11-05 Jason Rumney <jasonr@gnu.org>
10868
10869 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10870 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10871 fonts (Bug#6029).
10872 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10873 bitwise arithmetic preventing use of unicode-sip and non-truetype
10874 opentype fonts.
10875
10876 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10877
10878 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10879 "emacs"-only part.
10880
10881 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10882 initialization code to keep similarity to xfns.c after changes
10883 from 2011-11-05.
10884
10885 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10886
10887 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10888 (unwind_create_frame): New function (Bug#9943).
10889 (Fx_create_frame): Restructure code to be more similar to the one in
10890 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10891 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10892 Move terminal->reference_count++ just before making the frame official
10893 (Bug#9943).
10894
10895 * nsterm.m (x_free_frame_resources): New function.
10896 (x_destroy_window): Move code to x_free_frame_resources.
10897
10898 * xfns.c (unwind_create_frame): Fix comment.
10899 (Fx_create_frame, x_create_tip_frame):
10900 Move terminal->reference_count++ just before making the frame
10901 official. Move initialization of image_cache_refcount and
10902 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10903
10904 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10905
10906 Support MSVC build with newer versions of Visual Studio.
10907 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10908 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10909 nt/gmake.defs.
10910
10911 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10912 which are not supported by MSVC.
10913 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10914 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10915 bitfields.
10916 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10917 types in bitfields.
10918 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10919
10920 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10921
10922 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
10923
10924 Support MSVC build with newer versions of Visual Studio.
10925 * w32.c: Don't include w32api.h for MSVC.
10926 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10927
10928 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10929 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10930 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10931 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10932 e_* cousins.
10933 (alloca) [_MSC_VER]: Define to _alloca.
10934
10935 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10936
10937 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10938
10939 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10940
10941 * xdisp.c (note_mouse_highlight): If either of
10942 previous/next-single-property-change returns nil, treat that as
10943 the beginning or the end of the buffer. (Bug#9955)
10944
10945 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10946
10947 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10948 label is not null (Bug#9951).
10949 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10950 may be NULL.
10951
10952 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10953
10954 * window.c (Fwindow_body_size): Mention in the doc string that the
10955 return value is in frame's canonical units. (Bug#9949)
10956
10957 2011-11-03 Eli Zaretskii <eliz@gnu.org>
10958
10959 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10960
10961 * w32fns.c (unwind_create_frame): If needed, free the glyph
10962 matrices of the partially constructed frame. (Bug#9943)
10963 * xfns.c (unwind_create_frame): Likewise.
10964
10965 2011-11-01 Eli Zaretskii <eliz@gnu.org>
10966
10967 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10968 Don't stop backward scan on the continuation glyph, even though
10969 its CHARPOS is positive.
10970 (mouse_face_from_buffer_pos, note_mouse_highlight):
10971 Rename cover_string to disp_string.
10972
10973 2011-11-01 Martin Rudalics <rudalics@gmx.at>
10974
10975 * window.c (temp_output_buffer_show): Don't use
10976 Vtemp_buffer_show_specifiers.
10977 (Vtemp_buffer_show_specifiers): Remove unused variable.
10978
10979 2011-10-30 Eli Zaretskii <eliz@gnu.org>
10980
10981 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10982 past the beginning of the current glyph matrix.
10983
10984 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
10985
10986 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10987 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10988 HAVE_GTK3 (Bug#9869).
10989
10990 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10991 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10992
10993 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10994
10995 * xterm.c: Declare x_handle_net_wm_state to return int.
10996 (handle_one_xevent): Check if we are iconified but don't have
10997 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10998 (get_current_wm_state): Return non-zero if not hidden,
10999 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11000 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11001 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11002 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11003
11004 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11005
11006 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11007 so that this new function doesn't get optimized away by a
11008 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11009
11010 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11011
11012 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11013
11014 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11015
11016 Fix the `xbytecode' command.
11017 * .gdbinit (xprintbytestr): New command.
11018 (xwhichsymbols): Rename from `which'; all callers changed.
11019 (xbytecode): Print the byte-code string as well.
11020
11021 2011-10-29 Kim Storm <storm@cua.dk>
11022
11023 * alloc.c (which_symbols): New function.
11024
11025 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11026
11027 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11028 line. (Bug#9903)
11029
11030 2011-10-29 Glenn Morris <rgm@gnu.org>
11031
11032 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11033 Not clear what it was for, and it causes various bugs. (Bug#9839)
11034
11035 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11036
11037 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11038 possible random value that matches one of those tested as
11039 condition to clear the mouse face.
11040
11041 2011-10-28 Chong Yidong <cyd@gnu.org>
11042
11043 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11044
11045 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11046
11047 * window.c (make_window): Initialize phys_cursor_on_p.
11048
11049 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11050
11051 * lisp.h (struct Lisp_Symbol): Update comments.
11052
11053 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11054
11055 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11056
11057 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11058
11059 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11060 <oslsachem@gmail.com> for helping to debug this.
11061
11062 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11063 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11064 (g_b_init_get_glyph_outline_w): New static variables.
11065 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11066 (GetGlyphOutlineW_Proc): New typedefs.
11067 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11068 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11069 New functions.
11070 (w32font_open_internal, compute_metrics):
11071 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11072 instead of calling the "wide" APIs directly.
11073
11074 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11075
11076 * w32.h (syms_of_w32font): Add prototype.
11077
11078 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11079
11080 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11081 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11082 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11083 (Fmove_to_window_line): Doc fix.
11084
11085 2011-10-27 Chong Yidong <cyd@gnu.org>
11086
11087 * process.c (make_process): Set gnutls_state to NULL.
11088
11089 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11090 non-NULL, regardless of GNUTLS_INITSTAGE.
11091 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11092 an error. Set process slots as soon as we allocate them.
11093
11094 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11095
11096 2011-10-27 Chong Yidong <cyd@gnu.org>
11097
11098 * gnutls.c (emacs_gnutls_deinit): New function.
11099 Deallocate credentials structures as well as calling gnutls_deinit.
11100 (Fgnutls_deinit, Fgnutls_boot): Use it.
11101
11102 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11103 (deactivate_process): Call emacs_gnutls_deinit.
11104
11105 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11106
11107 * image.c (x_create_x_image_and_pixmap):
11108 * w32.c (sys_rename, w32_delayed_load):
11109 * w32font.c (fill_in_logfont):
11110 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11111
11112 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11113
11114 * w32fns.c (w32_default_color_map): New function,
11115 extracted from Fw32_default_color_map.
11116 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11117
11118 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11119
11120 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11121
11122 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11123
11124 * keyboard.c (test_undefined): New function (bug#9751).
11125 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11126
11127 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11128
11129 * sysdep.c (init_sys_modes): Fix the check for the controlling
11130 terminal (Bug#6649).
11131
11132 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11133
11134 * dispextern.h (struct bidi_it): New member next_en_type.
11135
11136 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11137 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11138 current character, check also for next_en_type being WEAK_EN.
11139 (bidi_resolve_weak): Don't enter the expensive loop if the current
11140 position is before next_en_pos. Record the bidi type of the first
11141 non-ET, non-BN character we find, in addition to its position.
11142 (bidi_level_of_next_char): Invalidate next_en_type when
11143 next_en_pos is over-stepped.
11144
11145 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11146
11147 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11148 * editfns.c: Rewrite current-time-zone so that it invokes
11149 the equivalent of (format-time-string "%Z") to get the time zone name.
11150 This fixes a bug when the time zone name contains characters that
11151 need converting from the system time locale to Emacs internal format.
11152 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11153 that patch fixed format-time-string to do the conversion, but
11154 I forgot to fix current-time-zone.
11155 (format_time_string): New function, containing most of
11156 what Fformat_time_string used to contain.
11157 (Fformat_time_string): Rewrite in terms of format_time_string.
11158 This doesn't change this function's behavior.
11159 (current-time-zone): Rewrite to use format_time_string.
11160 This fixes the bug reported by Michael Schierl in
11161 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11162 Jason Rumney's 2007-06-07 change worked around this bug, but
11163 didn't fix it.
11164 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11165
11166 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11167
11168 * xdisp.c (start_display): If the character at POS is displayed
11169 via a display vector, reset IT->current.dpvec_index to zero.
11170 (try_window_reusing_current_matrix): If a line ends in a display
11171 vector or the next line starts in a display vector, continue
11172 redrawing the window even though the character position of
11173 start_row was reached.
11174 (Bug#9771, part 2)
11175
11176 2011-10-18 Chong Yidong <cyd@gnu.org>
11177
11178 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11179 with nobreak-char-display too.
11180
11181 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11182
11183 Fix part 3 of bug#9771.
11184 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11185 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11186 non-neutral characters if the current character is a paragraph
11187 separator (a.k.a. Newline). This avoids running the same
11188 expensive loop twice, once when we consume the preceding newline
11189 and the other time when the line actually needs to be displayed.
11190 Avoid the loop when we see neutrals on the base embedding level
11191 following a character whose directionality is the same as the
11192 paragraph's. This avoids running the expensive loop when a line
11193 ends in a long sequence of neutrals, like control characters.
11194 Add assertion against STRONG_AL type. Slightly rearrange code
11195 that determines the type of a neutral given the first non-neutral
11196 that follows it.
11197 (bidi_level_of_next_char): Set next_en_pos to zero when
11198 invalidating its info.
11199
11200 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11201
11202 * xdisp.c (push_display_prop): Determine whether to record string
11203 or buffer position by IT->string, not by IT->method. Allow
11204 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11205 (move_it_vertically_backward): Don't look for character position
11206 immediately after the newline when in a continuation line.
11207 (Bug#9771, part 1)
11208
11209 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11210
11211 * window.c (coordinates_in_window): Rewrite and delabelize
11212 vertical border check. (Bug#5357) (Bug#9618)
11213
11214 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11215
11216 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11217 errors in XSetWindowBorder (bug#9310).
11218
11219 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11220
11221 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11222 avoid crash when xmalloc overrun checking is enabled.
11223
11224 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11225
11226 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11227 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11228 cursor motion with <left> and <right> arrow keys.
11229
11230 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11231 some callers set that themselves.
11232
11233 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11234
11235 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11236 display string and the previous row comes from the same string and
11237 is empty. (Bug#9739) (Bug#9738)
11238
11239 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11240
11241 * doc.c (get_doc_string): Encode file name (bug#9735).
11242
11243 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11244
11245 * bidi.c (bidi_level_of_next_char):
11246 * xdisp.c (get_visually_first_element): Remove old incorrect
11247 comments regarding the Unicode Line Separator character.
11248
11249 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11250
11251 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11252
11253 * alloc.c (Fgc_status): Do not access beyond zombies array
11254 boundary if nzombies > MAX_ZOMBIES.
11255 * alloc.c (dump_zombies): Add missing format specifier.
11256
11257 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11258
11259 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11260 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11261
11262 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11263 Some packages use them to denote characters with modifiers.
11264
11265 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11266
11267 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11268 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11269 matching a pp-number. Rename parameter var to var1.
11270
11271 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11272
11273 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11274
11275 2011-10-08 Glenn Morris <rgm@gnu.org>
11276
11277 * callint.c (Fcall_interactively): Give a more explicit error for the
11278 'c' case with a non-character input. (Bug#8479)
11279
11280 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11281
11282 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11283 lines.
11284 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11285 lines that are hscrolled on the left.
11286
11287 * dispnew.c (buffer_posn_from_coords): Account for a possible
11288 presence of header-line. (Bug#4426)
11289
11290 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11291
11292 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11293 Don't advertise functionality which we discourage or doesn't work.
11294
11295 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11296
11297 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11298 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11299 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11300 this makes Emacs dump core during garbage collection on rare
11301 occasions. sizeof is obviously inferior to offsetof here, so
11302 stick with offsetof.
11303 (GC_POINTER_ALIGNMENT): New macro.
11304 (mark_memory): Omit 3rd (offset) arg; caller changed.
11305 Don't assume EMACS_INT alignment is the same as pointer alignment.
11306
11307 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11308
11309 * keyboard.c (read_key_sequence_remapped): New var.
11310 (read_key_sequence): Compute remapping in the right buffer.
11311 (command_loop_1): Use read_key_sequence's remapping directly.
11312
11313 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11314
11315 * dired.c (file_name_completion): Don't expand file name.
11316 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11317 before checking file name handler.
11318
11319 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11320 they've been requested explicitly (bug#9591).
11321
11322 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11323
11324 * keymap.c (Fsingle_key_description): Use make_specified_string
11325 instead of build_string to build string from push_key_description.
11326 (Bug#5193)
11327
11328 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11329
11330 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11331 This fixes a Y2038 bug on 64-bit hosts.
11332 * buffer.c (reset_buffer):
11333 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11334 (Fclear_buffer_auto_save_failure):
11335 Use 0, not -1, to represent an unset failure time, since time_t
11336 might not be signed.
11337
11338 Remove dependency on glibc malloc internals.
11339 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11340 Move back here from lisp.h, but with their new implementations.
11341 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11342 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11343 * charset.c (charset_table_init): New static var.
11344 (syms_of_charset): Use it instead of xmalloc. This removes a
11345 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11346 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11347 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11348 Move back to alloc.c.
11349 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11350 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11351
11352 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11353
11354 * nsterm.m (windowDidResize): Call x_set_window_size only when
11355 ns_in_resize is true. Otherwise set pixelwidth/height and
11356 call change_frame_size (Bug#9628).
11357
11358 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11359
11360 Port --enable-checking=all to Fedora 14 x86-64.
11361 * charset.c (syms_of_charset): Also account for glibc malloc's
11362 internal overhead when calculating the initial malloc maximum.
11363
11364 Port --enable-checking=all to Fedora 14 x86.
11365 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11366 Move to lisp.h.
11367 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11368 (overrun_check_realloc, overrun_check_free):
11369 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11370 That way, xmalloc returns a properly-aligned pointer even if
11371 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11372 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11373 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11374 into account when calculating the initial malloc maximum.
11375 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11376 Move here from alloc.c, so that charset.c can use it too.
11377 Properly align; the old code wasn't right for common 32-bit hosts
11378 when configured with --enable-checking=all.
11379 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11380 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11381
11382 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11383
11384 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11385 use EDOM.
11386
11387 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11388
11389 * xdisp.c (compute_display_string_end): If there's no display
11390 string at CHARPOS, return -1.
11391
11392 * bidi.c (bidi_fetch_char): When compute_display_string_end
11393 returns a negative value, treat the character as a normal
11394 character not covered by a display string. (Bug#9624)
11395
11396 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11397
11398 * lread.c (Fread_from_string): Fix typo in docstring.
11399
11400 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11401
11402 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11403 newline, reseat the iterator instead of bidi-iterating there one
11404 character at a time. (Bug#9610)
11405 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11406 TO_CHARPOS if the bidi iterator is at base embedding level.
11407
11408 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11409
11410 * lread.c (readevalloop): Use correct code for NBSP.
11411 (read1): Likewise. (Bug#9608)
11412
11413 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11414
11415 * dbusbind.c (Fdbus_register_signal): When service is not
11416 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11417
11418 2011-09-25 Glenn Morris <rgm@gnu.org>
11419
11420 * buffer.c (truncate-lines): Doc fix.
11421
11422 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11423
11424 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11425 (Fset_window_next_buffers): Doc fix.
11426
11427 2011-09-24 Glenn Morris <rgm@gnu.org>
11428
11429 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11430
11431 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11432
11433 Fix minor problems found by static checking.
11434 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11435 * indent.c (Fvertical_motion): Fix == vs = typo.
11436
11437 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11438
11439 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11440 Default value is now t. Doc fix.
11441
11442 * indent.c (Fvertical_motion): Compute and apply the overshoot
11443 logic when moving up, not only when moving down. Fix the
11444 confusing name and values of the it_overshoot_expected variable;
11445 logic changes accordingly. (Bug#9254) (Bug#9549)
11446
11447 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11448 CHARPOS is covered by a display string which includes newlines.
11449 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11450 is covered by a display string with embedded newlines.
11451
11452 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11453
11454 * dbusbind.c (Fdbus_register_signal): Add match rule to
11455 Vdbus_registered_objects_table. (Bug#9581)
11456 (Fdbus_register_method, Vdbus_registered_objects_table):
11457 Fix docstring.
11458
11459 2011-09-24 Jim Meyering <meyering@redhat.com>
11460
11461 do not ignore write error for any output size
11462 The previous change was incomplete.
11463 While it makes emacs --batch detect the vast majority of stdout
11464 write failures, errors were still ignored whenever the output size is
11465 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11466 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11467 && echo FAIL: ignored write error
11468 FAIL: ignored write error
11469 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11470 && echo FAIL: ignored write error
11471 FAIL: ignored write error
11472 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11473
11474 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11475
11476 * emacs.c (Fkill_emacs): In noninteractive mode exit
11477 non-successfully if a write error occurred on stdout. (Bug#9574)
11478
11479 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11480
11481 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11482 the xassert test.
11483
11484 * dispextern.h (struct it): Update the comment documenting what
11485 can it->OBJECT be.
11486
11487 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11488
11489 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11490 a display string, extend search for cursor position to end of row.
11491 (find_row_edges): If the row ends in a newline from a display
11492 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11493 Handle the case of a display string with multiple newlines.
11494 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11495 non-empty line. Fixes confusing cursor motion with arrow keys at
11496 the beginning of a line that starts with whitespace.
11497
11498 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11499
11500 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11501 (bug#9493).
11502
11503 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11504
11505 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11506 boolean (Bug#9154).
11507
11508 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11509
11510 * xdisp.c (display_line): Record maximum and minimum buffer
11511 positions even if no glyphs were produced (e.g., by a zero-width
11512 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11513 buffer positions that will be removed from the glyph row because
11514 they don't fit.
11515 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11516 column is beyond frame width: don't subtract 1 "pixel" when
11517 computing width of the stretch.
11518 (reseat_at_next_visible_line_start): Undo the change made on
11519 2011-09-17 that saved paragraph information and restored it after
11520 the call to `reseat'. (Bug#9545)
11521
11522 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11523
11524 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11525 and turn window cursor on if cleared (Bug#9415).
11526
11527 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11528
11529 * search.c (boyer_moore): Take unibyte characters from pattern
11530 literally. (Bug#9458)
11531
11532 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11533
11534 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11535
11536 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11537
11538 Fix minor problem found by static checking.
11539 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11540 initialized, to pacify gcc -Wuninitialized.
11541
11542 * fileio.c: Report proper errno when syscall falls.
11543 (Finsert_file_contents): Save and restore errno,
11544 so that report_file_error outputs the correct diagnostic.
11545 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11546
11547 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11548
11549 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11550
11551 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11552
11553 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11554 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11555
11556 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11557
11558 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11559 about the current paragraph and restore it after the call to reseat.
11560
11561 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11562 (bidi_find_paragraph_start): Search back for paragraph beginning
11563 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11564 (bidi_move_to_visually_next): Only trigger paragraph-related
11565 computations when the last character is a newline or at EOB, not
11566 just any NEUTRAL_B. (Bug#9470)
11567
11568 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11569 truncated lines if point is covered by a display string. (Bug#9524)
11570
11571 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11572
11573 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11574 (cons_to_x_long): New function.
11575 (lisp_data_to_selection_data): Use it. Correct the test for
11576 short-versus-long data; it was negated. Break out of vector
11577 loop, for efficiency, when a long datum is discovered.
11578
11579 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11580
11581 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11582
11583 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11584
11585 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11586 GCC PR/17406) by declaring this function with external scope.
11587
11588 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11589
11590 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11591 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11592
11593 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11594
11595 * editfns.c (Fformat): Correctly handle text properties on "%%".
11596
11597 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11598
11599 * xterm.c (x_draw_composite_glyph_string_foreground):
11600 * w32term.c (x_draw_composite_glyph_string_foreground):
11601 * term.c (encode_terminal_code):
11602 * composite.c (composition_update_it, get_composition_id):
11603 * xdisp.c (get_next_display_element)
11604 (fill_composite_glyph_string): Add comments about special meaning
11605 of TAB characters in a composition.
11606
11607 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11608
11609 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11610 This occurs when processing a multibyte format.
11611 Problem reported by Wolfgang Jenker.
11612
11613 2011-09-15 Johan Bockgård <bojohan@gnu.org>
11614
11615 * xdisp.c (try_cursor_movement): Only check for exact match if
11616 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11617
11618 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11619
11620 Remove unused external symbols.
11621 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11622 * xdisp.c (calc_pixel_width_or_height): Now static.
11623 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11624 * indent.c (check_display_width):
11625 * w32term.c: Fix comment to match code.
11626 * xterm.c, xterm.h (x_catching_errors): Remove.
11627
11628 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11629
11630 * xselect.c: Use signed conversions more consistently (Bug#9498).
11631 (selection_data_to_lisp_data): Assume incoming selection data are
11632 signed integers, not unsigned. This is to be consistent with
11633 outgoing selection data, which was modified to use signed integers
11634 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11635 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11636 expects long, not unsigned long.
11637
11638 2011-09-14 Eli Zaretskii <eliz@gnu.org>
11639
11640 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11641 computation of loop end. Reported by Johan Bockgård
11642 <bojohan@gnu.org>.
11643
11644 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
11645
11646 * frame.c (Fother_visible_frames_p): Function deleted.
11647
11648 2011-09-12 Eli Zaretskii <eliz@gnu.org>
11649
11650 * indent.c (compute_motion): Process display vector front to back
11651 rather than the other way around. (Bug#2496)
11652
11653 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11654
11655 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11656
11657 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11658
11659 * minibuf.c (Fread_from_minibuffer): Doc fix.
11660
11661 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11662
11663 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11664 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11665
11666 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11667
11668 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11669 value for non-existent files.
11670
11671 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11672
11673 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11674 set its "size" to -1. This will set the modtime_size field of
11675 the corresponding buffer to -1, which is what
11676 verify-visited-file-modtime expects for files that do not exist.
11677 (Bug#9139)
11678
11679 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11680
11681 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11682 here ...
11683 * lisp.h: ... from here. push_key_description is no longer
11684 defined in keyboard.c, so its declaration should not be in
11685 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11686 logically belongs with push_key_description.
11687
11688 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11689
11690 * buffer.h: Include <sys/types.h> instead of <time.h>.
11691 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11692 Problem reported by Herbert J. Skuhra.
11693
11694 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11695
11696 * xml.c (parse_region): Make the parsing work for
11697 non-comment-starting XML files again (bug#9144).
11698
11699 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11700
11701 * image.c (gif_load): Fix calculation of bottom and right corner.
11702 (Bug#9468)
11703
11704 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11705
11706 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11707 redisplay in small windows.
11708
11709 2011-09-09 Eli Zaretskii <eliz@gnu.org>
11710
11711 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11712
11713 2011-09-08 Martin Rudalics <rudalics@gmx.at>
11714
11715 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11716 Operate on live windows only.
11717
11718 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
11719
11720 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11721
11722 2011-09-07 Eli Zaretskii <eliz@gnu.org>
11723
11724 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11725 only under bidi iteration.
11726
11727 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11728
11729 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11730
11731 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11732
11733 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11734 Without this fix, the command to link temacs failed due to an
11735 undefined symbol __builtin_isnan. This is because
11736 /usr/include/iso/math_c99.h #defines isnan(x) to
11737 __builtin_isnan(x), but the bundled gcc, which identifies itself
11738 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11739 a __builtin_isnan.
11740 * floatfns.c (isnan): #undef, and then #define to a clone of
11741 what's in data.c.
11742 (Fisnan): Always define, since it's always available now.
11743 (syms_of_floatfns): Always define isnan at the Lisp level.
11744
11745 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11746
11747 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11748
11749 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11750
11751 * fileio.c: Fix bugs with large file offsets (Bug#9428).
11752 The previous code assumed that file offsets (off_t values) fit in
11753 EMACS_INT variables, which is not true on typical 32-bit hosts.
11754 The code messed up by falsely reporting buffer overflow in cases
11755 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11756 when "big" contains more than 2**29 bytes, even though this
11757 inserts just one byte and does not overflow the buffer.
11758 (Finsert_file_contents): Store file offsets as off_t
11759 values, not as EMACS_INT values. Check for overflow when
11760 converting between EMACS_INT and off_t. When checking for
11761 buffer overflow or for overlap, take the offsets into account.
11762 Don't use EMACS_INT for small values where int suffices.
11763 When checking for overlap, fix a typo: ZV was used where
11764 ZV_BYTE was intended.
11765 (Fwrite_region): Don't assume off_t fits into 'long'.
11766 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11767
11768 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
11769
11770 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11771
11772 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11773
11774 sprintf-related integer and memory overflow issues (Bug#9412).
11775
11776 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11777 (esprintf, exprintf, evxprintf): New functions.
11778 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11779 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11780 (modify_event_symbol): Do not assume that the length of
11781 name_alist_or_stem is safe to alloca and fits in int.
11782 (Fexecute_extended_command): Likewise for function name and binding.
11783 (Frecursion_depth): Wrap around reliably on integer overflow.
11784 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11785 since some callers pass EMACS_INT values.
11786 (Fsingle_key_description): Don't crash if symbol name contains more
11787 than MAX_ALLOCA bytes.
11788 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11789 (get_minibuffer): Arg is now EMACS_INT, not int.
11790 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11791 (esprintf, exprintf, evxprintf): New decls.
11792 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11793
11794 * dbusbind.c (signature_cat): New function.
11795 (xd_signature, Fdbus_register_signal):
11796 Do not overrun buffer; instead, report string overflow.
11797
11798 * dispnew.c (add_window_display_history): Don't overrun buffer.
11799 Truncate instead; this is OK since it's just a log.
11800
11801 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11802 even if the time zone offset is outlandishly large.
11803 Don't mishandle offset == INT_MIN.
11804
11805 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11806 when creating daemon; the previous buffer-overflow check was incorrect.
11807
11808 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11809 which has the guts of the old verror function.
11810
11811 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11812 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11813
11814 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11815 (font_unparse_xlfd): Don't blindly alloca long strings.
11816 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11817 fits in int, when using sprintf. Use single snprintf to count
11818 length of string rather than counting it via multiple sprintfs;
11819 that's simpler and more reliable.
11820 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11821 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11822 sprintf, in case result does not fit in int.
11823
11824 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11825 (fontset_from_font): Print it.
11826
11827 * frame.c (tty_frame_count): Now printmax_t, not int.
11828 (make_terminal_frame, set_term_frame_name): Print it.
11829 (x_report_frame_params): In X, window IDs are unsigned long,
11830 not signed long, so print them as unsigned.
11831 (validate_x_resource_name): Check for implausibly long names,
11832 and don't assume name length fits in 'int'.
11833 (x_get_resource_string): Don't blindly alloca invocation name;
11834 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11835 not fit in int.
11836
11837 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11838 (xg_check_special_colors, xg_set_geometry):
11839 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11840
11841 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11842 Use esprintf, not sprintf, in case result does not fit in int.
11843
11844 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11845 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11846 it as a large positive number.
11847 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11848 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11849
11850 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11851 in case result does not fit in int.
11852
11853 * print.c (float_to_string): Detect width overflow more reliably.
11854 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11855 buffer overrun. Don't assume list length fits in 'int'. Treat
11856 print length of 0 as 0, not as infinity; to be consistent with other
11857 uses of print length in this function. Don't overflow print length
11858 index. Don't assume hash table size fits in 'long', or that
11859 vectorlike size fits in 'unsigned long'.
11860
11861 * process.c (make_process): Use printmax_t, not int, to format
11862 process-name gensyms.
11863
11864 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11865
11866 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11867 to avoid potential buffer overrun.
11868
11869 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11870 if X resource line is longer than 512 bytes.
11871
11872 * xfns.c (x_window): Make sprintf buffer a bit bigger
11873 to avoid potential buffer overrun.
11874
11875 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11876
11877 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11878
11879 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11880
11881 Integer overflow fixes for scrolling, etc.
11882 Without these, Emacs silently mishandles large integers sometimes.
11883 For example, "C-u 4294967297 M-x recenter" was treated as if
11884 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11885
11886 * xdisp.c (try_window_id): Check Emacs fixnum range before
11887 converting to 'int'.
11888
11889 * window.c (window_scroll_line_based, Frecenter):
11890 Check that an Emacs fixnum is in range before assigning it to 'int'.
11891 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11892 values converted from Emacs fixnums.
11893 (Frecenter): Don't wrap around a line count if it is out of 'int'
11894 range; instead, treat it as an extreme value.
11895 (Fset_window_configuration, compare_window_configurations):
11896 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11897
11898 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11899 that can exceed INT_MAX. Check that EMACS_INT value is in range
11900 before assigning it to the (possibly-narrower) index.
11901 (match_limit): Don't assume that a fixnum can fit in 'int'.
11902
11903 * print.c (print_object): Use ptrdiff_t, not int, for index that can
11904 exceed INT_MAX.
11905
11906 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11907 (Fvertical_motion): Don't wrap around LINES values that don't fit
11908 in 'int'. Instead, treat them as extreme values. This is good
11909 enough for windows, which can't have more than INT_MAX lines anyway.
11910
11911 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11912
11913 * Require libxml/parser.h to avoid compilation warning.
11914
11915 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11916
11917 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11918 since this reportedly can destroy thread storage.
11919
11920 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
11921
11922 * syntax.c (find_defun_start): Update all cache variables if
11923 exiting early (Bug#9401).
11924
11925 2011-08-30 Eli Zaretskii <eliz@gnu.org>
11926
11927 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11928
11929 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11930 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11931 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11932
11933 * term.c (tty_append_glyph): New function.
11934 (produce_stretch_glyph): Static function and its prototype deleted.
11935
11936 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11937 Add prototypes.
11938
11939 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11940
11941 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11942 when checking :margin (Bug#9390).
11943 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11944 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11945 so that the name doesn't mislead. All uses changed.
11946
11947 2011-08-28 Johan Bockgård <bojohan@gnu.org>
11948
11949 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11950 set_tty_hooks.
11951
11952 2011-08-27 Eli Zaretskii <eliz@gnu.org>
11953
11954 * xdisp.c (move_it_to): Don't bail out early when reaching
11955 position beyond to_charpos, if we are scanning backwards.
11956 (move_it_vertically_backward): When DY == 0, make sure we get to
11957 the first character in the line after the newline.
11958
11959 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11960
11961 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11962 (ccl_driver): Do not generate an out-of-range pointer.
11963 (Fccl_execute_on_string): Remove unnecessary check for
11964 integer overflow, noted by Stefan Monnier in
11965 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11966 Remove a FIXME that didn't need fixing.
11967 Simplify the newly-introduced buffer reallocation code.
11968
11969 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
11970
11971 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11972
11973 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
11974
11975 Integer and memory overflow issues (Bug#9196).
11976
11977 * doc.c (get_doc_string): Rework so that
11978 get_doc_string_buffer_size is the actual buffer size, rather than
11979 being 1 less than the actual buffer size; this makes xpalloc more
11980 convenient.
11981
11982 * image.c (x_allocate_bitmap_record, cache_image):
11983 * xselect.c (Fx_register_dnd_atom):
11984 Simplify previous changes by using xpalloc.
11985
11986 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11987 since either will do and ptrdiff_t is convenient with xpalloc.
11988
11989 * charset.c (charset_table_size)
11990 (struct charset_sort_data.priority): Now ptrdiff_t.
11991 (charset_compare): Don't overflow if priorities differ greatly.
11992 (Fsort_charsets): Don't assume list length fits in int.
11993 Check for size-calculation overflow when allocating sort data.
11994 (syms_of_charset): Allocate an initial charset table that is
11995 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11996
11997 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11998
11999 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12000 The actual value is always <= INT_MAX, and leaving it unsigned made
12001 overflow checking harder.
12002
12003 * dispextern.h (struct glyph_matrix.rows_allocated)
12004 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12005 with xpalloc. The values are still always <= INT_MAX.
12006
12007 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12008
12009 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12010 (SAFE_NALLOCA): New macro.
12011
12012 * region-cache.c (struct boundary.pos, find_cache_boundary)
12013 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12014 (set_cache_region, invalidate_region_cache)
12015 (revalidate_region_cache, know_region_cache, region_cache_forward)
12016 (region_cache_backward, pp_cache):
12017 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12018 so that ptrdiff_t * can be passed to xpalloc.
12019 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12020 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12021 (pp_cache): Don't assume cache_len fits in int.
12022 * region-cache.h: Adjust extern decls to match.
12023
12024 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12025 EMACS_INT, since either will do, for xpalloc.
12026
12027 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12028 (xnmalloc, xnrealloc, xpalloc): New functions.
12029
12030 * bidi.c (bidi_shelve_header_size): New constant.
12031 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12032 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12033
12034 * bidi.c (bidi_cache_shrink):
12035 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12036 (overlay_strings):
12037 Don't update size of array until after memory allocation succeeds,
12038 because xmalloc/xrealloc may not return.
12039 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12040 now that we have proper integer overflow checking.
12041 (record_overlay_string, overlay_strings): Catch overflows when
12042 calculating size of overlay_str_buf.
12043
12044 * callproc.c (Fcall_process): Check for size overflow when
12045 calculating size of args2.
12046 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12047 Normally we prefer signed values, but sticking with ptrdiff_t would
12048 require adding more-complicated checks.
12049
12050 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12051 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12052 Redo buffer-overflow calculations to avoid integer overflow.
12053 Add a FIXME comment where memory seems to be over-allocated.
12054
12055 * character.c (Fstring): Check for size-calculation overflow.
12056
12057 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12058 unnecessary integer overflow. Check for size overflow.
12059 (encode_coding_object): Don't update size until xmalloc succeeds.
12060
12061 * composite.c (get_composition_id): Check for overflow in glyph
12062 length calculations.
12063
12064 Integer and memory overflow fixes for display code.
12065 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12066 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12067 (scrolling_window): Check for overflow in size calculations.
12068 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12069 Don't assume glyph table len fits in int.
12070 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12071 (row_table_size): Now ptrdiff_t, not int.
12072 (scrolling_window): Avoid overflow in size calculations.
12073 Don't update size until allocation succeeds.
12074 * fns.c (concat): Check for overflow in size calculations.
12075 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12076 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12077 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12078
12079 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12080 (get_doc_string): Check for size calculation overflow.
12081 Don't update size until allocation succeeds.
12082 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12083 EMACS_INT, where ptrdiff_t will do.
12084 (Fsubstitute_command_keys): Check for string overflow.
12085
12086 * editfns.c (set_time_zone_rule): Don't assume environment length
12087 fits in int.
12088 (message_length): Now ptrdiff_t, not int.
12089 (Fmessage_box): Don't update size until allocation succeeds.
12090 Don't assume message length fits in int.
12091 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12092
12093 * emacs.c (main): Do not reallocate argv, since there is a null at
12094 the end that can be overwritten, and this way there's no need to
12095 worry about size-calculation overflow.
12096 (sort_args): Check for size-calculation overflow.
12097
12098 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12099 alloc succeeds.
12100 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12101
12102 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12103 (x_set_scroll_bar_width, x_figure_window_size):
12104 Check for integer overflow.
12105 (x_set_alpha): Do not assume XINT fits in int.
12106
12107 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12108 This is for the members text_lines, text_cols, total_lines, total_cols,
12109 where the system imposes an 'int' limit.
12110
12111 * fringe.c (Fdefine_fringe_bitmap):
12112 Don't update size until alloc works.
12113
12114 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12115 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12116
12117 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12118 Check for size-calculation overflow.
12119 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12120 do, as we prefer signed integers.
12121 (id_to_widget.max_size, id_to_widget.used)
12122 (xg_store_widget_in_map, xg_remove_widget_from_map)
12123 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12124 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12125 Use and return ptrdiff_t, not int.
12126 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12127 * gtkutil.h: Change prototypes to match the above.
12128
12129 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12130 are duplicate now that they've been promoted to lisp.h.
12131 (x_allocate_bitmap_record, x_alloc_image_color)
12132 (make_image_cache, cache_image, xpm_load):
12133 Don't update size until alloc is done.
12134 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12135 (x_detect_edges):
12136 Check for size calculation overflow.
12137 (ct_colors_allocated_max): New constant.
12138 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12139 overflow.
12140
12141 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12142 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12143 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12144 Use ptrdiff_t, not int, to count maps.
12145 (read_char_minibuf_menu_prompt): Check for overflow in size
12146 calculations. Don't update size until allocation succeeds.
12147 Redo calculations to avoid overflow.
12148 * keyboard.h: Change prototypes to match the above.
12149
12150 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12151 to count maps.
12152 (current_minor_maps): Check for size calculation overflow.
12153 * keymap.h: Change prototypes to match the above.
12154
12155 * lread.c (read1, init_obarray): Don't update size until alloc done.
12156
12157 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12158 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12159
12160 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12161 Now ptrdiff_t, not int.
12162 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12163 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12164
12165 * process.c (Fnetwork_interface_list): Check for overflow
12166 in size calculation.
12167
12168 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12169
12170 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12171 overflow. Don't bother calling xmalloc when xrealloc will do.
12172
12173 * search.c (Freplace_match): Check for size calculation overflow.
12174 (Fset_match_data): Don't assume list lengths fit in 'int'.
12175
12176 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12177 for command line length. Do not attempt to address one before the
12178 beginning of an array, as that's not portable.
12179
12180 * term.c (max_frame_lines): Remove; unused.
12181 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12182 not int.
12183 (encode_terminal_code, calculate_costs): Check for size
12184 calculation overflow.
12185 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12186 table lengths and related sizes. Don't update size until alloc
12187 done. Redo calculations to avoid overflow.
12188 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12189
12190 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12191 subtracting pointers.
12192 (gobble_line): Check for overflow more carefully. Don't update size
12193 until alloc done.
12194
12195 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12196 Don't update size until alloc done.
12197 Redo size calculations to avoid overflow.
12198 Check for size calculation overflow.
12199 (main) [DEBUG]: Fix typo in invoking tparam1.
12200
12201 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12202 Use ptrdiff_t, not int, for sizes.
12203 (store_mode_line_noprop_char): Don't update size until alloc done.
12204
12205 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12206 Use ptrdiff_t, not int, for sizes.
12207 (Finternal_make_lisp_face, cache_face):
12208 Check for size calculation overflow.
12209 (cache_face): Treat size calculation overflows as if they were
12210 memory exhaustion (the usual treatment), rather than aborting.
12211
12212 * xfns.c (x_encode_text, x_set_name_internal)
12213 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12214 sizes, since they can exceed INT_MAX in size. Check for size
12215 calculation overflow.
12216
12217 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12218 (xg_select): Check for size calculation overflow.
12219 Don't update size until alloc done.
12220
12221 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12222 as sprintf is limited to int lengths.
12223
12224 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12225 (X_LONG_MIN): New macros.
12226 Use them to make the following changes clearer.
12227 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12228 This change doesn't affect the value now, but it may help remind
12229 future maintainers not to raise the value too much later.
12230 (SELECTION_QUANTUM): Remove, replacing with ...
12231 (selection_quantum): ... new function, which avoids overflow.
12232 All uses changed.
12233 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12234 assumption that selection length fits in 'int'.
12235 (x_reply_selection_request, x_handle_selection_request)
12236 (x_get_window_property, receive_incremental_selection)
12237 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12238 (lisp_data_to_selection_data, clean_local_selection_data):
12239 Use ptrdiff_t, not int, to record length of selection.
12240 (x_reply_selection_request, x_get_window_property)
12241 (receive_incremental_selection, x_property_data_to_lisp):
12242 Redo calculations to avoid overflow.
12243 (x_reply_selection_request): When sending hint, ceiling it at
12244 X_LONG_MAX rather than relying on wraparound overflow to send
12245 something.
12246 (x_get_window_property, receive_incremental_selection)
12247 (lisp_data_to_selection_data, x_property_data_to_lisp):
12248 Check for size-calculation overflow.
12249 (x_get_window_property, receive_incremental_selection)
12250 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12251 Don't store size until memory allocation succeeds.
12252 (x_get_window_property): Plug memory leak on memory exhaustion.
12253 Don't double-block input; malloc is safe here. Don't assume 2**34
12254 - 4 fits in unsigned long. Add an xassert to check
12255 XGetWindowProperty overflow. Be more careful about overflow
12256 calculations, and distinguish size from memory overflow better.
12257 (receive_incremental_selection): When tracing, don't assume
12258 unsigned int is less than INT_MAX.
12259 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12260 harmful) conversions of unsigned short to int.
12261 (lisp_data_to_selection_data): Don't assume that integers
12262 in the range -65535 through -1 fit in an X unsigned short.
12263 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12264 result parameters unless successful. Rely on cons_to_unsigned
12265 to report problems with elements; the old code wasn't right anyway.
12266 (x_check_property_data): Check for int overflow; we cannot use
12267 a wider type due to X limits.
12268 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12269
12270 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12271
12272 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12273 (x_term_init): Check for size calculation overflow.
12274 (x_color_cells): Don't store size until memory allocation succeeds.
12275 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12276 Don't assume alloca size is less than MAX_ALLOCA.
12277 (x_term_init): Don't assume length fits in int (sprintf is limited
12278 to int size).
12279
12280 Use ptrdiff_t for composition IDs.
12281 * character.c (lisp_string_width):
12282 * composite.c (composition_table_size, n_compositions)
12283 (get_composition_id, composition_gstring_from_id):
12284 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12285 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12286 * window.c (Frecenter):
12287 Use ptrdiff_t, not int, for composition IDs.
12288 * composite.c (get_composition_id): Check for integer overflow.
12289 * composite.h: Adjust prototypes to match the above changes.
12290
12291 Use ptrdiff_t for hash table indexes.
12292 * category.c (hash_get_category_set):
12293 * ccl.c (ccl_driver):
12294 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12295 * coding.c (coding_system_charset_list, detect_coding_system):
12296 * coding.h (struct coding_system.id):
12297 * composite.c (get_composition_id, gstring_lookup_cache):
12298 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12299 * image.c (xpm_get_color_table_h):
12300 * lisp.h (hash_lookup, hash_put):
12301 * minibuf.c (Ftest_completion):
12302 Use ptrdiff_t for hash table indexes, not int (which is too
12303 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12304 32-bit --with-wide-int hosts).
12305
12306 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12307 Add a FIXME comment about memory leaks.
12308 (syms_of_charset): Don't assume xmalloc returns.
12309
12310 Don't assume that stated character widths fit in int.
12311 * character.c (Fchar_width, c_string_width, lisp_string_width):
12312 * character.h (CHAR_WIDTH):
12313 * indent.c (MULTIBYTE_BYTES_WIDTH):
12314 Use sanitize_char_width to avoid undefined and/or bad behavior
12315 with outlandish widths.
12316 * character.h (sanitize_tab_width): Rename from sanitize_width,
12317 now that we have two such functions. All uses changed.
12318 (sanitize_char_width): New inline function.
12319
12320 Don't assume that tab-width fits in int.
12321 * character.h (sanitize_width): New inline function.
12322 (SANE_TAB_WIDTH): New macro.
12323 (ASCII_CHAR_WIDTH): Use it.
12324 * indent.c (sane_tab_width): Remove. All uses replaced by
12325 SANE_TAB_WIDTH (current_buffer).
12326 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12327
12328 * fileio.c: Integer overflow issues with file modes.
12329 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12330
12331 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12332 Remove unreachable code.
12333 (read_hex, load_charset_map_from_file): Check for integer overflow.
12334
12335 * xterm.c: Don't go over XClientMessageEvent limit.
12336 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12337 (x_send_scroll_bar_event): Likewise. Check that the size does not
12338 exceed limits imposed by XClientMessageEvent, as well as the usual
12339 ptrdiff_t and size_t limits.
12340
12341 * keyboard.c: Overflow, signedness and related fixes.
12342 (make_lispy_movement): Use same integer type in forward decl
12343 that is used in the definition.
12344 (read_key_sequence, keyremap_step):
12345 Change bufsize argument back to int, undoing my 2011-03-30 change.
12346 We prefer signed types, and int is wide enough here.
12347 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12348 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12349 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12350 length, not size_t. Use ptrdiff_t for index, not int.
12351 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12352 possibility of integer overflow.
12353
12354 Overflow, signedness and related fixes for images.
12355
12356 * dispextern.h (struct it.stack[0].u.image.image_id)
12357 (struct_it.image_id, struct image.id, struct image_cache.size)
12358 (struct image_cache.used, struct image_cache.ref_count):
12359 * gtkutil.c (update_frame_tool_bar):
12360 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12361 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12362 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12363 * nsmenu.m (update_frame_tool_bar):
12364 * xdisp.c (calc_pixel_width_or_height):
12365 * xfns.c (image_cache_refcount):
12366 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12367 on typical 64-bit hosts.
12368
12369 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12370 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12371 Omit unnecessary casts to int.
12372 (parse_image_spec): Check that integers fall into 'int' range
12373 when the callers expect that.
12374 (image_ascent): Redo ascent calculation to avoid int overflow.
12375 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12376 (lookup_image): Remove unnecessary tests.
12377 (xbm_image_p): Locals are now of int, not EMACS_INT,
12378 since parse_image_check makes sure they fit into int.
12379 (png_load, gif_load, svg_load_image):
12380 Prefer int to unsigned where either will do.
12381 (tiff_handler): New function, combining the cores of the
12382 old tiff_error_handler and tiff_warning_handler.
12383 This function is rewritten to use vsnprintf and thereby avoid
12384 stack buffer overflows. It uses only the features of vsnprintf
12385 that are common to both POSIX and native Microsoft.
12386 (tiff_error_handler, tiff_warning_handler): Use it.
12387 (tiff_load, gif_load, imagemagick_load_image):
12388 Don't assume :index value fits in 'int'.
12389 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12390 (imagemagick_load_image): Check that crop parameters fit into
12391 the integer types that MagickCropImage accepts. Don't assume
12392 Vimagemagick_render_type has a nonnegative value. Don't assume
12393 size_t fits in 'long'.
12394 (gs_load): Use printmax_t to print the widest integers possible.
12395 Check for integer overflow when computing image height and width.
12396
12397 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12398
12399 * xdisp.c (redisplay_window): Don't force window start if point
12400 will be invisible in the resulting window. (Bug#9324)
12401
12402 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12403
12404 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12405 the display spec is of the form `(space ...)'.
12406 (handle_display_spec): Return the value returned by
12407 handle_single_display_spec, not just 1 or zero.
12408 (handle_single_display_spec): If the display spec is of the form
12409 `(space ...)', and specifies display in the text area, return 2
12410 rather than 1.
12411 (try_cursor_movement): Check for the need to scroll more
12412 accurately, and prefer exact match for point under bidi.
12413 Don't advance `row' beyond the last row of the window.
12414
12415 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12416 into disp_prop; all users changed.
12417
12418 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12419 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12420 for the text covered by the display property.
12421
12422 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12423
12424 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12425 Change return value to nil.
12426 (Frecord_buffer): Delete unused function.
12427
12428 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12429
12430 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12431 buffers, return left-to-right.
12432 (set_cursor_from_row): Consider candidate row a win if its glyph
12433 represents a newline and point is on that newline. Fixes cursor
12434 positioning on the newline at EOL of R2L text within L2R
12435 paragraph, and vice versa.
12436 (try_cursor_movement): Check continued rows, in addition to
12437 continuation rows. Fixes unwarranted scroll when point enters a
12438 continued line of R2L text within an L2R paragraph, or vice versa.
12439 (cursor_row_p): Consider the case of point being equal to
12440 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12441 from the end of a short line to the beginning of a continued line
12442 of R2L text within L2R paragraph.
12443 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12444 composed characters.
12445
12446 * bidi.c (bidi_check_type): Use xassert.
12447 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12448 members.
12449
12450 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12451
12452 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12453 a character.
12454
12455 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12456
12457 * nsfont.m (ns_otf_to_script): Fix typo.
12458
12459 2011-08-22 Kenichi Handa <handa@m17n.org>
12460
12461 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12462 extra slot even if the purpose is char-code-property-table.
12463
12464 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12465
12466 * xdisp.c (redisplay_window): When computing centering_position,
12467 account for the height of the header line. (Bug#8874)
12468
12469 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12470 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12471 candidate is selected by the mouse, and that candidate has a
12472 composed character under the mouse.
12473
12474 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12475 coordinates reported by pos-visible-in-window-p for a composed
12476 character in column zero.
12477
12478 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12479
12480 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12481
12482 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12483
12484 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12485 consider it a hit if to_charpos is anywhere in the range of the
12486 composed buffer positions.
12487
12488 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12489
12490 * image.c (gif_load): Don't assume that each subimage has the same
12491 dimensions as the base image. Handle disposal method that is
12492 "undefined" by the gif spec (Bug#9335).
12493
12494 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12495
12496 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12497 (Fcondition_case): Document `debug' symbol in error handler.
12498
12499 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12500
12501 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12502 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12503 from an Org mode buffer to a Speedbar frame.
12504
12505 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12506 a composition, take its buffer position from IT->cmp_it.charpos.
12507 Fixes cursor positioning at the beginning of a line that begins
12508 with a composed character.
12509
12510 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12511
12512 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12513 character bidirectional type, use STRONG_L instead. Fixes crashes
12514 in a buffer produced by `describe-categories'.
12515
12516 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12517 members before the level stack, so they would be saved and
12518 restored when copying iterator state. Fixes incorrect reordering
12519 around TABs covered by display properties.
12520
12521 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12522
12523 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12524
12525 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12526
12527 * eval.c (internal_condition_case, internal_condition_case_1)
12528 (internal_condition_case_2, internal_condition_case_n):
12529 Remove unnecessary aborts (Bug#9081).
12530
12531 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12532
12533 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12534 has no `load' handler, try opening the file locally. (Bug#9311)
12535
12536 2011-08-16 Ken Brown <kbrown@cornell.edu>
12537
12538 * gmalloc.c: Expand comment.
12539
12540 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12541
12542 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12543 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12544
12545 2011-08-16 Ken Brown <kbrown@cornell.edu>
12546
12547 Fix memory allocation problems in Cygwin build (Bug#9273).
12548
12549 * unexcw.c ( __malloc_initialized): Declare external variable.
12550 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12551
12552 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12553 New variables.
12554 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12555 dumped emacs.
12556 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12557 in the static heap.
12558 [CYGWIN] (special_realloc): New function.
12559 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12560 requests to realloc storage in the static heap.
12561
12562 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12563
12564 * bidi.c (bidi_initialize): Remove unused local.
12565
12566 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12567
12568 * bidimirror.h:
12569 * biditype.h: Remove file.
12570 * makefile.w32-in ($(BLD)/bidi.$(O)):
12571 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12572
12573 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12574
12575 * chartab.c: Improve commentary for the uniprop_table API.
12576
12577 * bidi.c (bidi_paragraph_init): Support zero value of
12578 bidi_ignore_explicit_marks_for_paragraph_level.
12579 (bidi_initialize): Use uniprop_table instead of including
12580 biditype.h and bidimirror.h.
12581
12582 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12583 coordinates of the iterator when restoring from ppos_it.
12584 (Bug#9296)
12585
12586 2011-08-14 Kenichi Handa <handa@m17n.org>
12587
12588 * process.c (create_process): Call setup_process_coding_systems
12589 after the pid of the process is set to -1 (Bug#8162).
12590
12591 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12592
12593 * xdisp.c (move_it_in_display_line_to): Don't invoke
12594 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12595 ppos_it. Fixes vertical cursor motion when line beginning is
12596 covered by an image. (Bug#9296)
12597
12598 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12599
12600 * nsterm.h (ns_run_ascript): Declare.
12601 (NSAPP_DATA2_RUNASSCRIPT): Define.
12602
12603 * nsfns.m (as_script, as_result, as_status): New static variables.
12604 (ns_run_ascript): New function.
12605 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12606 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12607 the event loop. Get status from as_status (Bug#7276).
12608
12609 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12610 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12611 the event loop (Bug#7276).
12612
12613 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12614
12615 * gnutls.c (QCgnutls_bootprop_priority)
12616 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12617 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12618 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12619 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12620 (QCgnutls_bootprop_verify_hostname_error)
12621 (QCgnutls_bootprop_callbacks_verify): Rename from
12622 Qgnutls_bootprop_..., all uses changed.
12623
12624 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12625 uses changed.
12626
12627 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12628
12629 * xfaces.c (Qframe_set_background_mode): Now static.
12630 * dispextern.h (Qframe_set_background_mode): Remove decl.
12631
12632 * process.c (Fnetwork_interface_info): Declare local only if needed.
12633
12634 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12635
12636 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12637 (Fnetwork_interface_list): Allocate in increments of bytes instead
12638 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12639 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12640 sockaddr.
12641 (struct ifflag_def): notrailers is smart on OSX.
12642 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12643 Get hardware address with getifaddrs if available.
12644
12645 2011-08-12 Eli Zaretskii <eliz@gnu.org>
12646
12647 * xdisp.c (iterate_out_of_display_property): xassert that
12648 IT->position is set to within IT->object's boundaries. Break from
12649 the loop as soon as EOB is reached; avoids infloops in redisplay
12650 when IT->position is set up wrongly due to some bug.
12651 Set IT->current to match the bidi iterator unconditionally.
12652 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12653 entry. Force push_it to save on the stack the current
12654 buffer/string position, to be restored by pop_it. Fix flags in
12655 the iterator structure wrt the object coming from a display
12656 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12657 properties. (Bug#9284)
12658
12659 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12660
12661 * fontset.c (fontset_get_font_group): Add proper type checks.
12662 (Bug#9172)
12663
12664 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12665
12666 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12667 and LC_VERSION_MIN_MACOSX.
12668 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12669 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12670
12671 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12672
12673 * xdisp.c (forward_to_next_line_start): Allow to use the
12674 no-display-properties-and-no-overlays under bidi display.
12675 Set disp_pos in the bidi iterator to avoid searches for display
12676 properties and overlays.
12677
12678 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12679
12680 * editfns.c (Fset_time_zone_rule): Document relationship with the
12681 setenv function.
12682
12683 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12684 the font entity extracted from the cache (Bug#8109).
12685
12686 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12687
12688 * composite.c (autocmp_chars): Don't reset point. That is done by
12689 restore_point_unwind (Bug#5984).
12690
12691 2011-08-07 Juri Linkov <juri@jurta.org>
12692
12693 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12694 to show the arg `TIME' instead of `TIMEVAL'.
12695
12696 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12697
12698 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12699 display property strides EOL and includes a newline, as in
12700 longlines-mode. (Bug#9254)
12701 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12702 word-wrap under bidirectional display. (Bug#9224)
12703
12704 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12705 is non-zero, even if the data buffer is NULL. Fixes a crash in
12706 vertical-motion with longlines-mode. (Bug#9254)
12707
12708 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12709
12710 * bidi.c <bidi_cache_total_alloc>: Now static.
12711 (bidi_initialize): Initialize bidi_cache_total_alloc.
12712
12713 * xdisp.c (display_line): Release buffer allocated for shelved bidi
12714 cache. (Bug#9221)
12715
12716 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12717 amount allocated this far in `bidi_cache_total_alloc'.
12718 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12719 non-zero, only free the data buffer without restoring the cache
12720 contents. All callers changed.
12721
12722 * dispextern.h (bidi_unshelve_cache): Update prototype.
12723
12724 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12725 (move_it_in_display_line, move_it_to)
12726 (move_it_vertically_backward, move_it_by_lines): Replace the call
12727 to xfree to an equivalent call to bidi_unshelve_cache.
12728 (move_it_in_display_line_to): Fix logic of returning
12729 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12730
12731 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12732
12733 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12734 came from a string character with a `cursor' property. (Bug#9229)
12735
12736 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12737
12738 * Makefile.in (LIB_PTHREAD): New variable.
12739 (LIBES): Add LIB_PTHREAD (Bug#9216).
12740
12741 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12742 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12743
12744 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12745
12746 * regex.c (re_iswctype): Remove some redundant boolean conversions.
12747
12748 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12749
12750 * xterm.c (x_find_topmost_parent): New function.
12751 (x_set_frame_alpha): Find topmost parent window with
12752 x_find_topmost_parent and set the property there also (bug#9181).
12753 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12754
12755 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12756
12757 * callproc.c (Fcall_process): Avoid vfork clobbering
12758 the local vars buffer, coding_systems, current_dir.
12759
12760 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12761
12762 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12763
12764 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12765
12766 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12767 so that it is not optimized away.
12768
12769 * xdisp.c (compute_display_string_pos): Remove unused local.
12770
12771 2011-08-02 Eli Zaretskii <eliz@gnu.org>
12772
12773 Fix slow cursor motion and scrolling in large buffers with
12774 selective display, like Org Mode buffers. (Bug#9218)
12775
12776 * dispextern.h (struct bidi_it): New member disp_prop_p.
12777
12778 * xdisp.c: Remove one-slot cache of display string positions.
12779 (compute_display_string_pos): Accept an additional argument
12780 DISP_PROP_P; callers changed. Scan at most 5K characters forward
12781 for a display string or property. If found, set DISP_PROP_P
12782 non-zero.
12783
12784 * bidi.c (bidi_fetch_char): Accept an additional argument
12785 DISP_PROP_P, and pass it to compute_display_string_pos.
12786 Only handle text covered by a display string if DISP_PROP_P is returned
12787 non-zero. All callers of bidi_fetch_char changed.
12788
12789 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12790
12791 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12792
12793 2010-12-03 Don March <don@ohspite.net>
12794
12795 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12796 last character M-[char] is translated to ESC [char] (bug#7541).
12797
12798 2011-08-02 Kenichi Handa <handa@m17n.org>
12799
12800 * lisp.h (uniprop_table): Extern it.
12801
12802 * chartab.c (uniprop_table): Make it non-static.
12803
12804 2011-08-01 Eli Zaretskii <eliz@gnu.org>
12805
12806 * xdisp.c (forward_to_next_line_start): Accept additional argument
12807 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12808 on the newline.
12809 (reseat_at_next_visible_line_start): Use the bidi iterator state
12810 returned by forward_to_next_line_start to restore the state of
12811 it->bidi_it after backing up to previous newline. (Bug#9212)
12812
12813 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12814
12815 * regex.c (re_comp): Protoize.
12816 (re_exec): Fix return type.
12817 (regexec): Fix type of `ret'. (Bug#9203)
12818
12819 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12820
12821 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12822 This is needed if max-image-size is a floating-point number.
12823
12824 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12825
12826 * print.c (print_object): Print empty symbol as ##.
12827
12828 * lread.c (read1): Read ## as empty symbol.
12829
12830 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12831
12832 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12833 setting frame foreground color (Bug#9175).
12834 (x_set_background_color): Likewise.
12835
12836 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12837 contents (Bug#9176).
12838 (EmacsTooltip -init): Remove bezels and add shadows to
12839 tooltip windows.
12840
12841 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12842 or scroll bar (Bug#8470).
12843
12844 * nsfont.m (nsfont_open): Remove assignment to voffset and
12845 unnecessary vars hshink, expand, hd, full_height, min_height.
12846 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12847
12848 * nsterm.h (nsfont_info): Remove voffset field.
12849
12850 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12851
12852 Implement strike-through and overline on NextStep (Bug#8863).
12853
12854 * nsfont.m (nsfont_open): Use underline position provided by font,
12855 instead of hard-coded value of 2.
12856 (nsfont_draw): Call ns_draw_text_decoration instead.
12857
12858 * nsterm.h: Add declaration for ns_draw_text_decoration.
12859
12860 * nsterm.m (ns_draw_text_decoration): New function for drawing
12861 underline, overline, and strike-through.
12862 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12863 ns_draw_text_decoration. Change treatment of cursor drawing to
12864 accommodate underlining, etc.
12865
12866 2011-07-28 Eli Zaretskii <eliz@gnu.org>
12867
12868 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12869 default.
12870
12871 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12872
12873 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12874 Without this fix, if a signal arrives just after memory fills up,
12875 'malloc' might be invoked reentrantly.
12876
12877 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12878 In other words, assume that every image size is allowed, on non-X
12879 hosts. This assumption is probably wrong, but it lets Emacs compile.
12880
12881 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12882
12883 * regex.c (re_iswctype): Convert return values to boolean.
12884
12885 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12886
12887 * xdisp.c (compute_display_string_pos): Don't use cached display
12888 string position if the buffer had its restriction changed.
12889 (Bug#9184)
12890
12891 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12892
12893 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12894
12895 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12896
12897 Integer signedness and overflow and related fixes. (Bug#9079)
12898
12899 * bidi.c: Integer size and overflow fixes.
12900 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12901 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12902 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12903 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12904 (bidi_find_other_level_edge):
12905 Use ptrdiff_t instead of EMACS_INT where either will do.
12906 This works better on 32-bit hosts configured --with-wide-int.
12907 (bidi_cache_ensure_space): Check for size-calculation overflow.
12908 Use % rather than repeated addition, for better worst-case speed.
12909 Don't set bidi_cache_size until after xrealloc returns, because it
12910 might not return.
12911 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12912 (bidi_cache_ensure_space): Also check that the bidi cache size
12913 does not exceed that of the largest Lisp string or buffer. See Eli
12914 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12915
12916 * alloc.c (__malloc_size_t): Remove.
12917 All uses replaced by size_t. See Andreas Schwab's note
12918 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12919
12920 * image.c: Improve checking for integer overflow.
12921 (check_image_size): Assume that f is nonnull, since
12922 it is always nonnull in practice. This is one less thing to
12923 worry about when checking for integer overflow later.
12924 (x_check_image_size): New function, which checks for integer
12925 overflow issues inside X.
12926 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12927 This removes the need for a memory_full check.
12928 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12929 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12930 (xbm_read_bitmap_data): Change locals back to 'int', since
12931 their values must fit in 'int'.
12932 (xpm_load_image, png_load, tiff_load):
12933 Invoke x_create_x_image_and_pixmap earlier,
12934 to avoid much needless work if the image is too large.
12935 (tiff_load): Treat overly large images as if
12936 x_create_x_image_and_pixmap failed, not as malloc failures.
12937 (gs_load): Use x_check_image_size.
12938
12939 * gtkutil.c: Omit integer casts.
12940 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12941 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12942
12943 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12944
12945 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12946 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12947 would wrongly return t on a 64-bit host.
12948
12949 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12950 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12951 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12952 and therefore cause GCC to emit a bogus diagnostic in some cases.
12953
12954 * image.c: Integer signedness and overflow and related fixes.
12955 This is not an exhaustive set of fixes, but it's time to
12956 record what I've got.
12957 (lookup_pixel_color, check_image_size): Remove redundant decls.
12958 (check_image_size): Don't assume that arbitrary EMACS_INT values
12959 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12960 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12961 (tiff_load, imagemagick_load_image):
12962 Check for overflow in size calculations.
12963 (x_create_x_image_and_pixmap): Remove unnecessary test for
12964 xmalloc returning NULL; that can't happen.
12965 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12966 (xpm_color_bucket): Use better integer hashing function.
12967 (xpm_cache_color): Don't possibly over-allocate memory.
12968 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12969 (gif_memory_source):
12970 Use ptrdiff_t, not int or size_t, to record sizes.
12971 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12972 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12973 either works, as we prefer signed integers.
12974 (tiff_read_from_memory, tiff_write_from_memory):
12975 Return tsize_t, not size_t, since that's what the TIFF API wants.
12976 (tiff_read_from_memory): Don't fail simply because the read would
12977 go past EOF; instead, return a short read.
12978 (tiff_load): Omit no-longer-needed casts.
12979 (Fimagemagick_types): Don't assume size fits into 'int'.
12980
12981 Improve hashing quality when configured --with-wide-int.
12982 * fns.c (hash_string): New function, taken from sxhash_string.
12983 Do not discard information about ASCII character case; this
12984 discarding is no longer needed.
12985 (sxhash-string): Use it. Change sig to match it. Caller changed.
12986 * lisp.h: Declare it.
12987 * lread.c (hash_string): Remove, since we now use fns.c's version.
12988 The fns.c version returns a wider integer if --with-wide-int is
12989 specified, so this should help the quality of the hashing a bit.
12990
12991 * emacs.c: Integer overflow minor fix.
12992 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12993 Define only if GNU_LINUX.
12994 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12995
12996 * dispnew.c: Integer signedness and overflow fixes.
12997 Remove unnecessary forward decls, that were a maintenance hassle.
12998 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12999 All uses changed.
13000 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13001 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13002 (prepare_desired_row, line_draw_cost):
13003 Use int, not unsigned, where either works.
13004 (save_current_matrix, restore_current_matrix):
13005 Use ptrdiff_t, not size_t, where either works.
13006 (init_display): Check for overflow more accurately, and without
13007 relying on undefined behavior.
13008
13009 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13010 Remove, replacing with the new symbols in lisp.h. All uses changed.
13011 * fileio.c (make_temp_name):
13012 * filelock.c (lock_file_1, lock_file):
13013 * xdisp.c (message_dolog):
13014 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13015 Use pMd etc. instead.
13016 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13017 replacing the pWIDE etc. symbols removed from editfns.c.
13018
13019 * keyboard.h (num_input_events): Now uintmax_t.
13020 This is (very slightly) less likely to mess up due to wraparound.
13021 All uses changed.
13022
13023 * buffer.c: Integer signedness fixes.
13024 (alloc_buffer_text, enlarge_buffer_text):
13025 Use ptrdiff_t rather than size_t when either will do, as we prefer
13026 signed integers.
13027
13028 * alloc.c: Integer signedness and overflow fixes.
13029 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13030 (__malloc_size_t): Default to size_t, not to int.
13031 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13032 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13033 Prefer ptrdiff_t to size_t when either would do, as we prefer
13034 signed integers.
13035 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13036 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13037 Now const. Initialize with values that are in range even if char
13038 is signed.
13039 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13040 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13041 These functions do the right thing with sizes > 2**32.
13042 (check_depth): Now ptrdiff_t, not int.
13043 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13044 Adjust to new way of storing sizes. Check for size overflow bugs
13045 in rest of code.
13046 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13047 slightly wrong anyway, as it missed one instance of
13048 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13049 (refill_memory_reserve): Omit needless cast to size_t.
13050 (mark_object_loop_halt): Mark as externally visible.
13051
13052 * xselect.c: Integer signedness and overflow fixes.
13053 (Fx_register_dnd_atom, x_handle_dnd_message):
13054 Use ptrdiff_t, not size_t, since we prefer signed.
13055 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13056 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13057 x_dnd_atoms_size and x_dnd_atoms_length.
13058
13059 * doprnt.c: Prefer signed to unsigned when either works.
13060 * eval.c (verror):
13061 * doprnt.c (doprnt):
13062 * lisp.h (doprnt):
13063 * xdisp.c (vmessage):
13064 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13065 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13066 prefer signed arithmetic to avoid comparison confusion.
13067 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13068 but is a bit tricky.
13069
13070 Assume freestanding C89 headers, string.h, stdlib.h.
13071 * data.c, doprnt.c, floatfns.c, print.c:
13072 Include float.h unconditionally.
13073 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13074 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13075 * regex.c: Likewise for stddef.h, string.h.
13076 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13077 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13078 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13079 (STDC_HEADERS): Remove obsolete defines.
13080 * sysdep.c: Include limits.h unconditionally.
13081
13082 Assume support for memcmp, memcpy, memmove, memset.
13083 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13084 * regex.c (memcmp, memcpy):
13085 Remove; we assume C89 now.
13086
13087 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13088 (__malloc_safe_bcopy): Remove; no longer needed.
13089
13090 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13091 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13092 well either way, and we prefer signed to unsigned.
13093
13094 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13095
13096 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13097 closes the connection while we're reading (bug#9182).
13098
13099 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13100
13101 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13102 are specified (Bug#9168).
13103
13104 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13105
13106 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13107 Found by GCC static checking and --with-wide-int on a 32-bit host.
13108
13109 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13110
13111 * xdisp.c (compute_display_string_pos): Fix logic of caching
13112 previous display string position. Initialize cached_prev_pos to
13113 -1. Fixes slow-down at the beginning of a buffer.
13114
13115 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13116
13117 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13118 for attrs[LFACE_FONTSET_INDEX].
13119
13120 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13121
13122 * xml.c (parse_region): Remove unused local
13123 that was recently introduced.
13124
13125 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13126
13127 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13128 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13129
13130 * xdisp.c (move_it_in_display_line_to): Record the best matching
13131 position for TO_CHARPOS while scanning the line, and restore it on
13132 exit if none of the characters scanned was an exact match.
13133 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13134 when exact match is impossible due to invisible text, and the
13135 lines are truncated.
13136
13137 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13138
13139 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13140 for OSX >= 10.7.
13141
13142 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13143
13144 Fix a significant slow-down of cursor motion with C-n, C-p,
13145 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13146 auto-repeat under bidi redisplay in fontified buffers.
13147 * xdisp.c (compute_stop_pos_backwards): New function.
13148 (next_element_from_buffer): Call compute_stop_pos_backwards to
13149 find a suitable prev_stop when we find ourselves before
13150 base_level_stop.
13151 (reseat): Don't look for prev_stop, as that could mean a very long
13152 run.
13153 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13154 <cached_disp_overlay_modiff>: Cache for last found display string
13155 position.
13156 (compute_display_string_pos): Return the cached position if asked
13157 about the same buffer in the same area of character positions, and
13158 the buffer wasn't changed since the time the display string
13159 position was cached.
13160
13161 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13162
13163 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13164 is an integer, which is important for empty lines. (Bug#9149)
13165
13166 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13167
13168 * frame.c (Fmodify_frame_parameters): In tty case, update the
13169 default face if necessary (Bug#4238).
13170
13171 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13172
13173 * editfns.c (Fstring_to_char): No need to explain what a character
13174 is in the docstring (Bug#6576).
13175
13176 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13177
13178 * xml.c (parse_region): Make sure we always return a tree.
13179
13180 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13181
13182 * xml.c (parse_region): If a document contains only comments,
13183 return that, too.
13184
13185 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13186
13187 * xml.c (make_dom): Return comments, too.
13188
13189 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13190
13191 Port to OpenBSD.
13192 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13193 and the surrounding thread.
13194 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13195 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13196 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13197 timer goes off.
13198 * s/openbsd.h (BROKEN_SIGIO): Define.
13199 * unexelf.c (unexec) [__OpenBSD__]:
13200 Don't update the .mdebug section of the Alpha COFF symbol table.
13201
13202 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13203
13204 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13205 (bug#8460).
13206
13207 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13208
13209 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13210 This fixes some race conditions on the permissions of any newly
13211 created file.
13212
13213 * alloc.c (valid_pointer_p): Use pipe, not open.
13214 This fixes some permissions issues when debugging.
13215
13216 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13217 If fchown fails to set both uid and gid, try to set just gid,
13218 as that is sometimes allowed. Adjust the file's mode to eliminate
13219 setuid or setgid bits that are inappropriate if fchown fails.
13220
13221 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13222
13223 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13224 to compare Lisp_Objects.
13225 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13226 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13227 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13228
13229 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13230
13231 * lread.c (read_integer): Unread even EOF character.
13232 (read1): Likewise. Properly record start position of symbol.
13233
13234 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13235 symbol character follows.
13236
13237 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13238
13239 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13240 This works around a problem with the previous change to Fcopy_file.
13241 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13242 and without this change, GCC might complain about discarding
13243 fchown's return value.
13244
13245 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13246
13247 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13248
13249 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13250
13251 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13252
13253 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13254
13255 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13256 it's used from the C level.
13257
13258 * process.c: Use the same condition for POLL_FOR_INPUT in both
13259 keyboard.c and process.c (bug#1858).
13260
13261 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13262
13263 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13264 (Fgnutls_boot): Use it.
13265
13266 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13267
13268 * doc.c (Fsubstitute_command_keys): Revert last change.
13269
13270 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13271
13272 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13273 quotes the next character, and doesn't affect other longer
13274 sequences (bug#8935).
13275
13276 * lread.c (syms_of_lread): Clarify that is isn't only
13277 `eval-buffer' and `eval-defun' that's affected by
13278 `lexical-binding' (bug#8460).
13279
13280 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13281
13282 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13283 bidi redisplay when a line includes both an image and is truncated.
13284
13285 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13286
13287 Fix minor problems found by static checking.
13288 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13289 (elsz): Now a signed constant, not a size_t var. We prefer signed
13290 types to unsigned, to avoid integer comparison confusion. Without
13291 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13292 "cannot optimize loop, the loop counter may overflow", a symptom
13293 of the confusion.
13294 * indent.c (Fvertical_motion): Mark locals as initialized.
13295 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13296
13297 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13298
13299 * search.c (Fre_search_backward): Mention `case-fold-search' in
13300 all the re_search_* functions (bug#8138).
13301
13302 * keyboard.c (Fopen_dribble_file): Document when the file is
13303 closed (bug#8056).
13304
13305 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13306
13307 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13308 bidi_cache_idx.
13309
13310 Support bidi reordering of display and overlay strings.
13311 * xdisp.c (compute_display_string_pos)
13312 (compute_display_string_end): Accept additional argument STRING.
13313 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13314 (reseat_to_string): Initialize bidi_it->string.s and
13315 bidi_it->string.schars.
13316 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13317 NULL (avoids a crash in bidi_paragraph_init).
13318 Initialize itb.string.lstring.
13319 (init_iterator): Call bidi_init_it only of a valid
13320 buffer position was specified. Initialize paragraph_embedding to
13321 L2R.
13322 (reseat_to_string): Initialize the bidi iterator.
13323 (display_string): If we need to ignore text properties of
13324 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13325 original value of -1 will not work with bidi.)
13326 (compute_display_string_pos): First arg is now struct
13327 `text_pos *'; all callers changed. Support display properties on
13328 Lisp strings.
13329 (compute_display_string_end): Support display properties on Lisp
13330 strings.
13331 (init_iterator, reseat_1, reseat_to_string): Initialize the
13332 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13333 when iterating on a string not from display properties).
13334 (compute_display_string_pos, compute_display_string_end):
13335 Fix calculation of the object to scan. Fixes an error when using
13336 arrow keys.
13337 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13338 base_level_stop; instead, set base_level_stop to BEGV.
13339 Fixes crashes in vertical-motion.
13340 (next_element_from_buffer): Improve commentary for when
13341 the iterator is before prev_stop.
13342 (init_iterator): Initialize bidi_p from the default value of
13343 bidi-display-reordering, not from buffer-local value. Use the
13344 buffer-local value only if initializing for buffer iteration.
13345 (handle_invisible_prop): Support invisible properties on strings
13346 that are being bidi-reordered.
13347 (set_iterator_to_next): Support bidi reordering of C strings and
13348 Lisp strings.
13349 (next_element_from_string): Support bidi reordering of Lisp
13350 strings.
13351 (handle_stop_backwards): Support Lisp strings as well.
13352 (display_string): Support display of R2L glyph rows.
13353 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13354 (init_iterator): Don't initialize it->bidi_p for strings
13355 here.
13356 (reseat_to_string): Initialize it->bidi_p for strings here.
13357 (next_element_from_string, next_element_from_c_string)
13358 (next_element_from_buffer): Add xassert's for correspondence
13359 between IT's object being iterated and it->bidi_it.string
13360 structure.
13361 (face_before_or_after_it_pos): Support bidi iteration.
13362 (next_element_from_c_string): Handle the case of the first string
13363 character that is not the first one in the visual order.
13364 (get_visually_first_element): New function, refactored from common
13365 parts of next_element_from_buffer, next_element_from_string, and
13366 next_element_from_c_string.
13367 (tool_bar_lines_needed, redisplay_tool_bar)
13368 (display_menu_bar): Force left-to-right direction. Add a FIXME
13369 comment for making that be controlled by a user option.
13370 (push_it, pop_it): Save and restore the state of the
13371 bidi iterator. Save and restore the bidi_p flag.
13372 (pop_it): Iterate out of display property for string iteration as
13373 well.
13374 (iterate_out_of_display_property): Support iteration over strings.
13375 (handle_single_display_spec): Set up it->bidi_it for iteration
13376 over a display string, and call bidi_init_it.
13377 (handle_single_display_spec, next_overlay_string)
13378 (get_overlay_strings_1, push_display_prop): Set up the bidi
13379 iterator for displaying display or overlay strings.
13380 (forward_to_next_line_start): Don't use the shortcut if
13381 bidi-iterating.
13382 (back_to_previous_visible_line_start): If handle_display_prop
13383 pushed the iterator stack, restore the internal state of the bidi
13384 iterator by calling bidi_pop_it same number of times.
13385 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13386 and we are bidi-iterating, don't decrement the iterator position;
13387 instead, set the first_elt flag in the bidi iterator, to produce
13388 the same effect.
13389 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13390 (push_display_prop): xassert that we are iterating a buffer.
13391 (push_it, pop_it): Save and restore paragraph_embedding member.
13392 (handle_single_display_spec, next_overlay_string)
13393 (get_overlay_strings_1, reseat_1, reseat_to_string)
13394 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13395 correctly. Don't assume unibyte strings are not bidi-reordered.
13396 (compute_display_string_pos)
13397 (compute_display_string_end): Fix handling the case of C string.
13398 (push_it, pop_it): Save and restore from_disp_prop_p.
13399 (handle_single_display_spec, push_display_prop): Set the
13400 from_disp_prop_p flag.
13401 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13402 (pop_it): Call iterate_out_of_display_property only if we are
13403 popping after iteration over a string that came from a display
13404 property. Fix a typo in popping stretch info. Add an assertion
13405 for verifying that the iterator position is in sync with the bidi
13406 iterator.
13407 (handle_single_display_spec, get_overlay_strings_1)
13408 (push_display_prop): Fix initialization of paragraph direction for
13409 string when that of the parent object is not yet determined.
13410 (reseat_1): Call bidi_init_it to resync the bidi
13411 iterator with IT's position. (Bug#7616)
13412 (find_row_edges): If ROW->start.pos gives position
13413 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13414 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13415 Reset the from_disp_prop_p flag.
13416 (SAVE_IT, RESTORE_IT): New macros.
13417 (pos_visible_p, face_before_or_after_it_pos)
13418 (back_to_previous_visible_line_start)
13419 (move_it_in_display_line_to, move_it_in_display_line)
13420 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13421 (try_scrolling, redisplay_window, display_line): Use them when
13422 saving a temporary copy of the iterator and restoring it back.
13423 (back_to_previous_visible_line_start, reseat_1)
13424 (init_iterator): Empty the bidi cache "stack".
13425 (move_it_in_display_line_to): If iterator ended up at
13426 EOL, but we never saw any buffer positions smaller than
13427 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13428 motion in bidi-reordered lines.
13429 (move_it_in_display_line_to): Record prev_method and prev_pos
13430 immediately before the call to set_iterator_to_next. Fixes cursor
13431 motion in bidi-reordered lines with stretch glyphs and strings
13432 displayed in margins. (Bug#8133) (Bug#8867)
13433 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13434 TO_CHARPOS.
13435 (pos_visible_p): Support positions in bidi-reordered lines.
13436 Save and restore bidi cache.
13437
13438 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13439 (bidi_paragraph_info): Delete unused struct.
13440 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13441 (bidi_cache_start): New variable.
13442 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13443 to zero.
13444 (bidi_cache_fetch_state, bidi_cache_search)
13445 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13446 (bidi_cache_find, bidi_peek_at_next_level)
13447 (bidi_level_of_next_char, bidi_find_other_level_edge)
13448 (bidi_move_to_visually_next): Compare cache index with
13449 bidi_cache_start rather than with zero.
13450 (bidi_fetch_char): Accept new argument STRING; all callers
13451 changed. Support iteration over a string. Support strings with
13452 display properties. Support unibyte strings. Fix the type of
13453 `len' according to what STRING_CHAR_AND_LENGTH expects.
13454 (bidi_paragraph_init, bidi_resolve_explicit_1)
13455 (bidi_resolve_explicit, bidi_resolve_weak)
13456 (bidi_level_of_next_char, bidi_move_to_visually_next):
13457 Support iteration over a string.
13458 (bidi_set_sor_type, bidi_resolve_explicit_1)
13459 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13460 can now be zero (for strings); special values 0 and -1 were
13461 changed to -1 and -2, respectively.
13462 (bidi_char_at_pos): New function.
13463 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13464 Call it instead of FETCH_MULTIBYTE_CHAR.
13465 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13466 initialized to valid values.
13467 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13468 values.
13469 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13470 the test for valid cached positions. Fix the logic for looking up
13471 the sentinel state in the cache. GCPRO the Lisp string we are
13472 iterating.
13473 (bidi_push_it, bidi_pop_it): New functions.
13474 (bidi_initialize): Initialize the bidi cache start stack pointer.
13475 (bidi_cache_ensure_space): New function, refactored from part of
13476 bidi_cache_iterator_state. Don't assume the required size is just
13477 one BIDI_CACHE_CHUNK away.
13478 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13479 (bidi_count_bytes, bidi_char_at_pos): New functions.
13480 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13481 always valid if bidi_cache_idx is valid.
13482 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13483 is valid if it's going to be used.
13484 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13485 (bidi_cache_fetch_state, bidi_cache_search)
13486 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13487 (bidi_cache_iterator_state, bidi_cache_find)
13488 (bidi_find_other_level_edge, bidi_cache_start_stack):
13489 All variables related to cache indices are now EMACS_INT.
13490
13491 * dispextern.h (struct bidi_string_data): New structure.
13492 (struct bidi_it): New member `string'. Make flag members be 1-bit
13493 fields, and put them last in the struct.
13494 (compute_display_string_pos, compute_display_string_end):
13495 Update prototypes.
13496 (bidi_push_it, bidi_pop_it): Add prototypes.
13497 (struct iterator_stack_entry): New members bidi_p,
13498 paragraph_embedding, and from_disp_prop_p.
13499 (struct it): Member bidi_p is now a bit field 1 bit wide.
13500 (bidi_shelve_cache, bidi_unshelve_cache):
13501 Declare prototypes.
13502
13503 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13504 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13505 and vector-like objects.
13506
13507 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13508 cache around display iteration.
13509
13510 * window.c (Fwindow_end, window_scroll_pixel_based)
13511 (displayed_window_lines, Frecenter): Save and restore the bidi
13512 cache around display iteration.
13513
13514 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13515
13516 * editfns.c (Fdelete_region): Clarify the use of the named
13517 parameters (bug#6788).
13518
13519 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13520
13521 * indent.c (Fvertical_motion): Set and restore w->pointm when
13522 saving and restoring the window's buffer (Bug#9006).
13523
13524 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13525
13526 * editfns.c (Fstring_to_char): Clarify just what is returned
13527 (bug#6576). Text by Eli Zaretskii.
13528
13529 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13530
13531 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13532
13533 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13534
13535 * buffer.c (mmap_find): Fix a typo.
13536
13537 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13538
13539 Fix execution of x selection hooks.
13540 * xselect.c (Qx_lost_selection_functions)
13541 (Qx_sent_selection_functions): New vars.
13542 (syms_of_xselect): DEFSYM them.
13543 (x_handle_selection_request): Pass Qx_sent_selection_functions
13544 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13545 (x_handle_selection_clear,x_clear_frame_selections):
13546 Pass Qx_lost_selection_functions rather than
13547 Vx_lost_selection_functions to Frun_hook_with_args.
13548
13549 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13550
13551 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13552 The old code sometimes used this field without initializing it.
13553
13554 * alloc.c (gc_sweep): Don't read past end of array.
13555 In theory, the old code could also have corrupted Emacs internals,
13556 though it'd be very unlikely.
13557
13558 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13559
13560 * character.c (Fcharacterp): Don't advertise optional ignored
13561 argument. (Bug#4026)
13562
13563 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13564
13565 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13566 key" (bug#4257).
13567
13568 * window.c (Fset_window_start): Doc fix (bug#4199).
13569 (Fset_window_hscroll): Ditto.
13570
13571 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13572
13573 Fix minor new problems caught by GCC 4.6.1.
13574 * term.c (init_tty): Remove unused local.
13575 * xsettings.c (store_monospaced_changed): Define this function only
13576 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13577 not used otherwise.
13578
13579 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13580
13581 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13582
13583 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13584
13585 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13586 are the mini-buffer and the echo area (bug#3320).
13587
13588 * term.c (init_tty): Remove support for supdup, c10 and perq
13589 terminals, which are no longer supported (bug#1482).
13590
13591 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13592
13593 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13594
13595 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13596
13597 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13598 for non-popups (Bug#3642).
13599
13600 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13601
13602 * alloc.c (reset_malloc_hooks): Protoize.
13603 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13604 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13605 * cm.c (losecursor): Likewise.
13606 * data.c (fmod): Likewise.
13607 * dispnew.c (swap_glyphs_in_rows): Likewise.
13608 * emacs.c (memory_warning_signal): Likewise.
13609 * floatfns.c (float_error): Likewise.
13610 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13611 (otf_open, font_otf_capability, generate_otf_features)
13612 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13613 Likewise.
13614 * image.c (pbm_read_file): Likewise.
13615 * indent.c (string_display_width): Likewise.
13616 * intervals.c (check_for_interval, search_for_interval)
13617 (inc_interval_count, count_intervals, root_interval)
13618 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13619 * lread.c (defalias): Likewise.
13620 * ralloc.c (r_alloc_check): Likewise.
13621 * regex.c (set_image_of_range_1, set_image_of_range)
13622 (regex_grow_registers): Likewise.
13623 * sysdep.c (strerror): Likewise.
13624 * termcap.c (valid_filename_p, tprint, main): Likewise.
13625 * tparam.c (main): Likewise.
13626 * unexhp9k800.c (run_time_remap, save_data_space)
13627 (update_file_ptrs, read_header, write_header, calculate_checksum)
13628 (copy_file, copy_rest, display_header): Likewise.
13629 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13630 Likewise.
13631 * xdisp.c (check_it): Likewise.
13632 * xfaces.c (register_color, unregister_color, unregister_colors):
13633 Likewise.
13634 * xfns.c (print_fontset_result): Likewise.
13635 * xrdb.c (member, fatal, main): Likewise.
13636
13637 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13638
13639 Fix minor problems found by static checking (Bug#9031).
13640 * chartab.c (char_table_set_range, map_sub_char_table):
13641 Remove unused locals.
13642 (uniprop_table): Now static.
13643 * composite.c (_work_char): Remove unused static var.
13644
13645 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
13646
13647 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13648
13649 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13650
13651 * gtkutil.c (qttip_cb): Remove code without function.
13652
13653 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13654
13655 * w32.c (pthread_sigmask): New stub.
13656
13657 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13658
13659 Use pthread_sigmask, not sigprocmask (Bug#9010).
13660 sigprocmask is portable only for single-threaded applications, and
13661 Emacs can be multi-threaded when it uses GTK.
13662 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13663 (LIBES): Use it.
13664 * callproc.c (Fcall_process):
13665 * process.c (create_process):
13666 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13667 Use pthread_sigmask, not sigprocmask.
13668
13669 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13670
13671 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13672 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13673 wrong (Bug#8591).
13674
13675 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13676
13677 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13678 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13679 (xg_hide_tooltip): Fix comment.
13680
13681 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13682 in registerServicesMenuSendTypes.
13683 (validRequestorForSendType): Don't check ns_return_types.
13684
13685 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13686 ns_return_type.
13687
13688 2011-07-08 Jason Rumney <jasonr@gnu.org>
13689
13690 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13691 SH_SHOW for hidden windows (Bug#5482).
13692
13693 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13694 frame struct members of non-existent frames (Bug#6284).
13695
13696 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13697
13698 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13699 variable firstTime not needed on OSX >= 10.6.
13700 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13701 >= 10.5. Use setKnobProportion, setDoubleValue.
13702
13703 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13704 (MAC_OS_X_VERSION_10_5): Define if not defined.
13705 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13706 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13707 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13708
13709 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13710 cString and lossyCString on OSX >= 10.4.
13711
13712 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13713 sizeToFit on OSX >= 10.2.
13714
13715 * nsimage.m (allocInitFromFile): Don't use deprecated method
13716 bestRepresentationForDevice on OSX >= 10.6.
13717
13718 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13719 to avoid warning.
13720
13721 * emacs.c: Declare unexec_init_emacs_zone.
13722
13723 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13724
13725 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13726
13727 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13728 on svcsMenu (Bug#8842).
13729
13730 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13731 ns_return_types.
13732 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13733
13734 * nsterm.m (QUTF8_STRING): Declare.
13735 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13736 (validRequestorForSendType): Return type is (id).
13737 Change indexOfObjectIdenticalTo to indexOfObject.
13738 Check if we have local selection before returning self (Bug#8842).
13739 (writeSelectionToPasteboard): Put local selection into paste board
13740 if we have a local selection (Bug#8842).
13741 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13742
13743 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13744 (ns_get_local_selection): Declare.
13745
13746 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13747
13748 * keymap.c (describe_map_tree): Don't insert a double newline at
13749 the end of the buffer (bug#1169) and return whether we inserted
13750 something.
13751
13752 * callint.c (Fcall_interactively): Change "reading args" to
13753 "providing args" to try to clarify what it does (bug#1010).
13754
13755 2011-07-07 Kenichi Handa <handa@m17n.org>
13756
13757 * composite.c (composition_compute_stop_pos): Ignore a static
13758 composition starting before CHARPOS (Bug#8915).
13759
13760 * xdisp.c (handle_composition_prop): Likewise.
13761
13762 2011-07-07 Eli Zaretskii <eliz@gnu.org>
13763
13764 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13765 (Bug#9015)
13766
13767 2011-07-07 Kenichi Handa <handa@m17n.org>
13768
13769 * character.h (unicode_category_t): New enum type.
13770
13771 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13772 (Qchar_code_property_table): New variable.
13773 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13774 (UNIPROP_COMPRESSED_FORM_P): New macros.
13775 (char_table_ascii): Uncompress the compressed values.
13776 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13777 Uncompress the compressed values.
13778 (sub_char_table_ref_and_range): Likewise.
13779 (char_table_ref_and_range): Uncompress the compressed values.
13780 (sub_char_table_set): New arg is_uniprop. Callers changed.
13781 Uncompress the compressed values.
13782 (sub_char_table_set_range): Args changed. Callers changed.
13783 (char_table_set_range): Adjuted for the above change.
13784 (map_sub_char_table): Delete args default_val and parent. Add arg
13785 top. Give decoded values to a Lisp function.
13786 (map_char_table): Adjust for the above change. Give decoded
13787 values to a Lisp function. Gcpro more variables.
13788 (uniprop_table_uncompress)
13789 (uniprop_decode_value_run_length): New functions.
13790 (uniprop_decoder, uniprop_decoder_count): New variables.
13791 (uniprop_get_decoder, uniprop_encode_value_character)
13792 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13793 New functions.
13794 (uniprop_encoder, uniprop_encoder_count): New variables.
13795 (uniprop_get_encoder, uniprop_table)
13796 (Funicode_property_table_internal, Fget_unicode_property_internal)
13797 (Fput_unicode_property_internal): New functions.
13798 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13799 Sunicode_property_table_internal, Sget_unicode_property_internal,
13800 and Sput_unicode_property_internal. Defvar_lisp
13801 char-code-property-alist.
13802
13803 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13804 Vunicode_category_table.
13805
13806 * font.c (font_range): Adjust for the change of
13807 Vunicode_category_table.
13808
13809 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13810
13811 * m/iris4d.h: Remove file, move contents ...
13812 * s/irix6-5.h: ... here.
13813
13814 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13815
13816 Remove unportable assumption about struct layout (Bug#8884).
13817 * alloc.c (mark_buffer):
13818 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13819 (clone_per_buffer_values): Don't assume that
13820 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13821 This isn't true in general, and it's particularly not true
13822 if Emacs is configured with --with-wide-int.
13823 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13824 New macros, used in the buffer.c change.
13825
13826 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13827
13828 * xsettings.c: Use both GConf and GSettings if both are available.
13829 (store_config_changed_event): Add comment.
13830 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13831 (store_tool_bar_style_changed): New functions.
13832 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
13833 (struct xsettings): Move font inside HAVE_XFT.
13834 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13835 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13836 Move inside HAVE_XFT.
13837 (something_changed_gsettingsCB): Rename from something_changedCB.
13838 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13839 also.
13840 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13841 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
13842 (something_changed_gconfCB): Rename from something_changedCB.
13843 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13844 (parse_settings): Move check for font inside HAVE_XFT.
13845 (read_settings, apply_xft_settings): Add comment.
13846 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13847 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13848 call store_font_name_changed.
13849 (xft_settings_event): Add comment.
13850 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13851 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13852 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13853 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13854 (xsettings_initialize): Call init_gsettings last.
13855 (xsettings_get_system_font, xsettings_get_system_normal_font):
13856 Add comment.
13857
13858 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13859
13860 Random fixes. E.g., (random) never returned negative values.
13861 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13862 subseconds part to the entropy, as that's a bit more random.
13863 Prefer signed to unsigned, since the signedness doesn't matter and
13864 in general we prefer signed. When given a limit, use a
13865 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13866 latter isn't right if USE_2_TAGS_FOR_INTS.
13867 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13868 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13869
13870 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13871
13872 * textprop.c (text_property_stickiness):
13873 Obey Vtext_property_default_nonsticky.
13874 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13875 * w32fns.c (syms_of_w32fns):
13876 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13877
13878 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13879
13880 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13881 This is more efficient than Ffile_directory_p and avoids a minor race.
13882
13883 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13884
13885 * buffer.c (Foverlay_put): Say what the return value is
13886 (bug#7835).
13887
13888 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13889 is a directory before asking whether to use the file name
13890 (bug#7564).
13891 (barf_or_query_if_file_exists): Make the "File is a directory"
13892 error be more correct.
13893
13894 * fns.c (Frequire): Remove the mention of the .gz files, since
13895 that's installation-specific, but keep the mention of
13896 `get-load-suffixes'.
13897
13898 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13899
13900 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13901 Report string overflow if the output is too long.
13902
13903 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
13904
13905 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13906 (syms_of_gnutls): Remove duplicate DEFSYM for
13907 Qgnutls_bootprop_verify_hostname_error, an error for
13908 Qgnutls_bootprop_verify_error (which is no longer used).
13909
13910 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13911 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13912 Also (re)move comments that are misplaced or no longer relevant.
13913
13914 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13915
13916 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13917
13918 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
13919
13920 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13921 and background color parameters if they have been changed.
13922
13923 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13924
13925 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13926
13927 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13928
13929 * xsettings.c (SYSTEM_FONT): Define only when used.
13930 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13931
13932 * keymap.c (access_keymap_1): Now static.
13933
13934 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
13935
13936 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13937 leave any prefix arg for the up event (Bug#1586).
13938
13939 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13940
13941 * lread.c (syms_of_lread): Mention single symbols defined by
13942 `defvar' or `defconst' (bug#7154).
13943
13944 * fns.c (Frequire): Mention .el.gz files (bug#7314).
13945 (Frequire): Mention get-load-suffixes.
13946
13947 2011-07-02 Martin Rudalics <rudalics@gmx.at>
13948
13949 * window.h (window): Remove clone_number slot.
13950 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13951 Remove.
13952 (make_parent_window, make_window, saved_window)
13953 (Fset_window_configuration, save_window_save): Don't deal with
13954 clone numbers.
13955 * buffer.c (Qclone_number): Remove declaration.
13956 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13957
13958 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13959
13960 Add multiple inheritance to keymaps.
13961 * keymap.c (Fmake_composed_keymap): New function.
13962 (Fset_keymap_parent): Simplify.
13963 (fix_submap_inheritance): Remove.
13964 (access_keymap_1): New function extracted from access_keymap to handle
13965 embedded parents and handle lists of maps.
13966 (access_keymap): Use it.
13967 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13968 (Fcopy_keymap): Handle embedded parents.
13969 (Fcommand_remapping, define_as_prefix): Simplify.
13970 (Fkey_binding): Simplify.
13971 (syms_of_keymap): Move minibuffer-local-completion-map,
13972 minibuffer-local-filename-completion-map,
13973 minibuffer-local-must-match-map, and
13974 minibuffer-local-filename-must-match-map to Elisp.
13975 (syms_of_keymap): Defsubr make-composed-keymap.
13976 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13977 (parse_menu_item): Trivial simplification.
13978
13979 2011-07-01 Glenn Morris <rgm@gnu.org>
13980
13981 * Makefile.in (SETTINGS_LIBS): Fix typo.
13982
13983 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13984
13985 * coding.c (Fencode_coding_string): Record the last coding system
13986 used, as the function doc string says (bug#8738).
13987
13988 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13989
13990 * xsettings.c (store_monospaced_changed): Take new font as arg and
13991 check for change against current_mono_font.
13992 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13993 (emacs_settings_constructor, emacs_settings_get_property)
13994 (emacs_settings_set_property, emacs_settings_class_init)
13995 (emacs_settings_init, gsettings_obj): Remove.
13996 (something_changedCB): New function for HAVE_GSETTINGS.
13997 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13998 with value as argument.
13999 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14000 g_settings_new (Bug#8967). Do not create gsettings_obj.
14001 Remove calls to g_settings_bind. Connect something_changedCB to
14002 "changed".
14003
14004 * xgselect.c: Add defined (HAVE_GSETTINGS).
14005 (xgselect_initialize): Ditto.
14006
14007 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14008 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14009 xg_select.
14010
14011 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14012
14013 * eval.c (struct backtrace): Simplify and port the data structure.
14014 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14015 signed bit field, as this assumption is not portable and it makes
14016 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14017 "char debug_on_exit : 1" as this is not portable either; instead,
14018 use the portable "unsigned int debug_on_exit : 1". Remove unused
14019 member evalargs. Remove obsolete comments about cc bombing out.
14020
14021 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14022
14023 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14024 Let HAVE_GSETTINGS override HAVE_GCONF.
14025 (store_monospaced_changed): New function.
14026 (EMACS_SETTINGS): A new type derived from GObject to handle
14027 GSettings notifications.
14028 (emacs_settings_constructor, emacs_settings_get_property)
14029 (emacs_settings_set_property, emacs_settings_class_init):
14030 New functions.
14031 (gsettings_client, gsettings_obj): New variables.
14032 (GSETTINGS_SCHEMA): New define.
14033 (something_changedCB): Call store_monospaced_changed.
14034 (init_gsettings): New function.
14035 (xsettings_initialize): Call init_gsettings.
14036 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14037 to NULL.
14038
14039 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14040 GCONF_CFLAGS/LIBS.
14041
14042 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14043
14044 * window.c (resize_root_window, grow_mini_window)
14045 (shrink_mini_window): Rename Qresize_root_window to
14046 Qwindow_resize_root_window and Qresize_root_window_vertically to
14047 Qwindow_resize_root_window_vertically.
14048
14049 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14050
14051 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14052
14053 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14054
14055 * makefile.w32-in: Redesign dependencies so they reflect more
14056 clearly which files are directly included by each source file,
14057 and not through other includes.
14058
14059 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14060
14061 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14062 (sort_overlays, overlay_strings): When an overlay's clone number
14063 matches the window's clone number process the overlay even if
14064 the overlay's window property doesn't match the current window.
14065
14066 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14067 (Fwindow_hchild): Rename to Fwindow_left_child.
14068 (Fwindow_next): Rename to Fwindow_next_sibling.
14069 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14070 (resize_window_check): Rename to window_resize_check.
14071 (resize_window_apply): Rename to window_resize_apply.
14072 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14073 (Fdelete_other_windows_internal, resize_frame_windows)
14074 (Fsplit_window_internal, Fdelete_window_internal)
14075 (grow_mini_window, shrink_mini_window)
14076 (Fresize_mini_window_internal): Fix callers accordingly.
14077
14078 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14079
14080 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14081 (emacs_fixed_set_min_size): Remove.
14082 (emacs_fixed_new): Take frame as argument.
14083
14084 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14085 (_EmacsFixedPrivate): Remove minwidth/height.
14086 Add struct frame *f.
14087 (emacs_fixed_init): Initialize priv->f.
14088 (get_parent_class, emacs_fixed_set_min_size): Remove.
14089 (emacs_fixed_new): Set priv->f to argument.
14090 (emacs_fixed_get_preferred_width)
14091 (emacs_fixed_get_preferred_height): Use min_width/height from
14092 frames size_hint to set minimum and natural (Bug#8919).
14093 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14094 and use min_width/height from frames size_hint to set
14095 min_width/height (Bug#8919).
14096
14097 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14098 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14099 Fix indentation.
14100
14101 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14102
14103 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14104 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14105 called at ZV.
14106
14107 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14108
14109 * process.c (wait_reading_process_output): Bypass select if
14110 waiting for a cell while ignoring keyboard input, and input is
14111 pending. Suggested by Jan Djärv (Bug#8869).
14112
14113 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14114
14115 Use gnulib's dup2 module instead of rolling our own.
14116 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14117
14118 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14119
14120 * dispnew.c (scrolling_window): Before scrolling, turn off a
14121 mouse-highlight in the window being scrolled.
14122
14123 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14124
14125 Move DEFSYM to lisp.h and use everywhere.
14126
14127 * character.h (DEFSYM): Move declaration...
14128 * lisp.h (DEFSYM): ...here.
14129
14130 * gnutls.c:
14131 * minibuf.c:
14132 * w32menu.c:
14133 * w32proc.c:
14134 * w32select.c: Don't include character.h.
14135
14136 * alloc.c (syms_of_alloc):
14137 * buffer.c (syms_of_buffer):
14138 * bytecode.c (syms_of_bytecode):
14139 * callint.c (syms_of_callint):
14140 * casefiddle.c (syms_of_casefiddle):
14141 * casetab.c (init_casetab_once):
14142 * category.c (init_category_once, syms_of_category):
14143 * ccl.c (syms_of_ccl):
14144 * cmds.c (syms_of_cmds):
14145 * composite.c (syms_of_composite):
14146 * dbusbind.c (syms_of_dbusbind):
14147 * dired.c (syms_of_dired):
14148 * dispnew.c (syms_of_display):
14149 * doc.c (syms_of_doc):
14150 * editfns.c (syms_of_editfns):
14151 * emacs.c (syms_of_emacs):
14152 * eval.c (syms_of_eval):
14153 * fileio.c (syms_of_fileio):
14154 * fns.c (syms_of_fns):
14155 * frame.c (syms_of_frame):
14156 * fringe.c (syms_of_fringe):
14157 * insdel.c (syms_of_insdel):
14158 * keymap.c (syms_of_keymap):
14159 * lread.c (init_obarray, syms_of_lread):
14160 * macros.c (syms_of_macros):
14161 * msdos.c (syms_of_msdos):
14162 * print.c (syms_of_print):
14163 * process.c (syms_of_process):
14164 * search.c (syms_of_search):
14165 * sound.c (syms_of_sound):
14166 * syntax.c (init_syntax_once, syms_of_syntax):
14167 * terminal.c (syms_of_terminal):
14168 * textprop.c (syms_of_textprop):
14169 * undo.c (syms_of_undo):
14170 * w32.c (globals_of_w32):
14171 * window.c (syms_of_window):
14172 * xdisp.c (syms_of_xdisp):
14173 * xfaces.c (syms_of_xfaces):
14174 * xfns.c (syms_of_xfns):
14175 * xmenu.c (syms_of_xmenu):
14176 * xsettings.c (syms_of_xsettings):
14177 * xterm.c (syms_of_xterm): Use DEFSYM.
14178
14179 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14180
14181 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14182
14183 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14184
14185 Integer and buffer overflow fixes (Bug#8873).
14186
14187 * print.c (printchar, strout): Check for string overflow.
14188 (PRINTPREPARE, printchar, strout):
14189 Don't set size unless allocation succeeds.
14190
14191 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14192 for sizes. Check for string overflow more accurately.
14193 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14194
14195 * macros.c: Integer and buffer overflow fixes.
14196 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14197 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14198 Use ptrdiff_t, not int, for sizes.
14199 Don't increment bufsize until after realloc succeeds.
14200 Check for size-calculation overflow.
14201 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14202
14203 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14204
14205 * lread.c: Integer overflow fixes.
14206 (read_integer): Radix is now EMACS_INT, not int,
14207 to improve quality of diagnostics for out-of-range radices.
14208 Calculate buffer size correctly for out-of-range radices.
14209 (read1): Check for integer overflow in radices, and in
14210 read-circle numbers.
14211 (read_escape): Avoid int overflow.
14212 (Fload, openp, read_buffer_size, read1)
14213 (substitute_object_recurse, read_vector, read_list, map_obarray):
14214 Use ptrdiff_t, not int, for sizes.
14215 (read1): Use EMACS_INT, not int, for sizes.
14216 Check for size overflow.
14217
14218 * image.c (cache_image): Check for size arithmetic overflow.
14219
14220 * lread.c: Integer overflow issues.
14221 (saved_doc_string_size, saved_doc_string_length)
14222 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14223 Now ptrdiff_t, not int.
14224 (read1): Don't assume doc string length fits in int. Check for
14225 out-of-range doc string lengths.
14226 (read_list): Don't assume file position fits in int.
14227 (read_escape): Check for hex character overflow.
14228
14229 2011-06-22 Leo Liu <sdl.web@gmail.com>
14230
14231 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14232 Move to minibuffer.el.
14233
14234 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14235
14236 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14237 The following patches are for when GLYPH_DEBUG && !XASSERT.
14238 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14239 * dispnew.c (flush_stdout):
14240 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14241 Mark as externally visible.
14242 * dispnew.c (check_window_matrix_pointers): Now static.
14243 * dispnew.c (window_to_frame_vpos):
14244 * xfns.c (unwind_create_frame):
14245 * xterm.c (x_check_font): Remove unused local.
14246 * scroll.c (CHECK_BOUNDS):
14247 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14248 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14249 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14250 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14251 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14252 Now static.
14253 (debug_method_add): Use va_list and vsprintf rather than relying
14254 on undefined behavior with wrong number of arguments.
14255 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14256 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14257 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14258 since we're not interested in debugging glyphs with old libraries.
14259 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14260 GCC 4.6.0's static checking.
14261
14262 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14263
14264 Integer overflow and signedness fixes (Bug#8873).
14265 A few related buffer overrun fixes, too.
14266
14267 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14268
14269 * dispextern.h (struct face.stipple):
14270 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14271 (x_bitmap_mask, x_allocate_bitmap_record)
14272 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14273 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14274 (x_create_bitmap_from_xpm_data):
14275 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14276 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14277 (.bitmaps_last):
14278 * xfaces.c (load_pixmap):
14279 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14280 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14281 (.bitmaps_last, struct x_output.icon_bitmap):
14282 Use ptrdiff_t, not int, for bitmap indexes.
14283 (x_allocate_bitmap_record): Check for size overflow.
14284 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14285
14286 Use ptrdiff_t, not int, for overlay counts.
14287 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14288 * editfns.c (overlays_around, get_pos_property):
14289 * textprop.c (get_char_property_and_overlay):
14290 * xdisp.c (next_overlay_change, note_mouse_highlight):
14291 * xfaces.c (face_at_buffer_position):
14292 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14293 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14294 (Fnext_overlay_change, Fprevious_overlay_change)
14295 (mouse_face_overlay_overlaps, Foverlays_in):
14296 Use ptrdiff_t, not int, for sizes.
14297 (overlays_at, overlays_in): Check for size-calculation overflow.
14298
14299 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14300
14301 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14302 (x_session_initialize): Do not assume string length fits in int.
14303
14304 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14305 This is unlikely, but can occur if DPI is outlandish.
14306
14307 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14308 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14309
14310 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14311 * xrdb.c (magic_file_p, search_magic_path):
14312 Omit last arg SUFFIX; it was always 0. All callers changed.
14313 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14314
14315 * xfont.c (xfont_match): Avoid need for strlen.
14316
14317 * xfns.c: Don't assume strlen fits in int.
14318 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14319
14320 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14321 not unsigned long, as we prefer signed integers. All callers changed.
14322 Detect integer overflow in repeat count.
14323 (message_dolog): Don't assume print length fits in 39 bytes.
14324 (display_mode_element): Don't assume strlen fits in int.
14325
14326 * termcap.c: Don't assume sizes fit in int and never overflow.
14327 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14328 (gobble_line): Check for size-calculation overflow.
14329
14330 * minibuf.c (Fread_buffer):
14331 * lread.c (intern, intern_c_string):
14332 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14333 Don't assume string length fits in int.
14334
14335 * keyboard.c (parse_tool_bar_item):
14336 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14337
14338 * font.c: Don't assume string length fits in int.
14339 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14340 Use ptrdiff_t, not int.
14341 (font_intern_prop): Don't assume string length fits in int.
14342 Don't assume integer property fits in fixnum.
14343 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14344
14345 * filelock.c: Fix some buffer overrun and integer overflow issues.
14346 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14347 Reformulate so as not to need the command string.
14348 Invoke gzip -cd rather than gunzip, as it's more portable.
14349 (lock_info_type, lock_file_1, lock_file):
14350 Don't assume pid_t and time_t fit in unsigned long.
14351 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14352 (current_lock_owner): Prefer signed type for sizes.
14353 Use memcpy, not strncpy, where memcpy is what is really wanted.
14354 Don't assume (via atoi) that time_t and pid_t fit in int.
14355 Check for time_t and/or pid_t out of range, e.g., via a network share.
14356 Don't alloca where an auto var works fine.
14357
14358 * fileio.c: Fix some integer overflow issues.
14359 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14360 Don't assume string length fits in int.
14361 (directory_file_name): Don't assume string length fits in long.
14362 (make_temp_name): Don't assume pid fits in int, or that its print
14363 length is less than 20.
14364
14365 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14366
14367 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14368
14369 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14370
14371 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14372 We prefer signed integers, even for size calculations.
14373
14374 * emacs.c: Don't assume string length fits in 'int'.
14375 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14376 (main): Don't invoke strlen when not needed.
14377
14378 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14379 (XD_DEBUG_MESSAGE): Don't waste a byte.
14380
14381 * callproc.c (getenv_internal_1, getenv_internal)
14382 (Fgetenv_internal):
14383 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14384
14385 * lread.c (invalid_syntax): Omit length argument.
14386 All uses changed. This doesn't fix a bug, but it simplifies the
14387 code away from its former Hollerith-constant appearance, and it's
14388 one less 'int' to worry about when looking at integer-overflow issues.
14389 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14390
14391 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14392 This didn't break anything, but it didn't help either.
14393 It's confusing to put a bogus integer in a place where the actual
14394 value does not matter.
14395 (LIST_END_P): Remove unused macro and its bogus comment.
14396 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14397
14398 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14399 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14400 implementation.
14401 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14402 We prefer signed types, and the value cannot exceed the EMACS_INT
14403 range anyway (because otherwise the length would not be representable).
14404 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14405 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14406 This avoids a GCC warning when WIDE_EMACS_INT.
14407
14408 * indent.c (sane_tab_width): New function.
14409 (current_column, scan_for_column, Findent_to, position_indentation)
14410 (compute_motion): Use it. This is just for clarity.
14411 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14412
14413 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14414
14415 * lisp.h (lint_assume): New macro.
14416 * composite.c (composition_gstring_put_cache):
14417 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14418
14419 * editfns.c, insdel.c:
14420 Omit unnecessary forward decls, to simplify future changes.
14421
14422 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14423
14424 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14425
14426 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14427 Use much-faster test for byte-length change.
14428 Don't assume string byte-length fits in 'int'.
14429 Check that character arg fits in 'int'.
14430 (mapcar1): Declare byte as byte, for clarity.
14431
14432 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14433
14434 * fns.c (concat): Catch string overflow earlier.
14435 Do not rely on integer wraparound.
14436
14437 * dispextern.h (struct it.overlay_strings_charpos)
14438 (struct it.selective): Now EMACS_INT, not int.
14439 * xdisp.c (forward_to_next_line_start)
14440 (back_to_previous_visible_line_start)
14441 (reseat_at_next_visible_line_start, next_element_from_buffer):
14442 Don't arbitrarily truncate the value of 'selective' to int.
14443
14444 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14445
14446 * composite.c: Don't truncate sizes to 'int'.
14447 (composition_gstring_p, composition_reseat_it)
14448 (composition_adjust_point): Use EMACS_INT, not int.
14449 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14450 not EMACS_UINT, for indexes.
14451
14452 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14453
14454 * buffer.c: Include <verify.h>.
14455 (struct sortvec.priority, struct sortstr.priority):
14456 Now EMACS_INT, not int.
14457 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14458 (struct sortstr.size, record_overlay_string)
14459 (struct sortstrlist.size, struct sortlist.used):
14460 Don't truncate size to int.
14461 (record_overlay_string): Check for size-calculation overflow.
14462 (init_buffer_once): Check at compile-time, not run-time.
14463
14464 2011-06-22 Jim Meyering <meyering@redhat.com>
14465
14466 Don't leak an XBM-image-sized buffer
14467 * image.c (xbm_load): Free the image buffer after using it.
14468
14469 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14470
14471 Port to Sun C.
14472 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14473 that Sun C diagnosed.
14474 * fns.c (secure_hash): Fix pointer signedness issue.
14475 * intervals.c (static_offset_intervals): New function.
14476 (offset_intervals): Use it.
14477
14478 2011-06-21 Leo Liu <sdl.web@gmail.com>
14479
14480 * deps.mk (fns.o):
14481 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14482 sha512.h.
14483
14484 * fns.c (secure_hash): Rename from crypto_hash_function and change
14485 the first arg to accept symbols.
14486 (Fsecure_hash): New primitive.
14487 (syms_of_fns): New symbols.
14488
14489 2011-06-20 Deniz Dogan <deniz@dogan.se>
14490
14491 * process.c (Fset_process_buffer): Clarify return value in
14492 docstring.
14493
14494 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14495
14496 * dispnew.c (add_window_display_history): Use BVAR.
14497
14498 * xdisp.c (debug_method_add): Use BVAR.
14499 (check_window_end, dump_glyph_matrix, dump_glyph)
14500 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14501
14502 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14503 Likewise.
14504
14505 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14506 check till after the cache is created in init_frame_faces.
14507
14508 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14509
14510 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14511
14512 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14513
14514 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14515 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14516 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14517
14518 Improve buffer-overflow checking (Bug#8873).
14519 * fileio.c (Finsert_file_contents):
14520 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14521 Remove the old (too-loose) buffer overflow checks.
14522 They weren't needed, since make_gap checks for buffer overflow.
14523 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14524 The old code merely checked for Emacs fixnum overflow, and relied
14525 on undefined (wraparound) behavior. The new code avoids undefined
14526 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14527
14528 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14529 Tune. Don't use wider integers than needed. Don't use alloca.
14530 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14531
14532 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14533
14534 * insdel.c, lisp.h (buffer_overflow): New function.
14535 (insert_from_buffer_1, replace_range, replace_range_2):
14536 * insdel.c (make_gap_larger):
14537 * editfns.c (Finsert_char):
14538 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14539
14540 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14541
14542 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14543
14544 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14545
14546 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14547 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14548
14549 * fileio.c: Don't assume EMACS_INT fits in off_t.
14550 (emacs_lseek): New static function.
14551 (Finsert_file_contents, Fwrite_region): Use it.
14552 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14553
14554 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14555
14556 * fns.c: Don't overflow int when computing a list length.
14557 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14558 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14559 truncation on 64-bit hosts. Check for QUIT every
14560 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14561 faster and is responsive enough.
14562 (Flength): Report an error instead of overflowing an integer.
14563 (Fsafe_length): Return a float if the value is not representable
14564 as a fixnum. This shouldn't happen except in contrived situations.
14565 (Fnthcdr, Fsort): Don't assume list length fits in int.
14566 (Fcopy_sequence): Don't assume vector length fits in int.
14567
14568 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14569 (header_size, word_size): New constants.
14570 (allocate_vectorlike): Don't check size overflow here.
14571 (allocate_vector): Check it here instead, since this is the only
14572 caller of allocate_vectorlike that could cause overflow.
14573 Check that the new vector's length is representable as a fixnum.
14574
14575 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14576 The previous code was bogus. For example, next_almost_prime (32)
14577 returned 39, which is undesirable as it is a multiple of 3; and
14578 next_almost_prime (24) returned 25, which is a multiple of 5 so
14579 why was the code bothering to check for multiples of 7?
14580
14581 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14582
14583 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14584
14585 Variadic C functions now count arguments with ptrdiff_t.
14586 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14587 Back then I didn't know that the Emacs coding style prefers signed int.
14588 Also, in the meantime I found a few more instances where arguments
14589 were being counted with int, which may truncate counts on 64-bit
14590 machines, or EMACS_INT, which may be unnecessarily wide.
14591 * lisp.h (struct Lisp_Subr.function.aMANY)
14592 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14593 Arg counts are now ptrdiff_t, not size_t.
14594 All variadic functions and their callers changed accordingly.
14595 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14596 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14597 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14598 * callint.c (Fcall_interactively): Check arg count for overflow,
14599 to avoid potential buffer overrun. Use signed char, not 'int',
14600 for 'varies' array, so that we needn't bother to check its size
14601 calculation for overflow.
14602 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14603 * eval.c (apply_lambda):
14604 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14605 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14606 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14607
14608 * callint.c (Fcall_interactively): Don't use index var as event count.
14609
14610 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14611 * mem-limits.h (SIZE): Remove; no longer used.
14612
14613 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14614
14615 Remove unnecessary casts.
14616 * xterm.c (x_term_init):
14617 * xfns.c (x_set_border_pixel):
14618 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14619 These aren't needed now that we assume ANSI C.
14620
14621 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14622 It's more likely to cause problems (due to unsigned overflow)
14623 than to cure them.
14624
14625 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14626
14627 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14628
14629 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14630
14631 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14632
14633 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14634
14635 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14636
14637 GLYPH_CODE_FACE returns EMACS_INT, not int.
14638 * dispextern.h (merge_faces):
14639 * xfaces.c (merge_faces):
14640 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14641 Don't assume EMACS_INT fits in int.
14642
14643 * character.h (CHAR_VALID_P): Remove unused parameter.
14644 * fontset.c, lisp.h, xdisp.c: All uses changed.
14645
14646 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14647
14648 * fns.c (concat): Minor tuning based on overflow analysis.
14649 This doesn't fix any bugs. Use int to hold character, instead
14650 of constantly refetching from Emacs object. Use XFASTINT, not
14651 XINT, for value known to be a character. Don't bother comparing
14652 a single byte to 0400, as it's always less.
14653
14654 * floatfns.c (Fexpt):
14655 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14656
14657 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14658 for characters.
14659
14660 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14661
14662 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14663 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14664 incorrectly succeed when S was a string, because 4294967386 was
14665 truncated before it was used.
14666
14667 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14668 Otherwise, an out-of-range integer could cause undefined behavior
14669 on a 64-bit host.
14670
14671 * composite.c: Use int, not EMACS_INT, for characters.
14672 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14673 EMACS_INT, for values that are known to be in character range.
14674 This doesn't fix any bugs but is the usual style inside Emacs and
14675 may generate better code on 32-bit machines.
14676
14677 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14678 This is for reasons similar to the recent CHAR_STRING fix.
14679 * charset.c (Fencode_char): Check that character arg is actually
14680 a character. Pass an int to ENCODE_CHAR.
14681 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14682 wider than 'int', as a compile-time check to prevent future regressions
14683 in this area.
14684
14685 * character.c (char_string): Remove unnecessary casts.
14686
14687 Make sure a 64-bit char is never passed to CHAR_STRING.
14688 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14689 by silently ignoring the top 32 bits, allowing some values
14690 that were far too large to be valid characters.
14691 * character.h: Include <verify.h>.
14692 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14693 arguments are no wider than unsigned, as a compile-time check
14694 to prevent future regressions in this area.
14695 * data.c (Faset):
14696 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14697 (Fsubst_char_in_region):
14698 * fns.c (concat):
14699 * xdisp.c (decode_mode_spec_coding):
14700 Adjust to CHAR_STRING's new requirement.
14701 * editfns.c (Finsert_char, Fsubst_char_in_region):
14702 * fns.c (concat): Check that character args are actually
14703 characters. Without this test, these functions did the wrong
14704 thing with wildly out-of-range values on 64-bit hosts.
14705
14706 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14707 These casts should not be needed on 32-bit hosts, either.
14708 * keyboard.c (read_char):
14709 * lread.c (Fload): Remove casts to unsigned.
14710
14711 * lisp.h (UNSIGNED_CMP): New macro.
14712 This fixes comparison bugs on 64-bit hosts.
14713 (ASCII_CHAR_P): Use it.
14714 * casefiddle.c (casify_object):
14715 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14716 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14717 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14718 * dispextern.h (FACE_FROM_ID):
14719 * keyboard.c (read_char): Use UNSIGNED_CMP.
14720
14721 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14722 not to EMACS_INT, to avoid GCC warning.
14723
14724 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14725
14726 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14727 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14728 isn't needed on 32-bit machines.
14729
14730 * buffer.c (Fgenerate_new_buffer_name):
14731 Use EMACS_INT for count, not int.
14732 (advance_to_char_boundary): Return EMACS_INT, not int.
14733
14734 * data.c (Qcompiled_function): Now static.
14735
14736 * window.c (window_body_lines): Now static.
14737
14738 * image.c (gif_load): Rename local to avoid shadowing.
14739
14740 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14741 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14742 * alloc.c (make_save_value): Integer argument is now of type
14743 ptrdiff_t, not int.
14744 (mark_object): Use ptrdiff_t, not int.
14745 * lisp.h (pD): New macro.
14746 * print.c (print_object): Use it.
14747
14748 * alloc.c: Use EMACS_INT, not int, to count objects.
14749 (total_conses, total_markers, total_symbols, total_vector_size)
14750 (total_free_conses, total_free_markers, total_free_symbols)
14751 (total_free_floats, total_floats, total_free_intervals)
14752 (total_intervals, total_strings, total_free_strings):
14753 Now EMACS_INT, not int. All uses changed.
14754 (Fgarbage_collect): Compute overall total using a double, so that
14755 integer overflow is less likely to be a problem. Check for overflow
14756 when converting back to an integer.
14757 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14758 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14759 These were 'int' variables that could overflow on 64-bit hosts;
14760 they were never used, so remove them instead of repairing them.
14761 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14762 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14763 Previously, this ceilinged at INT_MAX, but that doesn't work on
14764 64-bit machines.
14765 (allocate_pseudovector): Don't use EMACS_INT when int would do.
14766
14767 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14768 (allocate_vectorlike): Check for ptrdiff_t overflow.
14769 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14770 when a (possibly-narrower) signed value would do just as well.
14771 We prefer using signed arithmetic, to avoid comparison confusion.
14772
14773 * alloc.c: Catch some string size overflows that we were missing.
14774 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14775 for convenience in STRING_BYTES_MAX.
14776 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14777 The definition here is exact; the one in lisp.h was approximate.
14778 (allocate_string_data): Check for string overflow. This catches
14779 some instances we weren't catching before. Also, it catches
14780 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14781 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14782 and ptrdiff_t and EMACS_INT are both 64 bits.
14783
14784 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14785 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14786 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14787
14788 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14789
14790 * alloc.c (Fmake_string): Check for out-of-range init.
14791
14792 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14793
14794 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14795
14796 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14797
14798 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14799 xg_get_default_scrollbar_width.
14800
14801 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14802 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14803 (style_changed_cb): Call update_theme_scrollbar_width and call
14804 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14805 all frames (Bug#8505).
14806 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14807 Call gtk_window_set_resizable if HAVE_GTK3.
14808 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14809 and height if HAVE_GTK3 (Bug#8505).
14810 (scroll_bar_width_for_theme): New variable.
14811 (update_theme_scrollbar_width): New function.
14812 (xg_get_default_scrollbar_width): Move code to
14813 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14814 (xg_initialize): Call update_theme_scrollbar_width.
14815
14816 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14817
14818 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14819
14820 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14821
14822 * frame.c (make_frame): Call other_buffer_safely instead of
14823 other_buffer.
14824
14825 * window.c (temp_output_buffer_show): Call display_buffer with
14826 second argument Vtemp_buffer_show_specifiers and reset latter
14827 immediately after the call.
14828 (Vtemp_buffer_show_specifiers): New variable.
14829 (auto_window_vscroll_p, next_screen_context_lines)
14830 (Vscroll_preserve_screen_position): Remove leading asterisks from
14831 doc-strings.
14832
14833 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
14834
14835 Fix minor problems found by GCC 4.6.0 static checking.
14836 * buffer.c (Qclone_number): Remove for now, as it's unused.
14837 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14838 (record_buffer): Remove unused local.
14839 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14840 (set_frame_buffer_list): Remove; unused.
14841 * frame.h (other_visible_frames): Remove decl.
14842 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14843 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14844 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14845 if HAVE_GPM.
14846 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14847 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14848 Define only if HAVE_GPM.
14849 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14850 (update_hints_inhibit): Remove; never set. All uses removed.
14851 * widgetprv.h (emacsFrameClassRec): Remove decl.
14852 * window.c (delete_deletable_window): Now returns void, since it
14853 wasn't returning anything.
14854 (compare_window_configurations): Remove unused locals.
14855 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14856 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14857 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14858 the same widths as pointers. This follows up on the 2011-05-06 patch.
14859 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14860 * xterm.h: Likewise.
14861 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14862
14863 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
14864
14865 * makefile.w32-in: Update dependencies.
14866 (LISP_H): Add lib/intprops.h.
14867
14868 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14869
14870 * image.c (gif_load): Add animation frame delay to the metadata.
14871 (syms_of_image): Use DEFSYM. New symbol `delay'.
14872
14873 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14874
14875 * window.c (delete_deletable_window): Re-add.
14876 (Fset_window_configuration): Rewrite to handle dead buffers and
14877 consequently deletable windows.
14878 (window_tree, Fwindow_tree): Remove. Supply functionality in
14879 window.el.
14880 (compare_window_configurations): Simplify code.
14881
14882 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14883
14884 * image.c (imagemagick_load_image): Fix type mismatch.
14885 (Fimagemagick_types): Likewise.
14886
14887 * window.h (replace_buffer_in_windows): Declare.
14888
14889 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14890
14891 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14892 Qclone_number. Remove external declaration of Qdelete_window.
14893 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14894 code.
14895 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14896 Run Qbuffer_list_update_hook if allowed.
14897 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14898 buffer list implementation.
14899 (other_buffer_safely): New function.
14900 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14901 calls to replace_buffer_in_windows and
14902 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14903 if allowed.
14904 (record_buffer): Inhibit quitting and rewrite using quittable
14905 functions. Run Qbuffer_list_update_hook if allowed.
14906 (Frecord_buffer, Funrecord_buffer): New functions.
14907 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14908 Move switch-to-buffer to window.el.
14909 (bury-buffer): Move to window.el.
14910 (Vbuffer_list_update_hook): New variable.
14911
14912 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14913 section.
14914
14915 * window.h (resize_frame_windows): Move up in code.
14916 (Fwindow_frame): Remove EXFUN.
14917 (replace_buffer_in_all_windows): Remove prototype.
14918 (replace_buffer_in_windows_safely): Add prototype.
14919
14920 * window.c: Declare Qdelete_window static again. Move down
14921 declaration of select_count.
14922 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14923 (Fother_window): Move to window.el.
14924 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14925 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14926 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14927 window.el.
14928 (replace_buffer_in_windows): Implement by calling
14929 Qreplace_buffer_in_windows.
14930 (replace_buffer_in_all_windows): Remove with some functionality
14931 moved into replace_buffer_in_windows_safely.
14932 (replace_buffer_in_windows_safely): New function.
14933 (select_window_norecord, select_frame_norecord): Move in front
14934 of run_window_configuration_change_hook. Remove now obsolete
14935 declarations.
14936 (Fset_window_buffer): Rewrite doc-string.
14937 Call Qrecord_window_buffer.
14938 (keys_of_window): Move binding for other-window to window.el.
14939
14940 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14941
14942 * dispextern.h (struct image): Replace data member, whose int_val
14943 and ptr_val fields were not used by anything, with a single
14944 lisp_val object.
14945
14946 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14947 (gif_clear_image, gif_load, imagemagick_load_image)
14948 (gs_clear_image, gs_load): Callers changed.
14949
14950 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14951
14952 * buffer.h: Include <time.h>, for time_t.
14953 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14954
14955 Fix minor problems found by static checking.
14956
14957 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14958
14959 Make identifiers static if they are not used in other modules.
14960 * data.c (Qcompiled_function, Qframe, Qvector):
14961 * image.c (QimageMagick, Qsvg):
14962 * minibuf.c (Qmetadata):
14963 * window.c (resize_window_check, resize_root_window): Now static.
14964 * window.h (resize_window_check, resize_root_window): Remove decls.
14965
14966 * window.c (window_deletion_count, delete_deletable_window):
14967 Remove; unused.
14968 (window_body_lines): Now static.
14969 (Fdelete_other_windows_internal): Mark vars as initialized.
14970 Make sure 'resize_failed' is initialized.
14971 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14972 (resize_window_apply): Remove unused local.
14973 * window.h (delete_deletable_window): Remove decl.
14974
14975 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14976 (imagemagick_load_image): Fix pointer signedness problem by changing
14977 last arg from unsigned char * to char *. All uses changed.
14978 Also, fix a local for similar reasons.
14979 Remove unused locals. Remove locals to avoid shadowing.
14980 (fn_rsvg_handle_free): Remove; unused.
14981 (svg_load, svg_load_image): Fix pointer signedness problem.
14982 (imagemagick_load_image): Don't use garbage pointer image_wand.
14983
14984 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14985
14986 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
14987
14988 * image.c (gif_load): Fix omitted cast error introduced by
14989 2011-06-06 change.
14990
14991 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14992
14993 * window.h (resize_proportionally, orig_total_lines)
14994 (orig_top_line): Remove from window structure.
14995 (set_window_height, set_window_width, change_window_heights)
14996 (Fdelete_window): Remove prototypes.
14997 (resize_frame_windows): Remove duplicate declaration.
14998
14999 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15000
15001 * window.h (resize_frame_windows, resize_window_check)
15002 (delete_deletable_window, resize_root_window)
15003 (resize_frame_windows): Declare prototypes.
15004
15005 * window.c (resize_window_apply): Make definition be "static" to
15006 match the prototype.
15007
15008 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15009
15010 * window.c: Remove declarations of Qwindow_size_fixed,
15011 window_min_size_1, window_min_size_2, window_min_size,
15012 size_window, window_fixed_size_p, enlarge_window, delete_window.
15013 Remove static from declaration of Qdelete_window, it's
15014 temporarily needed by Fbury_buffer.
15015 (replace_window): Don't assign orig_top_line and
15016 orig_total_lines.
15017 (Fdelete_window, delete_window): Remove. Window deletion is
15018 handled by window.el.
15019 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15020 Replace Fdelete_window calls with calls to Qdelete_window.
15021 (Fdelete_other_windows): Remove. Deleting other windows is
15022 handled by window.el.
15023 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15024 handled in window.el.
15025 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15026 Window minimum sizes are handled in window.el.
15027 (shrink_windows, size_window, set_window_height)
15028 (set_window_width, change_window_heights, window_height)
15029 (window_width, CURBEG, CURSIZE, enlarge_window)
15030 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15031 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15032 handled in window.el.
15033 (make_dummy_parent): Rename to make_parent_window and give it a
15034 second argument horflag.
15035 (make_window): Don't set resize_proportionally any more.
15036 (Fsplit_window): Remove. Windows are split in window.el.
15037 (save_restore_action, save_restore_orig_size)
15038 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15039 Resize mini windows in window.el.
15040 (grow_mini_window, shrink_mini_window): Implement by calling
15041 Qresize_root_window_vertically, resize_window_check and
15042 resize_window_apply.
15043 (saved_window, Fset_window_configuration, save_window_save):
15044 Do not handle orig_top_line, orig_total_lines, and
15045 resize_proportionally.
15046 (window_min_height, window_min_width): Move to window.el.
15047 (keys_of_window): Move bindings for delete-other-windows,
15048 split-window, delete-window and enlarge-window to window.el.
15049
15050 * buffer.c: Temporarily extern Qdelete_window.
15051 (Fbury_buffer): Temporarily call Qdelete_window instead of
15052 Fdelete_window (Fbury_buffer will move to window.el soon).
15053
15054 * frame.c (set_menu_bar_lines_1): Remove code handling
15055 orig_top_line and orig_total_lines.
15056
15057 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15058 set_window_height but set heights directly.
15059 (change_frame_size_1): Use resize_frame_windows.
15060
15061 * xdisp.c (init_xdisp): Don't use set_window_height but set
15062 heights directly.
15063
15064 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15065 Use resize_frame_windows instead of change_window_heights and run
15066 run_window_configuration_change_hook.
15067
15068 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15069 instead of change_window_heights and run
15070 run_window_configuration_change_hook.
15071
15072 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15073
15074 * window.c (replace_window): Rename second argument REPLACEMENT to
15075 NEW. New third argument SETFLAG. Rewrite.
15076 (delete_window, make_dummy_parent): Call replace_window with
15077 third argument 1.
15078 (window_list_1): Move down in code.
15079 (run_window_configuration_change_hook): Move set_buffer part
15080 before select_frame_norecord part in order to unwind correctly.
15081 Rename count1 to count.
15082 (recombine_windows, delete_deletable_window, resize_root_window)
15083 (Fdelete_other_windows_internal)
15084 (Frun_window_configuration_change_hook, make_parent_window)
15085 (resize_window_check, resize_window_apply, Fresize_window_apply)
15086 (resize_frame_windows, Fsplit_window_internal)
15087 (Fdelete_window_internal, Fresize_mini_window_internal):
15088 New functions.
15089 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15090
15091 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15092
15093 * window.h (window): Add some new members to window structure -
15094 normal_lines, normal_cols, new_total, new_normal, clone_number,
15095 splits, nest, prev_buffers, next_buffers.
15096 (WINDOW_TOTAL_SIZE): Move here from window.c.
15097 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15098
15099 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15100 Remove.
15101 (make_dummy_parent): Set new members of windows structure.
15102 (make_window): Move down in code. Handle new members of window
15103 structure.
15104 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15105 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15106 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15107 (Fset_window_prev_buffers, Fwindow_next_buffers)
15108 (Fset_window_next_buffers, Fset_window_clone_number):
15109 New functions.
15110 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15111 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15112 Doc-string fixes.
15113 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15114 Argument WINDOW can be now internal window too.
15115 (Fwindow_use_time): Move up in code.
15116 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15117 Rewrite doc-string.
15118 (Fset_window_configuration, saved_window)
15119 (Fcurrent_window_configuration, save_window_save): Handle new
15120 members of window structure.
15121 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15122 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15123 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15124 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15125 Qget_mru_window, Qresize_root_window,
15126 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15127 Qauto_buffer_name; staticpro them.
15128
15129 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15130
15131 * window.c (Fwindow_total_size, Fwindow_left_column)
15132 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15133 (Fwindow_list_1): New functions.
15134 (window_box_text_cols): Replace with window_body_cols.
15135 (Fwindow_width, Fscroll_left, Fscroll_right):
15136 Use window_body_cols instead of window_box_text_cols.
15137 (delete_window, Fset_window_configuration):
15138 Call delete_all_subwindows with window as argument.
15139 (delete_all_subwindows): Take a window as argument and not a
15140 structure. Rewrite.
15141 (window_loop): Remove handling of GET_LRU_WINDOW and
15142 GET_LARGEST_WINDOW.
15143 (Fget_lru_window, Fget_largest_window): Move to window.el.
15144
15145 * window.h: Extern window_body_cols instead of
15146 window_box_text_cols. delete_all_subwindows now takes a
15147 Lisp_Object as argument.
15148
15149 * indent.c (compute_motion, Fcompute_motion):
15150 Use window_body_cols instead of window_box_text_cols.
15151
15152 * frame.c (delete_frame): Call delete_all_subwindows with root
15153 window as argument.
15154
15155 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15156
15157 * fns.c (Fputhash): Document return value.
15158
15159 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15160
15161 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15162
15163 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15164
15165 Cons<->int and similar integer overflow fixes (Bug#8794).
15166
15167 Check for overflow when converting integer to cons and back.
15168 * charset.c (Fdefine_charset_internal, Fdecode_char):
15169 Use cons_to_unsigned to catch overflow.
15170 (Fencode_char): Use INTEGER_TO_CONS.
15171 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15172 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15173 * data.c (long_to_cons, cons_to_long): Remove.
15174 (cons_to_unsigned, cons_to_signed): New functions.
15175 These signal an error for invalid or out-of-range values.
15176 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15177 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15178 * font.c (Ffont_variation_glyphs):
15179 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15180 * lisp.h: Include <intprops.h>.
15181 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15182 (cons_to_signed, cons_to_unsigned): New decls.
15183 (long_to_cons, cons_to_long): Remove decls.
15184 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15185 (Fprimitive_undo): Use CONS_TO_INTEGER.
15186 * xfns.c (Fx_window_property): Likewise.
15187 * xselect.c: Include <limits.h>.
15188 (x_own_selection, selection_data_to_lisp_data):
15189 Use INTEGER_TO_CONS.
15190 (x_handle_selection_request, x_handle_selection_clear)
15191 (x_get_foreign_selection, Fx_disown_selection_internal)
15192 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15193 (lisp_data_to_selection_data): Use cons_to_unsigned.
15194 (x_fill_property_data): Use cons_to_signed.
15195 Report values out of range.
15196
15197 Check for buffer and string overflow more precisely.
15198 * buffer.h (BUF_BYTES_MAX): New macro.
15199 * lisp.h (STRING_BYTES_MAX): New macro.
15200 * alloc.c (Fmake_string):
15201 * character.c (string_escape_byte8):
15202 * coding.c (coding_alloc_by_realloc):
15203 * doprnt.c (doprnt):
15204 * editfns.c (Fformat):
15205 * eval.c (verror):
15206 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15207 since they may not be the same number.
15208 * editfns.c (Finsert_char):
15209 * fileio.c (Finsert_file_contents):
15210 Likewise for BUF_BYTES_MAX.
15211
15212 * image.c: Use ptrdiff_t, not int, for sizes.
15213 (slurp_file): Switch from int to ptrdiff_t.
15214 All uses changed.
15215 (slurp_file): Check that file size fits in both size_t (for
15216 malloc) and ptrdiff_t (for sanity and safety).
15217
15218 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15219 if b->modtime has its maximal value.
15220
15221 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15222
15223 Don't assume time_t can fit into int.
15224 * buffer.h (struct buffer.modtime): Now time_t, not int.
15225 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15226 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15227
15228 Minor fixes for signed vs unsigned integers.
15229 * character.h (MAYBE_UNIFY_CHAR):
15230 * charset.c (maybe_unify_char):
15231 * keyboard.c (read_char, reorder_modifiers):
15232 XINT -> XFASTINT, since the integer must be nonnegative.
15233 * ftfont.c (ftfont_spec_pattern):
15234 * keymap.c (access_keymap, silly_event_symbol_error):
15235 XUINT -> XFASTINT, since the integer must be nonnegative.
15236 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15237 since it makes no difference and we prefer signed.
15238 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15239 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15240 nonnegative.
15241
15242 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15243
15244 * window.h (Fwindow_frame): Declare.
15245
15246 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15247
15248 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15249 (SPARE_MEMORY): Always define.
15250 (LARGE_REQUEST): Remove.
15251 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15252
15253 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15254
15255 * lisp.h: Move EXFUNS for Fframe_root_window,
15256 Fframe_first_window and Fset_frame_selected_window to window.h.
15257
15258 * window.h: Move EXFUNS for Fframe_root_window,
15259 Fframe_first_window and Fset_frame_selected_window here from
15260 lisp.h.
15261
15262 * frame.c (Fwindow_frame, Fframe_first_window)
15263 (Fframe_root_window, Fframe_selected_window)
15264 (Fset_frame_selected_window): Move to window.c.
15265 (Factive_minibuffer_window): Move to minibuf.c.
15266 (Fother_visible_frames_p): New function.
15267
15268 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15269
15270 * window.c (decode_window, decode_any_window): Move up in code.
15271 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15272 (inhibit_frame_unsplittable): Remove unused variable.
15273 (Fwindow_buffer): Move up and rewrite doc-string.
15274 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15275 (Fwindow_prev): New functions.
15276 (Fwindow_frame): Move here from frame.c. Accept any window as
15277 argument.
15278 (Fframe_root_window, Fframe_first_window)
15279 (Fframe_selected_window): Move here from frame.c. Accept frame
15280 or arbitrary window as argument. Update doc-strings.
15281 (Fminibuffer_window): Move up in code.
15282 (Fwindow_minibuffer_p): Move up in code and simplify.
15283 (Fset_frame_selected_window): Move here from frame.c.
15284 Marginal rewrite.
15285 (Fselected_window, select_window, Fselect_window): Move up in
15286 code. Minor doc-string fixes.
15287
15288 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15289
15290 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15291 Do not assume that spare memory exists; that assumption is valid
15292 only if SYSTEM_MALLOC.
15293 (LARGE_REQUEST): New macro, so that the issue of large requests
15294 is separated from the issue of spare memory.
15295
15296 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15297
15298 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15299 format. (Bug#8806)
15300
15301 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15302
15303 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15304 before statements.
15305
15306 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15307
15308 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15309
15310 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15311
15312 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15313 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15314
15315 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15316
15317 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15318
15319 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15320
15321 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15322 (x_clipboard_manager_save): Add return value.
15323 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15324 New error handlers.
15325 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15326 Obey Vx_select_enable_clipboard_manager. Catch errors in
15327 x_clipboard_manager_save (Bug#8779).
15328 (Vx_select_enable_clipboard_manager): New variable.
15329 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15330
15331 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15332
15333 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15334
15335 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15336
15337 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15338 in the current matrix if keep_current_p is non-zero.
15339
15340 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15341
15342 * bidi.c (bidi_level_of_next_char): Fix last change.
15343
15344 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15345
15346 Support bidi reordering of text covered by display properties.
15347
15348 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15349 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15350 (bidi_cache_search, bidi_cache_iterator_state)
15351 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15352 (bidi_level_of_next_char, bidi_move_to_visually_next):
15353 Support character positions inside a run of characters covered by a
15354 display string.
15355 (bidi_paragraph_init, bidi_resolve_explicit_1)
15356 (bidi_level_of_next_char): Call bidi_fetch_char and
15357 bidi_fetch_char_advance instead of FETCH_CHAR and
15358 FETCH_CHAR_ADVANCE.
15359 (bidi_init_it): Initialize new members.
15360 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15361 definitions.
15362 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15363 instead of using explicit *_CHAR codes.
15364 (bidi_resolve_explicit, bidi_resolve_weak):
15365 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15366 bidirectional text is supported only in multibyte buffers.
15367 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15368 it to initialize the frame_window_p member of struct bidi_it.
15369 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15370 (bidi_resolve_explicit, bidi_resolve_weak)
15371 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15372 bidi_it->nchars is non-positive.
15373 (bidi_level_of_next_char): Don't try to lookup the cache for the
15374 next/previous character if nothing is cached there yet, or if we
15375 were just reseat()'ed to a new position.
15376
15377 * xdisp.c (set_cursor_from_row): Set start and stop points
15378 according to the row's direction when priming the loop that looks
15379 for the glyph on which to display cursor.
15380 (single_display_spec_intangible_p): Function deleted.
15381 (display_prop_intangible_p): Reimplement to call
15382 handle_display_spec instead of single_display_spec_intangible_p.
15383 Accept 3 additional arguments needed by handle_display_spec.
15384 This fixes incorrect cursor motion across display property with complex
15385 values: lists, `(when COND...)' forms, etc.
15386 (single_display_spec_string_p): Support property values that are
15387 lists with the argument STRING its top-level element.
15388 (display_prop_string_p): Fix the condition for processing a
15389 property that is a list to be consistent with handle_display_spec.
15390 (handle_display_spec): New function, refactored from the
15391 last portion of handle_display_prop.
15392 (compute_display_string_pos): Accept additional argument
15393 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15394 value of a `display' property is a "replacing spec".
15395 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15396 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15397 the display property, but just return a value indicating whether
15398 the display property will replace the characters it covers.
15399 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15400 frame_window_p members of struct bidi_it.
15401 (compute_display_string_pos, compute_display_string_end):
15402 New functions.
15403 (push_it): Accept second argument POSITION, where pop_it should
15404 jump to continue iteration.
15405 (reseat_1): Initialize bidi_it.disp_pos.
15406
15407 * keyboard.c (adjust_point_for_property): Adjust the call to
15408 display_prop_intangible_p to its new signature.
15409
15410 * dispextern.h (struct bidi_it): New member frame_window_p.
15411 (bidi_init_it): Update prototypes.
15412 (display_prop_intangible_p): Update prototype.
15413 (compute_display_string_pos, compute_display_string_end):
15414 Declare prototypes.
15415 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15416 EMACS_INT.
15417
15418 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15419
15420 Malloc failure behavior now depends on size of allocation.
15421 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15422 * lisp.h: Change signatures accordingly.
15423 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15424 All callers changed. (Bug#8762)
15425
15426 * gnutls.c: Use Emacs's memory allocators.
15427 Without this change, the gnutls library would invoke malloc etc.
15428 directly, which causes problems on non-SYNC_INPUT hosts, and which
15429 runs afoul of improving memory_full behavior. (Bug#8761)
15430 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15431 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15432 xfree instead of the default malloc, realloc, free.
15433 (Fgnutls_boot): No need to check for memory allocation failure,
15434 since xmalloc does that for us.
15435
15436 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15437 * category.c (hash_get_category_set):
15438 * ccl.c (ccl_driver):
15439 * charset.c (Fdefine_charset_internal):
15440 * charset.h (struct charset.hash_index):
15441 * composite.c (get_composition_id, gstring_lookup_cache)
15442 (composition_gstring_put_cache):
15443 * composite.h (struct composition.hash_index):
15444 * dispextern.h (struct image.hash):
15445 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15446 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15447 (hashfn_equal, hashfn_user_defined, make_hash_table)
15448 (maybe_resize_hash_table, hash_lookup, hash_put)
15449 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15450 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15451 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15452 * image.c (make_image, search_image_cache, lookup_image)
15453 (xpm_put_color_table_h):
15454 * lisp.h (struct Lisp_Hash_Table):
15455 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15456 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15457 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15458 * alloc.c (allocate_vectorlike):
15459 Check for overflow in vector size calculations.
15460 * ccl.c (ccl_driver):
15461 Check for overflow when converting EMACS_INT to int.
15462 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15463 need to be updated by these changes.
15464 * fns.c (make_hash_table, maybe_resize_hash_table):
15465 Check for integer overflow with large hash tables.
15466 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15467 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15468 (SXHASH_REDUCE): New macro.
15469 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15470 Use it instead of discarding useful hash info with large hash values.
15471 (sxhash_float): New function.
15472 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15473 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15474 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15475 Rewrite to use FIXNUM_BITS, as this simplifies things.
15476 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15477 Adjust signatures to match updated version of code.
15478 (consing_since_gc): Now EMACS_INT, since a single hash table can
15479 use more than INT_MAX bytes.
15480
15481 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15482
15483 Make it possible to build with GCC-4.6+ -O2 -flto.
15484
15485 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15486
15487 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15488
15489 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15490 Call minibuffer-inactive-mode.
15491
15492 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15493
15494 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15495 Update dependencies.
15496
15497 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15498
15499 * data.c (init_data): Remove code for UTS, this system is not
15500 supported anymore.
15501
15502 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15503
15504 Don't force ./temacs to start in terminal mode.
15505
15506 * frame.c (make_initial_frame): Initialize faces in all cases, not
15507 only when CANNOT_DUMP is defined.
15508 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15509
15510 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15511
15512 * dispnew.c (add_window_display_history): Use const for the string
15513 pointer. Remove declaration, not needed.
15514
15515 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15516
15517 Use 'inline', not 'INLINE'.
15518 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15519 * alloc.c, fontset.c (INLINE): Remove.
15520 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15521 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15522 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15523 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15524 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15525
15526 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15527
15528 Make it possible to run ./temacs.
15529
15530 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15531 syms_of_callproc does the same thing. Remove test for
15532 "initialized", do it in the caller.
15533 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15534
15535 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15536
15537 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15538 (read_minibuf): Use get_minibuffer.
15539 (syms_of_minibuf): Use DEFSYM.
15540 (Qmetadata): New var.
15541 * data.c (Qbuffer): Don't make it static.
15542 (syms_of_data): Use DEFSYM.
15543
15544 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15545
15546 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15547 (CCL_CODE_MIN): New macro.
15548
15549 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15550
15551 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15552
15553 * eval.c (Qdebug): Now static.
15554 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15555 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15556 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15557
15558 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15559
15560 * image.c: Various fixes to ImageMagick code comments.
15561 (Fimagemagick_types): Doc fix.
15562
15563 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15564
15565 Minor fixes prompted by GCC 4.6.0 warnings.
15566
15567 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15568
15569 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15570 (x_clipboard_manager_save_all): Move extern decl to ...
15571 * xterm.h: ... here, so that it can be checked for consistency.
15572
15573 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15574
15575 * xselect.c (x_clipboard_manager_save_frame)
15576 (x_clipboard_manager_save_all): New functions.
15577 (Fx_clipboard_manager_save): Lisp function deleted.
15578
15579 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15580 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15581
15582 * xterm.h: Update prototype.
15583
15584 2011-05-28 William Xu <william.xwl@gmail.com>
15585
15586 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15587 exiting (Bug#8239).
15588
15589 2011-05-28 Jim Meyering <meyering@redhat.com>
15590
15591 Avoid a sign-extension bug in crypto_hash_function.
15592 * fns.c (to_uchar): Define.
15593 (crypto_hash_function): Use it to convert some newly-signed
15594 variables to unsigned, to avoid sign-extension bugs. For example,
15595 without this change, (md5 "truc") would evaluate to
15596 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15597 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15598 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15599
15600 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15601
15602 Integer overflow fixes.
15603
15604 * dbusbind.c: Serial number integer overflow fixes.
15605 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15606 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15607 to hold a serial number that is too large for a fixnum.
15608 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15609 Check for serial numbers out of range. Decode any serial number
15610 that was so large that it became a float. (Bug#8722)
15611
15612 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15613 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15614 Use XFASTINT rather than XUINT when numbers are nonnegative.
15615 (xd_append_arg, Fdbus_method_return_internal):
15616 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15617 arguments, check that Lisp number is nonnegative, rather than
15618 silently wrapping negative numbers around. (Bug#8722)
15619 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15620 (Bug#8722)
15621
15622 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15623
15624 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15625
15626 ccl: Add integer overflow checks.
15627 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15628 (IN_INT_RANGE): New macros.
15629 (ccl_driver): Use them to check for integer overflow when
15630 decoding a CCL program. Many of the new checks are whether XINT (x)
15631 fits in int; it doesn't always, on 64-bit hosts. The new version
15632 doesn't catch all possible integer overflows, but it's an
15633 improvement. (Bug#8719)
15634
15635 * alloc.c (make_event_array): Use XINT, not XUINT.
15636 There's no need for unsigned here.
15637
15638 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15639 This follows up to the 2011-05-06 change that substituted uintptr_t
15640 for EMACS_INT. This case wasn't caught back then.
15641
15642 Rework Fformat to avoid integer overflow issues.
15643 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15644 now (part of C89). Include <verify.h>.
15645 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15646 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15647 (Fformat): Avoid the prepass trying to compute sizes; it was only
15648 approximate and thus did not catch overflow reliably. Instead, walk
15649 through the format just once, formatting and computing sizes as we go,
15650 checking for integer overflow at every step, and allocating a larger
15651 buffer as needed. Keep track separately whether the format is
15652 multibyte. Keep only the most-recently calculated precision, rather
15653 than them all. Record whether each argument has been converted to
15654 string. Use EMACS_INT, not int, for byte and char and arg counts.
15655 Support field widths and precisions larger than INT_MAX. Avoid
15656 sprintf's undefined behavior with conversion specifications such as %#d
15657 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15658 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15659 formatting out-of-range floating point numbers with int
15660 formats. (Bug#8668)
15661
15662 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15663
15664 * data.c: Avoid integer truncation in expressions involving floats.
15665 * data.c: Include <intprops.h>.
15666 (arith_driver): When there's an integer overflow in an expression
15667 involving floating point, convert the integers to floating point
15668 so that the resulting value does not suffer from catastrophic
15669 integer truncation. For example, on a 64-bit host (* 4
15670 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15671 Do not rely on undefined behavior after integer overflow.
15672
15673 merge count_size_as_multibyte, parse_str_to_multibyte
15674 * character.c, character.h (count_size_as_multibyte):
15675 Rename from parse_str_to_multibyte; all uses changed.
15676 Check for integer overflow.
15677 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15678 since it's now a duplicate of the other. This is more of
15679 a character than a buffer op, so better that it's in character.c.
15680 * fns.c, print.c: Adjust to above changes.
15681
15682 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15683
15684 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15685
15686 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15687
15688 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15689 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15690 (x_clipboard_manager_save): Now static.
15691 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15692
15693 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15694 (crypto_hash_function): Now static.
15695 Fix pointer signedness problems. Avoid unnecessary initializations.
15696
15697 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15698
15699 * termhooks.h (Vselection_alist): Make it terminal-local.
15700
15701 * terminal.c (create_terminal): Initialize it.
15702
15703 * xselect.c: Support for clipboard managers.
15704 (Vselection_alist): Move to termhooks.h as terminal-local var.
15705 (LOCAL_SELECTION): New macro.
15706 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15707 (symbol_to_x_atom): Remove gratuitous arg.
15708 (x_handle_selection_request, lisp_data_to_selection_data)
15709 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15710 (x_own_selection, x_get_local_selection, x_convert_selection):
15711 New arg, specifying work frame. Use terminal-local Vselection_alist.
15712 (some_frame_on_display): Delete unused function.
15713 (Fx_own_selection_internal, Fx_get_selection_internal)
15714 (Fx_disown_selection_internal, Fx_selection_owner_p)
15715 (Fx_selection_exists_p): New optional frame arg.
15716 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15717 (x_handle_selection_clear): Don't treat other terminals with the
15718 same keyboard specially. Use the terminal-local Vselection_alist.
15719 (x_clear_frame_selections): Use Frun_hook_with_args.
15720
15721 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15722
15723 * xterm.h: Add support for those atoms.
15724
15725 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
15726
15727 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15728 (converted_selections, conversion_fail_tag): New global variables.
15729 (x_selection_request_lisp_error): Free the above.
15730 (x_get_local_selection): Remove unnecessary code.
15731 (x_reply_selection_request): Args changed; handle arbitrary array
15732 of converted selections stored in converted_selections.
15733 Separate the XChangeProperty and SelectionNotify steps.
15734 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15735 (x_convert_selection): New function.
15736 (x_handle_selection_event): Simplify.
15737 (x_get_foreign_selection): Don't ignore incoming requests while
15738 waiting for an answer; this will fail when we implement
15739 SAVE_TARGETS, and seems unnecessary anyway.
15740 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15741 (Vx_sent_selection_functions): Doc fix.
15742
15743 2011-05-26 Leo Liu <sdl.web@gmail.com>
15744
15745 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15746
15747 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15748
15749 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15750
15751 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15752 for fringe update if it has periodic bitmap.
15753 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15754 and fringe_bitmap_periodic_p.
15755
15756 * fringe.c (get_fringe_bitmap_data): New function.
15757 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15758 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15759 row. Mark glyph row for fringe update if periodicity changed.
15760
15761 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15762 for fringe update unless it has periodic bitmap.
15763
15764 2011-05-25 Kenichi Handa <handa@m17n.org>
15765
15766 * xdisp.c (get_next_display_element): Set correct it->face_id for
15767 a static composition.
15768
15769 2011-05-24 Leo Liu <sdl.web@gmail.com>
15770
15771 * deps.mk (fns.o):
15772 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15773
15774 * fns.c (crypto_hash_function, Fsha1): New function.
15775 (Fmd5): Use crypto_hash_function.
15776 (syms_of_fns): Add Ssha1.
15777
15778 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15779
15780 * gnutls.c: Remove unused macros.
15781 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15782 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15783 Remove macros that are defined and never used.
15784 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15785
15786 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15787
15788 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15789 (Fx_get_selection_internal): Minor cleanup.
15790 (Fx_own_selection_internal): Rename arguments for consistency with
15791 select.el.
15792
15793 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15794
15795 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15796
15797 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15798
15799 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15800
15801 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15802
15803 * dispnew.c (scrolling_window): Don't exclude the case that the
15804 last enabled row in the desired matrix touches the bottom boundary.
15805
15806 2011-05-21 Glenn Morris <rgm@gnu.org>
15807
15808 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15809 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15810 and add some more files.
15811
15812 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15813
15814 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15815 report_file_error introduced by the change from 2011-05-07.
15816
15817 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15818
15819 * systime.h (Time): Define only if emacs is defined.
15820 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15821 where the include path doesn't have X11/X.h by default. See
15822 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15823
15824 2011-05-20 Kenichi Handa <handa@m17n.org>
15825
15826 * composite.c (find_automatic_composition): Fix previous change.
15827
15828 2011-05-20 Glenn Morris <rgm@gnu.org>
15829
15830 * lisp.mk: New file, split from Makefile.in.
15831 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15832 (shortlisp): Remove.
15833 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15834
15835 2011-05-19 Glenn Morris <rgm@gnu.org>
15836
15837 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15838 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15839 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15840 (lisp): Set the order to that of loadup.el.
15841 (shortlisp): Make it a copy of $lisp.
15842 (SOME_MACHINE_LISP): Remove.
15843 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15844 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15845
15846 2011-05-18 Kenichi Handa <handa@m17n.org>
15847
15848 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15849 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15850 (find_automatic_composition): Mostly rewrite for efficiency.
15851
15852 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
15853
15854 * makefile.w32-in: Update dependencies.
15855
15856 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15857
15858 * menu.c: Include limits.h (fixes the MS-Windows build broken by
15859 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15860
15861 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
15862
15863 Fix some integer overflow issues, such as string length overflow.
15864
15865 * insdel.c (count_size_as_multibyte): Check for string overflow.
15866
15867 * character.c (lisp_string_width): Check for string overflow.
15868 Use EMACS_INT, not int, for string indexes and lengths; in
15869 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15870 the resulting string length overflows an EMACS_INT; instead,
15871 report a string overflow if no precision given. When checking for
15872 precision exhaustion, use a check that cannot possibly have
15873 integer overflow. (Bug#8675)
15874 * character.h (lisp_string_width): Adjust to new signature.
15875
15876 * alloc.c (string_overflow): New function.
15877 (Fmake_string): Use it. This doesn't change behavior, but saves
15878 a few bytes and will simplify future changes.
15879 * character.c (string_escape_byte8): Likewise.
15880 * lisp.h (string_overflow): New decl.
15881
15882 Fixups, following up to the user-interface timestamp change.
15883 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15884 for UI timestamps, instead of unsigned long.
15885 * msdos.c (mouse_get_pos): Likewise.
15886 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15887 * w32gui.h (Time): Define by including "systime.h" rather than by
15888 declaring it ourselves. (Bug#8664)
15889
15890 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15891 * image.c (clear_image_cache): Likewise.
15892
15893 * term.c (term_mouse_position): Don't assume time_t wraparound.
15894
15895 Be more systematic about user-interface timestamps.
15896 Before, the code sometimes used 'Time', sometimes 'unsigned long',
15897 and sometimes 'EMACS_UINT', to represent these timestamps.
15898 This change causes it to use 'Time' uniformly, as that's what X uses.
15899 This makes the code easier to follow, and makes it easier to catch
15900 integer overflow bugs such as Bug#8664.
15901 * frame.c (Fmouse_position, Fmouse_pixel_position):
15902 Use Time, not unsigned long, for user-interface timestamps.
15903 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15904 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15905 * keyboard.h (last_event_timestamp): Likewise.
15906 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15907 * menu.h (xmenu_show): Likewise.
15908 * term.c (term_mouse_position): Likewise.
15909 * termhooks.h (struct input_event.timestamp): Likewise.
15910 (struct terminal.mouse_position_hook): Likewise.
15911 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15912 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15913 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15914 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15915 what it was before.
15916 * menu.h, termhooks.h: Include "systime.h", for Time.
15917
15918 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15919 Don't assume that the difference between two unsigned long values
15920 can fit into an integer. At this point, we know button_down_time
15921 <= event->timestamp, so the difference must be nonnegative, so
15922 there's no need to cast the result if double-click-time is
15923 nonnegative, as it should be; check that it's nonnegative, just in
15924 case. This bug is triggered when events are more than 2**31 ms
15925 apart (about 25 days). (Bug#8664)
15926
15927 * xselect.c (last_event_timestamp): Remove duplicate decl.
15928 (x_own_selection): Remove needless cast to unsigned long.
15929
15930 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15931 that always fit in int. Use a sentinel instead of a counter, to
15932 avoid a temp and to allay GCC's concerns about possible int overflow.
15933 * frame.h (struct frame): Use int for menu_bar_items_used
15934 instead of EMACS_INT, since it always fits in int.
15935
15936 * menu.c (grow_menu_items): Check for int overflow.
15937
15938 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15939
15940 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15941 Before, the code was not consistent. These values cannot exceed
15942 2**31 - 1 so there's no need to make them unsigned.
15943 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15944 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15945 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15946 as modifiers.
15947 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15948
15949 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15950 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15951 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15952 presumably because the widths might not match.
15953
15954 * window.c (size_window): Avoid needless test at loop start.
15955
15956 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15957
15958 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15959
15960 2011-05-12 Drew Adams <drew.adams@oracle.com>
15961
15962 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15963
15964 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15965
15966 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15967 `width' to `bar_area_x' and `bar_area_width', respectively.
15968 (x_scroll_run): Take account of fringe background extension.
15969
15970 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15971 Rename local vars `left' and `width' to `bar_area_x' and
15972 `bar_area_width', respectively.
15973 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15974 background extension.
15975
15976 2011-05-10 Jim Meyering <meyering@redhat.com>
15977
15978 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15979
15980 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
15981
15982 * image.c (Finit_image_library): Return t for built-in image types,
15983 like pbm and xbm. (Bug#8640)
15984
15985 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15986
15987 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15988
15989 2011-05-07 Eli Zaretskii <eliz@gnu.org>
15990
15991 * w32console.c (Fset_screen_color): Doc fix.
15992 (Fget_screen_color): New function.
15993 (syms_of_ntterm): Defsubr it.
15994
15995 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15996 unlink the temporary file if Fcall_process didn't create it in the
15997 first place.
15998 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15999 child process will be redirected to a file specified with `:file'.
16000 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16001 cue to call_process_cleanup not to close that handle.
16002
16003 2011-05-07 Ben Key <bkey76@gmail.com>
16004
16005 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16006 one of two shell specific rules, either bootstrap-temacs-CMD or
16007 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16008 to the previous implementation of the bootstrap-temacs rule.
16009 The bootstrap-temacs-CMD rule is similar to the previous
16010 implementation of the bootstrap-temacs rule except that it
16011 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16012 variable.
16013
16014 These changes, along with some changes to nt/configure.bat,
16015 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16016 earlier fix to add support for --cflags and --ldflags options
16017 that include quotes so that it works whether make uses cmd or
16018 sh as the shell.
16019
16020 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16021
16022 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16023 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16024 is a constant.
16025 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16026 a string. Handle both cases.
16027 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16028 (Fdbus_register_method): Use Qinvalid_function.
16029
16030 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16031
16032 * makefile.w32-in: Update dependencies.
16033 (LISP_H): Add inttypes.h and stdin.h.
16034 (PROCESS_H): Add unistd.h.
16035
16036 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16037
16038 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16039 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16040
16041 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16042
16043 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16044
16045 * term.c (vfatal): Remove stray call to va_end.
16046 It's not needed and the C Standard doesn't allow it here anyway.
16047
16048 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16049 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16050
16051 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16052 bytes.
16053
16054 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16055
16056 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16057
16058 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16059
16060 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16061
16062 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16063
16064 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16065 * charset.c (Fdefine_charset_internal): Don't initialize
16066 charset.code_space[15]. The value was garbage, on hosts with
16067 32-bit int (Bug#8600).
16068
16069 * lread.c (read_integer): Be more consistent with string-to-number.
16070 Use string_to_number to do the actual conversion; this avoids
16071 rounding errors and fixes some other screwups. Without this fix,
16072 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16073 (digit_to_number): Move earlier, for benefit of read_integer.
16074 Return -1 if the digit is out of range for the base, -2 if it is
16075 not a digit in any supported base. (Bug#8602)
16076
16077 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16078
16079 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16080 to match comment at start of function. This also removes a
16081 GCC warning about overflow in a 32+64-bit port.
16082
16083 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16084
16085 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16086 Reported by Stefan Monnier in
16087 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16088 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16089 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16090
16091 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16092 (EMACS_UINTPTR): Likewise, with uintptr_t.
16093
16094 * lisp.h: Prefer 64-bit EMACS_INT if available.
16095 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16096 on 32-bit hosts that have 64-bit int, so that they can access
16097 large files.
16098 However, temporarily disable this change unless the temporary
16099 symbol WIDE_EMACS_INT is defined.
16100
16101 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16102
16103 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16104 This removes an assumption that EMACS_INT and long are the same
16105 width as pointers. The assumption is true for Emacs porting targets
16106 now, but we want to make other targets possible.
16107 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16108 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16109 In the rest of the code, change types of integers that hold casted
16110 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16111 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16112 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16113 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16114 No need to cast type when ORing.
16115 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16116 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16117 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16118 assume EMACS_INT is the same width as char *.
16119 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16120 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16121 Remove no-longer-needed casts.
16122 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16123 (xg_tool_bar_help_callback, xg_make_tool_item):
16124 Use EMACS_INTPTR to hold an integer
16125 that will be cast to void *; this can avoid a GCC warning
16126 if EMACS_INT is not the same width as void *.
16127 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16128 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16129 (current_message_1, set_message_1):
16130 Use a local to convert to proper width without a cast.
16131 * xmenu.c (dialog_selection_callback): Likewise.
16132
16133 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16134 Also, don't assume VALBITS / RAND_BITS is less than 5,
16135 and don't rely on undefined behavior when shifting a 1 left into
16136 the sign bit.
16137 * lisp.h (get_random): Change signature to match.
16138
16139 * lread.c (hash_string): Use size_t, not int, for hash computation.
16140 Normally we prefer signed values; but hashing is special, because
16141 it's better to use unsigned division on hash table sizes so that
16142 the remainder is nonnegative. Also, size_t is the natural width
16143 for hashing into memory. The previous code used 'int', which doesn't
16144 retain enough info to hash well into very large tables.
16145 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16146
16147 * dbusbind.c: Don't possibly lose pointer info when converting.
16148 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16149 Use XPNTR rather than XHASH, so that the high-order bits of
16150 the pointer aren't lost when converting through void *.
16151
16152 * eval.c (Fautoload): Don't double-shift a pointer.
16153
16154 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16155
16156 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16157
16158 * gnutls.c (DEF_GNUTLS_FN):
16159 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16160
16161 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16162
16163 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16164 marker. (Bug#8610)
16165
16166 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16167
16168 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16169 New version that can reserve upto 2GB of heap space.
16170
16171 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16172
16173 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16174
16175 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16176
16177 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16178 `gnutls_certificate_set_x509_key_file'.
16179
16180 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16181
16182 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16183 Update dependencies.
16184
16185 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16186
16187 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16188 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16189 Remove unused parameter `fildes'.
16190 * process.c (read_process_output, send_process): Don't pass it.
16191
16192 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16193
16194 Fix previous change: the library cache is defined in w32.c.
16195 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16196 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16197
16198 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16199
16200 Implement dynamic loading of GnuTLS on Windows.
16201
16202 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16203 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16204 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16205 Declare.
16206
16207 * gnutls.c (Qgnutls_dll): Define.
16208 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16209 (gnutls_*): Declare function pointers.
16210 (init_gnutls_functions): New function to initialize function pointers.
16211 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16212 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16213 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16214 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16215 (emacs_gnutls_write, emacs_gnutls_read)
16216 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16217 (Fgnutls_available_p): New function.
16218 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16219 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16220 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16221
16222 * image.c: Include w32.h.
16223 (Vimage_type_cache): Delete.
16224 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16225 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16226 (w32_delayed_load): Move to w32.c.
16227
16228 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16229
16230 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16231 (w32_delayed_load): Move from image.c. When loading a library, record
16232 its filename in the :loaded-from property of the library id.
16233 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16234 Initialize and staticpro them.
16235 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16236
16237 * process.c: Include lisp.h before w32.h, not after.
16238 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16239 instead of gnutls_record_check_pending.
16240
16241 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16242
16243 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16244
16245 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16246 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16247 as passed in.
16248
16249 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16250
16251 * xterm.c (x_set_frame_alpha): Do not set property on anything
16252 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16253
16254 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16255
16256 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16257
16258 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16259
16260 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16261 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16262 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16263 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16264 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16265 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16266 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16267 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16268 (Qgnutls_bootprop_callbacks_verify): Make static.
16269
16270 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16271
16272 * callproc.c: Indentation fixup.
16273
16274 * sysdep.c (wait_for_termination_1): Make static.
16275 (wait_for_termination, interruptible_wait_for_termination):
16276 Move after wait_for_termination_1.
16277
16278 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16279
16280 * sysdep.c (interruptible_wait_for_termination): New function
16281 which is like wait_for_termination, but allows keyboard
16282 interruptions.
16283
16284 * callproc.c (Fcall_process): Add (:file "file") as an option for
16285 the STDOUT buffer.
16286 (Fcall_process_region): Ditto.
16287
16288 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16289
16290 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16291 rather than `XVECTOR (FOO)->size'.
16292
16293 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16294 inttypes.h, as a gnulib replacement is used if it not available in
16295 system headers.
16296
16297 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16298
16299 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16300 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16301 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16302
16303 * coding.c (coding_alloc_by_realloc): Error out if destination
16304 will grow beyond MOST_POSITIVE_FIXNUM.
16305 (decode_coding_emacs_mule): Abort if there isn't enough place in
16306 charbuf for the composition carryover bytes. Reserve an extra
16307 space for up to 2 characters produced in a loop.
16308 (decode_coding_iso_2022): Abort if there isn't enough place in
16309 charbuf for the composition carryover bytes.
16310
16311 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16312
16313 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16314 aborting when %lld or %lll format is passed.
16315 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16316 %llo or %llx format is passed. (Bug#8545)
16317
16318 * window.c (window_scroll_line_based): Use a marker instead of
16319 simple variables to record original value of point. (Bug#7952)
16320
16321 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16322 produced by %s or %c overflows available buffer space. (Bug#8545)
16323
16324 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16325
16326 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16327 (SIZE_MAX): Move defn after all includes, as they might #define it.
16328
16329 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16330
16331 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16332
16333 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16334
16335 * keyboard.c (Qdelayed_warnings_hook): Define.
16336 (command_loop_1): Run `delayed-warnings-hook'
16337 if Vdelayed_warnings_list is non-nil.
16338 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16339 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16340
16341 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16342
16343 * doprnt.c (doprnt): Don't return value smaller than the buffer
16344 size if the message was truncated. (Bug#8545).
16345
16346 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16347
16348 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16349 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16350
16351 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16352
16353 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16354
16355 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16356
16357 * makefile.w32-in: Update dependencies.
16358
16359 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16360
16361 Improve `doprnt' and its usage. (Bug#8545)
16362 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16363 `format_end'. Remove support for %l as a conversion specifier.
16364 Don't use xrealloc. Improve diagnostics when the %l size modifier
16365 is used. Update the commentary.
16366
16367 * eval.c (verror): Simplify calculation of size_t.
16368
16369 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16370 messages.
16371
16372 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16373
16374 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16375 change.
16376
16377 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16378
16379 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16380 This makes this file independent of the recent pseudovector change.
16381
16382 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16383
16384 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16385
16386 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16387 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16388 Remove unused local.
16389 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16390
16391 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16392 GCC 4.6.0 optimizes based on type-based alias analysis.
16393 For example, if b is of type struct buffer * and v of type struct
16394 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16395 != &v->size, and therefore "v->size = 1; b->size = 2; return
16396 v->size;" must therefore return 1. This assumption is incorrect
16397 for Emacs, since it type-puns struct Lisp_Vector * with many other
16398 types. To fix this problem, this patch adds a new type struct
16399 vectorlike_header that documents the constraints on layout of vectors
16400 and pseudovectors, and helps optimizing compilers not get fooled
16401 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16402 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16403 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16404 the size member.
16405 (XSETPVECTYPE): Rewrite in terms of new macro.
16406 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16407 This is a bit clearer, and further avoids the possibility of
16408 undesirable aliasing.
16409 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16410 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16411 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16412 since Lisp_Subr is a special case (no "next" field).
16413 (ASIZE): Now uses header.size rather than size.
16414 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16415 to avoid the hassle of writing XVECTOR (foo)->header.size.
16416 (struct vectorlike_header): New type.
16417 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16418 object, to help avoid aliasing.
16419 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16420 (SUBRP): Likewise, since Lisp_Subr is a special case.
16421 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16422 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16423 (struct Lisp_Hash_Table): Combine first two members into a single
16424 struct vectorlike_header member. All uses of "size" and "next" members
16425 changed to be "header.size" and "header.next".
16426 * buffer.h (struct buffer): Likewise.
16427 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16428 * frame.h (struct frame): Likewise.
16429 * process.h (struct Lisp_Process): Likewise.
16430 * termhooks.h (struct terminal): Likewise.
16431 * window.c (struct save_window_data, struct saved_window): Likewise.
16432 * window.h (struct window): Likewise.
16433 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16434 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16435 * buffer.c (init_buffer_once): Likewise.
16436 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16437 special case.
16438 * process.c (Fformat_network_address): Use local var for size,
16439 for brevity.
16440
16441 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16442
16443 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16444 * data.c (atof): Remove decl; no longer used or needed.
16445 (digit_to_number): Move to lread.c.
16446 (Fstring_to_number): Use new string_to_number function, to be
16447 consistent with how the Lisp reader treats infinities and NaNs.
16448 Do not assume that floating-point numbers represent EMACS_INT
16449 without losing information; this is not true on most 64-bit hosts.
16450 Avoid double-rounding errors, by insisting on integers when
16451 parsing non-base-10 numbers, as the documentation specifies.
16452 * lisp.h (string_to_number): New decl, replacing ...
16453 (isfloat_string): Remove.
16454 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16455 (read1): Do not accept +. and -. as integers; this
16456 appears to have been a coding error. Similarly, do not accept
16457 strings like +-1e0 as floating point numbers. Do not report
16458 overflow for integer overflows unless the base is not 10 which
16459 means we have no simple and reliable way to continue.
16460 Break out the floating-point parsing into a new
16461 function string_to_number, so that Fstring_to_number parses
16462 floating point numbers consistently with the Lisp reader.
16463 (digit_to_number): Move here from data.c. Make it static inline.
16464 (E_CHAR, EXP_INT): Remove, replacing with ...
16465 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16466 (string_to_number): New function, replacing isfloat_string.
16467 This function checks for valid syntax and produces the resulting
16468 Lisp float number too. Rework it so that string-to-number
16469 no longer mishandles examples like "1.0e+". Use strtoumax,
16470 so that overflow for non-base-10 numbers is reported only when
16471 there's no portable and simple way to convert to floating point.
16472
16473 * textprop.c (set_text_properties_1): Rewrite for clarity,
16474 and to avoid GCC warning about integer overflow.
16475
16476 * intervals.h (struct interval): Use EMACS_INT for members
16477 where EMACS_UINT might cause problems. See
16478 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16479 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16480 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16481 All uses changed.
16482 (offset_intervals): Tell GCC not to worry about length overflow
16483 when negating a negative length.
16484
16485 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16486 (overrun_check_free): Likewise.
16487
16488 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16489 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16490 word size.
16491
16492 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16493 (gnutls_make_error): Rename local to avoid shadowing.
16494 (gnutls_emacs_global_deinit): ifdef out; not used.
16495 (Fgnutls_boot): Use const for pointer to readonly storage.
16496 Comment out unused local. Fix pointer signedness problems.
16497
16498 * lread.c (openp): Don't stuff size_t into an 'int'.
16499 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16500 about possible signed overflow.
16501
16502 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16503 (GDK_KEY_g): Don't define if already defined.
16504 (xg_prepare_tooltip): Avoid pointer signedness problem.
16505 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16506
16507 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16508 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16509
16510 * xfns.c (Fx_window_property): Simplify a bit,
16511 to make a bit faster and to avoid GCC 4.6.0 warning.
16512 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16513
16514 * fns.c (internal_equal): Don't assume size_t fits in int.
16515
16516 * alloc.c (compact_small_strings): Tighten assertion a little.
16517
16518 Replace pEd with more-general pI, and fix some printf arg casts.
16519 * lisp.h (pI): New macro, generalizing old pEd macro to other
16520 conversion specifiers. For example, use "...%"pI"d..." rather
16521 than "...%"pEd"...".
16522 (pEd): Remove. All uses replaced with similar uses of pI.
16523 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16524 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16525 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16526 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16527 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16528 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16529 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16530 64-bit hosts.
16531 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16532 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16533 * print.c (safe_debug_print, print_object): Likewise.
16534 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16535 to int.
16536 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16537 avoiding the 0 flag, which is not portable.
16538 * process.c (Fmake_network_process): Use pI to avoid cast.
16539 * region-cache.c (pp_cache): Likewise.
16540 * xdisp.c (decode_mode_spec): Likewise.
16541 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16542 behavior on 64-bit hosts with printf arg.
16543 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16544 (x_stop_queuing_selection_requests): Likewise.
16545 (x_get_window_property): Don't truncate byte count to an 'int'
16546 when tracing.
16547
16548 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16549 here, since it parses constructs like leading '-' and spaces,
16550 which are not wanted; and it overflows with large numbers.
16551 Instead, simply match F[0-9]+, which is what is wanted anyway.
16552
16553 * alloc.c: Remove unportable assumptions about struct layout.
16554 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16555 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16556 (allocate_vectorlike, make_pure_vector): Use the new macros,
16557 plus offsetof, to remove unportable assumptions about struct layout.
16558 These assumptions hold on all porting targets that I know of, but
16559 they are not guaranteed, they're easy to remove, and removing them
16560 makes further changes easier.
16561
16562 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16563 This doesn't fix a bug but makes the code clearer.
16564 (string_overrun_cookie): Now const. Use initializers that
16565 don't formally overflow signed char, to avoid warnings.
16566 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16567 can cause Emacs to crash when string overrun checking is enabled.
16568 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16569 multiple of sizeof (EMACS_INT); it need not be, if
16570 alignof(EMACS_INT) < sizeof (EMACS_INT).
16571 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16572
16573 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16574
16575 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16576
16577 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16578
16579 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16580 supposed to be handshaking. (Bug#8556)
16581 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16582
16583 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16584
16585 * lisp.h (Qdebug): List symbol.
16586 * eval.c (Qdebug): Restore global linkage.
16587 * keyboard.c (debug-on-event): New variable.
16588 (handle_user_signal): Break into debugger when debug-on-event
16589 matches the current signal symbol.
16590
16591 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16592
16593 * alloc.c (check_sblock, check_string_bytes)
16594 (check_string_free_list): Convert to standard C.
16595
16596 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16597
16598 * w32.c (emacs_gnutls_push): Fix typo.
16599
16600 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16601
16602 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16603 "cast to pointer from integer of different size".
16604
16605 Improve doprnt and its use in verror. (Bug#8545)
16606 * doprnt.c (doprnt): Document the set of format control sequences
16607 supported by the function. Use SAFE_ALLOCA instead of always
16608 using `alloca'.
16609
16610 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16611 is one byte too soon. Don't use xrealloc; instead xfree and
16612 xmalloc anew.
16613
16614 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16615
16616 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16617 callbacks stage.
16618
16619 * gnutls.c: Renamed global_initialized to
16620 gnutls_global_initialized. Added internals for the
16621 :verify-hostname-error, :verify-error, and :verify-flags
16622 parameters of `gnutls-boot' and documented those parameters in the
16623 docstring. Start callback support.
16624 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16625 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16626 on error. Return error code.
16627 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16628 (emacs_gnutls_read): Likewise.
16629 (Fgnutls_boot): Return handshake error code.
16630 (emacs_gnutls_handle_error): New function.
16631 (wsaerror_to_errno): Likewise.
16632
16633 * w32.h (emacs_gnutls_pull): Add prototype.
16634 (emacs_gnutls_push): Likewise.
16635
16636 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16637 (emacs_gnutls_push): Likewise.
16638
16639 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16640
16641 * process.c (wait_reading_process_output): Check if GnuTLS
16642 buffered some data internally if no FDs are set for TLS
16643 connections.
16644
16645 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16646 (LIBS): Link to USER_LIBS.
16647 ($(BLD)/gnutls.$(0)): New target.
16648
16649 2011-04-24 Eli Zaretskii <eliz@gnu.org>
16650
16651 * xdisp.c (handle_single_display_spec): Rename the
16652 display_replaced_before_p argument into display_replaced_p, to
16653 make it consistent with the commentary. Fix typos in the
16654 commentary.
16655
16656 * textprop.c (syms_of_textprop): Remove dead code.
16657 (copy_text_properties): Delete obsolete commentary about an
16658 interface that was deleted long ago. Fix typos in the description
16659 of arguments.
16660
16661 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16662 to changes in oldXMenu/XMenu.h from 2011-04-16.
16663 <menu_help_message, prev_menu_help_message>: Constify.
16664 (IT_menu_make_room): menu->help_text is now `const char **';
16665 adjust.
16666
16667 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16668 to changes in oldXMenu/XMenu.h from 2011-04-16.
16669 (struct XMenu): Declare `help_text' `const char **'.
16670
16671 * xfaces.c <Qunspecified>: Make extern again.
16672
16673 * syntax.c: Include sys/types.h before including regex.h, as
16674 required by POSIX.
16675
16676 * doc.c (get_doc_string): Improve the format passed to `error'.
16677
16678 * doprnt.c (doprnt): Improve commentary.
16679
16680 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16681
16682 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16683 them with etags.
16684
16685 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16686 changes in globals.h immediately force recompilation.
16687 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16688 $(CURDIR)/s/ms-w32.h.
16689 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16690
16691 * character.c (Fchar_direction): Function deleted.
16692 (syms_of_character): Don't defsubr it.
16693 <char-direction-table>: Deleted.
16694
16695 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16696
16697 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16698 * doprnt.c: Include limits.h.
16699 (SIZE_MAX): New macro.
16700 (doprnt): Return a size_t value. 2nd arg is now size_t.
16701 Many local variables are now size_t instead of int or unsigned.
16702 Improve overflow protection. Support `l' modifier for integer
16703 conversions. Support %l conversion. Don't assume an EMACS_INT
16704 argument for integer conversions and for %c.
16705
16706 * lisp.h (doprnt): Restore prototype.
16707
16708 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16709 $(SRC)/character.h.
16710
16711 * Makefile.in (base_obj): Add back doprnt.o.
16712
16713 * deps.mk (doprnt.o): Add back prerequisites.
16714 (callint.o): Depend on character.h.
16715
16716 * eval.c (internal_lisp_condition_case): Include the handler
16717 representation in the error message.
16718 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16719 when breaking from the loop.
16720
16721 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16722
16723 * callint.c (Fcall_interactively): When displaying error message
16724 about invalid control letter, pass the character's codepoint, not
16725 a pointer to its multibyte form. Improve display of the character
16726 in octal and display also its hex code.
16727
16728 * character.c (char_string): Use %x to display the (unsigned)
16729 codepoint of an invalid character, to avoid displaying a bogus
16730 negative value.
16731
16732 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16733 `error', not SYMBOL_NAME itself.
16734
16735 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16736 character arguments to `error'.
16737
16738 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16739 to `error' in error message about FINAL_CHAR argument. Make sure
16740 FINAL_CHAR is a character, and use %c when it is passed as
16741 argument to `error'.
16742
16743 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16744
16745 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16746
16747 * w32.c: Include <time.h>.
16748 (sys_localtime): New function.
16749
16750 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
16751
16752 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16753
16754 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16755
16756 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
16757
16758 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16759 zombies (Bug#8467).
16760
16761 2011-04-19 Eli Zaretskii <eliz@gnu.org>
16762
16763 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16764 gl_state.e_property when gl_state.object is Qt.
16765
16766 * insdel.c (make_gap_larger): Remove limitation of buffer size
16767 to <= INT_MAX.
16768
16769 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
16770
16771 * xdisp.c (lookup_glyphless_char_display)
16772 (produce_glyphless_glyph): Handle cons cell entry in
16773 glyphless-char-display.
16774 (Vglyphless_char_display): Document it.
16775
16776 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16777 glyphless-char-display.
16778
16779 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
16780
16781 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16782
16783 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16784
16785 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16786 definition for no-X builds.
16787
16788 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
16789
16790 Static checks with GCC 4.6.0 and non-default toolkits.
16791
16792 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16793
16794 * process.c (keyboard_bit_set): Define only if SIGIO.
16795 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16796 (send_process): Repair possible setjmp clobbering.
16797
16798 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16799
16800 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16801
16802 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16803
16804 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16805 Define only if needed.
16806
16807 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16808 by pacifying GCC about it. Maybe it's time to retire it?
16809 * xfaces.c (USG, __TIMEVAL__): Likewise.
16810
16811 * dispextern.h (struct redisplay_interface): Rename param
16812 to avoid shadowing.
16813 * termhooks.h (struct terminal): Likewise.
16814 * xterm.c (xembed_send_message): Likewise.
16815
16816 * insdel.c (make_gap_smaller): Define only if
16817 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16818
16819 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16820 it.
16821
16822 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16823 so that we aren't warned about unused symbols.
16824
16825 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16826
16827 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16828
16829 * xfns.c (x_real_positions): Mark locals as initialized.
16830
16831 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16832
16833 * xterm.c: Fix problems found by static analysis with other toolkits.
16834 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16835 (x_dispatch_event): Declare static if USE_GTK, and
16836 define if USE_GTK || USE_X_TOOLKIT.
16837 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16838 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16839 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16840 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16841
16842 * xmenu.c (menu_help_callback): Pointer type fixes.
16843 Use const pointers when pointing at readonly data. Avoid pointer
16844 signedness clashes.
16845 (FALSE): Remove unused macro.
16846 (update_frame_menubar): Remove unused decl.
16847
16848 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16849
16850 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16851 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16852 (single_menu_item): Rename local to avoid shadowing.
16853
16854 * keyboard.c (make_lispy_event): Remove unused local var.
16855
16856 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16857 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16858
16859 * bitmaps: Change bitmaps from unsigned char back to the X11
16860 compatible char. Avoid the old compiler warnings about
16861 out-of-range initializers by using, for example, '\xab' rather
16862 than 0xab.
16863
16864 * xgselect.c (xgselect_initialize): Check vs interface
16865 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16866
16867 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16868
16869 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16870 to read-only memory.
16871
16872 * fns.c (vector): Remove; this old hack is no longer needed.
16873
16874 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16875 Remove unused var.
16876 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16877
16878 * xrdb.c (x_load_resources): Omit unused local.
16879
16880 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16881 (x_window): Rename locals to avoid shadowing.
16882 (USG): Use the kludged USG macro, to pacify gcc.
16883
16884 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16885 (x_term_init): Remove local to avoid shadowing.
16886
16887 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16888
16889 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16890 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16891
16892 2011-04-16 Eli Zaretskii <eliz@gnu.org>
16893
16894 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16895
16896 Fix regex.c, syntax.c and friends for buffers > 2GB.
16897 * syntax.h (struct gl_state_s): Declare character position members
16898 EMACS_INT.
16899
16900 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16901
16902 * textprop.c (verify_interval_modification, interval_of):
16903 Declare arguments EMACS_INT.
16904
16905 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16906 EMACS_INT.
16907
16908 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16909
16910 * indent.c (Fvertical_motion): Local variable it_start is now
16911 EMACS_INT.
16912
16913 * regex.c (re_match, re_match_2, re_match_2_internal)
16914 (bcmp_translate, regcomp, regexec, print_double_string)
16915 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16916 (re_compile_pattern, re_exec): Declare arguments and local
16917 variables `size_t' and `ssize_t' and return values `regoff_t', as
16918 appropriate.
16919 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16920 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16921 <compile_stack_type>: `size' and `avail' are now `size_t'.
16922
16923 * regex.h <regoff_t>: Use ssize_t, not int.
16924 (re_search, re_search_2, re_match, re_match_2): Arguments that
16925 specify buffer/string position and length are now ssize_t and
16926 size_t. Return type is regoff_t.
16927
16928 2011-04-16 Ben Key <bkey76@gmail.com>
16929
16930 * nsfont.m: Fixed bugs in ns_get_family and
16931 ns_descriptor_to_entity that were caused by using free to
16932 deallocate memory blocks that were allocated by xmalloc (via
16933 xstrdup). This caused Emacs to crash when compiled with
16934 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16935 --enable-checking=xmallocoverrun). xfree is now used to
16936 deallocate these memory blocks.
16937
16938 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
16939
16940 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16941
16942 emacs_write: Accept and return EMACS_INT for sizes.
16943 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16944 et seq.
16945 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16946 Accept and return EMACS_INT.
16947 (emacs_gnutls_write): Return the number of bytes written on
16948 partial writes.
16949 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16950 (emacs_read, emacs_write): Remove check for negative size, as the
16951 Emacs source code has been audited now.
16952 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16953 (emacs_read, emacs_write): Use it.
16954 * process.c (send_process): Adjust to the new signatures of
16955 emacs_write and emacs_gnutls_write. Do not attempt to store
16956 a byte offset into an 'int'; it might overflow.
16957 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16958
16959 * sound.c: Don't assume sizes fit in 'int'.
16960 (struct sound_device.period_size, alsa_period_size):
16961 Return EMACS_INT, not int.
16962 (struct sound_device.write, vox_write, alsa_write):
16963 Accept EMACS_INT, not int.
16964 (wav_play, au_play): Use EMACS_INT to store sizes and to
16965 record read return values.
16966
16967 2011-04-15 Ben Key <bkey76@gmail.com>
16968
16969 * keyboard.c (Qundefined): Don't declare static since it is used
16970 in nsfns.m.
16971 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16972 static since they are used in nsfont.m.
16973
16974 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16975
16976 * process.c (Qprocessp): Don't declare static.
16977 * lisp.h (Qprocessp): Declare again.
16978
16979 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
16980
16981 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16982
16983 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16984
16985 Improve C-level modularity by making more things 'static'.
16986
16987 Don't publish debugger-only interfaces to other modules.
16988 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16989 (verify_bytepos, count_markers): Move decls to the only modules
16990 that need them.
16991 * region-cache.h (pp_cache): Likewise.
16992 * window.h (check_all_windows): Likewise.
16993 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16994
16995 * sysdep.c (croak): Now static, if
16996 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16997 * syssignal.h (croak): Declare only if not static.
16998
16999 * alloc.c (refill_memory_reserve): Now static if
17000 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17001 * lisp.h (refill_memory_reserve): Declare only if not static.
17002
17003 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17004 Define only if USE_LUCID.
17005
17006 * xrdb.c (x_customization_string, x_rm_string): Now static.
17007
17008 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17009 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17010
17011 * xdisp.c (draw_row_with_mouse_face): Now static.
17012 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17013
17014 * window.h (check_all_windows): Mark externally visible.
17015
17016 * window.c (window_deletion_count): Now static.
17017
17018 * undo.c: Make symbols static if they're not exported.
17019 (last_undo_buffer, last_boundary_position, pending_boundary):
17020 Now static.
17021
17022 * textprop.c (interval_insert_behind_hooks): Now static.
17023 (interval_insert_in_front_hooks): Likewise.
17024
17025 * term.c: Make symbols static if they're not exported.
17026 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17027 (max_frame_lines, tty_set_terminal_modes):
17028 (tty_reset_terminal_modes, tty_turn_off_highlight):
17029 (get_tty_terminal): Now static.
17030 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17031 * termhooks.h (term_mouse_moveto): Do not declare if
17032 HAVE_WINDOW_SYSTEM.
17033 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17034 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17035
17036 * sysdep.c: Make symbols static if they're not exported.
17037 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17038 Now static.
17039 (sigprocmask_set, full_mask): Remove; unused.
17040 (wait_debugging): Mark as visible.
17041 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17042 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17043
17044 * syntax.c (syntax_temp): Define only if !__GNUC__.
17045
17046 * sound.c (current_sound_device, current_sound): Now static.
17047
17048 * search.c (searchbufs, searchbuf_head): Now static.
17049
17050 * scroll.c (scroll_cost): Remove; unused.
17051 * dispextern.h (scroll_cost): Remove decl.
17052
17053 * region-cache.h (pp_cache): Mark as externally visible.
17054
17055 * process.c: Make symbols static if they're not exported.
17056 (process_tick, update_tick, create_process, chan_process):
17057 (Vprocess_alist, proc_buffered_char, datagram_access):
17058 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17059 (deactivate_process): Mark defn as static, as well as decl.
17060 * lisp.h (create_process): Remove decl.
17061 * process.h (chan_process, Vprocess_alist): Remove decls.
17062
17063 * print.c: Make symbols static if they're not exported.
17064 (print_depth, new_backquote_output, being_printed, print_buffer):
17065 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17066 (print_interval, print_number_index, initial_stderr_stream):
17067 Now static.
17068 * lisp.h (Fprinc): Remove decl.
17069 (debug_output_compilation_hack): Mark as externally visible.
17070
17071 * sysdep.c (croak): Move decl from here to syssignal.h.
17072 * syssignal.h (croak): Put it here, so the API can be checked when
17073 'croak' is called from dissociate_if_controlling_tty.
17074
17075 * minibuf.c: Make symbols static if they're not exported.
17076 (minibuf_save_list, choose_minibuf_frame): Now static.
17077 * lisp.h (choose_minibuf_frame): Remove decl.
17078
17079 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17080
17081 * lread.c: Make symbols static if they're not exported.
17082 (read_objects, initial_obarray, oblookup_last_bucket_number):
17083 Now static.
17084 (make_symbol): Remove; unused.
17085 * lisp.h (initial_obarray, make_symbol): Remove decls.
17086
17087 * keyboard.c: Make symbols static if they're not exported.
17088 (single_kboard, recent_keys_index, total_keys, recent_keys):
17089 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17090 (this_single_command_key_start, echoing, last_auto_save):
17091 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17092 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17093 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17094 (Vlispy_mouse_stem, double_click_count):
17095 Now static.
17096 (force_auto_save_soon): Define only if SIGDANGER.
17097 (ignore_mouse_drag_p): Now static if
17098 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17099 (print_help): Remove; unused.
17100 (stop_character, last_timer_event): Mark as externally visible.
17101 * keyboard.h (ignore_mouse_drag_p): Declare only if
17102 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17103 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17104 * lisp.h (echoing): Remove decl.
17105 (force_auto_save_soon): Declare only if SIGDANGER.
17106 * xdisp.c (redisplay_window): Simplify code, to make it more
17107 obvious that ignore_mouse_drag_p is not accessed if !defined
17108 USE_GTK && !defined HAVE_NS.
17109
17110 * intervals.c: Make symbols static if they're not exported.
17111 (merge_properties_sticky, merge_interval_right, delete_interval):
17112 Now static.
17113 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17114
17115 * insdel.c: Make symbols static if they're not exported.
17116 However, leave prepare_to_modify_buffer alone. It's never
17117 called from outside this function, but that appears to be a bug.
17118 (combine_after_change_list, combine_after_change_buffer):
17119 (adjust_after_replace, signal_before_change): Now static.
17120 (adjust_after_replace_noundo): Remove; unused.
17121 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17122 (signal_before_change): Remove decls.
17123
17124 * indent.c (val_compute_motion, val_vmotion): Now static.
17125
17126 * image.c: Make symbols static if they're not exported.
17127 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17128 if USE_GTK.
17129 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17130 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17131
17132 * fringe.c (standard_bitmaps): Now static.
17133 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17134
17135 * frame.c: Make symbols static if they're not exported.
17136 (x_report_frame_params, make_terminal_frame): Now static.
17137 (get_frame_param): Now static, unless HAVE_NS.
17138 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17139 (x_get_resource_string): Remove; not used.
17140 * frame.h (make_terminal_frame, x_report_frame_params):
17141 (x_get_resource_string); Remove decls.
17142 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17143 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17144
17145 * font.c, fontset.c: Make symbols static if they're not exported.
17146 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17147 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17148 * font.c (font_close_object): Now static.
17149 * font.h (font_close_object): Remove.
17150 * fontset.c (FONTSET_OBJLIST): Remove.
17151 (free_realized_fontset) #if-0 the body, which does nothing.
17152 (face_suitable_for_char_p): #if-0, as it's never called.
17153 * fontset.h (face_suitable_for_char_p): Remove decl.
17154 * xfaces.c (face_at_string_position):
17155 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17156 since 0 is always ASCII.
17157
17158 * fns.c (weak_hash_tables): Now static.
17159
17160 * fileio.c: Make symbols static if they're not exported.
17161 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17162 (Vwrite_region_annotation_buffers): Now static.
17163
17164 * eval.c: Make symbols static if they're not exported.
17165 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17166 * lisp.h (backtrace_list): Remove decl.
17167
17168 * emacs.c: Make symbols static if they're not exported.
17169 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17170 (fatal_error_code, fatal_error_signal_hook, standard_args):
17171 Now static.
17172 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17173 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17174 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17175 * lisp.h (fatal_error_signal_hook): Remove decl.
17176 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17177
17178 * editfns.c: Move a (normally-unused) function to its only use.
17179 * editfns.c, lisp.h (get_operating_system_release): Remove.
17180 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17181 worth the hassle of breaking this out.
17182
17183 * xterm.c: Make symbols static if they're not exported.
17184 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17185 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17186 (x_destroy_window, x_delete_display):
17187 Now static.
17188 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17189 (x_mouse_leave): Remove; unused.
17190 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17191 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17192 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17193 Remove decls.
17194 (x_mouse_leave): Declare only if WINDOWSNT.
17195 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17196 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17197 USE_X_TOOLKIT.
17198
17199 * ftxfont.c: Make symbols static if they're not exported.
17200 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17201 HAVE_FREETYPE.
17202 * font.h (ftxfont_driver): Likewise.
17203
17204 * xfns.c: Make symbols static if they're not exported.
17205 (x_last_font_name, x_display_info_for_name):
17206 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17207 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17208 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17209 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17210 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17211 (last_show_tip_args): Now static.
17212 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17213 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17214 (x_screen_planes): Remove; unused.
17215 * dispextern.h (x_screen_planes): Remove decl.
17216
17217 * dispnew.c: Make symbols static if they're not exported.
17218 * dispextern.h (redraw_garbaged_frames, scrolling):
17219 (increment_row_positions): Remove.
17220 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17221 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17222 Now static.
17223 (redraw_garbaged_frames): Remove; unused.
17224
17225 * xfaces.c: Make symbols static if they're not exported.
17226 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17227 Remove decls.
17228 * xterm.h (defined_color): Remove decls.
17229 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17230 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17231 (menu_face_changed_default, defined_color, free_realized_face):
17232 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17233 (ascii_face_of_lisp_face): Remove; unused.
17234
17235 * xdisp.c: Make symbols static if they're not exported.
17236 * dispextern.h (scratch_glyph_row, window_box_edges):
17237 (glyph_to_pixel_coords, set_cursor_from_row):
17238 (get_next_display_element, set_iterator_to_next):
17239 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17240 (show_mouse_face): Remove decls
17241 * frame.h (message_buf_print): Likewise.
17242 * lisp.h (pop_message, set_message, check_point_in_composition):
17243 Likewise.
17244 * xterm.h (set_vertical_scroll_bar): Likewise.
17245 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17246 (message_buf_print, scratch_glyph_row, displayed_buffer):
17247 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17248 (get_next_display_element, show_mouse_face, window_box_edges):
17249 (frame_to_window_pixel_xy, check_point_in_composition):
17250 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17251 (glyph_to_pixel_coords): Remove; unused.
17252
17253 * dired.c (file_name_completion): Now static.
17254
17255 * dbusbind.c (xd_in_read_queued_messages): Now static.
17256
17257 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17258 * data.c (circular_list_error): Remove.
17259
17260 * commands.h (last_point_position, last_point_position_buffer):
17261 (last_point_position_window): Remove decls.
17262 * keyboard.c: Make these variables static.
17263
17264 * coding.h (coding, code_convert_region, encode_coding_gap):
17265 Remove decls.
17266 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17267 (iso_code_class, detect_coding, code_convert_region): Now static.
17268 (encode_coding_gap): Remove; unused.
17269
17270 * chartab.c (chartab_chars, chartab_bits): Now static.
17271
17272 * charset.h (charset_iso_8859_1): Remove decl.
17273 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17274 Now static.
17275
17276 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17277 * ccl.c (Vccl_program_table): Now static.
17278 (check_ccl_update): Remove; unused.
17279
17280 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17281 * category.h: ... from here.
17282 * category.c (check_category_table, set_category_set): Now static.
17283
17284 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17285 * lisp.h: Remove these decls.
17286
17287 * buffer.c (buffer_count): Remove unused var.
17288
17289 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17290 so that it's not optimized away.
17291 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17292 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17293 exported only to the debugger.
17294
17295 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17296 * atimer.h (run_all_atimers): Remove; not exported.
17297
17298 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17299 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17300 was inaccessible from Lisp.
17301 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17302 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17303
17304 alloc.c: Import and export fewer symbols, and remove unused items.
17305 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17306 is defined.
17307 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17308 it's not optimized away by whole-program optimization.
17309 (message_enable_multibyte, free_misc): Remove.
17310 (catchlist, handlerlist, mark_backtrace):
17311 Declare only if BYTE_MARK_STACK.
17312 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17313 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17314 (message_enable_multibyte): Remove decl.
17315 (free_misc, interval_free_list, float_block, float_block_index):
17316 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17317 (cons_free_list, last_marked_index):
17318 Now static.
17319 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17320 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17321 (mark_backtrace): Define only if BYTE_MARK_STACK.
17322 * xdisp.c (message_enable_multibyte): Now static.
17323
17324 Declare Lisp_Object Q* variables to be 'static' if not exported.
17325 This makes it easier for human readers (and static analyzers)
17326 to see whether these variables are used from other modules.
17327 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17328 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17329 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17330 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17331 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17332 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17333 * xmenu.c, xselect.c:
17334 Declare Q* vars static if they are not used in other modules.
17335 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17336 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17337 Remove decls of unexported vars.
17338 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17339
17340 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17341
17342 Make Emacs functions such as Fatom 'static' by default.
17343 This makes it easier for human readers (and static analyzers)
17344 to see whether these functions can be called from other modules.
17345 DEFUN now defines a static function. To make the function external
17346 so that it can be used in other C modules, use the new macro DEFUE.
17347 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17348 (Finit_image_library):
17349 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17350 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17351 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17352 Remove decls, since these functions are now static.
17353 (Funintern, Fget_internal_run_time): New decls, since these functions
17354 were already external.
17355
17356 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17357 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17358 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17359 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17360 * keyboard.c, keymap.c, lread.c:
17361 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17362 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17363 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17364 Mark functions with DEFUE instead of DEFUN,
17365 if they are used in other modules.
17366 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17367 decls for now-static functions.
17368 * buffer.h (Fdelete_overlay): Remove decl.
17369 * callproc.c (Fgetenv_internal): Mark as internal.
17370 * composite.c (Fremove_list_of_text_properties): Remove decl.
17371 (Fcomposition_get_gstring): New forward static decl.
17372 * composite.h (Fcomposite_get_gstring): Remove decl.
17373 * dired.c (Ffile_attributes): New forward static decl.
17374 * doc.c (Fdocumntation_property): New forward static decl.
17375 * eval.c (Ffetch_bytecode): New forward static decl.
17376 (Funintern): Remove extern decl; now in .h file where it belongs.
17377 * fileio.c (Fmake_symbolic_link): New forward static decl.
17378 * image.c (Finit_image_library): New forward static decl.
17379 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17380 * intervals.h (Fprevious_property_change):
17381 (Fremove_list_of_text_properties): Remove decls.
17382 * keyboard.c (Fthis_command_keys): Remove decl.
17383 (Fcommand_execute): New forward static decl.
17384 * keymap.c (Flookup_key): New forward static decl.
17385 (Fcopy_keymap): Now static.
17386 * keymap.h (Flookup_key): Remove decl.
17387 * process.c (Fget_process): New forward static decl.
17388 (Fprocess_datagram_address): Mark as internal.
17389 * syntax.c (Fsyntax_table_p): New forward static decl.
17390 (skip_chars): Remove duplicate decl.
17391 * textprop.c (Fprevious_property_change): New forward static decl.
17392 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17393 Now internal.
17394 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17395 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17396
17397 * editfns.c (Fformat): Remove unreachable code.
17398
17399 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17400
17401 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17402 change. (Bug#8496)
17403
17404 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17405
17406 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17407 when at ZV. (Bug#8487)
17408
17409 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17410
17411 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17412 (Bug#8437)
17413 * keyboard.c (parse_tool_bar_item): Likewise.
17414 * sound.c (sound_cleanup, alsa_close): Likewise.
17415 * termcap.c (tgetent): Likewise.
17416 * xfns.c (x_default_font_parameter): Likewise.
17417 * xsettings.c (read_and_apply_settings): Likewise.
17418
17419 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17420 (overrun_check_free): Protoize.
17421
17422 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17423
17424 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17425 since callers should never pass a negative size.
17426 Change the signature to match that of plain 'read' and 'write'; see
17427 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17428 * lisp.h: Update prototypes of emacs_write and emacs_read.
17429
17430 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17431
17432 * xdisp.c (redisplay_window): Don't try to determine the character
17433 position of the scroll margin if the window start point w->startp
17434 is outside the buffer's accessible region. (Bug#8468)
17435
17436 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17437
17438 Fix write-region and its subroutines for buffers > 2GB.
17439 * fileio.c (a_write, e_write): Modify declaration of arguments and
17440 local variables to support buffers larger than 2GB.
17441 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17442
17443 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17444 argument, local variables, and return value.
17445
17446 * lisp.h: Update prototypes of emacs_write and emacs_read.
17447
17448 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17449
17450 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17451
17452 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17453
17454 Fix more problems found by GCC 4.6.0's static checks.
17455
17456 * xdisp.c (vmessage): Use a better test for character truncation.
17457
17458 * charset.c (load_charset_map): <, not <=, for optimization,
17459 and to avoid potential problems with integer overflow.
17460 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17461 * casetab.c (set_identity, shuffle): Likewise.
17462 * editfns.c (Fformat): Likewise.
17463 * syntax.c (skip_chars): Likewise.
17464
17465 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17466 This also lets GCC 4.6.0 generate slightly better loop code.
17467
17468 * callint.c (Fcall_interactively): <, not <=, for optimization.
17469 (Fcall_interactively): Count the number of arguments produced,
17470 not the number of arguments given. This is simpler and lets GCC
17471 4.6.0 generate slightly better code.
17472
17473 * ftfont.c: Distingish more carefully between FcChar8 and char.
17474 The previous code passed unsigned char * to a functions like
17475 strlen and xstrcasecmp that expect char *, which does not
17476 conform to the C standard.
17477 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17478 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17479 char * when the C standard requires it.
17480
17481 * keyboard.c (read_char): Remove unused var.
17482
17483 * eval.c: Port to Windows vsnprintf (Bug#8435).
17484 Include <limits.h>.
17485 (SIZE_MAX): Define if the headers do not.
17486 (verror): Do not give up if vsnprintf returns a negative count.
17487 Instead, grow the buffer. This ports to Windows vsnprintf, which
17488 does not conform to C99. Problem reported by Eli Zaretskii.
17489 Also, simplify the allocation scheme, by avoiding the need for
17490 calling realloc, and removing the ALLOCATED variable.
17491
17492 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17493
17494 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17495 But keep the doprint source code for now, as we might revamp it
17496 and use it again (Bug#8435).
17497 * lisp.h (doprnt): Remove.
17498 * Makefile.in (base_obj): Remove doprnt.o.
17499 * deps.mk (doprnt.o): Remove.
17500
17501 error: Print 32- and 64-bit integers portably (Bug#8435).
17502 Without this change, on typical 64-bit hosts error ("...%d...", N)
17503 was used to print both 32- and 64-bit integers N, which relied on
17504 undefined behavior.
17505 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17506 * lisp.h (error, verror): Mark as printf-like functions.
17507 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17508 Report overflow in size calculations when allocating printf buffer.
17509 Do not truncate output string at its first null byte.
17510 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17511 Truncate the output at a character boundary, since vsnprintf does not
17512 do that.
17513 * charset.c (check_iso_charset_parameter): Convert internal
17514 character to string before calling 'error', since %c now has the
17515 printf meaning.
17516 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17517 overflow when computing char to be passed to 'error'. Do not
17518 pass Lisp_Object to 'error'; pass the integer instead.
17519 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17520 formatted with plain %d.
17521
17522 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17523
17524 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17525
17526 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17527
17528 * xterm.c (x_catch_errors): Remove duplicate declaration.
17529
17530 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17531
17532 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17533
17534 2011-04-10 Jim Meyering <meyering@redhat.com>
17535
17536 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17537 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17538 return ssize_t not "int", and use size_t as the buffer length.
17539 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17540 * gnutls.h: Update declarations.
17541 * process.c (read_process_output): Use ssize_t, to match.
17542 (send_process): Likewise.
17543
17544 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17545
17546 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17547
17548 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17549
17550 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17551 Use unsigned char, to match FcChar8 type definition.
17552
17553 * xterm.c (handle_one_xevent):
17554 * xmenu.c (create_and_show_popup_menu):
17555 * xselect.c (x_decline_selection_request)
17556 (x_reply_selection_request): Avoid type-punned deref of X events.
17557
17558 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17559
17560 Fix some uses of `int' instead of EMACS_INT.
17561 * search.c (string_match_1, fast_string_match)
17562 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17563 (scan_buffer, find_next_newline_no_quit)
17564 (find_before_next_newline, search_command, Freplace_match)
17565 (Fmatch_data): Make some `int' variables be EMACS_INT.
17566
17567 * xdisp.c (display_count_lines): 3rd argument and return value now
17568 EMACS_INT. All callers changed.
17569 (pint2hrstr): Last argument is now EMACS_INT.
17570
17571 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17572 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17573 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17574 (decode_coding_utf_16, decode_coding_emacs_mule)
17575 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17576 (decode_coding_ccl, decode_coding_charset)
17577 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17578 (decode_coding_iso_2022, decode_coding_emacs_mule)
17579 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17580 <char_offset, last_offset>: Declare EMACS_INT.
17581 (encode_coding_utf_8, encode_coding_utf_16)
17582 (encode_coding_emacs_mule, encode_invocation_designation)
17583 (encode_designation_at_bol, encode_coding_iso_2022)
17584 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17585 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17586 Declare EMACS_INT.
17587 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17588 (encode_invocation_designation): Last argument P_NCHARS is now
17589 EMACS_INT.
17590 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17591 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17592
17593 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17594 All users changed.
17595
17596 * ccl.c (Fccl_execute_on_string): Declare some variables
17597 EMACS_INT.
17598
17599 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17600
17601 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17602
17603 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17604
17605 * process.c (Fformat_network_address): Doc fix.
17606
17607 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17608
17609 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17610
17611 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
17612
17613 * keyboard.c (read_char): Call Lisp function help-form-show,
17614 instead of using internal_with_output_to_temp_buffer.
17615 (Qhelp_form_show): New var.
17616 (syms_of_keyboard): Use DEFSYM macro.
17617
17618 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17619
17620 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17621
17622 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
17623
17624 * process.c (Flist_processes): Remove to Lisp.
17625 (list_processes_1): Delete.
17626
17627 2011-04-06 Eli Zaretskii <eliz@gnu.org>
17628
17629 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17630
17631 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17632
17633 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
17634
17635 Fix more problems found by GCC 4.6.0's static checks.
17636
17637 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17638
17639 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17640
17641 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17642
17643 * xdisp.c (vmessage): Mark as a printf-like function.
17644
17645 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17646
17647 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17648
17649 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17650 printf-like functions.
17651 (tiff_load): Add casts to remove these marks before passing them
17652 to system-supplied API.
17653
17654 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17655
17656 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17657 This avoids several warnings with gcc -Wstrict-overflow.
17658 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17659 directly, rather than having caller test rule sign. This avoids
17660 some unnecessary tests.
17661 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17662 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17663 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17664
17665 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17666 (xfont_open): Avoid unnecessary tests.
17667
17668 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17669
17670 * composite.h, composite.c (composition_gstring_put_cache):
17671 Use EMACS_INT, not int, for length.
17672
17673 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17674 breaking out part of COMPOSITION_DECODE_RULE.
17675 (COMPOSITION_DECODE_RULE): Use it.
17676 * composite.c (get_composition_id): Remove unused local vars,
17677 by using the new macro.
17678
17679 * textprop.c (set_text_properties_1): Change while to do-while,
17680 since the condition is always true at first.
17681
17682 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17683 (interval_deletion_adjustment): Return unsigned value.
17684 All uses changed.
17685
17686 * process.c (list_processes_1, create_pty, read_process_output):
17687 (exec_sentinel): Remove vars that were set but not used.
17688 (create_pty): Remove unnecessary "volatile"s.
17689 (Fnetwork_interface_info): Avoid possibility of int overflow.
17690 (read_process_output): Do adaptive read buffering even if carryover.
17691 (read_process_output): Simplify nbytes computation if buffered.
17692
17693 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17694
17695 * syntax.c (scan_words): Remove var that was set but not used.
17696 (update_syntax_table): Use unsigned instead of int.
17697
17698 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17699 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17700 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17701
17702 * print.c (print_error_message): Avoid int overflow.
17703
17704 * font.c (font_list_entities): Redo for clarity,
17705 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17706
17707 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17708 (font_score): Avoid potential overflow in diff calculation.
17709
17710 * fns.c (substring_both): Remove var that is set but not used.
17711 (sxhash): Redo loop for clarity and to avoid wraparound warning.
17712
17713 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17714
17715 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17716 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17717 can always succeed if overflow has undefined behavior.
17718
17719 * search.c (boyer_moore, wordify): Remove vars set but not used.
17720 (wordify): Omit three unnecessary tests.
17721
17722 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17723 All callers changed. This avoids the need for an unused var.
17724
17725 * casefiddle.c (casify_region): Remove var that is set but not used.
17726
17727 * dired.c (file_name_completion): Remove var that is set but not used.
17728
17729 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17730
17731 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17732 (Finsert_file_contents): Remove unnecessary code checking fd.
17733
17734 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17735 Check for integer overflow on size calculations.
17736
17737 * buffer.c (Fprevious_overlay_change): Remove var that is set
17738 but not used.
17739
17740 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17741 Remove vars that are set but not used.
17742 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17743 (timer_check_2): Mark vars as initialized.
17744
17745 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17746
17747 * image.c (lookup_image): Remove var that is set but not used.
17748 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17749
17750 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17751 that are set but not used.
17752
17753 * xfns.c (make_invisible_cursor): Don't return garbage
17754 if XCreateBitmapFromData fails (Bug#8410).
17755
17756 * xselect.c (x_get_local_selection, x_handle_property_notify):
17757 Remove vars that are set but not used.
17758
17759 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17760 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17761
17762 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17763 Remove var that is set but not used.
17764 (scroll_bar_windows_size): Now size_t, not int.
17765 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17766 Check for overflow.
17767
17768 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17769 (map_tty_color) [!defined MSDOS]: Likewise.
17770
17771 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17772
17773 * coding.c: Remove vars that are set but not used.
17774 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17775 All callers changed.
17776 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17777 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17778 (decode_coding_charset): Remove vars that are set but not used.
17779
17780 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17781 that is set but not used.
17782
17783 * print.c (print_object): Remove var that is set but not used.
17784
17785 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17786 The gnulib version avoids calling malloc in the usual case,
17787 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17788 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17789 * filelock.c (current_lock_owner): Likewise.
17790 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17791 * sysdep.c: Include allocator.h, careadlinkat.h.
17792 (emacs_no_realloc_allocator): New static constant.
17793 (emacs_readlink): New function.
17794 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17795 ../lib/careadlinkat.h.
17796
17797 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17798
17799 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17800 first non-nil return value).
17801
17802 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17803
17804 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17805 if not defined (Bug#8403).
17806
17807 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17808
17809 * xdisp.c (display_count_lines): Remove parameter `start',
17810 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17811 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17812 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17813 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17814 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17815 and thereabouts. All callers changed.
17816 (get_per_char_metric): Remove parameter `f', unused since
17817 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17818
17819 2011-04-02 Jim Meyering <meyering@redhat.com>
17820
17821 do not dereference NULL upon failed strdup
17822 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17823 (ns_get_family): Likewise.
17824
17825 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17826
17827 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17828
17829 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17830
17831 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17832 later (Bug#8403).
17833
17834 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17835
17836 Add lexical binding.
17837
17838 * window.c (Ftemp_output_buffer_show): New fun.
17839 (Fsave_window_excursion):
17840 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17841
17842 * lread.c (lisp_file_lexically_bound_p): New function.
17843 (Fload): Bind Qlexical_binding.
17844 (readevalloop): Remove `evalfun' arg.
17845 Bind Qinternal_interpreter_environment.
17846 (Feval_buffer): Bind Qlexical_binding.
17847 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17848 Mark as dynamic.
17849 (syms_of_lread): Declare `lexical-binding'.
17850
17851 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17852
17853 * keyboard.c (eval_dyn): New fun.
17854 (menu_item_eval_property): Use it.
17855
17856 * image.c (parse_image_spec): Use Ffunctionp.
17857
17858 * fns.c (concat, mapcar1): Accept byte-code-functions.
17859
17860 * eval.c (Fsetq): Handle lexical vars.
17861 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17862 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17863 (FletX, Flet): Obey lexical binding.
17864 (Fcommandp): Handle closures.
17865 (Feval): New `lexical' arg.
17866 (eval_sub): New function extracted from Feval. Use it almost
17867 everywhere where Feval was used. Look up vars in lexical env.
17868 Handle closures.
17869 (Ffunctionp): Move from subr.el.
17870 (Ffuncall): Handle closures.
17871 (apply_lambda): Remove `eval_flags'.
17872 (funcall_lambda): Handle closures and new byte-code-functions.
17873 (Fspecial_variable_p): New function.
17874 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17875 but without exporting it to Lisp.
17876
17877 * doc.c (Fdocumentation, store_function_docstring):
17878 * data.c (Finteractive_form): Handle closures.
17879
17880 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17881 interactive spec.
17882
17883 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17884 New byte-codes.
17885 (exec_byte_code): New function extracted from Fbyte_code to handle new
17886 calling convention for byte-code-functions. Add new byte-codes.
17887
17888 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17889
17890 * alloc.c (Fmake_symbol): Init new `declared_special' field.
17891
17892 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17893
17894 * xdisp.c (redisplay_internal): Fix prototype.
17895
17896 2011-03-31 Eli Zaretskii <eliz@gnu.org>
17897
17898 * xdisp.c (SCROLL_LIMIT): New macro.
17899 (try_scrolling): Use it when setting scroll_limit.
17900 Limit scrolling to 100 screen lines.
17901 (redisplay_window): Even when falling back on "recentering",
17902 position point in the window according to scroll-conservatively,
17903 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17904
17905 (try_scrolling): When point is above the window, allow searching
17906 as far as scroll_max, or one screenful, to compute vertical
17907 distance from PT to the scroll margin position. This prevents
17908 try_scrolling from unnecessarily failing when
17909 scroll-conservatively is set to a value slightly larger than the
17910 window height. Clean up the case of PT below the margin at bottom
17911 of window: scroll_max can no longer be INT_MAX. When aggressive
17912 scrolling is in use, don't let point enter the opposite scroll
17913 margin as result of the scroll.
17914 (syms_of_xdisp) <scroll-conservatively>: Document the
17915 threshold of 100 lines for never-recentering scrolling.
17916
17917 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17918
17919 * dispextern.h (move_it_by_lines):
17920 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17921 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17922 (message_log_check_duplicate): Remove parameters `prev_bol' and
17923 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17924 (redisplay_internal): Remove parameter `preserve_echo_area',
17925 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17926
17927 * indent.c (Fvertical_motion):
17928 * window.c (window_scroll_pixel_based, Frecenter):
17929 Don't pass `need_y_p' to `move_it_by_lines'.
17930
17931 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17932
17933 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17934 steal a few bits to be more compact.
17935 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17936 Remove unneeded casts.
17937
17938 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17939
17940 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17941
17942 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17943 binding" message (bug#7967).
17944
17945 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17946
17947 Fix more problems found by GCC 4.6.0's static checks.
17948
17949 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17950 Remove unused local var.
17951
17952 * editfns.c (Fmessage_box): Remove unused local var.
17953
17954 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17955 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17956 Omit unused local vars.
17957 * window.c (shrink_windows): Omit unused local var.
17958 * menu.c (digest_single_submenu): Omit unused local var.
17959 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17960 Omit unused local var.
17961
17962 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17963 Don't assume string length fits in int.
17964 (keyremap_step, read_key_sequence): Use size_t for sizes.
17965 (read_key_sequence): Don't check last_real_key_start redundantly.
17966
17967 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17968 instead of alloca (Bug#8344).
17969
17970 * eval.c (Fbacktrace): Don't assume nargs fits in int.
17971 (Fbacktrace_frame): Don't assume nframes fits in int.
17972
17973 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17974
17975 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17976 concerns.
17977
17978 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17979
17980 * cm.c (calccost): Turn while-do into do-while, for clarity.
17981
17982 * keyboard.c (syms_of_keyboard): Use the same style as later
17983 in this function when indexing through an array. This also
17984 works around GCC bug 48267.
17985
17986 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17987
17988 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17989
17990 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17991 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17992
17993 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17994 This avoids undefined behavior on integer overflow, and is a bit
17995 more convenient anyway since it is compared to a size_t variable.
17996
17997 Variadic C functions now count arguments with size_t, not int.
17998 This avoids an unnecessary limitation on 64-bit machines, which
17999 caused (substring ...) to crash on large vectors (Bug#8344).
18000 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18001 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18002 All variadic functions and their callers changed accordingly.
18003 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18004 * data.c (arith_driver, float_arith_driver): Likewise.
18005 * editfns.c (general_insert_function): Likewise.
18006 * eval.c (struct backtrace.nargs, interactive_p)
18007 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18008 (funcall_lambda, mark_backtrace): Likewise.
18009 * fns.c (concat): Likewise.
18010 * frame.c (x_set_frame_parameters): Likewise.
18011 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18012 0 if not found, not -1. All callers changed.
18013
18014 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18015 (stack_copy_size): Now size_t, not int.
18016 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18017
18018 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18019
18020 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18021 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18022 All callers changed.
18023
18024 * lisp.h (multibyte_char_to_unibyte):
18025 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18026 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18027 * character.h (CHAR_TO_BYTE8):
18028 * cmds.c (internal_self_insert):
18029 * editfns.c (general_insert_function):
18030 * keymap.c (push_key_description):
18031 * search.c (Freplace_match):
18032 * xdisp.c (message_dolog, set_message_1): All callers changed.
18033
18034 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18035
18036 * keyboard.c (safe_run_hook_funcall): New function.
18037 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18038 don't set the hook to nil, but remove the offending function instead.
18039 (Qcommand_hook_internal): Remove, unused.
18040 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18041 Vcommand_hook_internal.
18042
18043 * eval.c (enum run_hooks_condition): Remove.
18044 (funcall_nil, funcall_not): New functions.
18045 (run_hook_with_args): Call each function through a `funcall' argument.
18046 Remove `cond' argument, now redundant.
18047 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18048 (Frun_hook_with_args_until_failure): Adjust accordingly.
18049 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18050
18051 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18052
18053 * dispextern.h (string_buffer_position): Remove declaration.
18054
18055 * print.c (strout): Remove parameter `multibyte', unused since
18056 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18057
18058 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18059 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18060 All callers changed.
18061
18062 * w32.c (_wsa_errlist): Use braces for struct initializers.
18063
18064 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18065 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18066 All callers changed.
18067 (string_buffer_position): Likewise. Also, make static (it's never
18068 used outside xdisp.c).
18069 (cursor_row_p): Remove parameter `w', unused since
18070 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18071 (decode_mode_spec): Remove parameter `precision', introduced during
18072 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18073 All callers changed.
18074
18075 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18076
18077 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18078
18079 2011-03-27 Anders Lindgren <andlind@gmail.com>
18080
18081 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18082 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18083 (ns_update_auto_hide_menu_bar): New functions.
18084 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18085 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18086 ns_constrain_all_frames.
18087 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18088 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18089
18090 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18091
18092 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18093
18094 2011-03-27 Glenn Morris <rgm@gnu.org>
18095
18096 * syssignal.h: Replace RETSIGTYPE with void.
18097 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18098 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18099 Replace SIGTYPE with void everywhere.
18100 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18101 * s/template.h (SIGTYPE): Remove commented out definition.
18102
18103 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18104
18105 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18106 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18107
18108 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18109
18110 * w32.c (read_unc_volume): Use parameter `henum', instead of
18111 global variable `wget_enum_handle'.
18112
18113 * keymap.c (describe_vector): Remove parameters `indices' and
18114 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18115 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18116
18117 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18118
18119 * keyboard.c (timer_check): Remove parameter `do_it_now',
18120 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18121 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18122 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18123
18124 * keyboard.c (read_char):
18125 * w32menu.c (w32_menu_display_help):
18126 * xmenu.c (show_help_event, menu_help_callback):
18127 Adjust calls to `show_help_echo'.
18128
18129 * gtkutil.c (xg_maybe_add_timer):
18130 * keyboard.c (readable_events):
18131 * process.c (wait_reading_process_output):
18132 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18133
18134 * insdel.c (adjust_markers_gap_motion):
18135 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18136 (gap_left, gap_right): Don't call it.
18137
18138 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18139
18140 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18141 incurred during fontification.
18142
18143 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18144
18145 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18146 (DEFVAR_PER_BUFFER): Don't pass it.
18147
18148 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18149 (scrolling_window): Don't pass it.
18150
18151 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18152
18153 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18154
18155 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18156 and `suffix'.
18157 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18158 of variables specific to SELinux and computation of `encoded_absname'.
18159
18160 * image.c (XPutPixel): Remove unused variable `height'.
18161
18162 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18163
18164 * unexw32.c (get_section_info): Remove unused variable `section'.
18165
18166 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18167 (system_process_attributes): Remove unused variable `sess'.
18168 (sys_read): Remove unused variable `err'.
18169
18170 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18171 (w32_wnd_proc): Remove unused variable `isdead'.
18172 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18173 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18174 (x_create_tip_frame): Remove unused variable `tem'.
18175
18176 * w32inevt.c (w32_console_read_socket):
18177 Remove unused variable `no_events'.
18178
18179 * w32term.c (x_draw_composite_glyph_string_foreground):
18180 Remove unused variable `width'.
18181
18182 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18183
18184 * w32term.c (x_set_glyph_string_clipping):
18185 Don't pass uninitialized region to CombineRgn.
18186
18187 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18188
18189 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18190 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18191 (Fx_close_connection): Remove unused variable `i'.
18192
18193 * w32font.c (w32font_draw): Return number of glyphs.
18194 (w32font_open_internal): Remove unused variable `i'.
18195 (w32font_driver): Add missing initializer.
18196
18197 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18198 (fill_in_menu): Remove unused variable `items_added'.
18199
18200 * w32term.c (last_mouse_press_frame): Remove static global variable.
18201 (w32_clip_to_row): Remove unused variable `f'.
18202 (x_delete_terminal): Remove unused variable `i'.
18203
18204 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18205 (NOTHING): Remove unused static global variable.
18206 (uniscribe_check_otf): Remove unused variable `table'.
18207 (uniscribe_font_driver): Add missing initializers.
18208
18209 2011-03-23 Julien Danjou <julien@danjou.info>
18210
18211 * term.c (Fsuspend_tty, Fresume_tty):
18212 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18213 * window.c (temp_output_buffer_show):
18214 * insdel.c (signal_before_change):
18215 * frame.c (Fhandle_switch_frame):
18216 * fileio.c (Fdo_auto_save):
18217 * emacs.c (Fkill_emacs):
18218 * editfns.c (save_excursion_restore):
18219 * cmds.c (internal_self_insert):
18220 * callint.c (Fcall_interactively):
18221 * buffer.c (Fkill_all_local_variables):
18222 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18223 Use Frun_hooks.
18224 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18225 unconditionally since it does the check itself.
18226
18227 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18228
18229 Fix more problems found by GCC 4.5.2's static checks.
18230
18231 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18232 the first time through the loop, since we know p0 < p1 then.
18233 This also avoids a gcc -Wstrict-overflow warning.
18234
18235 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18236 leading to a memory leak, possible in functions like
18237 load_charset_map_from_file that can allocate an unbounded number
18238 of objects (Bug#8318).
18239
18240 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18241 that could (at least in theory) be that large.
18242
18243 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18244 This is less likely to overflow, and avoids undefined behavior if
18245 overflow does occur. All callers changed. Use strtoul to scan
18246 for the unsigned long integer.
18247 (pint2hrstr): Simplify and tune code slightly.
18248 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18249
18250 * scroll.c (do_scrolling): Work around GCC bug 48228.
18251 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18252
18253 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18254 This also avoids a warning with gcc -Wstrict-overflow.
18255 (validate_x_resource_name): Simplify count usage.
18256 This also avoids a warning with gcc -Wstrict-overflow.
18257
18258 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18259 fail (Bug#8306).
18260
18261 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18262
18263 * process.c (Fmake_network_process): Use socklen_t, not int,
18264 where POSIX says socklen_t is required in portable programs.
18265 This fixes a porting bug on hosts like 64-bit HP-UX, where
18266 socklen_t is wider than int (Bug#8277).
18267 (Fmake_network_process, server_accept_connection):
18268 (wait_reading_process_output, read_process_output):
18269 Likewise.
18270
18271 * process.c: Rename or move locals to avoid shadowing.
18272 (list_processes_1, Fmake_network_process):
18273 (read_process_output_error_handler, exec_sentinel_error_handler):
18274 Rename or move locals.
18275 (Fmake_network_process): Define label "retry_connect" only if needed.
18276 (Fnetwork_interface_info): Fix pointer signedness.
18277 (process_send_signal): Add cast to avoid pointer signedness problem.
18278 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18279 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18280
18281 Make tparam.h and terminfo.c consistent.
18282 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18283 Include tparam.h instead, since it declares them.
18284 * cm.h (PC): Remove extern decl; tparam.h now does this.
18285 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18286 * terminfo.c: Include tparam.h, to check interfaces.
18287 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18288 (tparam): Adjust signature to match interface in tparam.h;
18289 this removes some undefined behavior. Check that outstring and len
18290 are zero, which they always are with Emacs.
18291 * tparam.h (PC, BC, UP): New extern decls.
18292
18293 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18294 (xftfont_open): Rename locals to avoid shadowing.
18295
18296 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18297 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18298 (OTF_TAG_SYM): Omit macro if not needed.
18299 (ftfont_list): Remove unused local.
18300 (get_adstyle_property, ftfont_pattern_entity):
18301 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18302 Rename locals to avoid shadowing.
18303
18304 * xfont.c (xfont_list_family): Mark var as initialized.
18305
18306 * xml.c (make_dom): Now static.
18307
18308 * composite.c (composition_compute_stop_pos): Rename local to
18309 avoid shadowing.
18310 (composition_reseat_it): Remove unused locals.
18311 (find_automatic_composition, composition_adjust_point): Likewise.
18312 (composition_update_it): Mark var as initialized.
18313 (find_automatic_composition): Mark vars as initialized,
18314 with a FIXME (Bug#8290).
18315
18316 character.h: Rename locals to avoid shadowing.
18317 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18318 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18319 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18320 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18321 to avoid shadowing.
18322
18323 * textprop.c (property_change_between_p): Remove; unused.
18324
18325 * intervals.c (interval_start_pos): Now static.
18326
18327 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18328
18329 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18330 Rename locals to avoid shadowing.
18331
18332 * sound.c (wav_play, au_play, Fplay_sound_internal):
18333 Fix pointer signedness.
18334 (alsa_choose_format): Remove unused local var.
18335 (wav_play): Initialize a variable to 0, to prevent undefined
18336 behavior (Bug#8278).
18337
18338 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18339
18340 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18341
18342 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18343 clobbering (Bug#8298).
18344 * sysdep.c (sys_subshell): Likewise.
18345 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18346
18347 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18348 This should get cleaned up, so that child_setup has the
18349 same signature on all platforms.
18350
18351 * callproc.c (call_process_cleanup): Now static.
18352 (relocate_fd): Rename locals to avoid shadowing.
18353
18354 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18355
18356 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18357 not to be necessary, and produces flickering.
18358
18359 2011-03-20 Glenn Morris <rgm@gnu.org>
18360
18361 * config.in: Remove file.
18362
18363 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18364
18365 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18366 are now in src/globals.h.
18367 (syms_of_minibuf): Remove spurious & from previous change.
18368
18369 2011-03-20 Leo Liu <sdl.web@gmail.com>
18370
18371 * minibuf.c (completing-read-function): New variable.
18372 (completing-read-default): Rename from completing-read.
18373 (completing-read): Call completing-read-function.
18374
18375 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18376
18377 * xfaces.c (Fx_load_color_file):
18378 Read color file from absolute filename (bug#8250).
18379
18380 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18381
18382 * makefile.w32-in: Update dependencies.
18383
18384 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18385
18386 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18387
18388 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18389
18390 Fix more problems found by GCC 4.5.2's static checks.
18391
18392 * process.c (make_serial_process_unwind, send_process_trap):
18393 (sigchld_handler): Now static.
18394
18395 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18396 That way, the code declares only the vars that it needs.
18397 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18398 * s/cygwin.h (PTY_ITERATION): Likewise.
18399 * s/darwin.h (PTY_ITERATION): Likewise.
18400 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18401
18402 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18403 * process.c (allocate_pty): Don't declare stb unless it's needed.
18404
18405 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18406 (CONSTANTLIM): Remove; unused.
18407 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18408 Define only if needed.
18409
18410 * unexelf.c (unexec): Name an expression,
18411 to avoid gcc -Wbad-function-cast warning.
18412 Use a different way to cause a compilation error if anyone uses
18413 n rather than nn, a way that does not involve shadowing.
18414 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18415
18416 * deps.mk (unexalpha.o): Remove; unused.
18417
18418 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18419 * unexec.h: New file.
18420 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18421 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18422 Depend on unexec.h.
18423 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18424 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18425 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18426 Change as necessary to match prototype in unexec.h.
18427
18428 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18429 shadowing.
18430 (back_comment, skip_chars): Mark vars as initialized.
18431
18432 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18433 Rename locals to avoid shadowing.
18434
18435 * lread.c (read1): Rewrite so as not to use empty "else".
18436 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18437
18438 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18439
18440 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18441 warning when compiling print.c.
18442
18443 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18444 instead of using an uninitialized var.
18445 (font_sort_entities): Mark var as initialized.
18446
18447 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18448
18449 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18450 pointers to constants.
18451 (font_parse_fcname): Remove unused vars.
18452 (font_delete_unmatched): Now static.
18453 (font_get_spec): Remove; unused.
18454 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18455 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18456 Rename or move locals to avoid shadowing.
18457
18458 * fns.c (require_nesting_list, require_unwind): Now static.
18459 (Ffillarray): Rename locals to avoid shadowing.
18460
18461 * floatfns.c (domain_error2): Define only if needed.
18462 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18463
18464 * alloc.c (mark_backtrace): Move decl from here ...
18465 * lisp.h: ... to here, so that it can be checked.
18466
18467 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18468 (Fdefvar): Rewrite so as not to use empty "else".
18469 (lisp_indirect_variable): Name an expression,
18470 to avoid gcc -Wbad-function-cast warning.
18471 (Fdefvar): Rename locals to avoid shadowing.
18472
18473 * callint.c (quotify_arg, quotify_args): Now static.
18474 (Fcall_interactively): Rename locals to avoid shadowing.
18475 Use const pointer when appropriate.
18476
18477 * lisp.h (get_system_name, get_operating_system_release):
18478 Move decls here, to check interfaces.
18479 * process.c (get_operating_system_release): Move decl to lisp.h.
18480 * xrdb.c (get_system_name): Likewise.
18481 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18482 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18483 some of which prompt warnings from gcc -Wbad-function-cast.
18484 (Fformat_time_string, Fencode_time, Finsert_char):
18485 (Ftranslate_region_internal, Fformat):
18486 Rename or remove local vars to avoid shadowing.
18487 (Ftranslate_region_internal): Mark var as initialized.
18488
18489 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18490 avoid shadowing.
18491
18492 * lisp.h (eassert): Check that the argument compiles, even if
18493 ENABLE_CHECKING is not defined.
18494
18495 * data.c (Findirect_variable): Name an expression, to avoid
18496 gcc -Wbad-function-cast warning.
18497 (default_value, arithcompare, arith_driver, arith_error): Now static.
18498 (store_symval_forwarding): Rename local to avoid shadowing.
18499 (Fmake_variable_buffer_local, Fmake_local_variable):
18500 Mark variables as initialized.
18501 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18502
18503 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18504 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18505 Rename locals to avoid shadowing.
18506 (mark_stack): Move local variables into the #ifdef region where
18507 they're used.
18508 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18509 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18510 needed otherwise.
18511 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18512 (GC_STRING_CHARS): Remove; not used.
18513 (Fmemory_limit): Cast sbrk's returned value to char *.
18514
18515 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18516 avoids undefined behavior in theory.
18517
18518 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18519
18520 Use functions, not macros, for up- and down-casing (Bug#8254).
18521 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18522 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18523 to use the following functions instead of these macros.
18524 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18525 EMACS_INT, since callers assume the returned value fits in int.
18526 (upcase1): Likewise, for UPCASE_TABLE.
18527 (uppercasep, lowercasep, upcase): New static inline functions.
18528 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18529 the race-condition problem in the old DOWNCASE.
18530
18531 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18532 Rename locals to avoid shadowing.
18533 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18534 (regex_compile, re_search_2, re_match_2_internal):
18535 Remove unused local vars.
18536 (FREE_VAR): Rewrite so as not to use empty "else",
18537 which gcc can warn about.
18538 (regex_compile, re_match_2_internal): Mark locals as initialized.
18539 (RETALLOC_IF): Define only if needed.
18540 (WORDCHAR_P): Likewise. This one is never needed, but is used
18541 only in a comment talking about a compiler bug, so put inside
18542 the #if 0 of that comment.
18543 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18544 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18545 Remove; unused.
18546
18547 * search.c (boyer_moore): Rename locals to avoid shadowing.
18548 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18549 (PREV_CHAR_BOUNDARY): Likewise.
18550
18551 * search.c (simple_search): Remove unused var.
18552
18553 * dired.c (compile_pattern): Move decl from here ...
18554 * lisp.h: ... to here, so that it can be checked.
18555 (struct re_registers): New forward decl.
18556
18557 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18558
18559 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18560 All uses changed.
18561 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18562 Rename locals to avoid shadowing.
18563 (Fvertical_motion): Mark locals as initialized.
18564
18565 * casefiddle.c (casify_object, casify_region): Now static.
18566 (casify_region): Mark local as initialized.
18567
18568 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18569
18570 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18571 New macros, so that the caller can use some names other than
18572 gcpro1, gcpro2, etc.
18573 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18574 of the new macros.
18575 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18576 argument, for consistency with GCPRO2_VAR, etc: it is now the
18577 prefix of the variable, not the variable itself. All uses
18578 changed.
18579 * dired.c (directory_files_internal, file_name_completion):
18580 Rename locals to avoid shadowing.
18581
18582 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18583 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18584 dired.c's scmp function, had undefined behavior.
18585 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18586 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18587 * buffer.h: ... to here, because these macros use current_buffer,
18588 and the new implementation with inline functions needs to have
18589 current_buffer in scope now, rather than later when the macros
18590 are used.
18591 (downcase, upcase1): New static inline functions.
18592 (DOWNCASE, UPCASE1): Reimplement using these functions.
18593 This avoids undefined behavior in expressions like
18594 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18595 from race conditions in accessing the global variables
18596 case_temp1 and case_temp2.
18597 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18598 * lisp.h (case_temp1, case_temp2): Remove their decls.
18599 * character.h (ASCII_CHAR_P): Move from here ...
18600 * lisp.h: ... to here, so that the inline functions mentioned
18601 above can use them.
18602
18603 * dired.c (directory_files_internal_unwind): Now static.
18604
18605 * fileio.c (file_name_as_directory, directory_file_name):
18606 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18607 Now static.
18608 (file_name_as_directory): Use const pointers when appropriate.
18609 (Fexpand_file_name): Likewise. In particular, newdir might
18610 point at constant storage, so make it a const pointer.
18611 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18612 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18613 signedness issues.
18614 (Fset_file_times, Finsert_file_contents, auto_save_error):
18615 Rename locals to avoid shadowing.
18616
18617 * minibuf.c (choose_minibuf_frame_1): Now static.
18618 (Ftry_completion, Fall_completions): Rename or remove locals
18619 to avoid shadowing.
18620
18621 * marker.c (bytepos_to_charpos): Remove; unused.
18622
18623 * lisp.h (verify_bytepos, count_markers): New decls,
18624 so that gcc does not warn that these functions aren't declared.
18625
18626 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18627 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18628 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18629 (copy_text): Remove unused local var.
18630
18631 * filelock.c (within_one_second): Now static.
18632 (lock_file_1): Rename local to avoid shadowing.
18633
18634 * buffer.c (fix_overlays_before): Mark locals as initialized.
18635 (fix_start_end_in_overlays): Likewise. This function should be
18636 simplified by using pointers-to-pointers, but that's a different
18637 matter.
18638 (switch_to_buffer_1): Now static.
18639 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18640 (report_overlay_modification): Rename locals to avoid shadowing.
18641
18642 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18643 Fix pointer signedness issue.
18644 (sys_subshell): Mark local as volatile if checking for lint,
18645 to suppress a gcc -Wclobbered warning that does not seem to be right.
18646 (MAXPATHLEN): Define only if needed.
18647
18648 * process.c (serial_open, serial_configure): Move decls from here ...
18649 * systty.h: ... to here, so that they can be checked.
18650
18651 * fns.c (get_random, seed_random): Move extern decls from here ...
18652 * lisp.h: ... to here, so that they can be checked.
18653
18654 * sysdep.c (reset_io): Now static.
18655 (wait_for_termination_signal): Remove; unused.
18656
18657 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18658 (copy_keymap_item, append_key, push_text_char_description):
18659 Now static.
18660 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18661 (DENSE_TABLE_SIZE): Remove; unused.
18662 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18663 (describe_map_tree):
18664 Rename locals to avoid shadowing.
18665
18666 * keyboard.c: Declare functions static if they are not used elsewhere.
18667 (echo_char, echo_dash, cmd_error, top_level_2):
18668 (poll_for_input, handle_async_input): Now static.
18669 (read_char, kbd_buffer_get_event, make_lispy_position):
18670 (make_lispy_event, make_lispy_movement, apply_modifiers):
18671 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18672 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18673 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18674 (read_key_sequence, read_char): Mark locals as initialized.
18675 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18676
18677 * keyboard.h (make_ctrl_char): New decl.
18678 (mark_kboards): Move decl here ...
18679 * alloc.c (mark_kboards): ... from here.
18680
18681 * lisp.h (force_auto_save_soon): New decl.
18682
18683 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18684 (DEFINE_DUMMY_FUNCTION): New macro.
18685 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18686 Use it.
18687 (main): Add casts to avoid warnings
18688 if GCC considers string literals to be constants.
18689
18690 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18691
18692 * dbusbind.c: Pointer signedness fixes.
18693 (xd_signature, xd_append_arg, xd_initialize):
18694 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18695 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18696 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18697 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18698
18699 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18700 if GCC considers string literals to be constants.
18701 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18702
18703 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18704
18705 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18706 (print_preprocess, print_object): New macro to fix last change.
18707
18708 * print.c (print_preprocess): Don't forget font objects.
18709
18710 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
18711
18712 * emacs.c (USAGE3): Doc fixes.
18713
18714 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18715
18716 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18717 structure.
18718
18719 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
18720
18721 * lisp.h (VWindow_system, Qfile_name_history):
18722 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18723 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18724 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18725
18726 * w32select.c: Don't #include "keyboard.h".
18727 (run_protected): Add extern declaration for waiting_for_input.
18728
18729 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18730 * w32console.c (detect_input_pending, read_input_pending)
18731 (encode_terminal_code):
18732 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18733 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18734 (w32_system_caret_y, Qfile_name_history):
18735 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18736 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18737 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18738 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18739 * w32proc.c (Qlocal, report_file_error):
18740 * w32term.c (Vwindow_system, updating_frame):
18741 * w32uniscribe.c (initialized, uniscribe_font_driver):
18742 Remove unneeded extern declarations.
18743
18744 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
18745
18746 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18747
18748 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
18749
18750 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18751 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18752 These macros can no longer be used for assignment.
18753
18754 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18755 Assign struct members directly, instead of using BUF_BEGV etc.
18756 (record_buffer_markers, fetch_buffer_markers): New functions for
18757 recording and fetching special buffer markers.
18758 (set_buffer_internal_1, set_buffer_temp): Use them.
18759
18760 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18761
18762 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18763
18764 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18765 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18766
18767 * xdisp.c (hscroll_window_tree):
18768 (reconsider_clip_changes): Use PT instead of BUF_PT.
18769
18770 2011-03-13 Eli Zaretskii <eliz@gnu.org>
18771
18772 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18773 $(EMACS_ROOT)/lib/intprops.h.
18774
18775 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18776
18777 Fix more problems found by GCC 4.5.2's static checks.
18778
18779 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18780 to unsigned char * to avoid compiler diagnostic.
18781 (xg_free_frame_widgets): Make it clear that a local variable is
18782 needed only if USE_GTK_TOOLTIP.
18783 (gdk_window_get_screen): Make it clear that this macro is needed
18784 only if USE_GTK_TOOLTIP.
18785 (int_gtk_range_get_value): New function, which avoids a diagnostic
18786 from gcc -Wbad-function-cast.
18787 (xg_set_toolkit_scroll_bar_thumb): Use it.
18788 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18789 diagnostic from gcc -Wbad-function-cast.
18790 (get_utf8_string, xg_get_file_with_chooser):
18791 Rename locals to avoid shadowing.
18792 (create_dialog): Move locals to avoid shadowing.
18793
18794 * xgselect.c (xg_select): Remove unused var.
18795
18796 * image.c (four_corners_best): Mark locals as initialized.
18797 (gif_load): Initialize transparent_p to zero (Bug#8238).
18798 Mark another local as initialized.
18799 (my_png_error, my_error_exit): Mark with NO_RETURN.
18800
18801 * image.c (clear_image_cache): Now static.
18802 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18803 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18804 (x_edge_detection): Remove unnecessary cast that
18805 gcc -Wbad-function-cast diagnoses.
18806 (gif_load): Fix pointer signedness.
18807 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18808 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18809
18810 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18811
18812 Improve quality of tests for time stamp overflow.
18813 For example, without this patch (encode-time 0 0 0 1 1
18814 1152921504606846976) returns the obviously-bogus value (-948597
18815 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18816 reports time overflow. See
18817 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18818 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18819 * editfns.c: Include limits.h and intprops.h.
18820 (TIME_T_MIN, TIME_T_MAX): New macros.
18821 (time_overflow): Move earlier, to before first use.
18822 (hi_time, lo_time): New functions, for an accurate test for
18823 out-of-range times.
18824 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18825 (Fget_internal_run_time): Don't assume time_t fits in int.
18826 (make_time): Use list2 instead of Fcons twice.
18827 (Fdecode_time): More accurate test for out-of-range times.
18828 (check_tm_member): New function.
18829 (Fencode_time): Use it, to test for out-of-range times.
18830 (lisp_time_argument): Don't rely on undefined left-shift and
18831 right-shift behavior when checking for time stamp overflow.
18832
18833 * editfns.c (time_overflow): New function, refactoring common code.
18834 (Fformat_time_string, Fdecode_time, Fencode_time):
18835 (Fcurrent_time_string): Use it.
18836
18837 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18838 * dired.c (make_time): Move to ...
18839 * editfns.c (make_time): ... here.
18840 * systime.h: Note the move.
18841
18842 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18843
18844 * fringe.c (update_window_fringes): Remove unused variables.
18845
18846 * unexmacosx.c (copy_data_segment): Also copy __got section.
18847 (Bug#8223)
18848
18849 2011-03-12 Eli Zaretskii <eliz@gnu.org>
18850
18851 * termcap.c [MSDOS]: Include "msdos.h".
18852 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18853 Constify `char *' arguments and their references according to
18854 prototypes in tparam.h.
18855
18856 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18857
18858 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18859 Adapt all references accordingly.
18860
18861 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18862
18863 2011-03-11 Tom Tromey <tromey@redhat.com>
18864
18865 * buffer.c (syms_of_buffer): Remove obsolete comment.
18866
18867 2011-03-11 Eli Zaretskii <eliz@gnu.org>
18868
18869 * termhooks.h (encode_terminal_code): Declare prototype.
18870
18871 * msdos.c (encode_terminal_code): Don't declare prototype.
18872
18873 * term.c (encode_terminal_code): Now external again, used by
18874 w32console.c and msdos.c.
18875
18876 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18877 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18878
18879 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
18880
18881 Fix some minor problems found by GCC 4.5.2's static checks.
18882
18883 * fringe.c (update_window_fringes): Mark locals as initialized
18884 (Bug#8227).
18885 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18886
18887 * alloc.c (mark_fringe_data): Move decl from here ...
18888 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18889 to check its interface.
18890 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18891
18892 * fontset.c (free_realized_fontset): Now static.
18893 (Fset_fontset_font): Rename local to avoid shadowing.
18894 (fontset_font): Mark local as initialized.
18895 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18896
18897 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18898
18899 * xselect.c (x_disown_buffer_selections): Remove; not used.
18900 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18901 (x_own_selection, Fx_disown_selection_internal): Rename locals
18902 to avoid shadowing.
18903 (x_handle_dnd_message): Remove local to avoid shadowing.
18904
18905 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18906 so that the caller can use some name other than gcpro1.
18907 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18908 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18909 (Fx_backspace_delete_keys_p):
18910 Use them to avoid shadowing, and rename vars to avoid shadowing.
18911 (x_decode_color, x_set_name, x_window): Now static.
18912 (Fx_create_frame): Add braces to silence GCC warning.
18913 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18914 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18915 Remove unused locals.
18916 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18917 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18918 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18919 macros.
18920
18921 * xterm.h (x_mouse_leave): New decl.
18922
18923 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18924 Remove unused functions.
18925 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18926 (x_calc_absolute_position): Now static.
18927 (XTread_socket): Don't define label "out" unless it's used.
18928 Don't declare local "event" unless it's used.
18929 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18930 unless they are used.
18931 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18932 (x_fatal_error_signal): Remove; not used.
18933 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18934 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18935 (x_error_catcher, x_connection_closed, x_error_handler):
18936 (x_error_quitter, xembed_send_message, x_iconify_frame):
18937 (my_log_handler): Rename locals to avoid shadowing.
18938 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18939 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18940
18941 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18942 Rename or move locals to avoid shadowing.
18943 (tty_defined_color, merge_face_heights): Now static.
18944 (free_realized_faces_for_fontset): Remove; not used.
18945 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18946 does not deduce is never used uninitialized.
18947 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18948 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18949
18950 * terminal.c (store_terminal_param): Now static.
18951
18952 * xmenu.c (menu_highlight_callback): Now static.
18953 (set_frame_menubar): Remove unused local.
18954 (xmenu_show): Rename parameter to avoid shadowing.
18955 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18956 since they might point to immutable storage.
18957 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18958 since it's unused otherwise.
18959
18960 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18961 Add a FIXME, since the code still doesn't look right. (Bug#8215)
18962 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18963 avoids a gcc -Wuninitialized diagnostic.
18964 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18965 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18966 does not deduce are never used uninitialized.
18967
18968 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18969
18970 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18971 * window.c (window_loop, size_window):
18972 (run_window_configuration_change_hook, enlarge_window): Likewise.
18973
18974 * window.c (display_buffer): Now static.
18975 (size_window): Mark variables that gcc -Wuninitialized
18976 does not deduce are never used uninitialized.
18977 * window.h (check_all_windows): New decl, to forestall
18978 gcc -Wmissing-prototypes diagnostic.
18979 * dispextern.h (bidi_dump_cached_states): Likewise.
18980
18981 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18982 shadowing.
18983 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18984 Include <limits.h>.
18985 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18986 and to avoid gcc -Wuninitialized warning.
18987 (load_charset_map): Mark variables that gcc -Wuninitialized
18988 does not deduce are never used uninitialized.
18989 (load_charset): Abort instead of using uninitialized var (Bug#8229).
18990
18991 * coding.c (coding_set_source, coding_set_destination):
18992 Use "else { /* comment */ }" rather than "else /* comment */;"
18993 for clarity, and to avoid gcc -Wempty-body warning.
18994 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18995 a block, when the outer 'i' will do.
18996 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18997 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18998 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18999 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19000 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19001 Rename locals to avoid shadowing.
19002 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19003 * coding.c (emacs_mule_char, encode_invocation_designation):
19004 Now static, since they're not used elsewhere.
19005 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19006 (decode_coding_object, encode_coding_object, detect_coding_system):
19007 (decode_coding_emacs_mule): Mark variables that gcc
19008 -Wuninitialized does not deduce are never used uninitialized.
19009 (detect_coding_iso_2022): Initialize a local variable that might
19010 be used uninitialized. Leave a FIXME because it's not clear that
19011 this initialization is needed. (Bug#8211)
19012 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19013 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19014 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19015 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19016 Remove unused macros.
19017
19018 * category.c (hash_get_category_set): Remove unused local var.
19019 (copy_category_table): Now static, since it's not used elsewhere.
19020 * character.c (string_count_byte8): Likewise.
19021
19022 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19023 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19024
19025 * chartab.c (copy_sub_char_table): Now static, since it's not used
19026 elsewhere.
19027 (sub_char_table_ref_and_range, char_table_ref_and_range):
19028 Rename locals to avoid shadowing.
19029 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19030
19031 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19032 (BIDI_BOB): Remove unused macro.
19033
19034 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19035 deduce are never used uninitialized.
19036 * term.c (encode_terminal_code): Likewise.
19037
19038 * term.c (encode_terminal_code): Now static. Remove unused local.
19039
19040 * tparam.h: New file.
19041 * term.c, tparam.h: Include it.
19042 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19043 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19044 Move these decls to tparam.h, and make them agree with what
19045 is actually in tparam.c. The previous trick of using incompatible
19046 decls in different modules does not conform to the C standard.
19047 All callers of tparam changed to use tparam's actual API.
19048 * tparam.c (tparam1, tparam, tgoto):
19049 Use const pointers where appropriate.
19050
19051 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19052 * cm.h (struct cm): Likewise.
19053 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19054 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19055 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19056 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19057 (turn_on_face, init_tty): Likewise.
19058 * termchar.h (struct tty_display_info): Likewise.
19059
19060 * term.c (term_mouse_position): Rename local to avoid shadowing.
19061
19062 * alloc.c (mark_ttys): Move decl from here ...
19063 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19064
19065 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19066
19067 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19068
19069 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19070
19071 * search.c (compile_pattern_1): Remove argument regp, unused since
19072 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19073 (compile_pattern): Don't pass it.
19074
19075 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19076
19077 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19078 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19079 for ! HAVE_GTK3.
19080 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19081
19082 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19083
19084 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19085 gdk_window_get_screen, gdk_window_get_geometry,
19086 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19087 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19088 (xg_get_pixbuf_from_pixmap): New function.
19089 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19090 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19091 Call xg_get_pixbuf_from_pixmap instead of
19092 gdk_pixbuf_get_from_drawable.
19093 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19094 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19095 (xg_check_special_colors): Use GtkStyleContext and its functions
19096 for HAVE_GTK3.
19097 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19098 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19099 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19100 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19101 Call gtk_widget_get_preferred_size.
19102 (xg_frame_resized): gdk_window_get_geometry only takes 5
19103 parameters.
19104 (xg_win_to_widget, xg_event_is_for_menubar):
19105 Call gdk_x11_window_lookup_for_display.
19106 (xg_set_widget_bg): New function.
19107 (delete_cb): New function.
19108 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19109 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19110 (xg_set_background_color): Call xg_set_widget_bg.
19111 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19112 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19113 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19114 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19115 if ! HAVE_GTK3.
19116 (update_frame_tool_bar): Call gtk_widget_hide.
19117 (xg_initialize): Use GDK_KEY_g.
19118
19119 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19120 if ! HAVE_GTK3
19121 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19122
19123 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19124 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19125 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19126
19127 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19128
19129 * w32xfns.c (select_palette): Check success of RealizePalette against
19130 GDI_ERROR, not zero.
19131
19132 See ChangeLog.11 for earlier changes.
19133
19134 ;; Local Variables:
19135 ;; coding: utf-8
19136 ;; End:
19137
19138 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19139
19140 This file is part of GNU Emacs.
19141
19142 GNU Emacs is free software: you can redistribute it and/or modify
19143 it under the terms of the GNU General Public License as published by
19144 the Free Software Foundation, either version 3 of the License, or
19145 (at your option) any later version.
19146
19147 GNU Emacs is distributed in the hope that it will be useful,
19148 but WITHOUT ANY WARRANTY; without even the implied warranty of
19149 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19150 GNU General Public License for more details.
19151
19152 You should have received a copy of the GNU General Public License
19153 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.