merge trunk
[bpt/emacs.git] / src / ChangeLog
CommitLineData
537f336d
JD
12012-10-13 Jan Djärv <jan.h.d@swipnet.se>
2
3 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4
0ba06a77
KH
52012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
6
7 * coding.c (detect_coding): Set coding->id before calling
8 this->detector.
9
ce2fe65a
AS
102012-10-13 Andreas Schwab <schwab@linux-m68k.org>
11
12 * fileio.c: Formatting fixes.
13
d6453ce4
PE
142012-10-13 Paul Eggert <eggert@cs.ucla.edu>
15
16 Fix some stat-related races.
17 * fileio.c (Fwrite_region): Avoid race condition if a file is
18 removed or renamed by some other process immediately after Emacs
19 writes it but before Emacs stats it. Do not assume that stat (or
20 fstat) succeeds.
21 * image.c (slurp_file): Resolve the file name with fopen + fstat
22 rather than stat + fopen.
23 (pbm_read_file) [0]: Remove unused code with stat race.
24 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
25 Remove ineffective code with stat race.
26
06485aa8
SM
272012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
28
29 * doc.c (get_doc_string): Don't signal an error if the file is missing.
30
167e3640
JD
312012-10-12 Jan Djärv <jan.h.d@swipnet.se>
32
33 * nsterm.m (hold_event_q): New static variable.
34 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
35 ! q_event_ptr.
36 (hold_event): New function.
37 (ns_read_socket): If hold_event_q have events, store them and
38 return (Bug#12384).
39 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
40 is zero (Bug#12384).
41
c40239df
JB
422012-10-12 Juanma Barranquero <lekktu@gmail.com>
43
44 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
45
bb385a92
EZ
462012-10-12 Eli Zaretskii <eliz@gnu.org>
47
2a9f1099
EZ
48 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
49
bb385a92
EZ
50 * fileio.c (check_existing): New function.
51 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
52 instead of calling 'stat', when what's needed is to check whether
53 a file exists. This avoids expensive system calls on MS-Windows.
54 (Bug#12587)
55
56 * w32.c (init_environment): Call 'check_existing' instead of
57 'stat'.
58
59 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
60 determine whether a file exists and is not a directory.
61
62 * lisp.h (check_existing): Add prototype.
63
2b9c2e68
JD
642012-10-12 Jan Djärv <jan.h.d@swipnet.se>
65
66 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
67
81749a23
GM
682012-10-12 Glenn Morris <rgm@gnu.org>
69
70 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
71
5253a5fd
SM
722012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
73
389a94a5
SM
74 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
75
5253a5fd
SM
76 * eval.c (Fautoload): Remember previous autoload status in load-history.
77
7cded46f
PE
782012-10-11 Paul Eggert <eggert@cs.ucla.edu>
79
80 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
81 * lread.c (load_each_byte, new_backquote_flag, readchar)
82 (read_filtered_event, lisp_file_lexically_bound_p)
83 (safe_to_load_version, Fload, complete_filename_p, openp)
84 (build_load_history, readevalloop, read_escape, read1)
85 (string_to_number, read_vector, read_list):
86 * macros.c (Fstart_kbd_macro):
87 * marker.c (CONSIDER):
88 * menu.c (parse_single_submenu, digest_single_submenu)
89 (find_and_return_menu_selection, Fx_popup_menu):
90 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
91 (Ftry_completion):
92 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
93 (ns_menu_show):
94 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
95 (xmenu_show, xdialog_show):
96 Use bool for booleans.
97 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
98 as it's not a predicate. All uses changed. Omit unnecessary
99 buffer termination.
100
549c3414
DA
1012012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
102
103 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
104 (save_excursion_restore): Do not restore mark if it was not saved.
105
e85aafe7
PE
1062012-10-11 Paul Eggert <eggert@cs.ucla.edu>
107
fd2f90cf
PE
108 * marker.c (cached_modiff): EMACS_INT, not int.
109
c1af190b
PE
110 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
111 instead of having a wrong decl.
e85aafe7
PE
112 * nsmenu.m (waiting_for_input): Remove wrong decl.
113
e738ca56
PE
1142012-10-10 Paul Eggert <eggert@cs.ucla.edu>
115
9fa1de30
PE
116 keyboard.c, keymap.c: Use bool for booleans.
117 * dispnew.c (sit_for): Distinguish between 3-way display_option
118 and boolean do_display.
119 * keyboard.c (single_kboard, this_command_key_count_reset)
120 (waiting_for_input, echoing, immediate_quit, input_pending)
121 (interrupt_input, interrupts_deferred, pop_kboard)
122 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
123 (command_loop_1, adjust_point_for_property)
124 (safe_run_hooks_error, input_polling_used, read_char):
125 (help_char_p, readable_events, kbd_buffer_events_waiting)
126 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
127 (lucid_event_type_list_p, get_input_pending):
128 (gobble_input, menu_separator_name_p, menu_bar_item)
129 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
130 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
131 (keyremap_step, test_undefined, read_key_sequence)
132 (detect_input_pending, detect_input_pending_ignore_squeezables)
133 (detect_input_pending_run_timers, requeued_events_pending_p)
134 (quit_throw_to_read_char, Fset_input_interrupt_mode):
135 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
136 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
137 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
138 (accessible_keymaps_1, Fkey_description, push_key_description):
139 (shadow_lookup, struct where_is_internal_data)
140 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
141 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
142 (describe_map, describe_vector):
143 * menu.c (single_menu_item):
144 * nsmenu.m (ns_update_menubar):
145 * process.c (wait_reading_process_output):
146 * search.c (scan_buffer, scan_newline):
147 Use bool for boolean.
148 * keyboard.c (timers_run, swallow_events)
149 (detect_input_pending_run_timers):
150 * process.c (wait_reading_process_output):
151 Use unsigned for counter where wraparound-on-overflow is desired,
152 since unsigned is guaranteed to have that behavior and signed is not.
153 (read_char): Use ptrdiff_t for string length.
154 (get_input_pending): Remove first argument, since it was always
155 the same pointer-to-int (now pointer-to-boolean) &input_pending,
156 and behave as if it had that value. Return new value of
157 input_pending. All callers changed.
158 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
159 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
160 a string length.
161 * keymap.c (push_key_description): Omit last arg, which was always 1.
162 All callers changed.
163
e738ca56
PE
164 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
165
29f21cdf
JB
1662012-10-10 Juanma Barranquero <lekktu@gmail.com>
167
168 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
169 ($(BLD)/term.$(O)): Update dependencies.
170
6aea7528
DA
1712012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
172
173 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
174 * lisp.h (enum pvec_type): Adjust comments and omit explicit
175 initializer for PVEC_NORMAL_VECTOR.
176
5f3f57be
PE
1772012-10-10 Paul Eggert <eggert@cs.ucla.edu>
178
179 Clean out old termopts cruft.
180 * termopts.h (flow_control, meta_key): Remove unused decls.
181 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
182 Don't include termopts.h.
183
3e98c68e
DA
1842012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
185
186 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
187
77e344e5
PE
1882012-10-10 Paul Eggert <eggert@cs.ucla.edu>
189
190 * commands.h (immediate_quit): Remove duplicate decl.
191
5683d7cd
JD
1922012-10-09 Jan Djärv <jan.h.d@swipnet.se>
193
194 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
195 caching.
196 (nsfont_open): Remove setting of Vfonts_in_cache.
197 (syms_of_nsfont): Remove initialization of Vfonts_in_cache
198
cf5fc6db
EZ
1992012-10-09 Eli Zaretskii <eliz@gnu.org>
200
b15736e6
EZ
201 * w32fns.c (w32_last_error): Change the return value to DWORD, to
202 match what GetLastError returns. Explain why the function is
203 needed.
204
cf5fc6db
EZ
205 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
206 'is_tooltip_frame', to avoid confusion with its global namesake.
207
f99714ce
DC
2082012-10-08 Daniel Colascione <dancol@dancol.org>
209
210 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
211 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
212 build that caused Emacs to display the hourglass cursor forever.
f99714ce 213
fd59cb29
GM
214 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
215 which is broken under remote desktop, calculate the number of
216 colors available for a display based on the display's number of
217 planes and number of bits per pixel per plane. (bug#10397).
218
62c480c9 2192012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 220
62c480c9
JD
221 * nsfont.m (Vfonts_in_cache): New variable.
222 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
223 are used. Add cached fonts to Vfonts_in_cache.
224 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
225
607446ba
JB
2262012-10-08 Juanma Barranquero <lekktu@gmail.com>
227
fd5125ad
JB
228 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
229 in nt/config.nt.
46979e0b
JB
230 (FONT_H): Define after FRAME_H.
231 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
232 Update dependencies.
fd5125ad 233
607446ba
JB
234 * w32term.c: Remove leftover declaration of keyboard_codepage.
235
b6f4e300
EZ
2362012-10-08 Eli Zaretskii <eliz@gnu.org>
237
c54ebba4
EZ
238 * makefile.w32-in (FONT_H): Add $(FRAME_H).
239 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
240 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
241 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
242 ($(BLD)/unexw32.$(O)):
243 ($(BLD)/w32.$(O)):
244 ($(BLD)/w32console.$(O)):
245 ($(BLD)/w32fns.$(O)):
246 ($(BLD)/w32heap.$(O)):
247 ($(BLD)/w32menu.$(O)):
15c720a3 248 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 249
b6f4e300
EZ
250 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
251 'const char *'.
252 (x_to_w32_color): Don't modify the argument, modify a copy instead.
253
501199a3
DC
2542012-10-08 Daniel Colascione <dancol@dancol.org>
255
256 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
257 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
258 accidental message numbering hole. Change other messages to
259 match.
260
261 * w32select.h (HAVE_W32SELECT): Remove.
262
263 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
264 w32common.h instead of w32heap.h
265
266 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
267 (get_allocation_unit, get_processor_type, get_w32_major_version)
268 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
269 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
270 (OS_NT, os_subtype, cache_system_info): Move declarations to
271 w32common.
272
273 * w32heap.c: Include w32common.h.
274 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
275 (w32_minor_version, w32_build_number, w32_subtype): Remove
276 duplicate definitions.
277
278 * w32fns.c: Include w32common.h; include w32heap.h only in
279 WINDOWSNT.
280
281 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
282 Use `report_file_error' instead of `error' in order to better
283 inform users of what went wrong. Increase NTGUI_UNICODE file
284 dialog box file name length to 32k, the maximum allowed by the NT
285 kernel.
286
287 * w32common.h: New file.
288 (ROUND_UP, ROUND_DOWN, get_page_size)
289 (get_allocation_unit, get_processor_type, get_w32_major_version)
290 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
291 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
292 (OS_NT, os_subtype, cache_system_info): Move here.
293
294 * unexw32.c, unexcw.c: Include w32common.h.
295
296 * emacs.c (main): Use (defined (WINDOWSNT) || defined
297 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
298 to call syms_of_w32select.
299
300 * cygw32.h: Remove obsolete EXFUN declarations.
301
302 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
303
304 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
305 of w32inevt.o from SOME_MACHINE_OBJECTS.
306
93aa5c81
DC
3072012-10-08 Daniel Colascione <dancol@dancol.org>
308
309 * image.c: Permanent fix for JPEG compilation issue --- limit
310 jpeglib `boolean' redefinition to Cygwin builds.
311
d424f3d8
EZ
3122012-10-08 Eli Zaretskii <eliz@gnu.org>
313
8ee4c6ce
EZ
314 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
315
d424f3d8
EZ
316 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
317 Cygwin.
318
e08348a0
DC
3192012-10-08 Daniel Colascione <dancol@dancol.org>
320
321 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
322 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
323 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
324 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
325 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
326 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
327 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
328 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
329 now a supported configuration.
330
331 * Makefile.in: consolidate image variables into LIBIMAGE; add
332 W32_OBJ and W32_LIBS. Compile new files.
333
334 * conf_post.h:
335 (_DebPrint) declare tracing facility for W32 debugging. We need
336 to unify tracing later.
337
338 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
339 unconditional use of W32 Unicode functions. Cygwin runs only on
340 100% Unicode operating systems.
341
342 * cygw32.c: New file. Define Cygwin-specific facilities.
343 (Fcygwin_convert_path_to_windows)
344 (Fcygwin_convert_path_from_windows): New user functions for
345 accessing Cygwin path-munging routines.
346
347 * cygw32.h: New file.
348 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
349 UTF-16LE strings temporarily inside non-Lisp-visible string
350 objects.
351
352 (w32_strerror): Just what it says on the tin.
353
354 * emacs.c: Make the NS fork-then-exec code for daemon-launching
355 also run for Cygwin; both systems have the same problem with using
356 GUI facilities in a forked child. Also call syms_of_cygw32,
357 syms_of_w32select in correct places.
358
359 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
360 needs fork-then-exec for daemon launching.
361
362 * font.h: Include frame.h.
363
364 * image.c: Use the image library cache machinery only when we're
365 compiling for native WINDOWSNT; Cygwin can use shared libraries
366 like any other Unixlike system.
367
368 * keyboard.c: Clarify a comment regarding the input loop.
369
370 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
371 functions directly instead of trying to detect at runtime that our
372 host operating system supports them. We make this change for two
373 reasons: Cygwin lacks support for the multibyte character
374 conversion functions used by the legacy menu code, and Cygwin
375 never needs to rely on non-Unicode APIs.
376
377 * unexw32.c (hinst): Declare extern.
378
379 * w32.c: Change header order;
380 (w32_strerror): Move to w32fns.c because we need it for
381 non-WINDOWSNT builds.
382
383 * w32.h: Add #error macro to make sure we don't include w32.h for
384 Cygwin builds. Remove w32select declarations.
385
386 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
387 w32fns.c. w32console.c is WINDOWSNT-only.
388
389 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
390 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
391 POSIXy alternative.
392 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
393 (w32_major_version, w32_minor_version, w32_build_number)
394 (os_subtype, sound_type): Define here
395 (w32_defined_color): Make color parameter const for consistency
396 with other _defined_color functions.
397 (w32_createwindow): Unconditionally call w32_init_class instead of
398 doing so only when hprevinst is non-NULL. Plumbing hprevinst
399 through the code is complex and unnecessary because class
400 registration is practically free.
401 (w32_name_of_message): New EMACSDEBUG-only function.
402 (Fset_message_beep): Move here
403 (Fx_open_connection): Require that the display name for Windows be
404 "w32" for consistency, emacsclient disambiguation, and maybe, one
405 day, multi-window-system support.
406 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
407 Cygwin files for W32 GUI facilities, since these clearly don't
408 expect Cygwin names.
409 (_DebPrint): Define.
410 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
411 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
412 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
413 (w32_last_error): Remove.
414
415 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
416
417 * w32heap.c (syspage_mask): Declare here.
418 (cache_system_info): Remove.
419
420 * w32inevt.c (faked_key): Define globally, not statically.
421 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
422 (w32_console_toggle_lock_key): Move to w32fns.c.
423
424 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
425
426 * w32proc.c (_DebPrint): Move to w32fns.c.
427 * w32select.c: Include string.h, stdio.h for Cygwin.
428 * w32select.h: New File.
429
430 * w32term.c: Include io.h for non-CYGWIN builds; needed for
431 get_osfhandle.
432 (w32_message_fd): New variable. Under Cygwin, holds the file
433 descriptor the system used to tell us about pending thread
434 messages.
435
436 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
437 that prevented compilation under non-WINDOWSNT systems.
438
439 (w32_initialize): Open /dev/windows and assign it to
440 w32_message_fd. Provide w32 feature.
441
442 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
443 (WM_EMACS_INPUT_READY): add.
444 (prepend_msg, w32_message_fd): Declare globally.
445
446 * w32xfns.c:
447 (keyboard_handle): Use only when WINDOWSNT.
448 (notify_msg_ready): New function. Posts a message to the main
449 thread's message queue under CYGWIN, which wakes up the main
450 thread from select(2) by making the /dev/windows file descriptor
451 ready. Under WINDOWSNT, it sets an event the same way the old
452 code did.
453
454 (post, prepend_msg): Actually call notify_msg_ready instead of
455 setting the input event directly.
456
98daa893
EZ
4572012-10-07 Eli Zaretskii <eliz@gnu.org>
458
459 * ralloc.c (relinquish): If a heap is ready to be relinquished,
460 but it still has blocs in it, don't return it to the system,
461 instead of aborting. (Bug#12402)
462
3bc0a2f7
JD
4632012-10-07 Jan Djärv <jan.h.d@swipnet.se>
464
8ad5b73b 465 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 466
335f5ae4
JD
467 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
468 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
469 (syms_of_nsterm): Remove comment about Panther and above for
470 ns-antialias-text.
335f5ae4
JD
471 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
472 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
473 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
474
475 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
476 MAC_OS_X_VERSION_10_4.
477
8ad5b73b
JD
478 * nsmenu.m (fillWithWidgetValue:): Remove code for <
479 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
480
481 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
482
483 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
484 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
485
3bc0a2f7
JD
486 * nsterm.m (ns_in_resize): Remove (Bug#12479).
487 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8ad5b73b
JD
488 (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove
489 ns_in_resize check.
3bc0a2f7
JD
490 (ns_clear_frame_area): Remove resize handle code.
491
492 * nsfns.m (ns_in_resize): Remove.
8ad5b73b
JD
493 (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
494 ns_in_resize check.
3bc0a2f7 495
c622b48f
PE
4962012-10-07 Paul Eggert <eggert@cs.ucla.edu>
497
498 Improve sys_siglist detection.
499 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
500 defined as a macro, as is done in Solaris.
501 (sys_siglist_entries): New macro.
502 (save_strsignal): Use it.
503 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
504 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
505
04fafa46
JD
5062012-10-06 Jan Djärv <jan.h.d@swipnet.se>
507
508 * nsfns.m (Fx_create_frame): Call x_default_parameter with
509 fullscreen/Fullscreen.
510
511 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
512 tobar_height is new.
513
514 * nsterm.m (x_make_frame_visible): Check for fullscreen.
515 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
516 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
517 (windowDidResize:): Check for correct window if old style fullscreen.
518 Capitalize word in comment. Remove incorrect comment.
519 (initFrameFromEmacs:): tbar_height renamed tibar_height.
520 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
521 error in drawing background.
522 (toggleFullScreen:): Remove comment. Rearrange calls.
523 Set toolbar values to zero, save old height in tobar_height.
524 Restore tool bar height when leaving fullscreen.
525 (canBecomeMainWindow): New function.
526
c6e21c03
PE
5272012-10-06 Paul Eggert <eggert@cs.ucla.edu>
528
529 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
530
0d9f584b
EZ
5312012-10-05 Eli Zaretskii <eliz@gnu.org>
532
a65fbb5f
EZ
533 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
534
0d9f584b
EZ
535 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
536 that time stamps of directories could also be changed. Don't
537 request the too broad GENERIC_WRITE, only the more restrictive
538 FILE_WRITE_ATTRIBUTES access rights.
539
540 * fileio.c (Fset_file_times): Special-case ignoring errors for
541 directories only on MSDOS, not on MS-Windows.
542
e8757f09 5432012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
544
545 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
546
7604f298
EZ
5472012-10-04 Eli Zaretskii <eliz@gnu.org>
548
549 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
550 see whether CreateFile failed.
551
88d69b7d
PE
5522012-10-04 Paul Eggert <eggert@cs.ucla.edu>
553
554 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
555 to avoid similar races.
556 * keyboard.c (pending_signals): Now bool, not int.
557
7509f454
PE
558 Port timers to OpenBSD, plus check for timer failures.
559 OpenBSD problem reported by Han Boetes.
560 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
561 and/or setitimer.
562 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
563 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
564 like OpenBSD, which has timer_settime but does not declare it.
565 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
566 whether to use itimerspec-related primitives. All uses of
567 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
568
a3c5c0c5
PE
5692012-10-02 Paul Eggert <eggert@cs.ucla.edu>
570
571 * profiler.c (handle_profiler_signal): Fix a malloc race
572 that caused Emacs to hang on Fedora 17 when profiling Lisp.
573
914e743b
JD
5742012-10-02 Jan Djärv <jan.h.d@swipnet.se>
575
576 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
577
d8ab37a8
EZ
5782012-10-02 Eli Zaretskii <eliz@gnu.org>
579
580 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
581 consistent with the change in return value of 'safe_strsignal'.
582
b3ecad33
PE
5832012-10-02 Paul Eggert <eggert@cs.ucla.edu>
584
0a99eee1
PE
585 Prefer plain 'static' to 'static inline' (Bug#12541).
586 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
587 (bidi_set_sor_type, bidi_push_embedding_level)
588 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
589 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
590 (bidi_cache_search, bidi_cache_ensure_space)
591 (bidi_cache_iterator_state, bidi_cache_find)
592 (bidi_peek_at_next_level, bidi_set_paragraph_end)
593 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
594 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
595 Now 'static', not 'static inline'.
596
b3ecad33
PE
597 Count overruns when profiling; change units to ns.
598 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
599 Give extra weight to samples after overruns, to attempt to count
600 the time more accurately.
601 (setup_cpu_timer): Change sampling interval units from ms to ns, since
602 the underlying primitives nominally do ns.
603 (Fprofiler_cpu_start): Document the change. Mention that
604 the sampling intervals are only approximate.
605
090cf9db
SM
6062012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
607
608 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
609
610 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
611 case for the special 0 coding-system.
612
613 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
614 (Fmake_overlay): Remove redundant tests.
64edc777 615 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 616
81550bf4
JB
6172012-10-02 Juanma Barranquero <lekktu@gmail.com>
618
619 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
620 Update dependencies.
621
aa1ba90e
PE
6222012-10-01 Paul Eggert <eggert@cs.ucla.edu>
623
624 Fix a malloc race condition involving strsignal.
625 A signal can arrive in the middle of a malloc, and Emacs's signal
626 handler can invoke strsignal, which can invoke malloc, which is
627 not portable. This race condition bug makes Emacs hang on GNU/Linux.
628 Fix it by altering the signal handler so that it does not invoke
629 strsignal.
630 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
631 * process.c (status_message): Use const pointer, in case strsignal
632 is #defined to safe_strsignal.
633 * sysdep.c (sys_siglist, init_signals): Always define and
634 initialize a substitute sys_siglist if the system does not define
635 one, even if HAVE_STRSIGNAL.
636 (safe_strsignal): Rename from strsignal. Always define,
637 using sys_siglist. Return a const pointer.
638 * syssignal.h (safe_strsignal): New decl.
639 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
640
ace917bd
EZ
6412012-10-01 Eli Zaretskii <eliz@gnu.org>
642
643 * w32proc.c (timer_loop): Fix code that waits for timer
644 expiration, to avoid high CPU usage.
645
9eb71b9c
SM
6462012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
647
648 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
649 (sweep_weak_table): Remove redundant prototypes.
650
b3317662
FP
6512012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
652
653 * emacs.c: Move the inclusion of TERM_HEADER after including
654 windows.h on WINDOWSNT. This avoids compilation problems with
655 MSVC.
656
f0e5f225
EZ
6572012-10-01 Eli Zaretskii <eliz@gnu.org>
658
2d7d1608
EZ
659 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
660 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
661 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
662 as the previous version used 'void *'.
663
664 * ralloc.c (ROUNDUP): Fix last change.
665 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
666 'size_t'.
667
f0e5f225
EZ
668 * w32proc.c <disable_itimers>: New static flag.
669 (init_timers): Initialize it to zero, after creating the critical
670 sections used by the timer threads.
671 (term_timers): Set to 1 before deleting the critical sections.
672 (getitimer, setitimer): If disable_itimers is non-zero, return an
673 error indication without doing anything. Reported by Fabrice
674 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
675 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
676 return results.
677 [!HAVE_SETITIMER]: Behave as the previous version that didn't
678 support timers.
f0e5f225
EZ
679
680 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
681 term_ntproc after all the other bookkeeping, to get timers working
682 as long as possible.
683
82ef37c1
PE
6842012-10-01 Paul Eggert <eggert@cs.ucla.edu>
685
b3a4c387
PE
686 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
687 Suggested by Juri Linkov in
688 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
689
b0ab8123
PE
690 Prefer plain 'static' to 'static inline' (Bug#12541).
691 With static functions, modern compilers inline pretty well by
692 themselves; advice from programmers often hurts as much as it helps.
693 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
694 this change shrinks the text size of the Emacs executable by 1.1%
695 without affecting CPU significantly in my benchmark.
696 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
697 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
698 (mark_maybe_object, mark_maybe_pointer, bounded_number):
699 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
700 (bset_auto_fill_function, bset_auto_save_file_format)
701 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
702 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
703 (bset_cache_long_line_scans, bset_case_fold_search)
704 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
705 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
706 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
707 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
708 (bset_header_line_format, bset_indicate_buffer_boundaries)
709 (bset_indicate_empty_lines, bset_invisibility_spec)
710 (bset_left_fringe_width, bset_major_mode, bset_mark)
711 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
712 (bset_name, bset_overwrite_mode, bset_pt_marker)
713 (bset_right_fringe_width, bset_save_length)
714 (bset_scroll_bar_width, bset_scroll_down_aggressively)
715 (bset_scroll_up_aggressively, bset_selective_display)
716 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
717 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
718 (set_buffer_overlays_after):
719 * category.c (bset_category_table):
720 * charset.c (read_hex):
721 * coding.c (produce_composition, produce_charset)
722 (handle_composition_annotation, handle_charset_annotation)
723 (char_encodable_p):
724 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
725 (assign_row, set_frame_matrix_frame, make_current)
726 (add_row_entry):
727 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
728 * fns.c (maybe_resize_hash_table):
729 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
730 * gmalloc.c (register_heapinfo):
731 * image.c (lookup_image_type):
732 * intervals.c (set_interval_object, set_interval_left)
733 (set_interval_right, copy_interval_parent, rotate_right)
734 (rotate_left, balance_possible_root_interval):
735 * keyboard.c (kset_echo_string, kset_kbd_queue)
736 (kset_keyboard_translate_table, kset_last_prefix_arg)
737 (kset_last_repeatable_command, kset_local_function_key_map)
738 (kset_overriding_terminal_local_map, kset_real_last_command)
739 (kset_system_key_syms, clear_event, set_prop):
740 * lread.c (digit_to_number):
741 * marker.c (attach_marker, live_buffer, set_marker_internal):
742 * nsterm.m (ns_compute_glyph_string_overhangs):
743 * process.c (pset_buffer, pset_command)
744 (pset_decode_coding_system, pset_decoding_buf)
745 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
746 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
747 (pset_status, pset_tty_name, pset_type, pset_write_queue):
748 * syntax.c (bset_syntax_table, dec_bytepos):
749 * terminal.c (tset_param_alist):
750 * textprop.c (interval_has_some_properties)
751 (interval_has_some_properties_list):
752 * window.c (wset_combination_limit, wset_dedicated)
753 (wset_display_table, wset_hchild, wset_left_fringe_width)
754 (wset_left_margin_cols, wset_new_normal, wset_new_total)
755 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
756 (wset_right_fringe_width, wset_right_margin_cols)
757 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
758 (wset_vertical_scroll_bar_type, wset_window_parameters):
759 * xdisp.c (wset_base_line_number, wset_base_line_pos)
760 (wset_column_number_displayed, wset_region_showing)
761 (window_box_edges, run_window_scroll_functions)
762 (append_glyph_string_lists, prepend_glyph_string_lists)
763 (append_glyph_string, set_glyph_string_background_width)
764 (append_glyph, append_composite_glyph)
765 (take_vertical_position_into_account):
766 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
767 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
768 (lface_hash, lface_same_font_attributes_p, lookup_face):
769 * xml.c (libxml2_loaded_p):
770 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
771 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
772 Now 'static', not 'static inline'.
773
05584c31
PE
774 * bidi.c: Tune.
775 (bidi_copy_it): Do the whole copy with a single memcpy.
776 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
777
86ec63ba
PE
778 Revert the FOLLOW-SYMLINKS change for file-attributes.
779 Doing it right would require several changes to Tramp, and there's
780 not enough time to get that tested before the freeze today.
781 * dired.c (directory_files_internal, Ffile_attributes):
782 Undo last change.
783
82ef37c1
PE
784 * frame.c (x_report_frame_params): Port better to wider ints.
785 Do not assume that EMACS_UINT is the same width as uprintmax_t,
786 or that pointers can be printed in 15 decimal digits.
787 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
788
62aba0d4
FP
7892012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
790
791 Support x64 build on MS-Windows.
792 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
793 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
794 compatibility with x64.
5e4daaf3 795 (x_get_focus_frame): Add prototype.
62aba0d4
FP
796
797 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
798 defining an XRectangle structure.
799
800 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
801 arithmetics for compatibility with x64.
802
803 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
804 compatibility with x64.
805
806 * w32heap.h: Adjust prototypes and declarations.
807
808 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
809 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
810 DWORD, long, and unsigned long, for compatibility with x64.
811 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
812 (sbrk): Argument is now of type ptrdiff_t.
813
814 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
815 less than 0x0500.
816 (w32_msg_pump): Use WPARAM type for 'result'.
817
818 * w32.c (init_environment, get_emacs_configuration): Support AMD64
819 architecture.
820 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
821 compatibility with x64.
822
823 * vm-limit.c (lim_data): Now size_t.
824 (check_memory_limits): Adjust prototypes of real_morecore and
825 __morecore to receive argument of type ptrdiff_t. Use size_t for
826 five_percent and data_size.
827
828 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
829 variables, for compatibility with x64.
830 (rva_to_section, offset_to_section, relocate_offset)
831 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
832 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
833 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
834 for compatibility with x64.
835
836 * sysdep.c (STDERR_FILENO): Define if not already defined.
837
838 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
839 (__morecore): Argument type is now ptrdiff_t.
840 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
841 (relinquish): Use ptrdiff_t type for 'excess'.
842 (r_alloc_sbrk): Argument type is now ptrdiff_t.
843
844 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
845 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
846 instead of a literal number.
847
848 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
849 (min): Define only if not already defined.
850
851 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
852 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
853 hosts.
854
855 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
856 'bitmaps' is a pointer.
857
858 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
859
860 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
861
e7a2937b
PE
8622012-09-30 Paul Eggert <eggert@cs.ucla.edu>
863
864 file-attributes has a new optional arg FOLLOW-SYMLINKS.
865 * dired.c (directory_files_internal, Ffile_attributes):
866 New arg follow_symlinks. All uses changed.
867
b43d62ae
SM
8682012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
869
870 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
871
c06c382a
EZ
8722012-09-30 Eli Zaretskii <eliz@gnu.org>
873
874 Support atimers and CPU profiler via profile.c on MS-Windows.
875 * w32proc.c (sig_mask, crit_sig): New static variables.
876 (sys_signal): Support SIGALRM and SIGPROF.
877 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 878 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
879 sigfillset, and sigprocmask are no longer no-ops.
880 (sigismember): New function.
881 (struct itimer_data): New definition.
882 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
883 (crit_prof): New static variables.
884 (MAX_SINGLE_SLEEP): New definition.
885 (timer_loop, stop_timer_thread, term_timers, init_timers)
886 (start_timer_thread, getitimer, setitimer): New functions.
887 (alarm): No longer a no-op, calls setitimer.
888
889 * w32.c (term_ntproc): Call term_timers.
890 (init_ntproc): Make sure all signals are unblocked at startup, to
891 erase any traces of dumping. Call init_timers.
892
893 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
894 Windows-specific code to display the hourglass mouse pointer is no
895 longer used.
896 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
897 to hourglass timer expiration.
898 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
899 Remove, no longer used.
b43d62ae
SM
900 (w32_note_current_window, show_hourglass, hide_hourglass):
901 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
902 window systems.
903 (syms_of_w32fns): Don't initialize hourglass_timer.
904
905 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
906 WINDOWSNT as well.
907 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
908
909 * w32.h (init_timers, term_timers): Add prototypes.
910
95402d5f
KH
9112012-09-30 Kenichi Handa <handa@gnu.org>
912
913 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
914 to the buffer relocation which may be caused by ccl_driver.
915
dd946752
JD
9162012-09-30 Jan Djärv <jan.h.d@swipnet.se>
917
d7e642cc
JD
918 * xfns.c (Fx_file_dialog): Update comment.
919
920 * w32fns.c (Fx_file_dialog): Update comment.
921
922 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
923 Initialize panel name field if OSX >= 10.6.
924
925 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
926
dd946752
JD
927 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
928
929 * nsterm.m (NEW_STYLE_FS): New define.
930 (ns_fullscreen_hook, windowWillEnterFullScreen)
931 (windowDidEnterFullScreen, windowWillExitFullScreen)
932 (windowDidExitFullScreen, toggleFullScreen, handleFS)
933 (setFSValue): New functions.
934 (EmacsFSWindow): New implementation.
935 (canBecomeKeyWindow): New function for EmacsFSWindow.
936 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
937 (dealloc): Release nonfs_window if in fullscreen.
938 (updateFrameSize:): Call windowDidMove to update top/left.
939 (windowWillResize:toSize:): Check if frame is still maximized.
940 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
941 next_maximized, maximized_width, maximized_height and nonfs_window.
942 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
943 tbar_height.
944 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
945 fullscreen. Set maximized_width/height. Act on next_maximized.
946
947 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
948 (EmacsView): Add variables for fullscreen.
949 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
950 (EmacsFSWindow): New interface for fullscreen.
951
427730eb
JB
9522012-09-30 Juanma Barranquero <lekktu@gmail.com>
953
954 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
955
48de8b12
CY
9562012-09-30 Chong Yidong <cyd@gnu.org>
957
958 * fns.c (Frandom): Doc fix.
959
5938d519
MR
9602012-09-30 Martin Rudalics <rudalics@gmx.at>
961
962 * window.c (Vwindow_combination_limit): New default value.
963 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
964
cb5b0266
PE
9652012-09-30 Paul Eggert <eggert@cs.ucla.edu>
966
967 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
968 Suggested by Eli Zaretskii in
969 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
970
84f72efd
EZ
9712012-09-30 Eli Zaretskii <eliz@gnu.org>
972
973 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
974 HAVE_TIMER_SETTIME is defined.
975
9d4dcdc9
PE
9762012-09-30 Paul Eggert <eggert@cs.ucla.edu>
977
d89460ed
PE
978 Profiler improvements: more-accurate timers, overflow checks.
979 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
980 signal.h, setjmp.h. Include systime.h instead.
981 (saturated_add): New function.
982 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
983 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
984 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
985 New static vars.
84f72efd 986 (enum profiler_cpu_running): New enum.
d89460ed
PE
987 (profiler_cpu_running): Now of that enum type, not bool.
988 All uses changed to store the new value.
989 (handle_profiler_signal): Rename from sigprof_handler_1,
990 for consistency with other handlers. Do not check whether
991 cpu_log is a hash-table if garbage collecting, since it
992 doesn't matter in that case.
993 (deliver_profiler_signal): Rename from sigprof_handler,
994 for consistency with other handlers.
995 (setup_cpu_timer): New function, with much of what used to be in
996 Fprofiler_cpu_start. Check for out-of-range argument.
997 Prefer timer_settime if available, and prefer
998 thread cputime clocks, then process cputime clocks, then
999 monotonic clocks, to the old realtime clock. Use make_timeval
1000 to round more-correctly when falling back to setitimer.
1001 (Fprofiler_cpu_start): Use it.
1002 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1003 Don't assume that passing NULL as the 2nd argument of setitimer
1004 is the same as passing a pointer to all-zero storage.
1005 Ignore SIGPROF afterwards.
1006 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1007 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1008 non-fatal signal handlers. Ignore SIGPROF on startup.
1009 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1010 in profiler.c, since sysdep.c now uses it.
1011
9d4dcdc9
PE
1012 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1013 Suggested by Eli Zaretskii in
1014 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1015
8e5691a0
JB
10162012-09-29 Juanma Barranquero <lekktu@gmail.com>
1017
1018 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1019
e7c1b6ef
SM
10202012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1021
1022 * lisp.h (struct backtrace): Remove indirection for `function' field.
1023 * xdisp.c (redisplay_internal):
1024 * profiler.c (record_backtrace, sigprof_handler_1):
1025 * alloc.c (Fgarbage_collect):
1026 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1027 (Fbacktrace_frame): Adjust accordingly.
1028
e61d39cd 10292012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
1030
1031 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1032 (Frun_hook_with_args_until_failure): Doc fixes.
1033
404043ea
EZ
10342012-09-28 Eli Zaretskii <eliz@gnu.org>
1035
1036 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1037 Qautomatic_redisplay and change the symbol name. All users changed.
1038
704d3f45
TM
10392012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1040
1041 * profiler.c (sigprof_handler): Fix race condition.
1042
757140ff
GM
10432012-09-28 Glenn Morris <rgm@gnu.org>
1044
1045 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1046
a615a3ae
PE
10472012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1048
1049 Check more robustly for timer_settime.
89d17fd0
PE
1050 * Makefile.in (LIB_TIMER_TIME): New macro.
1051 (LIBES): Add it.
a615a3ae
PE
1052 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1053 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1054 call timer_settime.
1055
3670daf7
TM
10562012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1057
1058 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1059
6a586b7f
JB
10602012-09-26 Juanma Barranquero <lekktu@gmail.com>
1061
1062 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1063
41c8bfcf
PE
10642012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1065
1066 * character.h (MAYBE_UNIFY_CHAR): Remove.
1067 * charset.c, charset.h (maybe_unify_char): Now static.
1068 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1069 Since this stuff is now private to charset.c, there's no need for
1070 a public macro and no need to inline by hand.
1071
3a880af4
SM
10722012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1073 Stefan Monnier <monnier@iro.umontreal.ca>
1074 Juanma Barranquero <lekktu@gmail.com>
611b7507 1075
3a880af4
SM
1076 * profiler.c: New file.
1077 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
1078 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1079 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
1080 * emacs.c (main): Call syms_of_profiler.
1081 * alloc.c (Qautomatic_gc): New constant.
1082 (MALLOC_PROBE): New macro.
1083 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1084 (total_bytes_of_live_objects): New function.
1085 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1086 Call malloc_probe for the memory profiler.
1087 (syms_of_alloc): Define Qautomatic_gc.
1088 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1089 race condition.
1090 (struct backtrace): Move definition...
1091 * lisp.h (struct backtrace): ..here.
1092 (Qautomatic_gc, profiler_memory_running): Declare vars.
1093 (malloc_probe, syms_of_profiler): Declare functions.
1094 * xdisp.c (Qautomatic_redisplay): New constant.
1095 (redisplay_internal): Record itself in backtrace_list.
1096 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 1097
5938d519 10982012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
10992012-09-25 Juanma Barranquero <lekktu@gmail.com>
1100
1101 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1102
e26fd2e4
PE
11032012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1104
1105 Prefer POSIX timers if available.
1106 They avoid a race if the timer is too close to the current time.
1107 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1108 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 1109 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 1110
eedec3ee
EZ
11112012-09-25 Eli Zaretskii <eliz@gnu.org>
1112
1113 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1114 CHAR_STRING_ADVANCE.
1115 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1116 STRING_CHAR_ADVANCE.
1117
aa15c6bb
JB
11182012-09-25 Juanma Barranquero <lekktu@gmail.com>
1119
1120 Move Vlibrary_cache to emacs.c and reset before dumping.
1121
1122 * lisp.h (reset_image_types): Declare.
1123 [WINDOWSNT] (Vlibrary_cache): Declare.
1124
1125 * image.c (reset_image_types): New function.
1126
1127 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1128 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1129 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1130
1131 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1132 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1133
1134 * w32.h (Vlibrary_cache): Do not declare.
1135
54d629be
EZ
11362012-09-25 Eli Zaretskii <eliz@gnu.org>
1137
16b22fef
EZ
1138 * w32proc.c (sys_signal): Handle all signals defined by the
1139 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1140 handlers for signals supported by Windows. Don't override
1141 term_ntproc as the handler for SIGABRT.
1142 (sigaction): Rewrite to call sys_signal instead of duplicating its
1143 code.
1144 (sys_kill): Improve commentary.
1145
1146 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1147 consistency with a signature of a signal handler. All callers
1148 changed.
1149 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1150 install term_ntproc as a signal handler for SIGABRT, as that
1151 should be done by the dumped Emacs.
1152
1153 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1154
1155 * w32select.c (term_w32select): Protect against repeated
1156 invocation by setting clipboard_owner to NULL after calling
1157 DestroyWindow.
1158
1159 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1160 and term_ntproc to their modified signatures.
1161
54d629be
EZ
1162 * character.c (char_string, string_char): Remove calls to
1163 MAYBE_UNIFY_CHAR. See the discussion starting at
1164 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1165 for the details.
1166
59f7af81
CY
11672012-09-25 Chong Yidong <cyd@gnu.org>
1168
1169 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1170
22e8cf4a
SM
11712012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1172
1173 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1174 when encountering an unknown bytecode.
1175
578098f3
PE
11762012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1177
1178 image.c, indent.c: Use bool for booleans.
1179 * dispextern.h (struct image_type): Members valid_p, load, init
1180 now return bool, not int. All uses changed.
1181 * image.c: Omit unnecessary static decls.
1182 (x_create_bitmap_mask, x_build_heuristic_mask):
1183 Return void, not int, since callers don't care about the return value.
1184 (x_create_bitmap_mask, define_image_type, valid_image_p)
1185 (struct image_keyword, parse_image_spec, image_spec_value)
1186 (check_image_size, image_background)
1187 (image_background_transparent, x_clear_image_1)
1188 (postprocess_image, lookup_image, x_check_image_size)
1189 (x_create_x_image_and_pixmap, xbm_image_p)
1190 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1191 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1192 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1193 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1194 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1195 (png_image_p, init_png_functions, png_load_body, png_load)
1196 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1197 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1198 (init_gif_functions, gif_load, imagemagick_image_p)
1199 (imagemagick_load_image, imagemagick_load, svg_image_p)
1200 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1201 (gs_load):
1202 * nsimage.m (ns_load_image):
1203 * nsterm.m (ns_defined_color):
1204 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1205 * xfns.c (x_defined_color):
1206 * xterm.c (x_alloc_lighter_color_for_widget)
1207 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1208 (x_alloc_lighter_color):
1209 * indent.c (disptab_matches_widthtab, current_column)
1210 (scan_for_column, string_display_width, indented_beyond_p)
1211 (compute_motion, vmotion, Fvertical_motion):
1212 Use bool for booleans.
1213
a5f2b6ec
CY
12142012-09-24 Chong Yidong <cyd@gnu.org>
1215
1216 * chartab.c (Fset_char_table_default): Obsolete function removed.
1217
18e27ea8
PE
12182012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1219
afea8a8a
PE
1220 Move pid_t related decls out of lisp.h.
1221 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1222 (interruptible_wait_for_termination):
1223 Move these decls from lisp.h to syswait.h, since they use pid_t.
1224 Needed on FreeBSD; see Herbert J. Skuhra in
1225 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1226 * callproc.c: Include syswait.h.
1227
18e27ea8
PE
1228 gnutls.c, gtkutil.c: Use bool for boolean.
1229 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1230 (emacs_gnutls_handle_error):
1231 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1232 (xg_hide_tooltip, xg_create_frame_widgets)
1233 (create_dialog, xg_uses_old_file_dialog)
1234 (xg_get_file_with_chooser, xg_get_file_with_selection)
1235 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1236 (xg_item_label_same_p, xg_update_menubar)
1237 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1238 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1239 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1240 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1241 (update_frame_tool_bar, free_frame_tool_bar):
1242 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1243 * nsmenu.m (ns_update_menubar):
1244 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1245 * xfns.c (Fx_show_tip) [USE_GTK]:
1246 Use bool for boolean.
1247 * gtkutil.c (xg_update_frame_menubar):
1248 * xmenu.c (update_frame_menubar):
1249 Return void, not int, since caller ignores return value.
1250 * gtkutil.c (xg_change_toolbar_position):
1251 Return void, not 1.
1252
af0e9f75
JB
12532012-09-23 Juanma Barranquero <lekktu@gmail.com>
1254
1255 * makefile.w32-in (BLOCKINPUT_H): Remove.
1256 (SYSSIGNAL_H): New macro.
1257 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1258 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1259 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1260 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1261 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1262 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1263 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1264 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1265 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1266 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1267 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1268 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1269 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1270 ($(BLD)/w32xfns.$(O)): Update dependencies.
1271
5101529e
EZ
12722012-09-23 Eli Zaretskii <eliz@gnu.org>
1273
1274 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1275 fatal_error_backtrace.
1276
1277 * w32proc.c (sys_kill): Undo last change: don't do anything when
1278 invoked to deliver SIGABRT to our own process. This is now
1279 handled by emacs_raise.
1280
2c3ee0ad
JB
12812012-09-23 Juanma Barranquero <lekktu@gmail.com>
1282
1283 * w32term.c (w32_read_socket): Remove leftover reference to
1284 interrupt_input_pending.
1285
62a1d661
PE
12862012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1287
1288 Do not use SA_NODEFER.
1289 Problem reported by Dani Moncayo in
1290 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1291 * alloc.c (die):
1292 * sysdep.c (emacs_abort): Do not reset signal handler.
1293 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1294 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1295 wanted even on POSIXish hosts, and it doesn't work on Windows.
1296
a0942b9a
JD
12972012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1298
1299 * xterm.c (x_term_init): Call fixup_locale before and after calling
1300 gtk_init (Bug#12392).
1301
d07ff9db
CY
13022012-09-23 Chong Yidong <cyd@gnu.org>
1303
1304 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1305 Vdynamic_library_alist.
1306
1307 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1308 (Fgnutls_available_p): Caller changed.
1309
1310 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1311 (Flibxml_parse_xml_region): Likewise.
1312
1313 * dispextern.h (struct image_type): Remove arg from init function.
1314
1315 * image.c (Finit_image_library, lookup_image_type)
1316 (define_image_type): Remove now-unneeded second arg.
1317 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1318 (init_tiff_functions, init_gif_functions, init_svg_functions):
1319 Arglist and w32_delayed_load calling convention changed.
1320 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 1321 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 1322
4d7e6e51
PE
13232012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1324
1325 Simplify and avoid signal-handling races (Bug#12471).
1326 * alloc.c (die):
1327 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1328 Avoid recursive loop if there's a fatal error in the function itself.
1329 * atimer.c (pending_atimers):
1330 * blockinput.h: Don't include "atimer.h"; no longer needed.
1331 (interrupt_input_pending): Remove. All uses removed.
1332 pending_signals now counts both atimers and ordinary interrupts.
1333 This is less racy than having three separate pending-signal flags.
1334 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1335 (input_blocked_p):
1336 Rename from their upper-case counterparts BLOCK_INPUT,
1337 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1338 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1339 This makes it easier to access volatile variables more accurately.
1340 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1341 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1342 that's more reliable if the code is buggy and sets
1343 interrupt_input_blocked to a negative value. All uses changed.
1344 * atimer.c (deliver_alarm_signal):
1345 Remove. No need to deliver this to the parent; any thread can
1346 handle this signal now. All uses replaced by underlying handler.
1347 * atimer.c (turn_on_atimers):
1348 * dispnew.c (handle_window_change_signal):
1349 * emacs.c (handle_danger_signal):
1350 * keyboard.c (kbd_buffer_get_event):
1351 Don't reestablish signal handler; not needed with sigaction.
1352 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1353 (UNBLOCK_INPUT_TO):
1354 Rework to avoid unnecessary accesses to volatile variables.
1355 (UNBLOCK_INPUT_TO): Now a function.
1356 (totally_unblock_input, unblock_input): New decls.
1357 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1358 (init_data): Remove. Necessary stuff now done in init_signal.
1359 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1360 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1361 (fatal_error_code): Remove; no longer needed.
1362 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1363 it doesn't always backtrace. All uses changed. No need to reset
1364 signal to default, since sigaction and/or die does that for us now.
1365 Use emacs_raise (FOO), not kill (getpid (), FOO).
1366 (main): Check more-accurately whether we're dumping.
1367 Move fatal-error setup to sysdep.c
1368 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1369 * gtkutil.c (xg_get_file_name, xg_get_font):
1370 Remove no-longer-needed signal-mask manipulation.
1371 * keyboard.c, process.c (POLL_FOR_INPUT):
1372 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1373 * keyboard.c (read_avail_input): Remove.
1374 All uses replaced by gobble_input.
1375 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1376 (kbd_buffer_store_event_hold, gobble_input):
1377 (record_asynch_buffer_change) [USABLE_SIGIO]:
1378 (store_user_signal_events):
1379 No need to mess with signal mask.
1380 (gobble_input): If blocking input and there are terminals, simply
1381 set pending_signals to 1 and return. All hooks changed to not
1382 worry about whether input is blocked.
1383 (process_pending_signals): Clear pending_signals before processing
1384 them, in case a signal comes in while we're processing.
1385 By convention callers now test pending_signals before calling us.
1386 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1387 New functions, to support changes to blockinput.h.
1388 (handle_input_available_signal): Now extern.
1389 (reinvoke_input_signal): Remove. All uses replaced by
1390 handle_async_input.
1391 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
1392 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1393 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
1394 Clear sigmask reliably, even if Fsignal returns, which it can.
1395 Omit unnecessary accesses to volatile var.
1396 (quit_throw_to_read_char): No need to restore sigmask.
1397 * keyboard.c (gobble_input, handle_user_signal):
1398 * process.c (wait_reading_process_output):
1399 Call signal-handling code rather than killing ourselves.
1400 * lisp.h: Include <float.h>, for...
1401 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1402 (pending_signals): Now volatile.
1403 (syms_of_data): Now const if IEEE floating point.
1404 (handle_input_available_signal) [USABLE_SIGIO]:
1405 (terminate_due_to_signal, record_child_status_change): New decls.
1406 * process.c (create_process): Avoid disaster if memory is exhausted
1407 while we're processing a vfork, by tightening the critical section
1408 around the vfork.
1409 (send_process_frame, process_sent_to, handle_pipe_signal)
1410 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1411 ignores SIGPIPE.
1412 (send_process): No need for setjmp/longjmp any more, since the
1413 SIGPIPE stuff is now gone. Instead, report an error if errno
1414 is EPIPE.
1415 (record_child_status_change): Now extern. PID and W are now args.
1416 Return void, not bool. All callers changed.
1417 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1418 Remove. All uses removed. This bug should be fixed now in a
1419 different way.
1420 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1421 and record the child status change directly. This avoids the
1422 need to futz with the signal mask.
1423 (process_fatal_action): Move here from emacs.c.
1424 (emacs_sigaction_flags): New function, containing
1425 much of what used to be in emacs_sigaction_init.
1426 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1427 caught by emacs, to make races less likely.
1428 (deliver_process_signal): Rename from handle_on_main_thread.
1429 All uses changed.
1430 (BACKTRACE_LIMIT_MAX): Now at top level.
1431 (thread_backtrace_buffer, threadback_backtrace_pointers):
1432 New static vars.
1433 (deliver_thread_signal, deliver_fatal_thread_signal):
1434 New functions, for more-accurate delivery of thread-specific signals.
1435 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1436 (deliver_arith_signal): Handle in this thread, not
1437 in the main thread, since it's triggered by this thread.
1438 (maybe_fatal_sig): New function.
1439 (init_signals): New arg DUMPING so that we can be more accurate
1440 about whether we're dumping. Caller changed.
1441 Treat thread-specific signals differently from process-general signals.
1442 Block all signals while handling fatal error; that's safer.
1443 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1444 on IEEE hosts.
1445 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1446 Ignore SIGPIPE unless batch.
1447 (emacs_backtrace): Output backtrace for the appropriate thread,
1448 which is not necessarily the main thread.
1449 * syssignal.h: Include <stdbool.h>.
1450 (emacs_raise): New macro.
1451 * xterm.c (x_connection_signal): Remove; no longer needed
1452 now that we use sigaction.
1453 (x_connection_closed): No need to mess with sigmask now.
1454 (x_initialize): No need to reset SIGPIPE handler here, since
1455 init_signals does this for us now.
1456
8f4635e9
JD
14572012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1458
1459 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 1460 background rect may be larger (Bug#12245).
8f4635e9 1461
3296976d
CY
14622012-09-23 Chong Yidong <cyd@gnu.org>
1463
1464 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1465
d41e491e
PE
14662012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1467
1468 * .gdbinit: Just stop at fatal_error_backtrace.
1469 See Stefan Monnier's request in
1470 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1471 Remove no-longer-used query of system type.
1472
c88b867f
CY
14732012-09-22 Chong Yidong <cyd@gnu.org>
1474
1475 * search.c (Freplace_match): Doc fix (Bug#12325).
1476
1477 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1478
1479 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1480 (Fline_end_position): Doc fix.
1481
1482 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1483
bb4d86b4
CY
14842012-09-22 Chong Yidong <cyd@gnu.org>
1485
1486 * dispextern.h (struct image_type): Add new slot, storing a type
1487 initialization function.
1488
1489 * image.c (define_image_type): Call the image initializer function
1490 if it is defined. Arguments and return value changed.
1491 (valid_image_p, make_image): Callers changed.
1492 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
1493 (gif_type, imagemagick_type, svg_type, gs_type):
1494 Add initialization functions.
bb4d86b4
CY
1495 (Finit_image_library): Call lookup_image_type.
1496 (CHECK_LIB_AVAILABLE): Macro deleted.
1497 (lookup_image_type): Call define_image_type here, rather than via
1498 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1499 (syms_of_image): Move define_image_type calls for xbm_type and
1500 pbm_type to lookup_image_type.
1501
df9685f3
EZ
15022012-09-22 Eli Zaretskii <eliz@gnu.org>
1503
1504 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1505 'idle_timers' from here ...
1506 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1507 lists, to avoid infloops when the timer does something stupid,
1508 like reinvoke itself with the same or smaller time-out.
1509 (Bug#12447)
1510
8e17c9ba
MR
15112012-09-22 Martin Rudalics <rudalics@gmx.at>
1512
1513 * window.c (Fsplit_window_internal): Handle only Qt value of
1514 Vwindow_combination_limit separately.
1515 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
1516 (Vwindow_combination_limit): New default value.
1517 Rewrite doc-string.
8e17c9ba 1518
589bd69b
EZ
15192012-09-22 Eli Zaretskii <eliz@gnu.org>
1520
1521 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1522 the new overlay string. (Bug#10159)
1523
01108e3f
PE
15242012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1525
1526 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1527 or that fprintf is async-signal-safe. POSIX doesn't require
1528 either assumption.
1529
82f8cd94
CY
15302012-09-22 Chong Yidong <cyd@gnu.org>
1531
1532 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1533 (Bug#8207).
1534
3cccbd87
KH
15352012-09-22 Kenichi Handa <handa@gnu.org>
1536
1537 * composite.c (composition_reseat_it): Handle the case that a
1538 grapheme cluster is not covered by a single font (Bug#12352).
1539
09c01941
CY
15402012-09-21 Chong Yidong <cyd@gnu.org>
1541
1542 * image.c (define_image_type): Avoid adding duplicate types to
1543 image_types (Bug#12463). Suggested by Jörg Walter.
1544
acfa068f 15452012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
1546
1547 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1548 (print_load_command_name): Add case LC_DATA_IN_CODE.
1549 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1550
acfa068f 15512012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
1552
1553 * eval.c (Frun_hook_with_args_until_success)
1554 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1555
acfa068f 15562012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
1557
1558 * fileio.c (Ffile_selinux_context): Only call freecon when
1559 lgetfilecon succeeded.
1560 (Fset_file_selinux_context): Likewise. (Bug#12444)
1561
acfa068f 15622012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
1563
1564 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1565 reordering, locate the cursor by calling set_cursor_from_row; if
1566 that fails, clear the desired glyph matrix before returning a
1567 failure indication to the caller. Fixes leaving garbled display
1568 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
1569 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1570 scrolling through multibyte text.
aa36e4d2 1571
e99f70c8
SM
15722012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1573
1574 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1575 calling mark_vectorlike since that's the one that marks the window.
1576 (mark_discard_killed_buffers): Mark the final cdr.
1577 * window.h (struct window): Move prev/next_buffers to the
1578 non-standard fields.
1579 * window.c (make_window): Initialize prev/next_buffers manually.
1580
f75beb47
PE
15812012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1582
1583 Omit unused arg EXPECTED from socket hooks.
1584 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1585 * nsterm.m (ns_term_init):
1586 * termhooks.h (struct terminal.read_socket_hook):
1587 * w32inevt.c (w32_console_read_socket):
1588 * w32term.c (w32_read_socket):
1589 * xterm.c (XTread_socket):
1590 Omit unused arg EXPECTED. All callers changed.
1591 (store_user_signal_events): Return void, not int, since callers no
1592 longer care about the return value. All uses changed.
1593
b019b76a
JB
15942012-09-20 Juanma Barranquero <lekktu@gmail.com>
1595
1596 * w32gui.h (XParseGeometry): Do not declare.
1597
05642592
PE
15982012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1599
e4bce92a
PE
1600 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1601 Ignore 'expected'. See Eli Zaretskii in
1602 <http://bugs.gnu.org/12471#8> (last line).
1603
05642592
PE
1604 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1605 (XParseGeometry): Now static. Substitute extremal values for
1606 values that are out of range.
1607
e543ae91
JD
16082012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1609
1610 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1611
1612 * nsfns.m (XParseGeometry): Remove.
1613 (Fx_create_frame): Call x_set_offset to correctly interpret
1614 top_pos in geometry.
1615
3a880af4 1616 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
1617 (Fx_parse_geometry): If there is a space in string, call
1618 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1619
45ba16c7
EZ
16202012-09-17 Eli Zaretskii <eliz@gnu.org>
1621
c8b9f1bc
EZ
1622 * search.c (scan_buffer): Use character positions in calls to
1623 region_cache_forward and region_cache_backward, not byte
1624 positions. (Bug#12196)
1625
b4c932a2
EZ
1626 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1627 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1628
45ba16c7
EZ
1629 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1630 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1631 emacs_blocked_malloc, now deleted.
1632
eeceac93
PE
16332012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1634
1635 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1636 The workaround was for improving performance on Solaris 2.4, but
1637 is getting in the way now. Emacs will still work if someone is
1638 still running Solaris 2.4 in a museum somewhere; Sun dropped
1639 support for Solaris 2.4 in 2003.
1640 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1641 * process.c (create_process) [HAVE_WORKING_VFORK]:
1642 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1643 since Emacs no longer uses vfork on that platform.
1644
78f83752
GM
16452012-09-17 Glenn Morris <rgm@gnu.org>
1646
1647 * emacs.c: Use COPYRIGHT.
1648
634b8cac
PE
16492012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1650
0caaedb1
PE
1651 Remove configure's --without-sync-input option (Bug#12450).
1652 When auditing signal-handling in preparation for cleaning it up,
1653 I found that SYNC_INPUT has race conditions and would be a real
1654 pain to fix. Since it's an undocumented and deprecated
1655 configure-time option, now seems like a good time to remove it.
1656 Also see <http://bugs.gnu.org/11080#16>.
1657 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1658 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1659 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1660 (malloc_hysteresis):
1661 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1662 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1663 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1664 (dont_register_blocks, bytes_used_when_reconsidered)
1665 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1666 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1667 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1668 Remove. All uses removed.
1669 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1670 implementation, one that depends on whether the new macro
1671 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1672 is defined.
1673 * atimer.c (run_timers, handle_alarm_signal):
1674 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1675 (handle_async_input, process_pending_signals)
1676 (handle_input_available_signal, init_keyboard):
1677 * nsterm.m (ns_read_socket):
1678 * process.c (wait_reading_process_output):
1679 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1680 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1681 (emacs_write):
1682 * xterm.c (XTread_socket):
1683 Assume SYNC_INPUT.
1684 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1685 * eval.c (handling_signal): Remove. All uses removed.
1686 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1687 All uses replaced with the SYNC_INPUT version.
1688 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1689 Remove decls.
1690 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1691 Now static.
1692
634b8cac
PE
1693 * font.c (Ffont_shape_gstring): Remove unused local.
1694
83da1b55
GM
16952012-09-16 Glenn Morris <rgm@gnu.org>
1696
518650a5
GM
1697 * Makefile.in (clean): No longer run nextstep's clean.
1698
83da1b55
GM
1699 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1700 (ns_frag): Remove.
1701 (ns-app): Move here from ns.mk, and simplify.
1702 (clean): Simplify nextstep entry.
1703 * ns.mk: Remove file.
1704
85a43e2e
KH
17052012-09-17 Kenichi Handa <handa@gnu.org>
1706
1707 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1708 not covert the last few charactes.
1709
ba13e616 17102012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
1711
1712 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1713 here, but just check the validity of glyphs in the glyph-string.
1714
a8c729af
MR
17152012-09-16 Martin Rudalics <rudalics@gmx.at>
1716
3a880af4
SM
1717 * window.c (Fwindow_parameter, Fset_window_parameter):
1718 Accept any window as argument (Bug#12452).
a8c729af 1719
c077c059
JD
17202012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1721
1722 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1723 to ns_term_init to avoid memory leak.
1724
1725 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1726 explicit retain/release.
1727 (ns_term_init): Only allow one display. Initialize outerpool and
1728 ns_*_types.
1729
39a57ad0
PE
17302012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1731
1732 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1733 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1734 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1735 the Microsoft problem in a different way, by altering ../nt/config.nt.
1736
7105c8cb
EZ
17372012-09-15 Eli Zaretskii <eliz@gnu.org>
1738
1739 * w32xfns.c:
1740 * w32uniscribe.c:
1741 * w32term.c:
1742 * w32select.c:
1743 * w32reg.c:
1744 * w32proc.c:
1745 * w32menu.c:
1746 * w32inevt.c:
1747 * w32heap.c:
1748 * w32font.c:
1749 * w32fns.c:
1750 * w32console.c:
1751 * w32.c:
1752 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1753 by lisp.h. This completes removal of setjmp.h inclusion
1754 erroneously announced in the previous commit. (Bug#12446)
1755
1756 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1757 more accurate.
1758
1759 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1760 not defined as a macro. The latter happens on MS-Windows.
1761 (Bug#12446)
1762
0328b6de
PE
17632012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1764
1765 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1766 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 1767 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
1768 only reason for the instance was because "lisp.h" was included.
1769 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1770 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1771 and _longjmp with the new symbols. Emacs already uses _setjmp if
1772 available, so this change affects only POSIXish hosts that have
1773 sigsetjmp but not _setjmp, such as some versions of Solaris and
1774 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1775 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1776 (png_load_body) [HAVE_PNG]:
1777 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1778 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1779 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1780 since PNG requires jmp_buf. This is the only exception to the
1781 general rule that we now use sys_setjmp and sys_longjmp.
1782 This exception is OK since this code does not change the signal
1783 mask or longjmp out of a signal handler.
1784
2af03429
PE
17852012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1786
1787 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1788 Include "syssignal.h", for 'main_thread'.
1789
2f294edf
DA
17902012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1791
1792 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
1793 * insdel.c (replace_range, replace_range_2):
1794 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
1795 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1796 Remove redundant check before calling offset_intervals.
1797
6b533e9c
MR
17982012-09-14 Martin Rudalics <rudalics@gmx.at>
1799
1800 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1801 current buffer (Bug#12387).
1802
2a7931e3
JB
18032012-09-14 Juanma Barranquero <lekktu@gmail.com>
1804
1805 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1806
c18e885b
PE
18072012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1808
1809 Use a more backwards-compatible timer format (Bug#12430).
1810 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1811 vector element, not from the 4th, since PSECS is now at the end.
1812 (Fcurrent_idle_time): Doc fix.
1813
d59a1afb
DA
18142012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1815
1816 Function to mark objects and remove killed buffers at once.
1817 * alloc.c (discard_killed_buffers): Rename to ...
1818 (mark_discard_killed buffers) ... new name. Add marking
1819 of remaining objects. Fix comment. Adjust users.
1820 (mark_object): Do not touch frame buffer lists here.
1821 * frame.c (delete_frame): Reset frame buffer lists here.
1822
5f0cb45a
PE
18232012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1824
8ea47e3a
PE
1825 Better workaround for GNOME bug when --enable-gcc-warnings.
1826 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1827 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1828 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1829
4a4bbad2
PE
1830 Simplify SIGIO usage (Bug#12408).
1831 The code that dealt with SIGIO was crufty and confusing, e.g., it
1832 played tricks like "#undef SIGIO" but these tricks were not used
1833 consistently. Simplify mostly by not #undeffing standard symbols,
1834 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1835 or not as we please) rather than "defined SIGIO" (standard symbol
1836 that we probably shouldn't #undef).
1837 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1838 Modules that need it can include it.
1839 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1840 * dispextern.h (ignore_sigio): New decl.
1841 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1842 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1843 * emacs.c (shut_down_emacs):
1844 * keyboard.c (kbd_buffer_store_event_hold):
1845 Use ignore_sigio rather than invoking 'signal' directly.
1846 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1847 for FIONREAD.
1848 (FIONREAD, SIGIO): Do not #undef.
1849 (tty_read_avail_input): Use #error rather than a syntax error.
1850 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1851 for I_PIPE, used by SETUP_SLAVE_PTY.
1852 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1853 * sysdep.c (croak): Remove; no longer needed. This bit of
1854 temporary code, with Fred N. Fish's comment that it's temporary,
1855 has been in Emacs since at least 1992!
1856 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1857 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1858 * syssignal.h (croak): Remove decl.
1859 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1860 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1861 now that we're termios-only.
1862 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1863 * term.c (dissociate_if_controlling_tty): Use #error rather than
1864 a run-time error.
1865
5f0cb45a
PE
1866 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1867 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1868 to work around GNOME bug 683906.
1869 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1870 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1871 This works around GCC bug 54561.
1872
40bce90b
PE
18732012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1874
1875 More fixes for 'volatile' and setjmp/longjmp.
1876 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1877 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1878 (png_load_body) [HAVE_PNG]:
1879 (jpeg_load_body) [HAVE_JPEG]:
1880 New function, with most of the old parent function's body.
1881 (png_load) [HAVE_PNG]:
1882 (jpeg_load) [HAVE_JPEG]:
1883 Invoke the new function, to avoid longjmp munging our locals.
1884 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1885 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1886 longjmp is passed 2, as the C standard doesn't guarantee this.
1887 Instead, store the failure code into mgr->failure_code.
1888
bfeae2cf
SM
18892012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1890
1891 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1892 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1893 (syms_of_keyboard): Remove support for unread-command-char.
1894
8099e36b
EZ
18952012-09-12 Eli Zaretskii <eliz@gnu.org>
1896
1897 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1898 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1899 violation. (Bug#12426)
1900
92547ff9
PE
19012012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1902
1903 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1904
45b82ad0
SM
19052012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1906
1907 * eval.c: Add `inhibit-debugger'.
1908 (Qinhibit_debugger): New symbol.
1909 (call_debugger): Bind it instead of Qdebug_on_error.
1910 (maybe_call_debugger): Test Vinhibit_debugger.
1911 (syms_of_eval): Define inhibit-debugger.
1912 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1913 (syms_of_xdisp): Remove inhibit-debug-on-message.
1914
5779a1dc
PE
19152012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1916
50f2e553
PE
1917 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1918 If a nonvolatile local variable is written before a _longjmp to
1919 the frame containing the variable, and is read after the _longjmp,
1920 the value read is indeterminate. Some local variables of type
1921 'struct handler' and 'struct catchtag' are used in this way, so
1922 mark each of their slots as volatile if the slot can be set before
1923 _longjmp and read afterwards.
1924 * lisp.h (struct handler): var and chosen_clause are now volatile.
1925 (struct catchtag): val, next, and pdlcount are now volatile.
1926
ae1d87e2
PE
1927 * bidi.c (bidi_push_it, bidi_pop_it):
1928 * fns.c (copy_hash_table):
1929 * image.c (define_image_type):
1930 * keyboard.c (kbd_buffer_store_event_hold):
1931 * process.c (Fprocess_send_eof):
1932 * xfaces.c (x_create_gc) [HAVE_NS]:
1933 * xgselect.c (xg_select):
1934 Prefer assignment to memcpy when either will do.
1935
5779a1dc
PE
1936 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1937 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1938 time an item is removed. No need to mark this function 'inline';
1939 the compiler knows better than we do.
1940
c4c9756b
JD
19412012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1942
1943 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1944 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1945 to change_frame_size (Bug#12388).
1946 (windowDidResize:): Pass YES to updateFrameSize.
1947
1948 * nsterm.h: Add delay parameter to updateFrameSize.
1949
d73e321c
DA
19502012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1951
1952 Discard killed buffers from deleted window and frame objects.
1953 This reduces an amount of references to killed buffers and
1954 helps GC to reclaim them faster.
1955 * alloc.c (discard_killed_buffers): New function.
1956 (mark_object): Use it for deleted windows and frames.
1957 (mark_object): If symbol's value is set up for a killed buffer
1958 or deleted frame, restore it's global binding.
1959 * data.c (swap_in_global_binding): Add GC notice.
1960 (swap_in_symval_forwarding): Use convenient set_blv_where.
1961 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1962 * window.h: ... to here.
1963
e578f381
DA
19642012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1965
1966 Convenient macro to check whether the buffer is live.
1967 * buffer.h (BUFFER_LIVE_P): New macro.
1968 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1969 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1970
3057e615
YM
19712012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1972
1973 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1974 composition cases (Bug#12364).
1975
1976 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1977 overhang of succeeding glyphs overlapping box cursor.
1978
1979 * w32term.c (x_draw_glyph_string): Likewise.
1980
6fda35f2
PE
19812012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1982
c990426a
PE
1983 Simplify, document, and port floating-point (Bug#12381).
1984 The porting part of this patch fixes bugs on non-IEEE platforms
1985 with frexp, ldexp, logb.
1986 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1987 Now static.
1988 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1989 support, by removing commented-out code and briefly listing the
1990 C89 functions excluded. The commented-out stuff was confusing
1991 maintenance, e.g., we thought we needed cbrt but it was commented out.
1992 (logb): Remove decl; no longer needed.
1993 (isfinite): New macro, if not already supplied.
1994 (isnan): Don't replace any existing macro.
1995 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1996 are present on all C89 platforms.
1997 (Ffrexp): Do not special-case zero, as frexp does the right thing
1998 for that case.
1999 (Flogb): Do not use logb, as it doesn't have the desired meaning
2000 on hosts that use non-base-2 floating point. Instead, stick with
2001 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2002 frexp, to avoid getting an unspecified result.
2003
6fda35f2
PE
2004 * xdisp.c (Qinhibit_debug_on_message): Now static.
2005
16130a58
JD
20062012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2007
2008 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2009 NSBezierPath (Bug#12131).
2010
d105a573
CY
20112012-09-10 Chong Yidong <cyd@gnu.org>
2012
2013 * fns.c (Fdelq, Fdelete): Doc fix.
2014
ff55dfe8
PE
20152012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2016
2017 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2018 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2019
e7032e7c
SM
20202012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2021
2022 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2023 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2024 Use it.
2025
e9957956
EZ
20262012-09-09 Eli Zaretskii <eliz@gnu.org>
2027
aba05ce9
EZ
2028 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2029 left fringe if the window has a left margin. This avoids leaving
2030 traces of the cursor because its leftmost pixel is not drawn over.
2031
e9957956
EZ
2032 * dispnew.c (update_window_line): When the left margin area of a
2033 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2034 that screen line. (Bug#12277)
2035
f6196b87
PE
20362012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2037
2038 Assume C89 or later for math functions (Bug#12381).
2039 This simplifies the code, and makes it a bit smaller and faster,
2040 and (most important) makes it easier to clean up signal handling
2041 since we can stop worring about floating-point exceptions in
2042 library code. That was a problem before C89, but the problem
2043 went away many years ago on all practical Emacs targets.
2044 * data.c, image.c, lread.c, print.c:
2045 Don't include <math.h>; no longer needed.
2046 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2047 might be autoconfigured, as that never happens.
2048 * data.c (fmod):
2049 * doprnt.c (DBL_MAX_10_EXP):
2050 * print.c (DBL_DIG):
2051 Remove. C89 or later always defines these.
2052 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2053 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2054 (arith_error, domain_error, domain_error2):
2055 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2056 no longer needed -- we simply return what C returns. All uses removed.
2057 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2058 the wrapped code.
2059 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2060 Remove. All uses expanded, as these macros are no longer used
2061 more than once and are now more trouble than they're worth.
2062 (Ftan): Use tan, not sin / cos.
2063 (Flogb): Assume C89 frexp.
2064 (fmod_float): Assume C89 fmod.
2065 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2066 (init_floatfns): Remove. All uses removed.
2067
9d7f1863
JD
20682012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2069
2070 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2071 compositeToPoint for OSX < 10.6 (Bug#12390).
2072
eabf0404
PE
20732012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2074
2075 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2076 This produces more-accurate results.
2077
0b3b1d23
JD
20782012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2079
2080 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2081 changes (Bug#12088).
2082
6dcef6ec
CY
20832012-09-08 Chong Yidong <cyd@gnu.org>
2084
2085 * syntax.c (Fstring_to_syntax): Doc fix.
2086
aa7d57c5
JD
20872012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2088
2089 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2090 in the internal border.
2091 (x_set_window_size): Remove static variables and their usage.
2092 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
2093 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2094 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
2095 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2096 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2097 (ns_fix_rect_ibw): Remove.
2098 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2099 (ns_dumpglyphs_box_or_relief): Ditto.
2100 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2101 adjustment.
2102 (ns_dumpglyphs_image): Ditto.
fc0c31f8 2103 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
2104 border adjustment.
2105 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2106 their usage. Add fringe_extended_p and its use as in other terms.
2107 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2108 scroll bar was removed.
2109 (updateFrameSize): New function.
2110 (windowDidResize): Move code to updateFrameSize and call it.
2111
2112 * nsterm.h (EmacsView): Add updateFrameSize.
2113
1a5432bc
CY
21142012-09-07 Chong Yidong <cyd@gnu.org>
2115
b4f5313e
CY
2116 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2117
1a5432bc
CY
2118 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2119
1a4f1e9b
PE
21202012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2121
2122 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
2123 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2124 Problem introduced when merging patches. Noted by Eli Zaretskii in
2125 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
2126 * floatfns.c: Comment fix.
2127 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2128 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2129 and anyway the declaration is harmless even if SIGDANGER is not defined.
2130 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2131 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2132 source files not surprisingly expected syssignal.h to define, or
2133 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2134 Include <sys/ioctl.h>, for FIONREAD.
2135 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2136 This eliminates a problem whereby other files mysteriously had
2137 to include "syssignal.h" before including "systty.h" if they
2138 wanted to use "#ifdef SIGIO".
2139
bc8000ff
EZ
21402012-09-07 Eli Zaretskii <eliz@gnu.org>
2141
3e6d6928
EZ
2142 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2143
2144 * w32.c (sigemptyset): Empty the set.
2145 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2146
bc8000ff
EZ
2147 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2148
b4fa72f2
DA
21492012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2150
2151 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2152 (mark_object): Likewise for frame objects.
2153
30730c93
PE
21542012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2155
2156 * syssignal.h (handle_on_main_thread): Always declare,
2157 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2158 This ports to platforms without HAVE_PTHREAD.
2159
2fe28299
PE
21602012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2161
2162 Signal-handler cleanup (Bug#12327).
2163 Emacs's signal handlers were written in the old 4.2BSD style with
2164 sigblock and sigmask and so forth, and this led to some
2165 inefficiencies and confusion. Rewrite these to use
2166 pthread_sigmask etc. without copying signal sets around. Also,
2167 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2168 'signal', and instead use functions that do not attempt to take
2169 over the system name space. This patch causes Emacs's text
2170 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2171 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2172 Do not include <signal.h> or "syssignal.h", as these
2173 modules do not use signals.
2174 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2175 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2176 Do not include <signal.h>, as "syssignal.h" does that for us now.
2177 * atimer.c (sigmask_atimers): New function.
2178 (block_atimers, unblock_atimers): New functions,
2179 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2180 All uses replaced.
2181 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2182 no longer needed here.
2183 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 2184 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
2185 * sysdep.c (struct save_signal): New member 'action', replacing
2186 old member 'handler'.
2187 (save_signal_handlers, restore_signal_handlers):
2188 Use sigaction instead of 'signal' to save and restore.
2189 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2190 New function. All users of 'signal' modified to use set_sighandler
2191 if they're writeonly, and to use sys_signal if they're read+write.
2192 (emacs_sigaction_init, forwarded_signal): New functions.
2193 (sys_signal): Remove. All uses replaced by calls to sigaction
2194 and emacs_sigaction_init, or by direct calls to 'signal'.
2195 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2196 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2197 all uses replaced by pthread_sigmask etc. calls.
2198 * syssignal.h: Include <signal.h>.
2199 (emacs_sigaction_init, forwarded_signal): New decls.
2200 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2201 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2202 (sigmask, sys_sigmask): Remove; no longer needed.
2203 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2204 (sigblock, sigunblock, sigfree):
2205 (sigsetmask) [!defined sigsetmask]:
2206 Remove. All uses replaced by pthread_sigmask.
2207 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2208 no longer need to be replaced, and its typical old uses
2209 are now done via emacs_sigaction_init and sigaction.
2210 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2211 (sys_sigdel): Remove; unused.
2212 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2213
0216c128
EZ
22142012-09-06 Eli Zaretskii <eliz@gnu.org>
2215
2216 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2217 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2218
c752cfa9
DA
22192012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2220
2221 Explicitly mark buffer_defaults and buffer_local_symbols.
2222 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2223 mark_local_symbols here.
2224 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2225 since special buffers aren't marked here any more.
2226 (allocate_buffer): Chain new buffer with all_buffers here...
2227 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2228 not here.
2229 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2230 (syms_of_buffer): Remove staticpro of the above.
2231 (init_buffer_once): Set names for buffer_defaults and
2232 buffer_local_symbols.
2233
a864ef14
PE
22342012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2235
2236 Use bool for booleans in font-related modules.
2237 * font.c (font_intern_prop, font_style_to_value)
2238 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2239 (generate_otf_features, font_check_otf_features, font_check_otf)
2240 (font_match_p, font_list_entities, font_at):
2241 * fontset.c (fontset_id_valid_p, reorder_font_vector
2242 (fontset_find_font, Fset_fontset_font)
2243 (face_suitable_for_char_p) [0]:
2244 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2245 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2246 (m17n_flt_initialized, ftfont_shape_by_flt):
2247 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2248 * nsfont.m (nsfont_draw):
2249 * w32font.c (w32font_draw):
2250 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2251 Use bool for booleans.
2252 * font.h: Adjust to above API changes.
2253 (struct font, struct font_driver, struct font_driver_list):
2254 Use bool for booleans.
2255 (struct font): Remove useless member encoding_type.
2256 All users removed.
2257 * fontset.c, xftfont.c: Omit unnecessary static decls.
2258
0699fc18
DA
22592012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2260
2261 * alloc.c (mark_object): Revert window marking code
2262 since it's unsafe for the Fset_window_configuration.
2263
20ef56db
PE
22642012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2265
2fe28299 2266 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
2267 Be more systematic about preserving errno whenever a signal
2268 handler returns, even if it's not in the main thread. Do this by
2269 renaming signal handlers to distinguish between signal delivery
2270 and signal handling. All uses changed.
2271 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2272 * data.c (deliver_arith_signal): Rename from arith_error.
2273 * dispnew.c (deliver_window_change_signal): Rename from
2274 window_change_signal.
2275 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2276 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2277 * keyboard.c (deliver_input_available_signal): Rename from
2278 input_available_signal.
2279 (deliver_user_signal): Rename from handle_user_signal.
2280 (deliver_interrupt_signal): Rename from interrupt_signal.
2281 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2282 (deliver_child_signal): Rename from sigchld_handler.
2283 * atimer.c (handle_alarm_signal):
2284 * data.c (handle_arith_signal):
2285 * dispnew.c (handle_window_change_signal):
2286 * emacs.c (handle_fatal_signal, handle_danger_signal):
2287 * keyboard.c (handle_input_available_signal):
2288 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2289 * process.c (handle_pipe_signal, handle_child_signal):
2290 New functions, with the actual signal-handling code taken from the
2291 original respective signal handlers, sans the sporadic attempts to
2292 preserve errno, since that's now done by handle_on_main_thread.
2293 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2294 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2295 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2296 Move to sysdep.c.
2297 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2298 Move initialization of main_thread to sysdep.c's init_signals.
2299 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2300 our usage, and simplifies the mainline code.
2301 (record_child_status_change): New static function, as a helper
2302 for handle_child_signal, and with most of the old child handler's
2303 contents.
2304 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2305 (handle_child_signal): Use the above.
2306 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2307 Moved here from emacs.c.
2308 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2309 code moved here from emacs.c's main function.
2310 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
2311 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2312 This lets callers save and restore errno properly.
20ef56db 2313
e3ccf108
DA
23142012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2315
2316 Remove redundant or unused things here and there.
2317 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2318 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2319 * editfns.c (Fcompare_buffer_substrings): Likewise.
2320 * frame.h (struct terminal, struct font_driver_list):
2321 Remove redundant declarations.
2322 * window.h (Qleft, Qright): Likewise.
2323
697e1e39
DA
23242012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2325
2326 Do not mark objects from deleted buffers, windows and frames.
2327 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2328 (mark_object): Likewise for windows and frames.
2329
c1ca42ca
DA
23302012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2331
2332 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2333 buffer_defaults and buffer_local_symbols as valid objects.
2334 Return special value to denote them.
2335
014d93be
PE
23362012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2337
f75d7a91
PE
2338 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2339 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2340 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2341 (file_name_absolute_p, Fsubstitute_in_file_name):
2342 (check_executable, check_writable, Ffile_accessible_directory_p)
2343 (Fset_file_selinux_context, Fdefault_file_modes)
2344 (Finsert_file_contents, choose_write_coding_system)
2345 (Fwrite_region, build_annotations, a_write, e_write)
2346 (Fdo_auto_save):
2347 * filelock.c (boot_time_initialized, get_boot_time)
2348 (get_boot_time_1, lock_file_1, within_one_second):
2349 * floatfns.c (in_float):
2350 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2351 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2352 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2353 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2354 * window.c (compare_window_configurations):
2355 Use bool for booleans.
2356 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2357 (Fdefault_file_modes): Now mode_t, not int, for modes.
2358 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2359 (internal_delete_file): Now returns void, not a (boolean) int,
2360 since nobody was looking at the return value.
2361 * lisp.h, window.h: Adjust to above API changes.
2362
014d93be
PE
2363 * xdisp.c (set_message): Simplify and reindent last change.
2364
776f29e1
JB
23652012-09-05 Juanma Barranquero <lekktu@gmail.com>
2366
2367 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2368
7f7e0167
LI
23692012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2370
2371 * eval.c (call_debugger): Make the function non-static so that we
2372 can call it from set_message.
2373
2374 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2375 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2376
cf29dd84
PE
23772012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2378
2379 Give more-useful info on a fatal error (Bug#12328).
2380 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2381 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2382 of doing the work ourselves.
2383 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2384 do most of the work.
2385 (fatal_error_backtrace): New function, taken from the guts
2386 of the old fatal_error_signal, but with a new option to output
2387 a backtrace.
2388 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2389 info about the signal than just its number.
2390 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2391 * sysdep.c: Include <execinfo.h>
2392 (emacs_backtrace): New function, taken partly from the previous
2393 code of the 'die' function.
2394 (emacs_abort): Call fatal_error_backtrace rather than abort.
2395
972debf2
SM
23962012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2397
2398 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2399 eager (load-time) macro-expansion.
2400 * lisp.mk (lisp): Add macroexp.
2401
1088b922
PE
24022012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2403
2404 Simplify redefinition of 'abort' (Bug#12316).
2405 Do not try to redefine the 'abort' function. Instead, redo
2406 the code so that it calls 'emacs_abort' rather than 'abort'.
2407 This removes the need for the NO_ABORT configure-time macro
2408 and makes it easier to change the abort code to do a backtrace.
2409 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2410 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2411 Remove; sysdep.c's emacs_abort now takes its place.
2412 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2413 'abort' changed to use 'emacs_abort'.
2414 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2415 (abort) [!defined abort]: Rename to ...
2416 (emacs_abort): ... new name.
2417 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2418 the place of the old 'abort' in emacs.c.
2419 * w32.c, w32fns.c (abort): Do not #undef.
2420 * w32.c (emacs_abort): Rename from w32_abort.
2421
30934d33
EZ
24222012-09-04 Eli Zaretskii <eliz@gnu.org>
2423
2424 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2425 offsets[j].dv, since the y axis of the screen coordinates points
2426 down, while the y axis of the font definition coordinates points
2427 up. This fixes display of Arabic diacritics such as KASRA and
2428 KASRATAN. (Bug#11860)
2429
af26b72c
PE
24302012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2431
2432 Be more systematic about _setjmp vs setjmp.
2433 * alloc.c (test_setjmp, mark_stack):
2434 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2435 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2436 (png_load, my_error_exit, jpeg_load):
2437 * process.c (send_process_trap, send_process):
2438 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2439 The underscored versions are up to 30x faster on some hosts.
2440 Formerly, the code used setjmp+longjmp sometimes and
2441 _setjmp+_longjmp at other times, with no particular reason to
2442 prefer setjmp+longjmp.
2443
26d4541d
PE
24442012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2445
d42f4f0f 2446 Fix minor problem found by static checking.
26d4541d 2447 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 2448
c5e28e39
MR
24492012-09-03 Martin Rudalics <rudalics@gmx.at>
2450
2451 * buffer.c (Fdelete_all_overlays): New function.
2452
3eab3ca9
CY
24532012-09-03 Chong Yidong <cyd@gnu.org>
2454
2455 * gtkutil.c: Add extern decl for Qxft.
2456
c04889f8
PE
24572012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2458
1882aa38
PE
2459 * emacs.c, eval.c: Use bool for boolean.
2460 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2461 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2462 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2463 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2464 (main, decode_env_path, Fdaemon_initialized):
2465 * eval.c (call_debugger, Finteractive_p, interactive_p):
2466 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2467 (maybe_call_debugger, Fbacktrace):
2468 * process.c (read_process_output, exec_sentinel):
2469 Use bool for booleans.
2470 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2471 All callers changed.
2472 * eval.c (interactive_p): Omit always-true boolean argument
2473 EXCLUDE_SUBRS_P. All callers changed.
2474 * dispextern.h, lisp.h: Reflect above API changes.
2475 * firstfile.c (dummy): Use the address of 'main', whose signature
2476 won't change, instead of the address of 'initialize', whose
2477 signature just changed from int to bool.
2478 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2479 * msdos.c (fatal_error_in_progress): ... from here.
2480 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2481 of incrementing it.
2482 (redisplay_internal, unwind_redisplay): Simply clear
2483 REDISPLAYING_P when unwinding, instead of saving its previous,
2484 always-false value and then restoring it.
2485
a411ac43
PE
2486 Clean up some extern decls.
2487 Mostly, this hoists extern decls out of .c files and into .h files.
2488 That way, we're more likely to catch errors if the interfaces change.
2489 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2490 declare xg_mark_data.
2491 * dispextern.h (x_frame_parm_handlers):
2492 * font.h (Qxft):
2493 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2494 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2495 (Qultra_bold, Qoblique, Qitalic):
2496 Move extern decl here from .c file.
2497 * alloc.c (xg_mark_data) [USE_GTK]:
2498 * doc.c (Qclosure):
2499 * eval.c (Qlexical_binding):
2500 * fns.c (time) [!HAVE_UNISTD_H]:
2501 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2502 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2503 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2504 * lread.c (Qinternal_interpreter_environment):
2505 * minibuf.c (Qbuffer):
2506 * process.c (QCfamily, QCfilter):
2507 * widget.c (free_frame_faces):
2508 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2509 * xfont.c (x_clear_errors):
2510 * xterm.c (x_frame_parm_handlers):
2511 Remove now-redundant extern decls.
2512 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2513 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2514 Now static.
2515 * xfaces.c: Remove unnecessary static decls.
2516 * xterm.c (updating_frame): Remove decl of nonexistent object.
2517
c04889f8
PE
2518 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2519 when building globals.h, as the objects that are not built on
2520 this host are not needed to compile C files on this host.
2521
8b339673
JD
25222012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2523
2524 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2525
2526 * frame.h: Add missing prototype for x_wm_set_size_hint.
2527
a08d4ba7
PE
25282012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2529
2530 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2531 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2532 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2533 (Fsubstitute_command_keys):
2534 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2535 (save_excursion_save, save_excursion_restore)
2536 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2537 (format_time_string, general_insert_function)
2538 (make_buffer_string, make_buffer_string_both)
2539 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2540 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2541 (copy_text, insert_1, insert_1_both, insert_from_string)
2542 (insert_from_string_before_markers, insert_from_string_1)
2543 (insert_from_buffer, insert_from_buffer_1, replace_range)
2544 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2545 (del_range_2, modify_region):
2546 * intervals.c (intervals_equal, balance_possible_root_interval)
2547 (adjust_intervals_for_insertion, merge_properties_sticky)
2548 (graft_intervals_into_buffer, lookup_char_property)
2549 (adjust_for_invis_intang, set_point_both)
2550 (get_property_and_range, compare_string_intervals)
2551 (set_intervals_multibyte_1, set_intervals_multibyte):
2552 * keyboard.c (decode_timer):
2553 Use bool for boolean.
2554 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2555 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2556
48c948de
CY
25572012-09-02 Chong Yidong <cyd@gnu.org>
2558
2559 * keymap.c (push_key_description): Print M-TAB as C-M-i
2560 (Bug#11758).
2561
6c49a40b
JB
25622012-09-02 Juanma Barranquero <lekktu@gmail.com>
2563
2564 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2565 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2566 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2567 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2568 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2569 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2570 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2571
4dfbd238
EZ
25722012-09-01 Eli Zaretskii <eliz@gnu.org>
2573
7e510e28
EZ
2574 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2575 more than one grapheme cluster passed to the shaper: compute the
2576 offset adjustment values separately for each cluster. (Bug#11860)
2577
4dfbd238
EZ
2578 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2579 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2580 about implicit conversions from integer to pointer.
2581
86571ae0
DC
25822012-09-01 Daniel Colascione <dancol@dancol.org>
2583
2584 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2585 system used too early.
2586
0e23ef9d
PE
25872012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2588
2589 Better seed support for (random).
2590 * emacs.c (main): Call init_random.
2591 * fns.c (Frandom): Set the seed from a string argument, if given.
2592 Remove long-obsolete Gentzel cruft.
2593 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2594 (init_random): New function.
2595
17a2cbbd
DC
25962012-09-01 Daniel Colascione <dancol@dancol.org>
2597
2598 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2599 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2600 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2601 x_wm_set_size_hint, x_query_colors, x_real_positions,
2602 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2603 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2604 all of which have been moved to common code.
2605
2606 * xfaces.c: Include TERM_HEADER instead of listing all possible
2607 window-system headers.
2608
2609 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2610 to match header.
2611
2612 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2613 directly accessing frame internals.
2614
f18cbb28 2615 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
2616 globals_of_w32font.
2617
2618 * process.c: Include TERM_HEADER instead of listing all possible
2619 window-system headers.
2620
3a880af4
SM
2621 * nsterm.h: Remove declarations now in frame.h.
2622 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
2623
2624 * menu.c: Include TERM_HEADER instead of listing all possible
2625 window-system headers.
2626
2627 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2628 window system.
2629
2630 * keyboard.c: Include TERM_HEADER instead of listing all possible
2631 window-system headers.
2632
2633 * image.c: Include TERM_HEADER instead of listing all possible
2634 window-system headers. Declare Vlibrary_cache when compiling for
2635 Windows.
2636
2637 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2638 window system declarations.
2639
2640 * frame.h: Move common functions here: set_frame_menubar,
2641 x_set_window_size, x_sync, x_get_focus_frame,
2642 x_set_mouse_position, x_set_mouse_pixel_position,
2643 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2644 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2645 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2646 x_activate_menubar, x_real_positions, x_bitmap_icon,
2647 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2648 and x_query_colors.
2649
2650 * frame.c: Include TERM_HEADER instead of listing all possible
2651 window-system headers.
2652
2653 * font.c: Include TERM_HEADER instead of listing all possible
2654 window-system headers.
2655
2656 * emacs.c: Include TERM_HEADER.
2657
f18cbb28
EZ
2658 * dispnew.c: Include TERM_HEADER instead of listing all possible
2659 window-system headers.
17a2cbbd 2660
f18cbb28 2661 * ccl.h: Include character.h.
17a2cbbd
DC
2662
2663 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2664 the current window system; include in list of objects to link into
2665 Emacs.
2666
c650a5de
DA
26672012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2668
2669 Remove mark_ttys function and fix tty_display_info initialization.
2670 * lisp.h (mark_ttys): Remove prototype.
2671 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2672 to mark_ttys because all possible values of 'top_frame' slot are
2673 the frames which are reachable from Vframe_list.
2674 * term.c (mark_ttys): Remove.
2675 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2676
4e0f6479
DA
26772012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2678
2679 Change struct frame bitfields from unsigned char to unsigned.
2680 * frame.h (struct frame): Change type of 'display_preempted',
2681 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2682 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2683 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2684 bitfields from unsigned char to unsigned.
2685
8b96a52c
DA
26862012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2687
2688 Remove unused member of struct x_output and struct w32_output.
2689 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2690 * w32term.h (struct w32_output): Likewise.
2691
b4444c8a
JD
26922012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2693
2694 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2695 does not become zero (Bug#12234).
2696
b98521db
PE
26972012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2698
2699 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2700 for GCC 4.7.1 x86-64.
2701
31d02438
GM
27022012-08-30 Glenn Morris <rgm@gnu.org>
2703
2704 * lread.c (init_lread): For out-of-tree builds, only add the
2705 source directory's site-lisp dir to the load-path if it exists,
2706 consistent with in-tree builds. (Bug#12302)
2707
7f8941d8
JD
27082012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2709
2710 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 2711 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
2712 (windowShouldClose:): Set window_closed.
2713 (dealloc): New member, free button_values.
fc0c31f8
JB
2714 (process_dialog:): Make member function. Remove window argument,
2715 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
2716 in button_values.
2717 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 2718 with tag. Remove return self, declare return value as void.
7f8941d8
JD
2719 (addString:row:): Remove return self, declare return value as void.
2720 (addSplit): Remove return self, declare return value as void.
2721 (clicked:): Remove return self, declare return value as void.
fc0c31f8 2722 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
2723 (initFromContents:isQuestion:): Adjust call to process_dialog.
2724 Code formatting change.
2725 (timeout_handler:): Set timer_fired to YES.
2726 (runDialogAt:): Set timer_fired to NO.
2727 Handle click on close button as quit.
2728
2729 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2730 Add window_closed and button_values. Add void as return value for
2731 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2732 Add process_dialog as new member.
2733
eada0861 27342012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 2735
eada0861
GM
2736 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2737 is not one of the heaps we manage. (Bug#12242)
2738
27392012-08-28 Glenn Morris <rgm@gnu.org>
2740
2741 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2742
457294dd
MR
27432012-08-28 Martin Rudalics <rudalics@gmx.at>
2744
2745 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
2746 auto-buffer-name window parameter. Install revision of reverted
2747 fix.
457294dd 2748
4f2daf31
DA
27492012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2750
2751 Do not allow to set major mode for a dead buffer.
2752 * buffer.c (Fset_buffer_major_mode): Signal an error
2753 if the buffer is dead.
2754 (Fother_buffer, other_buffer_safely): Remove redundant
2755 nested declaration.
2756
66322887
DA
27572012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2758
2759 Always use set_buffer_if_live to restore original buffer at unwind.
2760 * buffer.h (record_unwind_current_buffer): New function.
2761 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2762 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2763 * undo.c, window.c: Adjust users.
2764 * buffer.c (set_buffer_if_live): Fix comment.
2765
a3d794a1
DA
27662012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2767
2768 Fix usage of set_buffer_internal.
2769 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2770 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2771 * coding.c (decode_coding): Omit redundant test.
2772 * fileio.c (decide_coding_unwind): Likewise.
2773 * fns.c (secure_hash): Likewise.
2774 * insdel.c (modify_region): Likewise.
2775 * keyboard.c (command_loop_1): Likewise.
2776 * print.c (PRINTFINISH): Likewise.
2777 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2778
59ea14cd
PE
27792012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2780
2781 * dispnew.c: Use bool for boolean.
2782 (frame_garbaged, display_completed, delayed_size_change)
2783 (fonts_changed_p, add_window_display_history)
2784 (add_frame_display_history, verify_row_hash)
2785 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2786 (row_equal_p, realloc_glyph_pool)
2787 (allocate_matrices_for_frame_redisplay)
2788 (showing_window_margins_p)
2789 (adjust_frame_glyphs_for_frame_redisplay)
2790 (build_frame_matrix_from_leaf_window, make_current)
2791 (mirrored_line_dance, mirror_line_dance, update_frame)
2792 (update_window_tree, update_single_window)
2793 (check_current_matrix_flags, update_window, update_text_area)
2794 (update_window_line, set_window_update_flags, scrolling_window)
2795 (update_frame_1, scrolling, buffer_posn_from_coords)
2796 (do_pending_window_change, change_frame_size)
2797 (change_frame_size_1, sit_for):
2798 Use bool for boolean.
2799 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2800 and remove last int (actually boolean) argument, which was always 0.
2801 All callers changed.
2802 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2803 * dispextern.h (struct composition_it): Use bool for boolean.
2804 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2805 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2806 * dired.c (file_name_completion):
2807 Use bool for boolean. (This was missed in an earlier change.)
2808
95072a94
MR
28092012-08-27 Martin Rudalics <rudalics@gmx.at>
2810
2811 * window.c (Fset_window_configuration): Revert first part of
2812 last change.
2813
0f19feff
JD
28142012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2815
2816 * nsterm.h (NSPanel): New class variable dialog_return.
2817
3a880af4
SM
2818 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2819 Initialize dialog_return.
0f19feff
JD
2820 (windowShouldClose:): Use stop instead of stopModalWithCode.
2821 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2822 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2823 event.
2824 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2825 modal loop returns.
2826
f10fe38f
PE
28272012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2828
de1339b0
PE
2829 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2830 * composite.c (find_composition, composition_gstring_p)
2831 (composition_reseat_it, find_automatic_composition):
2832 * data.c (let_shadows_buffer_binding_p)
2833 (let_shadows_global_binding_p, set_internal, make_blv)
2834 (Fmake_variable_buffer_local, Fmake_local_variable)
2835 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2836 (cons_to_signed, arith_driver):
2837 * dbusbind.c (xd_in_read_queued_messages):
2838 * dired.c (directory_files_internal, file_name_completion):
2839 Use bool for booleans.
2840 * dired.c (file_name_completion):
2841 * process.h (fd_callback):
2842 Omit int (actually boolean) argument. It wasn't being used.
2843 All uses changed.
2844 * composite.h, lisp.h: Reflect above API changes.
2845
f10fe38f
PE
2846 * cmds.c, coding.c: Use bool for booleans.
2847 * cmds.c (move_point, Fself_insert_command):
2848 * coding.h (struct composition status, struct coding_system):
2849 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2850 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2851 (emacs_mule_char, decode_coding_emacs_mule)
2852 (encode_coding_emacs_mule, detect_coding_iso_2022)
2853 (decode_coding_iso_2022, encode_invocation_designation)
2854 (encode_designation_at_bol, encode_coding_iso_2022)
2855 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2856 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2857 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2858 (encode_coding_raw_text, detect_coding_charset)
2859 (decode_coding_charset, encode_coding_charset, detect_eol)
2860 (detect_coding, get_translation_table, produce_chars)
2861 (consume_chars, reused_workbuf_in_use)
2862 (make_conversion_work_buffer, code_conversion_save)
2863 (decode_coding_object, encode_coding_object)
2864 (detect_coding_system, char_encodable_p)
2865 (Funencodable_char_position, code_convert_region)
2866 (code_convert_string, code_convert_string_norecord)
2867 (Fset_coding_system_priority):
2868 * fileio.c (Finsert_file_contents):
2869 Use bool for booleans.
2870 * coding.h, lisp.h: Reflect above API changes.
2871 * coding.c: Remove unnecessary static function decls.
2872 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2873 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2874 not a boolean 'int', since callers never look at the return value.
2875 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2876 * coding.h (decoding_buffer_size, encoding_buffer_size)
2877 (emacs_mule_string_char): Remove unused extern decls.
2878 (struct iso_2022_spec, struct coding_system):
2879 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2880 (struct emacs_mule_spec): Remove unused field 'full_support'.
2881 All initializations removed.
2882 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2883
5474c384
DA
28842012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2885
f10fe38f 2886 Fix spare memory change (Bug#12286).
5474c384
DA
2887 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2888 (valid_lisp_object_p): Likewise.
2889
c4b6914d
MR
28902012-08-27 Martin Rudalics <rudalics@gmx.at>
2891
2892 * window.c (Fset_window_configuration): Record any window's old
2893 buffer if it's replaced (see Bug#8789). If the new current
2894 buffer doesn't appear in the selected window, go to its old
2895 point (Bug#12208).
2896
35aaa1ea
DA
28972012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2898
2899 Special MEM_TYPE_SPARE to denote reserved memory.
2900 * alloc.c (enum mem_type): New memory type.
2901 (refill_memory_reserve): Use new type for spare memory.
2902 This prevents live_cons_p and live_string_p from incorrect
2903 detection of uninitialized objects from spare memory as live.
2904
6af64513
PE
29052012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2906
8b2e00a3
PE
2907 Spelling fixes.
2908 * Makefile.in (.PHONY): versioclean -> versionclean.
2909
b52d6985
PE
2910 Remove unused external symbols.
2911 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2912 * window.c (Qwindow_valid_p, decode_valid_window):
2913 Now static, not extern.
2914 * data.c (Qinterval): Remove; unused.
2915 (syms_of_data): Do not define 'interval'.
2916 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2917 * window.h (decode_valid_window):
2918 Remove decls.
2919
d5172d4f
PE
2920 * character.c, charset.c, chartab.c: Use bool for booleans.
2921 * character.c (lisp_string_width, string_count_byte8)
2922 (string_escape_byte8):
2923 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2924 (load_charset_map_from_file, map_charset_chars)
2925 (Fdefine_charset_internal, define_charset_internal)
2926 (Fdeclare_equiv_charset, find_charsets_in_text)
2927 (Ffind_charset_region, char_charset, Fiso_charset):
2928 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2929 (sub_char_table_set, sub_char_table_set_range)
2930 (char_table_set_range, optimize_sub_char_table)
2931 (map_sub_char_table):
2932 Use bool for boolean.
2933 * character.c (str_to_unibyte): Omit last boolean argument; it was
2934 always 0. All callers changed.
2935 * character.h, charset.h: Adjust to match previous changes.
2936 * character.h (char_printable_p): Remove decl of nonexistent function.
2937 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2938 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2939 are all boolean, so make them single-bit bitfields.
2940
6af64513
PE
2941 * lisp.h (ASET): Remove attempt to detect side effects.
2942 It was meant to be temporary and it often doesn't work,
2943 because when IDX has side effects the behavior of IDX==IDX
2944 is undefined. See Stefan Monnier in
2945 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2946
e1f29348
BR
29472012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2948
2949 * lisp.h (functionp): New function (extracted from Ffunctionp).
2950 (FUNCTIONP): Use it.
2951 * eval.c (Ffunctionp): Use it.
2952
17c05d74
PE
29532012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2954
0f46bc75
PE
2955 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2956 as that's faster and simpler than static storage. Don't bother
2957 with the g_main_context_query overhead if g_main_context_pending
2958 says no events are pending.
2959 (gfds, gfds_size): Remove these static vars.
2960 (xgselect_initialize): Remove; no longer needed.
2961 All uses and decls removed.
2962
ee4c0f69
PE
2963 * emacs.c (fatal_error_signal_hook): Remove.
2964 All uses removed. This leftover from old code was always 0.
2965
17c05d74
PE
2966 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2967 * casefiddle.c (casify_object, casify_region):
2968 * casetab.c (set_case_table):
2969 * category.c, category.h (word_boundary_p):
2970 * category.h (CHAR_HAS_CATEGORY):
2971 Use bool for booleans, instead of int.
2972
391ceac5
EZ
29732012-08-25 Eli Zaretskii <eliz@gnu.org>
2974
2975 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2976
2f221583
PE
29772012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2978
f4a681b0
PE
2979 On assertion failure, print backtrace if available.
2980 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2981 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2982 * Makefile.in (LIB_EXECINFO): New macro.
2983 (LIBES): Use it.
2984
2f221583
PE
2985 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2986 * bytecode.c (exec_byte_code):
2987 * callint.c (check_mark, Fcall_interactively):
2988 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2989 (getenv_internal, sync_process_alive, call_process_exited):
2990 * lisp.h (USE_SAFE_ALLOCA):
2991 Use bool for booleans, instead of int.
2992 * lisp.h, process.h: Adjust prototypes to match above changes.
2993 * callint.c (Fcall_interactively): Don't assume the mark's
2994 offset fits in 'int'.
2995
37ef52bb
PE
29962012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2997
2998 * buffer.c, buffer.h: Use bool for boolean.
2999 * buffer.c (reset_buffer_local_variables)
3000 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3001 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3002 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3003 (overlay_touches_p, overlay_strings, Foverlay_put)
3004 (report_overlay_modification, call_overlay_mod_hooks):
3005 (mmap_enlarge, mmap_set_vars):
3006 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3007 Use bool for booleans, instead of int.
3008 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3009 since the 1-or-0 return value is always ignored anyway.
3010 (mmap_initialized_p):
3011 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3012 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3013
2cc21167
PE
30142012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3015
3016 * bidi.c: Use bool for boolean.
3017 This is a bit more readable, and makes the text segment of bidi.o
3018 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3019 Presumably it's faster too.
3020 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3021 Now bool.
3022 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3023 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3024 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3025 (bidi_explicit_dir_char, bidi_level_of_next_char)
3026 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3027 Use bool for booleans, instead of int.
3028 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3029 (bidi_unshelve_cache): Adjust decls to match code.
3030
7db4ddf4
MR
30312012-08-23 Martin Rudalics <rudalics@gmx.at>
3032
3033 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3034 argument.
3035
b1bb8011
PE
30362012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3037
3038 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3039 * atimer.h: Include <stdbool.h>.
3040
ff687885
DN
30412012-08-22 Dan Nicolaescu <dann@gnu.org>
3042
3043 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3044 compile time tests instead of run time tests on systems that do
3045 not use them.
3046 (FRAME_MAC_P): Remove leftover from deleted code.
3047 * frame.c (syms_of_frame): Remove leftover from deleted code.
3048
4ce7a138
JD
30492012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3050
3051 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3052
d733ec6d
PE
30532012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3054
3055 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3056 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 3057 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
3058 (fontset_add): Return void, for FONTSET_ADD.
3059
d0d2d26f
PE
30602012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3061
fce31d69
PE
3062 * alloc.c: Use bool for booleans.
3063 (gc_in_progress, abort_on_gc)
3064 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3065 (dont_register_blocks) [GC_MALLOC_CHECK]:
3066 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3067 (check_string_bytes, make_specified_string, memory_full)
3068 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3069 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3070 (mark_stack, valid_pointer_p, make_pure_string)
3071 (Fgarbage_collect, survives_gc_p, gc_sweep):
3072 Use bool for booleans, instead of int.
3073 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3074 Remove unused local.
3075 * alloc.c (PURE_POINTER_P):
3076 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3077 * editfns.c (Fformat):
3078 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3079 (Fdo_auto_save):
3080 * fns.c (sweep_weak_table):
3081 * lisp.h (suppress_checking, push_message, survives_gc_p)
3082 (make_pure_string, gc_in_progress, abort_on_gc):
3083 * lread.c (readchar, read1):
3084 * print.c (Fprin1_to_string):
3085 * xdisp.c (push_message):
3086 Use bool for booleans affected directly or indirectly by
3087 alloc.c's changes.
3088
d0d2d26f
PE
3089 Make recently-introduced setters macros.
3090 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3091 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3092 (set_fontset_default, set_fontset_fallback): Rename from their
3093 upper-case counterparts, and make them functions rather than macros.
3094 This is more consistent with the other recently-introduced setters.
3095 These don't need to be inline, since they're local.
3096
d18e2bb6
JD
30972012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3098
3099 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3100 the loop (Bug#12247).
3101
1b9d9d16
PE
31022012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3103
3104 * lisp.h (vcopy): Use memcpy rather than our own loop.
3105 This fixes a performance regression introduced by the recent
3106 addition of vcopy. This means 'vcopy' will need to be modified
3107 for a copying collector, but that's OK. Also, tighten the
3108 checking in the assertion.
3109
b2f09701
EZ
31102012-08-21 Eli Zaretskii <eliz@gnu.org>
3111
3112 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3113 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3114 non-base glyph for the width of the base character, according to
e1f29348
BR
3115 what x_draw_composite_glyph_string_foreground expects.
3116 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
3117 expectations, to produce correct width of the composed character.
3118 Reverse the sign of the DU offset produced by ScriptPlace.
3119
9b994fed
PE
31202012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3121
3122 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3123
086ca913
DA
31242012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3125
3126 Avoid direct writes to contents member of struct Lisp_Vector.
3127 * lisp.h (vcopy): New function to copy data into vector.
3128 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3129 * fns.c (Ffillarray): Use ASET.
3130 * keyboard.c (timer_check_2): Use AREF and ASET.
3131 (append_tool_bar_item, Frecent_keys): Use vcopy.
3132 * lread.c (read_vector): Use ASET.
3133 * msdos.c (Frecent_doskeys): Use vcopy.
3134 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3135 (Finternal_merge_in_global_face): Use ASET and vcopy.
3136 * xfont.c (xfont_list_pattern): Likewise.
3137
5481664a
MR
31382012-08-21 Martin Rudalics <rudalics@gmx.at>
3139
3140 * window.c (Fwindow_point): For the selected window always return
3141 the position of its buffer's point.
3142 (Fset_window_point): For the selected window always go in its
3143 buffer to the specified position.
3144
6d470bdd
DA
31452012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3146
3147 Setter macros for fontsets.
3148 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3149 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3150 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3151 Adjust users.
3152
24564fe1
GM
31532012-08-20 Glenn Morris <rgm@gnu.org>
3154
3155 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3156 Don't assume that `ln -f' works.
3157
0a05a035
EZ
31582012-08-20 Eli Zaretskii <eliz@gnu.org>
3159
3160 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3161 and later about non-assignments with no effect. See discussion at
3162 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3163 details.
3164
e46f2325
DA
31652012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3166
3167 Inline setter functions for Lisp_Objects slots of struct specbinding.
3168 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3169 Adjust users.
3170
734fbd86
MR
31712012-08-20 Martin Rudalics <rudalics@gmx.at>
3172
3173 * window.c (select_window): Always make selected window's buffer
3174 current.
3175
f1a95992
DA
31762012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3177
3178 Use AREF and ASET for docstrings of category tables.
3179 * category.h (CATEGORY_DOCSTRING): Use AREF.
3180 (SET_CATEGORY_DOCSTRING): Use ASET.
3181 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3182
e83064be
DA
31832012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3184
3185 Inline setter functions for hash table members.
3186 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3187 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3188 (set_hash_key_and_value, set_hash_index, set_hash_next)
3189 (set_hash_hash): New functions.
3190 * charset.c, fns.c: Adjust users.
3191
4ce60d2e
DA
31922012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3193
3194 Inline getter and setter functions for per-buffer values.
3195 * buffer.h (per_buffer_default, set_per_buffer_default)
3196 (per_buffer_value, set_per_buffer_value): New functions.
3197 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3198 * buffer.c, data.c: Adjust users.
3199
c06c9690
JB
32002012-08-20 Juanma Barranquero <lekktu@gmail.com>
3201
3202 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3203
32bd4250
PE
32042012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3205
bad03192 3206 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
3207 as gnulib does this if the system doesn't.
3208 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
3209 Remove declaration. MS-Windows declares it on stdlib.h which is
3210 included by conf_post.h.
b69a6d22
PE
3211 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3212 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3213 * vm-limit.c: Include <unistd.h>, for 'environ'.
3214
22d7feb2
PE
3215 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3216 (start_of_data): Remove decl; mem-limits.h provides it.
3217
32bd4250
PE
3218 * xdisp.c (handle_invisible_prop): Make it a bit faster
3219 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3220
450809af
CY
32212012-08-19 Chong Yidong <cyd@gnu.org>
3222
3223 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3224 ends (Bug#3874).
3225
9e677988
AS
32262012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3227
6b1319ce
AS
3228 * .gdbinit: Use call instead of set when calling a function in the
3229 inferior.
3230
9e677988
AS
3231 * data.c (set_internal): Don't use set_blv_found.
3232 (Fkill_local_variable): Likewise.
3233
d7191076
AA
32342012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3235
3236 * nsfont.m (ns_ascii_average_width): Ensure the string
3237 ascii_printable is initialized with a null-terminated character
3238 array. Otherwise, it can contain undesired extra characters.
3239
e757f1c6
PE
32402012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3241
3242 port new setting code to Sun C 5.8 2005/10/13
3243 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3244 Return void, not Lisp_Object. Otherwise, the compiler
3245 complains about (A?B:C) where B is void and C is Lisp_Object
3246 when compiling CHAR_TABLE_SET, due to the recent change to
3247 the API of sub_char_table_set_contents.
3248
a999ce26
CY
32492012-08-18 Chong Yidong <cyd@gnu.org>
3250
3251 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3252 for the string case (Bug#3874).
3253
3f22b86f
PE
32542012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3255
39eb03f1
PE
3256 * buffer.h (BSET): Remove (Bug#12215).
3257 Replace all uses with calls to new setter functions.
3258 (bset_bidi_paragraph_direction, bset_case_canon_table)
3259 (bset_case_eqv_table, bset_directory, bset_display_count)
3260 (bset_display_time, bset_downcase_table)
3261 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3262 (bset_last_selected_window, bset_local_var_alist)
3263 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3264 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3265 (bset_width_table):
3266 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3267 (bset_auto_fill_function, bset_auto_save_file_format)
3268 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3269 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3270 (bset_cache_long_line_scans, bset_case_fold_search)
3271 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3272 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3273 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3274 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3275 (bset_header_line_format, bset_indicate_buffer_boundaries)
3276 (bset_indicate_empty_lines, bset_invisibility_spec)
3277 (bset_left_fringe_width, bset_major_mode, bset_mark)
3278 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3279 (bset_name, bset_overwrite_mode, bset_pt_marker)
3280 (bset_right_fringe_width, bset_save_length)
3281 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3282 (bset_scroll_up_aggressively, bset_selective_display)
3283 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3284 (bset_word_wrap, bset_zv_marker):
3285 * category.c (bset_category_table):
3286 * syntax.c (bset_syntax_table):
3287 New setter functions.
3288
6a09a33b
PE
3289 * process.h (PSET): Remove (Bug#12215).
3290 Replace all uses with calls to new setter functions.
3291 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3292 (PROCESS_INLINE): New macro.
3293 (pset_childp): New setter function.
3294 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3295 * process.c (PROCESS_INLINE):
3296 Define to EXTERN_INLINE, so that the corresponding functions
3297 are compiled into code.
3298 (pset_buffer, pset_command, pset_decode_coding_system)
3299 (pset_decoding_buf, pset_encode_coding_system)
3300 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3301 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3302 (pset_type, pset_write_queue): New setter functions.
3303
e8c17b81
PE
3304 * window.h (WSET): Remove (Bug#12215).
3305 Replace all uses with calls to new setter functions.
3306 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3307 (WINDOW_INLINE): New macro.
3308 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3309 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3310 (wset_total_lines, wset_vertical_scroll_bar)
3311 (wset_window_end_pos, wset_window_end_valid)
3312 (wset_window_end_vpos): New setter functions.
3313 * window.c (WINDOW_INLINE):
3314 Define to EXTERN_INLINE, so that the corresponding functions
3315 are compiled into code.
3316 (wset_combination_limit, wset_dedicated, wset_display_table)
3317 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3318 (wset_new_normal, wset_new_total, wset_next_buffers)
3319 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3320 (wset_prev_buffers, wset_right_fringe_width)
3321 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3322 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3323 (wset_window_parameters):
3324 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3325 (wset_column_number_displayed, wset_region_showing):
3326 New setter functions.
3327
3f22b86f
PE
3328 * termhooks.h (TSET): Remove (Bug#12215).
3329 Replace all uses with calls to new setter functions.
3330 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3331 (TERMHOOKS_INLINE): New macro.
3332 (tset_charset_list, tset_selection_alist): New setter functions.
3333 * terminal.c (TERMHOOKS_INLINE):
3334 Define to EXTERN_INLINE, so that the corresponding functions
3335 are compiled into code.
3336 (tset_param_alist): New setter function.
3337
742af32f
PE
33382012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3339
15dbb4d6
PE
3340 * keyboard.h (KSET): Remove (Bug#12215).
3341 Replace all uses with calls to new setter functions.
3342 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3343 (KEYBOARD_INLINE): New macro.
3344 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3345 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3346 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3347 New setter functions.
3348 * keyboard.c (KEYBOARD_INLINE):
3349 Define to EXTERN_INLINE, so that the corresponding functions
3350 are compiled into code.
3351 (kset_echo_string, kset_kbd_queue)
3352 (kset_keyboard_translate_table, kset_last_prefix_arg)
3353 (kset_last_repeatable_command, kset_local_function_key_map)
3354 (kset_overriding_terminal_local_map, kset_real_last_command)
3355 (kset_system_key_syms): New setter functions.
3356
f00af5b1
PE
3357 * frame.h (FSET): Remove (Bug#12215).
3358 Replace all uses with calls to new setter functions.
3359 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3360 (FRAME_INLINE): New macro.
3361 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3362 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3363 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3364 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3365 (fset_param_alist, fset_root_window, fset_scroll_bars)
3366 (fset_selected_window, fset_title, fset_tool_bar_items)
3367 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3368 * frame.c (FRAME_INLINE):
3369 Define to EXTERN_INLINE, so that the corresponding functions
3370 are compiled into code.
3371 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3372
0c94c8d6
PE
3373 A few more naming-convention fixes for getters and setters.
3374 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3375 and rename from buffer_overlays_set_before.
3376 (set_buffer_overlays_after): Move here from buffer.h, and rename
3377 from buffer_overlays_set_after.
3378 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3379 All uses changed.
3380 (set_buffer_intervals): Rename from buffer_set_intervals.
3381 * intervals.c (set_interval_object): Move here from intervals.h,
3382 and rename from interval_set_object.
3383 (set_interval_left): Move here from intervals.h, and rename from
3384 interval_set_left.
3385 (set_interval_right): Move here from intervals.h, and rename from
3386 interval_set_right.
3387 (copy_interval_parent): Move here from intervals.h, and rename from
3388 interval_copy_parent.
3389 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3390 (set_interval_plist): Rename from interval_set_plist.
3391 Return void, not Lisp_Object, since no caller uses the result.
3392 * lisp.h (string_intervals): Rename from string_get_intervals.
3393 (set_string_intervals): Rename from string_set_intervals.
3394
34dabdb7
PE
3395 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3396 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 3397 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
3398 All uses changed. See the end of
3399 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3400
742af32f
PE
3401 * lisp.h (CSET): Remove (Bug#12215).
3402 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3403 (set_char_table_purpose): New functions,
3404 replacing CSET. All uses changed. For example, replace
3405 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 3406 "set_char_table_parent (char_table, parent);".
742af32f
PE
3407 The old version was confusing because it used the same name
3408 'parent' for two different things.
3409
a04e2c62
DA
34102012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3411
3412 Functions to get and set Lisp_Object fields of buffer-local variables.
3413 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3414 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3415 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3416 * data.c, eval.c, frame.c: Adjust users.
3417
383dcbf9
CY
34182012-08-17 Chong Yidong <cyd@gnu.org>
3419
3420 * xfaces.c (merge_face_vectors): If the target font specfies a
3421 font spec, make the font's attributes take precedence over
3422 directly-specified attributes.
3423 (merge_face_ref): Recognize :font.
3424
44386687
DA
34252012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3426
3427 Do not use memcpy for copying intervals.
3428 * intervals.c (reproduce_interval): New function.
3429 (reproduce_tree, reproduce_tree_obj): Use it.
3430 (reproduce_tree_obj): Remove prototype.
3431
927c7216
PE
34322012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3433
3434 * lisp.h (duration_to_sec_usec): Remove unused decl.
3435
93044f7b
AA
34362012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3437
3438 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3439 to an allocated instance of NSString, not to the class itself.
3440
9851e4a5
JB
34412012-08-17 Juanma Barranquero <lekktu@gmail.com>
3442
3443 * makefile.w32-in (C_CTYPE_H): New macro.
3444 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3445 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3446 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3447
620f13b0
PE
34482012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3449
3450 Use ASCII tests for character types.
3451 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3452 * xfns.c, xterm.c:
3453 Don't include <ctype.h>; was not needed.
3454 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3455 * sysdep.c, xfaces.c:
3456 Include <c-ctype.h> instead of <ctype.h>.
3457 * nsterm.m: Include <c-ctype.h>.
3458 * charset.c (read_hex):
3459 * doc.c (Fsnarf_documentation):
3460 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3461 (DRIVE_LETTER) [DOS_NT]:
3462 (Ffile_name_directory, Fexpand_file_name)
3463 (Fsubstitute_in_file_name):
3464 * font.c (font_parse_xlfd, font_parse_fcname):
3465 * frame.c (x_set_font_backend):
3466 * gtkutil.c (xg_get_font):
3467 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3468 * nsimage.m (hexchar):
3469 * nsterm.m (ns_xlfd_to_fontname):
3470 * sysdep.c (system_process_attributes):
3471 * xfaces.c (hash_string_case_insensitive):
3472 Use C-locale tests instead of locale-specific tests for character
3473 types, since we want the ASCII interpretation here, not the
3474 interpretation suitable for whatever happens to be the current locale.
3475
52162052
MR
34762012-08-16 Martin Rudalics <rudalics@gmx.at>
3477
3478 Consistently check windows for validity/liveness
3479 (Bug#11984, Bug#12025, Bug#12026).
3480 * lisp.h (CHECK_VALID_WINDOW): New macro.
3481 * window.c (decode_window): Rename to decode_live_window.
3482 (decode_valid_window, Fwindow_valid_p): New functions.
3483 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3484 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3485 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3486 (Fwindow_prev_sibling, Fwindow_combination_limit)
3487 (Fset_window_combination_limit, Fwindow_use_time)
3488 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3489 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3490 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3491 (Fwindow_hscroll, Fset_window_hscroll)
3492 (Fwindow_redisplay_end_trigger)
3493 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3494 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3495 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3496 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3497 (Fwindow_end, Fset_window_point, Fset_window_start)
3498 (Fpos_visible_in_window_p, Fwindow_line_height)
3499 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3500 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3501 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3502 (Fset_window_parameter, Fwindow_display_table)
3503 (Fset_window_display_table, Fdelete_other_windows_internal)
3504 (Fset_window_buffer, Fset_window_new_total)
3505 (Fset_window_new_normal, Fdelete_window_internal)
3506 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3507 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3508 (Fwindow_scroll_bars): Check whether argument window is a valid or
3509 live window. Update doc-strings.
3510 (syms_of_window): New symbol Qwindow_valid_p.
3511 * keyboard.c (Fposn_at_x_y): Check whether argument
3512 frame_or_window denotes a valid window.
3513
2751c80f
DA
35142012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3515
3516 Fix previous char table change.
3517 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3518 * chartab.c (optimize_sub_char_table): Likewise.
3519
032a42c8
CY
35202012-08-16 Chong Yidong <cyd@gnu.org>
3521
a2d19368
CY
3522 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3523
032a42c8
CY
3524 * xfont.c (xfont_open):
3525 * xftfont.c (xftfont_open): Set the font's max_width field.
3526
3527 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3528 min_width to space_width and average_width to the average over
3529 printable ASCII characters.
3530 (ns_char_width): Code cleanup.
3531 (ns_ascii_average_width): New utility function.
3532
3533 * font.h (struct font): Update comments.
3534
a098c930
DA
35352012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3536
032a42c8 3537 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
3538 * lisp.h (CSET): New macro.
3539 (char_table_set_extras, char_table_set_contents)
3540 (sub_char_table_set_contents): New function.
3541 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3542 * syntax.c: Adjust users.
3543
8be3a09c
SM
35442012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3545
3546 * eval.c (eval_sub): Bind lexical-binding.
3547 * lread.c (Qlexical_binding): Make non-static.
3548
ac4845a6
JD
35492012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3550
ddee6515
JD
3551 * nsmenu.m (popupSession): Remove.
3552 (pop_down_menu): Remove endModalSession.
3553 (timeout_handler:): New method.
3554 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3555 Call runModalForWindow. Check timer_fired when it returns.
3556 If not set, cancel timer and break out of loop.
3557 Otherwise loop again, with a new timeout.
3558
3559 * nsterm.m: Include fcntl.h if present.
3560 (fd_entry, t_readfds, inNsSelect): Remove.
3561 (select_writefds, select_valid, select_timeout, selfds)
3562 (select_mutex, apploopnr): Add.
3563 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3564 Otherwise call kbd_buffer_store_event.
3565 (ns_send_appdefined): Remove release of fd_entry.
3566 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3567 Increment and decrement apploopnr.
3568 (ns_select): If no file descriptors, just do a NSTimer.
3569 Otherwise copy read/write masks and start select thread (fd_handler).
3570 Start main loop and wait for application defined event.
3571 Inform select thread to stop selecting after main loop is exited.
3572 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 3573 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
3574 (fd_handler:): Loop forever, wait for info from the main thread
3575 to either start or stop selecting. When select returns, send
3576 and appdefined event.
3577 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3578 If not call kbd_buffer_store_event.
3579
3580 * nsterm.h (EmacsApp): fd_handler takes id argument.
3581 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3582
ac4845a6
JD
3583 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3584
eb424fe3
EZ
35852012-08-15 Eli Zaretskii <eliz@gnu.org>
3586
3587 * region-cache.c (move_cache_gap): Update gap_len using the actual
3588 growth of the boundaries array. Do not change cache_len.
3589 (Bug#12196)
3590
4e6a86c6
DA
35912012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3592
3593 Generalize and cleanup font subsystem checks.
3594 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
3595 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3596 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 3597
5bf192ca
DA
35982012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3599
3600 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3601
f2045622
CY
36022012-08-15 Chong Yidong <cyd@gnu.org>
3603
8be3a09c
SM
3604 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3605 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3606 extract the font descriptor instead of just the font name.
3607 In that case, return a font spec instead of a string.
f2045622
CY
3608 (x_last_font_name): Move to this file from xfns.c.
3609
3610 * xfns.c (Fx_select_font): The return value can also be a font
3611 spec. Move x_last_font_name management to gtkutil.c.
3612
3613 * xfaces.c: Make font weight and style symbols non-static.
3614
7f6feb56
SM
36152012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3616
3617 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3618 (bug#12117).
3619
fecbd8ff
SM
36202012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3621
3622 * alloc.c (Fgarbage_collect): Use plural form consistently.
3623
9b8d5165
EZ
36242012-08-14 Eli Zaretskii <eliz@gnu.org>
3625
3626 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3627 iteration through the command loop. Fixes a problem whereby mouse
3628 movements are ignored until the first mouse click.
3629
f5d9e83a
PE
36302012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3631
3632 Use bool, not int, for Lisp booleans.
3633 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3634 makes Emacs a bit smaller and presumably a bit faster.
3635 * lisp.h: Include <stdbool.h>.
3636 (struct Lisp_Boolfwd, defvar_bool):
3637 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3638 * regex.c [!emacs]: Include <stdbool.h>.
3639 (false, true): Remove; <stdbool.h> does this for us now.
3640
55802e4a
CY
36412012-08-14 Chong Yidong <cyd@gnu.org>
3642
4abcdac8
CY
3643 * character.c (Fcharacterp): Doc fix (Bug#12076).
3644
3645 * data.c (Findirect_variable): Doc fix (Bug#11040).
3646
55802e4a
CY
3647 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3648
3649 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 3650 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 3651
8e99d072
BR
36522012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3653
3654 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3655 (bug#12022).
3656
08908aca
MR
36572012-08-14 Martin Rudalics <rudalics@gmx.at>
3658
3659 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3660 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3661 * minibuf.c (choose_minibuf_frame, read_minibuf):
3662 * w32fns.c (x_create_tip_frame):
3663 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3664 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3665
56120d6f
PE
36662012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3667
3668 * intervals.c (offset_intervals): Remove obsolete comment.
3669
67b77c0b
AS
36702012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3671
3672 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3673
f48b82fd
GR
36742012-08-14 Gergely Risko <gergely@risko.hu>
3675
3676 * coding.c (decode_coding): Record buffer modification before
3677 disabling undo_list (Bug#11773).
3678
fd318b54
DA
36792012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3680
3681 Revert and cleanup some recent overlay changes.
3682 * buffer.h (enum overlay_type): Remove.
3683 (buffer_get_overlays, buffer_set_overlays): Likewise.
3684 (buffer_set_overlays_before, buffer_set_overlays_after):
3685 New function. Adjust users.
3686 (unchain_both): Add eassert.
3687
41a62dd9
DA
36882012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3689
3690 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3691
5884c324
PE
36922012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3693
3694 * gtkutil.c (xg_mark_data): Don't assume C99.
3695
ca06f160
JD
36962012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3697
3698 * gtkutil.c (xg_frame_tb_info): New struct.
3699 (TB_INFO_KEY): New define.
3700 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3701 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3702 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3703 if not present.
3704 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 3705 is up to date. Otherwise store new data.
ca06f160
JD
3706 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3707
7864a3f7
DA
37082012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3709
3710 Use KSET for write access to Lisp_Object members of struct kboard.
3711 * keyboard.h (KSET): New macro.
3712 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3713 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3714 * xterm.c: Adjust users.
3715
4c31be61
DA
37162012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3717
3718 Use BSET for write access to Lisp_Object members of struct buffer.
3719 * buffer.h (BSET): New macro.
3720 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3721 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3722 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3723 * window.c, xdisp.c, xfns.c: Adjust users.
3724
14ae4239
BT
37252012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3726
3727 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3728
32bcadb4
JD
37292012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3730
3d29b2ce 3731 * nsterm.m (not_in_argv): New function.
fc0c31f8 3732 (application:openFile, application:openTempFile:):
3d29b2ce
JD
3733 (application:openFileWithoutUI:, application:openFiles:): Open file
3734 if not_in_argv returns non-zero (bug#12171).
3735
32bcadb4 3736 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
3737 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3738 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
3739 (xg_get_font_name): Use those functions/macros here.
3740 Reported by Frans Oilinki <moilinki@gmail.com>.
3741
9ff9402d 37422012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
3743
3744 * unexmacosx.c (copy_data_segment): Copy initialized data in
3745 statically linked libraries from input file rather than memory.
3746
db74a5fc
YM
3747 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3748 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3749 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3750
25e65510
GM
37512012-08-10 Glenn Morris <rgm@gnu.org>
3752
3753 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3754 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3755
7961135c
DA
37562012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3757
3758 Fix last change to allow compilation with low optimization levels.
3759 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3760 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3761
42b3a444
DA
37622012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3763
3764 Use common inline syntax in intervals.h.
3765 * intervals.h (INTERVALS_INLINE): New macro.
3766 Change all users from LISP_INLINE.
3767
9fb0c957
DA
37682012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3769
3770 Define Qnone once for all platforms.
3771 * frame.c (Qnone): Define here.
3772 (syms_of_frame): DEFSYM it.
3773 * lisp.h (Qnone): New declaration.
3774 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3775 * xfns.c: Remove duplication. Adjust users.
3776
65e8ee52
DA
37772012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3778
3779 Remove unused macros from intervals.h.
3780 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3781 * intervals.c: Adjust comment.
3782
9b855fd6
EZ
37832012-08-10 Eli Zaretskii <eliz@gnu.org>
3784
3785 * w32fns.c <w32_unicode_gui>: New static variable.
3786 (globals_of_w32fns): Initialize it according to os_subtype.
3787 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3788 testing os_subtype.
3789
39cb9e56 37902012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
3791 Eli Zaretskii <eliz@gnu.org>
3792
3793 Fix bug #10299 with Unicode characters sent by customized
3794 keyboards created by MSKLC.
3795 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3796 (w32_init_class): Use it to initialize the Emacs class with either
3797 ANSI or Unicode API calls.
3798 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3799 later.
3800 (w32_wnd_proc): If the character code sent by WM_CHAR or
3801 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3802 original message. Call DefWindowProcW on NT and later.
3803
9374581a
GM
38042012-08-10 Glenn Morris <rgm@gnu.org>
3805
4b94e8cf
GM
3806 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3807
9374581a
GM
3808 * lisp.h (DIRECTORY_SEP): Let configure set it.
3809
a2752828
DA
38102012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3811
3812 Use TSET for write access to Lisp_Object slots of struct terminal.
3813 * termhooks.h (TSET): New macro.
3814 * coding.c, terminal.c, xselect.c: Adjust users.
3815
cc92c454
SM
38162012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3817
3818 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3819 the failing expression, include them in the error message.
3820 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3821 * lisp.h (internal_condition_case_n): Update declaration.
3822
4cb3e6b3
DA
38232012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3824
3825 Inline functions to examine and change buffer overlays.
3826 * buffer.c (unchain_both): New function.
3827 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3828 (buffer_has_overlays): New function.
3829 (enum overlay_type): New enum.
3830 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3831 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3832
8707c1e5
DA
38332012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3834
3835 Inline functions to examine and change buffer intervals.
3836 * alloc.c (mark_interval_tree): Remove.
3837 (MARK_INTERVAL_TREE): Simplify.
3838 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3839 * intervals.c (buffer_balance_intervals): New function.
3840 (graft_intervals_into_buffer): Adjust indentation.
3841 (set_intervals_multibyte): Simplify.
3842 * buffer.h (BUF_INTERVALS): Remove.
3843 (buffer_get_intervals, buffer_set_intervals): New function.
3844 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3845 * intervals.c, textprop.c: Adjust users.
3846
ad8c997f
DA
38472012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3848
3849 Inline functions to examine and change string intervals.
3850 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3851 (string_get_intervals, string_set_intervals): New function.
3852 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3853 * lread.c, print.c, textprop.c: Adjust users.
3854
32ac3a6b
GM
38552012-08-08 Glenn Morris <rgm@gnu.org>
3856
3857 * lisp.mk (lisp): Remove language/persian.elc.
3858
77c7bcb1
DA
38592012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3860
3861 Cleanup intervals.
3862 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3863 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
3864 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3865 Adjust comment. Move under #if 0.
77c7bcb1
DA
3866 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3867 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3868
9c08a8d4
DA
38692012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3870
3871 Check total length of intervals with eassert.
3872 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3873 * intervals.c: Change all users to eassert.
3874
26d16b35
EZ
38752012-08-07 Eli Zaretskii <eliz@gnu.org>
3876
14ae4239
BT
3877 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3878 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
3879 INTERNAL_FIELD in Lisp_Cons.
3880
c644523b
DA
38812012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3882
3883 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3884 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3885 name since all xname users are fixed long time ago. Do not
3886 use INTERNAL_FIELD.
3887 (set_symbol_name, set_symbol_function, set_symbol_plist):
3888 (set_symbol_next, set_overlay_plist): New function.
3889 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3890 (struct Lisp_Overlay): Likewise.
3891 (CVAR, MVAR, SVAR): Remove.
3892 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3893 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3894 * xterm.c: Adjust users.
3895 * .gdbinit: Change to use name field of struct Lisp_Symbol
3896 where appropriate.
3897
6a3d20cc
DA
38982012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3899
3900 Basic functions to set Lisp_Object and pointer slots of intervals.
3901 * intervals.h (interval_set_parent, interval_set_object):
3902 (interval_set_left, interval_set_right, interval_set_plist):
3903 (interval_copy_parent): New function.
3904 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
3905 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3906 Adjust indentation.
6a3d20cc
DA
3907 (INTERVAL_SIZE): Remove. Adjust users.
3908 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3909
4d2b044c
DA
39102012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3911
3912 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3913 * process.h (PGET): Remove.
3914 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3915 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3916
d3d50620
DA
39172012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3918
3919 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3920 * window.h (WGET): Remove.
3921 (struct window): Do not use INTERNAL_FIELD.
3922 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3923 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3924 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3925 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3926 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3927 Adjust users.
3928
d10a51dc
CY
39292012-08-07 Chong Yidong <cyd@gnu.org>
3930
3931 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3932 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3933 (Fdelete_window_internal): Signal an error if the window is not on
3934 a live frame (Bug#12025).
3935
e69b0960
DA
39362012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3937
3938 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3939 * frame.h (FGET): Remove.
3940 (struct frame): Do not use INTERNAL_FIELD.
3941 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3942 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3943 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3944 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3945
25a20a3a
JB
39462012-08-06 Juanma Barranquero <lekktu@gmail.com>
3947
3948 * w32.c: Silence compiler warnings.
3949 (map_w32_filename): Remove unused variable `is_fat'.
3950 (chase_symlinks): Add parentheses around expression.
3951
1c6f11f4
GM
39522012-08-06 Glenn Morris <rgm@gnu.org>
3953
1db4583a
GM
3954 * sysdep.c: Respect BROKEN_GETWD.
3955
1c6f11f4
GM
3956 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3957 Let configure handle it.
3958 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3959
2b90362b
DA
39602012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3961
3962 Use GCALIGNMENT where appropriate.
3963 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3964 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3965 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3966
5f50daf2
EZ
39672012-08-06 Eli Zaretskii <eliz@gnu.org>
3968
14ae4239
BT
3969 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3970 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3971
cbcc7007
SM
39722012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3973
3974 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3975 that should be sufficient for everyone.
3976
4d365fa4
JD
39772012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3978
3979 * keyboard.c (timer_check_2): Add break so timer_check returns next
3980 timeout.
3981
dd86bd82
DA
39822012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3983
3984 Fix Windows build errors introduced after converting to WGET and WSET.
3985 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3986 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3987
054e1668
JD
39882012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3989
3990 * nsterm.m (ns_frame_rehighlight): Use FSET.
3991
3992 * nsmenu.m (ns_update_menubar): Use FSET.
3993
21238f11
DA
39942012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3995
3996 Separate read and write access to Lisp_Object slots of Lisp_Process.
3997 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3998 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3999
077288cf
DA
40002012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4001
4002 Separate read and write access to Lisp_Object slots of struct window.
4003 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4004 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4005 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4006 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4007 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4008 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4009 Adjust users.
4010
71688bd7
DA
40112012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4012
4013 Fix Windows build errors introduced after converting to FGET and FSET.
4014 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4015 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4016 (w32_judge_scroll_bars): Change to use FSET.
4017 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4018
f99bac93
DA
40192012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4020
4021 Fix replacement typo.
4022 * window.c (replace_window): Set root_window instead of
4023 selected_window. This fixes a total window subsystem
4024 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4025
8c2a0f2d
GM
40262012-08-06 Glenn Morris <rgm@gnu.org>
4027
4028 * lisp.mk (lisp): Add language/persian.elc.
4029
edd74c35
DA
40302012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4031
4032 Separate read and write access to Lisp_Object slots of struct frame.
4033 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4034 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4035 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4036 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4037 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4038
8671676c
AS
40392012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4040
4041 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4042
663e2b3f
DA
40432012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4044
4045 Generalize common compile-time constants.
4046 * lisp.h (header_size, bool_header_size, word_size): Now here.
4047 (struct Lisp_Vector): Add comment.
4048 (struct Lisp_Bool_Vector): Move up to define handy constants.
4049 (VECSIZE, PSEUDOVECSIZE): Simplify.
4050 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4051 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4052 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4053 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4054 * xfont.c, xmenu.c: Use word_size where appropriate.
4055
d32e47af
LM
40562012-08-05 Lawrence Mitchell <wence@gmx.li>
4057
4058 * search.c (Freplace_match): Treat \? in the replacement text
4059 literally (Bug#8161).
4060
e5d9c0d1
CY
40612012-08-05 Chong Yidong <cyd@gnu.org>
4062
4063 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4064 * frame.c (Vdelete_frame_functions):
4065 * emacs.c (Vkill_emacs_hook): Doc fix.
4066
8da0576b
EZ
40672012-08-04 Eli Zaretskii <eliz@gnu.org>
4068
4069 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4070 --with-x-toolkit=no builds.
4071 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4072
02676e5d
CY
40732012-08-04 Chong Yidong <cyd@gnu.org>
4074
4075 * syntax.c (Fmodify_syntax_entry): Doc fix.
4076
97147da9
EZ
40772012-08-04 Eli Zaretskii <eliz@gnu.org>
4078
76151e2c
EZ
4079 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4080 * w32.c (init_environment): Change the default values of many
4081 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
4082 them into environment when they were not already defined.
4083 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 4084 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
4085 (check_windows_init_file): Now external, not static.
4086 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
4087 called when Vload_path is already set up.
4088
4089 * w32.h (check_windows_init_file): Add prototype.
4090
4091 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4092 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4093 compatibility with Posix platforms.
4094 (main): Move the call to check_windows_init_file to here from
4095 w32.c.
4096 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4097 any, in the DEFALT argument into the root of the Emacs build or
4098 installation tree, as appropriate.
4099
4100 * callproc.c (init_callproc_1): Call decode_env_path instead of
4101 doing its equivalent by hand.
4102 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4103 the code that sets Vexec_path run on MS-Windows.
4104
4105 * lread.c (init_lread): Add comments to #ifdef's.
4106
97147da9
EZ
4107 * msdos.c (dos_set_window_size, IT_update_begin)
4108 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4109 instead of direct references.
4110
185ee146
PE
41112012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4112
4113 Export DEFAULT_REHASH_* to GDB.
4114 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4115 Now constants, not macros.
4116
8834c57a
PE
41172012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4118
98c6f1e3
PE
4119 Remove unnecessary casts involving pointers.
4120 These casts are no longer needed now that we assume C89 or later,
4121 since they involve casting to or from void *.
4122 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4123 (make_pure_float, make_pure_vector):
4124 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4125 * macros.c (Fstart_kbd_macro):
4126 * menu.c (find_and_return_menu_selection):
4127 * minibuf.c (read_minibuf_noninteractive):
4128 * sysdep.c (closedir):
4129 * xdisp.c (x_produce_glyphs):
4130 * xfaces.c (compare_fonts_by_sort_order):
4131 * xfns.c (x_real_positions, select_visual):
4132 * xselect.c (x_stop_queuing_selection_requests)
4133 (x_get_window_property, x_get_window_property_as_lisp_data):
4134 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4135 Remove unnecessary pointer casts.
4136 * alloc.c (record_xmalloc): New function.
4137 * lisp.h (record_xmalloc): New decl.
4138 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4139 more like a function. This is because the pointer cast is not
4140 needed. All uses changed.
4141 * print.c (print_string, print_error_message): Avoid length recalc.
4142
8834c57a
PE
4143 Improve fix for macroexp crash with debugging (Bug#12118).
4144 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4145 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4146 not supposed to be invoked from the garbage collector.
4147 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4148 (gc_aset): New function, which is like ASET but can be
4149 used in the garbage collector.
4150 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4151 (set_hash_index): Use it instead of ASET.
4152
6dad7178
EZ
41532012-08-03 Eli Zaretskii <eliz@gnu.org>
4154
4155 Support symlinks on latest versions of MS-Windows.
4156 * w32.c: Include winioctl.h and aclapi.h.
4157 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4158 (revert_to_self): Forward declarations of static functions.
4159 <static BOOL g_b_init_get_security_info>:
4160 <g_b_init_create_symbolic_link>: New static flags.
4161 (globals_of_w32): Initialize them to zero.
4162 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4163 (map_w32_filename): Improve commentary. Simplify switch.
4164 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4165 headers (most versions of MinGW w32api don't).
4166 (get_security_info, create_symbolic_link)
4167 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4168 New functions.
4169 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4170 in the argument file name.
4171 (sys_access): Call unc_volume_file_attributes only if
4172 GetFileAttributes fails with network-related error codes.
4173 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4174 have the required privileges.
14ae4239 4175 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
4176 get_file_security_desc.
4177 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
4178 with addition of handling of symlinks and support for 'lstat'.
4179 If possible, get file's attributes and security information by
6dad7178
EZ
4180 handle, not by name. Produce S_IFLNK bit for symlinks, when
4181 called from 'lstat'.
4182 (stat, lstat): New functions, call 'stat_worker'.
4183 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4184 symlinks when the underlying filesystem supports them.
4185
f162bcc3
PE
41862012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4187
79ea6c20
PE
4188 Fix macroexp crash on Windows with debugging (Bug#12118).
4189 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4190 checking subscripts; problem introduced with the recent
4191 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4192 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4193 since it's used in non-static inline functions now.
4194
c0ce93fd
PE
4195 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4196 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 4197
f162bcc3
PE
4198 Use C99-style 'extern inline' if available.
4199 * buffer.h (BUFFER_INLINE):
4200 * category.h (CATEGORY_INLINE):
4201 * character.h (CHARACTER_INLINE):
4202 * charset.h (CHARSET_INLINE):
4203 * composite.h (COMPOSITE_INLINE):
4204 * dispextern.h (DISPEXTERN_INLINE):
4205 * lisp.h (LISP_INLINE):
4206 * systime.h (SYSTIME_INLINE):
4207 New macro, replacing 'static inline' in this header.
4208 * buffer.h, category.h, character.h, charset.h, composite.h:
4209 * dispextern.h, lisp.h, systime.h:
4210 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4211 * alloc.c (LISP_INLINE):
4212 * buffer.c (BUFFER_INLINE):
4213 * category.c (CATEGORY_INLINE):
4214 * character.c (CHARACTER_INLINE):
4215 * charset.c (CHARSET_INLINE):
4216 * composite.c (COMPOSITE_INLINE):
4217 * dispnew.c (DISPEXTERN_INLINE):
4218 * sysdep.c (SYSTIME_INLINE):
4219 Define to EXTERN_INLINE, so that the corresponding functions
4220 are compiled into code.
4221 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4222 (INLINE_HEADER_END): New macros.
4223 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4224 since it's used in non-static inline functions now.
a8333d03 4225 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 4226
837b365b
GM
42272012-08-02 Glenn Morris <rgm@gnu.org>
4228
d66b744d
GM
4229 * s/: Remove empty directory.
4230
837b365b
GM
4231 * s/ms-w32.h: Move to ../nt/inc.
4232 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4233 Update for new ms-w32.h location.
4234
13294f95
PE
42352012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4236
4237 Port to Solaris 8.
4238 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4239
90df0db3
GM
42402012-08-02 Glenn Morris <rgm@gnu.org>
4241
4242 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4243 hard-coding the path separator.
4244
4939150c
PE
42452012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4246
4247 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4248 This how ASET and AREF are supposed to work, and makes
4249 it easier to think about future improvements. See
4250 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4251 * charset.h (set_charset_attr): New function.
4252 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4253 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4254 (aref_addr): New function. All uses of &AREF(...) changed.
4255 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4256 (set_hash_index): New functions. All lvalue-style uses of
4257 HASH_KEY etc. changed.
4258 * keyboard.c (set_prop): New function. All lvalue-style uses
4259 of PROP changed.
4260
947b2afd
AA
42612012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4262
4263 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4264 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4265 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4266 * nsfns.m (ns_set_name_as_filename): Likewise.
4267 * nsmenu.m (ns_update_menubar): Likewise.
4268 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4269
4f5d0325
EZ
42702012-08-01 Eli Zaretskii <eliz@gnu.org>
4271
2008beae
EZ
4272 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4273 Adapt to latest changes in field names of the corresponding Lisp
288479f6 4274 objects.
2008beae 4275
4f5d0325
EZ
4276 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4277
fe3cc771
GM
42782012-08-01 Glenn Morris <rgm@gnu.org>
4279
4280 * s/msdos.h: Remove file.
4281 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4282 * Makefile.in (S_FILE): Remove.
4283 (config_h): Remove S_FILE.
4284
c90acc54
JB
42852012-08-01 Juanma Barranquero <lekktu@gmail.com>
4286
4287 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4288 Remove; moved to nt/config.nt.
4289
d8a05828
DA
42902012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4291
4292 Use INTERNAL_FIELD for conses and overlays.
4293 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4294 Remove obsolete comment.
4295 (MVAR): New macro.
4296 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4297 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4298
8271d590
DA
42992012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4300
4301 Use INTERNAL_FIELD for symbols.
4302 * lisp.h (SVAR): New macro. Adjust users.
4303 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4304 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4305
3193acd2
DA
43062012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4307
4308 Use INTERNAL_FIELD for processes.
4309 * process.h (PVAR): New macro. Adjust style.
4310 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4311 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4312
3a45383a
DA
43132012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4314
4315 Use INTERNAL_FIELD for windows.
4316 * window.h (WVAR): New macro.
4317 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4318 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4319 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4320 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4321 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4322 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4323
c1dbc63c
PE
43242012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4325
4326 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4327
5c0c0e8a
GM
43282012-08-01 Glenn Morris <rgm@gnu.org>
4329
4330 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4331 Move to configure.ac.
4332
552a99b4
JB
43332012-08-01 Juanma Barranquero <lekktu@gmail.com>
4334
4335 * makefile.w32-in (CONFIG_H): Update dependencies.
4336 (CONF_POST_H): New macro.
4337
4338 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4339
8d8e2dfe
GM
43402012-07-31 Glenn Morris <rgm@gnu.org>
4341
bc96620a
GM
4342 * Makefile.in (S_FILE): No longer set by configure.
4343
476b1b2d
GM
4344 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4345 is available.
4346 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4347
b2c7a106
GM
4348 * process.h (NULL_DEVICE):
4349 * emacs.c (SEPCHAR):
4350 * editfns.c (USER_FULL_NAME): Let configure set them.
4351
d53d062a
GM
4352 * s/README, s/template.h: Remove files.
4353
4515017f
GM
4354 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4355
8d8e2dfe
GM
4356 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4357 Move to configure.ac.
4358
5b20b3cc
EZ
43592012-07-31 Eli Zaretskii <eliz@gnu.org>
4360
1e0afd9a
EZ
4361 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4362 resulting renaming of 'struct frame' members.
4363
5b20b3cc
EZ
4364 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4365
4366 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4367 after introduction of FVAR.
4368
f1310128
JD
43692012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4370
79e721e0
JD
4371 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4372
4373 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4374 instead of compositeToPoint.
4375 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4376
8d7c7eed 4377 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 4378
e34f7f79
DA
43792012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4380
4381 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4382 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 4383 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
4384 (BVAR): Change to use INTERNAL_FIELD.
4385 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4386 (KVAR): Change to use INTERNAL_FIELD.
4387 * frame.h (FVAR): New macro.
4388 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
4389 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4390 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4391 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
4392 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4393
c09bfb2f
DA
43942012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4395
4396 Miscellaneous fixes for non-default X toolkits.
4397 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4398 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4399 Move under #ifdef USE_LUCID.
4400 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4401 definition and usage to avoid warnings.
4402
14c114ae
JD
44032012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4404
4405 * nsterm.m (openFiles): Fix previous checkin.
4406
3bd21e82
PE
44072012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4408
4409 * indent.c (compute_motion): Remove unused local.
4410
c1529ded
GM
44112012-07-31 Glenn Morris <rgm@gnu.org>
4412
400d5621
GM
4413 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4414
268e2432
GM
4415 * conf_post.h [USG5_4]:
4416 Move remaining contents of s/usg5-4-common.h here.
4417 * s/usg5-4-common.h: Remove file.
4418
7552f3ee
GM
4419 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4420 * s/irix6-5.h: Remove file.
4421
6a381852
GM
4422 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4423 * s/darwin.h: Remove file.
4424
c1529ded
GM
4425 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4426 * s/hpux10-20.h: Remove file, which is now empty.
4427
b429a4ee
GM
44282012-07-30 Glenn Morris <rgm@gnu.org>
4429
4430 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4431 * Makefile.in (config_h): Add conf_post.h.
4432 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4433
adff3182
JD
44342012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4435
4436 * nsterm.m (ns_do_open_file): New variable.
b9031d69 4437 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
4438 (openFile, openTempFile, openFileWithoutUI, openFiles):
4439 Open files only if ns_do_open_file.
adff3182 4440
c32af1e4
PE
44412012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4442
7393bcbb
PE
4443 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4444 This no-op macro hasn't been needed for many years.
4445 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4446
c32af1e4
PE
4447 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4448 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4449 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4450 gdb_make_enums_visible.
4451 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4452 (DIRECTORY_SEP): Now a constant, not a macro.
4453
302fc036
EZ
44542012-07-30 Eli Zaretskii <eliz@gnu.org>
4455
4456 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4457 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4458
4459 * w32term.c <w32_keyboard_codepage>: Renamed from
4460 keyboard_codepage and now external. All users changed.
4461
4462 * w32term.h: Add declaration of w32_keyboard_codepage.
4463
4464 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4465 the codepage to translate keys to Unicode. If this argument is
4466 -1, use the value returned by GetConsoleCP. All callers changed.
4467
88fb40b4
PE
44682012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4469
0aee6912
PE
4470 Update .PHONY listings in makefiles.
4471 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4472 bootstrap-clean, distclean, maintainer-clean, versioclean,
4473 extraclean, frc.
4474
88fb40b4
PE
4475 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4476 This is a bit clearer. Fix some commentary typos.
4477
0a763bd1
GM
44782012-07-30 Glenn Morris <rgm@gnu.org>
4479
32bac6d6
GM
4480 * s/netbsd.h: Let configure include signal.h if needed.
4481 Remove file, which is now empty.
4482
b65e7c46
GM
4483 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4484 Let configure set them.
4485 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4486 No more need to undefine.
0a763bd1 4487
169304bd
AS
44882012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4489
4490 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4491 non-single-byte char when adding meta modifier. (Bug#12090)
4492
6cd7a139
DA
44932012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4494
4495 Convert safe_call to use variable number of arguments.
4496 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4497 (safe_call2): Fix comment.
4498 * lisp.h (safe_call): Adjust prototype.
4499 * coding.c (encode_coding_object): Change to use safe_call2.
4500 * xfaces.c (merge_face_heights): Change to use safe_call1.
4501
d34d6ffc
GM
45022012-07-30 Glenn Morris <rgm@gnu.org>
4503
7b8a48e4 4504 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 4505 does that unconditionally. Remove file, which is now empty.
7b8a48e4 4506
d34d6ffc
GM
4507 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4508 Remove empty files.
4509
03a660a6
PE
45102012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4511
4512 Export to GDB most of lisp.h's remaining object-like macros.
4513 * lisp.h (min, max): Move earlier, because they're used earlier now.
4514 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4515 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4516 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4517 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4518 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4519 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4520 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4521 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4522 Now constants, for GDB. They need not be macros.
4523 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4524 Now constants, for GDB, as well as macros, for static initializers.
4525 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4526 Move to after the definition of struct Lisp_Char_Table,
4527 since the former now needs that type defined.
4528 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4529 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4530 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4531 New enums, for gdb_make_enums_visible.
4532 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 4533 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
4534 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4535 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4536 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4537 enum maxargs, enum MAX_ALLOCA.
4538 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4539 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4540 no longer needed, now that they are done in lisp.h.
4541
e499d0ee
DA
45422012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4543
4544 Cleanup string bytes checking.
4545 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4546 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4547 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4548 (check_sblock, compact_small_strings): Simplify.
4549
d5040d2d
PE
45502012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4551
4552 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4553 These macros are confusing and no longer need to be defined, as
4554 the enum values now suffice. All uses replaced with definiens.
4555 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4556
7f259ae6
JB
45572012-07-29 Juanma Barranquero <lekktu@gmail.com>
4558
4559 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4560 ($(BLD)/w32console.$(O)): Update dependencies.
4561
7e63e0c3
DA
45622012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4563
4564 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4565 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4566 time. Adjust users.
4567 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4568
ffd817eb
JD
45692012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4570
4571 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4572 setting sitelisp (Bug#12010).
4573
417a7a0e
EZ
45742012-07-29 Eli Zaretskii <eliz@gnu.org>
4575
14ae4239 4576 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
4577
4578 * w32heap.c (cache_system_info):
4579 * w32.c (sys_rename):
4580 * w32proc.c (find_child_console, sys_kill): All users changed.
4581
387d4d92
PE
45822012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4583
4584 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4585
55a6cca6
EZ
45862012-07-29 Eli Zaretskii <eliz@gnu.org>
4587
4588 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4589
dbcf001c
DA
45902012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4591
4592 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
4593 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4594 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 4595
e2688e4a
DA
45962012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4597
4598 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4599 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4600 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4601 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4602 (replace_range, replace_range_2, del_range_2): Change to eassert.
4603 * marker.c (byte_char_debug_check): Adjust style.
4604
b46a6a83
PE
46052012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4606
4607 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4608 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4609 long-ago-commented-out code that talks about "WIN32".
4610 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4611 All uses changed.
4612
e32a5799
PE
46132012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4614
4615 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4616 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4617 Simplify by using alignof.
4618 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4619 * lisp.h: Include <stdalign.h>.
4620 (GCALIGNMENT): New macro and constant.
4621 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4622 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4623 (stdalign): New macro, if not already defined.
4624
df81cd29
EZ
46252012-07-28 Eli Zaretskii <eliz@gnu.org>
4626
01bd1b0d
EZ
4627 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4628 * w32inevt.c: Include w32inevt.h.
4629 (w32_read_console_input): New inline function, calls either
4630 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4631 w32_console_unicode_input.
4632 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4633 (w32_kbd_patch_key, key_event): Use the codepage returned by
4634 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4635 (key_event): use uChar.UnicodeChar only if
4636 w32_console_unicode_input is non-zero.
4637
4638 * w32console.c: Include w32heap.h.
4639 <w32_console_unicode_input>: New global variable.
4640 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4641 family of Windows, zero otherwise.
4642
4643 * w32inevt.h: Declare w32_console_unicode_input.
4644
df81cd29
EZ
4645 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4646 --without-x. (Bug#11742)
4647
c20fdd9e
PE
46482012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4649
4650 Adjust GDB to reflect pvec_type changes (Bug#12036).
4651 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
4652 2012-07-04 changes to pseudovector representation.
4653 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 4654
32770973 46552012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
4656
4657 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4658 bus address.
4659 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4660
3438fe21
EZ
46612012-07-27 Eli Zaretskii <eliz@gnu.org>
4662
bcfbc9de
EZ
4663 * alloc.c (listn): Fix the order the arguments are consed onto the
4664 list.
4665
3438fe21
EZ
4666 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4667 enumeration constants, as PURE and HEAP are too general, and clash
4668 with other headers and sources, such as gmalloc.c and the
4669 MS-Windows system headers. All users changed.
4670
eeaea515
DA
46712012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4672
4673 Revert last save_excursion_save and save_excursion_restore changes.
4674 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4675 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4676
073c88c2
DA
46772012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4678
4679 Fix recently-introduced typos in Windows port.
4680 Reported by Martin Rudalics <rudalics@gmx.at>.
4681 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 4682 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 4683
4706125e
PE
46842012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4685
4686 Improve GDB symbol export (Bug#12036).
4687 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4688 arms of an 'if', not using conditional expressions; otherwise GDB
4689 complains about the types in the unevaluated arm when the argument
4690 is an integer literal.
4691 (xgetint): Simplify expression.
4692 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4693 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4694 Zaretskii in <http://bugs.gnu.org/12036#13>.
4695 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4696 needed now that we have gdb_make_enums_visible.
4697 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4698 (enum enum_USE_LSB_TAG):
4699 New enum types, packaging up enums that need to be exported to GDB.
4700
694b6c97
DA
47012012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4702
4703 Utility function to make a list from specified amount of objects.
4704 * lisp.h (enum constype): New datatype.
4705 (listn): New prototype.
4706 * alloc.c (listn): New function.
4707 (Fmemory_use_count, syms_of_alloc): Use it.
4708 * buffer.c (syms_of_buffer): Likewise.
4709 * callint.c (syms_of_callint): Likewise.
4710 * charset.c (define_charset_internal): Likewise.
4711 * coding.c (syms_of_coding): Likewise.
4712 * keymap.c (syms_of_keymap): Likewise.
4713 * search.c (syms_of_search): Likewise.
4714 * syntax.c (syms_of_syntax): Likewise.
4715 * w32.c (init_environment): Likewise.
4716 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4717 * xdisp.c (syms_of_xdisp): Likewise.
4718 * xfns.c (syms_of_xfns): Likewise.
4719
6195f384
DA
47202012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4721
4722 Fast save_excursion_save and save_excursion_restore.
4723 * lisp.h (struct Lisp_Excursion): New data type.
4724 (PVEC_EXCURSION): New pseudovector type.
4725 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4726 to deal with it. Adjust comments.
4727 (init_marker, attach_marker): New prototype.
4728 (unchain_marker): Adjust prototype.
4729 * marker.c (attach_marker): Change to global.
4730 (init_marker): New function.
4731 * alloc.c (Fmake_marker, build_marker): Use it.
4732 (build_marker): More easserts.
4733 (mark_object): Handle struct Lisp_Excursion.
4734 * editfns.c (save_excursion_save, save_excursion_restore):
4735 Reimplement to use struct Lisp_Excursion. Add comments.
4736
5eceb8fb
PE
47372012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4738
4739 Fix export of symbols to GDB (Bug#12036).
4740 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4741 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4742 emacs.c, as this is a more-suitable home. Had this been done earlier
4743 the fix for 12036 would have avoided some of the problems noted in
4744 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4745 would have been more obvious.
562157c8
PE
4746 * emacs.c: Do not include <verify.h>; no longer needed.
4747 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
4748 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4749 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4750 Remove; now done in lisp.h.
4751 * lisp.h (PUBLISH_TO_GDB): New macro.
4752 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4753 (DATA_SEG_BITS): Use it.
4754 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4755 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4756 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4757 not be usable in #if. This simplifies things.
4758
d6749401
JB
47592012-07-26 Juanma Barranquero <lekktu@gmail.com>
4760
4761 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4762
1781b9e9
PE
47632012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4764
d89518db 4765 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
4766 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4767 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4768 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4769 Adjust to changes in lisp.h and emacs.c, by using
4770 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4771 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4772 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4773 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4774 instead of gdb_valbits.
4775 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4776 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4777 instead of gdb_array_mark_flag.
4778 (xboolvector): Get size from $->size, not $->header.size.
4779 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4780 (xreload, hook-run, hookpost-run): Remove.
4781 * emacs.c: Include <verify.h>.
4782 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4783 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4784 Remove.
4785 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4786 (gdb_USE_LSB_TAG): New enum constants.
4787 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4788 Also define these as enum constants, so they're visible to GDB.
4789 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4790 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4791 as constants, so they're visible to GDB.
4792 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4793 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4794 Now enum constants, not macros, so they're visible to GDB.
4795 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4796 more convenient now. All uses changed.
4797 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4798 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4799
3628596a
DA
48002012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4801
4802 Explicitly free restriction data that are not needed anymore.
4803 * editfns.c (save_restriction_restore): Free restriction data.
4804
7abaf5cc
SM
48052012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4806
4807 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4808 add argument, tune behavior, and adjust all callers.
4809
71f88e00
PE
48102012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4811
4812 Use typedef for EMACS_INT, EMACS_UINT.
4813 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4814 than macros. This simplifies debugging in the usual case, since
4815 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4816 and it allows expressions involving EMACS_INT casts.
4817 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4818
57ec3034
JD
48192012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4820
4821 * nsterm.m (ns_read_socket): Return early if there is a modal
4822 window (Bug#12043).
4823
8137e7b3
MR
48242012-07-25 Martin Rudalics <rudalics@gmx.at>
4825
4826 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4827 that FOCUS-FRAME can be omitted.
4828
04e9897c
DA
48292012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4830
4831 Adjust buffer text indirection counters at the end of Fkill_buffer.
4832 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4833 buffer is definitely dead. This should really fix an issue reported
4834 by Christoph Scholtes again. (Bug#12007).
4835 (init_buffer_once): Initialize indirection counters of
4836 buffer_defaults and buffer_local_symbols (for sanity and safety).
4837
8a0484e1
EZ
48382012-07-24 Eli Zaretskii <eliz@gnu.org>
4839
4840 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4841 and continuation glyphs on tooltip frames, leave them at zero.
4842 Avoids continued lines in tooltips. (Bug#11832)
4843
fa691a83
DA
48442012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4845
4846 Simplify copy_overlay.
04e9897c 4847 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
4848 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4849
436bc8e0
EZ
48502012-07-23 Eli Zaretskii <eliz@gnu.org>
4851
4852 * print.c (print_object): Don't crash when a frame's name is nil
4853 or invalid. (Bug#12025)
4854
4855 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4856 it signals an error when a tooltip frame is being created.
4857
d7a7fda3
DA
48582012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4859
4860 Cleanup miscellaneous objects allocation and initialization.
4861 * alloc.c (allocate_misc): Change to static. Add argument to
4862 specify the subtype. Adjust comment and users.
4863 (build_overlay): New function.
4864 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4865 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4866 (allocate_misc): Remove prototype.
4867 (build_overlay): Add prototype.
4868
48692012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
4870
4871 Swap buffer text indirection counters in Fbuffer_swap_text.
4872 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4873 This avoids crash reported by Christoph Scholtes at
4874 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4875
9d7fa573
JD
48762012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4877
4878 * nsmenu.m (Popdown_data): New struct.
4879 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4880 free Popdown_data.
4881 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4882 (initWithContentRect): Make imgView and contentView non-static
4883 and autorelease them. Also autorelease img and matrix (Bug#12005).
4884 (dealloc): Remove (Bug#12005).
4885
0dd6d66d
DA
48862012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4887
4888 Adjust consing_since_gc when objects are explicitly freed.
4889 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4890 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4891 (free_cons, free_misc): Subtract object size from consing_since_gc.
4892
d36d71df
DA
48932012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4894
4895 Simplify and cleanup markers positioning code.
4896 * marker.c (attach_marker): More useful eassert.
4897 (live_buffer, set_marker_internal): New function.
4898 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4899 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4900
fb9ea40f
PE
49012012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4902
4903 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4904 as it's limited by the amount of memory, not by INT_MAX.
4905
2d5c5f7d
EZ
49062012-07-21 Eli Zaretskii <eliz@gnu.org>
4907
07fb592e
EZ
4908 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4909 in special-event-map. See the discussion at
4910 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4911 for the reasons.
4912
37a9eac8 4913 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
4914 info.dwItemData. Fixes crashes on 64-bit Windows.
4915 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 4916
c4328746
JD
49172012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4918
fc0c31f8 4919 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 4920 (conversationIdentifier): Return value is NSInteger.
784051c4 4921 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 4922
6e5d1c12
CY
49232012-07-21 Chong Yidong <cyd@gnu.org>
4924
4925 * window.c (decode_any_window): Signal an error if the window is
4926 on a dead frame (Bug#11984).
4927
9928463d
DA
49282012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4929
4930 Add indirection counting to speed up Fkill_buffer.
4931 * buffer.h (struct buffer): New member.
4932 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4933 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4934 base buffer indirection counter.
4935 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4936 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4937 through buffer list if indirection counter is 0.
4938
f8643a6b
DA
49392012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4940
4941 Extend the value returned by Fgarbage_collect with heap statistics.
4942 * alloc.c (Qheap): New symbol.
4943 (syms_of_alloc): DEFSYM it.
4944 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4945 (Fmemory_free): Remove.
4946 (syms_of_alloc): Don't defsubr it.
4947 * buffer.c (Fcompact_buffer): Remove.
4948 (syms_of_buffer): Don't defsubr it.
4949
dac616ff
DA
49502012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4951
4952 Make maybe_gc inline.
4953 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4954 * lisp.h (consing_since_gc, gc_relative_threshold)
4955 (memory_full_cons_threshold): Revert declaration.
4956 (maybe_gc): Remove prototype, define as inline.
4957 * alloc.c: Remove old commented-out code.
4958 (consing_since_gc, gc_relative_threshold)
4959 (memory_full_cons_threshold): Revert to global.
4960 (maybe_gc): Remove.
4961
d7ea76b4
DA
49622012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4963
4964 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4965 * lisp.h (build_unibyte_string): New function.
4966 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4967 * sysdep.c, w32fns.c, xfns.c: Use it.
4968 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4969 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4970 Adjust users accordingly.
4971 * font.h (font_open_by_name): Adjust prototype.
4972
765e61e3
DA
49732012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4974
4975 Cleanup calls to Fgarbage_collect.
4976 * lisp.h (maybe_gc): New prototype.
4977 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4978 Remove declarations.
4979 * alloc.c (maybe_gc): New function.
4980 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4981 Make them static.
4982 * bytecode.c (MAYBE_GC): Use maybe_gc.
4983 * eval.c (eval_sub, Ffuncall): Likewise.
4984 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4985 to avoid dependency from auto-save feature.
4986
52b852c7
PE
49872012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4988
4989 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4990 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4991 'for_each_per_buffer_object_at'.
4992 All uses changed. It's better to use upper-case for macros that
4993 cannot be implemented as functions, to give the reader a clue
4994 that they're special.
4995
5db81e33
SM
49962012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4997
4998 * alloc.c (Fgarbage_collect): Tweak docstring.
4999
5b835e1d
DA
50002012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5001
5002 Tweak the value returned from Fgarbage_collect again.
5003 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5004 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5005 Adjust documentation.
5006 (total_vector_bytes): Rename to total_vector_slots, adjust
5007 accounting.
5008 (total_free_vector_bytes): Rename to total_free_vector_slots,
5009 adjust accounting.
5010 (Qstring_bytes, Qvector_slots): New symbols.
5011 (syms_of_alloc): DEFSYM them.
5012
9cd47b72
DA
50132012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5014
5015 Buffer compaction primitive which may be used from Lisp.
5016 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5017 (syms_of_buffer): Register Fcompact_buffer.
5018 * alloc.c (Fgarbage_collect): Use compact_buffer.
5019 * buffer.h (compact_buffer): New prototype.
5020 (struct buffer_text): New member.
5021
d17337e5
DA
50222012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5023
5024 New macro to iterate over all buffers, miscellaneous cleanups.
5025 * lisp.h (all_buffers): Remove declaration.
5026 * buffer.h (all_buffers): Add declaration, with comment.
5027 (for_each_buffer): New macro.
5028 * alloc.c (Fgarbage_collect, mark_object): Use it.
5029 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5030 (init_buffer): Likewise.
5031 * data.c (Fset_default): Likewise.
5032 * coding.c (code_conversion_restore): Remove redundant check
5033 for dead buffer.
5034 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5035
60cfd278
AS
50362012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5037
5038 Fix bug that created negative-length intervals.
5039 * intervals.c (merge_interval_right, merge_interval_left):
5040 Do not zero out this interval if it is absorbed by its children,
5041 as this interval's total length doesn't change in that case. See
5042 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5043
d06714cb
PE
50442012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5045
83713154
PE
5046 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5047 when invoking (make-bool-vector N t) and N is a positive
5048 multiple of 8 -- the last 8 bits were mistakenly cleared.
5049
d06714cb
PE
5050 Remove some struct layout assumptions in bool vectors.
5051 * alloc.c (bool_header_size): New constant.
5052 (header_size, word_size): Move earlier, as they're now used earlier.
5053 Use 'word_size' in a few more places, where it's appropriate.
5054 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5055 padding before the data member of a bool vector.
5056 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5057 than doing the check by hand with an abort ().
5058
464d5a5e
SM
50592012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5060
5fbc0409
SM
5061 * eval.c (Fdefvar): Don't check constants since we only set the var if
5062 it's not yet defined anyway (bug#11904).
5063
464d5a5e
SM
5064 * lisp.h (last_undo_boundary): Declare new var.
5065 * keyboard.c (command_loop_1): Set it.
5066 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5067 were auto-added by the command loop (bug#11774).
5068
8dc2e44a
AS
50692012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5070
5071 * w32font.c (Qsymbol): Remove local definition.
5072 (syms_of_w32font): Don't DEFSYM it.
5073
169925ec
DA
50742012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5075
5076 Fix sweep_vectors to handle large bool vectors correctly.
5077 * alloc.c (sweep_vectors): Account total_vector_bytes for
5078 bool vectors larger than VBLOCK_BYTES_MAX.
5079
5fbfb018
CY
50802012-07-18 Chong Yidong <cyd@gnu.org>
5081
5082 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5083 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5084
3ab6e069
DA
50852012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5086
5087 Return more descriptive data from Fgarbage_collect.
5088 Suggested by Stefan Monnier in
5089 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5090 * alloc.c (bounded_number): New function.
5091 (total_buffers, total_vectors): New variable.
5092 (total_string_size): Rename to total_string_bytes, adjust users.
5093 (total_vector_size): Rename to total_vector_bytes, adjust users.
5094 (sweep_vectors): Account total_vectors and total_vector_bytes.
5095 (Fgarbage_collect): New return value. Adjust documentation.
5096 (gc_sweep): Account total_buffers.
5097 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5098 (VECTOR_SIZE): Remove.
5099 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5100 (Qinterval, Qmisc): New symbols.
5101 (syms_of_data): Initialize them.
5102 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5103 (Qcons, Qbuffer): New declarations.
5104
6d02fe5b
PE
51052012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5106
5107 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5108 Round up, not down. Improve doc.
5109
b7ffe040
DA
51102012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5111
5112 Restore old code in allocate_string_data to avoid Faset breakage.
5113 Reported by Julien Danjou <julien@danjou.info> in
5114 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5115 * alloc.c (allocate_string_data): Restore old code with minor
5116 adjustments, fix comment to explain this subtle issue.
5117
4dc7c8d5
SM
51182012-07-17 Eli Zaretskii <eliz@gnu.org>
5119
5120 Remove FILE_SYSTEM_CASE.
5121 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5122
5123 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5124 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5125 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5126 call-process-region passes it through expand-file-name.
5127
5128 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5129
51302012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5131
5132 Fix crash when creating indirect buffer (Bug#11917)
5133 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5134 Don't handle unbound variables specially if non-zero.
5135 (Fbuffer_local_variables): Pass zero.
5136 (clone_per_buffer_values): Pass non-zero.
5137
51382012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5139
5140 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5141 to make the loop interruptible.
5142
51432012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5144
5145 * gnutls.c (emacs_gnutls_handshake): Only retry if
5146 GNUTLS_E_INTERRUPTED.
5147
cce7fefc
DA
51482012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5149
5150 Cleanup and convert miscellaneous checks to eassert.
5151 * alloc.c (mark_interval): Fix comment, partially rephrase
5152 old comment from intervals.h (see below).
5153 * intervals.c (find_interval, adjust_intervals_for_insertion)
5154 (delete_interval, adjust_intervals_for_deletion)
5155 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5156 Convert to eassert.
5157 (adjust_intervals_for_insertion, make_new_interval):
5158 Remove obsolete and unused code.
5159 * intervals.h (struct interval): Remove obsolete comment.
5160 * textprotp.c (erase_properties): Remove unused code.
5161 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5162 (Fremove_list_of_text_properties): Convert to eassert.
5163
9ea10cc3
CY
51642012-07-17 Chong Yidong <cyd@gnu.org>
5165
5166 * editfns.c (Finsert_char): Doc fix.
5167
3900d5de
DA
51682012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5169
5170 Fix previous change to make Fmemory_free always accurate.
5171 * alloc.c (make_interval): Update total_free_intervals.
5172 (make_float): Likewise for total_free_floats.
5173 (free_cons, Fcons): Likewise for total_free_conses.
5174 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5175 Likewise for total_free_vector_bytes.
5176 (Fmake_symbol): Likewise for total_free_symbols.
5177 (bytes_free): Remove.
5178
7098646f
DA
51792012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5180
5181 Simple free memory accounting feature.
5182 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5183 (sweep_vectors): Accumulate size of free vectors.
5184 (Fgarbage_collect): Setup bytes_free.
5185 (Fmemory_free): New function.
5186 (syms_of_alloc): Register it.
5187
22657b40
DA
51882012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5189
5190 Cleanup overlays checking.
5191 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5192 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5193 eassert and OVERLAYP.
5194 (sort_overlays): Change to use OVERLAYP.
5195
ddfc8813
RK
51962012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5197
5198 * editfns.c (Finsert_char): Make it interactive, and make the
5199 second arg optional. Copy interactive spec and docstring from
5200 ucs-insert.
5201
7c26cf3c
PE
52022012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5203
5204 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5205 Unlike the other wrapped functions, fabs has an unspecified
5206 effect on errno.
5207
5d127af9
JD
52082012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5209
5210 * nsterm.m (keyDown): Interpret flags without left/right bits
5211 as the left key (Bug#11670).
5212
6a0dd1d7
DA
52132012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5214
5215 Remove empty and useless init functions.
5216 * lisp.h (init_character_once, init_fns, init_image)
5217 (init_filelock, init_sound): Remove prototype.
5218 * character.c (init_character_once): Remove.
5219 * filelock.c (init_filelock): Likewise.
5220 * fns.c (init_fns): Likewise.
5221 * image.c (init_image): Likewise.
5222 * sound.c (init_sound): Likewise.
5223 * emacs.c (main): Adjust accordingly.
5224
7a6136fd
DA
52252012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5226
5227 * gtkutil.h: Tiny cleanups.
5228 (use_old_gtk_file_dialog): Remove useless declaration.
5229 (xg_uses_old_file_dialog): Add suggested const attribute.
5230
ce811ad9
EZ
52312012-07-15 Eli Zaretskii <eliz@gnu.org>
5232
5233 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5234 (bidi_paragraph_init): Use it to limit search forward for a strong
5235 directional character in abnormally large paragraphs full of
5236 neutral or weak characters. (Bug#11943)
5237
c9adfeaa
SF
52382012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5239
5240 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5241 the toolbar (Bug#9451).
5242 (xg_make_tool_item): Give the widget event box a transparent
5243 background.
5244
fff62aa9
DA
52452012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5246
5247 Cleanup basic allocation variables and functions.
5248 * alloc.c (ignore_warnings, init_intervals, init_float)
5249 (init_cons, init_symbol, init_marker): Remove.
5250 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5251 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5252 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5253 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5254 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5255 (staticidx, init_alloc_once, init_strings, free_ablock):
5256 Remove redundant initialization.
5257 * fns.c (init_weak_hash_tables): Remove.
5258 * lisp.h (init_weak_hash_tables): Remove prototype.
5259
9730daca
DA
52602012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5261
5262 Use zero_vector where appropriate.
5263 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5264 accordingly.
5265 * lisp.h (zero_vector): New declaration.
5266 * font.c (null_vector): Remove.
5267 (syms_of_font): Remove initialization and staticpro.
5268 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5269 * keymap.c (Faccessible_keymaps): Likewise.
5270
2e2d2a13
LL
52712012-07-15 Leo Liu <sdl.web@gmail.com>
5272
5273 * fringe.c: Fix typo in comments.
5274
cd276f6e
LL
52752012-07-14 Leo Liu <sdl.web@gmail.com>
5276
5277 * fringe.c: Add a new bitmap exclamation-mark.
5278
5a1131d9
EZ
52792012-07-14 Eli Zaretskii <eliz@gnu.org>
5280
5281 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5282
5283 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5284 (HAVE_MENUS): Don't define, defined by editing config.in with
5285 msdos/sed2v2.inp.
5286 (GMALLOC_INHIBIT_VALLOC): Don't define.
5287 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5288
22e983b7
JB
52892012-07-14 Juanma Barranquero <lekktu@gmail.com>
5290
5291 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5292
5b3f250f
GM
52932012-07-14 Glenn Morris <rgm@gnu.org>
5294
5295 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5296 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5297 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5298
33d63ff4
GM
52992012-07-13 Glenn Morris <rgm@gnu.org>
5300
5b633342
GM
5301 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5302
33d63ff4
GM
5303 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5304 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5305
b55b9f85
JD
53062012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5307
0dc8cf50
JD
5308 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5309 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5310 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5311 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5312 where appropriate.
5313 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5314 as boolean expression.
5315 (x_set_window_size): Remove unused variable toolbar.
5316 (ns_get_color_default, ns_mod_to_lisp): Remove.
5317 (ns_mouse_position): Remove unused variables xchar and ychar.
5318 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5319 (ns_set_vertical_scroll_bar): Remove unused variable count.
5320 (ns_delete_terminal): Remove unused variable i.
5321 (ns_term_init): Remove unused variables r, g and b.
5322 (mouseDown): Remove unused variable window.
5323 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5324 (initFrameFromEmacs): Remove unused variable vbextra.
5325 (mouseEntered): Remove unused variables p and dpyinfo.
5326 (mouseExited): Remove unused variables p and r.
5327 (ns_define_frame_cursor, ns_clear_frame_area)
5328 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5329 (menuDown): Assign [sender tag] to variable and cast the variable.
5330
5331 * nsterm.h (menuDown): Add id as type to argument sender.
5332 (ns_display_info_for_name): Add Lisp_Object argument.
5333 (ns_term_init): Add Lisp_Object argument.
5334 (ns_map_event_to_object): Add void argument.
5335 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5336 prototype with arguments and only declare if __OBJC__.
5337 (nxatoms_of_nsselect): Add void argument.
5338 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5339 (ns_alloc_autorelease_pool): Add void argument.
5340 (ns_release_autorelease_pool): Add void* argument.
5341 (ns_get_defaults_value): Add const char* argument.
5342
5343 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5344 (initFromContents): Use SSDATA where appropriate.
5345 (ns_update_menubar): Add braces to ambigous if-else.
5346 (initWithTitle): Put () around assignment in if statement.
5347 (ns_menu_show): Remove unused variables window and keymap.
5348 (update_frame_tool_bar): Remove unused variable selected_p.
5349 (initWithContentRect): Remove unused variable this_cmd_name.
5350
5351 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5352 appropriate.
5353 (setXBMColor): Remove unused variable len.
5354 (setPixmapData): Put () around assignment in loop statement.
5355
5356 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5357 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5358 where appropriate.
5359 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5360 around assignment in loop statement.
5361 (nsfont_open): Remove unused variable i.
5362 (nsfont_open): Remove unused variable len.
5363 (nsfont_draw): Remove unused variable cs.
5364
5365 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5366 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5367 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5368 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5369 (Fns_font_name, Fns_perform_service)
5370 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5371 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5372 (ns_set_name): Remove unused variable view.
5373 (x_set_menu_bar_lines): Remove unused variable olines.
5374 (x_set_tool_bar_lines): Remove unused variable root_window.
5375 (Fns_list_colors): Put () around assignment in while statement.
5376 (Fns_perform_service): Remove unused variable len.
5377 (Fns_display_usable_bounds): Remove unused variable top.
5378 (syms_of_nsfns): Remove unused variable i.
5379
b55b9f85
JD
5380 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5381 memcpy (Bug#11907).
5382
ed9265fc 53832012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
5384
5385 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5386 and free it with DestroyExceptionInfo (Bug#11558).
5387
ef099b57
JB
53882012-07-13 Juanma Barranquero <lekktu@gmail.com>
5389
5390 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5391 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5392 Set here, not in nt/config.nt.
5393
ea814a5d
EZ
53942012-07-13 Eli Zaretskii <eliz@gnu.org>
5395
5396 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5397 cursor overflow into the last glyph on display line when the right
5398 fringe is off. (Bug#11832)
5399
1a952767
PE
54002012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5401
5402 * xdisp.c (produce_special_glyphs): Now static.
5403 * dispextern.h (produce_special_glyphs): Remove decl.
5404
983188fd
GM
54052012-07-13 Glenn Morris <rgm@gnu.org>
5406
8d7c7eed 5407 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
5408 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5409
983188fd
GM
5410 * s/usg5-4-common.h (USG, USG5):
5411 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5412 * s/sol2-6.h (SOLARIS2):
5413 * s/irix6-5.h (IRIX6_5):
5414 * s/hpux10-20.h (USG, USG5, HPUX):
5415 * s/gnu-linux.h (USG, GNU_LINUX):
5416 * s/freebsd.h (BSD_SYSTEM):
5417 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5418 * s/cygwin.h (CYGWIN):
5419 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5420 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5421
d1e68667 54222012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
5423
5424 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 5425
6de0e799
GM
54262012-07-13 Glenn Morris <rgm@gnu.org>
5427
739ae010
GM
5428 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5429
dbee5793
GM
5430 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5431
6de0e799
GM
5432 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5433 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5434
b82da769
GM
54352012-07-12 Glenn Morris <rgm@gnu.org>
5436
4fae5a7a 5437 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
5438
5439 * process.c (init_process_emacs): Rename from init_process.
5440 The old name is also the name of a Mach system call.
5441 * lisp.h, emacs.c: Update for this name change.
5442 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5443 longer needed.
5444
5a979817
EZ
54452012-07-12 Eli Zaretskii <eliz@gnu.org>
5446
5447 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5448 memmove call that removes glyphs covered by the left truncation
5449 glyph. Improve commentary.
5450 (display_line): Fix display of continuation glyphs on GUI frames
5451 when the right fringe is turned off and variable-size fonts are
5452 used in the window. Move the code that appends a stretch glyph to
5453 produce_special_glyphs, so that it could be used for truncation
5454 and continuation glyphs alike.
5455 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5456 glyph of a suitably computed width, to align the special glyphs at
5457 the window margin. Code moved from display_line. (Bug#11832)
5458
3e91a053
GM
54592012-07-12 Glenn Morris <rgm@gnu.org>
5460
ba9e4b84
GM
5461 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5462
5463 * s/gnu-linux.h, s/hpux10-20.h:
5464 Do not unconditionally define HAVE_XRMSETDATABASE.
5465
3e91a053
GM
5466 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5467
b300b1f4
PE
54682012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5469
5470 Fix typos that broke OS X build.
5471 Reported by Randal L. Schwartz in
5472 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5473 * nsterm.m (ns_timeout): Add missing local decl.
5474 (ns_get_color): snprintf -> sprintf, to fix typo.
5475
6e777848
GM
54762012-07-12 Glenn Morris <rgm@gnu.org>
5477
3f922c37
GM
5478 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5479 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5480 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5481 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5482
0ab7b23a
GM
5483 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5484 Move PTY_OPEN to configure.
5485
6e777848
GM
5486 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5487 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5488 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5489
4a7edc24
DA
54902012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5491
5492 Use empty_unibyte_string where applicable.
5493 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5494 * lread.c (read1): Likewise.
5495 * xsettings.c (syms_of_xsettings): Likewise.
5496
308aab79
GM
54972012-07-12 Glenn Morris <rgm@gnu.org>
5498
42bd1719
GM
5499 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5500 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
5501 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5502 * s/hpux10-20.h (RUN_TIME_REMAP):
5503 * s/bsd-common.h (TABDLY): Move to configure.
5504
5505 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5506
5507 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5508
ea0bbd17 5509 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 5510 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
5511
5512 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 5513
308aab79
GM
5514 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5515 * s/template.h: Move NARROWPROTO to configure.
5516
ee1cf5cf
GM
55172012-07-11 Glenn Morris <rgm@gnu.org>
5518
30fe9bf4
GM
5519 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5520 unused since 2011-01-17 change to systty.h.
5521
ee1cf5cf
GM
5522 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5523 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5524 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5525
63e47e07
PE
55262012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5527
5528 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5529
c43fb4c3
GM
55302012-07-11 Glenn Morris <rgm@gnu.org>
5531
5532 * s/darwin.h, s/gnu-linux.h, s/template.h:
5533 Move INTERRUPT_INPUT to configure.
5534
e8df9267
DA
55352012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5536
5537 Minor adjustments to interning code.
5538 * lisp.h (intern, intern_c_string): Redefine as static inline
5539 wrappers for intern_1 and intern_c_string_1, respectively.
5540 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
5541 * lread.c (intern_1, intern_c_string_1, oblookup):
5542 Simplify Vobarray checking.
e8df9267
DA
5543 * font.c (font_intern_prop): Likewise. Adjust comment.
5544 * w32font.c (intern_font_name): Likewise.
5545
34348bd4
AS
55462012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5547
d96a1e0c
AS
5548 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5549
34348bd4
AS
5550 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5551 of Fcar/Fcdr if possible.
5552 * font.c (check_otf_features): Likewise.
5553 * fontset.c (Fnew_fontset): Likewise.
5554 * gnutls.c (Fgnutls_boot): Likewise.
5555 * minibuf.c (read_minibuf): Likewise.
5556 * msdos.c (IT_set_frame_parameters): Likewise.
5557 * xmenu.c (Fx_popup_dialog): Likewise.
5558 * w32menu.c (Fx_popup_dialog): Likewise.
5559
c8add24e
GM
55602012-07-11 Glenn Morris <rgm@gnu.org>
5561
4b575b3c
GM
5562 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5563 since nothing has defined it on these platforms.
5564
09f4e3b0
GM
5565 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5566 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5567
172bedef
GM
5568 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5569 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5570 Move CLASH_DETECTION to configure.
5571
249685df
GM
5572 * s/gnu.h: Remove file, which is now empty.
5573
c8add24e
GM
5574 * s/gnu.h, s/gnu-linux.h:
5575 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5576
b41253a3
JW
55772012-07-11 John Wiegley <johnw@newartisans.com>
5578
5579 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5580 function attribute, so we only use it if it exists in the
5581 compiler.
5582
d923b542
DA
55832012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5584
5585 Avoid call to strlen in fast_c_string_match_ignore_case.
5586 * search.c (fast_c_string_match_ignore_case): Change to use
5587 length argument. Adjust users accordingly.
5588 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5589
5ebbef1d
PE
55902012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5591
bb352260
PE
5592 Assume mkdir, rmdir.
5593 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5594 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5595
57054ddd
PE
5596 Assume rename.
5597 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5598
b747d3f7
PE
5599 Assume perror.
5600 * s/hpux10-20.h (HAVE_PERROR): Remove.
5601 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5602 Remove dummy definition, as this problem was obsolete long ago.
5603
5ebbef1d
PE
5604 Assume strerror.
5605 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5606
984e7f30
DA
56072012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5608
5609 Avoid calls to strlen in font processing functions.
5610 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
5611 (font_open_by_name): Change to use length argument.
5612 Adjust users accordingly.
d923b542
DA
5613 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5614 Adjust prototypes.
5615 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5616 Change to return ptrdiff_t.
984e7f30
DA
5617 (xfont_list_pattern, xfont_match): Use length returned by
5618 xfont_decode_coding_xlfd.
5619 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5620
20e94fdd
GM
56212012-07-11 Glenn Morris <rgm@gnu.org>
5622
9d596af3
GM
5623 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5624 Move DONT_REOPEN_PTY to configure.
5625
20e94fdd
GM
5626 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5627 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5628
e99a530f
PE
56292012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5630
22ffb973
PE
5631 Remove "#define unix" that is no longer needed (Bug#11905).
5632 * s/aix4-2.h (unix): Remove; no longer needed.
5633
e9a9ae03
PE
5634 EMACS_TIME simplification (Bug#11875).
5635 This replaces macros (which typically do not work in GDB)
5636 with functions, typedefs and enums, making the code easier to debug.
5637 The functional style also makes code easier to read and maintain.
5638 * systime.h: Include <sys/time.h> on all hosts, not just if
5639 WINDOWSNT, since 'struct timeval' is needed in general.
5640 (EMACS_TIME): Now a typedef, not a macro.
5641 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5642 not macros.
5643 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5644 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5645 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5646 (EMACS_TIME_LE): Now functions, not macros.
5647 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5648 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5649 which are not functions. All uses rewritten to use:
5650 (make_emacs_time): New function.
5651 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5652 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5653 not functions. All uses rewritten to use the following, respectively:
5654 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5655 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 5656 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
5657 * fileio.c (Fcopy_file):
5658 * xterm.c (XTflash): Get the current time closer to when it's used.
5659 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5660
ffacb126
PE
5661 * bytecode.c (targets): Suppress -Woverride-init warnings.
5662
e99a530f
PE
5663 Simplify by avoiding confusing use of strncpy etc.
5664 * doc.c (Fsnarf_documentation):
5665 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5666 * frame.c (Fmake_terminal_frame):
5667 * gtkutil.c (get_utf8_string):
5668 * lread.c (openp):
5669 * nsmenu.m (ns_update_menubar):
5670 * regex.c (regerror):
5671 Prefer memcpy to strncpy and strncat when either will do.
5672 * fileio.c (Fsubstitute_in_file_name):
5673 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5674 (menu_separator_name_p):
5675 * nsmenu.m (ns_update_menubar):
5676 Prefer memcmp to strncmp when either will do.
5677 * nsterm.m: Include <ftoastr.h>.
5678 (ns_get_color):
5679 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5680 Prefer snprintf to strncpy.
5681 * nsterm.m (ns_term_init):
5682 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5683 * nsterm.m (ns_term_init):
5684 Avoid the need for strncpy, by using build_string or
5685 make_unibyte_string directly. Use dtoastr, not snprintf.
5686 * process.c (Fmake_network_process): Diagnose service names that
5687 are too long, rather than silently truncating them or creating
5688 non-null-terminated names.
5689 (Fnetwork_interface_info): Likewise, for interface names.
5690 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5691 Prefer sprintf to strncat.
5692 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5693 Prefer vsnprintf to vsprintf + strncpy.
5694
c59592b3
GM
56952012-07-10 Glenn Morris <rgm@gnu.org>
5696
5697 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5698 Clarify fallback case.
5699
7d7bbefd
DA
57002012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5701
5702 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5703 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5704 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 5705 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
5706 where argument type is known to be a Lisp_Cons.
5707
3a4c8000
TT
57082012-07-10 Tom Tromey <tromey@redhat.com>
5709
5710 * bytecode.c (BYTE_CODE_THREADED): New macro.
5711 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5712 (enum byte_code_op): New type.
5713 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5714 (exec_byte_code): Use them. Use token threading when applicable.
5715
2a0213a6
DA
57162012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5717
5718 Optimize pure C strings initialization.
5719 * lisp.h (make_pure_string): Fix prototype.
5720 (build_pure_c_string): New function, defined as static inline. This
5721 provides a better opportunity to optimize away calls to strlen when
5722 the function is called with compile-time constant argument.
5723 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5724 argument, adjust users accordingly. Use build_pure_c_string where
5725 appropriate.
5726 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5727 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5728 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5729
cb1caeaf
DA
57302012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5731
5732 Avoid calls to strlen in miscellaneous functions.
5733 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5734 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5735 * lread.c (openp): Likewise.
5736
c293e30c
DA
57372012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5738
5739 Avoid calls to strlen in path processing functions.
5740 * fileio.c (file_name_as_directory): Add comment. Change to add
5741 srclen argument and return the length of result. Adjust users
5742 accordingly.
5743 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
5744 swap 1st and 2nd arguments to obey the common convention.
5745 Adjust users accordingly.
c293e30c
DA
5746 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5747
9e059e3f
GM
57482012-07-10 Glenn Morris <rgm@gnu.org>
5749
d02eb359
GM
5750 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5751 Move PENDING_OUTPUT_COUNT definition to configure.
5752
882cf227
GM
5753 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5754 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5755 * s/gnu.h (DATA_START): Move definitions to configure.
5756
af6e839f
GM
5757 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5758 We include usg5-4-common.h, which defines them both.
5759
40289a12
GM
5760 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5761 O_RDONLY already includes it).
5762
9e059e3f
GM
5763 Stop ns builds setting the EMACSLOADPATH environment variable.
5764 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5765 Now it does not set EMACSLOADPATH, just returns the load-path string.
5766 * nsterm.h: Update accordingly.
5767 * lread.c [HAVE_NS]: Include nsterm.h.
5768 (init_lread) [HAVE_NS]: Use ns_load_path.
5769 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5770
7c4e8ec0
GM
57712012-07-09 Glenn Morris <rgm@gnu.org>
5772
d4f600ff
GM
5773 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5774 since the included bsd-common.h does so.
5775
cbb31951
GM
5776 Stop ns builds setting the EMACSPATH environment variable.
5777 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5778 (ns_init_paths): Do not set EMACSPATH.
5779 * nsterm.h (ns_exec_path): Add it.
5780 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5781 Use ns_exec_path.
5782
7c4e8ec0
GM
5783 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5784
26bccfae
PE
57852012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5786
a0bee46f
PE
5787 * process.c (wait_reading_process_output): 'waitchannels' was unset
5788 when read_kbd || !NILP (wait_for_cell); fix this.
5789
5994c183
PE
5790 Add GCC-style 'const' attribute to functions that can use it.
5791 * character.h (char_resolve_modifier_mask):
5792 * keyboard.h (make_ctrl_char):
5793 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5794 (init_character_once, next_almost_prime, init_fns, init_image)
5795 (flush_pending_output, init_sound):
5796 * mem-limits.h (start_of_data):
5797 * menu.h (finish_menu_items):
5798 Add ATTRIBUTE_CONST.
5799 * emacs.c (DEFINE_DUMMY_FUNCTION):
5800 Declare the dummy function with ATTRIBUTE_CONST.
5801 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5802 Add decls with ATTRIBUTE_CONST.
5803
26bccfae
PE
5804 Minor improvements to make_formatted_string.
5805 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5806 where int is good enough, as vsprintf returns an int.
5807 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5808
a8290ec3
DA
58092012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5810
5811 Use make_formatted_string to avoid double length calculation.
5812 * lisp.h (make_formatted_string): New prototype.
5813 * alloc.c (make_formatted_string): New function.
5814 * buffer.c (Fgenerate_new_buffer_name): Use it.
5815 * dbus.c (syms_of_dbusbind): Likewise.
5816 * editfns.c (Fcurrent_time_zone): Likewise.
5817 * filelock.c (get_boot_time): Likewise.
5818 * frame.c (make_terminal_frame, set_term_frame_name)
5819 (x_report_frame_params): Likewise.
5820 * image.c (gs_load): Likewise.
5821 * minibuf.c (get_minibuffer): Likewise.
5822 * msdos.c (dos_set_window_size): Likewise.
5823 * process.c (make_process): Likewise.
5824 * xdisp.c (ensure_echo_area_buffers): Likewise.
5825 * xsettings.c (apply_xft_settings): Likewise.
5826
d01ba2f1
GM
58272012-07-09 Glenn Morris <rgm@gnu.org>
5828
5829 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5830 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5831 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5832 * nsterm.h (ns_etc_directory): Add it.
5833 * callproc.c [HAVE_NS]: Include nsterm.h.
5834 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5835
f1f924b6
DA
58362012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5837
5838 Move marker debugging code under MARKER_DEBUG.
5839 * marker.c (MARKER_DEBUG): Move marker debugging code under
5840 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5841 for bootstrap with --enable-checking (~3x slowdown reported
5842 by Juanma Barranquero <lekktu@gmail.com>).
5843 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5844
ab531b66
PE
58452012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5846
5847 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5848 See <http://bugs.gnu.org/11825#29>.
5849
c4b3bc8a
EZ
58502012-07-08 Eli Zaretskii <eliz@gnu.org>
5851
5852 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5853 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
5854 (display_line): Add commentary about displaying truncation glyphs
5855 on GUI frames.
5856 (produce_special_glyphs): Move here from term.c.
5857
5858 * term.c (produce_special_glyphs): Move to xdisp.c.
5859
5860 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5861 section.
c4b3bc8a 5862
b676b881
AS
58632012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5864
f17c5273
AS
5865 * xdisp.c (display_line): Avoid warning about implicit declaration
5866 of FRAME_FONT.
5867
298819b9
AS
5868 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5869
b676b881
AS
5870 * lisp.h: Remove empty conditional.
5871
6045c4fd
PE
58722012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5873
b3350bf9
PE
5874 * lread.c (load_path_check): Now static.
5875
6045c4fd
PE
5876 Fix some minor --with-ns problems found by static checking.
5877 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5878 (x_set_font) [!HAVE_X_WINDOWS]:
5879 * image.c (xpm_load_image) [HAVE_NS]:
5880 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5881 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5882 Remove unused local.
5883 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5884 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5885 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5886 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5887 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5888 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5889 Fix pointer signedness problem.
5890 * xfaces.c (FRAME_X_FONT_TABLE):
5891 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5892
929e7845
GM
58932012-07-07 Glenn Morris <rgm@gnu.org>
5894
5895 * lread.c (load_path_check): New function, split from init_lread.
5896 (init_lread): Reorganize. Motivation:
5897 If EMACSLOADPATH is set, check/warn about that rather than the
5898 defaults, which we are not going to use. Hence we can remove
5899 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5900 Don't warn if site-lisp directories are missing.
5901 If not installed, start from a blank load-path, since
5902 PATH_LOADSEARCH refers to the eventual installation directories.
5903
58dd0aa4
EZ
59042012-07-07 Eli Zaretskii <eliz@gnu.org>
5905
5906 Support truncation and continuation glyphs on GUI frames, when
5907 fringes are disabled. (Bug#11832)
5908 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
5909 continuation glyphs even if on GUI frames.
5910 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
5911 or both, are absent.
5912 (start_display, move_it_in_display_line_to): Handle the case of a
5913 GUI frame without a fringe to display continuation or truncation
5914 glyphs.
5915 (insert_left_trunc_glyphs): Support GUI frames: make sure
5916 truncation glyphs overwrite enough glyphs from the current line to
5917 have sufficient space in pixels.
5918 (display_line): Support truncation and continuation glyphs on GUI
5919 frames. If some spare pixels are left on the line after inserting
5920 the truncation glyphs, fill that space with a stretch glyph of a
5921 suitably computed width.
5922
5923 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5924 produce_glyphs, to support GUI sessions.
5925
31571fd7
PE
59262012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5927
5a16b9bc
PE
5928 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5929
f3047c75
PE
5930 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5931
31571fd7
PE
5932 Do not require float-time's arg to fit in time_t (Bug#11825).
5933 This works better on hosts where time_t is unsigned, and where
5934 float-time is applied to the (negative) difference between two times.
5935 * editfns.c (decode_time_components): Last arg is now double *,
5936 not int *, and means to store all the result as a double, without
5937 worrying about whether the seconds part fits in time_t.
5938 All callers changed.
5939 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5940 All callers changed.
5941 (Ffloat_time): Do not fail merely because the specified time falls
5942 outside of time_t range.
5943
4516fbef
GM
59442012-07-07 Glenn Morris <rgm@gnu.org>
5945
5946 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5947 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5948 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5949
07adc2c6
JB
59502012-07-07 Juanma Barranquero <lekktu@gmail.com>
5951
5952 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5953 Update dependencies.
5954
5955 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5956
fd573f31
PE
59572012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5958
fee5959d
PE
5959 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5960 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5961 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5962 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5963 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5964 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5965
fd573f31
PE
5966 * xfont.c (compare_font_names): Redo to omit the need for casts.
5967
ddadbc0e
AS
59682012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5969
fca8d6b6
AS
5970 * xfns.c (Fx_change_window_property): Doc fix.
5971 * w32fns.c (Fx_change_window_property): Doc fix.
5972
ddadbc0e
AS
5973 * w32fns.c (Fx_window_property): Accept the same arguments as the
5974 X Windows version. Doc fix.
5975 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5976
ed9265fc 59772012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5978 Eli Zaretskii <eliz@gnu.org>
5979
5980 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5981 Windows-specific code from nt/config.nt moved here.
5982 Obsolete settings removed.
5983
216ee680
PE
59842012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5985
5986 * process.c: Avoid unnecessary calls to gettime.
5987 (wait_reading_process_output): Don't get the time of day
5988 when gobbling data immediately and not waiting, as there's no need
5989 for it in that case. This removes a FIXME.
5990
bdd091e4
JD
59912012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5992
5993 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5994 is defined (Bug#11768).
5995
9d44f8ce
DA
59962012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5997
5998 Fix marker debugging code.
5999 * marker.c (byte_char_debug_check): Do not perform the check
6000 if buffer is not multibyte.
090bd7cb
JB
6001 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6002 Call byte_char_debug_check with correct arguments.
9d44f8ce 6003
90fc4786
DA
60042012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6005
6006 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
6007 * marker.c (byte_char_debug_check, count_markers):
6008 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
6009 (byte_debug_flag): Remove.
6010 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6011 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6012
7b7ae965
DA
60132012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6014
4e57b342
DA
6015 Avoid code repetition in marker-related functions.
6016 * marker.c (attach_marker): New function.
6017 (Fset_marker, set_marker_restricted, set_marker_both)
6018 (set_marker_restricted_both): Use it.
6019 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6020 Consistently rename charno to charpos.
6021 (marker_position): Add eassert.
6022 (marker_byte_position): Convert to eassert.
6023
60242012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6025
6026 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 6027 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 6028 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 6029
657924ff
DA
60302012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6031
6032 Introduce fast path for the widely used marker operation.
6033 * alloc.c (build_marker): New function.
6034 * lisp.h (build_marker): New prototype.
6035 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6036 * composite.c (autocmp_chars): Likewise.
6037 * editfns.c (buildmark): Remove.
6038 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6039 (save_restriction_save): Use build_marker.
6040 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6041 * window.c (save_window_save): Likewise.
6042
041a49a6
DA
60432012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6044
6045 Do not use Fdelete_overlay in delete_all_overlays
6046 to avoid redundant calls to unchain_overlay.
6047 * buffer.c (drop_overlay): New function.
6048 (delete_all_overlays, Fdelete_overlay): Use it.
6049 * minibuf.c (get_minibuffer): Fix comment.
6050
7dca65a4
PE
60512012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6052
6053 Port to OpenBSD 5.1 amd64.
6054 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6055 This is needed for OpenBSD, and should be harmless on all BSD systems.
6056 Also, include <sys/sysctl.h>, as it should be available on all
6057 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6058 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6059 use p_pid member, not kp_proc.pid.
6060
8eb876e2
GM
60612012-07-06 Glenn Morris <rgm@gnu.org>
6062
6063 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6064
38182d90
PE
60652012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6066
6067 More xmalloc and related cleanup.
6068 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6069 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6070 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6071 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6072 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6073 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6074 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6075 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6076 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6077 * xterm.c:
6078 Omit needless casts involving void * pointers and allocation.
6079 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6080 as the former is more robust if P's type is changed.
6081 Prefer xzalloc to xmalloc + memset 0.
6082 Simplify malloc-or-realloc to realloc.
6083 Don't worry about xmalloc returning a null pointer.
6084 Prefer xstrdup to xmalloc + strcpy.
6085 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6086 growing it.
6087 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6088 alloca of a constant.
6089
6dd5a677
EZ
60902012-07-05 Eli Zaretskii <eliz@gnu.org>
6091
6092 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6093 hscroll is larger than the line width. Fixes long and futile
6094 looping inside extend_face_to_end_of_line (on a TTY) producing
6095 glyphs that are not needed and thrown away.
6096
6b312f0f
DA
60972012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6098
6099 * marker.c (set_marker_restricted_both): Simplify by using
6100 clip_to_bounds.
6101
f520ef9b
PE
61022012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6103
6104 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6105
383b7c95
JD
61062012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6107
6108 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6109 not defined (Bug#11768).
6110 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6111 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6112 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6113 followed by gtk_box_set_homogeneous (Bug#11768).
6114 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
6115 (update_theme_scrollbar_width, xg_create_scroll_bar):
6116 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
6117 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6118 (is_box_type): New function (Bug#11768).
6119 (xg_tool_item_stale_p): Call is_box_type.
5293d758 6120 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
6121 with default display (Bug#11768).
6122
d6e7bf45
EZ
61232012-07-05 Eli Zaretskii <eliz@gnu.org>
6124
6125 * xdisp.c (window_hscroll_limited): New function.
6126 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6127 coordinates when window's hscroll is set to insanely large
6128 values. (Bug#11857)
6129
431391ec
JB
61302012-07-05 Juanma Barranquero <lekktu@gmail.com>
6131
6132 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6133 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6134
23f86fce
DA
61352012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6136
6137 Cleanup xmalloc.
6138 * lisp.h (xzalloc): New prototype. Omit needless casts.
6139 * alloc.c (xzalloc): New function. Omit needless casts.
6140 * charset.c: Omit needless casts. Convert all calls to
6141 xmalloc with following memset to xzalloc.
6142 * dispnew.c: Likewise.
6143 * fringe.c: Likewise.
6144 * image.c: Likewise.
6145 * sound.c: Likewise.
6146 * term.c: Likewise.
6147 * w32fns.c: Likewise.
6148 * w32font.c: Likewise.
6149 * w32term.c: Likewise.
6150 * xfaces.c: Likewise.
6151 * xfns.c: Likewise.
6152 * xterm.c: Likewise.
6153 * atimer.c: Omit needless casts.
6154 * buffer.c: Likewise.
6155 * callproc.c: Likewise.
6156 * ccl.c: Likewise.
6157 * coding.c: Likewise.
6158 * composite.c: Likewise.
6159 * doc.c: Likewise.
6160 * doprnt.c: Likewise.
6161 * editfns.c: Likewise.
6162 * emacs.c: Likewise.
6163 * eval.c: Likewise.
6164 * filelock.c: Likewise.
6165 * fns.c: Likewise.
6166 * gtkutil.c: Likewise.
6167 * keyboard.c: Likewise.
6168 * lisp.h: Likewise.
6169 * lread.c: Likewise.
6170 * minibuf.c: Likewise.
6171 * msdos.c: Likewise.
6172 * print.c: Likewise.
6173 * process.c: Likewise.
6174 * region-cache.c: Likewise.
6175 * search.c: Likewise.
6176 * sysdep.c: Likewise.
6177 * termcap.c: Likewise.
6178 * terminal.c: Likewise.
6179 * tparam.c: Likewise.
6180 * w16select.c: Likewise.
6181 * w32.c: Likewise.
6182 * w32reg.c: Likewise.
6183 * w32select.c: Likewise.
6184 * w32uniscribe.c: Likewise.
6185 * widget.c: Likewise.
6186 * xdisp.c: Likewise.
6187 * xmenu.c: Likewise.
6188 * xrdb.c: Likewise.
6189 * xselect.c: Likewise.
6190
0497dc44
PE
61912012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6192
6193 * fileio.c (time_error_value): Check the right error number.
6194 Problem reported by Troels Nielsen in
6195 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6196
356e7178
PE
61972012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6198
4e71fd89
PE
6199 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6200 This should be fixed in a better way; see Eli Zaretskii in
6201 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6202 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6203
f0941253
PE
6204 * fileio.c (time_error_value): Rename from special_mtime.
6205 The old name's problems were noted by Eli Zaretskii in
6206 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6207
065c9eb4
PE
6208 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6209 This variable's comment says Emacs needs at least one GDB-visible
6210 symbol of type enum pvec_type, to work around GDB problems.
6211 The symbol's value doesn't matter.
6212
356e7178
PE
6213 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6214 that causes compilation to fail on pre-C99 compilers.
6215
ed9265fc 62162012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
6217
6218 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6219 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6220
3884d954
DA
62212012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6222
d209e2fb 6223 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
6224 headers for buffer_defaults and buffer_local_symbols.
6225 Reported by Juanma Barranquero <lekktu@gmail.com>.
6226
ee28be33
SM
62272012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6228
6229 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6230 * lisp.h (enum pvec_type): Use fewer bits.
6231 (PSEUDOVECTOR_SIZE_BITS): New constant.
6232 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6233 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6234 change in pvec_type.
6235 (PSEUDOVECTOR_TYPEP): New macro.
6236 (TYPED_PSEUDOVECTORP): Use it.
6237 * fns.c (internal_equal): Adapt code to extract pvectype.
6238 * emacs.c (gdb_pvec_type): Update type.
6239 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6240 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6241 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6242 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6243 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6244 abusing vector->header.next.nbytes.
6245 (live_vector_p): Use PVEC_TYPE.
6246 (mark_object): Adapt code to extract pvectype. Use switch.
6247
c7f2cd7f
PE
62482012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6249
6250 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6251 Tighten new eassert a bit.
6252
8ce70ed2
DA
62532012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6254
6255 Fix compilation with --enable-gcc-warnings and -O1
6256 optimization level.
6257 * doprnt.c (doprnt): Change type of tem to int, initialize
6258 to avoid compiler warning. Add eassert.
6259 * search.c (simple_search): Initialize match_byte to avoid
6260 compiler warning. Add eassert.
6261
dea7f1e5
PE
62622012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6263
24a212eb
PE
6264 Avoid weird behavior with large horizontal scrolls.
6265 Without this change, for example, large hscroll values would
6266 mess up Emacs's display on Fedora 15 x86, presumably due to
6267 overflows in int calculations in the display code.
6268 Also, if buffers had long lines, Emacs would freeze.
6269 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6270 (set_window_hscroll): New function, containing the old guts of
6271 Fset_window_hscroll. Return the clipped value.
6272 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6273 This avoids the need to check against PTRDIFF_MAX.
6274
dea7f1e5
PE
6275 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6276
76046526
DA
62772012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6278
6279 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6280
39adff0d
PE
62812012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6282
63807d47
PE
6283 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6284 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6285 since GCC 4.4.6 issues a bogus warning for them.
6286
39adff0d
PE
6287 Fix bugs in file timestamp newness comparisons.
6288 * fileio.c (Ffile_newer_than_file_p):
6289 * lread.c (Fload): Use full timestamp resolution of files,
6290 not just the 1-second resolution, so that files that are only
6291 slightly newer still count as newer.
6292 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6293 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6294
dbeed9a6
PE
62952012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6296
6297 * fileio.c: Improve handling of file time marker. (Bug#11852)
6298 (special_mtime): New function.
6299 (Finsert_file_contents, Fverify_visited_file_modtime):
6300 Use it to set special mtime values consistently.
6301
636334d6
AS
63022012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6303
6304 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6305 marker for non-existing file. (Bug#11852)
6306
e2017fe2
GM
63072012-07-03 Glenn Morris <rgm@gnu.org>
6308
6309 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6310 and did not make it into globals.h).
6311
404dbd37
TT
63122012-07-03 Tom Tromey <tromey@redhat.com>
6313
6314 * window.c (Fset_window_margins, Fset_window_fringes)
6315 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6316 * textprop.c (Fprevious_property_change): No longer static.
6317 * syntax.c (Fsyntax_table_p): No longer static.
6318 * process.c (Fget_process, Fprocess_datagram_address): No longer
6319 static.
6320 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6321 * keyboard.c (Fcommand_execute): No longer static.
6322 Remove EXFUN.
6323 * insdel.c (Fcombine_after_change_execute): No longer static.
6324 * image.c (Finit_image_library): No longer static.
6325 * fileio.c (Fmake_symbolic_link): No longer static.
6326 * eval.c (Ffetch_bytecode): No longer static.
6327 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
6328 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6329 No longer static.
404dbd37
TT
6330 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6331 static.
6332 * dired.c (Ffile_attributes): No longer static.
6333 * composite.c (Fcomposition_get_gstring): No longer static.
6334 * callproc.c (Fgetenv_internal): No longer static.
6335
6336 * ccl.h: Remove EXFUNs.
6337 * buffer.h: Remove EXFUNs.
6338 * dispextern.h: Remove EXFUNs.
6339 * intervals.h: Remove EXFUNs.
6340 * fontset.h: Remove EXFUN.
6341 * font.h: Remove EXFUNs.
6342 * dosfns.c (system_process_attributes): Remove EXFUN.
6343 * keymap.h: Remove EXFUNs.
6344 * lisp.h: Remove EXFUNs.
6345 * w32term.h: Remove EXFUNs.
6346 * window.h: Remove EXFUNs.
6347 * xsettings.h: Remove EXFUN.
6348 * xterm.h: Remove EXFUN.
6349
8e4fd1e1
GM
63502012-07-03 Glenn Morris <rgm@gnu.org>
6351
6352 * lisp.h (Frandom): Make it visible to C.
6353 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6354 buffer for invisible buffers. (Bug#1229)
6355
ca95b3eb
DA
63562012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6357
6358 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6359 values which aren't power of 2.
14ae4239
BT
6360 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6361 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
6362 accordingly.
6363
7555c33f
SM
63642012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6365
6366 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6367
6368 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6369
d12e8f5a
DA
63702012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6371
6372 * alloc.c (allocate_vector_block): Remove redundant
6373 calls to mallopt if DOUG_LEA_MALLOC is defined.
6374 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6375 avoid calls to mallopt if zero_vector is returned.
6376
296094c3
DA
63772012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6378
6379 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6380 is enabled, avoid dereferencing NULL current_sblock if
6381 running undumped.
6382
36429c89
DA
63832012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6384
6385 Cleanup basic buffer management.
6386 * buffer.h (struct buffer): Change layout to use generic vector
6387 marking code. Fix some comments. Change type of 'clip_changed'
6388 to bitfield. Remove unused #ifndef old.
6389 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6390 (GET_OVERLAYS_AT): Fix indentation.
6391 (for_each_per_buffer_object_at): New macro.
6392 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6393 (Fbuffer_local_variables): Use it.
6394 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6395 * alloc.c (allocate_buffer): Adjust to match new layout of
6396 struct buffer. Fix comment.
6397 (mark_overlay): New function.
6398 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6399 Lisp area of struct buffer.
6400 (mark_object): Use it. Adjust marking of misc objects
6401 and related comments.
6402
3b3e4cac
PE
64032012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6404
6405 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6406 wrapper that is not needed because the wrapped code is a no-op (zero
6407 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6408 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6409
cf5c0175
DA
64102012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6411
6412 * alloc.c (mark_buffer): Simplify. Remove prototype.
6413 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 6414 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
6415 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6416 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 6417
ca26824c
GM
64182012-06-30 Glenn Morris <rgm@gnu.org>
6419
2e4c5312
GM
6420 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6421
ca26824c
GM
6422 * epaths.in (PATH_SITELOADSEARCH): New.
6423 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6424 This is rather than relying on --enable-locallisppath elements
6425 having "site-lisp" in their names. (Bug#10208#25, 11658)
6426
0d23c240
EZ
64272012-06-30 Eli Zaretskii <eliz@gnu.org>
6428
c9240d7a
EZ
6429 * w32proc.c (sys_select): Accept and ignore one more argument.
6430
6431 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6432
0d23c240 6433 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 6434 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
6435
6436 * sysdep.c: Don't include dos.h and dosfns.h.
6437
6438 * process.c (sys_select):
6439 * msdos.c (sys_select): Accept one more argument and ignore it.
6440
6441 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6442 adapt data types and code to that.
6443
6444 * dosfns.c:
6445 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6446 which clashes with the gnulib function of the same name.
6447
af5a5a98
AS
64482012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6449
c5e4379c
AS
6450 * font.c (font_style_to_value, font_style_symbolic)
6451 (font_prop_validate_style): Add type checks for values in
6452 font_style_table.
6453
af5a5a98
AS
6454 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6455 argument.
6456 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6457 uses.
6458
8d38f461
EZ
64592012-06-29 Eli Zaretskii <eliz@gnu.org>
6460
2e5a6631
EZ
6461 * xdisp.c (try_window_id): Undo last change.
6462
8d38f461
EZ
6463 * w32.c (getwd): Adjust commentary about startup_dir.
6464 (init_environment): Always call sys_access, even in non-MSVC
6465 builds. Don't chdir to the directory of the Emacs executable.
6466 This undoes code from 1997 which was justified by the need to
6467 "avoid conflicts when removing and renaming directories". But its
6468 downside was that every relative file name was being interpreted
6469 relative to the directory of the Emacs executable, which can never
6470 be TRT. In particular, it broke sys_access when called with
6471 relative file names.
6472 (sys_access): Map GetLastError to errno.
6473
2af3565e
DA
64742012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6475
6476 * window.h (struct window): Change type of 'fringes_outside_margins'
6477 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 6478 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
6479 Adjust comment.
6480 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6481 to ptrdiff_t.
6482
c8d3a25c 64832012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 6484
c8d3a25c
GM
6485 * gnutls.c (emacs_gnutls_handshake):
6486 Add QUIT to make the loop interruptible.
57570cd3 6487
c8d3a25c 64882012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 6489
c8d3a25c
GM
6490 * charset.c (init_charset): Make lack of etc/charsets fatal.
6491
3e984ee8
DA
64922012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6493
6494 * editfns.c (region_limit): Fix type mismatch.
6495
ef884f23
DA
64962012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6497
6498 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6499 undefined. Convert from xassert to eassert.
6500 * nsmenu.m: Convert from xassert to eassert.
6501 * nsterm.m: Likewise.
6502
7d7e0027
SM
65032012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6504
6505 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6506
aa754e6a
PE
65072012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6508
6509 Avoid integer overflow on scroll-left and scroll-right.
6510 * window.c (HSCROLL_MAX): New macro.
6511 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6512 overflow when requested scroll falls outside ptrdiff_t range.
6513
80b00b08
DA
65142012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6515
6516 * window.h (struct window): Change type of 'hscroll',
6517 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6518 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6519 Adjust users accordingly.
6520 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6521 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6522 from EMACS_INT to ptrdiff_t.
6523 (make_window): Omit redundant initialization.
6524
62b2bcf6
JB
65252012-06-28 Juanma Barranquero <lekktu@gmail.com>
6526
6527 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6528
45942c7d
DA
65292012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6530
6531 * window.h (struct window): Change type of 'use_time' and
6532 'sequence_number' from Lisp_Object to int.
6533 * frame.c (make_frame): Adjust users accordingly.
6534 * print.c (print_object): Likewise.
6535 * window.c (select_window, Fwindow_use_time, make_parent_window)
6536 (make_window): Likewise.
6537
e509cfa6
DA
65382012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6539
6540 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6541 enabled with --enable-checking=[all,glyphs] configure option.
6542 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6543 adjust comments accordingly.
6544 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6545 undefined, adjust comments accordingly.
6546 * image.c: Likewise.
6547 * scroll.c: Likewise.
6548 * w32fns.c: Likewise.
6549 * w32term.c: Likewise.
6550 * xdisp.c: Likewise.
6551 * xfaces.c: Likewise.
6552 * xfns.c: Likewise.
6553 * xterm.c: Likewise.
6554
a54e2c05
DA
65552012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6556
6557 Generalize run-time debugging checks.
6558 * dispextern.h (XASSERTS): Remove.
6559 * fontset.c (xassert): Remove.
6560 Convert from xassert to eassert.
6561 * alloc.c: Convert from xassert to eassert.
6562 * bidi.c: Likewise.
6563 * dispnew.c: Likewise.
6564 * fns.c: Likewise.
6565 * fringe.c: Likewise.
6566 * ftfont.c: Likewise.
6567 * gtkutil.c: Likewise.
6568 * image.c: Likewise.
6569 * keyboard.c: Likewise.
6570 * menu.c: Likewise.
6571 * process.c: Likewise.
6572 * scroll.c: Likewise.
6573 * sound.c: Likewise.
6574 * term.c: Likewise.
6575 * w32console.c: Likewise.
6576 * w32fns.c: Likewise.
6577 * w32term.c: Likewise.
6578 * window.c: Likewise.
6579 * xdisp.c: Likewise.
6580 * xfaces.c: Likewise.
6581 * xfns.c: Likewise.
6582 * xselect.c: Likewise.
6583 * xterm.c: Likewise.
6584
1ec4b7b2
SM
65852012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6586
6587 * fns.c (maybe_resize_hash_table): Output message when growing the
6588 purify-hashtable.
6589
2014308a
DA
65902012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6591
6592 * alloc.c (allocate_string_data): Remove dead code.
6593 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6594 avoid GCC warning about unused macro.
6595
246155eb
DA
65962012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6597
6598 * alloc.c (allocate_string): Omit intervals initialization.
6599 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6600 as in make_pure_string and make_pure_c_string.
6601
43184b7b
DA
66022012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6603
d209e2fb 6604 * alloc.c (allocate_string): Fix last change.
43184b7b 6605
3fe6dd74
DA
66062012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6607
d209e2fb 6608 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
6609 to memset, add explicit initialization where appropriate.
6610
1ba6038a
GM
66112012-06-27 Glenn Morris <rgm@gnu.org>
6612
6613 * lisp.mk (lisp): Remove paths.elc.
6614
c89926a5
CY
66152012-06-27 Chong Yidong <cyd@gnu.org>
6616
6617 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6618
ed6b3510
JW
66192012-06-26 John Wiegley <johnw@newartisans.com>
6620
1ec4b7b2 6621 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
6622 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6623
ed6b3510
JW
6624 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6625 when building with Clang.
6626
8edd4a2b
SM
66272012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6628
6629 * eval.c (Fapply): Allow calling it with a single argument.
6630
f6f62d1b
EZ
66312012-06-26 Eli Zaretskii <eliz@gnu.org>
6632
6633 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6634 _stricmp and _strnicmp.
6635 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6636
62efea5e
DA
66372012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6638
6639 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6640 allocated window.
6641 (allocate_process): Likewise for new process.
8edd4a2b 6642 (allocate_terminal): Change to use offsetof.
62efea5e
DA
6643 (allocate_frame): Likewise.
6644 * frame.c (make_frame): Omit redundant initialization.
6645 * window.c (make_parent_window): Use memset.
6646 (make_window): Omit redundant initialization.
6647 * process.c (make_process): Omit redundant initialization.
6648 * terminal.c (create_terminal): Likewise.
6649
42997f4d
DA
66502012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6651
6652 * term.c (delete_tty): Remove redundant call to memset.
6653
1130ecfc
DA
66542012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6655
6656 * alloc.c: Remove build_string.
6657 * lisp.h: Define build_string as static inline. This provides
6658 a better opportunity to optimize away calls to strlen when the
6659 function is called with compile-time constant argument.
6660 * image.c (imagemagick_error): Convert to build_string.
6661 * w32proc.c (sys_spawnve): Likewise.
6662 * xterm.c (x_term_init): Likewise.
6663
cf38a720
PE
66642012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6665
99027bdd
PE
6666 Use sprintf return value instead of invoking strlen on result.
6667 In the old days this wasn't portable, since some sprintf
6668 implementations returned char *. But they died out years ago and
6669 Emacs already assumes sprintf returns int.
6670 Similarly for float_to_string.
6671 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6672 * ccl.c (ccl_driver):
6673 * character.c (string_escape_byte8):
6674 * data.c (Fnumber_to_string):
6675 * doprnt.c (doprnt):
6676 * print.c (print_object):
6677 * xdisp.c (message_dolog):
6678 * xfns.c (syms_of_xfns):
6679 Use sprintf or float_to_string result to avoid need to call strlen.
6680 * data.c (Fnumber_to_string):
6681 Use make_unibyte_string, since the string must be ASCII.
6682 * lisp.h, print.c (float_to_string): Now returns int length.
6683 * term.c (produce_glyphless_glyph):
6684 Use sprintf result rather than recomputing it.
6685
cf38a720
PE
6686 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6687 * Makefile.in (ALL_CFLAGS):
6688 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6689 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6690
3511c784
DA
66912012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6692
0a08eb21 6693 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
6694 strcasecmp if available.
6695 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6696
fb7da12e
AS
66972012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6698
6699 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6700 Avoid comma operator.
6701 * menu.c (push_submenu_start, push_submenu_end)
6702 (push_left_right_boundary, push_menu_pane): Likewise.
6703 * msdos.c (dos_rawgetc): Likewise.
6704
afa2ffd8
DA
67052012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6706
6707 * xfns.c (xic_create_fontsetname): Remove redundant calls
6708 to memset.
6709
b3b4476b
PE
67102012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6711
4495ff38
PE
6712 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6713 sprintf already null-terminates its output.
6714
b3b4476b
PE
6715 * xfns.c (x_window): Remove redundant cast.
6716
b00876c9
DA
67172012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6718
6719 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6720 `const char *' to `char *' to avoid compiler warning.
6721
d188e26b
PE
67222012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6723
885d1d74
PE
6724 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6725 instead of truncating it to 63 (admittedly a generous limit).
6726
d188e26b
PE
6727 * process.c: Fix spelling and caps in comments.
6728
e2f560b1
DN
67292012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6730
e86db54b 6731 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
6732 * sysdep.c (setpgrp): Remove definition, not used in this file.
6733
7583a3a1
JB
67342012-06-24 Juanma Barranquero <lekktu@gmail.com>
6735
6736 * makefile.w32-in: Update dependencies.
6737
696056c2
EZ
67382012-06-24 Eli Zaretskii <eliz@gnu.org>
6739
6740 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6741 (SYSTIME_H): Add nt/inc/sys/time.h.
6742
6743 * systime.h [WINDOWSNT]: Include sys/time.h.
6744
6745 * s/ms-w32.h (struct timespec): Definition moved from
6746 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6747
845ca893
PE
67482012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6749
6750 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6751 * buffer.h (buffer_slot_type_mismatch):
6752 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6753 * eval.c (unwind_to_catch):
6754 * image.c (my_png_error, my_error_exit):
6755 * keyboard.c (quit_throw_to_read_char, user_error)
6756 (Fexit_recursive_edit, Fabort_recursive_edit):
6757 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6758 (wrong_type_argument, buffer_overflow, __executable_start)
6759 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6760 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6761 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6762 (fatal):
6763 (child_setup) [!DOS_NT]:
6764 * lread.c (end_of_file_error, invalid_syntax):
6765 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6766 * puresize.h (pure_write_error):
6767 * search.c (matcher_overflow):
6768 * sound.c (sound_perror, alsa_sound_perror):
6769 * sysdep.c, syssignal.h (croak):
6770 * term.c (maybe_fatal, vfatal):
6771 * textprop.c (text_read_only):
6772 * undo.c (user_error):
6773 * unexmacosx.c (unexec_error):
6774 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6775 Use _Noreturn rather than NO_RETURN.
6776 No need for separate decl merely because of _Noreturn.
6777 * sound.c (sound_warning, parse_sound):
6778 Remove unnecessary forward decls.
6779
f1dd8073
PE
67802012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6781
6782 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6783 * lisp.h (WAIT_READING_MAX): New macro.
6784 * dispnew.c (Fsleep_for, sit_for):
6785 * keyboard.c (kbd_buffer_get_event):
6786 * process.c (Faccept_process_output):
6787 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6788 This improves on the previous patch, which introduced a bug
6789 when time_t is unsigned and as wide as intmax_t.
6790 See <http://bugs.gnu.org/9000#51>.
6791
b82c1755
EZ
67922012-06-23 Eli Zaretskii <eliz@gnu.org>
6793
6794 * dispnew.c (sit_for, Fsleep_for):
6795 * keyboard.c (kbd_buffer_get_event):
6796 * process.c (Faccept_process_output): Avoid compiler warnings when
6797 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6798
ca300656
JB
67992012-06-23 Juanma Barranquero <lekktu@gmail.com>
6800
049ec95b
JB
6801 * makefile.w32-in: Update dependencies.
6802
ca300656
JB
6803 * w32.c (ltime): Add return type and declare static.
6804 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6805
db7b8d06
PE
68062012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6807
6808 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6809 Privately reported by Herbert J. Skuhra.
6810 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6811 All uses changed.
6812 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6813 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6814
0bd8297f
EZ
68152012-06-23 Eli Zaretskii <eliz@gnu.org>
6816
96512555
EZ
6817 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6818 last argument of make_unibyte_string.
6819
0bd8297f
EZ
6820 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6821 language ID in the event parameters.
6822
6823 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6824 event.code, not the obscure "character set ID".
6825
63def6b6
CY
68262012-06-23 Chong Yidong <cyd@gnu.org>
6827
6828 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6829
e8a02204
EZ
68302012-06-23 Eli Zaretskii <eliz@gnu.org>
6831
388cdec0
EZ
6832 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6833 * w32.c (fdutimens): New function.
6834
6835 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6836
6837 * s/ms-w32.h (pselect): Redirect to sys_select.
6838
6839 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6840
e8a02204
EZ
6841 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6842 in the logic of incrementing and decrementing the value of
6843 use_relocatable_buffers.
6844
d054f3fb
PE
68452012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6846
6847 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6848 Privately reported by Herbert J. Skuhra.
6849 [__FreeBSD__]: Remove "*/" typo after "#include".
6850 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6851 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6852 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6853 Don't assume EMACS_TIME and struct timeval are the same type.
6854
d35af63c
PE
68552012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6856
6857 Support higher-resolution time stamps (Bug#9000).
6858 The time stamps are only nanosecond-resolution at the C level,
6859 since that's the best that any real-world system supports now.
6860 But they are picosecond-resolution at the Lisp level, as that's
6861 easy, and leaves room for future OS improvements.
6862
6863 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6864 (LIBES): Use it.
6865
6866 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6867 Don't get current time unless it's needed.
6868
6869 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6870 now provides it if it's absent.
6871 (start_atimer): Port to higher-res time stamps.
6872 Check for time stamp overflow. Don't get current time more
6873 often than is needed.
6874
6875 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6876 Include systime.h, not time.h.
6877 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6878
6879 * dired.c: Include stat-time.h.
6880 (Ffile-attributes): File times now have higher resolution.
6881
6882 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6883 (struct image): Timestamp now has higher resolution.
6884
6885 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6886 has at least microseconds now. All uses removed.
6887 (update_frame, update_single_window, update_window, update_frame_1)
6888 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 6889 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
6890
6891 * editfns.c (time_overflow): Now extern.
6892 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6893 (float-time, Fformat_time_string, Fcurrent_time_string)
6894 (Fcurrent_time_zone): Accept and generate higher-resolution
6895 time stamps.
6896 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6897 (decode_time_components, lisp_seconds_argument): New functions.
6898 (make_time): Now static.
6899 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6900 Report an error if the time is invalid, rather than having the caller
6901 do that.
6902
6903 * fileio.c: Include <stat-time.h>
6904 (Fcopy_file): Copy higher-resolution time stamps.
6905 Prefer to set the time stamp via a file descriptor if that works.
6906 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6907 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6908 (Fvisited_file_modtime, Fset_visited_file_modtime):
6909 Support higher-resolution time stamps.
6910
6911 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6912
6913 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6914
6915 * image.c (prepare_image_for_display, clear_image_cache)
6916 (lookup_image): Port to higer-resolution time stamps.
6917
6918 * keyboard.c (start_polling, bind_polling_period):
6919 Check for time stamp overflow.
6920 (read_char, kbd_buffer_get_event, timer_start_idle)
6921 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6922 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6923 Port to higher-resolution time stamps. Do not assume time_t is signed.
6924 (decode_timer): New function. Timers are now vectors of length 9,
6925 not 8, to accommodate the picosecond component.
6926 (timer_check_2): Use it.
6927
6928 * nsterm.m (select_timeout, timeval_subtract): Remove.
6929 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6930 as they're a bit more accurate and handle overflow better.
6931 (ns_select): Change prototype to be compatible with pselect.
6932 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6933 * nsterm.h (ns_select): Adjust prototype.
6934
6935 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6936 us-resolution time stamps.
6937 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6938
6939 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6940
6941 * lisp.h (time_overflow): New decl.
6942 (wait_reading_process_output): First arg is now intmax_t, not int,
6943 to accommodate larger waits.
6944
6945 * process.h (struct Lisp_Process.read_output_delay):
6946 Now counts nanoseconds, not microseconds.
6947 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6948 EMACS_HAS_USECS.
6949 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6950 (wait_reading_process_output):
6951 Port to ns-resolution time stamps.
6952 (Faccept_process_output, wait_reading_process_output):
6953 Check for time stamp overflow. Do not assume time_t is signed.
6954 (select_wrapper): Remove; we now use pselect.
6955 (Fprocess_attributes): Now generates ns-resolution time stamps.
6956
6957 * sysdep.c: Include utimens.h. Don't include utime.h
6958 or worry about struct utimbuf; gnulib does that for us now.
6959 (gettimeofday): Remove; gnulib provides a substitute.
6960 (make_timeval): New function.
6961 (set_file_times): Now sets ns-resolution time stamps.
6962 New arg FD; all uses changed.
6963 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6964 (system_process_attributes):
6965 Now returns ns-resolution time stamp. All uses changed.
6966 Check for time stamp overflow.
6967
6968 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6969 provides a substitute now.
6970
6971 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6972 since it guarantees struct timespec.
6973 (EMACS_TIME): Now struct timespec, so that we can support
6974 ns-resolution time stamps.
6975 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6976 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6977 (EMACS_USECS): Remove.
6978 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6979 so multiply the arg by 1000 before storing it.
6980 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6981 New macros.
6982 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6983 Port to ns-resolution time stamps.
6984 (EMACS_TIME_NEG_P): Remove; replaced by....
6985 (EMACS_TIME_SIGN): New macro.
6986 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6987 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6988 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6989 (make_timeval, make_lisp_time, decode_time_components): New decls.
6990 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6991 that it mishandled time_t overflow. You can't compare by subtracting!
6992 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6993 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6994
6995 * term.c: Include <sys/time.h>.
6996 (timeval_to_Time): New function, for proper overflow wraparound.
6997 (term_mouse_position, term_mouse_click): Use it.
6998
6999 * undo.c (record_first_change): Support higher-resolution time stamps
7000 in the undo buffer.
7001 (Fprimitive_undo): Use them when restoring time stamps.
7002
7003 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7004 (w32_get_internal_run_time):
7005 Port to higher-resolution Emacs time stamps.
7006 (ltime): Now accepts single 64-bit integer, as that's more convenient
7007 for callers.
7008
7009 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7010
7011 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7012 for compatibility with pselect. Support ns-resolution time stamps.
7013
7014 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7015
7016 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7017 Check for time stamp overflow, and support ns-resolution time stamps.
7018
7019 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7020 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7021 (timeval_subtract): Remove; no longer needed.
7022 (XTflash, XTring_bell, x_wait_for_event):
7023 Port to ns-resolution time stamps. Don't assume time_t is signed.
7024
b6a92dfe
CY
70252012-06-22 Chong Yidong <cyd@gnu.org>
7026
7027 * xdisp.c (x_consider_frame_title): Revert last change.
7028
d251c37c
EZ
70292012-06-22 Eli Zaretskii <eliz@gnu.org>
7030
7031 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7032 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7033 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7034 staticidx goes up to 1597 out of 1600 = 0x640.)
7035
f10deafb
PE
70362012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7037
7038 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7039 Otherwise, the umask might be mistakenly 0 while handling input signals.
7040
ec6de1e2
SM
70412012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7042
7043 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7044
28be1ada
DA
70452012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7046
7047 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7048 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7049 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7050 access to `contents' member of Lisp_Vector objects with AREF and ASET
7051 where appropriate.
7052
c6bf3022
CY
70532012-06-19 Chong Yidong <cyd@gnu.org>
7054
7055 * frame.c (delete_frame): When selecting a frame on a different
7056 text terminal, do not alter the terminal's top-frame.
7057
7058 * xdisp.c (format_mode_line_unwind_data): Record the target
7059 frame's selected window and its terminal's top-frame.
7060 (unwind_format_mode_line): Restore them.
7061 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7062 Callers changed.
7063 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7064 since tty frames can be explicitly named.
7065 (prepare_menu_bars): Likewise.
7066
7067 * term.c (Ftty_top_frame): New function.
7068
defd4196
PE
70692012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7070
7071 Port byte-code-meter to modern targets.
7072 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7073 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 7074 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
7075 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7076 (METER_1, METER_2): Simplify.
7077
1053a871
SM
70782012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7079
7080 * data.c (Fdefalias): Return `symbol' (bug#11686).
7081
b7e8d081
MR
70822012-06-18 Martin Rudalics <rudalics@gmx.at>
7083
7084 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
7085 gets killed during executing of this function (Bug#11665).
7086 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
7087 (Vkill_buffer_query_functions): In doc-string say that functions
7088 run by this hook should not change the current buffer.
7089
7ea2b339
PE
70902012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7091
7092 Fix recently-introduced process.c problems found by static checking.
7093 * process.c (write_queue_push, write_queue_pop, send_process):
7094 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7095 (write_queue_pop): Fix pointer signedness problem.
7096 (send_process): Remove unused local.
7097
96a313a1
CY
70982012-06-17 Chong Yidong <cyd@gnu.org>
7099
7100 * xdisp.c (redisplay_internal): No need to redisplay terminal
7101 frames that are not on top.
7102
20ca2e94
TN
71032012-06-17 Troels Nielsen <bn.troels@gmail.com>
7104
7105 * process.c (make_process): Initialize write_queue.
7106 (write_queue_push, write_queue_pop): New functions.
7107 (send_process): Use them to maintain correct ordering of process
7108 writes (Bug#10815).
7109
9a900ca9
PE
71102012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7111
310fbfa8
PE
7112 * lisp.h (eassert): Assume C89 or later.
7113 This removes the need for CHECK.
7114 (CHECK): Remove. Its comments about always evaluating its
7115 argument were confusing, as 'eassert' typically does not evaluate
7116 its argument.
7117
27bb1ca4
PE
7118 * coding.c (produce_chars): Use ptrdiff_t, not int.
7119
9a900ca9
PE
7120 * xterm.c (x_draw_underwave): Check for integer overflow.
7121 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7122
41b7f8bc 71232012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
7124
7125 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7126 referenced (Bug#11583).
7127
9b0e3eba
AA
71282012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7129
7130 Implement wave-style variant of underlining.
7131 * dispextern.h (face_underline_type): New enum.
7132 (face): Add field for underline type.
7133 * nsterm.m (ns_draw_underwave): New function.
7134 (ns_draw_text_decoration): Use it.
7135 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7136 New functions.
7137 (x_draw_glyph_string): Use them.
7138 * xfaces.c (Qline, Qwave): New Lisp objects.
7139 (check_lface_attrs, merge_face_ref)
1053a871
SM
7140 (Finternal_set_lisp_face_attribute, realize_x_face):
7141 Handle wave-style underline face attributes.
9b0e3eba
AA
7142 * xterm.c (x_draw_underwave): New function.
7143 (x_draw_glyph_string): Use it.
7144
0fb52f11
JB
71452012-06-16 Juanma Barranquero <lekktu@gmail.com>
7146
7147 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7148 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7149 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7150 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7151 ($(BLD)/w32select.$(O)): Update dependencies.
7152
e5560ff7
AS
71532012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7154
7155 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7156 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7157 * character.c (_fetch_multibyte_char_p): Remove.
7158 * alloc.c: Include "character.h" before "buffer.h".
7159 * bidi.c: Likewise.
7160 * buffer.c: Likewise.
7161 * bytecode.c: Likewise.
7162 * callint.c: Likewise.
7163 * callproc.c: Likewise.
7164 * casefiddle.c: Likewise.
7165 * casetab.c: Likewise.
7166 * category.c: Likewise.
7167 * cmds.c: Likewise.
7168 * coding.c: Likewise.
7169 * composite.c: Likewise.
7170 * dired.c: Likewise.
7171 * dispnew.c: Likewise.
7172 * doc.c: Likewise.
7173 * dosfns.c: Likewise.
7174 * editfns.c: Likewise.
7175 * emacs.c: Likewise.
7176 * fileio.c: Likewise.
7177 * filelock.c: Likewise.
7178 * font.c: Likewise.
7179 * fontset.c: Likewise.
7180 * fringe.c: Likewise.
7181 * indent.c: Likewise.
7182 * insdel.c: Likewise.
7183 * intervals.c: Likewise.
7184 * keyboard.c: Likewise.
7185 * keymap.c: Likewise.
7186 * lread.c: Likewise.
7187 * macros.c: Likewise.
7188 * marker.c: Likewise.
7189 * minibuf.c: Likewise.
7190 * nsfns.m: Likewise.
7191 * nsmenu.m: Likewise.
7192 * print.c: Likewise.
7193 * process.c: Likewise.
7194 * regex.c: Likewise.
7195 * region-cache.c: Likewise.
7196 * search.c: Likewise.
7197 * syntax.c: Likewise.
7198 * term.c: Likewise.
7199 * textprop.c: Likewise.
7200 * undo.c: Likewise.
7201 * unexsol.c: Likewise.
7202 * w16select.c: Likewise.
7203 * w32fns.c: Likewise.
7204 * w32menu.c: Likewise.
7205 * window.c: Likewise.
7206 * xdisp.c: Likewise.
7207 * xfns.c: Likewise.
7208 * xmenu.c: Likewise.
7209 * xml.c: Likewise.
7210 * xselect.c: Likewise.
7211
2f07e6af
EZ
72122012-06-16 Eli Zaretskii <eliz@gnu.org>
7213
1053a871
SM
7214 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7215 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 7216 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
7217 row.
7218 (handle_face_prop): Use chunk-relative overlay string index when
7219 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
7220 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7221 the rightmost. (Bug#11720)
2f07e6af 7222
29b83cec
AS
72232012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7224
7225 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7226 (CATEGORY_MEMBER): Enforce 1/0 value.
7227 * category.c (_temp_category_set): Remove.
7228
4c5501e9
EZ
72292012-06-16 Eli Zaretskii <eliz@gnu.org>
7230
7231 * window.c (Fdelete_other_windows_internal)
7232 (Fdelete_window_internal): Don't access frame's mouse highlight
7233 info of the initial frame. (Bug#11677)
7234
2b570124
PE
72352012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7236
e93864f9
PE
7237 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7238 Assume USE_2_TAGS_FOR_INTS.
7239 (xreload): Adjust $tagmask width to match recent lisp.h change.
7240
2b570124
PE
7241 Simplify lisp.h in minor ways that should not affect code.
7242 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7243 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7244 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7245 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7246 (INTTYPEBITS): New macro, for clarity.
7247 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
7248 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7249 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
7250 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7251 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7252
81755f69
JB
72532012-06-13 Juanma Barranquero <lekktu@gmail.com>
7254
7255 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7256
16192a57
GM
72572012-06-13 Glenn Morris <rgm@gnu.org>
7258
7259 * s/bsd-common.h (BSD4_3):
7260 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7261
646b5f55
AS
72622012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7263
7264 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7265 instead of union.
7266 (XLI, XIL): Define.
1053a871
SM
7267 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7268 Use them.
7269 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 7270 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 7271 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
7272 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7273 * frame.c (delete_frame): Remove outdated comment.
7274 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7275 USE_LISP_UNION_TYPE.
7276 (Fw32_unregister_hot_key): Likewise.
7277 (Fw32_toggle_lock_key): Likewise.
7278 * w32menu.c (add_menu_item): Likewise.
7279 (w32_menu_display_help): Use XIL instead of checking
7280 USE_LISP_UNION_TYPE.
7281 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7282 (init_heap): Likewise.
7283 * w32term.c (w32_read_socket): Update comment.
7284
1d3823c9
GM
72852012-06-13 Glenn Morris <rgm@gnu.org>
7286
c62ff706
GM
7287 * s/usg5-4-common.h, src/s/unixware.h:
7288 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7289
1d3823c9
GM
7290 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7291
bfe3e0a2
PE
72922012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7293
7294 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7295 * alloc.c (make_number) [!defined make_number]:
7296 Remove, as lisp.h always defines this now.
7297 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7298 (roundup_size): Verify that it is a power of 2.
7299 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7300 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7301 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7302 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7303 USE_LSB_TAG now is always defined to be either 0 or 1.
7304 All uses changed.
7305 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7306 code works fine either way, and efficiency is not a concern here,
7307 as the union type is for debugging, not for production.
7308 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7309 Use an inline function on all platforms when using the union type,
7310 since this is simpler and 'static inline' can be used portably
7311 within Emacs now.
7312 (LISP_INITIALLY_ZERO): New macro.
7313 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7314 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7315
45fa9c0f
GM
73162012-06-12 Glenn Morris <rgm@gnu.org>
7317
b4492cba
GM
7318 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7319
7320 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 7321
45fa9c0f
GM
7322 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7323 Move BROKEN_SIGIO to configure.
7324
7325 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7326 Move NO_TERMIO to configure.
7327
0e25d334
CY
73282012-06-12 Chong Yidong <cyd@gnu.org>
7329
7330 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7331 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7332 MagickExportImagePixels is undefined.
7333
43682bb6
PE
73342012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7335
7336 * image.c (imagemagick_load_image): Remove unused label.
7337
a9be7d2b
GM
73382012-06-11 Glenn Morris <rgm@gnu.org>
7339
7340 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7341 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7342 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7343 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7344
3017f87f
SM
73452012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7346
7347 * alloc.c (make_byte_code): New function.
7348 (Fmake_byte_code): Use it. Don't purify here.
7349 * lread.c (read1): Use it as well to avoid extra allocation.
7350
1b9b4cf4
CY
73512012-06-11 Chong Yidong <cyd@gnu.org>
7352
7353 * image.c (imagemagick_load_image): Implement transparency.
7354
95988fcf
AS
73552012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7356
7357 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7358 account for preceding backslashes. (Bug#11663)
7359
cd4eb164
CY
73602012-06-09 Chong Yidong <cyd@gnu.org>
7361
7362 * term.c: Support italics in capable terminals (Bug#9652).
7363 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7364 (turn_on_face): Output using TS_enter_italic_mode if available.
7365 Don't handle unused blinking and alt-charset cases.
7366 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7367 and tty_alt_charset_p cases.
7368 (tty_capable_p, init_tty): Support italics.
7369
7370 * termchar.h (struct tty_display_info): Add field for italics.
7371 Remove unused blink field.
7372
7373 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7374 Handle slant.
7375
7376 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7377 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7378 tty_alt_charset_p. Add tty_italic_p.
7379
ff88beb8
MA
73802012-06-09 Michael Albinus <michael.albinus@gmx.de>
7381
7382 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7383 dbus_type_is_basic if available.
7384 (xd_extract_signed, xd_extract_unsigned): Rename from
7385 extract_signed and extract_unsigned, respectively. Adapt callers.
7386
44286096
CY
73872012-06-09 Chong Yidong <cyd@gnu.org>
7388
1682701f
CY
7389 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7390
44286096
CY
7391 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7392 case (Bug#9752).
7393
d86feb17
PE
73942012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7395
7396 * xdisp.c (vmessage): Treat frame message as multibyte.
7397 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7398 would generate the diagnostic "Making \302\247 buffer-local while
7399 let-bound!".
7400
d5c20fe8
EZ
74012012-06-08 Eli Zaretskii <eliz@gnu.org>
7402
7403 * dispnew.c (showing_window_margins_p): Undo last change, which
7404 was done due to an inadvertent commit.
7405 (adjust_frame_glyphs_for_frame_redisplay): Do call
7406 showing_window_margins_p.
7407
513749ee
SM
74082012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7409
7410 * eval.c (Fmake_var_non_special): New primitive.
7411 (syms_of_eval): Defsubr it.
7412 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7413
d4a8f5c1
JB
74142012-06-08 Juanma Barranquero <lekktu@gmail.com>
7415
7416 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7417 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7418
8bbbc977
EZ
74192012-06-08 Eli Zaretskii <eliz@gnu.org>
7420
7421 * alloc.c (allocate_vectorlike): Fix last change.
7422
f3372c87
DA
74232012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7424
7425 Block-based vector allocation of small vectors.
7426 * lisp.h (struct vectorlike_header): New field `nbytes',
7427 adjust comment accordingly.
7428 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 7429 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
7430 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7431 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7432 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7433 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7434 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7435 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7436 (roundup_size): New constant.
7437 (struct vector_block): New data type.
7438 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 7439 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
7440 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7441 (sweep_vectors): New functions.
7442 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 7443 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
7444 or equal to VBLOCK_BYTES_MAX.
7445 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7446 (init_alloc_once): Add call to init_vectors.
7447
4f18a4ed
SM
74482012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7449
7450 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7451
86f158bc
PE
74522012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7453
7454 * doprnt.c (doprnt): Truncate multibyte char correctly.
7455 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7456 would mishandle a string argument "Xc" if X was a multibyte
7457 character of length 2: it would truncate after X's first byte
7458 rather than including all of X.
7459
c5cfcbe0
CY
74602012-06-06 Chong Yidong <cyd@gnu.org>
7461
7462 * buffer.c (word_wrap): Doc fix.
7463
c05cf390
PE
74642012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7465
7466 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7467
0c3461de
GM
74682012-06-03 Glenn Morris <rgm@gnu.org>
7469
7470 * xdisp.c (tool-bar-style): Doc fix.
7471
c71232db
UM
74722012-06-03 Ulrich Müller <ulm@gentoo.org>
7473
7474 * Makefile.in (PAXCTL): Define.
7475 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7476 binary via PaX flags if the paxctl utility is available.
7477 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7478 Restore PaX flags to their default. (Bug#11398)
7479
383f7350
CY
74802012-06-03 Chong Yidong <cyd@gnu.org>
7481
7482 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7483 buffer (Bug#11226).
7484
5f2c76c6
CY
74852012-06-03 Chong Yidong <cyd@gnu.org>
7486
7487 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7488 (note_mode_line_or_margin_highlight): If there is no help echo,
7489 use mode-line-default-help-echo. Handle the case where the mouse
7490 position is past the end of the mode line string.
7491
7492 * buffer.c (buffer_local_value_1): New function, split from
7493 Fbuffer_local_value; can return Qunbound.
7494 (Fbuffer_local_value): Use it.
7495 (Vmode_line_format): Docstring tweaks.
7496
773d47f6
PE
74972012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7498
7499 * sysdep.c (system_process_attributes): Improve comment.
7500
f2d6a3df
SM
75012012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7502
7503 * keyboard.c: Export real-this-command to Elisp.
7504 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7505 and DEFVAR it. Update all users.
7506
63810350
PE
75072012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7508
7bd5c1f4
PE
7509 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7510
63810350
PE
7511 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7512 Convert pctcpu and pctmem to Lisp float properly.
7513 Let the compiler fold better, as 100.0/0x8000 is exact.
7514
a2821611
AS
75152012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7516
7517 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7518 cons_block.
7519
5fceba1d
PE
75202012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7521
7522 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7523
c98ff5dd
DA
75242012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7525
7526 For a 'struct window', replace some Lisp_Object fields to
7527 bitfields where appropriate, remove unused fields.
7528 * window.h (struct window): Remove unused 'last_mark_x' and
7529 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7530 change it's type from Lisp_Object to bitfield.
7531 Change type of 'force_start', 'optional_new_start',
7532 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 7533 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 7534
ca34e0be
PE
75352012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7536
7537 Pacify gcc -Wdouble-precision when using Xaw.
7538 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7539 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7540 Use 'float' consistently, rather than 'float' in most places
7541 and 'double' in a couple of places.
7542
efc00ab1 75432012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
7544
7545 * xdisp.c (handle_stop): Detect whether we have overlay strings
7546 loaded by testing it->current.overlay_string_index to be
7547 non-negative, instead of checking whether n_overlay_strings is
7548 positive. (Bug#11587)
7549
efc00ab1 75502012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
7551
7552 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7553
7554 * doc.c (Fsubstitute_command_keys): Doc fix.
7555
efc00ab1 75562012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
7557
7558 * search.c (search_buffer): Remove calls to
7559 r_alloc_inhibit_buffer_relocation, as it is now called by
7560 maybe_unify_char, which was the cause of relocation of buffer text
7561 in bug#11519.
7562
efc00ab1 75632012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
7564
7565 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7566 for the duration of call to load_charset, to avoid problems with
7567 callers of maybe_unify_char that access buffer text through C
7568 pointers.
7569
7570 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7571 decrement the inhibition flag, instead of just setting or
7572 resetting it.
7573
ba93a187
PE
75742012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7575
7576 Remove obsolete '#define static' cruft.
7577 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7578 This #undef was "temporary" in 2000; it is no longer needed
7579 now that '#define static' has gone away.
7580 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7581 (gray_bitmap_bits): Remove; no longer needed.
7582 All uses replaced with definiens.
7583 * xterm.c: Include "bitmaps/gray.xbm".
7584
9e4bf381
PE
75852012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7586
7587 Clean up __executable_start, monstartup when --enable-profiling.
7588 The following changes affect the code only when profiling.
7589 * dispnew.c (__executable_start): Rename from safe_bcopy.
7590 Define only on platforms that need it.
7591 * emacs.c: Include <sys/gmon.h> when profiling.
7592 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7593 (__executable_start): Remove decl, since lisp.h does it now.
7594 (safe_bcopy): Remove decl; no longer has that name.
7595 (main): Coalesce #if into single bit of code, for simplicity.
7596 Cast pointers to uintptr_t, since standard libraries want integers
7597 and not pointers.
7598 * lisp.h (__executable_start): New decl.
7599
32d72c2f
GM
76002012-05-31 Glenn Morris <rgm@gnu.org>
7601
7602 * image.c (Fimagemagick_types): Doc fix.
7603
baac5bc7
JM
76042012-05-30 Jim Meyering <meyering@redhat.com>
7605
7606 * callproc.c (Fcall_process_region): Include directory component
7607 in mkstemp error message (Bug#11586).
7608
72cb32cf
PE
76092012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7610
7611 * alloc.c, lisp.h (make_pure_vector): Now static.
7612
61b108cc
SM
76132012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7614
7615 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7616 Move to byte-run.el.
7617 (Fautoload): Do the hash-doc more carefully.
7618 * data.c (Fdefalias): Purify definition, except for keymaps.
7619 (Qdefun): Move from eval.c.
7620 * lisp.h (Qdefun): Remove.
7621 * lread.c (read1): Tiny simplification.
7622
471fe23d
TN
76232012-05-29 Troels Nielsen <bn.troels@gmail.com>
7624
934f3f58 7625 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
7626 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7627 Bug#9642, but explicitly check that the buffer the overlay would
7628 be moved to is live and rearrange lines to make sure that errors
7629 will not put the overlay in an inconsistent state.
7630 (Fdelete_overlay): Cosmetics.
7631
85d0efd1
EZ
76322012-05-28 Eli Zaretskii <eliz@gnu.org>
7633
7634 * w32term.c (my_bring_window_to_top): New function.
7635 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
7636 could be different from the original one.
7637 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
7638 (Bug#11513)
7639
7640 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7641 by calling BringWindowToTop.
7642
7643 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7644 (WM_EMACS_END): Increase by one.
7645
da92a98c
PE
76462012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7647
7648 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7649 This avoids undefined behavior that might cause the eassert
7650 to not catch an out-of-range value.
7651
74d1f848
JB
76522012-05-28 Juanma Barranquero <lekktu@gmail.com>
7653
7654 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7655 Update dependencies.
7656
9e1a06fc
EZ
76572012-05-27 Eli Zaretskii <eliz@gnu.org>
7658
7659 * bidi.c (bidi_mirror_char): Fix last change.
7660
f3dd7312
AS
76612012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7662
7663 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7664 when referring to sectname field in printf format.
7665
81899c91
PE
76662012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7667
57b81a9f
PE
7668 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7669 Only r_alloc_inhibit_buffer_relocation needed to be added;
7670 the others were already declared.
7671
81899c91
PE
7672 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7673 before checking whether it's out of range. Put the check inside
7674 eassert. See
7675 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7676
33017faf 76772012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
7678
7679 * callproc.c (Fcall_process): Restore a line that was accidentally
7680 commented out in the 2011-02-13 change (bug#11547).
7681
33017faf 76822012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
7683
7684 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7685 defined on ralloc.c.
7686
7687 * buffer.c [REL_ALLOC]: Remove prototypes of
7688 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7689 they are now on lisp.h.
7690
7691 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7692
7693 * search.c (search_buffer): Use it to inhibit relocation of buffer
7694 text while re_search_2 is doing its job, because re_search_2 is
7695 passed C pointers to buffer text. (Bug#11519)
7696
23415acf
EZ
7697 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7698 Update value to 24.
7699
44e27368
EZ
7700 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7701 state after an additional call to move_it_in_display_line_to, keep
7702 the values of it->max_ascent and it->max_descent found for the
7703 entire line.
7704 (pos_visible_p): Revert the comparison against bottom_y to what it
7705 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7706 (Bug#11464)
7707
c1892f11
PE
77082012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7709
7710 Fix coding-related core dumps with gcc -ftrapv.
7711 The code was computing A - B, where A and B are pointers, and B is
7712 random garbage. This can lead to core dumps on platforms that
7713 have special pointer registers, and it also leads to core dumps on
7714 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7715 A - B only when B is initialized properly.
7716 * coding.c (coding_set_source, coding_set_destination): Return void.
7717 (coding_change_source, coding_change_destinations): New functions,
7718 with the old behaviors of coding_set_source and coding_set_destination.
7719 All callers that need an offset changed to use these new functions.
7720
eb7afdad
GM
77212012-05-26 Glenn Morris <rgm@gnu.org>
7722
7723 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7724
f12fdf02
EZ
77252012-05-26 Eli Zaretskii <eliz@gnu.org>
7726
53a63be6 7727 Extend mouse support on W32 text-mode console.
61b108cc
SM
7728 * xdisp.c (draw_row_with_mouse_face):
7729 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 7730
eb3f6f01 7731 * w32console.c: Include window.h.
61b108cc
SM
7732 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7733 New functions.
eb3f6f01
EZ
7734 (initialize_w32_display): Initialize mouse-highlight data.
7735
53a63be6
EZ
7736 * w32inevt.c: Include termchar.h and window.h.
7737 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7738 moves, call note_mouse_highlight. If help_echo changed, call
7739 gen_help_event to produce help-echo message in the echo area.
7740 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7741 highlight info.
7742
4cfd81f6
PE
77432012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7744
7745 * lread.c (read1): Simplify slightly to avoid an overflow warning
7746 with GCC 4.7.0 on x86-64.
7747
4446092a
EZ
77482012-05-26 Eli Zaretskii <eliz@gnu.org>
7749
7750 * bidi.c (bidi_mirror_char): Revert last change: an int is
7751 definitely wide enough here.
7752
42b2a986 77532012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 7754
42b2a986 7755 Fix integer width and related bugs (Bug#9874).
eb106a49 7756 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
7757 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7758 (string_bytes, check_sblock, allocate_string_data):
7759 (compact_small_strings, Fmake_bool_vector, make_string)
7760 (make_unibyte_string, make_multibyte_string)
7761 (make_string_from_bytes, make_specified_string)
7762 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7763 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7764 (mark_vectorlike):
7765 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7766 (allocate_pseudovector):
7767 Use int, not EMACS_INT, where int is wide enough.
7768 (inhibit_garbage_collection, Fgarbage_collect):
7769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7770 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7771 int might not be wide enough.
7772 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7773 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7774 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7775 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7776 (bidi_level_of_next_char, bidi_move_to_visually_next):
7777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7778 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7779 (Fkill_buffer, Fset_buffer_major_mode)
7780 (advance_to_char_boundary, Fbuffer_swap_text)
7781 (Fset_buffer_multibyte, overlays_at, overlays_in)
7782 (overlay_touches_p, struct sortvec, record_overlay_string)
7783 (overlay_strings, recenter_overlay_lists)
7784 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7785 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7786 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7787 (Foverlay_recenter, last_overlay_modification_hooks_used)
7788 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
7790 (validate_region): Omit unnecessary test for b <= e,
7791 since that's guaranteed by the previous test.
d311d28c
PE
7792 (adjust_overlays_for_delete): Avoid pos + length overflow.
7793 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7794 (report_overlay_modification):
7795 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7796 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7797 Omit pointer cast, which isn't needed anyway, and doesn't work
7798 after the EMACS_INT -> ptrdiff_t change.
02481186 7799 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
7800 * buffer.h: Adjust decls to match defn changes elsewhere.
7801 (struct buffer_text, struct buffer):
7802 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7803 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
7804 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7805 not int, to avoid needless 32-bit limit on 64-bit hosts.
7806 (exec_byte_code): Use tighter memory-full test, one that checks
7807 for alloca overflow. Don't compute the address of the object just
7808 before an array, as that's not portable. Use EMACS_INT, not
7809 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
7810 * callint.c (Fcall_interactively):
7811 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7812 * callproc.c (call_process_kill, Fcall_process):
7813 Don't assume pid_t fits into an Emacs fixnum.
7814 (call_process_cleanup, Fcall_process, child_setup):
7815 Don't assume pid_t fits into int.
7816 (call_process_cleanup, Fcall_process, delete_temp_file)
7817 (Fcall_process_region):
7818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7819 (Fcall_process): Simplify handling of volatile integers.
7820 Use int, not EMACS_INT, where int will do.
7821 * casefiddle.c (casify_object, casify_region, operate_on_word)
7822 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7824 (casify_object): Avoid integer overflow when overallocating buffer.
7825 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 7826 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
7827 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7828 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7829 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7830 integers are now checked earlier. All uses replaced with XINT.
7831 (ccl_driver):
7832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7833 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
7834 (ccl_driver, Fregister_code_conversion_map):
7835 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
7836 (resolve_symbol_ccl_program): Check that vector header is in range.
7837 Always copy the vector, so that we can check its contents reliably
7838 now rather than having to recheck each instruction as it's being
7839 executed. Check that vector words fit in 'int'.
7840 (ccl_get_compiled_code, Fregister_ccl_program)
7841 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7842 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7843 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7844 contents are in range.
7845 (Fccl_execute_on_string): Check that status is in range.
7846 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7847 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7848 Accept and return EMACS_INT, not int, because callers can pass values
7849 out of 'int' range.
7850 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7851 (multibyte_chars_in_text, parse_str_as_multibyte)
7852 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7853 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7854 (string_escape_byte8, Fget_byte):
7855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 7856 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
7857 avoid mishandling large integers.
7858 * character.h: Adjust decls to match defn changes elsewhere.
7859 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7860 (Ffind_charset_region):
7861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7862 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7863 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 7864 Don't assume fixnum fits in int.
d311d28c
PE
7865 (load_charset_map_from_vector, Fmap_charset_chars):
7866 Remove now-unnecessary CHECK_NATNUMs.
7867 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
7868 Don't rely on undefined behavior with signed left shift overflow.
7869 Don't assume unsigned int fits into fixnum, or that fixnum fits
7870 into unsigned int. Don't require max_code to be a valid fixnum;
7871 that's not true for gb10830 4-byte on a 32-bit host. Allow
7872 invalid_code to be a cons, for the same reason. Require code_offset
7873 to be a character. Avoid int overflow if max_char is close
7874 to INT_MAX.
7875 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7876 this is intended anyway and avoids some undefined behavior.
7877 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7878 INDEX_TO_CODE_POINT, as that's what it expects.
7879 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
7880 * charset.h (DECODE_CHAR): Return int, not unsigned;
7881 this is what was intended anyway, and it avoids undefined behavior.
7882 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7883 integer-overflow issues.
7884 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7885 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7886 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
7887 * chartab.c (Fmake_char_table, Fset_char_table_range)
7888 (uniprop_get_decoder, uniprop_get_encoder):
7889 Don't assume fixnum fits in int.
7890 * cmds.c (move_point): New function, that does the gist of
7891 Fforward_char and Fbackward_char, but does so while checking
7892 for integer overflow more accurately.
c96e5d6a 7893 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
7894 (Fforward_line, Fend_of_line, internal_self_insert)
7895 (internal_self_insert):
7896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7897 Fix a FIXME, by checking for integer overflow when calculating
7898 target_clm and actual_clm.
7899 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 7900 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
7901 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7902 (coding_alloc_by_making_gap, alloc_destination)
7903 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7904 (encode_coding_utf_16, detect_coding_emacs_mule)
7905 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7906 (detect_coding_iso_2022, decode_coding_iso_2022)
7907 (encode_invocation_designation, encode_designation_at_bol)
7908 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7909 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7910 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7911 (encode_coding_ccl, encode_coding_raw_text)
7912 (detect_coding_charset, decode_coding_charset)
7913 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7914 (produce_composition, produce_charset, produce_annotation)
7915 (decode_coding, handle_composition_annotation)
7916 (handle_charset_annotation, consume_chars, decode_coding_gap)
7917 (decode_coding_object, encode_coding_object, detect_coding_system)
7918 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7919 (code_convert_region, code_convert_string)
8f50130c
PE
7920 (Fdefine_coding_system_internal)
7921 (coding_set_source, coding_set_destination):
d311d28c
PE
7922 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7923 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7924 (Fdefine_coding_system_internal):
7925 Don't assume fixnums fit in int.
7926 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 7927 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
7928 (Funencodable_char_position, Fcheck_coding_systems_region)
7929 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 7930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 7931 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 7932 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 7933 Don't access memory outside of the args array.
d311d28c 7934 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
7935 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7936 result of ENCODE_CHAR.
d311d28c
PE
7937 * coding.h: Adjust decls to match defn changes elsewhere.
7938 (struct coding_system):
7939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7940 * composite.c (get_composition_id, find_composition)
7941 (run_composition_function, update_compositions)
7942 (compose_text, composition_gstring_put_cache)
7943 (composition_gstring_p, composition_gstring_width)
7944 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7945 (composition_compute_stop_pos, composition_reseat_it)
7946 (composition_update_it, struct position_record)
7947 (find_automatic_composition, composition_adjust_point)
7948 (Fcomposition_get_gstring, Ffind_composition_internal):
7949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7950 (update_compositions):
7951 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7952 * composite.h: Adjust decls to match defn changes elsewhere.
7953 (struct composition):
7954 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7955 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7956 Do not attempt to compute the address of the object just before a
7957 buffer; this is not portable.
7958 (Faref, Faset):
7959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7960 (Faset): Use int, not EMACS_INT, where int is wide enough.
7961 (Fstring_to_number): Don't assume fixnums fit in int.
7962 (Frem): Don't assume arg is nonnegative.
7963 * dbusbind.c (xd_append_arg): Check for integers out of range.
7964 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7965 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7966 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7967 (xd_get_connection_references): Return ptrdiff_t, not int.
7968 All uses changed.
7969 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7970 (xd_read_message_1):
7971 Use int, not unsigned, where the dbus API uses int.
7972 (Fdbus_message_internal): Don't overflow mtype.
7973 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7974 * dired.c (directory_files_internal, file_name_completion, scmp)
7975 (file_name_completion_stat):
7976 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7977 (file_name_completion): Don't overflow matchcount.
7978 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7979 * dispextern.h: Adjust decls to match defn changes elsewhere.
7980 (struct text_pos, struct glyph, struct bidi_saved_info)
7981 (struct bidi_string_data, struct bidi_it, struct composition_it)
7982 (struct it):
7983 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7984 (struct display_pos, struct composition_it, struct it):
7985 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7986 * dispnew.c (increment_matrix_positions)
7987 (increment_row_positions, mode_line_string)
7988 (marginal_area_string):
7989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7990 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7992 (duration_to_sec_usec): New function, to check for overflow better.
7993 (Fsleep_for, sit_for): Use it.
7994 * doc.c (get_doc_string, store_function_docstring):
7995 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7996 (get_doc_string, Fsnarf_documentation):
7997 Use int, not EMACS_INT, where int is wide enough.
7998 (get_doc_string):
7999 Use SAFE_ALLOCA, not alloca.
8000 Check for overflow when converting EMACS_INT to off_t.
8001 * doprnt.c (doprnt):
8002 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8003 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8004 Don't assume uid_t fits into fixnum.
8005 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8006 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8007 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8008 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8009 (general_insert_function)
8010 (Finsert_char, make_buffer_string, make_buffer_string_both)
8011 (update_buffer_properties, Fbuffer_substring)
8012 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8013 (Fsubst_char_in_region, check_translation)
8014 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8015 (transpose_markers, Ftranspose_regions):
8016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8017 (clip_to_bounds): Move to lisp.h as an inline function).
8018 (Fconstrain_to_field): Don't assume integers are nonnegative.
8019 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8020 (Fsubst_char_in_region, Fsave_restriction):
8021 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8022 (Femacs_pid): Don't assume pid_t fits into fixnum.
8023 (lo_time): Use int, not EMACS_INT, when int suffices.
8024 (lisp_time_argument): Check for usec out of range.
8025 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
8026 (Fuser_login_name, Fuser_full_name): Signal an error
8027 if a uid argument is out of range, rather than relying on
8028 undefined behavior.
c8d5c857
PE
8029 (Fformat_time_string): Remove now-unnecessary check.
8030 lisp_time_argument checks for out-of-range usec now.
243e0530 8031 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
8032 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8033 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8034 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8035 (init_cmdargs, Fdump_emacs):
8036 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8037 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8038 the bottom (typically) 32 bits of the fixnum.
8039 * eval.c (specpdl_size, call_debugger):
8040 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8041 (when_entered_debugger, Fbacktrace_debug):
8042 Don't assume fixnum can fit in int.
8043 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8044 the object just before a buffer; this is not portable.
8045 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8046 (grow_specpdl, unbind_to):
8047 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8048 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8049 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 8050 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
8051 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8052 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8053 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8054 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8055 (a_write, e_write):
8056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8057 (Fcopy_file, non_regular_nbytes, read_non_regular)
8058 (Finsert_file_contents):
8059 Use int, not EMACS_INT, where int is wide enough.
8060 (READ_BUF_SIZE): Verify that it fits in int.
8061 (Finsert_file_contents): Check that counts are in proper range,
8062 rather than assuming fixnums fit into ptrdiff_t etc.
8063 Don't assume fixnums fit into int.
125b3835 8064 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
8065 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8066 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
8067 (string_char_to_byte, string_byte_to_char)
8068 (string_make_multibyte, string_to_multibyte)
8069 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8070 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8071 (substring_both, Fdelete, internal_equal, Ffillarray)
8072 (Fclear_string, mapcar1)
8073 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8074 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8075 (larger_vector, make_hash_table, maybe_resize_hash_table)
8076 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8077 (Fmaphash, secure_hash):
8078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8079 (concat): Check for string index and length overflow.
8080 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8081 (Frequire):
8082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8083 (larger_vector): New API (vec, incr_min, size_max) replaces old
8084 one (vec, new_size, init). This catches size overflow.
8085 INIT was removed because it was always Qnil.
8086 All callers changed.
8087 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8088 the upper bound on a hash table index size.
8089 (make_hash_table, maybe_resize_hash_table): Use it.
8090 (secure_hash): Computer start_byte and end_byte only after
8091 they're known to be in ptrdiff_t range.
8092 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8093 (Ffont_get_glyphs, Ffont_at):
8094 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8095 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8096 (Flist_fonts, Fopen_font):
8097 Don't assume fixnum can fit in int.
8098 (check_gstring): Don't assume index can fit in int.
8099 (font_match_p): Check that fixnum is a character, not a nonnegative
8100 fixnum, since the later code needs to stuff it into an int.
8101 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8102 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8103 conversion overflow issues.
8104 (Fopen_font): Check for integer out of range.
8105 (Ffont_get_glyphs): Don't assume index can fit in int.
8106 * font.h: Adjust decls to match defn changes elsewhere.
8107 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8108 integer overflow.
8109 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8110 printmax_t, where ptrdiff_t is wide enough.
8111 (Finternal_char_font):
8112 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8113 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8114 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8115 (Fset_frame_position, x_set_frame_parameters)
8116 (x_set_line_spacing, x_set_border_width)
8117 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8118 Check that fixnums are in proper range for system types.
8119 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8121 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8122 Use SAFE_ALLOCA_LISP, not alloca.
8123 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8124 intptr_t is wide enough.
8125 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8126 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8127 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8128 Check for fixnum out of range.
8129 * ftfont.c (ftfont_list): Don't assume index fits in int.
8130 Check that fixnums are in proper range for system types.
8131 (ftfont_shape_by_flt):
8132 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
8133 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8134 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8135 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8136 Check that fixnums are in proper range for system types.
8137 * gnutls.h: Adjust decls to match defn changes elsewhere.
8138 * gtkutil.c (xg_dialog_run):
8139 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8140 (update_frame_tool_bar):
8141 Check that fixnums are in proper range for system types.
8142 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 8143 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
8144 * indent.c (last_known_column, last_known_column_point):
8145 (current_column_bol_cache):
8146 (skip_invisible, current_column, check_display_width):
8147 (check_display_width, scan_for_column, current_column_1)
8148 (Findent_to, Fcurrent_indentation, position_indentation)
8149 (indented_beyond_p, Fmove_to_column, compute_motion):
8150 (Fcompute_motion, Fvertical_motion):
8151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8152 (last_known_column_modified): Use EMACS_INT, not int.
8153 (check_display_width):
8154 (Fcompute_motion):
8155 Check that fixnums and floats are in proper range for system types.
8156 (compute_motion): Don't assume index or fixnum fits in int.
8157 (compute_motion, Fcompute_motion):
8158 Use int, not EMACS_INT, when it is wide enough.
8159 (vmotion): Omit local var start_hpos that is always 0; that way
8160 we don't need to worry about overflow in expressions involving it.
8161 * indent.h: Adjust decls to match defn changes elsewhere.
8162 (struct position):
8163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8164 Use int, not EMACS_INT, where int is wide enough.
8165 Remove unused members ovstring_chars_done and tab_offset;
8166 all uses removed.
8167 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8168 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8169 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8170 (make_gap, copy_text, insert, insert_and_inherit)
8171 (insert_before_markers, insert_before_markers_and_inherit)
8172 (insert_1, count_combining_before, count_combining_after)
8173 (insert_1_both, insert_from_string)
8174 (insert_from_string_before_markers, insert_from_string_1)
8175 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8176 (adjust_after_replace, adjust_after_insert, replace_range)
8177 (replace_range_2, del_range, del_range_1, del_range_byte)
8178 (del_range_both, del_range_2, modify_region)
8179 (prepare_to_modify_buffer, signal_before_change)
8180 (signal_after_change, Fcombine_after_change_execute):
8181 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8182 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8183 (balance_an_interval, split_interval_right, split_interval_left)
8184 (find_interval, next_interval, update_interval)
8185 (adjust_intervals_for_insertion, delete_node, delete_interval)
8186 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8187 (static_offset_intervals, offset_intervals)
8188 (merge_interval_right, merge_interval_left, make_new_interval)
8189 (graft_intervals_into_buffer, temp_set_point_both)
8190 (temp_set_point, set_point, adjust_for_invis_intang)
8191 (set_point_both, move_if_not_intangible, get_property_and_range)
8192 (get_local_map, copy_intervals, copy_intervals_to_string)
8193 (compare_string_intervals, set_intervals_multibyte_1):
8194 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8195 * intervals.h: Adjust decls to match defn changes elsewhere.
8196 (struct interval):
8197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8198 * keyboard.c (this_command_key_count, this_single_command_key_start)
8199 (before_command_key_count, before_command_echo_length, echo_now)
8200 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8201 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8202 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8203 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8205 (last_non_minibuf_size, last_point_position, echo_truncate)
8206 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8207 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8208 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8209 (stuff_buffered_input):
8210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8211 (last_auto_save, command_loop_1, read_char):
8212 Use EMACS_INT, not int, to avoid integer overflow.
8213 (record_char): Avoid overflow in total_keys computation.
8214 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8215 * keyboard.h: Adjust decls to match defn changes elsewhere.
8216 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8217 (Fkey_description, Fdescribe_vector, Flookup_key):
8218 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8219 (click_position): New function, to check that positions are in range.
8220 (Fcurrent_active_maps):
8221 (describe_command):
8222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8223 (Faccessible_keymaps, Fkey_description):
8224 (preferred_sequence_p):
8225 Don't assume fixnum can fit into int.
8226 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8227 Check for integer overflow in size calculations.
8228 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8229 avoid mishandling large integers.
8230 * lisp.h: Adjust decls to match defn changes elsewhere.
8231 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8232 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8233 (struct Lisp_Marker):
8234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8235 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
8236 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8237 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8238 All callers changed.
8239 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8240 Assume the arg has valid form, since it always does.
8241 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8242 unsigned integer system type.
8243 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8244 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8245 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8246 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8247 (duration_to_sec_usec): New decl.
8248 * lread.c (read_from_string_index, read_from_string_index_byte)
8249 (read_from_string_limit, readchar, unreadchar, openp)
8250 (read_internal_start, read1, oblookup):
8251 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8252 (Fload, readevalloop, Feval_buffer, Feval_region):
8253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8254 (openp): Check for out-of-range argument to 'access'.
8255 (read1): Use int, not EMACS_INT, where int is wide enough.
8256 Don't assume fixnum fits into int.
6efdadfd 8257 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
8258 (read_filtered_event): Use duration_to_sec_usec
8259 to do proper overflow checking on durations.
d311d28c
PE
8260 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8261 in size calculation.
8262 (Fexecute_kbd_macro):
8263 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8264 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8265 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8266 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8267 (set_marker_both, set_marker_restricted_both, marker_position)
8268 (marker_byte_position, Fbuffer_has_markers_at):
8269 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8270 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 8271 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
8272 It now merely ensures that the menu is large enough, without
8273 necessarily growing it, as this avoids some integer overflow issues.
8274 All callers changed.
8275 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8276 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8277 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8278 Use SAFE_ALLOCA_LISP, not alloca.
8279 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8280 to EMACS_INT. Check that fixnums are in proper range for system types.
8281 * minibuf.c (minibuf_prompt_width, string_to_object)
8282 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8283 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8285 (get_minibuffer, read_minibuf_unwind):
8286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8287 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8288 this simplifies overflow checking. All callers changed.
8289 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8290 (Ftest_completion):
8291 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8292 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8293 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8294 Check that fixnums are in proper range for system types.
8295 (Fx_create_frame, Fx_show_tip):
8296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8297 * nsfont.m (ns_findfonts, nsfont_list_family):
8298 Don't assume fixnum fits in long.
8299 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8300 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8301 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8302 wide enough.
17fdb222 8303 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
8304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8305 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8306 (PRINTDECLARE, PRINTPREPARE):
8307 (strout, print_string):
8308 (print, print_preprocess, print_check_string_charset_prop)
8309 (print_object):
8310 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8311 (PRINTDECLARE):
8312 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8313 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8314 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 8315 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 8316 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
8317 (print_error_message): Use SAFE_ALLOCA, not alloca.
8318 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
8319 (print_depth, new_backquote_output, print_number_index):
8320 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
8321 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8322 (Fset_process_window_size, Fformat_network_address)
8323 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 8324 (sigchld_handler):
d311d28c 8325 Check that fixnums are in proper range for system types.
d44287d4 8326 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
8327 Check for process-ids out of pid_t range rather than relying on
8328 undefined behavior.
e4d81efc 8329 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
8330 (Fformat_network_address, read_process_output, send_process)
8331 (Fprocess_send_region, status_notify):
8332 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8333 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8334 (wait_reading_process_output, read_process_output, exec_sentinel):
8335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8336 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8337 (Faccept_process_output): Use duration_to_sec_usec to do proper
8338 overflow checking on durations.
dde14581
PE
8339 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8340 Don't assume pid_t fits in int.
02481186
PE
8341 * process.h (struct Lisp_Process): Members tick and update_tick
8342 are now of type EMACS_INT, not int.
b62b53e8
PE
8343 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8344 configured --with-wide-int.
d311d28c
PE
8345 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8346 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8347 * search.c (looking_at_1, string_match_1):
8348 (fast_string_match, fast_c_string_match_ignore_case)
8349 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8350 (scan_newline, find_before_next_newline, search_command)
8351 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8352 (set_search_regs, wordify):
8353 (Freplace_match):
8354 (Fmatch_data):
8355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8356 (string_match_1, search_buffer, set_search_regs):
8357 (Fmatch_data):
8358 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8359 (wordify): Check for overflow in size calculation.
8360 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8361 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8362 Check that fixnums are in proper range for system types.
8363 * sound.c (struct sound_device)
8364 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8366 (Fplay_sound_internal):
8367 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 8368 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
8369 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8370 (Fparse_partial_sexp):
8371 Don't assume fixnums can fit in int.
8372 (struct lisp_parse_state, find_start_pos, find_start_value)
8373 (find_start_value_byte, find_start_begv)
8374 (update_syntax_table, char_quoted, dec_bytepos)
8375 (find_defun_start, prev_char_comend_first, back_comment):
8376 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8377 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8378 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8379 (Finternal_describe_syntax_value): Check that match_lisp is a
8380 character, not an integer, since the code stuffs it into int.
8381 (scan_words, scan_sexps_forward):
8382 Check that fixnums are in proper range for system types.
8383 (Fforward_word):
8384 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8385 (scan_sexps_forward):
8386 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8387 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8388 * syntax.h: Adjust decls to match defn changes elsewhere.
8389 (struct gl_state_s):
8390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
8391 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8392 MOST_POSITIVE_FIXNUM.
d311d28c
PE
8393 * sysdep.c (wait_for_termination_1, wait_for_termination)
8394 (interruptible_wait_for_termination, mkdir):
8395 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8396 (emacs_read, emacs_write):
8397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
8398 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8399 and double all fit in int.
d311d28c
PE
8400 * term.c (set_tty_color_mode):
8401 Check that fixnums are in proper range for system types.
8402 * termhooks.h (struct input_event):
8403 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8404 * textprop.c (validate_interval_range, interval_of)
8405 (Fadd_text_properties, set_text_properties_1)
8406 (Fremove_text_properties, Fremove_list_of_text_properties)
8407 (Ftext_property_any, Ftext_property_not_all)
8408 (copy_text_properties, text_property_list, extend_property_ranges)
8409 (verify_interval_modification):
8410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8411 (Fnext_single_char_property_change)
8412 (Fprevious_single_char_property_change):
8413 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
8414 (copy_text_properties):
8415 Check for integer overflow in index calculation.
d311d28c
PE
8416 * undo.c (last_boundary_position, record_point, record_insert)
8417 (record_delete, record_marker_adjustment, record_change)
8418 (record_property_change):
8419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8420 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8421 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8422 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8423 (Fx_hide_tip, Fx_file_dialog):
8424 * w32menu.c (set_frame_menubar):
8425 Use ptrdiff_t, not int, for consistency with rest of code.
8426 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8427 (select_window, Fdelete_other_windows_internal)
8428 (window_scroll_pixel_based, window_scroll_line_based)
8429 (Frecenter, Fset_window_configuration):
8430 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8431 (Fset_window_hscroll, run_window_configuration_change_hook)
8432 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 8433 (Fscroll_other_window, Frecenter):
d311d28c
PE
8434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8435 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8436 Don't assume fixnum fits in int.
8437 (Fset_window_scroll_bars):
8438 Check that fixnums are in proper range for system types.
8439 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8440 (string_pos, c_string_pos, number_of_chars, init_iterator)
8441 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8442 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8443 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
8444 (face_before_or_after_it_pos, handle_invisible_prop)
8445 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
8446 (display_prop_intangible_p, string_buffer_position_lim)
8447 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8448 (get_overlay_strings_1, get_overlay_strings)
8449 (iterate_out_of_display_property, forward_to_next_line_start)
8450 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8451 (get_next_display_element, set_iterator_to_next)
8452 (get_visually_first_element, compute_stop_pos_backwards)
8453 (handle_stop_backwards, next_element_from_buffer)
8454 (move_it_in_display_line_to, move_it_in_display_line)
8455 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8456 (add_to_log, message_dolog, message_log_check_duplicate)
8457 (message2, message2_nolog, message3, message3_nolog
8458 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8459 (current_message_1, truncate_echo_area, truncate_message_1)
8460 (set_message, set_message_1, store_mode_line_noprop)
8461 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8462 (text_outside_line_unchanged_p, check_point_in_composition)
8463 (reconsider_clip_changes)
8464 (redisplay_internal, set_cursor_from_row, try_scrolling)
8465 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8466 (redisplay_window, find_last_unchanged_at_beg_row)
8467 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8468 (trailing_whitespace_p, find_row_edges, display_line)
8469 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8470 (display_mode_element, store_mode_line_string)
8471 (pint2str, pint2hrstr, decode_mode_spec)
8472 (display_count_lines, display_string, draw_glyphs)
8473 (x_produce_glyphs, x_insert_glyphs)
8474 (rows_from_pos_range, mouse_face_from_buffer_pos)
8475 (fast_find_string_pos, mouse_face_from_string_pos)
8476 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8477 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8478 (safe_call, init_from_display_pos, handle_fontified_prop)
8479 (handle_single_display_spec, load_overlay_strings)
8480 (with_echo_area_buffer, setup_echo_area_for_printing)
8481 (display_echo_area, echo_area_display)
8482 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8483 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
8484 (redisplay_window, dump_glyph_row, display_mode_line)
8485 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 8486 (handle_display_spec, display_prop_string_p):
d311d28c
PE
8487 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8488 (handle_single_display_spec, build_desired_tool_bar_string)
8489 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8490 (get_specified_cursor_type):
8491 Check that fixnums are in proper range for system types.
8492 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8493 (Flookup_image_map):
8494 Don't assume fixnums fit in int.
8495 (compare_overlay_entries):
8496 Avoid mishandling comparisons due to subtraction overflow.
8497 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8498 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8499 (handle_tool_bar_click):
8500 Use int, not unsigned, since we prefer signed and the signedness
8501 doesn't matter here.
8502 (get_next_display_element, next_element_from_display_vector):
8503 Use int, not EMACS_INT, when int is wide enough.
8504 (start_hourglass): Use duration_to_sec_usec to do proper
8505 overflow checking on durations.
8506 * xfaces.c (Fbitmap_spec_p):
8507 Check that fixnums are in proper range for system types.
8508 (compare_fonts_by_sort_order):
8509 Avoid mishandling comparisons due to subtraction overflow.
8510 (Fx_family_fonts, realize_basic_faces):
8511 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8512 (Fx_family_fonts):
8513 Don't assume fixnum fits in int.
8514 Use SAFE_ALLOCA_LISP, not alloca.
8515 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8516 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8517 (face_at_buffer_position, face_for_overlay_string)
8518 (face_at_string_position):
8519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8520 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8521 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8522 (Fx_show_tip):
8523 Check that fixnums are in proper range for system types.
8524 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8525 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8526 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8527 (Fx_change_window_property): Don't assume fixnums fit in int.
8528 * xfont.c (xfont_chars_supported):
8529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8530 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8531 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8532 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8533 * xml.c (parse_region):
8534 * xrdb.c (magic_file_p):
8535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8536 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8537 (x_get_local_selection, x_reply_selection_request)
8538 (x_handle_selection_request, wait_for_property_change):
8539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8540 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8541 short is wide enough.
8542 (x_send_client_event): Don't assume fixnum fits in int.
8543 * xterm.c (x_x_to_emacs_modifiers):
8544 Don't assume EMACS_INT overflows nicely into int.
8545 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8546 may come from Lisp.
8547 (handle_one_xevent): NATNUMP can eval its arg twice.
8548 (x_connection_closed):
8549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8550 * xterm.h: Adjust decls to match defn changes elsewhere.
8551 (struct scroll_bar): Use struct vectorlike_header
8552 rather than rolling our own approximation.
8553 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8554
c6574eb5
GM
85552012-05-25 Glenn Morris <rgm@gnu.org>
8556
8557 * lisp.mk (lisp): Update for more files being compiled now.
8558
e8d32c7e
SM
85592012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8560
48def666
SM
8561 * lread.c: Remove `read_pure' which makes no difference.
8562 (read_pure): Remove var.
8563 (unreadpure): Remove function.
8564 (readevalloop): Don't call read_list with -1 flag.
8565 (read1, read_vector): Don't test read_pure any more.
8566 (read_list): Simplify.
8567
e8d32c7e
SM
8568 * fileio.c, character.h: Minor style tweaks.
8569
4b2addb7
DA
85702012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8571
8572 * window.h (clip_changed): Remove useless declaration.
8573
584461b2
JB
85742012-05-22 Juanma Barranquero <lekktu@gmail.com>
8575
8576 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8577 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8578
34374650
PE
85792012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8580
8581 Remove src/m/*.
8582 This directory predates autoconf and is no longer needed nowadays.
8583 Move its few remaining bits of functionality to where they're needed.
8584 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8585 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8586 * m/template.h: Remove.
8587 * Makefile.in (M_FILE): Remove. All uses removed.
8588 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8589 * lisp.h (USE_LSB_TAG):
8590 * mem-limits.h (EXCEEDS_LISP_PTR):
8591 Use VAL_MAX, not VALBITS, in #if.
8592 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8593 (EMACS_UINT): Define unconditionally now.
8594 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8595 (BITS_PER_EMACS_INT): New constants, replacing
8596 what used to be in config.h, but not useful in #if.
8597 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8598 define them any more.
8599 (VAL_MAX): New macro.
8600 (VALMASK): Use it.
8601 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8602 BITS_PER_EMACS_INT, in #if.
8603 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8604 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8605 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8606 * s/ms-w32.h (DATA_START):
8607 Move here from removed file m/intel386.h.
8608 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8609 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8610
261cb4bb
PE
86112012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8612
8613 Assume C89 or later.
8614 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8615 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8616 (xrealloc):
8617 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8618 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8619 * textprop.c, tparam.c (NULL): Remove.
8620 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8621 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8622 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8623 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8624 * xterm.c (input_signal_count): Assume volatile works.
8625
ff23cd9f
KB
86262012-05-21 Ken Brown <kbrown@cornell.edu>
8627
8628 * xgselect.c (xg_select): Fix first argument in call to 'select'
8629 (bug#11508).
8630
1b170bc6
KB
86312012-05-20 Ken Brown <kbrown@cornell.edu>
8632
8633 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 8634 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 8635
b2f4d39f
KB
86362012-05-19 Ken Brown <kbrown@cornell.edu>
8637
8638 * xfns.c (x_in_use): Remove `static' qualifier.
8639 * xterm.h (x_in_use): Declare.
8640 * xgselect.c: Include xterm.h.
8641 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8642 and `display_arg' (bug#9754).
8643
003fdae2
PE
86442012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8645
9232a6d9
PE
8646 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8647
003fdae2
PE
8648 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8649 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8650
784b56e2
EZ
86512012-05-18 Eli Zaretskii <eliz@gnu.org>
8652
8653 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8654
8655 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 8656 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
8657
8658 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8659 reference to image_cache->refcount.
8660 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8661
a0a79cde
JL
86622012-05-17 Juri Linkov <juri@jurta.org>
8663
8664 * search.c (Fword_search_regexp, Fword_search_backward)
8665 (Fword_search_forward, Fword_search_backward_lax)
8666 (Fword_search_forward_lax): Move functions to isearch.el
8667 (bug#10145, bug#11381).
8668
b0572523
PE
86692012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8670
8671 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8672
9660f5fc
SM
86732012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8674
8675 * lread.c (init_obarray): Declare Qt and Qnil as special.
8676
4374de83
GM
86772012-05-14 Glenn Morris <rgm@gnu.org>
8678
8679 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 8680 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 8681
dc44c39a
PE
86822012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8683
078c97cb
PE
8684 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8685
dc44c39a
PE
8686 * unexaix.c: Port to more-recent AIX compilers.
8687 (report_error, report_error_1, make_hdr, copy_sym)
8688 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8689 Make arguments const char *, not char *, to avoid violations of C
8690 standard and to fix some AIX warnings reported by Gilles Pion.
8691
e18afed7 86922012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
8693
8694 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8695 already have overlays loaded.
8696 (handle_single_display_spec): Before returning without displaying
8697 fringe bitmap, synchronize the bidi iterator with the main display
8698 iterator, by calling iterate_out_of_display_property.
8699 (iterate_out_of_display_property): Detect buffer iteration by
8700 testing that it->string is a Lisp string.
8701 (get_next_display_element): When the current object is exhausted,
8702 and there's something on it->stack, call set_iterator_to_next to
8703 proceed with what's on the stack, instead of returning zero.
8704 (set_iterator_to_next): If called at the end of a Lisp string,
8705 proceed to consider_string_end without incrementing string
8706 position. Don't increment display vector index past the end of
8707 the display vector. (Bug#11417)
c8fb9dc6
EZ
8708 (pos_visible_p): Don't report a position visible when move_it_to
8709 stopped at the last line of window, which happens to be scanned
8710 backwards by the bidi iteration. (Bug#11464)
ac268e67 8711
e18afed7 87122012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
8713
8714 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8715 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
8716 are on a TTY, and thus unable to display on the fringes.
8717 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
8718 so we need to signal to the caller that this is a "replacing"
8719 display spec. This fixes display when the spec is invalid or we
8720 are on a TTY.
8721
e18afed7 87222012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
8723
8724 * unexaix.c (make_hdr): Fix typo in prototype.
8725 This bug broke the build on AIX. Problem reported by Gilles Pion.
8726
9d0a235a
MA
87272012-05-14 Michael Albinus <michael.albinus@gmx.de>
8728
8729 * keyboard.c (kbd_buffer_get_event): Read special events also in
8730 batch mode. (Bug#11415)
8731
9e6b06ed
GM
87322012-05-12 Glenn Morris <rgm@gnu.org>
8733
8734 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8735
c1a1d7a3
EZ
87362012-05-12 Eli Zaretskii <eliz@gnu.org>
8737
8738 * lisp.mk (lisp): Add newcomment.elc.
8739
3fe7cdc8
GM
87402012-05-12 Glenn Morris <rgm@gnu.org>
8741
8742 * Makefile.in (MKDIR_P): New, set by configure.
8743 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8744
53f7d2c0
PE
87452012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8746
8747 Remove unused function hourglass_started.
8748 * dispextern.h (hourglass_started):
8749 * w32fns.c (hourglass_started):
8750 * xdisp.c (hourglass_started): Remove.
8751
75aafb17
JB
87522012-05-10 Juanma Barranquero <lekktu@gmail.com>
8753
8754 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8755 Update dependencies.
8756
12959e8e
PE
87572012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8758
97107e2e
PE
8759 * xgselect.c (xg_select): Put maxfds+1 into a var.
8760 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8761
12959e8e
PE
8762 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8763
836d29b3
DA
87642012-05-10 Dave Abrahams <dave@boostpro.com>
8765
8766 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8767 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8768
5cb67954
MA
87692012-05-09 Michael Albinus <michael.albinus@gmx.de>
8770
8771 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8772 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8773 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8774 Initialize xd_registered_buses.
8775
3478ec45
PE
87762012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8777
b263a6b0
PE
8778 Untag more efficiently if USE_LSB_TAG.
8779 This is based on a proposal by YAMAMOTO Mitsuharu in
8780 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8781 For an admittedly artificial (nth 8000 longlist) benchmark on
8782 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8783 Emacs's overall text size by 1%.
8784 * lisp.h (XUNTAG): New macro.
8785 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8786 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8787 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8788 * eval.c (Fautoload):
8789 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8790 * frame.h (XFRAME): Use XUNTAG.
8791
3478ec45
PE
8792 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8793 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8794 Remove unportable assumptions about print widths of types like
8795 dbus_uint32_t.
8796 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8797 intptr_t when converting between pointer and integer, to avoid GCC
8798 warnings about wrong width.
8799
666b903b 88002012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
8801
8802 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8803 stack for each reader_thread, instead of defaulting to 8MB
8804 determined by the linker. This avoids failures in creating
8805 subprocesses on Windows 7, see the discussion in this thread:
8806 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8807
b120cc17
JC
88082012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8809
8810 Fix up display of the *Minibuf-0* buffer in the mini window.
8811 * keyboard.c (read_char): Don't clear the echo area if there's no
8812 message to clear.
8813 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 8814 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 8815
9a4b36f8
MA
88162012-05-07 Michael Albinus <michael.albinus@gmx.de>
8817
8818 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8819 batch mode.
8820
e5f9458f
CY
88212012-05-06 Chong Yidong <cyd@gnu.org>
8822
8823 * lisp.mk (lisp): Update.
8824
eceeb5fc 88252012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
8826
8827 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8828
71873e2b
SM
88292012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8830
8831 * data.c (PUT_ERROR): New macro.
8832 (syms_of_data): Use it. Add new error type `user-error'.
8833 * undo.c (user_error): New function.
8834 (Fprimitive_undo): Use it.
8835 * print.c (print_error_message): Adjust print style for `user-error'.
8836 * keyboard.c (user_error): New function.
8837 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8838
ab0fa4e4
PE
88392012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8840
8841 Do not limit current-time-string to years 1000..9999.
8842 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8843 (Fcurrent_time_string): Support any year that is supported by the
8844 underlying localtime representation. Don't use asctime, as it
8845 has undefined behavior for years outside the range -999..9999.
8846
7ed806a7
PE
88472012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8848
8849 Fix race conditions involving setenv, gmtime, localtime, asctime.
8850 Without this fix, interrupts could mess up code that uses these
8851 nonreentrant functions, since setting TZ invalidates existing
8852 tm_zone or tzname values, and since most of these functions return
8853 pointers to static storage.
8854 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8855 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8856 Grow the critical sections to include not just invoking
8857 localtime/gmtime, but also accessing these functions' results
8858 including their tm_zone values if any, and any related TZ setting.
8859 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
8860 so that the struct tm is saved in the critical section.
8861 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
8862 motivated by the fact that memory allocation needs to be outside
8863 the critical section.
8864
0c16dfed
DA
88652012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8866
8867 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8868 with RESET_INTERVAL.
8869
8870 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8871 Remove duplicated buffer name initialization.
8872
3f83ace8
JM
88732012-05-02 Jim Meyering <jim@meyering.net>
8874
8875 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8876
c7b8541e
JM
8877 * xfns.c (x_window): Use xstrdup (Bug#11375).
8878
90207a15 88792012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
8880
8881 * xdisp.c (pos_visible_p): If already at a newline from the
8882 display string before the 'while' loop, don't walk back the glyphs
8883 from it3.glyph_row. Solves assertion violation when the display
8884 string begins with a newline (egg.el). (Bug#11367)
8885
b593d6a9
AH
88862012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8887
8888 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8889 Move to simple.el.
8890
4737362e
GM
88912012-05-01 Glenn Morris <rgm@gnu.org>
8892
99cf43f9
GM
8893 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8894 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8895 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8896 All were removed before 23.1.
8897
9311dcff
GM
8898 * dispnew.c: Remove HAVE_LIBNCURSES test;
8899 it is always true on relevant platforms.
8900
4d5c6349
GM
8901 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8902 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8903
4737362e
GM
8904 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8905
74dd3a6b
AS
89062012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8907
8908 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8909 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8910 Remove.
8911
13c379ee
PE
89122012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8913
8914 Do not avoid creating empty evaporating overlays (Bug#9642).
8915 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8916 That is, do not delete an evaporating overlay if it becomes
8917 empty after its bounds are adjusted to fit within its buffer.
8918 This fix caused other problems, and I'm reverting it until we get
8919 to the bottom of them.
8920
a8e7d6d7 89212012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
8922
8923 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8924
a8e7d6d7 89252012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
8926
8927 * xdisp.c (pos_visible_p): If the window start position is beyond
8928 ZV, start the display from buffer beginning. Prevents assertion
8929 violation in init_iterator when the minibuffer window is scrolled
8930 via the scroll bar.
8931
8932 * window.c (window_scroll_pixel_based): Likewise.
8933
a8e7d6d7 89342012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
8935
8936 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8937
a8e7d6d7 89382012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
8939
8940 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8941 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8942
a8e7d6d7 89432012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 8944
b593d6a9
AH
8945 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8946 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 8947
1c6900d9
EZ
89482012-04-26 Eli Zaretskii <eliz@gnu.org>
8949
4c3fa1d9
EZ
8950 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8951 display element, check also the underlying string or buffer
8952 character. (Bug#11341)
8953
1c6900d9
EZ
8954 * w32menu.c: Include w32heap.h.
8955 (add_menu_item): If the call to AppendMenuW (via
8956 unicode_append_menu) fails, disable Unicode menus only if we are
8957 running on Windows 9X/Me.
8958
42bf8205
AS
89592012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8960
8961 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8962 (xgetint): Add missing shift for LSB tags.
8963
b1bac16e
MR
89642012-04-24 Martin Rudalics <rudalics@gmx.at>
8965
8966 * keyboard.c (read_char): Don't wipe echo area for select window
8967 events: These might get delayed via `mouse-autoselect-window'
8968 (Bug#11304).
8969
d69621cc
JB
89702012-04-24 Juanma Barranquero <lekktu@gmail.com>
8971
8972 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8973 manipulation of :loaded-from data.
8974
02fd101b
JB
89752012-04-23 Juanma Barranquero <lekktu@gmail.com>
8976
8977 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8978 now a cons (bug#11311).
8979
888bec30
PE
89802012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8981
89a438bd
PE
8982 Do not create empty overlays with the evaporate property (Bug#9642).
8983 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8984 if it becomes empty after its bounds are adjusted to fit within
8985 its buffer. Without this fix, in a nonempty buffer (let ((o
8986 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8987 yields an empty overlay that has the evaporate property, which is
8988 not supposed to happen.
8989
1068fe4d
PE
8990 Fix minor GTK3 problems found by static checking.
8991 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8992 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8993 (struct _EmacsFixedClass, emacs_fixed_get_type):
8994 Move decls here from emacsgtkfixed.h, since they needn't be public.
8995 (emacs_fixed_get_type): Now static.
8996 (emacs_fixed_class_init): Omit unused local.
8997 (emacs_fixed_child_type): Remove; unused.
8998 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8999 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9000 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9001 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9002 (EMACS_FIXED_GET_CLASS): Remove; unused.
9003 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9004
888bec30
PE
9005 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9006 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9007
de85e130
PE
90082012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9009
d0baac98 9010 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 9011 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
9012 (__malloc_size_t, __malloc_ptrdiff_t):
9013 Remove. All uses removed, replaced by the definiens if needed,
9014 since we can assume C89 or better now.
9015 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9016 (protect_malloc_state, align, get_contiguous_space)
9017 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9018 (malloc_atfork_handler_child, malloc_enable_thread)
9019 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9020 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9021 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9022 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9023 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9024 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9025 Define using prototypes, not old style.
9026 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9027 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9028 (align): Don't assume that signed integer overflow wraps around.
9029 Omit unused local var.
9030 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9031 (_free_internal_nolock, memalign, mallochook, reallochook):
9032 Omit no-longer-needed casts.
9033 (valloc): Use getpagesize, not __getpagesize.
9034 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9035 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9036
de85e130
PE
9037 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9038
dcbf5805
MA
90392012-04-22 Michael Albinus <michael.albinus@gmx.de>
9040
9041 Move functions from C to Lisp. Make non-blocking method calls
9042 the default. Implement further D-Bus standard interfaces.
9043
9044 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9045 (QCdbus_request_name_allow_replacement)
9046 (QCdbus_request_name_replace_existing)
9047 (QCdbus_request_name_do_not_queue)
9048 (QCdbus_request_name_reply_primary_owner)
9049 (QCdbus_request_name_reply_in_queue)
9050 (QCdbus_request_name_reply_exists)
9051 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9052 (QCdbus_registered_serial, QCdbus_registered_method)
9053 (QCdbus_registered_signal): New Lisp objects.
9054 (XD_DEBUG_MESSAGE): Use sizeof.
9055 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9056 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9057 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9058 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9059 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9060 (xd_signature, xd_append_arg): Allow float for integer types.
9061 (xd_get_connection_references): New function.
b593d6a9
AH
9062 (xd_get_connection_address): Rename from xd_initialize.
9063 Return cached address.
dcbf5805
MA
9064 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9065 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9066 level.
9067 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 9068 Return number of refcounts.
dcbf5805
MA
9069 (Fdbus_get_unique_name): Make stronger parameter check.
9070 (Fdbus_message_internal): New defun.
9071 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9072 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9073 (Fdbus_send_signal, Fdbus_register_service)
9074 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9075 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9076 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9077 (Vdbus_compiled_version, Vdbus_runtime_version)
9078 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9079 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9080 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
9081 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9082 Adapt docstring.
dcbf5805 9083
52828e02
PE
90842012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9085
da05bc4c
PE
9086 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9087 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9088 Do not assume ptrdiff_t is the same width as 'int'.
9089
52828e02
PE
9090 * alloc.c: Handle unusual debugging option combinations.
9091 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9092 since the two debugging options are incompatible.
9093 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9094 is defined.
9095 (mem_init, mem_insert, mem_insert_fixup):
9096 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9097 (NEED_MEM_INSERT): Remove; no longer needed.
9098
f01769f9
LL
90992012-04-22 Leo Liu <sdl.web@gmail.com>
9100
9101 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9102
5790543d
PE
91032012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9104
9105 * sysdep.c [__FreeBSD__]: Minor cleanups.
9106 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9107 Use Emacs indenting style more consistently. Avoid some casts.
9108 Use 'double' consistently rather than mixing 'float' and 'double'.
9109
b91b7e4d
EW
91102012-04-21 Eduard Wiebe <usenet@pusto.de>
9111
b593d6a9
AH
9112 * sysdep.c (list_system_processes, system_process_attributes):
9113 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 9114
6114eb15
AS
91152012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9116
9117 * lisp.mk (lisp): Update.
9118
2f38dff7
PE
91192012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9120
9121 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9122 It is never used otherwise.
9123
4ae29f89
SM
91242012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9125
9126 * print.c (print_preprocess): Only check print_depth if print-circle
9127 is nil.
9128 (print_object): Check for cycles even when print-circle is nil and
9129 print-gensym is t, but only check print_depth if print-circle is nil.
9130
f30d612a
CY
91312012-04-20 Chong Yidong <cyd@gnu.org>
9132
9133 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9134 set the status to "failed" and ensure that sentinel is run.
9135
c07a4c0b 91362012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
9137
9138 * process.c (Fset_process_inherit_coding_system_flag)
9139 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 9140 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 9141
c07a4c0b 91422012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
9143
9144 * xdisp.c (string_buffer_position_lim): Limit starting position to
9145 BEGV.
9146 (set_cursor_from_row): If called for a mode-line or header-line
9147 row, return zero immediately.
9148 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
9149 farther than the first row after the header line, if any.
9150 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
9151 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9152
c07a4c0b 91532012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9154
4ae29f89
SM
9155 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9156 (bug#11238).
ad3a2b41 9157
c07a4c0b 91582012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 91592012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
9160
9161 configure: new option --enable-gcc-warnings (Bug#11207)
9162 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9163 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9164 (ALL_CFLAGS): Use new macros rather than old.
9165 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9166 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9167 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9168 -Wunused-result, -Wunused-variable. This should go away once
9169 the Emacs and Gnulib regex code is merged.
9170 (xmalloc, xrealloc): Now static.
9171
aba027e8
PE
91722012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9173
9174 * dired.c (Fsystem_groups): Remove unused local.
9175
e5a36063
GM
91762012-04-17 Glenn Morris <rgm@gnu.org>
9177
9178 * dired.c (Fsystem_users): Doc fix.
9179
316411f0
DA
91802012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9181
9182 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9183 (syms_of_dired): Add them.
9184
9426aba4
PE
91852012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9186
b62a57be
PE
9187 Fix minor alloc.c problems found by static checking.
9188 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9189 New extern decls, to avoid calling undeclared functions.
9190 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9191 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9192 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9193 (NEED_MEM_INSERT): New macro.
9194 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 9195 Remove one incorrect comment and fix another.
b62a57be 9196
3539f31f
PE
9197 Fix minor ralloc.c problems found by static checking.
9198 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9199 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9200 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9201 (r_alloc_sbrk): Now static.
9202
a041960a
PE
9203 Improve ralloc.c interface checking.
9204 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9205 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9206 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9207 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9208 [REL_ALLOC]: ... to here, to check interface.
9209 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9210 Remove decls. This fixes an "It stinks!".
9211
9426aba4
PE
9212 * alloc.c (which_symbols): Fix alignment issue / type clash.
9213
d55c12ed
AS
92142012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9215
9216 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9217 (struct Lisp_Misc_Any): Likewise.
9218 (struct Lisp_Free): Likewise.
9219 * alloc.c (union aligned_Lisp_Symbol): Define.
9220 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9221 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9222 (union aligned_Lisp_Misc): Define.
9223 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9224 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 9225 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 9226
b948ce8b
PE
92272012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9228
9229 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9230 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9231 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9232 * s/netbsd.h, s/sol2-6.h:
9233 Remove definition of GC_MARK_STACK, since the default now works.
9234 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9235 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9236 no longer the default.
9237 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9238
35dc09a1 92392012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9240
35dc09a1
GM
9241 * lread.c (lisp_file_lexically_bound_p):
9242 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 9243
35dc09a1
GM
92442012-04-14 Eli Zaretskii <eliz@gnu.org>
9245
9246 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9247 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9248
92492012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9250
9251 * nsterm.m (constrainFrameRect): Always constrain when there is only
9252 one screen (Bug#10962).
9253
bcd86815
KB
92542012-04-13 Ken Brown <kbrown@cornell.edu>
9255
9256 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9257
c25df26e
RT
92582012-04-13 Reuben Thomas <rrt@sc3d.org>
9259
9260 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9261
0fc59f1e
DC
92622012-04-11 Daniel Colascione <dancol@dancol.org>
9263
9264 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9265 against is gone. It's better to use vfork now so that when Cygwin
9266 gains a new, working vfork, we use it automatically (bug#10398).
9267
de8c03dc
SM
92682012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9269
9270 * window.c (save_window_save): Obey window-point-insertion-type.
9271
2f097256
GM
92722012-04-11 Glenn Morris <rgm@gnu.org>
9273
9274 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9275
453b951e
SM
92762012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9277
9278 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9279
75f1671a 92802012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
9281
9282 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9283 (force_quit_count): New var.
9284 (handle_interrupt): Use it.
9285
2a8ce227
JB
92862012-04-10 Juanma Barranquero <lekktu@gmail.com>
9287
9288 * w32.c (w32_delayed_load): Record the full path of the library
9289 being loaded (bug#10424).
9290
935396c0
GM
92912012-04-09 Glenn Morris <rgm@gnu.org>
9292
05920a43
GM
9293 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9294 not just in the obarray, before snarfing them. (Bug#11036)
9295
935396c0
GM
9296 * Makefile.in ($(leimdir)/leim-list.el):
9297 Pass EMACS rather than BUILT_EMACS.
9298
a18ecafa
TZ
92992012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9300
9301 * process.c (make_process):
9302 * process.h: Add integer `gnutls_handshakes_tried' member to
9303 process struct.
9304
6bbef4e5
JC
9305 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9306 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
9307
9308 * gnutls.c (gnutls_log_function2i): Convenience log function.
9309 (emacs_gnutls_read): Use new log functions,
9310 `gnutls_handshakes_tried' process member, and
9311 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9312 attempts per process (connection).
9313
b4d3bc10
CY
93142012-04-09 Chong Yidong <cyd@gnu.org>
9315
9316 * eval.c (Fuser_variable_p, user_variable_p_eh)
9317 (lisp_indirect_variable): Functions deleted.
9318 (Fdefvar): Caller changed.
9319
9320 * callint.c (Finteractive, Fcall_interactively):
9321 * minibuf.c (Fread_variable): Callers changed.
9322
70f4d973
EZ
93232012-04-09 Eli Zaretskii <eliz@gnu.org>
9324
9325 * xdisp.c (set_cursor_from_row): If the display string appears in
9326 the buffer at position that is closer to point than the position
9327 after the display string, display the cursor on the first glyph of
9328 the display string. Fixes cursor display when a 'display' text
9329 property immediately follows invisible text. (Bug#11094)
9330
cb3c2e3e
PE
93312012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9332
9333 composite.c: use 'double' consistently
9334 * composite.c (get_composition_id): Use 'double' consistently
9335 instead of converting 'float' to 'double' and vice versa; this is
9336 easier to understand and avoids a GCC warning.
9337
fd06db5d
GM
93382012-04-09 Glenn Morris <rgm@gnu.org>
9339
50fe702a
GM
9340 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9341 preparation for dumping it with emacs. (Bug#4789)
9342 (leimdir): New variable.
9343 ($(leimdir)/leim-list.el): New rule.
9344 (emacs$(EXEEXT)): Depend on leim-list.el.
9345
fd06db5d
GM
9346 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9347 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9348 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9349
55c131ee
AS
93502012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9351
9352 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9353 proper alignment.
9354
9209588f
JB
93552012-04-07 Juanma Barranquero <lekktu@gmail.com>
9356
9357 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9358 Remove unused local variable.
9359
e3fb2efb
PE
93602012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9361
9362 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9363 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9364 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9365 objects, as mark_maybe_pointer will catch them otherwise.
9366 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9367 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9368
b5385551
PE
93692012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9370
9371 Fix typo that broke non-Windows builds.
9372 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9373
9078ead6
EZ
93742012-04-07 Eli Zaretskii <eliz@gnu.org>
9375
9376 Support building on MS-Windows with libxml2.
9377
9378 * makefile.w32-in (OBJ2): Add xml.$(O).
9379 (GLOBAL_SOURCES): Add xml.c.
9380 ($(BLD)/xml.$(O)): New dependency list.
9381
9382 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9383 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9384 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9385 [!WINDOWSNT]: New macros.
9386 (init_libxml2_functions, libxml2_loaded_p): New functions.
9387 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9388 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9389 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9390 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9391 linked in).
6bbef4e5
JC
9392 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9393 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
9394 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9395
9396 * emacs.c: Don't include libxml/parser.h.
9397 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9398 xmlCleanupParser directly.
9399
9400 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9401
3811fdf3
EZ
94022012-04-07 Eli Zaretskii <eliz@gnu.org>
9403
9404 * indent.c (Fvertical_motion): If there is a display string at
9405 point, use it.vpos to compute how many lines to backtrack after
9406 move_it_to point. (Bug#11133)
9407
2f8e16b2
EZ
94082012-04-06 Eli Zaretskii <eliz@gnu.org>
9409
9410 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9411 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9412 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9413 macros related to unification of CJK characters. For the details,
9414 see the discussion following the message here:
9415 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9416
3d439cd1
CY
94172012-04-04 Chong Yidong <cyd@gnu.org>
9418
9419 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9420
8bc53d00
EZ
94212012-04-01 Eli Zaretskii <eliz@gnu.org>
9422
9423 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9424 instead of alloca. (Bug#11138)
9425
3b0512a3
AS
94262012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9427
9428 * w32menu.c (is_simple_dialog): Properly check lisp types.
9429 (Bug#11141)
9430
8427ddd2
EZ
94312012-03-31 Eli Zaretskii <eliz@gnu.org>
9432
979022ef
EZ
9433 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9434 position we get to after a call to move_it_to fails the
9435 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9436 only if we wind up in a string from display property. (Bug#11063)
9437
a6b1c7cc
EZ
9438 * window.c (Fdelete_other_windows_internal): Invalidate the row
9439 and column information about mouse highlight, so that redisplay
9440 restores it after reallocating the glyph matrices. (Bug#7464)
9441
8427ddd2
EZ
9442 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9443 string comes from a `display' text property, use the buffer
9444 position of that property as if we actually saw that position in
9445 the row's glyphs.
697ba24b
EZ
9446 (move_it_by_lines): Remove the assertion that
9447 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9448 violated when there's a before-string at the beginning of a line.
9449 (Bug#11063)
8427ddd2 9450
65a0a738
EZ
94512012-03-30 Eli Zaretskii <eliz@gnu.org>
9452
9453 * xdisp.c (append_space_for_newline): If the default face was
9454 remapped, use the remapped face for the appended newline.
9455 (extend_face_to_end_of_line): Use the remapped default face for
9456 extending the face to the end of the line.
9457 (display_line): Call extend_face_to_end_of_line when the default
9458 face was remapped. (Bug#11068)
9459
581355cc
EZ
94602012-03-29 Eli Zaretskii <eliz@gnu.org>
9461
9462 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9463
e8fc049f
SM
94642012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9465
9466 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9467
4fb9a543
GM
94682012-03-27 Glenn Morris <rgm@gnu.org>
9469
9470 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9471 Doc fixes.
9472
679910f1
KH
94732012-03-26 Kenichi Handa <handa@m17n.org>
9474
9475 * dispextern.h (struct glyph): Fix previous change. Change the
9476 bit length of glyphless.ch to 25 (Bug#11082).
9477
90d49b7f
CY
94782012-03-26 Chong Yidong <cyd@gnu.org>
9479
9480 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9481 (command_loop_1): Use it; inhibit selection update for
9482 handle-select-window too (Bug#8996).
9483
f514f6f0
FP
94842012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9485
e8fc049f 9486 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 9487
bf43fa51
KH
94882012-03-25 Kenichi Handa <handa@m17n.org>
9489
9490 * dispextern.h (struct glyph): Change the bit length of
9491 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9492
8a0c01dd
EZ
94932012-03-24 Eli Zaretskii <eliz@gnu.org>
9494
9495 * s/ms-w32.h (tzname): Include time.h before redirecting to
9496 _tzname. Fixes the MSVC build. (Bug#9960)
9497
7d1c3a76
AS
94982012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9499
8ed79523
AS
9500 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9501 characters.
9502
7d1c3a76
AS
9503 * xterm.c (XTread_socket): Only modify handling_signal if
9504 !SYNC_INPUT. (Bug#11080)
9505
e99a9b8b
EZ
95062012-03-23 Eli Zaretskii <eliz@gnu.org>
9507
9508 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9509 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9510 when fetching a multibyte character consumes more bytes than
9511 CHAR_BYTES returns, due to unification of CJK characters in
9512 string_char. (Bug#11073)
9513
5063c0e1
TN
95142012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9515
9516 * process.c (wait_reading_process_output): Handle pty disconnect
9517 by refraining from sending oneself a SIGCHLD (bug#10933).
9518
9f851fbd
CY
95192012-03-22 Chong Yidong <cyd@gnu.org>
9520
9521 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9522
5063c0e1 9523 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
9524 Mark string as coming from a prefix property.
9525 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9526 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9527
fb5b8aca
CY
95282012-03-21 Chong Yidong <cyd@gnu.org>
9529
9530 * xfaces.c (Vface_remapping_alist): Doc fix.
9531
62356a1b
EZ
95322012-03-20 Eli Zaretskii <eliz@gnu.org>
9533
9534 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
9535 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9536 Doc fixes.
62356a1b 9537
025de85b
CY
95382012-03-20 Chong Yidong <cyd@gnu.org>
9539
9540 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9541 to reflect default non-nil value of redisplay-dont-pause.
9542
4827f94e
KH
95432012-03-19 Kenichi Handa <handa@m17n.org>
9544
9545 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9546 it fit in a valid range (Bug#11003).
9547
e50a24a2
EZ
95482012-03-18 Eli Zaretskii <eliz@gnu.org>
9549
9550 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9551 that is not from display property, accept the row as a "cursor
9552 row" if one of the string's character has a non-nil `cursor'
9553 property. Fixes cursor positioning when there are newlines in
9554 overlay strings, e.g. in icomplete.el. (Bug#11035)
9555
9af5ed87
PE
95562012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9557
9558 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9559
d1f55f16
CY
95602012-03-12 Chong Yidong <cyd@gnu.org>
9561
9562 * eval.c (inhibit_lisp_code): Rename from
9563 inhibit_window_configuration_change_hook; move from window.c.
9564
9565 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9566 * window.c (run_window_configuration_change_hook)
9567 (syms_of_window): Callers changed.
9568
66c5eebd
CY
95692012-03-11 Chong Yidong <cyd@gnu.org>
9570
413df973
CY
9571 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9572
66c5eebd
CY
9573 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9574
1de11f56
CY
95752012-03-10 Chong Yidong <cyd@gnu.org>
9576
9577 * frame.c (other_visible_frames): Don't assume the selected frame
9578 is visible (Bug#10955).
9579
cae07000
SM
95802012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9581
9582 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9583
89c94350
JD
95842012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9585
9586 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9587 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9588 zero (Bug#10954).
9589
999dd333
GM
95902012-03-03 Glenn Morris <rgm@gnu.org>
9591
01a6dcc8 9592 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 9593
de0100f2
EZ
95942012-03-02 Eli Zaretskii <eliz@gnu.org>
9595
9596 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9597 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
9598 (redisplay_window, next_element_from_string): Fix typos in
9599 comments.
3e441275
EZ
9600 (redisplay_window): Pass to move_it_vertically the margin in
9601 pixels, not in screen lines.
de0100f2 9602
96a72ee9
GM
96032012-03-02 Glenn Morris <rgm@gnu.org>
9604
9605 * buffer.c (buffer-list-update-hook): Doc fix.
9606
312508d7
EZ
96072012-02-29 Eli Zaretskii <eliz@gnu.org>
9608
9609 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9610 push_it before setting up the iterator for the first overlay
9611 string, even if we have an empty string loaded.
9612 (next_overlay_string): If there's an empty string on the iterator
9613 stack, pop the stack. (Bug#10903)
9614
27f3c637
PE
96152012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9616
9617 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9618 Suggested by Stefan Monnier in
9619 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9620 * alloc.c (widen_to_Lisp_Object): New static function.
9621 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9622 and widening them to Lisp_Objects. This would work even if
9623 USE_LSB_TAG is defined and wide integers are used, which might
9624 happen in a future version of Emacs.
9625
3c9dfce6
CY
96262012-02-25 Chong Yidong <cyd@gnu.org>
9627
fa74b241
CY
9628 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9629 Doc fix.
9630
3c9dfce6
CY
9631 * xselect.c (Fx_selection_exists_p): Doc fix.
9632 (x_clipboard_manager_save_all): Print an informative message
9633 before saving to clipboard manager.
9634
9486df08
CY
96352012-02-24 Chong Yidong <cyd@gnu.org>
9636
9637 * keyboard.c (process_special_events): Handle all X selection
9638 requests in kbd_buffer, not just the next one (Bug#8869).
9639
f01d3321
CY
96402012-02-23 Chong Yidong <cyd@gnu.org>
9641
9642 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9643 call when setting menu-bar-lines and tool-bar-lines parameters.
9644 (unwind_create_frame_1): New helper function.
9645
9646 * window.c (inhibit_window_configuration_change_hook): New var.
9647 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 9648 (syms_of_window): Initialize it.
f01d3321 9649
86b847b6
CY
96502012-02-22 Chong Yidong <cyd@gnu.org>
9651
9652 * xterm.c (x_draw_image_relief): Add missing type check for
9653 Vtool_bar_button_margin (Bug#10743).
9654
a59225b1
CY
96552012-02-21 Chong Yidong <cyd@gnu.org>
9656
9657 * fileio.c (Vfile_name_handler_alist): Doc fix.
9658
9659 * buffer.c (Fget_file_buffer): Protect against invalid file
9660 handler return value.
9661
310f5bd4
PE
96622012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9663
cb3a28cc
PE
9664 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9665 when computing $valmask.
9666
310f5bd4
PE
9667 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9668 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9669 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9670 It's useless in that case, and it can cause problems on hosts
9671 that allocate halves of EMACS_INT values separately.
9672 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9673 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9674 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9675 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9676 it avoids undefined behavior on hosts where shifting right by more
9677 than the word width has undefined behavior.
9678
2375c96a
CY
96792012-02-19 Chong Yidong <cyd@gnu.org>
9680
9681 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9682 (Funhandled_file_name_directory, Ffile_name_as_directory)
9683 (Fdirectory_file_name, Fexpand_file_name)
9684 (Fsubstitute_in_file_name): Protect against invalid file handler
9685 return values (Bug#10845).
9686
3eb49e71
EZ
96872012-02-18 Eli Zaretskii <eliz@gnu.org>
9688
9689 * .gdbinit (pitx): Fix incorrect references to fields of the
9690 iterator stack.
9691
7b926f3f
CY
96922012-02-17 Chong Yidong <cyd@gnu.org>
9693
9694 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9695
11273115
PE
96962012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9697
9698 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9699 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9700
c3a70e2b
CY
97012012-02-15 Chong Yidong <cyd@gnu.org>
9702
9703 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9704 marked as special. Also, starting docstrings with * is obsolete.
9705
0ca43699
AS
97062012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9707
9708 * gnutls.c (emacs_gnutls_write): Fix last change.
9709
2e8f3c56
LI
97102012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9711
9712 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9713 send_process.
9714
af70074f
SM
97152012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9716
9717 * keymap.c (Fsingle_key_description): Handle char ranges.
9718
95986d52
CY
97192012-02-12 Chong Yidong <cyd@gnu.org>
9720
afd83bd1
CY
9721 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9722 as that creates a dangerous corner case.
9723
95986d52
CY
9724 * window.c (Fdelete_window_internal): Invalidate the mouse
9725 highlight (Bug#9904).
9726
bd7da63e
GM
97272012-02-12 Glenn Morris <rgm@gnu.org>
9728
9729 * xselect.c (Fx_own_selection_internal)
9730 (Fx_get_selection_internal, Fx_disown_selection_internal)
9731 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9732 * nsselect.m (Fx_own_selection_internal)
9733 (Fx_disown_selection_internal, Fx_selection_exists_p)
9734 (Fx_selection_owner_p, Fx_get_selection_internal):
9735 Sync docs and argument specs with the xselect.c versions.
9736
77abcbc2
LI
97372012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9738
9739 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9740
90b671e2
EZ
97412012-02-11 Eli Zaretskii <eliz@gnu.org>
9742
1c0ca0b7
EZ
9743 * w32select.c (Fx_selection_exists_p): Sync doc string and
9744 argument list with xselect.c. (Bug#10783)
9745
9746 * w16select.c (Fx_selection_exists_p): Sync doc string and
9747 argument list with xselect.c. (Bug#10783)
90b671e2 9748
49241268
GM
97492012-02-10 Glenn Morris <rgm@gnu.org>
9750
9751 * fns.c (Fsecure_hash): Doc fix.
9752
f998bbe7 97532012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
9754
9755 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9756
0992bd9c
CY
97572012-02-07 Chong Yidong <cyd@gnu.org>
9758
9759 * buffer.c (Fbuffer_local_variables)
9760 (buffer_lisp_local_variables): Handle unbound vars correctly;
9761 don't let Qunbound leak into Lisp.
9762
af008560
GM
97632012-02-07 Glenn Morris <rgm@gnu.org>
9764
dd605cc4
GM
9765 * image.c (Fimagemagick_types): Doc fix.
9766
af008560
GM
9767 * image.c (imagemagick-render-type): Change it from a lisp object
9768 to an integer. Move the doc here from the lisp manual.
9769 Treat all values not equal to 0 the same.
9770
1449fa1d
CY
97712012-02-06 Chong Yidong <cyd@gnu.org>
9772
9773 * doc.c (store_function_docstring): Avoid applying docstring of
9774 alias to base function (Bug#2603).
9775
3723ec07
AS
97762012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9777
9778 * .gdbinit (pp1, pv1): Remove redundant defines.
9779 (pr): Use pp.
9780
79c1cc1e
CY
97812012-02-04 Chong Yidong <cyd@gnu.org>
9782
9783 * nsterm.m: Declare a global (Bug#10694).
9784
d7f29f8e
EZ
97852012-02-04 Eli Zaretskii <eliz@gnu.org>
9786
cae07000
SM
9787 * w32.c (get_emacs_configuration_options):
9788 Include --enable-checking, if specified, in the return value.
d7f29f8e 9789
3b95a6f9
MR
97902012-02-04 Martin Rudalics <rudalics@gmx.at>
9791
9792 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9793 after rounding frame sizes. (Bug#9723)
9794
d6fa96a6
EZ
97952012-02-04 Eli Zaretskii <eliz@gnu.org>
9796
9797 * keyboard.c (adjust_point_for_property): Don't position point
9798 before BEGV. (Bug#10696)
9799
df0b2940
PE
98002012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9801
9802 Handle overflow when computing char display width (Bug#9496).
9803 * character.c (char_width): Return EMACS_INT, not int.
9804 (char_width, c_string_width): Check for overflow when
9805 computing the width; this is possible now that individual
9806 characters can have unbounded width. Problem introduced
9807 by merge from Emacs 23 on 2012-01-19.
9808
6bee44d6
MA
98092012-02-02 Michael Albinus <michael.albinus@gmx.de>
9810
9811 * dbusbind.c (Fdbus_register_method): Mention the return value
9812 :ignore in the docstring.
9813
44f92739
GM
98142012-02-02 Glenn Morris <rgm@gnu.org>
9815
1b9f60cc
GM
9816 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9817
44f92739
GM
9818 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9819 Unconditionally set to t. (Bug#10673)
9820 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9821 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9822 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9823
c5d3843c
KH
98242012-02-02 Kenichi Handa <handa@m17n.org>
9825
9826 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9827 0, do not call append_composite_glyph.
9828
159462d4 98292012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
9830
9831 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9832 NULL (Bug#6988).
9833 (x_produce_glyphs): If the component of a composition is a null
9834 string, set it->pixel_width to 1 to avoid zero-width glyph.
9835
78cef877
EZ
98362012-02-01 Eli Zaretskii <eliz@gnu.org>
9837
9838 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9839 first 2 arguments are identical. This makes inserting large
9840 output from a subprocess an order of magnitude faster on
9841 MS-Windows, where all sbrk'ed memory is always contiguous.
9842
97897668
GM
98432012-01-31 Glenn Morris <rgm@gnu.org>
9844
9845 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 9846 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
9847 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9848
31fd3586
GM
98492012-01-29 Glenn Morris <rgm@gnu.org>
9850
9851 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9852
0e24a8b2
CY
98532012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9854
9855 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9856
cc0adcb0
CY
98572012-01-28 Chong Yidong <cyd@gnu.org>
9858
9859 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9860
acc28cb9
CY
98612012-01-26 Chong Yidong <cyd@gnu.org>
9862
9c69cfb7
CY
9863 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9864
acc28cb9
CY
9865 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9866 repeat counts (Bug#10507).
9867
48da7392
GM
98682012-01-26 Glenn Morris <rgm@gnu.org>
9869
9870 * lread.c (syms_of_lread): Doc fix.
9871
14af5f7f
CY
98722012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9873
9874 * coding.c (encode_designation_at_bol): Change return value to
9875 EMACS_INT.
9876
0b21c100
CY
98772012-01-25 Chong Yidong <cyd@gnu.org>
9878
9879 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9880
3c2907f7
CY
98812012-01-21 Chong Yidong <cyd@gnu.org>
9882
9883 * floatfns.c (Fcopysign): Make the second argument non-optional,
9884 since nil is not allowed anyway.
9885
959ad23f
AS
98862012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9887
9888 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9889 (send_process): Likewise.
9890
34a02f46
MR
98912012-01-19 Martin Rudalics <rudalics@gmx.at>
9892
9893 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
9894 (Vwindow_persistent_parameters): Do not use Qstate.
9895 Rewrite doc-strings.
34a02f46 9896
1259009a 98972012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
9898
9899 * character.c (char_width): New function.
70d4fdf6
GM
9900 (Fchar_width, c_string_width, lisp_string_width):
9901 Use char_width (Bug#9496).
25ed9e61 9902
6a6ee00d
MR
99032012-01-16 Martin Rudalics <rudalics@gmx.at>
9904
9905 * window.c (Vwindow_persistent_parameters): New variable.
9906 (Fset_window_configuration, save_window_save): Handle persistent
9907 window parameters.
9908
c85efaf7
EZ
99092012-01-14 Eli Zaretskii <eliz@gnu.org>
9910
9911 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9912 thrashing the stack of the thread. (Bug#9087)
9913
5944709e
PE
99142012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9915
9916 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9917
e71f5d99
EZ
99182012-01-11 Eli Zaretskii <eliz@gnu.org>
9919
9920 * xdisp.c (rows_from_pos_range): Handle the case where the
9921 highlight ends on a newline. (Bug#10464)
9922 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9923 he end column for display of highlight that ends on a newline
9924 before a R2L line.
9925
ce316182
GM
99262012-01-11 Glenn Morris <rgm@gnu.org>
9927
9928 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9929 from load-path also when installation-directory is nil. (Bug#10208)
9930
5b43da69
GM
99312012-01-10 Glenn Morris <rgm@gnu.org>
9932
74cc8ff9
GM
9933 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9934
7d8d6e4e
GM
9935 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9936 Update template values to be closer to their typical values these days.
5b43da69 9937
a0db8d43
EZ
99382012-01-09 Eli Zaretskii <eliz@gnu.org>
9939
9940 * xdisp.c (rows_from_pos_range): Accept additional argument
9941 DISP_STRING, and accept any glyph in a row whose object is that
9942 string as eligible for mouse highlight. Fixes mouse highlight of
9943 display strings from overlays. (Bug#10464)
9944
9a0115ab 99452012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 9946
b9110d6a 9947 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
9948 * fileio.c (auto_saving_dir_umask): New static var.
9949 (Fmake_directory_internal): Use it.
9950 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9951 creating the directory. The old code temporarily assigns
9952 too-generous permissions to the directory.
9953 (do_auto_save_eh): Clear it.
b9110d6a 9954 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
9955 that the var is always cleared.
9956
6c1bd3f3
EZ
99572012-01-07 Eli Zaretskii <eliz@gnu.org>
9958
9959 * search.c (scan_buffer): Pass character positions to
9960 know_region_cache, not byte positions. (Bug#6540)
9961
069d2b50
L
99622012-01-07 LynX <_LynX@bk.ru> (tiny change)
9963
9964 * w32.c (sys_rename): Report EXDEV when rename of a directory
9965 fails because the target is on another logical disk. (Bug#10284)
9966
75bf0d33
DB
99672012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9968
9969 * xterm.c (x_embed_request_focus): New function.
9970
9971 * xterm.h: Add prototype.
9972
9973 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9974
1c6e5a32
GM
99752012-01-05 Glenn Morris <rgm@gnu.org>
9976
9977 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9978
651e947e
EZ
99792012-01-01 Eli Zaretskii <eliz@gnu.org>
9980
9981 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9982 Load gnutls_transport_set_lowat only if GnuTLS version is below
9983 2.11.1.
9984 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9985 GnuTLS versions below 2.11.1.
9986
3778cdd8
AL
99872011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9988
9989 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9990 to the doc string advising against its use for altering the way
9991 windows are scrolled.
9992
0e5317f7
KH
99932011-12-28 Kenichi Handa <handa@m17n.org>
9994
9995 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9996 coding-system ASCII compatible only when it does not produce BOM
9997 on encoding (Bug#10383).
9998
93d5ca1f
JD
99992011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10000
10001 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10002 can scroll.
10003 (create_and_show_popup_menu): Always use menu_position_func for
10004 Gtk3 (Bug#10361).
10005
ca22b785
AS
100062011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10007
10008 * callint.c (Fcall_interactively): Don't truncate prompt string.
10009
d048e1e6
EZ
100102011-12-23 Eli Zaretskii <eliz@gnu.org>
10011
10012 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10013 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 10014 resumed from there (after widening). (Bug#10360)
d048e1e6 10015
5ccaba1f
JD
100162011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10017
10018 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10019
204ee57f
JD
100202011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10021
b81d40f0
JB
10022 * nsterm.m (x_free_frame_resources):
10023 Release f->output_data.ns->miniimage.
204ee57f
JD
10024 (ns_index_color): Fix indentation. Do not retain
10025 color_table->colors[i].
10026
10027 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10028 before returning.
10029
10030 * nsfns.m (x_set_background_color): Assign return value from
10031 ns_index_color to face-background instead of NSColor*.
10032 (ns_implicitly_set_icon_type): Fix indentation.
10033 Change assignment in for loop to comparison.
10034
10035 * emacs.c (ns_pool): New variable.
10036 (main): Assign ns_pool.
10037 (Fkill_emacs): Call ns_release_autorelease_pool.
10038
10039 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10040 autorelease fdesc, release fdAttrs and tdict.
10041 (ns_get_covering_families): Release charset.
10042 (ns_findfonts): Release NSFontDescriptor created with new.
10043 (ns_uni_to_glyphs): Fix indentation.
10044 (setString): Release attrStr before assigning new value.
10045
c803b2b7
JD
100462011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10047
678f4426
JD
10048 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10049 and NS_IMPL_COCOA.
10050 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10051 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10052
cd394be1 100532011-12-18 David Reitter <reitter@cmu.edu>
678f4426 10054
5fecd5fc
JD
10055 * nsterm.m (ns_term_init): Subscribe for notifications
10056 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10057 to method trackingNotification in EmacsMenu.
10058
10059 * nsmenu.m (trackingMenu): New variable.
3771cb17 10060 (trackingNotification): New method (from Aquamacs).
5fecd5fc 10061 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 10062 from Aquamacs (Bug#7030).
678f4426
JD
10063
100642011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 10065
c803b2b7
JD
10066 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10067 (symbol_to_nsstring): Fix indentation.
10068 (ns_symbol_to_pb): New function.
cae07000
SM
10069 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10070 (Fns_rotate_cut_buffers_internal): Remove.
10071 (Fns_store_selection_internal): Rename from
c803b2b7
JD
10072 Fns_store_cut_buffer_internal.
10073 (ns_get_foreign_selection, Fx_own_selection_internal)
10074 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
10075 (Fns_get_selection_internal, Fns_store_selection_internal):
10076 Use ns_symbol_to_pb and check if return value is nil.
10077 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10078 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
10079 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10080 renamed to Sns_store_selection_internal.
10081 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10082 and remove this function.
10083 (ns_handle_selection_clear): Remove, never used.
10084 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10085 here.
10086
e1b01a3a
KB
100872011-12-17 Ken Brown <kbrown@cornell.edu>
10088
10089 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10090 GID is unknown (Bug#10257).
10091
2adb6e85
PE
100922011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10093
10094 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10095 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10096 which caused a build failure on GNU/Linux IA-64. This problem was
10097 introduced by my 2011-10-07 patch.
10098
d1d7b339
JL
100992011-12-15 Juri Linkov <juri@jurta.org>
10100
10101 * image.c (imagemagick_error): New function. (Bug#10112)
10102 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10103 Use `imagemagick_error' where ImageMagick functions return
10104 `MagickFalse'.
10105 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10106 proper order.
10107
100d5755
KH
101082011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10109
10110 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10111 fill background (Bug#8992).
10112
454592a6
MR
101132011-12-13 Martin Rudalics <rudalics@gmx.at>
10114
10115 * window.c (Vwindow_combination_resize)
10116 (Vwindow_combination_limit): Use t instead of non-nil in
10117 doc-strings.
61d4b438
MR
10118 (Vrecenter_redisplay): Add first sentence of doc-string on
10119 separate line.
53524d93 10120 (Frecenter): Fix doc-string typo.
454592a6 10121
3633e3aa
KH
101222011-12-11 Kenichi Handa <handa@m17n.org>
10123
10124 * coding.c (Funencodable_char_position): Pay attention to the
10125 buffer text relocation (Bug#9389).
10126
7b9d523a 101272011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 10128
7b9d523a
JD
10129 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10130 gtk_init (Bug#10100).
10131
b73189c6
EZ
101322011-12-10 Eli Zaretskii <eliz@gnu.org>
10133
10134 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10135 IT->string is nil. (Bug#10263)
10136
f7dfe5d6
JD
101372011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10138
83faebb4
JD
10139 * nsterm.h (x_free_frame_resources): Declare.
10140
f7dfe5d6
JD
10141 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10142 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10143
10144 * nsterm.h (ns_get_defaults_value): Declare.
10145
10146 * nsterm.m (ns_default): Call ns_get_defaults_value.
10147
7cd4e72c
EZ
101482011-12-09 Eli Zaretskii <eliz@gnu.org>
10149
10150 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10151 (Bug#10170)
10152
b34d7317
YM
101532011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10154
10155 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10156 that where the value of an _OBJC_* symbol points to is in the .bss
10157 section (Bug#10240).
10158
76470ad1
KH
101592011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10160
10161 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 10162 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 10163
745fff94
KH
101642011-12-08 Kenichi Handa <handa@m17n.org>
10165
10166 * ftfont.c (get_adstyle_property): Fix previous change
10167 (Bug#10233).
10168
6e44397c
JB
101692011-12-07 Juanma Barranquero <lekktu@gmail.com>
10170
10171 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10172 dirs from the default value of EMACSLOADPATH (bug#10208).
10173
7efa6272
GM
101742011-12-07 Glenn Morris <rgm@gnu.org>
10175
10176 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10177 installation and source directories as well. (Bug#10208)
10178
f6fc4d87
CY
101792011-12-06 Chong Yidong <cyd@gnu.org>
10180
10181 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10182
2bf26180
GM
101832011-12-06 Glenn Morris <rgm@gnu.org>
10184
10185 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10186 as an error, not just -1. (Bug#10217)
10187
3a6ad4f0
CY
101882011-12-05 Chong Yidong <cyd@gnu.org>
10189
10190 * keyboard.c (process_special_events): New function.
10191 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10192
75a3b399
PE
101932011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10194
10195 * coding.c (encode_designation_at_bol): Don't use uninitialized
10196 local variable (Bug#9318).
10197
c3c9e25e
KH
101982011-12-05 Kenichi Handa <handa@m17n.org>
10199
10200 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10201 return Qnil (Bug#8046, Bug#10193).
10202
5eb05ea3
KH
102032011-12-05 Kenichi Handa <handa@m17n.org>
10204
10205 * coding.c (encode_designation_at_bol): New args charbuf_end and
10206 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
10207 (coding_set_source): Return how many bytes coding->source was
10208 relocated.
10209 (coding_set_destination): Return how many bytes
10210 coding->destination was relocated.
10211 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 10212 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
10213
102142011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10215
10216 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10217 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10218 macro (Bug#9318).
10219
102202011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10221
10222 The following changes are to fix Bug#9318.
10223
a79703f5 10224 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
10225 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10226 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 10227 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 10228
7dbda6df
JB
102292011-12-05 Juanma Barranquero <lekktu@gmail.com>
10230
10231 * lisp.h (process_quit_flag): Fix external declaration.
10232
6d5eb5b0
SM
102332011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10234
10235 Don't macro-inline non-performance-critical code.
10236 * eval.c (process_quit_flag): New function.
10237 * lisp.h (QUIT): Use it.
10238
a0c3fad0
JD
102392011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10240
10241 * nsfns.m (get_geometry_from_preferences): New function.
10242 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10243
6c07aac2
AS
102442011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10245
10246 * emacs.c (Qkill_emacs): Define.
10247 (syms_of_emacs): Initialize it.
10248 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10249 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
10250 (quit_throw_to_read_char): Add parameter `from_signal'.
10251 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
10252 * lisp.h (QUIT): Call Fkill_emacs if requested.
10253
c052ead4
JD
102542011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10255
10256 * widget.c (update_wm_hints): Return if wmshell is null.
10257 (widget_update_wm_size_hints): New function.
10258
10259 * widget.h (widget_update_wm_size_hints): Declare.
10260
10261 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10262 widget_update_wm_size_hints (Bug#10104).
10263
9e49252b
EZ
102642011-12-03 Eli Zaretskii <eliz@gnu.org>
10265
10266 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10267 before a newline, prepare the bidi iterator for consuming the
10268 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 10269 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 10270
02b16839
JL
102712011-12-02 Juri Linkov <juri@jurta.org>
10272
10273 * search.c (Fword_search_regexp): New Lisp function created from
10274 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10275 (Fword_search_backward, Fword_search_forward)
10276 (Fword_search_backward_lax, Fword_search_forward_lax):
10277 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10278 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10279
0068070e
SM
102802011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10281
10282 * fileio.c (Finsert_file_contents): Move after-change-function call
10283 to before the "handled:" label, since all "goto handled" appear in
10284 cases where the *-change-functions have already been properly called
10285 (bug#10117).
10286
3360a3fc
AS
102872011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10288
10289 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10290 waiting for input. (Bug#10169)
10291
73d6c093
EZ
102922011-11-30 Eli Zaretskii <eliz@gnu.org>
10293
10294 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10295 verifies glyph row's hash code--we have just reallocated the
10296 glyphs, so their contents can be complete garbage. (Bug#10164)
10297
febe6bea
JB
102982011-11-30 Juanma Barranquero <lekktu@gmail.com>
10299
10300 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10301
801a4313
EZ
103022011-11-30 Eli Zaretskii <eliz@gnu.org>
10303
10304 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10305 attributes are tested _before_ calling verify_row_hash, to protect
10306 against GCC re-ordering of the tests. (Bug#10164)
10307
2b56b87e
JD
103082011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10309
10310 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10311
10312 * xterm.c (handle_one_xevent): Only set async_visible and friends
10313 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 10314 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
10315 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10316
dbf31225
PE
103172011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10318
10319 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10320 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10321 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10322 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10323 All uses changed to use GCPRO1 etc.
10324 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10325 Revert to old implementation (i.e., before 2011-03-11).
10326
1305621b
YM
103272011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10328
10329 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10330 of scroll runs so as to avoid assigning disabled bogus rows and
10331 unnecessary graphics copy operations.
10332
8c9afb46
EZ
103332011-11-27 Eli Zaretskii <eliz@gnu.org>
10334
10335 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10336 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10337 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10338 (malloc, free, realloc, calloc): Redirect to e_* only when
10339 compiling Emacs.
10340
10341 * lisp.h (GCTYPEBITS): Move before first use.
10342 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10343 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10344 this macro definition.
10345
10346 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10347 _MSC_VER.
10348
54e9e3bf
JD
103492011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10350
6d5eb5b0
SM
10351 * gtkutil.c (xg_create_frame_widgets):
10352 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
10353 present with Gtk+ 2.0.
10354
83aca1cb
PE
103552011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10356
10357 * fileio.c (Finsert_file_contents): Undo previous change; see
10358 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10359
5b76caa4
PE
103602011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10361
10362 Rename locals to avoid shadowing.
10363 * fileio.c (Finsert_file_contents):
10364 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10365 * process.c (wait_reading_process_output):
10366 Rename inner 'proc' to 'p' to avoid shadowing.
10367 Indent for consistency with usual Emacs style.
10368
8c535114
EZ
103692011-11-25 Eli Zaretskii <eliz@gnu.org>
10370
10371 * xdisp.c (redisplay_window): If cursor row is not fully visible
10372 after recentering, and scroll-conservatively is set to a large
10373 number, scroll window by a few more lines to make the cursor fully
10374 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
10375 (start_display): Don't move to the next line if the display should
10376 start at a newline that is part of a display vector or an overlay
10377 string. (Bug#10119)
8c535114 10378
fa4fdb5c
JL
103792011-11-24 Juri Linkov <juri@jurta.org>
10380
10381 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10382 after the `MagickPingImage' call. (Bug#10112)
10383
90ec88df
CY
103842011-11-23 Chong Yidong <cyd@gnu.org>
10385
10386 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10387
56e2e794
MR
103882011-11-23 Martin Rudalics <rudalics@gmx.at>
10389
10390 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10391 making another buffer current. (Bug#10114)
10392
b6e64c41
GM
103932011-11-23 Glenn Morris <rgm@gnu.org>
10394
10395 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10396
6b21de18
CY
103972011-11-23 Chong Yidong <cyd@gnu.org>
10398
10399 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10400 using it (Bug#5984).
10401
b12cd789
EZ
104022011-11-22 Eli Zaretskii <eliz@gnu.org>
10403
10404 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10405 and header-lines, as they don't have one computed for them.
10406 (Bug#10098)
10407
10408 * .gdbinit (prow): Make displayed values more self-explaining.
10409 Add row's hash code.
10410
261b6fd4
LMI
104112011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10412
10413 * process.c (wait_reading_process_output): Fix asynchrounous
10414 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 10415 (wait_reading_process_output): Add comment and URL.
261b6fd4 10416
e7cfd277
JD
104172011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10418
10419 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10420
a9b9b7f5
CY
104212011-11-21 Chong Yidong <cyd@gnu.org>
10422
10423 * window.c (Fnext_window, Fprevious_window): Doc fix.
10424
b0d15b4f
SM
104252011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10426
10427 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10428
fe7a3057
JB
104292011-11-20 Juanma Barranquero <lekktu@gmail.com>
10430
10431 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10432
d2999b1a
MR
104332011-11-20 Martin Rudalics <rudalics@gmx.at>
10434
10435 * window.c (Fset_window_combination_limit): Rename argument
10436 STATUS to LIMIT.
10437 (Vwindow_combination_limit): Remove "status" from doc-string.
10438
d5ff9cd0
AS
104392011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10440
10441 * m/ibms390.h: Remove.
10442 * m/ibms390x.h: Don't include "ibms390.h".
10443
a5bb9bd3
SM
104442011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10445
10446 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10447 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10448
cd1181db
JB
104492011-11-20 Juanma Barranquero <lekktu@gmail.com>
10450
10451 * casetab.c (Fset_case_table):
10452 * charset.c (Fcharset_after): Fix typos.
10453
615a3b8d 104542011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 10455
17e845af
PE
10456 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10457 Otherwise, valgrind does not work on some platforms.
10458 Problem reported by Andreas Schwab in
6a0bf43d
PE
10459 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10460 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10461 is set, removing the need for VIRT_ADDRESS_VARIES.
10462 (PURE_P): Use a more-efficient implementation that needs just one
10463 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10464 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10465 to 4 (xorl, subq, cmpq, setbe).
10466 * alloc.c (pure): Always extern now, since that's the
10467 VIRT_ADDR_VARIES behavior.
10468 (PURE_POINTER_P): Use a single comparison, not two, for
10469 consistency with the new puresize.h.
10470 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10471 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10472 Remove VIRT_ADDR_VARIES no longer needed.
10473
f8fe6f96
EZ
104742011-11-19 Eli Zaretskii <eliz@gnu.org>
10475
10476 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10477 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10478 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10479 behave as if the cursor position were at the window margin.
10480
10481 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10482 and the cursor position is out of bounds, behave as if the cursor
10483 position were at the window margin. (Bug#10075)
10484
df05a53c
CY
104852011-11-18 Chong Yidong <cyd@gnu.org>
10486
10487 * window.c (Fwindow_combination_limit): Make first argument
10488 non-optional, since it is meaningless for live windows like the
10489 selected window.
61ccba97 10490
2071918e
DA
104912011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10492
10493 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10494
b50a28de
SM
104952011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10496
10497 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10498 (graft_intervals_into_buffer): Simplify.
10499
015137db
EZ
105002011-11-18 Eli Zaretskii <eliz@gnu.org>
10501
10502 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10503 hash values of the two rows.
10504 (copy_row_except_pointers): Preserve the used[] arrays and the
10505 hash values of the two rows. (Bug#10035)
68c95424 10506 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
10507
10508 * xdisp.c (row_hash): New function, body extracted from
10509 compute_line_metrics.
10510 (compute_line_metrics): Call row_hash, instead of computing the
10511 hash code inline.
10512
10513 * dispnew.c (verify_row_hash): Call row_hash for computing the
10514 hash code of a row, instead of duplicating code from xdisp.c.
10515
10516 * dispextern.h (row_hash): Add prototype.
10517
a2addb04
TH
105182011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10519
10520 * frame.c (delete_frame): Don't delete the terminal when the last
10521 X frame is closed if emacs is built with GTK toolkit.
10522
df85d315
JB
105232011-11-17 Juanma Barranquero <lekktu@gmail.com>
10524
10525 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10526
a0c2d0ae
MR
105272011-11-17 Martin Rudalics <rudalics@gmx.at>
10528
10529 * window.c (Vwindow_splits): Rename to
10530 Vwindow_combination_resize. Suggested by Juri Linkov.
10531 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10532 of Vwindow_splits.
10533
58179cce
JB
105342011-11-16 Juanma Barranquero <lekktu@gmail.com>
10535
7877f373
JB
10536 * nsfns.m (Fns_font_name):
10537 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 10538
b6f67890
MR
105392011-11-16 Martin Rudalics <rudalics@gmx.at>
10540
10541 * window.h (window): Rename slot "nest" to "combination_limit".
10542 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10543 (Fset_window_nest): Rename to Fset_window_combination_limit.
10544 (Vwindow_nest): Rename to Vwindow_combination_limit.
10545 (recombine_windows, make_parent_window, make_window)
10546 (Fsplit_window_internal, saved_window)
10547 (Fset_window_configuration, save_window_save): Rename all
10548 occurrences of window_nest to window_combination_limit.
10549
c7015153
JB
105502011-11-15 Juanma Barranquero <lekktu@gmail.com>
10551
10552 * image.c (imagemagick_load_image): Fix typo.
10553
322ad6ec
EZ
105542011-11-14 Eli Zaretskii <eliz@gnu.org>
10555
10556 * xdisp.c (display_line): Move the call to
10557 highlight_trailing_whitespace before the call to
10558 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
10559 faces of all the glyphs to compute ROW's hash value.
10560 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 10561
f067b8ec
JB
105622011-11-14 Juanma Barranquero <lekktu@gmail.com>
10563
10564 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10565 just return (bug#10044).
10566
1e5b2111
EZ
105672011-11-12 Eli Zaretskii <eliz@gnu.org>
10568
7ef3cbd5
EZ
10569 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10570 with user-defined heap size. Bump the default size of the temacs
10571 heap to 27MB, to avoid memory warning when running temacs.
10572 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10573
1e5b2111
EZ
10574 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10575 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
10576 (verify_row_hash) [XASSERTS]: New function.
10577 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10578 that the hash value of glyph rows is correct.
1e5b2111 10579
89d61221
MR
105802011-11-12 Martin Rudalics <rudalics@gmx.at>
10581
10582 * window.h (window): Remove splits slot.
10583 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10584 (Fdelete_other_windows_internal, make_parent_window)
10585 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10586 (Fset_window_configuration, save_window_save): Don't deal with
10587 split status of windows.
10588 (saved_window): Remove splits slot.
10589 (Vwindow_splits): Rewrite doc-string.
10590
97f18cc8
JD
105912011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10592
10593 * xfns.c (unwind_create_frame):
10594 * nsfns.m (unwind_create_frame):
10595 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10596 Vframe_list (Bug#9999).
10597
22a648b4
DA
105982011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10599
0b381c7e 10600 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 10601
659afede
KH
106022011-11-11 Kenichi Handa <handa@m17n.org>
10603
10604 * callproc.c (Fcall_process): Set the member dst_multibyte of
10605 process_coding.
10606
9ac0394b
KH
106072011-11-11 Johan Bockgård <bojohan@gnu.org>
10608
10609 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10610 avoid a crash (bug#9496).
10611
2fbdc249
CY
106122011-11-09 Chong Yidong <cyd@gnu.org>
10613
10614 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10615 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10616
ac6b1f81
PE
106172011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10618
10619 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10620
09db192c
PE
106212011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10622
10623 Avoid some portability problems by eschewing 'extern inline' functions.
10624 The trivial performance wins aren't worth the portability hassles; see
10625 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10626 et seq.
10627 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10628 (window_box_width, window_box_left, window_box_left_offset)
10629 (window_box_right, window_box_right_offset): Undo previous change,
10630 by removing the "extern"s.
10631 * intervals.c (adjust_intervals_for_insertion)
10632 (adjust_intervals_for_deletion): Undo previous change,
10633 making these static again.
10634 (offset_intervals, temp_set_point_both, temp_set_point)
10635 (copy_intervals_to_string): No longer inline.
10636 * xdisp.c (window_text_bottom_y, window_box_width)
10637 (window_box_height, window_box_left_offset)
10638 (window_box_right_offset, window_box_left, window_box_right)
10639 (window_box): No longer inline.
10640
105216ed
CY
106412011-11-08 Chong Yidong <cyd@gnu.org>
10642
10643 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
10644 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10645 Signal an error if not a live window.
105216ed
CY
10646 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10647 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10648
ae9e237f
JB
106492011-11-07 Juanma Barranquero <lekktu@gmail.com>
10650
10651 * lisp.h (syms_of_abbrev): Remove declaration.
10652 Reported by CHENG Gao <chenggao@royau.me>.
10653
c7aa8333
EZ
106542011-11-07 Eli Zaretskii <eliz@gnu.org>
10655
10656 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10657 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10658 of temacs in GUI mode.
10659
be7f5545
MR
106602011-11-07 Martin Rudalics <rudalics@gmx.at>
10661
10662 * window.h: Declare delete_all_child_windows instead of
10663 delete_all_subwindows.
10664 * window.c (Fwindow_nest, Fset_window_nest)
10665 (Fset_window_new_total, Fset_window_new_normal)
10666 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10667 (delete_all_subwindows): Rename to delete_all_child_windows.
10668 (Fdelete_other_windows_internal, Fset_window_configuration):
10669 Call delete_all_child_windows instead of delete_all_subwindows.
10670 * frame.c (delete_frame): Call delete_all_child_windows instead
10671 of delete_all_subwindows.
10672
ca78dc43
PE
106732011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10674
10675 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10676 This is also needed for porting to any host where GC_MARK_STACK is
10677 not GC_MAKE_GCPROS_NOOPS.
10678 (which_symbols): Use it.
10679
a0241d01
KH
106802011-11-07 Kenichi Handa <handa@m17n.org>
10681
10682 * coding.c (coding_set_destination): Check coding->src_pos only
10683 when coding->src_object is a buffer (bug#9910).
10684
10685 * process.c (send_process): Set the member src_multibyte of coding
10686 to 0 (bug#9911) when sending a unibyte text.
10687
10688 * callproc.c (Fcall_process): Set the member src_multibyte of
10689 process_coding to 0 (bug#9912).
10690
a64bfdfa 106912011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
10692
10693 * xmenu.c (cleanup_widget_value_tree): New function.
10694 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10695 calling free_menubar_widget_value_tree directly (Bug#9830).
10696
cb41b32a
PE
106972011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10698
10699 Fix some portability problems with 'inline'.
10700 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10701 (window_box_width, window_box_left, window_box_left_offset)
10702 (window_box_right, window_box_right_offset): Declare extern.
10703 Otherwise, these inline functions do not conform to C99 and
10704 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10705 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10706 * intervals.c (adjust_intervals_for_insertion)
10707 (adjust_intervals_for_deletion): Now extern, because otherwise the
10708 extern inline functions 'offset_intervals' couldn't refer to it.
10709 (static_offset_intervals): Remove.
10710 (offset_intervals): Rewrite using the old contents of
10711 static_offset_intervals. The old version didn't conform to C99
10712 because an extern inline function contained a reference to an
10713 identifier with static linkage.
10714
b7041366
AS
107152011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10716
10717 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10718 GC.
10719
88a37c4d
EZ
107202011-11-06 Eli Zaretskii <eliz@gnu.org>
10721
10722 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10723 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10724 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10725 return Qleft_to_right.
10726
49745b39
CY
107272011-11-06 Chong Yidong <cyd@gnu.org>
10728
10729 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10730 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10731 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10732 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10733 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10734 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10735 (Fwindow_vscroll): Doc fix.
10736 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10737 argument, since it makes no sense to pass a live window and for
10738 consistency with window-child.
10739
1f05cd82
CS
107402011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10741
10742 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10743 support MSVC.
10744
22610910
JR
107452011-11-05 Jason Rumney <jasonr@gnu.org>
10746
10747 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10748 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10749 fonts (Bug#6029).
10750 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10751 bitwise arithmetic preventing use of unicode-sip and non-truetype
10752 opentype fonts.
10753
a06776b2
EZ
107542011-11-05 Eli Zaretskii <eliz@gnu.org>
10755
3ad924ba
EZ
10756 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10757 "emacs"-only part.
10758
a06776b2
EZ
10759 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10760 initialization code to keep similarity to xfns.c after changes
10761 from 2011-11-05.
10762
c9e7db78
JD
107632011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10764
a97f8f3f
JD
10765 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10766 (unwind_create_frame): New function (Bug#9943).
10767 (Fx_create_frame): Restructure code to be more similar to the one in
10768 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10769 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10770 Move terminal->reference_count++ just before making the frame official
10771 (Bug#9943).
10772
10773 * nsterm.m (x_free_frame_resources): New function.
10774 (x_destroy_window): Move code to x_free_frame_resources.
10775
c9e7db78 10776 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
10777 (Fx_create_frame, x_create_tip_frame):
10778 Move terminal->reference_count++ just before making the frame
75f1671a 10779 official. Move initialization of image_cache_refcount and
c9e7db78
JD
10780 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10781
a6fc3b5c
EZ
107822011-11-05 Eli Zaretskii <eliz@gnu.org>
10783
10784 Support MSVC build with newer versions of Visual Studio.
10785 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10786 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10787 nt/gmake.defs.
10788
10789 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10790 which are not supported by MSVC.
10791 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10792 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10793 bitfields.
10794 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10795 types in bitfields.
10796 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10797
10798 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10799
58179cce 108002011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
10801
10802 Support MSVC build with newer versions of Visual Studio.
10803 * w32.c: Don't include w32api.h for MSVC.
10804 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10805
10806 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10807 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10808 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10809 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10810 e_* cousins.
10811 (alloca) [_MSC_VER]: Define to _alloca.
10812
10813 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10814
10815 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10816
a58c13ed
EZ
108172011-11-04 Eli Zaretskii <eliz@gnu.org>
10818
10819 * xdisp.c (note_mouse_highlight): If either of
10820 previous/next-single-property-change returns nil, treat that as
10821 the beginning or the end of the buffer. (Bug#9955)
10822
fe0b6370
JD
108232011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10824
a58c13ed 10825 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
10826 label is not null (Bug#9951).
10827 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10828 may be NULL.
10829
89bd5ee1
EZ
108302011-11-04 Eli Zaretskii <eliz@gnu.org>
10831
10832 * window.c (Fwindow_body_size): Mention in the doc string that the
10833 return value is in frame's canonical units. (Bug#9949)
10834
84c3edb9
EZ
108352011-11-03 Eli Zaretskii <eliz@gnu.org>
10836
4e2fb5c7
EZ
10837 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10838
84c3edb9 10839 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 10840 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 10841 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 10842
bc17a887
EZ
108432011-11-01 Eli Zaretskii <eliz@gnu.org>
10844
10845 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10846 Don't stop backward scan on the continuation glyph, even though
10847 its CHARPOS is positive.
6d5eb5b0
SM
10848 (mouse_face_from_buffer_pos, note_mouse_highlight):
10849 Rename cover_string to disp_string.
bc17a887 10850
4ee88440
MR
108512011-11-01 Martin Rudalics <rudalics@gmx.at>
10852
10853 * window.c (temp_output_buffer_show): Don't use
10854 Vtemp_buffer_show_specifiers.
10855 (Vtemp_buffer_show_specifiers): Remove unused variable.
10856
c2ff3c02
EZ
108572011-10-30 Eli Zaretskii <eliz@gnu.org>
10858
10859 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10860 past the beginning of the current glyph matrix.
10861
58179cce 108622011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
10863
10864 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10865 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10866 HAVE_GTK3 (Bug#9869).
b77a6a7f 10867
3b574623
JD
10868 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10869 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10870
b77a6a7f
JD
10871 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10872
10873 * xterm.c: Declare x_handle_net_wm_state to return int.
10874 (handle_one_xevent): Check if we are iconified but don't have
10875 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10876 (get_current_wm_state): Return non-zero if not hidden,
10877 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10878 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10879 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10880 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10881
196e41e4
PE
108822011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10883
10884 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10885 so that this new function doesn't get optimized away by a
10886 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10887
021f2e1a
AS
108882011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10889
10890 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10891
8b058d44
EZ
108922011-10-29 Eli Zaretskii <eliz@gnu.org>
10893
10894 Fix the `xbytecode' command.
10895 * .gdbinit (xprintbytestr): New command.
b50a28de 10896 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
10897 (xbytecode): Print the byte-code string as well.
10898
4452fb80
EZ
108992011-10-29 Kim Storm <storm@cua.dk>
10900
8b058d44
EZ
10901 * alloc.c (which_symbols): New function.
10902
21b72067
AS
109032011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10904
10905 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10906 line. (Bug#9903)
10907
83ed7b5c
GM
109082011-10-29 Glenn Morris <rgm@gnu.org>
10909
10910 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10911 Not clear what it was for, and it causes various bugs. (Bug#9839)
10912
5a7a728b
EZ
109132011-10-28 Eli Zaretskii <eliz@gnu.org>
10914
10915 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10916 possible random value that matches one of those tested as
10917 condition to clear the mouse face.
10918
d3d0842f
CY
109192011-10-28 Chong Yidong <cyd@gnu.org>
10920
10921 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10922
31b39d13
DN
109232011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10924
10925 * window.c (make_window): Initialize phys_cursor_on_p.
10926
9aba6043
SM
109272011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10928
10929 * lisp.h (struct Lisp_Symbol): Update comments.
10930
c20992f4
JB
109312011-10-28 Juanma Barranquero <lekktu@gmail.com>
10932
10933 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10934
db4f02f2
EZ
109352011-10-28 Eli Zaretskii <eliz@gnu.org>
10936
10937 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10938 <oslsachem@gmail.com> for helping to debug this.
10939
10940 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10941 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10942 (g_b_init_get_glyph_outline_w): New static variables.
10943 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10944 (GetGlyphOutlineW_Proc): New typedefs.
10945 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
10946 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10947 New functions.
10948 (w32font_open_internal, compute_metrics):
10949 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
10950 instead of calling the "wide" APIs directly.
10951
10952 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10953
10954 * w32.h (syms_of_w32font): Add prototype.
10955
87e68db4
JB
109562011-10-27 Juanma Barranquero <lekktu@gmail.com>
10957
10958 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10959 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10960 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10961 (Fmove_to_window_line): Doc fix.
10962
435c1d67
CY
109632011-10-27 Chong Yidong <cyd@gnu.org>
10964
10965 * process.c (make_process): Set gnutls_state to NULL.
10966
10967 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10968 non-NULL, regardless of GNUTLS_INITSTAGE.
10969 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10970 an error. Set process slots as soon as we allocate them.
10971
10972 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10973
9c6c6f49
CY
109742011-10-27 Chong Yidong <cyd@gnu.org>
10975
9aba6043
SM
10976 * gnutls.c (emacs_gnutls_deinit): New function.
10977 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10978 (Fgnutls_deinit, Fgnutls_boot): Use it.
10979
10980 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10981 (deactivate_process): Call emacs_gnutls_deinit.
10982
657d08d3
JB
109832011-10-27 Juanma Barranquero <lekktu@gmail.com>
10984
10985 * image.c (x_create_x_image_and_pixmap):
10986 * w32.c (sys_rename, w32_delayed_load):
10987 * w32font.c (fill_in_logfont):
10988 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10989
5430d399
JB
109902011-10-26 Juanma Barranquero <lekktu@gmail.com>
10991
10992 * w32fns.c (w32_default_color_map): New function,
10993 extracted from Fw32_default_color_map.
a7ef684b 10994 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10995
fe0055fa
PE
109962011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10997
10998 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10999
e6346438
SM
110002011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11001
11002 * keyboard.c (test_undefined): New function (bug#9751).
11003 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11004
e112cc37
ET
110052011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11006
11007 * sysdep.c (init_sys_modes): Fix the check for the controlling
11008 terminal (Bug#6649).
11009
7b5d6677
EZ
110102011-10-20 Eli Zaretskii <eliz@gnu.org>
11011
11012 * dispextern.h (struct bidi_it): New member next_en_type.
11013
11014 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11015 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11016 current character, check also for next_en_type being WEAK_EN.
11017 (bidi_resolve_weak): Don't enter the expensive loop if the current
11018 position is before next_en_pos. Record the bidi type of the first
11019 non-ET, non-BN character we find, in addition to its position.
11020 (bidi_level_of_next_char): Invalidate next_en_type when
11021 next_en_pos is over-stepped.
11022
7da0b018
PE
110232011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11024
11025 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11026 * editfns.c: Rewrite current-time-zone so that it invokes
11027 the equivalent of (format-time-string "%Z") to get the time zone name.
11028 This fixes a bug when the time zone name contains characters that
11029 need converting from the system time locale to Emacs internal format.
11030 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11031 that patch fixed format-time-string to do the conversion, but
11032 I forgot to fix current-time-zone.
11033 (format_time_string): New function, containing most of
11034 what Fformat_time_string used to contain.
11035 (Fformat_time_string): Rewrite in terms of format_time_string.
11036 This doesn't change this function's behavior.
11037 (current-time-zone): Rewrite to use format_time_string.
11038 This fixes the bug reported by Michael Schierl in
11039 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11040 Jason Rumney's 2007-06-07 change worked around this bug, but
11041 didn't fix it.
11042 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11043
8547b010
EZ
110442011-10-19 Eli Zaretskii <eliz@gnu.org>
11045
11046 * xdisp.c (start_display): If the character at POS is displayed
11047 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
11048 (try_window_reusing_current_matrix): If a line ends in a display
11049 vector or the next line starts in a display vector, continue
11050 redrawing the window even though the character position of
11051 start_row was reached.
8547b010
EZ
11052 (Bug#9771, part 2)
11053
4e948d15
CY
110542011-10-18 Chong Yidong <cyd@gnu.org>
11055
11056 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11057 with nobreak-char-display too.
11058
4787455f
EZ
110592011-10-18 Eli Zaretskii <eliz@gnu.org>
11060
11061 Fix part 3 of bug#9771.
11062 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11063 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11064 non-neutral characters if the current character is a paragraph
11065 separator (a.k.a. Newline). This avoids running the same
11066 expensive loop twice, once when we consume the preceding newline
11067 and the other time when the line actually needs to be displayed.
11068 Avoid the loop when we see neutrals on the base embedding level
11069 following a character whose directionality is the same as the
11070 paragraph's. This avoids running the expensive loop when a line
11071 ends in a long sequence of neutrals, like control characters.
11072 Add assertion against STRONG_AL type. Slightly rearrange code
11073 that determines the type of a neutral given the first non-neutral
11074 that follows it.
11075 (bidi_level_of_next_char): Set next_en_pos to zero when
11076 invalidating its info.
11077
2c91f553
EZ
110782011-10-17 Eli Zaretskii <eliz@gnu.org>
11079
11080 * xdisp.c (push_display_prop): Determine whether to record string
11081 or buffer position by IT->string, not by IT->method. Allow
11082 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
11083 (move_it_vertically_backward): Don't look for character position
11084 immediately after the newline when in a continuation line.
11085 (Bug#9771, part 1)
2c91f553 11086
c7b08b0d
MR
110872011-10-15 Martin Rudalics <rudalics@gmx.at>
11088
11089 * window.c (coordinates_in_window): Rewrite and delabelize
11090 vertical border check. (Bug#5357) (Bug#9618)
11091
6b02f655
SM
110922011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11093
11094 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11095 errors in XSetWindowBorder (bug#9310).
11096
81d40c92
DA
110972011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11098
11099 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11100 avoid crash when xmalloc overrun checking is enabled.
11101
d4172c3b
EZ
111022011-10-13 Eli Zaretskii <eliz@gnu.org>
11103
11104 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11105 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11106 cursor motion with <left> and <right> arrow keys.
11107
11108 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11109 some callers set that themselves.
11110
b00eea75
EZ
111112011-10-12 Eli Zaretskii <eliz@gnu.org>
11112
11113 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11114 display string and the previous row comes from the same string and
11115 is empty. (Bug#9739) (Bug#9738)
11116
8fe012c4
SM
111172011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11118
11119 * doc.c (get_doc_string): Encode file name (bug#9735).
11120
0074aef2
EZ
111212011-10-12 Eli Zaretskii <eliz@gnu.org>
11122
79beb178
EZ
11123 * bidi.c (bidi_level_of_next_char):
11124 * xdisp.c (get_visually_first_element): Remove old incorrect
11125 comments regarding the Unicode Line Separator character.
11126
0074aef2
EZ
11127 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11128
6e4b3fbe
DA
111292011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11130
11131 * alloc.c (Fgc_status): Do not access beyond zombies array
11132 boundary if nzombies > MAX_ZOMBIES.
11133 * alloc.c (dump_zombies): Add missing format specifier.
11134
0324f3af
PE
111352011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11136
b5525cac
PE
11137 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11138 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11139
0324f3af
PE
11140 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11141 Some packages use them to denote characters with modifiers.
11142
e9b5f888
AS
111432011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11144
11145 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11146 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11147 matching a pp-number. Rename parameter var to var1.
11148
127827c0
SM
111492011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11150
11151 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11152
c8fd3bd0
GM
111532011-10-08 Glenn Morris <rgm@gnu.org>
11154
11155 * callint.c (Fcall_interactively): Give a more explicit error for the
11156 'c' case with a non-character input. (Bug#8479)
11157
352ec8ff
EZ
111582011-10-08 Eli Zaretskii <eliz@gnu.org>
11159
03669ccb
EZ
11160 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11161 lines.
7061c986
EZ
11162 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11163 lines that are hscrolled on the left.
03669ccb 11164
352ec8ff
EZ
11165 * dispnew.c (buffer_posn_from_coords): Account for a possible
11166 presence of header-line. (Bug#4426)
11167
a66cfb1c
SM
111682011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11169
6b02f655
SM
11170 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11171 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 11172
7c5ee88e
PE
111732011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11174
11175 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11176 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11177 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11178 this makes Emacs dump core during garbage collection on rare
11179 occasions. sizeof is obviously inferior to offsetof here, so
11180 stick with offsetof.
11181 (GC_POINTER_ALIGNMENT): New macro.
11182 (mark_memory): Omit 3rd (offset) arg; caller changed.
11183 Don't assume EMACS_INT alignment is the same as pointer alignment.
11184
df1bbe5b
SM
111852011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11186
11187 * keyboard.c (read_key_sequence_remapped): New var.
11188 (read_key_sequence): Compute remapping in the right buffer.
11189 (command_loop_1): Use read_key_sequence's remapping directly.
11190
51553db6
SM
111912011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11192
32c1fffd
SM
11193 * dired.c (file_name_completion): Don't expand file name.
11194 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11195 before checking file name handler.
11196
51553db6
SM
11197 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11198 they've been requested explicitly (bug#9591).
11199
b6bd1599 112002011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
11201
11202 * keymap.c (Fsingle_key_description): Use make_specified_string
11203 instead of build_string to build string from push_key_description.
11204 (Bug#5193)
11205
f701dc2a
PE
112062011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11207
4222c55d
PE
11208 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11209 This fixes a Y2038 bug on 64-bit hosts.
11210 * buffer.c (reset_buffer):
11211 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11212 (Fclear_buffer_auto_save_failure):
11213 Use 0, not -1, to represent an unset failure time, since time_t
11214 might not be signed.
11215
f701dc2a
PE
11216 Remove dependency on glibc malloc internals.
11217 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11218 Move back here from lisp.h, but with their new implementations.
11219 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11220 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11221 * charset.c (charset_table_init): New static var.
11222 (syms_of_charset): Use it instead of xmalloc. This removes a
11223 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11224 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11225 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11226 Move back to alloc.c.
11227 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11228 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11229
9ceebf39
JD
112302011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11231
11232 * nsterm.m (windowDidResize): Call x_set_window_size only when
11233 ns_in_resize is true. Otherwise set pixelwidth/height and
11234 call change_frame_size (Bug#9628).
11235
cb993c58
PE
112362011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11237
3930c88b
PE
11238 Port --enable-checking=all to Fedora 14 x86-64.
11239 * charset.c (syms_of_charset): Also account for glibc malloc's
11240 internal overhead when calculating the initial malloc maximum.
11241
cb993c58
PE
11242 Port --enable-checking=all to Fedora 14 x86.
11243 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11244 Move to lisp.h.
11245 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11246 (overrun_check_realloc, overrun_check_free):
11247 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11248 That way, xmalloc returns a properly-aligned pointer even if
11249 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11250 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11251 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11252 into account when calculating the initial malloc maximum.
11253 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11254 Move here from alloc.c, so that charset.c can use it too.
11255 Properly align; the old code wasn't right for common 32-bit hosts
11256 when configured with --enable-checking=all.
11257 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11258 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11259
31bed486
EZ
112602011-09-29 Eli Zaretskii <eliz@gnu.org>
11261
04c70788 11262 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
11263 use EDOM.
11264
fbcaa2f3
EZ
112652011-09-28 Eli Zaretskii <eliz@gnu.org>
11266
11267 * xdisp.c (compute_display_string_end): If there's no display
11268 string at CHARPOS, return -1.
11269
11270 * bidi.c (bidi_fetch_char): When compute_display_string_end
11271 returns a negative value, treat the character as a normal
11272 character not covered by a display string. (Bug#9624)
11273
a239d4e9
JB
112742011-09-28 Juanma Barranquero <lekktu@gmail.com>
11275
11276 * lread.c (Fread_from_string): Fix typo in docstring.
11277
88652fd5
EZ
112782011-09-27 Eli Zaretskii <eliz@gnu.org>
11279
11280 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11281 newline, reseat the iterator instead of bidi-iterating there one
11282 character at a time. (Bug#9610)
32c1fffd
SM
11283 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11284 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 11285
ed497dd4
AS
112862011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11287
11288 * lread.c (readevalloop): Use correct code for NBSP.
11289 (read1): Likewise. (Bug#9608)
11290
b2bf61aa
MA
112912011-09-25 Michael Albinus <michael.albinus@gmx.de>
11292
11293 * dbusbind.c (Fdbus_register_signal): When service is not
11294 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11295
32bbb17c
GM
112962011-09-25 Glenn Morris <rgm@gnu.org>
11297
11298 * buffer.c (truncate-lines): Doc fix.
11299
94e0933e
CY
113002011-09-24 Chong Yidong <cyd@stupidchicken.com>
11301
11302 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11303 (Fset_window_next_buffers): Doc fix.
11304
cddde921
GM
113052011-09-24 Glenn Morris <rgm@gnu.org>
11306
11307 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11308
1260aef1
PE
113092011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11310
25b4bfa0
PE
11311 Fix minor problems found by static checking.
11312 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
11313 * indent.c (Fvertical_motion): Fix == vs = typo.
11314
e3cbd34b
EZ
113152011-09-24 Eli Zaretskii <eliz@gnu.org>
11316
a66cfb1c
SM
11317 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11318 Default value is now t. Doc fix.
6bf7006f 11319
e3cbd34b 11320 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 11321 logic when moving up, not only when moving down. Fix the
e3cbd34b 11322 confusing name and values of the it_overshoot_expected variable;
32c1fffd 11323 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
11324
11325 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11326 CHARPOS is covered by a display string which includes newlines.
11327 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11328 is covered by a display string with embedded newlines.
11329
a3de0cbd
MA
113302011-09-24 Michael Albinus <michael.albinus@gmx.de>
11331
11332 * dbusbind.c (Fdbus_register_signal): Add match rule to
11333 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
11334 (Fdbus_register_method, Vdbus_registered_objects_table):
11335 Fix docstring.
a3de0cbd 11336
b260039d
JM
113372011-09-24 Jim Meyering <meyering@redhat.com>
11338
32c1fffd 11339 do not ignore write error for any output size
b260039d
JM
11340 The previous change was incomplete.
11341 While it makes emacs --batch detect the vast majority of stdout
11342 write failures, errors were still ignored whenever the output size is
11343 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11344 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11345 && echo FAIL: ignored write error
11346 FAIL: ignored write error
11347 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11348 && echo FAIL: ignored write error
11349 FAIL: ignored write error
11350 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11351
8eca8a7c
AS
113522011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11353
11354 * emacs.c (Fkill_emacs): In noninteractive mode exit
11355 non-successfully if a write error occurred on stdout. (Bug#9574)
11356
3341db62
EZ
113572011-09-21 Eli Zaretskii <eliz@gnu.org>
11358
11359 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11360 the xassert test.
11361
11362 * dispextern.h (struct it): Update the comment documenting what
11363 can it->OBJECT be.
11364
8c203dbf
EZ
113652011-09-20 Eli Zaretskii <eliz@gnu.org>
11366
11367 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11368 a display string, extend search for cursor position to end of row.
11369 (find_row_edges): If the row ends in a newline from a display
11370 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11371 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
11372 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11373 non-empty line. Fixes confusing cursor motion with arrow keys at
11374 the beginning of a line that starts with whitespace.
8c203dbf 11375
a4824228
LMI
113762011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11377
11378 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11379 (bug#9493).
11380
33ed493b
CY
113812011-09-18 Chong Yidong <cyd@stupidchicken.com>
11382
11383 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11384 boolean (Bug#9154).
11385
56cd55c8
EZ
113862011-09-18 Eli Zaretskii <eliz@gnu.org>
11387
11388 * xdisp.c (display_line): Record maximum and minimum buffer
11389 positions even if no glyphs were produced (e.g., by a zero-width
11390 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11391 buffer positions that will be removed from the glyph row because
11392 they don't fit.
c02dcedf
EZ
11393 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11394 column is beyond frame width: don't subtract 1 "pixel" when
11395 computing width of the stretch.
3e62b7e0
EZ
11396 (reseat_at_next_visible_line_start): Undo the change made on
11397 2011-09-17 that saved paragraph information and restored it after
11398 the call to `reseat'. (Bug#9545)
56cd55c8 11399
5ed99d36 114002011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
11401
11402 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11403 and turn window cursor on if cleared (Bug#9415).
11404
5ed99d36 114052011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
11406
11407 * search.c (boyer_moore): Take unibyte characters from pattern
11408 literally. (Bug#9458)
11409
9bade7b2
EZ
114102011-09-18 Eli Zaretskii <eliz@gnu.org>
11411
11412 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11413
e5e9d610
PE
114142011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11415
87e4427a
PE
11416 Fix minor problem found by static checking.
11417 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11418 initialized, to pacify gcc -Wuninitialized.
11419
e5e9d610
PE
11420 * fileio.c: Report proper errno when syscall falls.
11421 (Finsert_file_contents): Save and restore errno,
11422 so that report_file_error outputs the correct diagnostic.
11423 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11424
a1674f0b
EZ
114252011-09-18 Eli Zaretskii <eliz@gnu.org>
11426
11427 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11428
fbfb6dd4
EZ
114292011-09-17 Eli Zaretskii <eliz@gnu.org>
11430
11431 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11432 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11433
bb187662
EZ
114342011-09-17 Eli Zaretskii <eliz@gnu.org>
11435
1137e8b8 11436 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 11437 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
11438
11439 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11440 (bidi_find_paragraph_start): Search back for paragraph beginning
11441 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11442 (bidi_move_to_visually_next): Only trigger paragraph-related
11443 computations when the last character is a newline or at EOB, not
11444 just any NEUTRAL_B. (Bug#9470)
11445
bb187662
EZ
11446 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11447 truncated lines if point is covered by a display string. (Bug#9524)
11448
2e621251
PE
114492011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11450
11451 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11452 (cons_to_x_long): New function.
11453 (lisp_data_to_selection_data): Use it. Correct the test for
11454 short-versus-long data; it was negated. Break out of vector
11455 loop, for efficiency, when a long datum is discovered.
11456
91a15bc6
SM
114572011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11458
11459 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11460
b41c3a35
EZ
114612011-09-16 Eli Zaretskii <eliz@gnu.org>
11462
11463 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11464 GCC PR/17406) by declaring this function with external scope.
11465
7812ba2d
PE
114662011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11467
11468 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11469 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11470
cf7edc2a
AS
114712011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11472
11473 * editfns.c (Fformat): Correctly handle text properties on "%%".
11474
bd01620e
EZ
114752011-09-15 Eli Zaretskii <eliz@gnu.org>
11476
11477 * xterm.c (x_draw_composite_glyph_string_foreground):
11478 * w32term.c (x_draw_composite_glyph_string_foreground):
11479 * term.c (encode_terminal_code):
11480 * composite.c (composition_update_it, get_composition_id):
11481 * xdisp.c (get_next_display_element)
11482 (fill_composite_glyph_string): Add comments about special meaning
11483 of TAB characters in a composition.
11484
a02719a3
PE
114852011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11486
11487 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
11488 This occurs when processing a multibyte format.
11489 Problem reported by Wolfgang Jenker.
a02719a3 11490
72589a3c
JB
114912011-09-15 Johan Bockgård <bojohan@gnu.org>
11492
11493 * xdisp.c (try_cursor_movement): Only check for exact match if
11494 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11495
1c14176c
PE
114962011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11497
11498 Remove unused external symbols.
11499 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11500 * xdisp.c (calc_pixel_width_or_height): Now static.
11501 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11502 * indent.c (check_display_width):
11503 * w32term.c: Fix comment to match code.
11504 * xterm.c, xterm.h (x_catching_errors): Remove.
11505
d2eea5b5
PE
115062011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11507
11508 * xselect.c: Use signed conversions more consistently (Bug#9498).
11509 (selection_data_to_lisp_data): Assume incoming selection data are
11510 signed integers, not unsigned. This is to be consistent with
11511 outgoing selection data, which was modified to use signed integers
11512 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11513 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11514 expects long, not unsigned long.
11515
46888499
EZ
115162011-09-14 Eli Zaretskii <eliz@gnu.org>
11517
11518 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11519 computation of loop end. Reported by Johan Bockgård
11520 <bojohan@gnu.org>.
11521
ef8ef9fb
CY
115222011-09-13 Chong Yidong <cyd@stupidchicken.com>
11523
11524 * frame.c (Fother_visible_frames_p): Function deleted.
11525
fa819fed
EZ
115262011-09-12 Eli Zaretskii <eliz@gnu.org>
11527
11528 * indent.c (compute_motion): Process display vector front to back
11529 rather than the other way around. (Bug#2496)
11530
2ba8e008
SM
115312011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11532
11533 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11534
20f53c69
CY
115352011-09-11 Chong Yidong <cyd@stupidchicken.com>
11536
11537 * minibuf.c (Fread_from_minibuffer): Doc fix.
11538
d562d7a4
EZ
115392011-09-11 Eli Zaretskii <eliz@gnu.org>
11540
11541 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11542 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11543
1c4d7f3d
LMI
115442011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11545
11546 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11547 value for non-existent files.
11548
b885bf36
EZ
115492011-09-11 Eli Zaretskii <eliz@gnu.org>
11550
11551 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11552 set its "size" to -1. This will set the modtime_size field of
11553 the corresponding buffer to -1, which is what
11554 verify-visited-file-modtime expects for files that do not exist.
11555 (Bug#9139)
11556
6612f0bf
PE
115572011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11558
11559 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11560 here ...
11561 * lisp.h: ... from here. push_key_description is no longer
11562 defined in keyboard.c, so its declaration should not be in
11563 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11564 logically belongs with push_key_description.
11565
dfb3f755
PE
115662011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11567
11568 * buffer.h: Include <sys/types.h> instead of <time.h>.
11569 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11570 Problem reported by Herbert J. Skuhra.
11571
3134906c
LMI
115722011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11573
11574 * xml.c (parse_region): Make the parsing work for
11575 non-comment-starting XML files again (bug#9144).
11576
8d903f4e
AS
115772011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11578
11579 * image.c (gif_load): Fix calculation of bottom and right corner.
11580 (Bug#9468)
11581
80ad64f4
EZ
115822011-09-10 Eli Zaretskii <eliz@gnu.org>
11583
11584 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11585 redisplay in small windows.
11586
208a048d
EZ
115872011-09-09 Eli Zaretskii <eliz@gnu.org>
11588
11589 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11590
9b1c252e
MR
115912011-09-08 Martin Rudalics <rudalics@gmx.at>
11592
11593 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11594 Operate on live windows only.
11595
2949f33b
JB
115962011-09-08 Juanma Barranquero <lekktu@gmail.com>
11597
11598 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11599
e08dcafd
EZ
116002011-09-07 Eli Zaretskii <eliz@gnu.org>
11601
11602 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11603 only under bidi iteration.
11604
115b96bd
JD
116052011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11606
11607 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11608
c8199d0f
PE
116092011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11610
11611 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11612 Without this fix, the command to link temacs failed due to an
11613 undefined symbol __builtin_isnan. This is because
11614 /usr/include/iso/math_c99.h #defines isnan(x) to
11615 __builtin_isnan(x), but the bundled gcc, which identifies itself
11616 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11617 a __builtin_isnan.
11618 * floatfns.c (isnan): #undef, and then #define to a clone of
11619 what's in data.c.
11620 (Fisnan): Always define, since it's always available now.
11621 (syms_of_floatfns): Always define isnan at the Lisp level.
11622
e39b275c 116232011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
11624
11625 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11626
b2db44d9 116272011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 11628
f4af5137 11629 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
11630 The previous code assumed that file offsets (off_t values) fit in
11631 EMACS_INT variables, which is not true on typical 32-bit hosts.
11632 The code messed up by falsely reporting buffer overflow in cases
11633 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11634 when "big" contains more than 2**29 bytes, even though this
11635 inserts just one byte and does not overflow the buffer.
11636 (Finsert_file_contents): Store file offsets as off_t
11637 values, not as EMACS_INT values. Check for overflow when
11638 converting between EMACS_INT and off_t. When checking for
11639 buffer overflow or for overlap, take the offsets into account.
11640 Don't use EMACS_INT for small values where int suffices.
11641 When checking for overlap, fix a typo: ZV was used where
11642 ZV_BYTE was intended.
11643 (Fwrite_region): Don't assume off_t fits into 'long'.
11644 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11645
ecfc0a49
MA
116462011-09-05 Michael Albinus <michael.albinus@gmx.de>
11647
11648 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11649
6511acf2 116502011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 11651
0999621a 11652 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
11653
11654 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 11655 (esprintf, exprintf, evxprintf): New functions.
62f19c19 11656 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 11657 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
11658 (modify_event_symbol): Do not assume that the length of
11659 name_alist_or_stem is safe to alloca and fits in int.
11660 (Fexecute_extended_command): Likewise for function name and binding.
11661 (Frecursion_depth): Wrap around reliably on integer overflow.
11662 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11663 since some callers pass EMACS_INT values.
11664 (Fsingle_key_description): Don't crash if symbol name contains more
11665 than MAX_ALLOCA bytes.
11666 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11667 (get_minibuffer): Arg is now EMACS_INT, not int.
11668 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 11669 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
11670 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11671
2be7d702
PE
11672 * dbusbind.c (signature_cat): New function.
11673 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
11674 Do not overrun buffer; instead, report string overflow.
11675
9d1df220
PE
11676 * dispnew.c (add_window_display_history): Don't overrun buffer.
11677 Truncate instead; this is OK since it's just a log.
11678
33ef5c64
PE
11679 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11680 even if the time zone offset is outlandishly large.
11681 Don't mishandle offset == INT_MIN.
11682
66c6fdd5
PE
11683 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11684 when creating daemon; the previous buffer-overflow check was incorrect.
11685
d749b01b
PE
11686 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11687 which has the guts of the old verror function.
11688
b5cd1905
PE
11689 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11690 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11691
6e1a67fb
PE
11692 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11693 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 11694 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 11695 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
11696 length of string rather than counting it via multiple sprintfs;
11697 that's simpler and more reliable.
c21721cc
PE
11698 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11699 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11700 sprintf, in case result does not fit in int.
11701
c57b67fc
PE
11702 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11703 (fontset_from_font): Print it.
11704
8a401434
PE
11705 * frame.c (tty_frame_count): Now printmax_t, not int.
11706 (make_terminal_frame, set_term_frame_name): Print it.
11707 (x_report_frame_params): In X, window IDs are unsigned long,
11708 not signed long, so print them as unsigned.
11709 (validate_x_resource_name): Check for implausibly long names,
11710 and don't assume name length fits in 'int'.
11711 (x_get_resource_string): Don't blindly alloca invocation name;
11712 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11713 not fit in int.
11714
6e1a67fb
PE
11715 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11716 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
11717 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11718
0df02bf3
PE
11719 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11720 Use esprintf, not sprintf, in case result does not fit in int.
11721
48e30793
PE
11722 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11723 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11724 it as a large positive number.
11725 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11726 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11727
a66ff6d8
PE
11728 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11729 in case result does not fit in int.
11730
aca216ff
PE
11731 * print.c (float_to_string): Detect width overflow more reliably.
11732 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11733 buffer overrun. Don't assume list length fits in 'int'. Treat
11734 print length of 0 as 0, not as infinity; to be consistent with other
11735 uses of print length in this function. Don't overflow print length
11736 index. Don't assume hash table size fits in 'long', or that
11737 vectorlike size fits in 'unsigned long'.
11738
31c286f7
PE
11739 * process.c (make_process): Use printmax_t, not int, to format
11740 process-name gensyms.
11741
55e5faa1
PE
11742 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11743
80f2e268
PE
11744 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11745 to avoid potential buffer overrun.
11746
670741ab
PE
11747 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11748 if X resource line is longer than 512 bytes.
11749
b7163a50
PE
11750 * xfns.c (x_window): Make sprintf buffer a bit bigger
11751 to avoid potential buffer overrun.
11752
ae58ff1f
PE
11753 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11754
c43c8a6a
PE
11755 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11756
3f8236f4
PE
117572011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11758
53e9fe90 11759 Integer overflow fixes for scrolling, etc.
6511acf2
PE
11760 Without these, Emacs silently mishandles large integers sometimes.
11761 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
11762 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11763
6511acf2
PE
11764 * xdisp.c (try_window_id): Check Emacs fixnum range before
11765 converting to 'int'.
806add1d 11766
6511acf2 11767 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
11768 Check that an Emacs fixnum is in range before assigning it to 'int'.
11769 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11770 values converted from Emacs fixnums.
11771 (Frecenter): Don't wrap around a line count if it is out of 'int'
11772 range; instead, treat it as an extreme value.
11773 (Fset_window_configuration, compare_window_configurations):
11774 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11775
6511acf2
PE
11776 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11777 that can exceed INT_MAX. Check that EMACS_INT value is in range
11778 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
11779 (match_limit): Don't assume that a fixnum can fit in 'int'.
11780
6511acf2 11781 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
11782 exceed INT_MAX.
11783
6511acf2 11784 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
11785 (Fvertical_motion): Don't wrap around LINES values that don't fit
11786 in 'int'. Instead, treat them as extreme values. This is good
11787 enough for windows, which can't have more than INT_MAX lines anyway.
11788
fcb901a7
LMI
117892011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11790
0f2f6b6d
LMI
11791 * Require libxml/parser.h to avoid compilation warning.
11792
fcb901a7
LMI
11793 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11794
11795 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11796 since this reportedly can destroy thread storage.
11797
6e20a0d4
CY
117982011-08-30 Chong Yidong <cyd@stupidchicken.com>
11799
11800 * syntax.c (find_defun_start): Update all cache variables if
11801 exiting early (Bug#9401).
11802
148ae00e
EZ
118032011-08-30 Eli Zaretskii <eliz@gnu.org>
11804
f6cfbd8f
EZ
11805 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11806
148ae00e
EZ
11807 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11808 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11809 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11810
11811 * term.c (tty_append_glyph): New function.
11812 (produce_stretch_glyph): Static function and its prototype deleted.
11813
a66cfb1c
SM
11814 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11815 Add prototypes.
148ae00e 11816
c4a07a4c
PE
118172011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11818
11819 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11820 when checking :margin (Bug#9390).
11821 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 11822 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
11823 so that the name doesn't mislead. All uses changed.
11824
6bc8cd65
JB
118252011-08-28 Johan Bockgård <bojohan@gnu.org>
11826
11827 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11828 set_tty_hooks.
11829
dca4927e
EZ
118302011-08-27 Eli Zaretskii <eliz@gnu.org>
11831
11832 * xdisp.c (move_it_to): Don't bail out early when reaching
11833 position beyond to_charpos, if we are scanning backwards.
11834 (move_it_vertically_backward): When DY == 0, make sure we get to
11835 the first character in the line after the newline.
11836
f2cad773
PE
118372011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11838
11839 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11840 (ccl_driver): Do not generate an out-of-range pointer.
11841 (Fccl_execute_on_string): Remove unnecessary check for
11842 integer overflow, noted by Stefan Monnier in
11843 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11844 Remove a FIXME that didn't need fixing.
11845 Simplify the newly-introduced buffer reallocation code.
11846
0cae2cdb
JB
118472011-08-27 Juanma Barranquero <lekktu@gmail.com>
11848
11849 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11850
5fc295a4 118512011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 11852
70c60eb2 11853 Integer and memory overflow issues (Bug#9196).
726e0ab1 11854
d31850da
PE
11855 * doc.c (get_doc_string): Rework so that
11856 get_doc_string_buffer_size is the actual buffer size, rather than
11857 being 1 less than the actual buffer size; this makes xpalloc more
11858 convenient.
11859
a69fbedb
PE
11860 * image.c (x_allocate_bitmap_record, cache_image):
11861 * xselect.c (Fx_register_dnd_atom):
11862 Simplify previous changes by using xpalloc.
11863
fe5c5d37
PE
11864 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11865 since either will do and ptrdiff_t is convenient with xpalloc.
11866
0065d054
PE
11867 * charset.c (charset_table_size)
11868 (struct charset_sort_data.priority): Now ptrdiff_t.
11869 (charset_compare): Don't overflow if priorities differ greatly.
11870 (Fsort_charsets): Don't assume list length fits in int.
11871 Check for size-calculation overflow when allocating sort data.
11872 (syms_of_charset): Allocate an initial charset table that is
11873 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11874
11875 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11876
11877 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11878 The actual value is always <= INT_MAX, and leaving it unsigned made
11879 overflow checking harder.
11880
11881 * dispextern.h (struct glyph_matrix.rows_allocated)
11882 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11883 with xpalloc. The values are still always <= INT_MAX.
11884
11885 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11886
11887 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11888 (SAFE_NALLOCA): New macro.
11889
11890 * region-cache.c (struct boundary.pos, find_cache_boundary)
11891 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11892 (set_cache_region, invalidate_region_cache)
11893 (revalidate_region_cache, know_region_cache, region_cache_forward)
11894 (region_cache_backward, pp_cache):
11895 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11896 so that ptrdiff_t * can be passed to xpalloc.
11897 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11898 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11899 (pp_cache): Don't assume cache_len fits in int.
11900 * region-cache.h: Adjust extern decls to match.
11901
11902 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11903 EMACS_INT, since either will do, for xpalloc.
11904
11905 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11906 (xnmalloc, xnrealloc, xpalloc): New functions.
11907
726e0ab1
PE
11908 * bidi.c (bidi_shelve_header_size): New constant.
11909 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11910 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11911
51f30bc5 11912 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
11913 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11914 (overlay_strings):
11915 Don't update size of array until after memory allocation succeeds,
11916 because xmalloc/xrealloc may not return.
0065d054
PE
11917 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11918 now that we have proper integer overflow checking.
11919 (record_overlay_string, overlay_strings): Catch overflows when
11920 calculating size of overlay_str_buf.
726e0ab1 11921
0065d054
PE
11922 * callproc.c (Fcall_process): Check for size overflow when
11923 calculating size of args2.
11924 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11925 Normally we prefer signed values, but sticking with ptrdiff_t would
11926 require adding more-complicated checks.
726e0ab1
PE
11927
11928 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11929 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11930 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 11931 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
11932
11933 * character.c (Fstring): Check for size-calculation overflow.
11934
11935 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11936 unnecessary integer overflow. Check for size overflow.
11937 (encode_coding_object): Don't update size until xmalloc succeeds.
11938
11939 * composite.c (get_composition_id): Check for overflow in glyph
11940 length calculations.
11941
11942 Integer and memory overflow fixes for display code.
11943 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11944 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11945 (scrolling_window): Check for overflow in size calculations.
11946 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11947 Don't assume glyph table len fits in int.
11948 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11949 (row_table_size): Now ptrdiff_t, not int.
11950 (scrolling_window): Avoid overflow in size calculations.
11951 Don't update size until allocation succeeds.
11952 * fns.c (concat): Check for overflow in size calculations.
11953 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11954 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11955 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11956
11957 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11958 (get_doc_string): Check for size calculation overflow.
11959 Don't update size until allocation succeeds.
11960 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11961 EMACS_INT, where ptrdiff_t will do.
11962 (Fsubstitute_command_keys): Check for string overflow.
11963
11964 * editfns.c (set_time_zone_rule): Don't assume environment length
11965 fits in int.
11966 (message_length): Now ptrdiff_t, not int.
11967 (Fmessage_box): Don't update size until allocation succeeds.
11968 Don't assume message length fits in int.
11969 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11970
0065d054
PE
11971 * emacs.c (main): Do not reallocate argv, since there is a null at
11972 the end that can be overwritten, and this way there's no need to
11973 worry about size-calculation overflow.
11974 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11975
11976 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11977 alloc succeeds.
11978 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11979
11980 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11981 (x_set_scroll_bar_width, x_figure_window_size):
11982 Check for integer overflow.
11983 (x_set_alpha): Do not assume XINT fits in int.
11984
11985 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11986 This is for the members text_lines, text_cols, total_lines, total_cols,
11987 where the system imposes an 'int' limit.
11988
11989 * fringe.c (Fdefine_fringe_bitmap):
11990 Don't update size until alloc works.
11991
11992 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11993 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11994
11995 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11996 Check for size-calculation overflow.
11997 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11998 do, as we prefer signed integers.
11999 (id_to_widget.max_size, id_to_widget.used)
12000 (xg_store_widget_in_map, xg_remove_widget_from_map)
12001 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12002 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12003 Use and return ptrdiff_t, not int.
12004 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12005 * gtkutil.h: Change prototypes to match the above.
12006
12007 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12008 are duplicate now that they've been promoted to lisp.h.
12009 (x_allocate_bitmap_record, x_alloc_image_color)
12010 (make_image_cache, cache_image, xpm_load):
12011 Don't update size until alloc is done.
12012 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12013 (x_detect_edges):
3256efce 12014 Check for size calculation overflow.
726e0ab1
PE
12015 (ct_colors_allocated_max): New constant.
12016 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12017 overflow.
3256efce 12018
726e0ab1
PE
12019 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12020 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12021 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12022 Use ptrdiff_t, not int, to count maps.
12023 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
12024 calculations. Don't update size until allocation succeeds.
12025 Redo calculations to avoid overflow.
726e0ab1
PE
12026 * keyboard.h: Change prototypes to match the above.
12027
12028 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12029 to count maps.
12030 (current_minor_maps): Check for size calculation overflow.
12031 * keymap.h: Change prototypes to match the above.
12032
12033 * lread.c (read1, init_obarray): Don't update size until alloc done.
12034
12035 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12036 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12037
726e0ab1
PE
12038 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12039 Now ptrdiff_t, not int.
12040 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12041 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12042
12043 * process.c (Fnetwork_interface_list): Check for overflow
12044 in size calculation.
12045
12046 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12047
12048 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12049 overflow. Don't bother calling xmalloc when xrealloc will do.
12050
12051 * search.c (Freplace_match): Check for size calculation overflow.
12052 (Fset_match_data): Don't assume list lengths fit in 'int'.
12053
12054 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12055 for command line length. Do not attempt to address one before the
12056 beginning of an array, as that's not portable.
12057
12058 * term.c (max_frame_lines): Remove; unused.
12059 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12060 not int.
12061 (encode_terminal_code, calculate_costs): Check for size
12062 calculation overflow.
12063 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12064 table lengths and related sizes. Don't update size until alloc
12065 done. Redo calculations to avoid overflow.
12066 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12067
12068 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12069 subtracting pointers.
12070 (gobble_line): Check for overflow more carefully. Don't update size
12071 until alloc done.
12072
12073 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12074 Don't update size until alloc done.
12075 Redo size calculations to avoid overflow.
12076 Check for size calculation overflow.
0065d054 12077 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
12078
12079 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12080 Use ptrdiff_t, not int, for sizes.
12081 (store_mode_line_noprop_char): Don't update size until alloc done.
12082
0065d054
PE
12083 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12084 Use ptrdiff_t, not int, for sizes.
12085 (Finternal_make_lisp_face, cache_face):
12086 Check for size calculation overflow.
12087 (cache_face): Treat size calculation overflows as if they were
12088 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
12089
12090 * xfns.c (x_encode_text, x_set_name_internal)
12091 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12092 sizes, since they can exceed INT_MAX in size. Check for size
12093 calculation overflow.
12094
0065d054
PE
12095 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12096 (xg_select): Check for size calculation overflow.
726e0ab1
PE
12097 Don't update size until alloc done.
12098
0065d054 12099 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 12100 as sprintf is limited to int lengths.
1d526e2f 12101
252c5ee1
PE
12102 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12103 (X_LONG_MIN): New macros.
864d7ce7
PE
12104 Use them to make the following changes clearer.
12105 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12106 This change doesn't affect the value now, but it may help remind
12107 future maintainers not to raise the value too much later.
12108 (SELECTION_QUANTUM): Remove, replacing with ...
12109 (selection_quantum): ... new function, which avoids overflow.
12110 All uses changed.
12111 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12112 assumption that selection length fits in 'int'.
12113 (x_reply_selection_request, x_handle_selection_request)
12114 (x_get_window_property, receive_incremental_selection)
12115 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12116 (lisp_data_to_selection_data, clean_local_selection_data):
12117 Use ptrdiff_t, not int, to record length of selection.
12118 (x_reply_selection_request, x_get_window_property)
12119 (receive_incremental_selection, x_property_data_to_lisp):
12120 Redo calculations to avoid overflow.
12121 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 12122 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
12123 something.
12124 (x_get_window_property, receive_incremental_selection)
12125 (lisp_data_to_selection_data, x_property_data_to_lisp):
12126 Check for size-calculation overflow.
12127 (x_get_window_property, receive_incremental_selection)
12128 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12129 Don't store size until memory allocation succeeds.
12130 (x_get_window_property): Plug memory leak on memory exhaustion.
12131 Don't double-block input; malloc is safe here. Don't assume 2**34
12132 - 4 fits in unsigned long. Add an xassert to check
12133 XGetWindowProperty overflow. Be more careful about overflow
12134 calculations, and distinguish size from memory overflow better.
12135 (receive_incremental_selection): When tracing, don't assume
12136 unsigned int is less than INT_MAX.
12137 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12138 harmful) conversions of unsigned short to int.
12139 (lisp_data_to_selection_data): Don't assume that integers
12140 in the range -65535 through -1 fit in an X unsigned short.
12141 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12142 result parameters unless successful. Rely on cons_to_unsigned
12143 to report problems with elements; the old code wasn't right anyway.
12144 (x_check_property_data): Check for int overflow; we cannot use
12145 a wider type due to X limits.
12146 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12147
726e0ab1 12148 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 12149
0065d054
PE
12150 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12151 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
12152 (x_color_cells): Don't store size until memory allocation succeeds.
12153 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 12154 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
12155 (x_term_init): Don't assume length fits in int (sprintf is limited
12156 to int size).
bc18e09d 12157
ebfa62c0
PE
12158 Use ptrdiff_t for composition IDs.
12159 * character.c (lisp_string_width):
12160 * composite.c (composition_table_size, n_compositions)
12161 (get_composition_id, composition_gstring_from_id):
12162 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12163 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12164 * window.c (Frecenter):
12165 Use ptrdiff_t, not int, for composition IDs.
12166 * composite.c (get_composition_id): Check for integer overflow.
12167 * composite.h: Adjust prototypes to match the above changes.
12168
d3411f89
PE
12169 Use ptrdiff_t for hash table indexes.
12170 * category.c (hash_get_category_set):
12171 * ccl.c (ccl_driver):
12172 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12173 * coding.c (coding_system_charset_list, detect_coding_system):
12174 * coding.h (struct coding_system.id):
12175 * composite.c (get_composition_id, gstring_lookup_cache):
12176 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12177 * image.c (xpm_get_color_table_h):
12178 * lisp.h (hash_lookup, hash_put):
12179 * minibuf.c (Ftest_completion):
12180 Use ptrdiff_t for hash table indexes, not int (which is too
12181 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12182 32-bit --with-wide-int hosts).
12183
e097a6fa
PE
12184 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12185 Add a FIXME comment about memory leaks.
12186 (syms_of_charset): Don't assume xmalloc returns.
12187
5637687f
PE
12188 Don't assume that stated character widths fit in int.
12189 * character.c (Fchar_width, c_string_width, lisp_string_width):
12190 * character.h (CHAR_WIDTH):
12191 * indent.c (MULTIBYTE_BYTES_WIDTH):
12192 Use sanitize_char_width to avoid undefined and/or bad behavior
12193 with outlandish widths.
a66cfb1c 12194 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
12195 now that we have two such functions. All uses changed.
12196 (sanitize_char_width): New inline function.
12197
a2271ba2
PE
12198 Don't assume that tab-width fits in int.
12199 * character.h (sanitize_width): New inline function.
12200 (SANE_TAB_WIDTH): New macro.
12201 (ASCII_CHAR_WIDTH): Use it.
12202 * indent.c (sane_tab_width): Remove. All uses replaced by
12203 SANE_TAB_WIDTH (current_buffer).
12204 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12205
18c52557
PE
12206 * fileio.c: Integer overflow issues with file modes.
12207 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12208
caeeedc1
PE
12209 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12210 Remove unreachable code.
12211 (read_hex, load_charset_map_from_file): Check for integer overflow.
12212
6df6ae42 12213 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
12214 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12215 (x_send_scroll_bar_event): Likewise. Check that the size does not
12216 exceed limits imposed by XClientMessageEvent, as well as the usual
12217 ptrdiff_t and size_t limits.
12218
b13995db
PE
12219 * keyboard.c: Overflow, signedness and related fixes.
12220 (make_lispy_movement): Use same integer type in forward decl
12221 that is used in the definition.
12222 (read_key_sequence, keyremap_step):
12223 Change bufsize argument back to int, undoing my 2011-03-30 change.
12224 We prefer signed types, and int is wide enough here.
12225 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12226 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12227 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12228 length, not size_t. Use ptrdiff_t for index, not int.
12229 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12230 possibility of integer overflow.
12231
13464394
PE
12232 Overflow, signedness and related fixes for images.
12233
12234 * dispextern.h (struct it.stack[0].u.image.image_id)
12235 (struct_it.image_id, struct image.id, struct image_cache.size)
12236 (struct image_cache.used, struct image_cache.ref_count):
12237 * gtkutil.c (update_frame_tool_bar):
12238 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12239 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12240 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12241 * nsmenu.m (update_frame_tool_bar):
12242 * xdisp.c (calc_pixel_width_or_height):
12243 * xfns.c (image_cache_refcount):
12244 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12245 on typical 64-bit hosts.
12246
12247 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12248 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12249 Omit unnecessary casts to int.
12250 (parse_image_spec): Check that integers fall into 'int' range
12251 when the callers expect that.
12252 (image_ascent): Redo ascent calculation to avoid int overflow.
12253 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12254 (lookup_image): Remove unnecessary tests.
12255 (xbm_image_p): Locals are now of int, not EMACS_INT,
12256 since parse_image_check makes sure they fit into int.
12257 (png_load, gif_load, svg_load_image):
12258 Prefer int to unsigned where either will do.
12259 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
12260 old tiff_error_handler and tiff_warning_handler.
12261 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
12262 stack buffer overflows. It uses only the features of vsnprintf
12263 that are common to both POSIX and native Microsoft.
12264 (tiff_error_handler, tiff_warning_handler): Use it.
12265 (tiff_load, gif_load, imagemagick_load_image):
12266 Don't assume :index value fits in 'int'.
12267 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12268 (imagemagick_load_image): Check that crop parameters fit into
12269 the integer types that MagickCropImage accepts. Don't assume
12270 Vimagemagick_render_type has a nonnegative value. Don't assume
12271 size_t fits in 'long'.
12272 (gs_load): Use printmax_t to print the widest integers possible.
12273 Check for integer overflow when computing image height and width.
12274
c11821d4
EZ
122752011-08-26 Eli Zaretskii <eliz@gnu.org>
12276
12277 * xdisp.c (redisplay_window): Don't force window start if point
12278 will be invisible in the resulting window. (Bug#9324)
12279
0c95fcf7
EZ
122802011-08-25 Eli Zaretskii <eliz@gnu.org>
12281
12282 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12283 the display spec is of the form `(space ...)'.
12284 (handle_display_spec): Return the value returned by
12285 handle_single_display_spec, not just 1 or zero.
12286 (handle_single_display_spec): If the display spec is of the form
12287 `(space ...)', and specifies display in the text area, return 2
12288 rather than 1.
fee65a97 12289 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
12290 accurately, and prefer exact match for point under bidi.
12291 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
12292
12293 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12294 into disp_prop; all users changed.
12295
12296 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12297 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12298 for the text covered by the display property.
12299
e4ed06f1
CY
123002011-08-25 Chong Yidong <cyd@stupidchicken.com>
12301
12302 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12303 Change return value to nil.
12304 (Frecord_buffer): Delete unused function.
12305
f67cdd7f
EZ
123062011-08-24 Eli Zaretskii <eliz@gnu.org>
12307
5980d4c6
EZ
12308 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12309 buffers, return left-to-right.
8610fe8b
EZ
12310 (set_cursor_from_row): Consider candidate row a win if its glyph
12311 represents a newline and point is on that newline. Fixes cursor
12312 positioning on the newline at EOL of R2L text within L2R
12313 paragraph, and vice versa.
12314 (try_cursor_movement): Check continued rows, in addition to
12315 continuation rows. Fixes unwarranted scroll when point enters a
12316 continued line of R2L text within an L2R paragraph, or vice versa.
12317 (cursor_row_p): Consider the case of point being equal to
12318 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12319 from the end of a short line to the beginning of a continued line
12320 of R2L text within L2R paragraph.
12321 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12322 composed characters.
5980d4c6 12323
f67cdd7f
EZ
12324 * bidi.c (bidi_check_type): Use xassert.
12325 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12326 members.
12327
bca633fb
EZ
123282011-08-23 Eli Zaretskii <eliz@gnu.org>
12329
12330 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12331 a character.
12332
4a5885a7
CY
123332011-08-23 Chong Yidong <cyd@stupidchicken.com>
12334
12335 * nsfont.m (ns_otf_to_script): Fix typo.
12336
0902a04e
KH
123372011-08-22 Kenichi Handa <handa@m17n.org>
12338
12339 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12340 extra slot even if the purpose is char-code-property-table.
12341
1a2e6670
EZ
123422011-08-23 Eli Zaretskii <eliz@gnu.org>
12343
8ddde651
EZ
12344 * xdisp.c (redisplay_window): When computing centering_position,
12345 account for the height of the header line. (Bug#8874)
12346
425cc014
EZ
12347 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12348 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12349 candidate is selected by the mouse, and that candidate has a
12350 composed character under the mouse.
12351
1a2e6670
EZ
12352 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12353 coordinates reported by pos-visible-in-window-p for a composed
12354 character in column zero.
12355
8b76d6f8
SM
123562011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12357
12358 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12359
dac347dd
EZ
123602011-08-22 Eli Zaretskii <eliz@gnu.org>
12361
12362 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12363 consider it a hit if to_charpos is anywhere in the range of the
12364 composed buffer positions.
12365
e013fb34
CY
123662011-08-22 Chong Yidong <cyd@stupidchicken.com>
12367
12368 * image.c (gif_load): Don't assume that each subimage has the same
12369 dimensions as the base image. Handle disposal method that is
12370 "undefined" by the gif spec (Bug#9335).
12371
bd1ba3e8
CY
123722011-08-20 Chong Yidong <cyd@stupidchicken.com>
12373
12374 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 12375 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 12376
54a1215b
EZ
123772011-08-19 Eli Zaretskii <eliz@gnu.org>
12378
823564e5
EZ
12379 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12380 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12381 from an Org mode buffer to a Speedbar frame.
12382
54a1215b
EZ
12383 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12384 a composition, take its buffer position from IT->cmp_it.charpos.
12385 Fixes cursor positioning at the beginning of a line that begins
12386 with a composed character.
12387
9778ebcc
EZ
123882011-08-18 Eli Zaretskii <eliz@gnu.org>
12389
0be6ee06
EZ
12390 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12391 character bidirectional type, use STRONG_L instead. Fixes crashes
12392 in a buffer produced by `describe-categories'.
12393
9778ebcc
EZ
12394 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12395 members before the level stack, so they would be saved and
12396 restored when copying iterator state. Fixes incorrect reordering
12397 around TABs covered by display properties.
12398
156bffbe
AS
123992011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12400
6b02f655 12401 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 12402
72ad093b
CY
124032011-08-17 Chong Yidong <cyd@stupidchicken.com>
12404
12405 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
12406 (internal_condition_case_2, internal_condition_case_n):
12407 Remove unnecessary aborts (Bug#9081).
72ad093b 12408
35774242
EZ
124092011-08-17 Eli Zaretskii <eliz@gnu.org>
12410
12411 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12412 has no `load' handler, try opening the file locally. (Bug#9311)
12413
db76dd85
KB
124142011-08-16 Ken Brown <kbrown@cornell.edu>
12415
12416 * gmalloc.c: Expand comment.
12417
b215eee5
EZ
124182011-08-16 Eli Zaretskii <eliz@gnu.org>
12419
12420 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12421 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12422
a4579d33
KB
124232011-08-16 Ken Brown <kbrown@cornell.edu>
12424
12425 Fix memory allocation problems in Cygwin build (Bug#9273).
12426
12427 * unexcw.c ( __malloc_initialized): Declare external variable.
12428 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12429
8b76d6f8
SM
12430 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12431 New variables.
a4579d33
KB
12432 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12433 dumped emacs.
12434 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12435 in the static heap.
12436 [CYGWIN] (special_realloc): New function.
12437 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12438 requests to realloc storage in the static heap.
12439
3ebec551
PE
124402011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12441
12442 * bidi.c (bidi_initialize): Remove unused local.
12443
9fd8be00
EZ
124442011-08-15 Eli Zaretskii <eliz@gnu.org>
12445
6b02f655
SM
12446 * bidimirror.h:
12447 * biditype.h: Remove file.
12448 * makefile.w32-in ($(BLD)/bidi.$(O)):
12449 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
12450
12451 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12452
12453 * chartab.c: Improve commentary for the uniprop_table API.
12454
32413314
EZ
12455 * bidi.c (bidi_paragraph_init): Support zero value of
12456 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
12457 (bidi_initialize): Use uniprop_table instead of including
12458 biditype.h and bidimirror.h.
32413314 12459
9fd8be00
EZ
12460 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12461 coordinates of the iterator when restoring from ppos_it.
12462 (Bug#9296)
12463
5cf2b69b
KH
124642011-08-14 Kenichi Handa <handa@m17n.org>
12465
12466 * process.c (create_process): Call setup_process_coding_systems
72ad093b 12467 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 12468
daf17d00
EZ
124692011-08-14 Eli Zaretskii <eliz@gnu.org>
12470
12471 * xdisp.c (move_it_in_display_line_to): Don't invoke
12472 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12473 ppos_it. Fixes vertical cursor motion when line beginning is
12474 covered by an image. (Bug#9296)
12475
08e3161a
JD
124762011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12477
12478 * nsterm.h (ns_run_ascript): Declare.
12479 (NSAPP_DATA2_RUNASSCRIPT): Define.
12480
12481 * nsfns.m (as_script, as_result, as_status): New static variables.
12482 (ns_run_ascript): New function.
5e617bc2 12483 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
12484 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12485 the event loop. Get status from as_status (Bug#7276).
12486
12487 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12488 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12489 the event loop (Bug#7276).
12490
a3720aa2
AS
124912011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12492
12493 * gnutls.c (QCgnutls_bootprop_priority)
12494 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12495 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12496 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12497 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12498 (QCgnutls_bootprop_verify_hostname_error)
12499 (QCgnutls_bootprop_callbacks_verify): Rename from
12500 Qgnutls_bootprop_..., all uses changed.
12501
12502 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12503 uses changed.
12504
0a0d27fb
PE
125052011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12506
19d5c50c
PE
12507 * xfaces.c (Qframe_set_background_mode): Now static.
12508 * dispextern.h (Qframe_set_background_mode): Remove decl.
12509
0a0d27fb
PE
12510 * process.c (Fnetwork_interface_info): Declare local only if needed.
12511
377538cb
JD
125122011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12513
12514 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12515 (Fnetwork_interface_list): Allocate in increments of bytes instead
12516 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12517 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12518 sockaddr.
12519 (struct ifflag_def): notrailers is smart on OSX.
12520 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12521 Get hardware address with getifaddrs if available.
12522
08fff70c
EZ
125232011-08-12 Eli Zaretskii <eliz@gnu.org>
12524
12525 * xdisp.c (iterate_out_of_display_property): xassert that
12526 IT->position is set to within IT->object's boundaries. Break from
12527 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
12528 when IT->position is set up wrongly due to some bug.
12529 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
12530 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12531 entry. Force push_it to save on the stack the current
12532 buffer/string position, to be restored by pop_it. Fix flags in
12533 the iterator structure wrt the object coming from a display
12534 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12535 properties. (Bug#9284)
12536
7be1c708 125372011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 12538
7be1c708
CY
12539 * fontset.c (fontset_get_font_group): Add proper type checks.
12540 (Bug#9172)
aac0c6e3 12541
7be1c708 125422011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 12543
7be1c708
CY
12544 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12545 and LC_VERSION_MIN_MACOSX.
12546 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12547 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 12548
97bb72a6
EZ
125492011-08-08 Eli Zaretskii <eliz@gnu.org>
12550
12551 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
12552 no-display-properties-and-no-overlays under bidi display.
12553 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 12554 properties and overlays.
97bb72a6 12555
d5617611
CY
125562011-08-08 Chong Yidong <cyd@stupidchicken.com>
12557
37e11a63
CY
12558 * editfns.c (Fset_time_zone_rule): Document relationship with the
12559 setenv function.
12560
d5617611
CY
12561 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12562 the font entity extracted from the cache (Bug#8109).
12563
58872834
CY
125642011-08-07 Chong Yidong <cyd@stupidchicken.com>
12565
12566 * composite.c (autocmp_chars): Don't reset point. That is done by
12567 restore_point_unwind (Bug#5984).
12568
75bfc667
JL
125692011-08-07 Juri Linkov <juri@jurta.org>
12570
12571 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12572 to show the arg `TIME' instead of `TIMEVAL'.
12573
d1410150
EZ
125742011-08-06 Eli Zaretskii <eliz@gnu.org>
12575
12576 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12577 display property strides EOL and includes a newline, as in
12578 longlines-mode. (Bug#9254)
75b771e4
EZ
12579 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12580 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
12581
12582 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12583 is non-zero, even if the data buffer is NULL. Fixes a crash in
12584 vertical-motion with longlines-mode. (Bug#9254)
12585
35928349
EZ
125862011-08-05 Eli Zaretskii <eliz@gnu.org>
12587
ec7cc85b
EZ
12588 * bidi.c <bidi_cache_total_alloc>: Now static.
12589 (bidi_initialize): Initialize bidi_cache_total_alloc.
12590
8b76d6f8 12591 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
12592 cache. (Bug#9221)
12593
12594 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12595 amount allocated this far in `bidi_cache_total_alloc'.
12596 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12597 non-zero, only free the data buffer without restoring the cache
12598 contents. All callers changed.
12599
12600 * dispextern.h (bidi_unshelve_cache): Update prototype.
12601
12602 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12603 (move_it_in_display_line, move_it_to)
12604 (move_it_vertically_backward, move_it_by_lines): Replace the call
12605 to xfree to an equivalent call to bidi_unshelve_cache.
12606 (move_it_in_display_line_to): Fix logic of returning
412b6358 12607 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 12608
e2e2423b
EZ
126092011-08-05 Eli Zaretskii <eliz@gnu.org>
12610
12611 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12612 came from a string character with a `cursor' property. (Bug#9229)
12613
ae9e757a
JD
126142011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12615
12616 * Makefile.in (LIB_PTHREAD): New variable.
12617 (LIBES): Add LIB_PTHREAD (Bug#9216).
12618
12619 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12620 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12621
213bd7f2
AS
126222011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12623
6b02f655 12624 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 12625
99aaf75f
JD
126262011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12627
12628 * xterm.c (x_find_topmost_parent): New function.
12629 (x_set_frame_alpha): Find topmost parent window with
12630 x_find_topmost_parent and set the property there also (bug#9181).
12631 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12632
c74e9d86
PE
126332011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12634
12635 * callproc.c (Fcall_process): Avoid vfork clobbering
12636 the local vars buffer, coding_systems, current_dir.
12637
640c8776
SM
126382011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12639
12640 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12641
f26d0e4c
PE
126422011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12643
8a10d76c
PE
12644 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12645 so that it is not optimized away.
12646
f26d0e4c
PE
12647 * xdisp.c (compute_display_string_pos): Remove unused local.
12648
55439c61
EZ
126492011-08-02 Eli Zaretskii <eliz@gnu.org>
12650
12651 Fix slow cursor motion and scrolling in large buffers with
12652 selective display, like Org Mode buffers. (Bug#9218)
12653
12654 * dispextern.h (struct bidi_it): New member disp_prop_p.
12655
12656 * xdisp.c: Remove one-slot cache of display string positions.
12657 (compute_display_string_pos): Accept an additional argument
5e617bc2 12658 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
12659 for a display string or property. If found, set DISP_PROP_P
12660 non-zero.
12661
12662 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
12663 DISP_PROP_P, and pass it to compute_display_string_pos.
12664 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
12665 non-zero. All callers of bidi_fetch_char changed.
12666
fb33fa43
SM
126672011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12668
12669 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12670
b099e063
DM
126712010-12-03 Don March <don@ohspite.net>
12672
12673 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12674 last character M-[char] is translated to ESC [char] (bug#7541).
12675
5cc7f7af
KH
126762011-08-02 Kenichi Handa <handa@m17n.org>
12677
d0fffa3f 12678 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
12679
12680 * chartab.c (uniprop_table): Make it non-static.
12681
525d5e6e
EZ
126822011-08-01 Eli Zaretskii <eliz@gnu.org>
12683
12684 * xdisp.c (forward_to_next_line_start): Accept additional argument
12685 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12686 on the newline.
12687 (reseat_at_next_visible_line_start): Use the bidi iterator state
12688 returned by forward_to_next_line_start to restore the state of
12689 it->bidi_it after backing up to previous newline. (Bug#9212)
12690
31011111
AS
126912011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12692
12693 * regex.c (re_comp): Protoize.
12694 (re_exec): Fix return type.
12695 (regexec): Fix type of `ret'. (Bug#9203)
12696
476371c4
PE
126972011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12698
e5d76069
PE
12699 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12700 This is needed if max-image-size is a floating-point number.
12701
9a79b20c
AS
127022011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12703
12704 * print.c (print_object): Print empty symbol as ##.
12705
12706 * lread.c (read1): Read ## as empty symbol.
12707
d8c2fa78
AA
127082011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12709
12710 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12711 setting frame foreground color (Bug#9175).
12712 (x_set_background_color): Likewise.
12713
ffe57a7a
AA
12714 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12715 contents (Bug#9176).
12716 (EmacsTooltip -init): Remove bezels and add shadows to
12717 tooltip windows.
12718
bf3492a5
AA
12719 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12720 or scroll bar (Bug#8470).
12721
d55e9c53
AA
12722 * nsfont.m (nsfont_open): Remove assignment to voffset and
12723 unnecessary vars hshink, expand, hd, full_height, min_height.
12724 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12725
12726 * nsterm.h (nsfont_info): Remove voffset field.
12727
d8c2fa78 127282011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
12729
12730 Implement strike-through and overline on NextStep (Bug#8863).
12731
12732 * nsfont.m (nsfont_open): Use underline position provided by font,
12733 instead of hard-coded value of 2.
12734 (nsfont_draw): Call ns_draw_text_decoration instead.
12735
12736 * nsterm.h: Add declaration for ns_draw_text_decoration.
12737
12738 * nsterm.m (ns_draw_text_decoration): New function for drawing
12739 underline, overline, and strike-through.
12740 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12741 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 12742 accommodate underlining, etc.
4843aac3 12743
4cc60b9b
EZ
127442011-07-28 Eli Zaretskii <eliz@gnu.org>
12745
bc7ece87
EZ
12746 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12747 default.
4cc60b9b 12748
476371c4
PE
127492011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12750
66606eea
PE
12751 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12752 Without this fix, if a signal arrives just after memory fills up,
12753 'malloc' might be invoked reentrantly.
12754
476371c4
PE
12755 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12756 In other words, assume that every image size is allowed, on non-X
12757 hosts. This assumption is probably wrong, but it lets Emacs compile.
12758
f3fcc40d
AS
127592011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12760
12761 * regex.c (re_iswctype): Convert return values to boolean.
12762
350c992f
EZ
127632011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12764
12765 * xdisp.c (compute_display_string_pos): Don't use cached display
12766 string position if the buffer had its restriction changed.
12767 (Bug#9184)
12768
5266b4bb
PE
127692011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12770
12771 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12772
2573a837 127732011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 12774
41f55ccd 12775 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 12776
39e378da
PE
12777 * bidi.c: Integer size and overflow fixes.
12778 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12779 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12780 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12781 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12782 (bidi_find_other_level_edge):
12783 Use ptrdiff_t instead of EMACS_INT where either will do.
12784 This works better on 32-bit hosts configured --with-wide-int.
12785 (bidi_cache_ensure_space): Check for size-calculation overflow.
12786 Use % rather than repeated addition, for better worst-case speed.
12787 Don't set bidi_cache_size until after xrealloc returns, because it
12788 might not return.
12789 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
12790 (bidi_cache_ensure_space): Also check that the bidi cache size
12791 does not exceed that of the largest Lisp string or buffer. See Eli
12792 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 12793
5e927815
PE
12794 * alloc.c (__malloc_size_t): Remove.
12795 All uses replaced by size_t. See Andreas Schwab's note
12796 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12797
ca4aa935
PE
12798 * image.c: Improve checking for integer overflow.
12799 (check_image_size): Assume that f is nonnull, since
12800 it is always nonnull in practice. This is one less thing to
12801 worry about when checking for integer overflow later.
12802 (x_check_image_size): New function, which checks for integer
12803 overflow issues inside X.
12804 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12805 This removes the need for a memory_full check.
12806 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12807 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12808 (xbm_read_bitmap_data): Change locals back to 'int', since
12809 their values must fit in 'int'.
12810 (xpm_load_image, png_load, tiff_load):
12811 Invoke x_create_x_image_and_pixmap earlier,
12812 to avoid much needless work if the image is too large.
12813 (tiff_load): Treat overly large images as if
12814 x_create_x_image_and_pixmap failed, not as malloc failures.
12815 (gs_load): Use x_check_image_size.
12816
5f8f9cc2
PE
12817 * gtkutil.c: Omit integer casts.
12818 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12819 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12820
5adf60bc
PE
12821 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12822
c8907a93
PE
12823 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12824 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12825 would wrongly return t on a 64-bit host.
12826
e3c25c68
PE
12827 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12828 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12829 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12830 and therefore cause GCC to emit a bogus diagnostic in some cases.
12831
3f791afe
PE
12832 * image.c: Integer signedness and overflow and related fixes.
12833 This is not an exhaustive set of fixes, but it's time to
12834 record what I've got.
12835 (lookup_pixel_color, check_image_size): Remove redundant decls.
12836 (check_image_size): Don't assume that arbitrary EMACS_INT values
12837 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12838 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12839 (tiff_load, imagemagick_load_image):
12840 Check for overflow in size calculations.
12841 (x_create_x_image_and_pixmap): Remove unnecessary test for
12842 xmalloc returning NULL; that can't happen.
12843 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12844 (xpm_color_bucket): Use better integer hashing function.
12845 (xpm_cache_color): Don't possibly over-allocate memory.
12846 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12847 (gif_memory_source):
12848 Use ptrdiff_t, not int or size_t, to record sizes.
12849 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12850 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12851 either works, as we prefer signed integers.
12852 (tiff_read_from_memory, tiff_write_from_memory):
12853 Return tsize_t, not size_t, since that's what the TIFF API wants.
12854 (tiff_read_from_memory): Don't fail simply because the read would
12855 go past EOF; instead, return a short read.
12856 (tiff_load): Omit no-longer-needed casts.
12857 (Fimagemagick_types): Don't assume size fits into 'int'.
12858
3cc5a532
PE
12859 Improve hashing quality when configured --with-wide-int.
12860 * fns.c (hash_string): New function, taken from sxhash_string.
12861 Do not discard information about ASCII character case; this
12862 discarding is no longer needed.
12863 (sxhash-string): Use it. Change sig to match it. Caller changed.
12864 * lisp.h: Declare it.
12865 * lread.c (hash_string): Remove, since we now use fns.c's version.
12866 The fns.c version returns a wider integer if --with-wide-int is
12867 specified, so this should help the quality of the hashing a bit.
12868
b312a492
PE
12869 * emacs.c: Integer overflow minor fix.
12870 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12871 Define only if GNU_LINUX.
12872 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12873
dfd153ae
PE
12874 * dispnew.c: Integer signedness and overflow fixes.
12875 Remove unnecessary forward decls, that were a maintenance hassle.
12876 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12877 All uses changed.
12878 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12879 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12880 (prepare_desired_row, line_draw_cost):
12881 Use int, not unsigned, where either works.
12882 (save_current_matrix, restore_current_matrix):
12883 Use ptrdiff_t, not size_t, where either works.
12884 (init_display): Check for overflow more accurately, and without
12885 relying on undefined behavior.
12886
a81d11a3
PE
12887 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12888 Remove, replacing with the new symbols in lisp.h. All uses changed.
12889 * fileio.c (make_temp_name):
12890 * filelock.c (lock_file_1, lock_file):
12891 * xdisp.c (message_dolog):
12892 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12893 Use pMd etc. instead.
12894 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12895 replacing the pWIDE etc. symbols removed from editfns.c.
12896
3300e6fd
PE
12897 * keyboard.h (num_input_events): Now uintmax_t.
12898 This is (very slightly) less likely to mess up due to wraparound.
12899 All uses changed.
12900
fd05c7e9
PE
12901 * buffer.c: Integer signedness fixes.
12902 (alloc_buffer_text, enlarge_buffer_text):
12903 Use ptrdiff_t rather than size_t when either will do, as we prefer
12904 signed integers.
12905
903fe15d
PE
12906 * alloc.c: Integer signedness and overflow fixes.
12907 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12908 (__malloc_size_t): Default to size_t, not to int.
12909 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12910 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12911 Prefer ptrdiff_t to size_t when either would do, as we prefer
12912 signed integers.
12913 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12914 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12915 Now const. Initialize with values that are in range even if char
12916 is signed.
12917 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12918 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12919 These functions do the right thing with sizes > 2**32.
12920 (check_depth): Now ptrdiff_t, not int.
12921 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12922 Adjust to new way of storing sizes. Check for size overflow bugs
12923 in rest of code.
12924 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12925 slightly wrong anyway, as it missed one instance of
12926 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12927 (refill_memory_reserve): Omit needless cast to size_t.
12928 (mark_object_loop_halt): Mark as externally visible.
12929
ac82cc6a
PE
12930 * xselect.c: Integer signedness and overflow fixes.
12931 (Fx_register_dnd_atom, x_handle_dnd_message):
12932 Use ptrdiff_t, not size_t, since we prefer signed.
12933 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12934 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12935 x_dnd_atoms_size and x_dnd_atoms_length.
12936
c2d1e36d
PE
12937 * doprnt.c: Prefer signed to unsigned when either works.
12938 * eval.c (verror):
12939 * doprnt.c (doprnt):
12940 * lisp.h (doprnt):
12941 * xdisp.c (vmessage):
12942 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12943 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12944 prefer signed arithmetic to avoid comparison confusion.
12945 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12946 but is a bit tricky.
12947
0e926e56
PE
12948 Assume freestanding C89 headers, string.h, stdlib.h.
12949 * data.c, doprnt.c, floatfns.c, print.c:
12950 Include float.h unconditionally.
12951 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12952 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12953 * regex.c: Likewise for stddef.h, string.h.
12954 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12955 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12956 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12957 (STDC_HEADERS): Remove obsolete defines.
12958 * sysdep.c: Include limits.h unconditionally.
12959
9cfdb3ec
PE
12960 Assume support for memcmp, memcpy, memmove, memset.
12961 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12962 * regex.c (memcmp, memcpy):
12963 Remove; we assume C89 now.
12964
12965 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12966 (__malloc_safe_bcopy): Remove; no longer needed.
12967
cf950e6b 12968 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12969 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12970 well either way, and we prefer signed to unsigned.
12971
dbf38e02
LMI
129722011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12973
12974 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12975 closes the connection while we're reading (bug#9182).
12976
d6f0886c 129772011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12978
d6f0886c
JD
12979 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12980 are specified (Bug#9168).
24e0f6b1 12981
2eb1f9e6
PE
129822011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12983
12984 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12985 Found by GCC static checking and --with-wide-int on a 32-bit host.
12986
22381272 129872011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12988
12989 * xdisp.c (compute_display_string_pos): Fix logic of caching
12990 previous display string position. Initialize cached_prev_pos to
12991 -1. Fixes slow-down at the beginning of a buffer.
12992
f25e39b4
EZ
129932011-07-24 Eli Zaretskii <eliz@gnu.org>
12994
12995 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12996 for attrs[LFACE_FONTSET_INDEX].
12997
04c4b52e
PE
129982011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12999
13000 * xml.c (parse_region): Remove unused local
13001 that was recently introduced.
13002
c1734fbd
EZ
130032011-07-23 Eli Zaretskii <eliz@gnu.org>
13004
be18c5a5
EZ
13005 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13006 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13007
c1734fbd
EZ
13008 * xdisp.c (move_it_in_display_line_to): Record the best matching
13009 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
13010 exit if none of the characters scanned was an exact match.
13011 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
13012 when exact match is impossible due to invisible text, and the
13013 lines are truncated.
13014
a258d627
JD
130152011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13016
13017 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13018 for OSX >= 10.7.
13019
b6d5a689
EZ
130202011-07-22 Eli Zaretskii <eliz@gnu.org>
13021
0f74f785
EZ
13022 Fix a significant slow-down of cursor motion with C-n, C-p,
13023 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13024 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 13025 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
13026 (next_element_from_buffer): Call compute_stop_pos_backwards to
13027 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
13028 base_level_stop.
13029 (reseat): Don't look for prev_stop, as that could mean a very long
13030 run.
13031 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13032 <cached_disp_overlay_modiff>: Cache for last found display string
13033 position.
551918c1 13034 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
13035 about the same buffer in the same area of character positions, and
13036 the buffer wasn't changed since the time the display string
13037 position was cached.
551918c1 13038
b2d0c91a
EZ
130392011-07-22 Eli Zaretskii <eliz@gnu.org>
13040
13041 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13042 is an integer, which is important for empty lines. (Bug#9149)
13043
043604ee
CY
130442011-07-22 Chong Yidong <cyd@stupidchicken.com>
13045
13046 * frame.c (Fmodify_frame_parameters): In tty case, update the
13047 default face if necessary (Bug#4238).
13048
da4adb04
CY
130492011-07-21 Chong Yidong <cyd@stupidchicken.com>
13050
13051 * editfns.c (Fstring_to_char): No need to explain what a character
13052 is in the docstring (Bug#6576).
13053
9abd0532
LMI
130542011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13055
13056 * xml.c (parse_region): Make sure we always return a tree.
13057
36881d16
HK
130582011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13059
13060 * xml.c (parse_region): If a document contains only comments,
13061 return that, too.
13062
1e98674d
LMI
130632011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13064
13065 * xml.c (make_dom): Return comments, too.
13066
590bd467
PE
130672011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13068
13069 Port to OpenBSD.
13070 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13071 and the surrounding thread.
13072 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13073 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13074 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13075 timer goes off.
13076 * s/openbsd.h (BROKEN_SIGIO): Define.
13077 * unexelf.c (unexec) [__OpenBSD__]:
13078 Don't update the .mdebug section of the Alpha COFF symbol table.
13079
f41628b2
LMI
130802011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13081
13082 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13083 (bug#8460).
13084
b59b67c5
PE
130852011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13086
15e3a074
PE
13087 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13088 This fixes some race conditions on the permissions of any newly
13089 created file.
13090
41bed37d
PE
13091 * alloc.c (valid_pointer_p): Use pipe, not open.
13092 This fixes some permissions issues when debugging.
13093
b59b67c5
PE
13094 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13095 If fchown fails to set both uid and gid, try to set just gid,
13096 as that is sometimes allowed. Adjust the file's mode to eliminate
13097 setuid or setgid bits that are inappropriate if fchown fails.
13098
925a6be7
SM
130992011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13100
13101 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13102 to compare Lisp_Objects.
13103 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13104 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13105 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13106
52968808
AS
131072011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13108
0a6a104b
AS
13109 * lread.c (read_integer): Unread even EOF character.
13110 (read1): Likewise. Properly record start position of symbol.
13111
52968808
AS
13112 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13113 symbol character follows.
13114
9e381cdd
PE
131152011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13116
13117 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13118 This works around a problem with the previous change to Fcopy_file.
13119 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13120 and without this change, GCC might complain about discarding
13121 fchown's return value.
13122
b5641435
JB
131232011-07-16 Juanma Barranquero <lekktu@gmail.com>
13124
13125 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13126
a8031457
PE
131272011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13128
13129 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13130
dd889327
LMI
131312011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13132
750c33f7
LMI
13133 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13134 it's used from the C level.
13135
dd889327
LMI
13136 * process.c: Use the same condition for POLL_FOR_INPUT in both
13137 keyboard.c and process.c (bug#1858).
13138
87e86684
LM
131392011-07-09 Lawrence Mitchell <wence@gmx.li>
13140
13141 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13142 (Fgnutls_boot): Use it.
13143
64348f40
AS
131442011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13145
13146 * doc.c (Fsubstitute_command_keys): Revert last change.
13147
1d698799
LMI
131482011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13149
f863868c
LMI
13150 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13151 quotes the next character, and doesn't affect other longer
13152 sequences (bug#8935).
13153
1d698799
LMI
13154 * lread.c (syms_of_lread): Clarify that is isn't only
13155 `eval-buffer' and `eval-defun' that's affected by
13156 `lexical-binding' (bug#8460).
13157
aa4b6df6
EZ
131582011-07-15 Eli Zaretskii <eliz@gnu.org>
13159
13160 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 13161 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 13162
5d856da6
PE
131632011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13164
ad6042bb
PE
13165 Fix minor problems found by static checking.
13166 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13167 (elsz): Now a signed constant, not a size_t var. We prefer signed
13168 types to unsigned, to avoid integer comparison confusion. Without
13169 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13170 "cannot optimize loop, the loop counter may overflow", a symptom
13171 of the confusion.
f00bbb22 13172 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
13173 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13174
6468f31c
LMI
131752011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13176
49080b10
LMI
13177 * search.c (Fre_search_backward): Mention `case-fold-search' in
13178 all the re_search_* functions (bug#8138).
13179
6468f31c
LMI
13180 * keyboard.c (Fopen_dribble_file): Document when the file is
13181 closed (bug#8056).
13182
c965adc5
EZ
131832011-07-14 Eli Zaretskii <eliz@gnu.org>
13184
df9733bf
EZ
13185 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13186 bidi_cache_idx.
13187
0bb23927
EZ
13188 Support bidi reordering of display and overlay strings.
13189 * xdisp.c (compute_display_string_pos)
13190 (compute_display_string_end): Accept additional argument STRING.
13191 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13192 (reseat_to_string): Initialize bidi_it->string.s and
13193 bidi_it->string.schars.
13194 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
13195 NULL (avoids a crash in bidi_paragraph_init).
13196 Initialize itb.string.lstring.
0bb23927
EZ
13197 (init_iterator): Call bidi_init_it only of a valid
13198 buffer position was specified. Initialize paragraph_embedding to
13199 L2R.
13200 (reseat_to_string): Initialize the bidi iterator.
13201 (display_string): If we need to ignore text properties of
13202 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13203 original value of -1 will not work with bidi.)
13204 (compute_display_string_pos): First arg is now struct
13205 `text_pos *'; all callers changed. Support display properties on
13206 Lisp strings.
13207 (compute_display_string_end): Support display properties on Lisp
13208 strings.
13209 (init_iterator, reseat_1, reseat_to_string): Initialize the
13210 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13211 when iterating on a string not from display properties).
640c8776
SM
13212 (compute_display_string_pos, compute_display_string_end):
13213 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
13214 arrow keys.
13215 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
13216 base_level_stop; instead, set base_level_stop to BEGV.
13217 Fixes crashes in vertical-motion.
0bb23927
EZ
13218 (next_element_from_buffer): Improve commentary for when
13219 the iterator is before prev_stop.
13220 (init_iterator): Initialize bidi_p from the default value of
13221 bidi-display-reordering, not from buffer-local value. Use the
13222 buffer-local value only if initializing for buffer iteration.
13223 (handle_invisible_prop): Support invisible properties on strings
13224 that are being bidi-reordered.
13225 (set_iterator_to_next): Support bidi reordering of C strings and
13226 Lisp strings.
13227 (next_element_from_string): Support bidi reordering of Lisp
13228 strings.
13229 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
13230 (display_string): Support display of R2L glyph rows.
13231 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
13232 (init_iterator): Don't initialize it->bidi_p for strings
13233 here.
13234 (reseat_to_string): Initialize it->bidi_p for strings here.
13235 (next_element_from_string, next_element_from_c_string)
13236 (next_element_from_buffer): Add xassert's for correspondence
13237 between IT's object being iterated and it->bidi_it.string
13238 structure.
13239 (face_before_or_after_it_pos): Support bidi iteration.
13240 (next_element_from_c_string): Handle the case of the first string
13241 character that is not the first one in the visual order.
13242 (get_visually_first_element): New function, refactored from common
13243 parts of next_element_from_buffer, next_element_from_string, and
13244 next_element_from_c_string.
13245 (tool_bar_lines_needed, redisplay_tool_bar)
13246 (display_menu_bar): Force left-to-right direction. Add a FIXME
13247 comment for making that be controlled by a user option.
13248 (push_it, pop_it): Save and restore the state of the
13249 bidi iterator. Save and restore the bidi_p flag.
13250 (pop_it): Iterate out of display property for string iteration as
13251 well.
13252 (iterate_out_of_display_property): Support iteration over strings.
13253 (handle_single_display_spec): Set up it->bidi_it for iteration
13254 over a display string, and call bidi_init_it.
13255 (handle_single_display_spec, next_overlay_string)
13256 (get_overlay_strings_1, push_display_prop): Set up the bidi
13257 iterator for displaying display or overlay strings.
13258 (forward_to_next_line_start): Don't use the shortcut if
13259 bidi-iterating.
13260 (back_to_previous_visible_line_start): If handle_display_prop
13261 pushed the iterator stack, restore the internal state of the bidi
13262 iterator by calling bidi_pop_it same number of times.
13263 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13264 and we are bidi-iterating, don't decrement the iterator position;
13265 instead, set the first_elt flag in the bidi iterator, to produce
13266 the same effect.
13267 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13268 (push_display_prop): xassert that we are iterating a buffer.
13269 (push_it, pop_it): Save and restore paragraph_embedding member.
13270 (handle_single_display_spec, next_overlay_string)
13271 (get_overlay_strings_1, reseat_1, reseat_to_string)
13272 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13273 correctly. Don't assume unibyte strings are not bidi-reordered.
13274 (compute_display_string_pos)
13275 (compute_display_string_end): Fix handling the case of C string.
13276 (push_it, pop_it): Save and restore from_disp_prop_p.
13277 (handle_single_display_spec, push_display_prop): Set the
13278 from_disp_prop_p flag.
13279 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13280 (pop_it): Call iterate_out_of_display_property only if we are
13281 popping after iteration over a string that came from a display
13282 property. Fix a typo in popping stretch info. Add an assertion
13283 for verifying that the iterator position is in sync with the bidi
13284 iterator.
13285 (handle_single_display_spec, get_overlay_strings_1)
13286 (push_display_prop): Fix initialization of paragraph direction for
13287 string when that of the parent object is not yet determined.
13288 (reseat_1): Call bidi_init_it to resync the bidi
13289 iterator with IT's position. (Bug#7616)
13290 (find_row_edges): If ROW->start.pos gives position
13291 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13292 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13293 Reset the from_disp_prop_p flag.
13294 (SAVE_IT, RESTORE_IT): New macros.
13295 (pos_visible_p, face_before_or_after_it_pos)
13296 (back_to_previous_visible_line_start)
13297 (move_it_in_display_line_to, move_it_in_display_line)
13298 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13299 (try_scrolling, redisplay_window, display_line): Use them when
13300 saving a temporary copy of the iterator and restoring it back.
13301 (back_to_previous_visible_line_start, reseat_1)
13302 (init_iterator): Empty the bidi cache "stack".
13303 (move_it_in_display_line_to): If iterator ended up at
13304 EOL, but we never saw any buffer positions smaller than
13305 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13306 motion in bidi-reordered lines.
13307 (move_it_in_display_line_to): Record prev_method and prev_pos
13308 immediately before the call to set_iterator_to_next. Fixes cursor
13309 motion in bidi-reordered lines with stretch glyphs and strings
13310 displayed in margins. (Bug#8133) (Bug#8867)
13311 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13312 TO_CHARPOS.
640c8776
SM
13313 (pos_visible_p): Support positions in bidi-reordered lines.
13314 Save and restore bidi cache.
0bb23927
EZ
13315
13316 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13317 (bidi_paragraph_info): Delete unused struct.
13318 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13319 (bidi_cache_start): New variable.
13320 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13321 to zero.
13322 (bidi_cache_fetch_state, bidi_cache_search)
13323 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13324 (bidi_cache_find, bidi_peek_at_next_level)
13325 (bidi_level_of_next_char, bidi_find_other_level_edge)
13326 (bidi_move_to_visually_next): Compare cache index with
13327 bidi_cache_start rather than with zero.
13328 (bidi_fetch_char): Accept new argument STRING; all callers
13329 changed. Support iteration over a string. Support strings with
13330 display properties. Support unibyte strings. Fix the type of
13331 `len' according to what STRING_CHAR_AND_LENGTH expects.
13332 (bidi_paragraph_init, bidi_resolve_explicit_1)
13333 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
13334 (bidi_level_of_next_char, bidi_move_to_visually_next):
13335 Support iteration over a string.
0bb23927
EZ
13336 (bidi_set_sor_type, bidi_resolve_explicit_1)
13337 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13338 can now be zero (for strings); special values 0 and -1 were
13339 changed to -1 and -2, respectively.
13340 (bidi_char_at_pos): New function.
13341 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13342 Call it instead of FETCH_MULTIBYTE_CHAR.
13343 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13344 initialized to valid values.
13345 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13346 values.
13347 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13348 the test for valid cached positions. Fix the logic for looking up
13349 the sentinel state in the cache. GCPRO the Lisp string we are
13350 iterating.
13351 (bidi_push_it, bidi_pop_it): New functions.
13352 (bidi_initialize): Initialize the bidi cache start stack pointer.
13353 (bidi_cache_ensure_space): New function, refactored from part of
13354 bidi_cache_iterator_state. Don't assume the required size is just
13355 one BIDI_CACHE_CHUNK away.
13356 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13357 (bidi_count_bytes, bidi_char_at_pos): New functions.
13358 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13359 always valid if bidi_cache_idx is valid.
13360 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13361 is valid if it's going to be used.
13362 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13363 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
13364 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13365 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
13366 (bidi_find_other_level_edge, bidi_cache_start_stack):
13367 All variables related to cache indices are now EMACS_INT.
c965adc5 13368
0bb23927
EZ
13369 * dispextern.h (struct bidi_string_data): New structure.
13370 (struct bidi_it): New member `string'. Make flag members be 1-bit
13371 fields, and put them last in the struct.
640c8776
SM
13372 (compute_display_string_pos, compute_display_string_end):
13373 Update prototypes.
0bb23927
EZ
13374 (bidi_push_it, bidi_pop_it): Add prototypes.
13375 (struct iterator_stack_entry): New members bidi_p,
13376 paragraph_embedding, and from_disp_prop_p.
13377 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
13378 (bidi_shelve_cache, bidi_unshelve_cache):
13379 Declare prototypes.
0bb23927
EZ
13380
13381 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13382 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13383 and vector-like objects.
13384
13385 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13386 cache around display iteration.
13387
13388 * window.c (Fwindow_end, window_scroll_pixel_based)
13389 (displayed_window_lines, Frecenter): Save and restore the bidi
13390 cache around display iteration.
13391
3bbd2265
LMI
133922011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13393
13394 * editfns.c (Fdelete_region): Clarify the use of the named
13395 parameters (bug#6788).
13396
adc47434
MR
133972011-07-14 Martin Rudalics <rudalics@gmx.at>
13398
13399 * indent.c (Fvertical_motion): Set and restore w->pointm when
13400 saving and restoring the window's buffer (Bug#9006).
13401
837c31f8
LMI
134022011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13403
13404 * editfns.c (Fstring_to_char): Clarify just what is returned
13405 (bug#6576). Text by Eli Zaretskii.
13406
ac389d0c
JB
134072011-07-13 Juanma Barranquero <lekktu@gmail.com>
13408
13409 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13410
0be0ce47
EZ
134112011-07-13 Eli Zaretskii <eliz@gnu.org>
13412
13413 * buffer.c (mmap_find): Fix a typo.
13414
cd18e7e3
JB
134152011-07-13 Johan Bockgård <bojohan@gnu.org>
13416
13417 Fix execution of x selection hooks.
13418 * xselect.c (Qx_lost_selection_functions)
13419 (Qx_sent_selection_functions): New vars.
13420 (syms_of_xselect): DEFSYM them.
13421 (x_handle_selection_request): Pass Qx_sent_selection_functions
13422 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13423 (x_handle_selection_clear,x_clear_frame_selections):
13424 Pass Qx_lost_selection_functions rather than
13425 Vx_lost_selection_functions to Frun_hook_with_args.
13426
47ea7f44
PE
134272011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13428
ac389d0c 13429 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
13430 The old code sometimes used this field without initializing it.
13431
47ea7f44
PE
13432 * alloc.c (gc_sweep): Don't read past end of array.
13433 In theory, the old code could also have corrupted Emacs internals,
13434 though it'd be very unlikely.
13435
bc985c87
AS
134362011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13437
13438 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 13439 argument. (Bug#4026)
bc985c87 13440
0cf34688
LMI
134412011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13442
b3dadd76
LMI
13443 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13444 key" (bug#4257).
13445
0cf34688
LMI
13446 * window.c (Fset_window_start): Doc fix (bug#4199).
13447 (Fset_window_hscroll): Ditto.
13448
270768cd
PE
134492011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13450
077e3dda 13451 Fix minor new problems caught by GCC 4.6.1.
270768cd 13452 * term.c (init_tty): Remove unused local.
490011a6 13453 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 13454 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 13455 not used otherwise.
270768cd 13456
b1f58454
CY
134572011-07-12 Chong Yidong <cyd@stupidchicken.com>
13458
13459 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13460
22b9578d
LMI
134612011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13462
6e70ab07
LMI
13463 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13464 are the mini-buffer and the echo area (bug#3320).
13465
22b9578d
LMI
13466 * term.c (init_tty): Remove support for supdup, c10 and perq
13467 terminals, which are no longer supported (bug#1482).
13468
8974cc9f
JB
134692011-07-10 Johan Bockgård <bojohan@gnu.org>
13470
13471 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13472
a560d974
JD
134732011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13474
13475 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13476 for non-popups (Bug#3642).
13477
1dae0f0a
AS
134782011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13479
268c2c36 13480 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 13481 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
13482 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13483 * cm.c (losecursor): Likewise.
1dae0f0a
AS
13484 * data.c (fmod): Likewise.
13485 * dispnew.c (swap_glyphs_in_rows): Likewise.
13486 * emacs.c (memory_warning_signal): Likewise.
13487 * floatfns.c (float_error): Likewise.
13488 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13489 (otf_open, font_otf_capability, generate_otf_features)
13490 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13491 Likewise.
13492 * image.c (pbm_read_file): Likewise.
13493 * indent.c (string_display_width): Likewise.
13494 * intervals.c (check_for_interval, search_for_interval)
13495 (inc_interval_count, count_intervals, root_interval)
13496 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13497 * lread.c (defalias): Likewise.
268c2c36 13498 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
13499 * regex.c (set_image_of_range_1, set_image_of_range)
13500 (regex_grow_registers): Likewise.
13501 * sysdep.c (strerror): Likewise.
13502 * termcap.c (valid_filename_p, tprint, main): Likewise.
13503 * tparam.c (main): Likewise.
13504 * unexhp9k800.c (run_time_remap, save_data_space)
13505 (update_file_ptrs, read_header, write_header, calculate_checksum)
13506 (copy_file, copy_rest, display_header): Likewise.
13507 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13508 Likewise.
13509 * xdisp.c (check_it): Likewise.
13510 * xfaces.c (register_color, unregister_color, unregister_colors):
13511 Likewise.
13512 * xfns.c (print_fontset_result): Likewise.
13513 * xrdb.c (member, fatal, main): Likewise.
13514
99033785
PE
135152011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13516
13517 Fix minor problems found by static checking (Bug#9031).
13518 * chartab.c (char_table_set_range, map_sub_char_table):
13519 Remove unused locals.
13520 (uniprop_table): Now static.
13521 * composite.c (_work_char): Remove unused static var.
13522
9cb2ac56
JB
135232011-07-09 Juanma Barranquero <lekktu@gmail.com>
13524
13525 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13526
f25661f0
JD
135272011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13528
13529 * gtkutil.c (qttip_cb): Remove code without function.
13530
8278c4fe
EZ
135312011-07-09 Eli Zaretskii <eliz@gnu.org>
13532
13533 * w32.c (pthread_sigmask): New stub.
13534
1692ae2d 135352011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 13536
8a6ebd58 13537 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
13538 sigprocmask is portable only for single-threaded applications, and
13539 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
13540 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13541 (LIBES): Use it.
13542 * callproc.c (Fcall_process):
13543 * process.c (create_process):
13544 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13545 Use pthread_sigmask, not sigprocmask.
123403e4 13546
1b854618
JD
135472011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13548
13549 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13550 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13551 wrong (Bug#8591).
13552
3fe4b549
JD
135532011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13554
0ce7e563
JD
13555 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13556 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13557 (xg_hide_tooltip): Fix comment.
13558
3fe4b549
JD
13559 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13560 in registerServicesMenuSendTypes.
13561 (validRequestorForSendType): Don't check ns_return_types.
13562
13563 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13564 ns_return_type.
13565
5df75e47
JR
135662011-07-08 Jason Rumney <jasonr@gnu.org>
13567
22610910
JR
13568 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13569 SH_SHOW for hidden windows (Bug#5482).
13570
5df75e47
JR
13571 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13572 frame struct members of non-existent frames (Bug#6284).
13573
699c10bd
JD
135742011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13575
4393663b
JD
13576 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13577 variable firstTime not needed on OSX >= 10.6.
13578 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13579 >= 10.5. Use setKnobProportion, setDoubleValue.
13580
13581 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13582 (MAC_OS_X_VERSION_10_5): Define if not defined.
13583 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13584 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13585 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13586
13587 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 13588 cString and lossyCString on OSX >= 10.4.
4393663b 13589
58179cce 13590 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
13591 sizeToFit on OSX >= 10.2.
13592
13593 * nsimage.m (allocInitFromFile): Don't use deprecated method
13594 bestRepresentationForDevice on OSX >= 10.6.
13595
13596 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13597 to avoid warning.
13598
13599 * emacs.c: Declare unexec_init_emacs_zone.
13600
a63e0781
JD
13601 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13602
699c10bd
JD
13603 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13604
13605 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13606 on svcsMenu (Bug#8842).
13607
13608 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13609 ns_return_types.
13610 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13611
13612 * nsterm.m (QUTF8_STRING): Declare.
13613 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13614 (validRequestorForSendType): Return type is (id).
13615 Change indexOfObjectIdenticalTo to indexOfObject.
13616 Check if we have local selection before returning self (Bug#8842).
13617 (writeSelectionToPasteboard): Put local selection into paste board
13618 if we have a local selection (Bug#8842).
13619 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13620
13621 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13622 (ns_get_local_selection): Declare.
13623
54e10184
LMI
136242011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13625
9888ff71
LMI
13626 * keymap.c (describe_map_tree): Don't insert a double newline at
13627 the end of the buffer (bug#1169) and return whether we inserted
13628 something.
13629
54e10184
LMI
13630 * callint.c (Fcall_interactively): Change "reading args" to
13631 "providing args" to try to clarify what it does (bug#1010).
13632
15fa4783
KH
136332011-07-07 Kenichi Handa <handa@m17n.org>
13634
13635 * composite.c (composition_compute_stop_pos): Ignore a static
13636 composition starting before CHARPOS (Bug#8915).
13637
13638 * xdisp.c (handle_composition_prop): Likewise.
13639
a8815b00
EZ
136402011-07-07 Eli Zaretskii <eliz@gnu.org>
13641
13642 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13643 (Bug#9015)
13644
ef7b981d 136452011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
13646
13647 * character.h (unicode_category_t): New enum type.
13648
13649 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13650 (Qchar_code_property_table): New variable.
13651 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13652 (UNIPROP_COMPRESSED_FORM_P): New macros.
13653 (char_table_ascii): Uncompress the compressed values.
13654 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13655 Uncompress the compressed values.
ac389d0c 13656 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
13657 (char_table_ref_and_range): Uncompress the compressed values.
13658 (sub_char_table_set): New arg is_uniprop. Callers changed.
13659 Uncompress the compressed values.
13660 (sub_char_table_set_range): Args changed. Callers changed.
13661 (char_table_set_range): Adjuted for the above change.
13662 (map_sub_char_table): Delete args default_val and parent. Add arg
13663 top. Give decoded values to a Lisp function.
640c8776 13664 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
13665 values to a Lisp function. Gcpro more variables.
13666 (uniprop_table_uncompress)
13667 (uniprop_decode_value_run_length): New functions.
13668 (uniprop_decoder, uniprop_decoder_count): New variables.
13669 (uniprop_get_decoder, uniprop_encode_value_character)
13670 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13671 New functions.
13672 (uniprop_encoder, uniprop_encoder_count): New variables.
13673 (uniprop_get_encoder, uniprop_table)
13674 (Funicode_property_table_internal, Fget_unicode_property_internal)
13675 (Fput_unicode_property_internal): New functions.
13676 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13677 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 13678 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
13679 char-code-property-alist.
13680
640c8776 13681 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
13682 Vunicode_category_table.
13683
640c8776 13684 * font.c (font_range): Adjust for the change of
c805dec0
KH
13685 Vunicode_category_table.
13686
76b397fb
DN
136872011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13688
13689 * m/iris4d.h: Remove file, move contents ...
13690 * s/irix6-5.h: ... here.
13691
22b4128e
PE
136922011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13693
13694 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
13695 * alloc.c (mark_buffer):
13696 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13697 (clone_per_buffer_values): Don't assume that
22b4128e
PE
13698 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13699 This isn't true in general, and it's particularly not true
13700 if Emacs is configured with --with-wide-int.
13701 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13702 New macros, used in the buffer.c change.
13703
869795d6
JD
137042011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13705
13706 * xsettings.c: Use both GConf and GSettings if both are available.
13707 (store_config_changed_event): Add comment.
13708 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13709 (store_tool_bar_style_changed): New functions.
5e617bc2 13710 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
13711 (struct xsettings): Move font inside HAVE_XFT.
13712 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 13713 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 13714 Move inside HAVE_XFT.
640c8776 13715 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
13716 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13717 also.
13718 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 13719 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 13720 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
13721 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13722 (parse_settings): Move check for font inside HAVE_XFT.
13723 (read_settings, apply_xft_settings): Add comment.
13724 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13725 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13726 call store_font_name_changed.
13727 (xft_settings_event): Add comment.
13728 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13729 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13730 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13731 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13732 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
13733 (xsettings_get_system_font, xsettings_get_system_normal_font):
13734 Add comment.
869795d6 13735
d8ed26bd
PE
137362011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13737
13738 Random fixes. E.g., (random) never returned negative values.
13739 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13740 subseconds part to the entropy, as that's a bit more random.
13741 Prefer signed to unsigned, since the signedness doesn't matter and
13742 in general we prefer signed. When given a limit, use a
13743 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13744 latter isn't right if USE_2_TAGS_FOR_INTS.
13745 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13746 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13747
cabf1cac
SM
137482011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13749
13750 * textprop.c (text_property_stickiness):
13751 Obey Vtext_property_default_nonsticky.
13752 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13753 * w32fns.c (syms_of_w32fns):
13754 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13755
6e9b2be9
PE
137562011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13757
13758 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13759 This is more efficient than Ffile_directory_p and avoids a minor race.
13760
90186c68
LMI
137612011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13762
7c301272
LMI
13763 * buffer.c (Foverlay_put): Say what the return value is
13764 (bug#7835).
13765
c4f2d8d4
LMI
13766 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13767 is a directory before asking whether to use the file name
13768 (bug#7564).
ad637907
LMI
13769 (barf_or_query_if_file_exists): Make the "File is a directory"
13770 error be more correct.
c4f2d8d4 13771
90186c68
LMI
13772 * fns.c (Frequire): Remove the mention of the .gz files, since
13773 that's installation-specific, but keep the mention of
13774 `get-load-suffixes'.
13775
da64016e
PE
137762011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13777
13778 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13779 Report string overflow if the output is too long.
13780
7d47b580
JB
137812011-07-04 Juanma Barranquero <lekktu@gmail.com>
13782
a555cb87
JB
13783 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13784 (syms_of_gnutls): Remove duplicate DEFSYM for
13785 Qgnutls_bootprop_verify_hostname_error, an error for
13786 Qgnutls_bootprop_verify_error (which is no longer used).
13787
7d47b580
JB
13788 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13789 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13790 Also (re)move comments that are misplaced or no longer relevant.
13791
1e49bfab
LMI
137922011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13793
13794 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13795
1485f4c0
CY
137962011-07-03 Chong Yidong <cyd@stupidchicken.com>
13797
13798 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13799 and background color parameters if they have been changed.
13800
a9ab721e
LMI
138012011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13802
13803 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13804
cf7cff57
PE
138052011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13806
2e13213d
PE
13807 * xsettings.c (SYSTEM_FONT): Define only when used.
13808 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13809
cf7cff57
PE
13810 * keymap.c (access_keymap_1): Now static.
13811
7a8e04f7
CY
138122011-07-02 Chong Yidong <cyd@stupidchicken.com>
13813
13814 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13815 leave any prefix arg for the up event (Bug#1586).
13816
61352f62
LMI
138172011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13818
69bb1ef7
LMI
13819 * lread.c (syms_of_lread): Mention single symbols defined by
13820 `defvar' or `defconst' (bug#7154).
13821
61352f62 13822 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 13823 (Frequire): Mention get-load-suffixes.
61352f62 13824
28545e04
MR
138252011-07-02 Martin Rudalics <rudalics@gmx.at>
13826
13827 * window.h (window): Remove clone_number slot.
13828 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13829 Remove.
13830 (make_parent_window, make_window, saved_window)
13831 (Fset_window_configuration, save_window_save): Don't deal with
13832 clone numbers.
13833 * buffer.c (Qclone_number): Remove declaration.
13834 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13835
3349e122
SM
138362011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13837
13838 Add multiple inheritance to keymaps.
13839 * keymap.c (Fmake_composed_keymap): New function.
13840 (Fset_keymap_parent): Simplify.
13841 (fix_submap_inheritance): Remove.
13842 (access_keymap_1): New function extracted from access_keymap to handle
13843 embedded parents and handle lists of maps.
13844 (access_keymap): Use it.
13845 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13846 (Fcopy_keymap): Handle embedded parents.
13847 (Fcommand_remapping, define_as_prefix): Simplify.
13848 (Fkey_binding): Simplify.
13849 (syms_of_keymap): Move minibuffer-local-completion-map,
13850 minibuffer-local-filename-completion-map,
13851 minibuffer-local-must-match-map, and
13852 minibuffer-local-filename-must-match-map to Elisp.
13853 (syms_of_keymap): Defsubr make-composed-keymap.
13854 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13855 (parse_menu_item): Trivial simplification.
13856
3279eb87
GM
138572011-07-01 Glenn Morris <rgm@gnu.org>
13858
13859 * Makefile.in (SETTINGS_LIBS): Fix typo.
13860
39cb9e56 138612011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
13862
13863 * coding.c (Fencode_coding_string): Record the last coding system
13864 used, as the function doc string says (bug#8738).
13865
0949d2b6
JD
138662011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13867
13868 * xsettings.c (store_monospaced_changed): Take new font as arg and
13869 check for change against current_mono_font.
13870 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13871 (emacs_settings_constructor, emacs_settings_get_property)
13872 (emacs_settings_set_property, emacs_settings_class_init)
13873 (emacs_settings_init, gsettings_obj): Remove.
13874 (something_changedCB): New function for HAVE_GSETTINGS.
13875 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13876 with value as argument.
13877 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13878 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 13879 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
13880 "changed".
13881
13882 * xgselect.c: Add defined (HAVE_GSETTINGS).
13883 (xgselect_initialize): Ditto.
13884
13885 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13886 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13887 xg_select.
13888
bbc6b304
PE
138892011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13890
13891 * eval.c (struct backtrace): Simplify and port the data structure.
13892 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13893 signed bit field, as this assumption is not portable and it makes
13894 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13895 "char debug_on_exit : 1" as this is not portable either; instead,
13896 use the portable "unsigned int debug_on_exit : 1". Remove unused
13897 member evalargs. Remove obsolete comments about cc bombing out.
13898
9851bfc5
JD
138992011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13900
51bb811f 13901 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
13902 Let HAVE_GSETTINGS override HAVE_GCONF.
13903 (store_monospaced_changed): New function.
13904 (EMACS_SETTINGS): A new type derived from GObject to handle
13905 GSettings notifications.
13906 (emacs_settings_constructor, emacs_settings_get_property)
13907 (emacs_settings_set_property, emacs_settings_class_init):
13908 New functions.
13909 (gsettings_client, gsettings_obj): New variables.
13910 (GSETTINGS_SCHEMA): New define.
13911 (something_changedCB): Call store_monospaced_changed.
13912 (init_gsettings): New function.
13913 (xsettings_initialize): Call init_gsettings.
13914 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13915 to NULL.
13916
640c8776 13917 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
13918 GCONF_CFLAGS/LIBS.
13919
5386012d
MR
139202011-06-29 Martin Rudalics <rudalics@gmx.at>
13921
13922 * window.c (resize_root_window, grow_mini_window)
13923 (shrink_mini_window): Rename Qresize_root_window to
13924 Qwindow_resize_root_window and Qresize_root_window_vertically to
13925 Qwindow_resize_root_window_vertically.
13926
f13e0b08
PE
139272011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13928
13929 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13930
94515237
JB
139312011-06-27 Juanma Barranquero <lekktu@gmail.com>
13932
13933 * makefile.w32-in: Redesign dependencies so they reflect more
13934 clearly which files are directly included by each source file,
13935 and not through other includes.
13936
e43b6e43
MR
139372011-06-27 Martin Rudalics <rudalics@gmx.at>
13938
13939 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13940 (sort_overlays, overlay_strings): When an overlay's clone number
13941 matches the window's clone number process the overlay even if
13942 the overlay's window property doesn't match the current window.
13943
d68443dc
MR
13944 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13945 (Fwindow_hchild): Rename to Fwindow_left_child.
13946 (Fwindow_next): Rename to Fwindow_next_sibling.
13947 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
13948 (resize_window_check): Rename to window_resize_check.
13949 (resize_window_apply): Rename to window_resize_apply.
13950 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13951 (Fdelete_other_windows_internal, resize_frame_windows)
13952 (Fsplit_window_internal, Fdelete_window_internal)
13953 (grow_mini_window, shrink_mini_window)
13954 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 13955
c7e73be5
JD
139562011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13957
13958 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13959 (emacs_fixed_set_min_size): Remove.
13960 (emacs_fixed_new): Take frame as argument.
13961
13962 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13963 (_EmacsFixedPrivate): Remove minwidth/height.
13964 Add struct frame *f.
13965 (emacs_fixed_init): Initialize priv->f.
13966 (get_parent_class, emacs_fixed_set_min_size): Remove.
13967 (emacs_fixed_new): Set priv->f to argument.
13968 (emacs_fixed_get_preferred_width)
13969 (emacs_fixed_get_preferred_height): Use min_width/height from
13970 frames size_hint to set minimum and natural (Bug#8919).
13971 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13972 and use min_width/height from frames size_hint to set
13973 min_width/height (Bug#8919).
13974
13975 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13976 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13977 Fix indentation.
c7e73be5 13978
cf99dcf8
EZ
139792011-06-26 Eli Zaretskii <eliz@gnu.org>
13980
13981 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13982 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13983 called at ZV.
13984
029529ac
CY
139852011-06-26 Chong Yidong <cyd@stupidchicken.com>
13986
13987 * process.c (wait_reading_process_output): Bypass select if
13988 waiting for a cell while ignoring keyboard input, and input is
13989 pending. Suggested by Jan Djärv (Bug#8869).
13990
7a7ef429
PE
139912011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13992
13993 Use gnulib's dup2 module instead of rolling our own.
13994 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13995
11fdef7d 139962011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13997
13998 * dispnew.c (scrolling_window): Before scrolling, turn off a
13999 mouse-highlight in the window being scrolled.
14000
cd3520a4
JB
140012011-06-24 Juanma Barranquero <lekktu@gmail.com>
14002
14003 Move DEFSYM to lisp.h and use everywhere.
14004
14005 * character.h (DEFSYM): Move declaration...
14006 * lisp.h (DEFSYM): ...here.
14007
14008 * gnutls.c:
14009 * minibuf.c:
14010 * w32menu.c:
14011 * w32proc.c:
14012 * w32select.c: Don't include character.h.
14013
14014 * alloc.c (syms_of_alloc):
14015 * buffer.c (syms_of_buffer):
14016 * bytecode.c (syms_of_bytecode):
14017 * callint.c (syms_of_callint):
14018 * casefiddle.c (syms_of_casefiddle):
14019 * casetab.c (init_casetab_once):
14020 * category.c (init_category_once, syms_of_category):
14021 * ccl.c (syms_of_ccl):
14022 * cmds.c (syms_of_cmds):
14023 * composite.c (syms_of_composite):
14024 * dbusbind.c (syms_of_dbusbind):
14025 * dired.c (syms_of_dired):
14026 * dispnew.c (syms_of_display):
14027 * doc.c (syms_of_doc):
14028 * editfns.c (syms_of_editfns):
14029 * emacs.c (syms_of_emacs):
14030 * eval.c (syms_of_eval):
14031 * fileio.c (syms_of_fileio):
14032 * fns.c (syms_of_fns):
14033 * frame.c (syms_of_frame):
14034 * fringe.c (syms_of_fringe):
14035 * insdel.c (syms_of_insdel):
14036 * keymap.c (syms_of_keymap):
14037 * lread.c (init_obarray, syms_of_lread):
14038 * macros.c (syms_of_macros):
14039 * msdos.c (syms_of_msdos):
14040 * print.c (syms_of_print):
14041 * process.c (syms_of_process):
14042 * search.c (syms_of_search):
14043 * sound.c (syms_of_sound):
14044 * syntax.c (init_syntax_once, syms_of_syntax):
14045 * terminal.c (syms_of_terminal):
14046 * textprop.c (syms_of_textprop):
14047 * undo.c (syms_of_undo):
14048 * w32.c (globals_of_w32):
14049 * window.c (syms_of_window):
14050 * xdisp.c (syms_of_xdisp):
14051 * xfaces.c (syms_of_xfaces):
14052 * xfns.c (syms_of_xfns):
14053 * xmenu.c (syms_of_xmenu):
14054 * xsettings.c (syms_of_xsettings):
14055 * xterm.c (syms_of_xterm): Use DEFSYM.
14056
4228cf16
TZ
140572011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14058
cd3520a4 14059 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 14060
7fcccf1e
PE
140612011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14062
7efb4e0e
PE
14063 Integer and buffer overflow fixes (Bug#8873).
14064
ff5844ad
PE
14065 * print.c (printchar, strout): Check for string overflow.
14066 (PRINTPREPARE, printchar, strout):
14067 Don't set size unless allocation succeeds.
14068
90532f02
PE
14069 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14070 for sizes. Check for string overflow more accurately.
14071 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14072
6d84508d
PE
14073 * macros.c: Integer and buffer overflow fixes.
14074 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14075 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14076 Use ptrdiff_t, not int, for sizes.
14077 Don't increment bufsize until after realloc succeeds.
14078 Check for size-calculation overflow.
14079 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14080
437b2cb4
PE
14081 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14082
8b9ac8b4
PE
14083 * lread.c: Integer overflow fixes.
14084 (read_integer): Radix is now EMACS_INT, not int,
14085 to improve quality of diagnostics for out-of-range radices.
14086 Calculate buffer size correctly for out-of-range radices.
14087 (read1): Check for integer overflow in radices, and in
14088 read-circle numbers.
82cb60d3
PE
14089 (read_escape): Avoid int overflow.
14090 (Fload, openp, read_buffer_size, read1)
14091 (substitute_object_recurse, read_vector, read_list, map_obarray):
14092 Use ptrdiff_t, not int, for sizes.
14093 (read1): Use EMACS_INT, not int, for sizes.
20270765 14094 Check for size overflow.
8b9ac8b4 14095
7fcccf1e
PE
14096 * image.c (cache_image): Check for size arithmetic overflow.
14097
bfbbd7e7
PE
14098 * lread.c: Integer overflow issues.
14099 (saved_doc_string_size, saved_doc_string_length)
14100 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14101 Now ptrdiff_t, not int.
14102 (read1): Don't assume doc string length fits in int. Check for
14103 out-of-range doc string lengths.
14104 (read_list): Don't assume file position fits in int.
39019e54 14105 (read_escape): Check for hex character overflow.
bfbbd7e7 14106
4e323265
LL
141072011-06-22 Leo Liu <sdl.web@gmail.com>
14108
14109 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14110 Move to minibuffer.el.
14111
85fece3e
PE
141122011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14113
20b84ce9 14114 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
14115 The following patches are for when GLYPH_DEBUG && !XASSERT.
14116 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14117 * dispnew.c (flush_stdout):
14118 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14119 Mark as externally visible.
14120 * dispnew.c (check_window_matrix_pointers): Now static.
14121 * dispnew.c (window_to_frame_vpos):
14122 * xfns.c (unwind_create_frame):
14123 * xterm.c (x_check_font): Remove unused local.
14124 * scroll.c (CHECK_BOUNDS):
14125 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14126 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14127 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14128 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14129 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14130 Now static.
14131 (debug_method_add): Use va_list and vsprintf rather than relying
14132 on undefined behavior with wrong number of arguments.
14133 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14134 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14135 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14136 since we're not interested in debugging glyphs with old libraries.
14137 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14138 GCC 4.6.0's static checking.
14139
0766b489
PE
141402011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14141
31fd4b32
PE
14142 Integer overflow and signedness fixes (Bug#8873).
14143 A few related buffer overrun fixes, too.
14144
b79e8648
PE
14145 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14146
0766b489
PE
14147 * dispextern.h (struct face.stipple):
14148 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14149 (x_bitmap_mask, x_allocate_bitmap_record)
14150 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14151 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14152 (x_create_bitmap_from_xpm_data):
14153 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14154 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14155 (.bitmaps_last):
14156 * xfaces.c (load_pixmap):
14157 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14158 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14159 (.bitmaps_last, struct x_output.icon_bitmap):
14160 Use ptrdiff_t, not int, for bitmap indexes.
14161 (x_allocate_bitmap_record): Check for size overflow.
14162 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14163
b081724f
PE
14164 Use ptrdiff_t, not int, for overlay counts.
14165 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14166 * editfns.c (overlays_around, get_pos_property):
14167 * textprop.c (get_char_property_and_overlay):
14168 * xdisp.c (next_overlay_change, note_mouse_highlight):
14169 * xfaces.c (face_at_buffer_position):
21514da7
PE
14170 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14171 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14172 (Fnext_overlay_change, Fprevious_overlay_change)
14173 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 14174 Use ptrdiff_t, not int, for sizes.
21514da7 14175 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 14176
3de73e5e
PE
14177 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14178
2606c57b
PE
14179 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14180 (x_session_initialize): Do not assume string length fits in int.
14181
aaafe47a
PE
14182 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14183 This is unlikely, but can occur if DPI is outlandish.
14184
2674ddc8 14185 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
14186 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14187
28154962
PE
14188 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14189 * xrdb.c (magic_file_p, search_magic_path):
14190 Omit last arg SUFFIX; it was always 0. All callers changed.
14191 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14192
7de51af5
PE
14193 * xfont.c (xfont_match): Avoid need for strlen.
14194
25ed6cc3
PE
14195 * xfns.c: Don't assume strlen fits in int.
14196 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14197
4eab31dd
PE
14198 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14199 not unsigned long, as we prefer signed integers. All callers changed.
14200 Detect integer overflow in repeat count.
14201 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 14202 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 14203
171e2a58
PE
14204 * termcap.c: Don't assume sizes fit in int and never overflow.
14205 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14206 (gobble_line): Check for size-calculation overflow.
14207
ad39faca 14208 * minibuf.c (Fread_buffer):
6e5bb2dc 14209 * lread.c (intern, intern_c_string):
74ca2eb3
PE
14210 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14211 Don't assume string length fits in int.
14212
52c61c22 14213 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
14214 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14215
b5b8c9e5
PE
14216 * font.c: Don't assume string length fits in int.
14217 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14218 Use ptrdiff_t, not int.
ccd6111c
PE
14219 (font_intern_prop): Don't assume string length fits in int.
14220 Don't assume integer property fits in fixnum.
14221 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 14222
882f0d81 14223 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 14224 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
14225 Reformulate so as not to need the command string.
14226 Invoke gzip -cd rather than gunzip, as it's more portable.
14227 (lock_info_type, lock_file_1, lock_file):
14228 Don't assume pid_t and time_t fit in unsigned long.
14229 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14230 (current_lock_owner): Prefer signed type for sizes.
14231 Use memcpy, not strncpy, where memcpy is what is really wanted.
14232 Don't assume (via atoi) that time_t and pid_t fit in int.
14233 Check for time_t and/or pid_t out of range, e.g., via a network share.
14234 Don't alloca where an auto var works fine.
14235
93f4cf88
PE
14236 * fileio.c: Fix some integer overflow issues.
14237 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14238 Don't assume string length fits in int.
14239 (directory_file_name): Don't assume string length fits in long.
14240 (make_temp_name): Don't assume pid fits in int, or that its print
14241 length is less than 20.
14242
f3e92b69
PE
14243 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14244
1bfdaf10
PE
14245 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14246
35016e9a
PE
14247 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14248
3d1e65a1
PE
14249 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14250 We prefer signed integers, even for size calculations.
14251
0b963a93
PE
14252 * emacs.c: Don't assume string length fits in 'int'.
14253 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14254 (main): Don't invoke strlen when not needed.
14255
573f4b54
PE
14256 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14257 (XD_DEBUG_MESSAGE): Don't waste a byte.
14258
989f33ba
PE
14259 * callproc.c (getenv_internal_1, getenv_internal)
14260 (Fgetenv_internal):
965d34eb
PE
14261 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14262
e4d29b33
PE
14263 * lread.c (invalid_syntax): Omit length argument.
14264 All uses changed. This doesn't fix a bug, but it simplifies the
14265 code away from its former Hollerith-constant appearance, and it's
14266 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 14267 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 14268
eb49b136
PE
14269 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14270 This didn't break anything, but it didn't help either.
14271 It's confusing to put a bogus integer in a place where the actual
14272 value does not matter.
9f62aeb1 14273 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 14274 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 14275
15375a22
PE
14276 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14277 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14278 implementation.
b61cc01c
PE
14279 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14280 We prefer signed types, and the value cannot exceed the EMACS_INT
14281 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
14282 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14283 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14284 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 14285
53b2623d
PE
14286 * indent.c (sane_tab_width): New function.
14287 (current_column, scan_for_column, Findent_to, position_indentation)
14288 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 14289 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 14290
51cab52b 14291 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 14292
f2ed8a70
PE
14293 * lisp.h (lint_assume): New macro.
14294 * composite.c (composition_gstring_put_cache):
14295 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14296
abe80cc6
PE
14297 * editfns.c, insdel.c:
14298 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 14299
b02c740e
PE
14300 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14301
ebc96716
PE
14302 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14303
b4e50fa0 14304 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 14305 Use much-faster test for byte-length change.
311d5d7c 14306 Don't assume string byte-length fits in 'int'.
a4cf38e4 14307 Check that character arg fits in 'int'.
85461888 14308 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 14309
c0c1ee9f
PE
14310 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14311
a498d7f4
PE
14312 * fns.c (concat): Catch string overflow earlier.
14313 Do not rely on integer wraparound.
14314
51cab52b
PE
14315 * dispextern.h (struct it.overlay_strings_charpos)
14316 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
14317 * xdisp.c (forward_to_next_line_start)
14318 (back_to_previous_visible_line_start)
14319 (reseat_at_next_visible_line_start, next_element_from_buffer):
14320 Don't arbitrarily truncate the value of 'selective' to int.
14321
76031fad
PE
14322 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14323
5eb55db9
PE
14324 * composite.c: Don't truncate sizes to 'int'.
14325 (composition_gstring_p, composition_reseat_it)
14326 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
14327 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14328 not EMACS_UINT, for indexes.
5eb55db9 14329
0703a717
PE
14330 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14331
d6202519
PE
14332 * buffer.c: Include <verify.h>.
14333 (struct sortvec.priority, struct sortstr.priority):
8961a454 14334 Now EMACS_INT, not int.
c20998a7 14335 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
14336 (struct sortstr.size, record_overlay_string)
14337 (struct sortstrlist.size, struct sortlist.used):
14338 Don't truncate size to int.
14339 (record_overlay_string): Check for size-calculation overflow.
d6202519 14340 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 14341
d5a19415
JM
143422011-06-22 Jim Meyering <meyering@redhat.com>
14343
029529ac 14344 Don't leak an XBM-image-sized buffer
d5a19415
JM
14345 * image.c (xbm_load): Free the image buffer after using it.
14346
a9041e6c
PE
143472011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14348
14349 Port to Sun C.
14350 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14351 that Sun C diagnosed.
14352 * fns.c (secure_hash): Fix pointer signedness issue.
14353 * intervals.c (static_offset_intervals): New function.
14354 (offset_intervals): Use it.
14355
7f3f739f
LL
143562011-06-21 Leo Liu <sdl.web@gmail.com>
14357
14358 * deps.mk (fns.o):
14359 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14360 sha512.h.
14361
14362 * fns.c (secure_hash): Rename from crypto_hash_function and change
14363 the first arg to accept symbols.
5b66d427 14364 (Fsecure_hash): New primitive.
7f3f739f
LL
14365 (syms_of_fns): New symbols.
14366
76147d94
DD
143672011-06-20 Deniz Dogan <deniz@dogan.se>
14368
14369 * process.c (Fset_process_buffer): Clarify return value in
14370 docstring.
14371
7d7d0045
CY
143722011-06-18 Chong Yidong <cyd@stupidchicken.com>
14373
14374 * dispnew.c (add_window_display_history): Use BVAR.
14375
14376 * xdisp.c (debug_method_add): Use BVAR.
14377 (check_window_end, dump_glyph_matrix, dump_glyph)
14378 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14379
14380 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14381 Likewise.
14382
14383 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14384 check till after the cache is created in init_frame_faces.
14385
ff2bc410
SM
143862011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14387
14388 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14389
28177add
PE
143902011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14391
dd3482fe
PE
14392 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14393 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14394 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14395
393d71f3 14396 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
14397 * fileio.c (Finsert_file_contents):
14398 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14399 Remove the old (too-loose) buffer overflow checks.
14400 They weren't needed, since make_gap checks for buffer overflow.
14401 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14402 The old code merely checked for Emacs fixnum overflow, and relied
14403 on undefined (wraparound) behavior. The new code avoids undefined
14404 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14405
2e6813b0 14406 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
14407 Tune. Don't use wider integers than needed. Don't use alloca.
14408 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 14409
599a9e4f
PE
14410 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14411
99561444
PE
14412 * insdel.c, lisp.h (buffer_overflow): New function.
14413 (insert_from_buffer_1, replace_range, replace_range_2):
14414 * insdel.c (make_gap_larger):
14415 * editfns.c (Finsert_char):
14416 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14417
28177add
PE
14418 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14419
e69dafad
PE
144202011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14421
4baa020d 14422 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 14423
b1c46f02
PE
14424 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14425 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14426
e69dafad
PE
14427 * fileio.c: Don't assume EMACS_INT fits in off_t.
14428 (emacs_lseek): New static function.
14429 (Finsert_file_contents, Fwrite_region): Use it.
14430 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14431
566684ea
PE
14432 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14433
e6966cd6
PE
14434 * fns.c: Don't overflow int when computing a list length.
14435 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14436 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14437 truncation on 64-bit hosts. Check for QUIT every
14438 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14439 faster and is responsive enough.
14440 (Flength): Report an error instead of overflowing an integer.
14441 (Fsafe_length): Return a float if the value is not representable
14442 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 14443 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 14444 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 14445
dd0b0efb
PE
14446 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14447 (header_size, word_size): New constants.
14448 (allocate_vectorlike): Don't check size overflow here.
14449 (allocate_vector): Check it here instead, since this is the only
14450 caller of allocate_vectorlike that could cause overflow.
14451 Check that the new vector's length is representable as a fixnum.
14452
86fe5cfe
PE
14453 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14454 The previous code was bogus. For example, next_almost_prime (32)
14455 returned 39, which is undesirable as it is a multiple of 3; and
14456 next_almost_prime (24) returned 25, which is a multiple of 5 so
14457 why was the code bothering to check for multiples of 7?
14458
80e88859
PE
14459 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14460
4a2f0ad6
PE
14461 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14462
f66c7cf8
PE
14463 Variadic C functions now count arguments with ptrdiff_t.
14464 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14465 Back then I didn't know that the Emacs coding style prefers signed int.
14466 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
14467 were being counted with int, which may truncate counts on 64-bit
14468 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
14469 * lisp.h (struct Lisp_Subr.function.aMANY)
14470 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14471 Arg counts are now ptrdiff_t, not size_t.
14472 All variadic functions and their callers changed accordingly.
14473 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14474 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14475 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14476 * callint.c (Fcall_interactively): Check arg count for overflow,
14477 to avoid potential buffer overrun. Use signed char, not 'int',
14478 for 'varies' array, so that we needn't bother to check its size
14479 calculation for overflow.
14480 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14481 * eval.c (apply_lambda):
14482 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14483 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14484 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14485
a1759b76
PE
14486 * callint.c (Fcall_interactively): Don't use index var as event count.
14487
d96be9fc
PE
14488 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14489 * mem-limits.h (SIZE): Remove; no longer used.
14490
a690a978 14491 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 14492
578c21e6
PE
14493 Remove unnecessary casts.
14494 * xterm.c (x_term_init):
14495 * xfns.c (x_set_border_pixel):
14496 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14497 These aren't needed now that we assume ANSI C.
14498
96f53c6c
PE
14499 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14500 It's more likely to cause problems (due to unsigned overflow)
14501 than to cure them.
14502
83c77d31
PE
14503 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14504
ee2079f1
PE
14505 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14506
6da65536
PE
14507 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14508
7147c4a4
PE
14509 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14510
193e32d9
PE
14511 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14512
e5533da6
PE
14513 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14514
9910e595
PE
14515 GLYPH_CODE_FACE returns EMACS_INT, not int.
14516 * dispextern.h (merge_faces):
14517 * xfaces.c (merge_faces):
01103c44
PE
14518 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14519 Don't assume EMACS_INT fits in int.
9910e595 14520
2638320e
PE
14521 * character.h (CHAR_VALID_P): Remove unused parameter.
14522 * fontset.c, lisp.h, xdisp.c: All uses changed.
14523
045eb8d9
PE
14524 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14525
c1f134b5
PE
14526 * fns.c (concat): Minor tuning based on overflow analysis.
14527 This doesn't fix any bugs. Use int to hold character, instead
14528 of constantly refetching from Emacs object. Use XFASTINT, not
14529 XINT, for value known to be a character. Don't bother comparing
14530 a single byte to 0400, as it's always less.
14531
395fcb93 14532 * floatfns.c (Fexpt):
327eeec8
PE
14533 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14534
abbd3d23
PE
14535 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14536 for characters.
14537
684a03ef
PE
14538 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14539
0fed43f3
PE
14540 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14541 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14542 incorrectly succeed when S was a string, because 4294967386 was
14543 truncated before it was used.
14544
8fd02eb7
PE
14545 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14546 Otherwise, an out-of-range integer could cause undefined behavior
14547 on a 64-bit host.
14548
f8c86b69
PE
14549 * composite.c: Use int, not EMACS_INT, for characters.
14550 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14551 EMACS_INT, for values that are known to be in character range.
14552 This doesn't fix any bugs but is the usual style inside Emacs and
14553 may generate better code on 32-bit machines.
14554
34206dd2
PE
14555 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14556 This is for reasons similar to the recent CHAR_STRING fix.
14557 * charset.c (Fencode_char): Check that character arg is actually
14558 a character. Pass an int to ENCODE_CHAR.
14559 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14560 wider than 'int', as a compile-time check to prevent future regressions
14561 in this area.
14562
c5958d4c 14563 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
14564
14565 Make sure a 64-bit char is never passed to CHAR_STRING.
14566 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14567 by silently ignoring the top 32 bits, allowing some values
14568 that were far too large to be valid characters.
14569 * character.h: Include <verify.h>.
14570 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14571 arguments are no wider than unsigned, as a compile-time check
14572 to prevent future regressions in this area.
14573 * data.c (Faset):
01103c44 14574 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
14575 (Fsubst_char_in_region):
14576 * fns.c (concat):
14577 * xdisp.c (decode_mode_spec_coding):
14578 Adjust to CHAR_STRING's new requirement.
14579 * editfns.c (Finsert_char, Fsubst_char_in_region):
14580 * fns.c (concat): Check that character args are actually
14581 characters. Without this test, these functions did the wrong
14582 thing with wildly out-of-range values on 64-bit hosts.
14583
d37ca623
PE
14584 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14585 These casts should not be needed on 32-bit hosts, either.
14586 * keyboard.c (read_char):
14587 * lread.c (Fload): Remove casts to unsigned.
14588
ea204efb
PE
14589 * lisp.h (UNSIGNED_CMP): New macro.
14590 This fixes comparison bugs on 64-bit hosts.
14591 (ASCII_CHAR_P): Use it.
14592 * casefiddle.c (casify_object):
01103c44 14593 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
14594 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14595 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14596 * dispextern.h (FACE_FROM_ID):
14597 * keyboard.c (read_char): Use UNSIGNED_CMP.
14598
41cb286c
PE
14599 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14600 not to EMACS_INT, to avoid GCC warning.
14601
4a1b9832
PE
14602 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14603
55daad71
PE
14604 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14605 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14606 isn't needed on 32-bit machines.
8f95c75c 14607
01103c44
PE
14608 * buffer.c (Fgenerate_new_buffer_name):
14609 Use EMACS_INT for count, not int.
0ceccced 14610 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
14611
14612 * data.c (Qcompiled_function): Now static.
14613
c6f072e7
PE
14614 * window.c (window_body_lines): Now static.
14615
20ce5912
PE
14616 * image.c (gif_load): Rename local to avoid shadowing.
14617
9c4c5f81
PE
14618 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14619 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14620 * alloc.c (make_save_value): Integer argument is now of type
14621 ptrdiff_t, not int.
14622 (mark_object): Use ptrdiff_t, not int.
14623 * lisp.h (pD): New macro.
14624 * print.c (print_object): Use it.
14625
c0c5c8ae
PE
14626 * alloc.c: Use EMACS_INT, not int, to count objects.
14627 (total_conses, total_markers, total_symbols, total_vector_size)
14628 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
14629 (total_free_floats, total_floats, total_free_intervals)
14630 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
14631 Now EMACS_INT, not int. All uses changed.
14632 (Fgarbage_collect): Compute overall total using a double, so that
14633 integer overflow is less likely to be a problem. Check for overflow
14634 when converting back to an integer.
5a25e253
PE
14635 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14636 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14637 These were 'int' variables that could overflow on 64-bit hosts;
14638 they were never used, so remove them instead of repairing them.
211a0b2a 14639 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
14640 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14641 Previously, this ceilinged at INT_MAX, but that doesn't work on
14642 64-bit machines.
e46bb31a 14643 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 14644
c78baabf 14645 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 14646 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
14647 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14648 when a (possibly-narrower) signed value would do just as well.
14649 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 14650
c9d624c6
PE
14651 * alloc.c: Catch some string size overflows that we were missing.
14652 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14653 for convenience in STRING_BYTES_MAX.
14654 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14655 The definition here is exact; the one in lisp.h was approximate.
14656 (allocate_string_data): Check for string overflow. This catches
14657 some instances we weren't catching before. Also, it catches
14658 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14659 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14660 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 14661
c9d624c6
PE
14662 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14663 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 14664 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 14665
353032ce
PE
14666 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14667
2bccce07
PE
14668 * alloc.c (Fmake_string): Check for out-of-range init.
14669
0ac30604
SM
146702011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14671
14672 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14673
c195f2de
JD
146742011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14675
14676 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14677 xg_get_default_scrollbar_width.
14678
14679 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14680 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14681 (style_changed_cb): Call update_theme_scrollbar_width and call
14682 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14683 all frames (Bug#8505).
14684 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14685 Call gtk_window_set_resizable if HAVE_GTK3.
14686 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14687 and height if HAVE_GTK3 (Bug#8505).
14688 (scroll_bar_width_for_theme): New variable.
14689 (update_theme_scrollbar_width): New function.
14690 (xg_get_default_scrollbar_width): Move code to
14691 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14692 (xg_initialize): Call update_theme_scrollbar_width.
14693
14694 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14695
14696 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14697
e10ac9f1
MR
146982011-06-12 Martin Rudalics <rudalics@gmx.at>
14699
14700 * frame.c (make_frame): Call other_buffer_safely instead of
14701 other_buffer.
14702
14703 * window.c (temp_output_buffer_show): Call display_buffer with
14704 second argument Vtemp_buffer_show_specifiers and reset latter
14705 immediately after the call.
14706 (Vtemp_buffer_show_specifiers): New variable.
14707 (auto_window_vscroll_p, next_screen_context_lines)
14708 (Vscroll_preserve_screen_position): Remove leading asterisks from
14709 doc-strings.
14710
2d3c217e 147112011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 14712
7b7f97e8 14713 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
14714 * buffer.c (Qclone_number): Remove for now, as it's unused.
14715 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14716 (record_buffer): Remove unused local.
14717 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14718 (set_frame_buffer_list): Remove; unused.
14719 * frame.h (other_visible_frames): Remove decl.
14720 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14721 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14722 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14723 if HAVE_GPM.
14724 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14725 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14726 Define only if HAVE_GPM.
14727 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14728 (update_hints_inhibit): Remove; never set. All uses removed.
14729 * widgetprv.h (emacsFrameClassRec): Remove decl.
14730 * window.c (delete_deletable_window): Now returns void, since it
14731 wasn't returning anything.
14732 (compare_window_configurations): Remove unused locals.
14733 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14734 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
14735 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14736 the same widths as pointers. This follows up on the 2011-05-06 patch.
14737 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14738 * xterm.h: Likewise.
14739 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14740
1384b89e
JB
147412011-06-12 Juanma Barranquero <lekktu@gmail.com>
14742
14743 * makefile.w32-in: Update dependencies.
14744 (LISP_H): Add lib/intprops.h.
14745
1100a63c
CY
147462011-06-11 Chong Yidong <cyd@stupidchicken.com>
14747
14748 * image.c (gif_load): Add animation frame delay to the metadata.
14749 (syms_of_image): Use DEFSYM. New symbol `delay'.
14750
6198ccd0
MR
147512011-06-11 Martin Rudalics <rudalics@gmx.at>
14752
14753 * window.c (delete_deletable_window): Re-add.
14754 (Fset_window_configuration): Rewrite to handle dead buffers and
14755 consequently deletable windows.
14756 (window_tree, Fwindow_tree): Remove. Supply functionality in
14757 window.el.
14758 (compare_window_configurations): Simplify code.
14759
b6e3633c
AS
147602011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14761
1ab0dee5
AS
14762 * image.c (imagemagick_load_image): Fix type mismatch.
14763 (Fimagemagick_types): Likewise.
14764
b6e3633c
AS
14765 * window.h (replace_buffer_in_windows): Declare.
14766
9397e56f
MR
147672011-06-11 Martin Rudalics <rudalics@gmx.at>
14768
14769 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14770 Qclone_number. Remove external declaration of Qdelete_window.
14771 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14772 code.
640c8776
SM
14773 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14774 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
14775 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14776 buffer list implementation.
14777 (other_buffer_safely): New function.
14778 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14779 calls to replace_buffer_in_windows and
14780 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14781 if allowed.
14782 (record_buffer): Inhibit quitting and rewrite using quittable
14783 functions. Run Qbuffer_list_update_hook if allowed.
14784 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
14785 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14786 Move switch-to-buffer to window.el.
9397e56f
MR
14787 (bury-buffer): Move to window.el.
14788 (Vbuffer_list_update_hook): New variable.
14789
14790 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14791 section.
14792
14793 * window.h (resize_frame_windows): Move up in code.
14794 (Fwindow_frame): Remove EXFUN.
14795 (replace_buffer_in_all_windows): Remove prototype.
14796 (replace_buffer_in_windows_safely): Add prototype.
14797
14798 * window.c: Declare Qdelete_window static again. Move down
14799 declaration of select_count.
14800 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14801 (Fother_window): Move to window.el.
14802 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14803 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14804 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14805 window.el.
14806 (replace_buffer_in_windows): Implement by calling
14807 Qreplace_buffer_in_windows.
14808 (replace_buffer_in_all_windows): Remove with some functionality
14809 moved into replace_buffer_in_windows_safely.
14810 (replace_buffer_in_windows_safely): New function.
14811 (select_window_norecord, select_frame_norecord): Move in front
14812 of run_window_configuration_change_hook. Remove now obsolete
14813 declarations.
640c8776
SM
14814 (Fset_window_buffer): Rewrite doc-string.
14815 Call Qrecord_window_buffer.
9397e56f
MR
14816 (keys_of_window): Move binding for other-window to window.el.
14817
b50691aa
CY
148182011-06-11 Chong Yidong <cyd@stupidchicken.com>
14819
14820 * dispextern.h (struct image): Replace data member, whose int_val
14821 and ptr_val fields were not used by anything, with a single
14822 lisp_val object.
14823
14824 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14825 (gif_clear_image, gif_load, imagemagick_load_image)
14826 (gs_clear_image, gs_load): Callers changed.
14827
3f754b86
PE
148282011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14829
cca69397
PE
14830 * buffer.h: Include <time.h>, for time_t.
14831 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14832
109e28d0
PE
14833 Fix minor problems found by static checking.
14834
60737f02
PE
14835 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14836
4b66faf3
PE
14837 Make identifiers static if they are not used in other modules.
14838 * data.c (Qcompiled_function, Qframe, Qvector):
14839 * image.c (QimageMagick, Qsvg):
14840 * minibuf.c (Qmetadata):
14841 * window.c (resize_window_check, resize_root_window): Now static.
14842 * window.h (resize_window_check, resize_root_window): Remove decls.
14843
109e28d0
PE
14844 * window.c (window_deletion_count, delete_deletable_window):
14845 Remove; unused.
46a4ce9e
PE
14846 (window_body_lines): Now static.
14847 (Fdelete_other_windows_internal): Mark vars as initialized.
14848 Make sure 'resize_failed' is initialized.
14849 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14850 (resize_window_apply): Remove unused local.
14851 * window.h (delete_deletable_window): Remove decl.
14852
109e28d0 14853 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
14854 (imagemagick_load_image): Fix pointer signedness problem by changing
14855 last arg from unsigned char * to char *. All uses changed.
14856 Also, fix a local for similar reasons.
14857 Remove unused locals. Remove locals to avoid shadowing.
14858 (fn_rsvg_handle_free): Remove; unused.
14859 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 14860 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 14861
3f754b86
PE
14862 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14863
2547adb1
CY
148642011-06-10 Chong Yidong <cyd@stupidchicken.com>
14865
14866 * image.c (gif_load): Fix omitted cast error introduced by
14867 2011-06-06 change.
14868
2c8e37d4
MR
148692011-06-10 Martin Rudalics <rudalics@gmx.at>
14870
14871 * window.h (resize_proportionally, orig_total_lines)
14872 (orig_top_line): Remove from window structure.
14873 (set_window_height, set_window_width, change_window_heights)
14874 (Fdelete_window): Remove prototypes.
14875 (resize_frame_windows): Remove duplicate declaration.
14876
440a42e3
EZ
148772011-06-10 Eli Zaretskii <eliz@gnu.org>
14878
14879 * window.h (resize_frame_windows, resize_window_check)
14880 (delete_deletable_window, resize_root_window)
14881 (resize_frame_windows): Declare prototypes.
14882
14883 * window.c (resize_window_apply): Make definition be "static" to
14884 match the prototype.
14885
562dd5e9
MR
148862011-06-10 Martin Rudalics <rudalics@gmx.at>
14887
14888 * window.c: Remove declarations of Qwindow_size_fixed,
14889 window_min_size_1, window_min_size_2, window_min_size,
14890 size_window, window_fixed_size_p, enlarge_window, delete_window.
14891 Remove static from declaration of Qdelete_window, it's
14892 temporarily needed by Fbury_buffer.
14893 (replace_window): Don't assign orig_top_line and
14894 orig_total_lines.
14895 (Fdelete_window, delete_window): Remove. Window deletion is
14896 handled by window.el.
640c8776
SM
14897 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14898 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
14899 (Fdelete_other_windows): Remove. Deleting other windows is
14900 handled by window.el.
14901 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14902 handled in window.el.
14903 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14904 Window minimum sizes are handled in window.el.
14905 (shrink_windows, size_window, set_window_height)
14906 (set_window_width, change_window_heights, window_height)
14907 (window_width, CURBEG, CURSIZE, enlarge_window)
14908 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14909 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14910 handled in window.el.
14911 (make_dummy_parent): Rename to make_parent_window and give it a
14912 second argument horflag.
14913 (make_window): Don't set resize_proportionally any more.
14914 (Fsplit_window): Remove. Windows are split in window.el.
14915 (save_restore_action, save_restore_orig_size)
14916 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14917 Resize mini windows in window.el.
14918 (grow_mini_window, shrink_mini_window): Implement by calling
14919 Qresize_root_window_vertically, resize_window_check and
14920 resize_window_apply.
640c8776
SM
14921 (saved_window, Fset_window_configuration, save_window_save):
14922 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
14923 resize_proportionally.
14924 (window_min_height, window_min_width): Move to window.el.
14925 (keys_of_window): Move bindings for delete-other-windows,
14926 split-window, delete-window and enlarge-window to window.el.
14927
14928 * buffer.c: Temporarily extern Qdelete_window.
14929 (Fbury_buffer): Temporarily call Qdelete_window instead of
14930 Fdelete_window (Fbury_buffer will move to window.el soon).
14931
14932 * frame.c (set_menu_bar_lines_1): Remove code handling
14933 orig_top_line and orig_total_lines.
14934
14935 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14936 set_window_height but set heights directly.
14937 (change_frame_size_1): Use resize_frame_windows.
14938
14939 * xdisp.c (init_xdisp): Don't use set_window_height but set
14940 heights directly.
14941
640c8776
SM
14942 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14943 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
14944 run_window_configuration_change_hook.
14945
14946 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14947 instead of change_window_heights and run
14948 run_window_configuration_change_hook.
14949
1a13852e
MR
149502011-06-09 Martin Rudalics <rudalics@gmx.at>
14951
14952 * window.c (replace_window): Rename second argument REPLACEMENT to
14953 NEW. New third argument SETFLAG. Rewrite.
14954 (delete_window, make_dummy_parent): Call replace_window with
14955 third argument 1.
14956 (window_list_1): Move down in code.
14957 (run_window_configuration_change_hook): Move set_buffer part
14958 before select_frame_norecord part in order to unwind correctly.
14959 Rename count1 to count.
14960 (recombine_windows, delete_deletable_window, resize_root_window)
14961 (Fdelete_other_windows_internal)
14962 (Frun_window_configuration_change_hook, make_parent_window)
14963 (resize_window_check, resize_window_apply, Fresize_window_apply)
14964 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14965 (Fdelete_window_internal, Fresize_mini_window_internal):
14966 New functions.
1a13852e
MR
14967 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14968
f3d1777e
MR
149692011-06-08 Martin Rudalics <rudalics@gmx.at>
14970
496e208e
MR
14971 * window.h (window): Add some new members to window structure -
14972 normal_lines, normal_cols, new_total, new_normal, clone_number,
14973 splits, nest, prev_buffers, next_buffers.
14974 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14975 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14976
f3d1777e
MR
14977 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14978 Remove.
496e208e
MR
14979 (make_dummy_parent): Set new members of windows structure.
14980 (make_window): Move down in code. Handle new members of window
14981 structure.
14982 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14983 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14984 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14985 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14986 (Fset_window_next_buffers, Fset_window_clone_number):
14987 New functions.
496e208e
MR
14988 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14989 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14990 Doc-string fixes.
14991 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14992 Argument WINDOW can be now internal window too.
14993 (Fwindow_use_time): Move up in code.
14994 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14995 Rewrite doc-string.
14996 (Fset_window_configuration, saved_window)
14997 (Fcurrent_window_configuration, save_window_save): Handle new
14998 members of window structure.
b9e809c2
MR
14999 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15000 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15001 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15002 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15003 Qget_mru_window, Qresize_root_window,
15004 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15005 Qauto_buffer_name; staticpro them.
f3d1777e 15006
abde8f8c
MR
150072011-06-07 Martin Rudalics <rudalics@gmx.at>
15008
15009 * window.c (Fwindow_total_size, Fwindow_left_column)
15010 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15011 (Fwindow_list_1): New functions.
15012 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
15013 (Fwindow_width, Fscroll_left, Fscroll_right):
15014 Use window_body_cols instead of window_box_text_cols.
15015 (delete_window, Fset_window_configuration):
15016 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
15017 (delete_all_subwindows): Take a window as argument and not a
15018 structure. Rewrite.
190b47e6
MR
15019 (window_loop): Remove handling of GET_LRU_WINDOW and
15020 GET_LARGEST_WINDOW.
15021 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
15022
15023 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
15024 window_box_text_cols. delete_all_subwindows now takes a
15025 Lisp_Object as argument.
abde8f8c 15026
640c8776
SM
15027 * indent.c (compute_motion, Fcompute_motion):
15028 Use window_body_cols instead of window_box_text_cols.
abde8f8c 15029
fa8a67e6
MR
15030 * frame.c (delete_frame): Call delete_all_subwindows with root
15031 window as argument.
15032
a54e3482
DC
150332011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15034
15035 * fns.c (Fputhash): Document return value.
15036
60002bf5
CY
150372011-06-06 Chong Yidong <cyd@stupidchicken.com>
15038
15039 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15040
0c671da6 150412011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 15042
b862a52a 15043 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 15044
be44ca6c
PE
15045 Check for overflow when converting integer to cons and back.
15046 * charset.c (Fdefine_charset_internal, Fdecode_char):
15047 Use cons_to_unsigned to catch overflow.
15048 (Fencode_char): Use INTEGER_TO_CONS.
15049 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15050 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15051 * data.c (long_to_cons, cons_to_long): Remove.
15052 (cons_to_unsigned, cons_to_signed): New functions.
15053 These signal an error for invalid or out-of-range values.
15054 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15055 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15056 * font.c (Ffont_variation_glyphs):
15057 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15058 * lisp.h: Include <intprops.h>.
15059 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15060 (cons_to_signed, cons_to_unsigned): New decls.
15061 (long_to_cons, cons_to_long): Remove decls.
15062 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15063 (Fprimitive_undo): Use CONS_TO_INTEGER.
15064 * xfns.c (Fx_window_property): Likewise.
15065 * xselect.c: Include <limits.h>.
15066 (x_own_selection, selection_data_to_lisp_data):
15067 Use INTEGER_TO_CONS.
15068 (x_handle_selection_request, x_handle_selection_clear)
15069 (x_get_foreign_selection, Fx_disown_selection_internal)
15070 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15071 (lisp_data_to_selection_data): Use cons_to_unsigned.
15072 (x_fill_property_data): Use cons_to_signed.
15073 Report values out of range.
15074
d1f3d2af
PE
15075 Check for buffer and string overflow more precisely.
15076 * buffer.h (BUF_BYTES_MAX): New macro.
15077 * lisp.h (STRING_BYTES_MAX): New macro.
15078 * alloc.c (Fmake_string):
15079 * character.c (string_escape_byte8):
15080 * coding.c (coding_alloc_by_realloc):
15081 * doprnt.c (doprnt):
15082 * editfns.c (Fformat):
15083 * eval.c (verror):
15084 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15085 since they may not be the same number.
15086 * editfns.c (Finsert_char):
15087 * fileio.c (Finsert_file_contents):
15088 Likewise for BUF_BYTES_MAX.
15089
dd52fcea
PE
15090 * image.c: Use ptrdiff_t, not int, for sizes.
15091 (slurp_file): Switch from int to ptrdiff_t.
15092 All uses changed.
15093 (slurp_file): Check that file size fits in both size_t (for
15094 malloc) and ptrdiff_t (for sanity and safety).
15095
7f9bbdbb
PE
15096 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15097 if b->modtime has its maximal value.
15098
dfe18f82
PE
15099 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15100
84acfcf0
PE
15101 Don't assume time_t can fit into int.
15102 * buffer.h (struct buffer.modtime): Now time_t, not int.
15103 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15104 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15105
ccd9a01a
PE
15106 Minor fixes for signed vs unsigned integers.
15107 * character.h (MAYBE_UNIFY_CHAR):
15108 * charset.c (maybe_unify_char):
15109 * keyboard.c (read_char, reorder_modifiers):
15110 XINT -> XFASTINT, since the integer must be nonnegative.
15111 * ftfont.c (ftfont_spec_pattern):
15112 * keymap.c (access_keymap, silly_event_symbol_error):
15113 XUINT -> XFASTINT, since the integer must be nonnegative.
15114 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15115 since it makes no difference and we prefer signed.
15116 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15117 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15118 nonnegative.
15119
d6d100dd
SM
151202011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15121
15122 * window.h (Fwindow_frame): Declare.
15123
2b6148e4
PE
151242011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15125
15126 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15127 (SPARE_MEMORY): Always define.
15128 (LARGE_REQUEST): Remove.
15129 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15130
f230ecc9
MR
151312011-06-06 Martin Rudalics <rudalics@gmx.at>
15132
727e958e
MR
15133 * lisp.h: Move EXFUNS for Fframe_root_window,
15134 Fframe_first_window and Fset_frame_selected_window to window.h.
15135
15136 * window.h: Move EXFUNS for Fframe_root_window,
15137 Fframe_first_window and Fset_frame_selected_window here from
15138 lisp.h.
15139
15140 * frame.c (Fwindow_frame, Fframe_first_window)
15141 (Fframe_root_window, Fframe_selected_window)
15142 (Fset_frame_selected_window): Move to window.c.
15143 (Factive_minibuffer_window): Move to minibuf.c.
15144 (Fother_visible_frames_p): New function.
15145
15146 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15147
f230ecc9
MR
15148 * window.c (decode_window, decode_any_window): Move up in code.
15149 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15150 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
15151 (Fwindow_buffer): Move up and rewrite doc-string.
15152 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15153 (Fwindow_prev): New functions.
727e958e
MR
15154 (Fwindow_frame): Move here from frame.c. Accept any window as
15155 argument.
15156 (Fframe_root_window, Fframe_first_window)
15157 (Fframe_selected_window): Move here from frame.c. Accept frame
15158 or arbitrary window as argument. Update doc-strings.
15159 (Fminibuffer_window): Move up in code.
15160 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
15161 (Fset_frame_selected_window): Move here from frame.c.
15162 Marginal rewrite.
727e958e
MR
15163 (Fselected_window, select_window, Fselect_window): Move up in
15164 code. Minor doc-string fixes.
f230ecc9 15165
4d09bcf6
PE
151662011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15167
15168 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15169 Do not assume that spare memory exists; that assumption is valid
15170 only if SYSTEM_MALLOC.
15171 (LARGE_REQUEST): New macro, so that the issue of large requests
15172 is separated from the issue of spare memory.
15173
810928a2
AS
151742011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15175
172418ad
AS
15176 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15177 format. (Bug#8806)
15178
43f862f7
AS
15179 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15180
810928a2
AS
15181 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15182 before statements.
15183
a059fe24
JD
151842011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15185
15186 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15187
15188 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15189
15190 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15191 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15192
989bf368
JB
151932011-06-05 Juanma Barranquero <lekktu@gmail.com>
15194
15195 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15196
4b80f674
CY
151972011-06-04 Chong Yidong <cyd@stupidchicken.com>
15198
15199 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15200 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
15201 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15202 New error handlers.
4b80f674
CY
15203 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15204 Obey Vx_select_enable_clipboard_manager. Catch errors in
15205 x_clipboard_manager_save (Bug#8779).
15206 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 15207 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 15208
99a33b77 152092011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
15210
15211 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15212
99a33b77 152132011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
15214
15215 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15216 in the current matrix if keep_current_p is non-zero.
15217
8264569d
EZ
152182011-06-04 Eli Zaretskii <eliz@gnu.org>
15219
15220 * bidi.c (bidi_level_of_next_char): Fix last change.
15221
57f97249
EZ
152222011-06-03 Eli Zaretskii <eliz@gnu.org>
15223
fec2107c 15224 Support bidi reordering of text covered by display properties.
57f97249 15225
fec2107c
EZ
15226 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15227 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15228 (bidi_cache_search, bidi_cache_iterator_state)
15229 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
15230 (bidi_level_of_next_char, bidi_move_to_visually_next):
15231 Support character positions inside a run of characters covered by a
fec2107c
EZ
15232 display string.
15233 (bidi_paragraph_init, bidi_resolve_explicit_1)
15234 (bidi_level_of_next_char): Call bidi_fetch_char and
15235 bidi_fetch_char_advance instead of FETCH_CHAR and
15236 FETCH_CHAR_ADVANCE.
15237 (bidi_init_it): Initialize new members.
15238 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15239 definitions.
15240 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15241 instead of using explicit *_CHAR codes.
d6d100dd
SM
15242 (bidi_resolve_explicit, bidi_resolve_weak):
15243 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
15244 bidirectional text is supported only in multibyte buffers.
15245 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15246 it to initialize the frame_window_p member of struct bidi_it.
15247 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15248 (bidi_resolve_explicit, bidi_resolve_weak)
15249 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15250 bidi_it->nchars is non-positive.
15251 (bidi_level_of_next_char): Don't try to lookup the cache for the
15252 next/previous character if nothing is cached there yet, or if we
15253 were just reseat()'ed to a new position.
c40e2fb2 15254
0e14fe90
EZ
15255 * xdisp.c (set_cursor_from_row): Set start and stop points
15256 according to the row's direction when priming the loop that looks
15257 for the glyph on which to display cursor.
15258 (single_display_spec_intangible_p): Function deleted.
15259 (display_prop_intangible_p): Reimplement to call
15260 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
15261 Accept 3 additional arguments needed by handle_display_spec.
15262 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
15263 values: lists, `(when COND...)' forms, etc.
15264 (single_display_spec_string_p): Support property values that are
15265 lists with the argument STRING its top-level element.
15266 (display_prop_string_p): Fix the condition for processing a
15267 property that is a list to be consistent with handle_display_spec.
fec2107c 15268 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
15269 last portion of handle_display_prop.
15270 (compute_display_string_pos): Accept additional argument
15271 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15272 value of a `display' property is a "replacing spec".
15273 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15274 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15275 the display property, but just return a value indicating whether
15276 the display property will replace the characters it covers.
15277 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15278 frame_window_p members of struct bidi_it.
d6d100dd
SM
15279 (compute_display_string_pos, compute_display_string_end):
15280 New functions.
fec2107c
EZ
15281 (push_it): Accept second argument POSITION, where pop_it should
15282 jump to continue iteration.
15283 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 15284
fec2107c
EZ
15285 * keyboard.c (adjust_point_for_property): Adjust the call to
15286 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
15287
15288 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
15289 (bidi_init_it): Update prototypes.
15290 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
15291 (compute_display_string_pos, compute_display_string_end):
15292 Declare prototypes.
fec2107c
EZ
15293 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15294 EMACS_INT.
fc6f18ce 15295
40087514 152962011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 15297
57f53182
PE
15298 Malloc failure behavior now depends on size of allocation.
15299 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15300 * lisp.h: Change signatures accordingly.
15301 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15302 All callers changed. (Bug#8762)
15303
15304 * gnutls.c: Use Emacs's memory allocators.
15305 Without this change, the gnutls library would invoke malloc etc.
15306 directly, which causes problems on non-SYNC_INPUT hosts, and which
15307 runs afoul of improving memory_full behavior. (Bug#8761)
15308 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15309 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15310 xfree instead of the default malloc, realloc, free.
15311 (Fgnutls_boot): No need to check for memory allocation failure,
15312 since xmalloc does that for us.
15313
ac32cd99 15314 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
15315 * category.c (hash_get_category_set):
15316 * ccl.c (ccl_driver):
15317 * charset.c (Fdefine_charset_internal):
15318 * charset.h (struct charset.hash_index):
15319 * composite.c (get_composition_id, gstring_lookup_cache)
15320 (composition_gstring_put_cache):
15321 * composite.h (struct composition.hash_index):
15322 * dispextern.h (struct image.hash):
15323 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15324 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15325 (hashfn_equal, hashfn_user_defined, make_hash_table)
15326 (maybe_resize_hash_table, hash_lookup, hash_put)
15327 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15328 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15329 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15330 * image.c (make_image, search_image_cache, lookup_image)
15331 (xpm_put_color_table_h):
15332 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 15333 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 15334 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 15335 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
15336 * alloc.c (allocate_vectorlike):
15337 Check for overflow in vector size calculations.
15338 * ccl.c (ccl_driver):
15339 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
15340 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15341 need to be updated by these changes.
40087514
PE
15342 * fns.c (make_hash_table, maybe_resize_hash_table):
15343 Check for integer overflow with large hash tables.
0de4bb68
PE
15344 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15345 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15346 (SXHASH_REDUCE): New macro.
15347 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15348 Use it instead of discarding useful hash info with large hash values.
15349 (sxhash_float): New function.
15350 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15351 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
15352 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15353 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
15354 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15355 Adjust signatures to match updated version of code.
15356 (consing_since_gc): Now EMACS_INT, since a single hash table can
15357 use more than INT_MAX bytes.
15358
698d32e2
DN
153592011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15360
15361 Make it possible to build with GCC-4.6+ -O2 -flto.
15362
15363 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15364
fd6fa53f
SM
153652011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15366
15367 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15368 Call minibuffer-inactive-mode.
15369
864db017
JB
153702011-05-31 Juanma Barranquero <lekktu@gmail.com>
15371
15372 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15373 Update dependencies.
15374
2ad0baf4
DN
153752011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15376
15377 * data.c (init_data): Remove code for UTS, this system is not
15378 supported anymore.
15379
4fcc2638
DN
153802011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15381
15382 Don't force ./temacs to start in terminal mode.
15383
15384 * frame.c (make_initial_frame): Initialize faces in all cases, not
15385 only when CANNOT_DUMP is defined.
15386 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15387
c56e0fd5
DN
153882011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15389
15390 * dispnew.c (add_window_display_history): Use const for the string
15391 pointer. Remove declaration, not needed.
15392
333d54da 153932011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 15394
55d4c1b2 15395 Use 'inline', not 'INLINE'.
333d54da 15396 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
15397 * alloc.c, fontset.c (INLINE): Remove.
15398 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15399 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15400 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15401 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15402 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15403
738db178
DN
154042011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15405
15406 Make it possible to run ./temacs.
15407
15408 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15409 syms_of_callproc does the same thing. Remove test for
15410 "initialized", do it in the caller.
15411 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15412
620c53a6
SM
154132011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15414
15415 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15416 (read_minibuf): Use get_minibuffer.
15417 (syms_of_minibuf): Use DEFSYM.
15418 (Qmetadata): New var.
15419 * data.c (Qbuffer): Don't make it static.
15420 (syms_of_data): Use DEFSYM.
15421
e003a292
PE
154222011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15423
15424 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15425 (CCL_CODE_MIN): New macro.
15426
ed008a6d
PE
154272011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15428
3687c2ef
PE
15429 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15430
ed008a6d
PE
15431 * eval.c (Qdebug): Now static.
15432 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15433 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15434 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15435
d66c4c7c
CY
154362011-05-29 Chong Yidong <cyd@stupidchicken.com>
15437
15438 * image.c: Various fixes to ImageMagick code comments.
15439 (Fimagemagick_types): Doc fix.
15440
5fbc2025
PE
154412011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15442
0196f88a
PE
15443 Minor fixes prompted by GCC 4.6.0 warnings.
15444
15445 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15446
5fbc2025
PE
15447 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15448 (x_clipboard_manager_save_all): Move extern decl to ...
15449 * xterm.h: ... here, so that it can be checked for consistency.
15450
1dd3c2d9
CY
154512011-05-29 Chong Yidong <cyd@stupidchicken.com>
15452
15453 * xselect.c (x_clipboard_manager_save_frame)
15454 (x_clipboard_manager_save_all): New functions.
15455 (Fx_clipboard_manager_save): Lisp function deleted.
15456
15457 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15458 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15459
15460 * xterm.h: Update prototype.
15461
5ba6571d
WX
154622011-05-28 William Xu <william.xwl@gmail.com>
15463
15464 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15465 exiting (Bug#8239).
15466
3eaff834
JM
154672011-05-28 Jim Meyering <meyering@redhat.com>
15468
e1900994 15469 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
15470 * fns.c (to_uchar): Define.
15471 (crypto_hash_function): Use it to convert some newly-signed
15472 variables to unsigned, to avoid sign-extension bugs. For example,
15473 without this change, (md5 "truc") would evaluate to
15474 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15475 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 15476 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 15477
0f6990a7
PE
154782011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15479
15480 Integer overflow fixes.
c8a9ca5a 15481
08686060
PE
15482 * dbusbind.c: Serial number integer overflow fixes.
15483 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
15484 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15485 to hold a serial number that is too large for a fixnum.
15486 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15487 Check for serial numbers out of range. Decode any serial number
59568bf0 15488 that was so large that it became a float. (Bug#8722)
08686060 15489
2d1fc3c7
PE
15490 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15491 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15492 Use XFASTINT rather than XUINT when numbers are nonnegative.
15493 (xd_append_arg, Fdbus_method_return_internal):
15494 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15495 arguments, check that Lisp number is nonnegative, rather than
59568bf0 15496 silently wrapping negative numbers around. (Bug#8722)
30217ff0 15497 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 15498 (Bug#8722)
2d1fc3c7 15499
c8a9ca5a
PE
15500 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15501
519e1d69
PE
15502 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15503
6df6ae42 15504 ccl: Add integer overflow checks.
30569699
PE
15505 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15506 (IN_INT_RANGE): New macros.
15507 (ccl_driver): Use them to check for integer overflow when
15508 decoding a CCL program. Many of the new checks are whether XINT (x)
15509 fits in int; it doesn't always, on 64-bit hosts. The new version
15510 doesn't catch all possible integer overflows, but it's an
847044ea 15511 improvement. (Bug#8719)
30569699 15512
c11285dc
PE
15513 * alloc.c (make_event_array): Use XINT, not XUINT.
15514 There's no need for unsigned here.
15515
fdccd48e
PE
15516 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15517 This follows up to the 2011-05-06 change that substituted uintptr_t
15518 for EMACS_INT. This case wasn't caught back then.
15519
37910ab2
PE
15520 Rework Fformat to avoid integer overflow issues.
15521 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15522 now (part of C89). Include <verify.h>.
15523 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15524 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15525 (Fformat): Avoid the prepass trying to compute sizes; it was only
15526 approximate and thus did not catch overflow reliably. Instead, walk
15527 through the format just once, formatting and computing sizes as we go,
15528 checking for integer overflow at every step, and allocating a larger
15529 buffer as needed. Keep track separately whether the format is
15530 multibyte. Keep only the most-recently calculated precision, rather
15531 than them all. Record whether each argument has been converted to
15532 string. Use EMACS_INT, not int, for byte and char and arg counts.
15533 Support field widths and precisions larger than INT_MAX. Avoid
15534 sprintf's undefined behavior with conversion specifications such as %#d
15535 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15536 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15537 formatting out-of-range floating point numbers with int
9173deec 15538 formats. (Bug#8668)
37910ab2 15539
2e6578fb
PE
15540 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15541
0ae6bdee
PE
15542 * data.c: Avoid integer truncation in expressions involving floats.
15543 * data.c: Include <intprops.h>.
15544 (arith_driver): When there's an integer overflow in an expression
15545 involving floating point, convert the integers to floating point
15546 so that the resulting value does not suffer from catastrophic
15547 integer truncation. For example, on a 64-bit host (* 4
15548 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15549 Do not rely on undefined behavior after integer overflow.
15550
de883a70
PE
15551 merge count_size_as_multibyte, parse_str_to_multibyte
15552 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 15553 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
15554 Check for integer overflow.
15555 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15556 since it's now a duplicate of the other. This is more of
15557 a character than a buffer op, so better that it's in character.c.
15558 * fns.c, print.c: Adjust to above changes.
15559
2ff916cb
PE
155602011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15561
15562 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15563
f1b54466
PE
155642011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15565
fb1ac845
PE
15566 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15567 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15568 (x_clipboard_manager_save): Now static.
15569 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15570
f1b54466
PE
15571 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15572 (crypto_hash_function): Now static.
15573 Fix pointer signedness problems. Avoid unnecessary initializations.
15574
a9f737ee
CY
155752011-05-27 Chong Yidong <cyd@stupidchicken.com>
15576
15577 * termhooks.h (Vselection_alist): Make it terminal-local.
15578
15579 * terminal.c (create_terminal): Initialize it.
15580
15581 * xselect.c: Support for clipboard managers.
15582 (Vselection_alist): Move to termhooks.h as terminal-local var.
15583 (LOCAL_SELECTION): New macro.
15584 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15585 (symbol_to_x_atom): Remove gratuitous arg.
15586 (x_handle_selection_request, lisp_data_to_selection_data)
15587 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
15588 (x_own_selection, x_get_local_selection, x_convert_selection):
15589 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
15590 (some_frame_on_display): Delete unused function.
15591 (Fx_own_selection_internal, Fx_get_selection_internal)
15592 (Fx_disown_selection_internal, Fx_selection_owner_p)
15593 (Fx_selection_exists_p): New optional frame arg.
15594 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15595 (x_handle_selection_clear): Don't treat other terminals with the
15596 same keyboard specially. Use the terminal-local Vselection_alist.
15597 (x_clear_frame_selections): Use Frun_hook_with_args.
15598
15599 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15600
15601 * xterm.h: Add support for those atoms.
15602
e067f0c1
CY
156032011-05-26 Chong Yidong <cyd@stupidchicken.com>
15604
15605 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15606 (converted_selections, conversion_fail_tag): New global variables.
15607 (x_selection_request_lisp_error): Free the above.
15608 (x_get_local_selection): Remove unnecessary code.
15609 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
15610 of converted selections stored in converted_selections.
15611 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
15612 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15613 (x_convert_selection): New function.
15614 (x_handle_selection_event): Simplify.
15615 (x_get_foreign_selection): Don't ignore incoming requests while
15616 waiting for an answer; this will fail when we implement
15617 SAVE_TARGETS, and seems unnecessary anyway.
15618 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15619 (Vx_sent_selection_functions): Doc fix.
15620
0f4aebc0
LL
156212011-05-26 Leo Liu <sdl.web@gmail.com>
15622
15623 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15624
e61124cd
YM
156252011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15626
15627 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15628
15629 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15630 for fringe update if it has periodic bitmap.
ac389d0c 15631 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
15632 and fringe_bitmap_periodic_p.
15633
15634 * fringe.c (get_fringe_bitmap_data): New function.
15635 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15636 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15637 row. Mark glyph row for fringe update if periodicity changed.
15638
15639 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15640 for fringe update unless it has periodic bitmap.
15641
f16d9837
KH
156422011-05-25 Kenichi Handa <handa@m17n.org>
15643
15644 * xdisp.c (get_next_display_element): Set correct it->face_id for
15645 a static composition.
15646
e1b90ef6
LL
156472011-05-24 Leo Liu <sdl.web@gmail.com>
15648
15649 * deps.mk (fns.o):
15650 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15651
15652 * fns.c (crypto_hash_function, Fsha1): New function.
15653 (Fmd5): Use crypto_hash_function.
15654 (syms_of_fns): Add Ssha1.
15655
7400048f
PE
156562011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15657
15658 * gnutls.c: Remove unused macros.
15659 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15660 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15661 Remove macros that are defined and never used.
15662 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15663
abb71cf4
CY
156642011-05-22 Chong Yidong <cyd@stupidchicken.com>
15665
15666 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15667 (Fx_get_selection_internal): Minor cleanup.
15668 (Fx_own_selection_internal): Rename arguments for consistency with
15669 select.el.
15670
6307db39
PE
156712011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15672
15673 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15674
f3d4e0a4
CY
156752011-05-22 Chong Yidong <cyd@stupidchicken.com>
15676
15677 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15678
4d8ade89
YM
156792011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15680
15681 * dispnew.c (scrolling_window): Don't exclude the case that the
15682 last enabled row in the desired matrix touches the bottom boundary.
15683
32078c8d
GM
156842011-05-21 Glenn Morris <rgm@gnu.org>
15685
15686 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
15687 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15688 and add some more files.
32078c8d 15689
7285dc67
EZ
156902011-05-20 Eli Zaretskii <eliz@gnu.org>
15691
15692 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15693 report_file_error introduced by the change from 2011-05-07.
15694
89d1bd22
PE
156952011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15696
15697 * systime.h (Time): Define only if emacs is defined.
15698 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15699 where the include path doesn't have X11/X.h by default. See
15700 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15701
cd394be1 157022011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
15703
15704 * composite.c (find_automatic_composition): Fix previous change.
15705
b9704ad9
GM
157062011-05-20 Glenn Morris <rgm@gnu.org>
15707
15708 * lisp.mk: New file, split from Makefile.in.
15709 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15710 (shortlisp): Remove.
15711 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15712
4a720484
GM
157132011-05-19 Glenn Morris <rgm@gnu.org>
15714
15715 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15716 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15717 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15718 (lisp): Set the order to that of loadup.el.
15719 (shortlisp): Make it a copy of $lisp.
15720 (SOME_MACHINE_LISP): Remove.
15721 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15722 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15723
a28d4396
KH
157242011-05-18 Kenichi Handa <handa@m17n.org>
15725
15726 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15727 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15728 (find_automatic_composition): Mostly rewrite for efficiency.
15729
a2b1fa8e
JB
157302011-05-18 Juanma Barranquero <lekktu@gmail.com>
15731
15732 * makefile.w32-in: Update dependencies.
15733
8e1f5610
CS
157342011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15735
15736 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 15737 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 15738
7025ee00 157392011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 15740
cdfa6eab
PE
15741 Fix some integer overflow issues, such as string length overflow.
15742
06d6db33
PE
15743 * insdel.c (count_size_as_multibyte): Check for string overflow.
15744
2b4560a8
PE
15745 * character.c (lisp_string_width): Check for string overflow.
15746 Use EMACS_INT, not int, for string indexes and lengths; in
15747 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15748 the resulting string length overflows an EMACS_INT; instead,
15749 report a string overflow if no precision given. When checking for
15750 precision exhaustion, use a check that cannot possibly have
15751 integer overflow. (Bug#8675)
15752 * character.h (lisp_string_width): Adjust to new signature.
15753
cb93f9be
PE
15754 * alloc.c (string_overflow): New function.
15755 (Fmake_string): Use it. This doesn't change behavior, but saves
15756 a few bytes and will simplify future changes.
15757 * character.c (string_escape_byte8): Likewise.
15758 * lisp.h (string_overflow): New decl.
15759
1a1f3366
PE
15760 Fixups, following up to the user-interface timestamp change.
15761 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15762 for UI timestamps, instead of unsigned long.
9fbd6841
PE
15763 * msdos.c (mouse_get_pos): Likewise.
15764 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
15765 * w32gui.h (Time): Define by including "systime.h" rather than by
15766 declaring it ourselves. (Bug#8664)
15767
d4e3e4d3
PE
15768 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15769 * image.c (clear_image_cache): Likewise.
15770
f6a24d19
PE
15771 * term.c (term_mouse_position): Don't assume time_t wraparound.
15772
08dc5ae6
PE
15773 Be more systematic about user-interface timestamps.
15774 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
15775 and sometimes 'EMACS_UINT', to represent these timestamps.
15776 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
15777 This makes the code easier to follow, and makes it easier to catch
15778 integer overflow bugs such as Bug#8664.
15779 * frame.c (Fmouse_position, Fmouse_pixel_position):
15780 Use Time, not unsigned long, for user-interface timestamps.
15781 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15782 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15783 * keyboard.h (last_event_timestamp): Likewise.
15784 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15785 * menu.h (xmenu_show): Likewise.
15786 * term.c (term_mouse_position): Likewise.
15787 * termhooks.h (struct input_event.timestamp): Likewise.
15788 (struct terminal.mouse_position_hook): Likewise.
15789 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15790 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15791 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15792 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15793 what it was before.
15794 * menu.h, termhooks.h: Include "systime.h", for Time.
15795
8e55734a
PE
15796 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15797 Don't assume that the difference between two unsigned long values
15798 can fit into an integer. At this point, we know button_down_time
15799 <= event->timestamp, so the difference must be nonnegative, so
15800 there's no need to cast the result if double-click-time is
15801 nonnegative, as it should be; check that it's nonnegative, just in
15802 case. This bug is triggered when events are more than 2**31 ms
86db42d2 15803 apart (about 25 days). (Bug#8664)
8e55734a 15804
841f1b75 15805 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 15806 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 15807
3e26f69c
PE
15808 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15809 that always fit in int. Use a sentinel instead of a counter, to
15810 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
15811 * frame.h (struct frame): Use int for menu_bar_items_used
15812 instead of EMACS_INT, since it always fits in int.
3e26f69c 15813
5cc152c0
PE
15814 * menu.c (grow_menu_items): Check for int overflow.
15815
d89eb65e
PE
15816 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15817
5235bd3e
PE
15818 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15819 Before, the code was not consistent. These values cannot exceed
15820 2**31 - 1 so there's no need to make them unsigned.
15821 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15822 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15823 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15824 as modifiers.
15825 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15826
bc827e23
PE
15827 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15828 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15829 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15830 presumably because the widths might not match.
15831
78eb494e
PE
15832 * window.c (size_window): Avoid needless test at loop start.
15833
04f2d78b
CB
158342011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15835
15836 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15837
d2fc7e3d 158382011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
15839
15840 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15841
d2fc7e3d 158422011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
15843
15844 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15845 `width' to `bar_area_x' and `bar_area_width', respectively.
15846 (x_scroll_run): Take account of fringe background extension.
15847
04f2d78b
CB
15848 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15849 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
15850 `bar_area_width', respectively.
15851 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15852 background extension.
15853
79b70037
GM
158542011-05-10 Jim Meyering <meyering@redhat.com>
15855
15856 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15857
2f142cc5
JB
158582011-05-10 Juanma Barranquero <lekktu@gmail.com>
15859
15860 * image.c (Finit_image_library): Return t for built-in image types,
15861 like pbm and xbm. (Bug#8640)
15862
57679c86
AS
158632011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15864
15865 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15866
888c9e86
EZ
158672011-05-07 Eli Zaretskii <eliz@gnu.org>
15868
b0512a1d
EZ
15869 * w32console.c (Fset_screen_color): Doc fix.
15870 (Fget_screen_color): New function.
15871 (syms_of_ntterm): Defsubr it.
15872
7285dc67
EZ
15873 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15874 unlink the temporary file if Fcall_process didn't create it in the
15875 first place.
15876 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15877 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
15878 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15879 cue to call_process_cleanup not to close that handle.
15880
4d3fcc8e
BK
158812011-05-07 Ben Key <bkey76@gmail.com>
15882
15883 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15884 one of two shell specific rules, either bootstrap-temacs-CMD or
15885 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15886 to the previous implementation of the bootstrap-temacs rule.
15887 The bootstrap-temacs-CMD rule is similar to the previous
15888 implementation of the bootstrap-temacs rule except that it
15889 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15890 variable.
15891
15892 These changes, along with some changes to nt/configure.bat,
15893 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15894 earlier fix to add support for --cflags and --ldflags options
15895 that include quotes so that it works whether make uses cmd or
15896 sh as the shell.
15897
b4289b64
MA
158982011-05-06 Michael Albinus <michael.albinus@gmx.de>
15899
15900 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15901 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15902 is a constant.
15903 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15904 a string. Handle both cases.
15905 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15906 (Fdbus_register_method): Use Qinvalid_function.
15907
af4c0e28
JB
159082011-05-06 Juanma Barranquero <lekktu@gmail.com>
15909
15910 * makefile.w32-in: Update dependencies.
15911 (LISP_H): Add inttypes.h and stdin.h.
15912 (PROCESS_H): Add unistd.h.
15913
c51453d9
EZ
159142011-05-06 Eli Zaretskii <eliz@gnu.org>
15915
15916 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15917 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15918
8ff0ac3c 159192011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 15920
4c4b566b
PE
15921 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15922
aab2b9b5
PE
15923 * term.c (vfatal): Remove stray call to va_end.
15924 It's not needed and the C Standard doesn't allow it here anyway.
15925
c378da0b
PE
15926 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15927 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15928
288b08c7
PE
15929 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15930 bytes.
15931
e3601888
PE
15932 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15933
db6c0e74
PE
15934 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15935
dd5963ea
PE
15936 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15937
88c9450f
PE
15938 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15939
2f9442b8
PE
15940 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15941
c032b5f8
PE
15942 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15943 * charset.c (Fdefine_charset_internal): Don't initialize
15944 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 15945 32-bit int (Bug#8600).
a108c10b
PE
15946
15947 * lread.c (read_integer): Be more consistent with string-to-number.
15948 Use string_to_number to do the actual conversion; this avoids
15949 rounding errors and fixes some other screwups. Without this fix,
15950 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15951 (digit_to_number): Move earlier, for benefit of read_integer.
15952 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 15953 not a digit in any supported base. (Bug#8602)
a108c10b 15954
ad5f9eea
PE
15955 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15956
aec1708a
PE
15957 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15958 to match comment at start of function. This also removes a
15959 GCC warning about overflow in a 32+64-bit port.
15960
47be4ab5
PE
15961 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15962
371cac43
PE
15963 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15964 Reported by Stefan Monnier in
15965 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15966 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15967 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15968
d01a7826
PE
15969 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15970 (EMACS_UINTPTR): Likewise, with uintptr_t.
15971
7fd47d5c
PE
15972 * lisp.h: Prefer 64-bit EMACS_INT if available.
15973 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15974 on 32-bit hosts that have 64-bit int, so that they can access
15975 large files.
122b0c86
PE
15976 However, temporarily disable this change unless the temporary
15977 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15978
8727937b
PE
15979 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15980
8ac068ac
PE
15981 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15982 This removes an assumption that EMACS_INT and long are the same
15983 width as pointers. The assumption is true for Emacs porting targets
15984 now, but we want to make other targets possible.
15985 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15986 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15987 In the rest of the code, change types of integers that hold casted
15988 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15989 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15990 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15991 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15992 No need to cast type when ORing.
15993 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15994 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15995 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15996 assume EMACS_INT is the same width as char *.
15997 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15998 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15999 Remove no-longer-needed casts.
16000 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16001 (xg_tool_bar_help_callback, xg_make_tool_item):
16002 Use EMACS_INTPTR to hold an integer
16003 that will be cast to void *; this can avoid a GCC warning
16004 if EMACS_INT is not the same width as void *.
16005 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16006 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16007 (current_message_1, set_message_1):
16008 Use a local to convert to proper width without a cast.
16009 * xmenu.c (dialog_selection_callback): Likewise.
16010
ede49d71
PE
16011 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16012 Also, don't assume VALBITS / RAND_BITS is less than 5,
16013 and don't rely on undefined behavior when shifting a 1 left into
16014 the sign bit.
16015 * lisp.h (get_random): Change signature to match.
16016
2f30ecd0
PE
16017 * lread.c (hash_string): Use size_t, not int, for hash computation.
16018 Normally we prefer signed values; but hashing is special, because
16019 it's better to use unsigned division on hash table sizes so that
16020 the remainder is nonnegative. Also, size_t is the natural width
16021 for hashing into memory. The previous code used 'int', which doesn't
16022 retain enough info to hash well into very large tables.
16023 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16024
2a866e7b
PE
16025 * dbusbind.c: Don't possibly lose pointer info when converting.
16026 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16027 Use XPNTR rather than XHASH, so that the high-order bits of
16028 the pointer aren't lost when converting through void *.
16029
51639eac
PE
16030 * eval.c (Fautoload): Don't double-shift a pointer.
16031
92394119
PE
16032 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16033
dbdb9a7c
JB
160342011-05-06 Juanma Barranquero <lekktu@gmail.com>
16035
16036 * gnutls.c (DEF_GNUTLS_FN):
16037 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16038
db7a0b4f
AS
160392011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16040
16041 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16042 marker. (Bug#8610)
16043
cd394be1 160442011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
16045
16046 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16047 New version that can reserve upto 2GB of heap space.
16048
f7ff1b0f 160492011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
16050
16051 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16052
639c109b
TZ
160532011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16054
16055 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16056 `gnutls_certificate_set_x509_key_file'.
16057
d2127135
JB
160582011-05-05 Juanma Barranquero <lekktu@gmail.com>
16059
16060 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16061 Update dependencies.
16062
e968f4f3
JB
160632011-05-04 Juanma Barranquero <lekktu@gmail.com>
16064
16065 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16066 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16067 Remove unused parameter `fildes'.
16068 * process.c (read_process_output, send_process): Don't pass it.
16069
84d358f0
JB
160702011-05-04 Juanma Barranquero <lekktu@gmail.com>
16071
16072 Fix previous change: the library cache is defined in w32.c.
16073 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16074 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16075
0898ca10
JB
160762011-05-04 Juanma Barranquero <lekktu@gmail.com>
16077
16078 Implement dynamic loading of GnuTLS on Windows.
16079
16080 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16081 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16082 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16083 Declare.
16084
16085 * gnutls.c (Qgnutls_dll): Define.
16086 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16087 (gnutls_*): Declare function pointers.
16088 (init_gnutls_functions): New function to initialize function pointers.
16089 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16090 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16091 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16092 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16093 (emacs_gnutls_write, emacs_gnutls_read)
16094 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16095 (Fgnutls_available_p): New function.
16096 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16097 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16098 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16099
16100 * image.c: Include w32.h.
16101 (Vimage_type_cache): Delete.
16102 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16103 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16104 (w32_delayed_load): Move to w32.c.
16105
16106 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16107
16108 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16109 (w32_delayed_load): Move from image.c. When loading a library, record
16110 its filename in the :loaded-from property of the library id.
16111 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16112 Initialize and staticpro them.
16113 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16114
16115 * process.c: Include lisp.h before w32.h, not after.
16116 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16117 instead of gnutls_record_check_pending.
16118
16119 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16120
ff4de4aa
TZ
161212011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16122
16123 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16124 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16125 as passed in.
16126
abe95abb
JD
161272011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16128
16129 * xterm.c (x_set_frame_alpha): Do not set property on anything
16130 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16131
e16e55d4
JB
161322011-05-02 Juanma Barranquero <lekktu@gmail.com>
16133
16134 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16135
bafcf6a5
JB
161362011-05-02 Juanma Barranquero <lekktu@gmail.com>
16137
16138 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16139 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16140 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16141 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16142 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16143 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16144 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16145 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16146 (Qgnutls_bootprop_callbacks_verify): Make static.
16147
e7a6747f
AS
161482011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16149
19ed11ba
AS
16150 * callproc.c: Indentation fixup.
16151
e7a6747f 16152 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
16153 (wait_for_termination, interruptible_wait_for_termination):
16154 Move after wait_for_termination_1.
e7a6747f 16155
1ef14cb4
LMI
161562011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16157
16158 * sysdep.c (interruptible_wait_for_termination): New function
16159 which is like wait_for_termination, but allows keyboard
16160 interruptions.
16161
16162 * callproc.c (Fcall_process): Add (:file "file") as an option for
16163 the STDOUT buffer.
16164 (Fcall_process_region): Ditto.
16165
330d880c
EZ
161662011-04-30 Eli Zaretskii <eliz@gnu.org>
16167
8db90b73
EZ
16168 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16169 rather than `XVECTOR (FOO)->size'.
16170
330d880c
EZ
16171 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16172 inttypes.h, as a gnulib replacement is used if it not available in
16173 system headers.
16174
15cbd324
EZ
161752011-04-21 Eli Zaretskii <eliz@gnu.org>
16176
16177 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16178 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16179 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16180
16181 * coding.c (coding_alloc_by_realloc): Error out if destination
16182 will grow beyond MOST_POSITIVE_FIXNUM.
16183 (decode_coding_emacs_mule): Abort if there isn't enough place in
16184 charbuf for the composition carryover bytes. Reserve an extra
16185 space for up to 2 characters produced in a loop.
16186 (decode_coding_iso_2022): Abort if there isn't enough place in
16187 charbuf for the composition carryover bytes.
16188
161892011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 16190
ae940cca
EZ
16191 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16192 aborting when %lld or %lll format is passed.
16193 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16194 %llo or %llx format is passed. (Bug#8545)
16195
03ab8921
EZ
16196 * window.c (window_scroll_line_based): Use a marker instead of
16197 simple variables to record original value of point. (Bug#7952)
16198
afda1437
EZ
16199 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16200 produced by %s or %c overflows available buffer space. (Bug#8545)
16201
f76dee0c
PE
162022011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16203
16204 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 16205 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 16206
fdc5744d
JB
162072011-04-28 Juanma Barranquero <lekktu@gmail.com>
16208
16209 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16210
638f053a
JB
162112011-04-28 Juanma Barranquero <lekktu@gmail.com>
16212
16213 * keyboard.c (Qdelayed_warnings_hook): Define.
16214 (command_loop_1): Run `delayed-warnings-hook'
16215 if Vdelayed_warnings_list is non-nil.
16216 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16217 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16218
d178f871
EZ
162192011-04-28 Eli Zaretskii <eliz@gnu.org>
16220
16221 * doprnt.c (doprnt): Don't return value smaller than the buffer
16222 size if the message was truncated. (Bug#8545).
16223
b124fd93
JB
162242011-04-28 Juanma Barranquero <lekktu@gmail.com>
16225
16226 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16227 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16228
e810457d
PE
162292011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16230
16231 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16232
ea51cceb
JB
162332011-04-27 Juanma Barranquero <lekktu@gmail.com>
16234
16235 * makefile.w32-in: Update dependencies.
16236
94dcfacf
EZ
162372011-04-27 Eli Zaretskii <eliz@gnu.org>
16238
16239 Improve `doprnt' and its usage. (Bug#8545)
16240 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16241 `format_end'. Remove support for %l as a conversion specifier.
16242 Don't use xrealloc. Improve diagnostics when the %l size modifier
16243 is used. Update the commentary.
16244
16245 * eval.c (verror): Simplify calculation of size_t.
16246
16247 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16248 messages.
16249
f61f41d7
PE
162502011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16251
16252 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16253 change.
16254
96fb4434
PE
162552011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16256
16257 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16258 This makes this file independent of the recent pseudovector change.
16259
671875da 162602011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 16261
69e9b5a3
PE
16262 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16263
b5f869a7 16264 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 16265 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 16266 Remove unused local.
c8926152 16267 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 16268
841a1577 16269 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
16270 GCC 4.6.0 optimizes based on type-based alias analysis.
16271 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
16272 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16273 != &v->size, and therefore "v->size = 1; b->size = 2; return
16274 v->size;" must therefore return 1. This assumption is incorrect
16275 for Emacs, since it type-puns struct Lisp_Vector * with many other
16276 types. To fix this problem, this patch adds a new type struct
f904488f 16277 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
16278 and pseudovectors, and helps optimizing compilers not get fooled
16279 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16280 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
16281 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16282 the size member.
eab3844f
PE
16283 (XSETPVECTYPE): Rewrite in terms of new macro.
16284 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16285 This is a bit clearer, and further avoids the possibility of
16286 undesirable aliasing.
16287 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 16288 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
16289 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16290 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
16291 (ASIZE): Now uses header.size rather than size.
16292 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
16293 to avoid the hassle of writing XVECTOR (foo)->header.size.
16294 (struct vectorlike_header): New type.
eab3844f
PE
16295 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16296 object, to help avoid aliasing.
16297 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16298 (SUBRP): Likewise, since Lisp_Subr is a special case.
16299 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16300 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16301 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 16302 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
16303 changed to be "header.size" and "header.next".
16304 * buffer.h (struct buffer): Likewise.
16305 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16306 * frame.h (struct frame): Likewise.
16307 * process.h (struct Lisp_Process): Likewise.
16308 * termhooks.h (struct terminal): Likewise.
16309 * window.c (struct save_window_data, struct saved_window): Likewise.
16310 * window.h (struct window): Likewise.
16311 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16312 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16313 * buffer.c (init_buffer_once): Likewise.
16314 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16315 special case.
16316 * process.c (Fformat_network_address): Use local var for size,
16317 for brevity.
16318
0df1eac5
PE
16319 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16320
847ab9d1 16321 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
16322 * data.c (atof): Remove decl; no longer used or needed.
16323 (digit_to_number): Move to lread.c.
16324 (Fstring_to_number): Use new string_to_number function, to be
16325 consistent with how the Lisp reader treats infinities and NaNs.
16326 Do not assume that floating-point numbers represent EMACS_INT
16327 without losing information; this is not true on most 64-bit hosts.
16328 Avoid double-rounding errors, by insisting on integers when
16329 parsing non-base-10 numbers, as the documentation specifies.
16330 * lisp.h (string_to_number): New decl, replacing ...
16331 (isfloat_string): Remove.
bc0a5c13 16332 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 16333 (read1): Do not accept +. and -. as integers; this
452f4150
PE
16334 appears to have been a coding error. Similarly, do not accept
16335 strings like +-1e0 as floating point numbers. Do not report
16336 overflow for integer overflows unless the base is not 10 which
16337 means we have no simple and reliable way to continue.
16338 Break out the floating-point parsing into a new
16339 function string_to_number, so that Fstring_to_number parses
16340 floating point numbers consistently with the Lisp reader.
04f2d78b 16341 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
16342 (E_CHAR, EXP_INT): Remove, replacing with ...
16343 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16344 (string_to_number): New function, replacing isfloat_string.
16345 This function checks for valid syntax and produces the resulting
16346 Lisp float number too. Rework it so that string-to-number
bc0a5c13 16347 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
16348 so that overflow for non-base-10 numbers is reported only when
16349 there's no portable and simple way to convert to floating point.
452f4150 16350
67769ffc
PE
16351 * textprop.c (set_text_properties_1): Rewrite for clarity,
16352 and to avoid GCC warning about integer overflow.
16353
c20db43f
PE
16354 * intervals.h (struct interval): Use EMACS_INT for members
16355 where EMACS_UINT might cause problems. See
16356 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16357 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16358 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16359 All uses changed.
37aa2f85
PE
16360 (offset_intervals): Tell GCC not to worry about length overflow
16361 when negating a negative length.
c20db43f 16362
2538aa2f
PE
16363 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16364 (overrun_check_free): Likewise.
16365
f2d3008d
PE
16366 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16367 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16368 word size.
16369
ec8df744
PE
16370 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16371 (gnutls_make_error): Rename local to avoid shadowing.
16372 (gnutls_emacs_global_deinit): ifdef out; not used.
16373 (Fgnutls_boot): Use const for pointer to readonly storage.
16374 Comment out unused local. Fix pointer signedness problems.
16375
640ee02d
PE
16376 * lread.c (openp): Don't stuff size_t into an 'int'.
16377 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16378 about possible signed overflow.
16379
6048fb2a
PE
16380 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16381 (GDK_KEY_g): Don't define if already defined.
16382 (xg_prepare_tooltip): Avoid pointer signedness problem.
16383 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16384
fa3c87e1
PE
16385 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16386 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16387
2172544b
PE
16388 * xfns.c (Fx_window_property): Simplify a bit,
16389 to make a bit faster and to avoid GCC 4.6.0 warning.
16390 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16391
9b821a21
PE
16392 * fns.c (internal_equal): Don't assume size_t fits in int.
16393
3c616cfa
PE
16394 * alloc.c (compact_small_strings): Tighten assertion a little.
16395
c2982e87
PE
16396 Replace pEd with more-general pI, and fix some printf arg casts.
16397 * lisp.h (pI): New macro, generalizing old pEd macro to other
16398 conversion specifiers. For example, use "...%"pI"d..." rather
16399 than "...%"pEd"...".
16400 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 16401 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
16402 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16403 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16404 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16405 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16406 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16407 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16408 64-bit hosts.
16409 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16410 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16411 * print.c (safe_debug_print, print_object): Likewise.
16412 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16413 to int.
6f04d126
PE
16414 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16415 avoiding the 0 flag, which is not portable.
c2982e87
PE
16416 * process.c (Fmake_network_process): Use pI to avoid cast.
16417 * region-cache.c (pp_cache): Likewise.
16418 * xdisp.c (decode_mode_spec): Likewise.
16419 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16420 behavior on 64-bit hosts with printf arg.
6f04d126 16421 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
16422 (x_stop_queuing_selection_requests): Likewise.
16423 (x_get_window_property): Don't truncate byte count to an 'int'
16424 when tracing.
0b432f21 16425
5e073ec7
PE
16426 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16427 here, since it parses constructs like leading '-' and spaces,
16428 which are not wanted; and it overflows with large numbers.
16429 Instead, simply match F[0-9]+, which is what is wanted anyway.
16430
36372bf9
PE
16431 * alloc.c: Remove unportable assumptions about struct layout.
16432 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16433 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16434 (allocate_vectorlike, make_pure_vector): Use the new macros,
16435 plus offsetof, to remove unportable assumptions about struct layout.
16436 These assumptions hold on all porting targets that I know of, but
16437 they are not guaranteed, they're easy to remove, and removing them
16438 makes further changes easier.
16439
0b432f21
PE
16440 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16441 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
16442 (string_overrun_cookie): Now const. Use initializers that
16443 don't formally overflow signed char, to avoid warnings.
000098c1
PE
16444 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16445 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
16446 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16447 multiple of sizeof (EMACS_INT); it need not be, if
16448 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 16449 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 16450
895009e1
JB
164512011-04-26 Juanma Barranquero <lekktu@gmail.com>
16452
16453 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16454
6a7a1b0b
TZ
164552011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16456
16457 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 16458 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
16459 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16460
841a1577 164612011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
16462
16463 * lisp.h (Qdebug): List symbol.
895009e1 16464 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
16465 * keyboard.c (debug-on-event): New variable.
16466 (handle_user_signal): Break into debugger when debug-on-event
16467 matches the current signal symbol.
16468
f2d3ba6f
DN
164692011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16470
16471 * alloc.c (check_sblock, check_string_bytes)
16472 (check_string_free_list): Convert to standard C.
16473
42ce4c63
TZ
164742011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16475
16476 * w32.c (emacs_gnutls_push): Fix typo.
16477
825cd63c
EZ
164782011-04-25 Eli Zaretskii <eliz@gnu.org>
16479
fb11d64d
EZ
16480 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16481 "cast to pointer from integer of different size".
16482
825cd63c
EZ
16483 Improve doprnt and its use in verror. (Bug#8545)
16484 * doprnt.c (doprnt): Document the set of format control sequences
16485 supported by the function. Use SAFE_ALLOCA instead of always
16486 using `alloca'.
16487
16488 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16489 is one byte too soon. Don't use xrealloc; instead xfree and
16490 xmalloc anew.
16491
e061a11b
TZ
164922011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16493
16494 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16495 callbacks stage.
16496
16497 * gnutls.c: Renamed global_initialized to
16498 gnutls_global_initialized. Added internals for the
16499 :verify-hostname-error, :verify-error, and :verify-flags
16500 parameters of `gnutls-boot' and documented those parameters in the
16501 docstring. Start callback support.
9173deec
JB
16502 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16503 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16504 on error. Return error code.
e061a11b
TZ
16505 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16506 (emacs_gnutls_read): Likewise.
16507 (Fgnutls_boot): Return handshake error code.
16508 (emacs_gnutls_handle_error): New function.
16509 (wsaerror_to_errno): Likewise.
16510
16511 * w32.h (emacs_gnutls_pull): Add prototype.
16512 (emacs_gnutls_push): Likewise.
16513
16514 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16515 (emacs_gnutls_push): Likewise.
16516
165172011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16518
16519 * process.c (wait_reading_process_output): Check if GnuTLS
16520 buffered some data internally if no FDs are set for TLS
16521 connections.
16522
16523 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16524 (LIBS): Link to USER_LIBS.
16525 ($(BLD)/gnutls.$(0)): New target.
16526
fa6996bc
EZ
165272011-04-24 Eli Zaretskii <eliz@gnu.org>
16528
eb35682e
EZ
16529 * xdisp.c (handle_single_display_spec): Rename the
16530 display_replaced_before_p argument into display_replaced_p, to
16531 make it consistent with the commentary. Fix typos in the
16532 commentary.
16533
e2ad650c
EZ
16534 * textprop.c (syms_of_textprop): Remove dead code.
16535 (copy_text_properties): Delete obsolete commentary about an
16536 interface that was deleted long ago. Fix typos in the description
16537 of arguments.
16538
1b2de274
EZ
16539 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16540 to changes in oldXMenu/XMenu.h from 2011-04-16.
16541 <menu_help_message, prev_menu_help_message>: Constify.
16542 (IT_menu_make_room): menu->help_text is now `const char **';
16543 adjust.
16544
16545 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16546 to changes in oldXMenu/XMenu.h from 2011-04-16.
16547 (struct XMenu): Declare `help_text' `const char **'.
16548
16549 * xfaces.c <Qunspecified>: Make extern again.
16550
16551 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 16552 required by POSIX.
1b2de274 16553
762b15be
EZ
16554 * doc.c (get_doc_string): Improve the format passed to `error'.
16555
16556 * doprnt.c (doprnt): Improve commentary.
16557
16558 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16559
16560 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16561 them with etags.
16562
f1052e5d
EZ
16563 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16564 changes in globals.h immediately force recompilation.
762b15be
EZ
16565 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16566 $(CURDIR)/s/ms-w32.h.
16567 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 16568
fa6996bc
EZ
16569 * character.c (Fchar_direction): Function deleted.
16570 (syms_of_character): Don't defsubr it.
16571 <char-direction-table>: Deleted.
16572
e6c3da20
EZ
165732011-04-23 Eli Zaretskii <eliz@gnu.org>
16574
16575 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16576 * doprnt.c: Include limits.h.
16577 (SIZE_MAX): New macro.
04f2d78b
CB
16578 (doprnt): Return a size_t value. 2nd arg is now size_t.
16579 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
16580 Improve overflow protection. Support `l' modifier for integer
16581 conversions. Support %l conversion. Don't assume an EMACS_INT
16582 argument for integer conversions and for %c.
16583
16584 * lisp.h (doprnt): Restore prototype.
16585
16586 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16587 $(SRC)/character.h.
16588
16589 * Makefile.in (base_obj): Add back doprnt.o.
16590
16591 * deps.mk (doprnt.o): Add back prerequisites.
16592 (callint.o): Depend on character.h.
16593
16594 * eval.c (internal_lisp_condition_case): Include the handler
16595 representation in the error message.
16596 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16597 when breaking from the loop.
16598
16599 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16600
16601 * callint.c (Fcall_interactively): When displaying error message
16602 about invalid control letter, pass the character's codepoint, not
16603 a pointer to its multibyte form. Improve display of the character
16604 in octal and display also its hex code.
16605
16606 * character.c (char_string): Use %x to display the (unsigned)
16607 codepoint of an invalid character, to avoid displaying a bogus
16608 negative value.
16609
16610 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16611 `error', not SYMBOL_NAME itself.
16612
16613 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16614 character arguments to `error'.
16615
16616 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16617 to `error' in error message about FINAL_CHAR argument. Make sure
16618 FINAL_CHAR is a character, and use %c when it is passed as
16619 argument to `error'.
16620
4ffd0d6b 166212011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
16622
16623 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16624
16625 * w32.c: Include <time.h>.
16626 (sys_localtime): New function.
16627
4ffd0d6b 166282011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
16629
16630 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16631
4ffd0d6b 16632 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 16633
4ffd0d6b 166342011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 16635
4ffd0d6b
GM
16636 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16637 zombies (Bug#8467).
aac0c6e3 16638
04c56954
EZ
166392011-04-19 Eli Zaretskii <eliz@gnu.org>
16640
16641 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16642 gl_state.e_property when gl_state.object is Qt.
16643
16644 * insdel.c (make_gap_larger): Remove limitation of buffer size
16645 to <= INT_MAX.
16646
16a43933
CY
166472011-04-18 Chong Yidong <cyd@stupidchicken.com>
16648
16649 * xdisp.c (lookup_glyphless_char_display)
16650 (produce_glyphless_glyph): Handle cons cell entry in
16651 glyphless-char-display.
16652 (Vglyphless_char_display): Document it.
16653
16654 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16655 glyphless-char-display.
16656
4581706e
CY
166572011-04-17 Chong Yidong <cyd@stupidchicken.com>
16658
16659 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16660
16661 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16662
16663 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16664 definition for no-X builds.
16665
4887c6e2 166662011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 16667
fd35b6f9
PE
16668 Static checks with GCC 4.6.0 and non-default toolkits.
16669
5c1ccb01
PE
16670 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16671
006c5daa
PE
16672 * process.c (keyboard_bit_set): Define only if SIGIO.
16673 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16674 (send_process): Repair possible setjmp clobbering.
16675
efc736d3
PE
16676 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16677
4e2fe2e6
PE
16678 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16679
f97334a2
PE
16680 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16681
4e75f29d
PE
16682 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16683 Define only if needed.
16684
90efadd1
PE
16685 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16686 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 16687 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 16688
3c647824
PE
16689 * dispextern.h (struct redisplay_interface): Rename param
16690 to avoid shadowing.
e264f262 16691 * termhooks.h (struct terminal): Likewise.
761383f4 16692 * xterm.c (xembed_send_message): Likewise.
3c647824 16693
b58c5c4a
PE
16694 * insdel.c (make_gap_smaller): Define only if
16695 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16696
cad59032
PE
16697 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16698 it.
16699
c339dc2e
PE
16700 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16701 so that we aren't warned about unused symbols.
16702
91a3e27b
PE
16703 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16704
399c71d3 16705 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 16706
8ffc96f5
PE
16707 * xfns.c (x_real_positions): Mark locals as initialized.
16708
eef9bc79
PE
16709 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16710
098db9dd
PE
16711 * xterm.c: Fix problems found by static analysis with other toolkits.
16712 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
16713 (x_dispatch_event): Declare static if USE_GTK, and
16714 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 16715 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 16716 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
16717 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16718 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 16719
eb18f6cc
PE
16720 * xmenu.c (menu_help_callback): Pointer type fixes.
16721 Use const pointers when pointing at readonly data. Avoid pointer
16722 signedness clashes.
16723 (FALSE): Remove unused macro.
16724 (update_frame_menubar): Remove unused decl.
16725
1fe72bf8
PE
16726 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16727
60d9e1db
PE
16728 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16729 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16730 (single_menu_item): Rename local to avoid shadowing.
16731
39261c26
PE
16732 * keyboard.c (make_lispy_event): Remove unused local var.
16733
018c5e19
PE
16734 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16735 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16736
63d2b86e
PE
16737 * bitmaps: Change bitmaps from unsigned char back to the X11
16738 compatible char. Avoid the old compiler warnings about
16739 out-of-range initializers by using, for example, '\xab' rather
16740 than 0xab.
16741
aefd87e1
PE
16742 * xgselect.c (xgselect_initialize): Check vs interface
16743 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16744
bf501fb9
PE
16745 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16746
e9829fdf
PE
16747 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16748 to read-only memory.
16749
1086c095
PE
16750 * fns.c (vector): Remove; this old hack is no longer needed.
16751
2baccd04 16752 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 16753 Remove unused var.
dde42981 16754 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 16755
72391843 16756 * xrdb.c (x_load_resources): Omit unused local.
3565b346 16757
436c16df 16758 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 16759 (x_window): Rename locals to avoid shadowing.
dc5ddd85 16760 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 16761
92bb796d 16762 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 16763 (x_term_init): Remove local to avoid shadowing.
92bb796d 16764
764430a3 16765 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
16766
16767 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16768 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16769
d1dfb56c
EZ
167702011-04-16 Eli Zaretskii <eliz@gnu.org>
16771
c4354cb4
EZ
16772 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16773
d1dfb56c
EZ
16774 Fix regex.c, syntax.c and friends for buffers > 2GB.
16775 * syntax.h (struct gl_state_s): Declare character position members
16776 EMACS_INT.
16777
16778 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16779
04f2d78b
CB
16780 * textprop.c (verify_interval_modification, interval_of):
16781 Declare arguments EMACS_INT.
d1dfb56c
EZ
16782
16783 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16784 EMACS_INT.
16785
16786 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16787
16788 * indent.c (Fvertical_motion): Local variable it_start is now
16789 EMACS_INT.
16790
16791 * regex.c (re_match, re_match_2, re_match_2_internal)
16792 (bcmp_translate, regcomp, regexec, print_double_string)
16793 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16794 (re_compile_pattern, re_exec): Declare arguments and local
16795 variables `size_t' and `ssize_t' and return values `regoff_t', as
16796 appropriate.
16797 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16798 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16799 <compile_stack_type>: `size' and `avail' are now `size_t'.
16800
16801 * regex.h <regoff_t>: Use ssize_t, not int.
16802 (re_search, re_search_2, re_match, re_match_2): Arguments that
16803 specify buffer/string position and length are now ssize_t and
16804 size_t. Return type is regoff_t.
16805
613052cd
BK
168062011-04-16 Ben Key <bkey76@gmail.com>
16807
16808 * nsfont.m: Fixed bugs in ns_get_family and
16809 ns_descriptor_to_entity that were caused by using free to
16810 deallocate memory blocks that were allocated by xmalloc (via
16811 xstrdup). This caused Emacs to crash when compiled with
16812 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16813 --enable-checking=xmallocoverrun). xfree is now used to
16814 deallocate these memory blocks.
16815
4170f62f 168162011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 16817
71b41406
PE
16818 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16819
9587a89d
PE
16820 emacs_write: Accept and return EMACS_INT for sizes.
16821 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16822 et seq.
16823 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16824 Accept and return EMACS_INT.
16825 (emacs_gnutls_write): Return the number of bytes written on
16826 partial writes.
16827 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
16828 (emacs_read, emacs_write): Remove check for negative size, as the
16829 Emacs source code has been audited now.
9587a89d
PE
16830 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16831 (emacs_read, emacs_write): Use it.
273a5f82
PE
16832 * process.c (send_process): Adjust to the new signatures of
16833 emacs_write and emacs_gnutls_write. Do not attempt to store
16834 a byte offset into an 'int'; it might overflow.
9587a89d 16835 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 16836
3e047f51
PE
16837 * sound.c: Don't assume sizes fit in 'int'.
16838 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 16839 Return EMACS_INT, not int.
3e047f51 16840 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
16841 Accept EMACS_INT, not int.
16842 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
16843 record read return values.
16844
cc39a9db
BK
168452011-04-15 Ben Key <bkey76@gmail.com>
16846
c9d0ec6d
JB
16847 * keyboard.c (Qundefined): Don't declare static since it is used
16848 in nsfns.m.
16849 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16850 static since they are used in nsfont.m.
cc39a9db 16851
6c60eb9f
SM
168522011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16853
16854 * process.c (Qprocessp): Don't declare static.
16855 * lisp.h (Qprocessp): Declare again.
16856
7990b61a
JB
168572011-04-15 Juanma Barranquero <lekktu@gmail.com>
16858
16859 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16860
5d4cb038
PE
168612011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16862
8bd7b830 16863 Improve C-level modularity by making more things 'static'.
cd64ea1d 16864
e3b27b31
PE
16865 Don't publish debugger-only interfaces to other modules.
16866 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16867 (verify_bytepos, count_markers): Move decls to the only modules
16868 that need them.
16869 * region-cache.h (pp_cache): Likewise.
16870 * window.h (check_all_windows): Likewise.
16871 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16872
5d4cb038
PE
16873 * sysdep.c (croak): Now static, if
16874 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16875 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
16876
16877 * alloc.c (refill_memory_reserve): Now static if
16878 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16879 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 16880
e87b6180
PE
16881 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16882 Define only if USE_LUCID.
16883
ac64929e
PE
16884 * xrdb.c (x_customization_string, x_rm_string): Now static.
16885
6f37259d
PE
16886 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16887 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16888
1683e3ab
PE
16889 * xdisp.c (draw_row_with_mouse_face): Now static.
16890 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16891
de9c2632
PE
16892 * window.h (check_all_windows): Mark externally visible.
16893
2b96acb7
PE
16894 * window.c (window_deletion_count): Now static.
16895
16896 * undo.c: Make symbols static if they're not exported.
16897 (last_undo_buffer, last_boundary_position, pending_boundary):
16898 Now static.
16899
50436f33
PE
16900 * textprop.c (interval_insert_behind_hooks): Now static.
16901 (interval_insert_in_front_hooks): Likewise.
16902
64520e5c
PE
16903 * term.c: Make symbols static if they're not exported.
16904 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16905 (max_frame_lines, tty_set_terminal_modes):
16906 (tty_reset_terminal_modes, tty_turn_off_highlight):
16907 (get_tty_terminal): Now static.
16908 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16909 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 16910 HAVE_WINDOW_SYSTEM.
64520e5c
PE
16911 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16912 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16913
1fa53021
PE
16914 * sysdep.c: Make symbols static if they're not exported.
16915 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16916 Now static.
16917 (sigprocmask_set, full_mask): Remove; unused.
16918 (wait_debugging): Mark as visible.
16919 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16920 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16921
d4b43b22
PE
16922 * syntax.c (syntax_temp): Define only if !__GNUC__.
16923
b7c513d0
PE
16924 * sound.c (current_sound_device, current_sound): Now static.
16925
989b29ad
PE
16926 * search.c (searchbufs, searchbuf_head): Now static.
16927
13a55a78
PE
16928 * scroll.c (scroll_cost): Remove; unused.
16929 * dispextern.h (scroll_cost): Remove decl.
16930
de68a1fc
PE
16931 * region-cache.h (pp_cache): Mark as externally visible.
16932
40ccffa6
PE
16933 * process.c: Make symbols static if they're not exported.
16934 (process_tick, update_tick, create_process, chan_process):
16935 (Vprocess_alist, proc_buffered_char, datagram_access):
16936 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16937 (deactivate_process): Mark defn as static, as well as decl.
16938 * lisp.h (create_process): Remove decl.
16939 * process.h (chan_process, Vprocess_alist): Remove decls.
16940
ad64fc97
PE
16941 * print.c: Make symbols static if they're not exported.
16942 (print_depth, new_backquote_output, being_printed, print_buffer):
16943 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16944 (print_interval, print_number_index, initial_stderr_stream):
16945 Now static.
16946 * lisp.h (Fprinc): Remove decl.
16947 (debug_output_compilation_hack): Mark as externally visible.
16948
adddb265
PE
16949 * sysdep.c (croak): Move decl from here to syssignal.h.
16950 * syssignal.h (croak): Put it here, so the API can be checked when
16951 'croak' is called from dissociate_if_controlling_tty.
16952
1717ede2
PE
16953 * minibuf.c: Make symbols static if they're not exported.
16954 (minibuf_save_list, choose_minibuf_frame): Now static.
16955 * lisp.h (choose_minibuf_frame): Remove decl.
16956
fa5fb2bc
PE
16957 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16958
1e3890d1
PE
16959 * lread.c: Make symbols static if they're not exported.
16960 (read_objects, initial_obarray, oblookup_last_bucket_number):
16961 Now static.
16962 (make_symbol): Remove; unused.
16963 * lisp.h (initial_obarray, make_symbol): Remove decls.
16964
8a1414fa
PE
16965 * keyboard.c: Make symbols static if they're not exported.
16966 (single_kboard, recent_keys_index, total_keys, recent_keys):
16967 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16968 (this_single_command_key_start, echoing, last_auto_save):
16969 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16970 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16971 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16972 (Vlispy_mouse_stem, double_click_count):
16973 Now static.
16974 (force_auto_save_soon): Define only if SIGDANGER.
16975 (ignore_mouse_drag_p): Now static if
16976 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16977 (print_help): Remove; unused.
16978 (stop_character, last_timer_event): Mark as externally visible.
16979 * keyboard.h (ignore_mouse_drag_p): Declare only if
16980 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16981 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16982 * lisp.h (echoing): Remove decl.
16983 (force_auto_save_soon): Declare only if SIGDANGER.
16984 * xdisp.c (redisplay_window): Simplify code, to make it more
16985 obvious that ignore_mouse_drag_p is not accessed if !defined
16986 USE_GTK && !defined HAVE_NS.
16987
93ea6e8f
PE
16988 * intervals.c: Make symbols static if they're not exported.
16989 (merge_properties_sticky, merge_interval_right, delete_interval):
16990 Now static.
16991 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16992
77382fcc
PE
16993 * insdel.c: Make symbols static if they're not exported.
16994 However, leave prepare_to_modify_buffer alone. It's never
16995 called from outside this function, but that appears to be a bug.
16996 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16997 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16998 (adjust_after_replace_noundo): Remove; unused.
16999 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 17000 (signal_before_change): Remove decls.
77382fcc 17001
9306c32e
PE
17002 * indent.c (val_compute_motion, val_vmotion): Now static.
17003
cd44d2eb
PE
17004 * image.c: Make symbols static if they're not exported.
17005 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17006 if USE_GTK.
17007 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17008 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17009
ad9a7a06
PE
17010 * fringe.c (standard_bitmaps): Now static.
17011 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17012
81626931
PE
17013 * frame.c: Make symbols static if they're not exported.
17014 (x_report_frame_params, make_terminal_frame): Now static.
17015 (get_frame_param): Now static, unless HAVE_NS.
17016 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17017 (x_get_resource_string): Remove; not used.
17018 * frame.h (make_terminal_frame, x_report_frame_params):
17019 (x_get_resource_string); Remove decls.
17020 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17021 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17022
239f9db9
PE
17023 * font.c, fontset.c: Make symbols static if they're not exported.
17024 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17025 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17026 * font.c (font_close_object): Now static.
17027 * font.h (font_close_object): Remove.
17028 * fontset.c (FONTSET_OBJLIST): Remove.
17029 (free_realized_fontset) #if-0 the body, which does nothing.
17030 (face_suitable_for_char_p): #if-0, as it's never called.
17031 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
17032 * xfaces.c (face_at_string_position):
17033 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
17034 since 0 is always ASCII.
17035
dfcf3579
PE
17036 * fns.c (weak_hash_tables): Now static.
17037
5045092b
PE
17038 * fileio.c: Make symbols static if they're not exported.
17039 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17040 (Vwrite_region_annotation_buffers): Now static.
17041
57a96f5c
PE
17042 * eval.c: Make symbols static if they're not exported.
17043 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17044 * lisp.h (backtrace_list): Remove decl.
17045
35f08c38
PE
17046 * emacs.c: Make symbols static if they're not exported.
17047 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17048 (fatal_error_code, fatal_error_signal_hook, standard_args):
17049 Now static.
17050 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17051 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17052 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17053 * lisp.h (fatal_error_signal_hook): Remove decl.
17054 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17055
f44bd759
PE
17056 * editfns.c: Move a (normally-unused) function to its only use.
17057 * editfns.c, lisp.h (get_operating_system_release): Remove.
17058 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17059 worth the hassle of breaking this out.
17060
b532497d
PE
17061 * xterm.c: Make symbols static if they're not exported.
17062 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17063 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17064 (x_destroy_window, x_delete_display):
17065 Now static.
17066 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17067 (x_mouse_leave): Remove; unused.
17068 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17069 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17070 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17071 Remove decls.
17072 (x_mouse_leave): Declare only if WINDOWSNT.
17073 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17074 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17075 USE_X_TOOLKIT.
17076
1675728f
PE
17077 * ftxfont.c: Make symbols static if they're not exported.
17078 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17079 HAVE_FREETYPE.
17080 * font.h (ftxfont_driver): Likewise.
17081
e4cebfca
PE
17082 * xfns.c: Make symbols static if they're not exported.
17083 (x_last_font_name, x_display_info_for_name):
17084 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17085 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17086 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17087 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17088 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17089 (last_show_tip_args): Now static.
17090 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17091 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17092 (x_screen_planes): Remove; unused.
17093 * dispextern.h (x_screen_planes): Remove decl.
17094
5bf46f05
PE
17095 * dispnew.c: Make symbols static if they're not exported.
17096 * dispextern.h (redraw_garbaged_frames, scrolling):
17097 (increment_row_positions): Remove.
17098 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17099 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17100 Now static.
17101 (redraw_garbaged_frames): Remove; unused.
17102
435f4c28
PE
17103 * xfaces.c: Make symbols static if they're not exported.
17104 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17105 Remove decls.
17106 * xterm.h (defined_color): Remove decls.
17107 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17108 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17109 (menu_face_changed_default, defined_color, free_realized_face):
17110 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17111 (ascii_face_of_lisp_face): Remove; unused.
17112
8524aef3
PE
17113 * xdisp.c: Make symbols static if they're not exported.
17114 * dispextern.h (scratch_glyph_row, window_box_edges):
17115 (glyph_to_pixel_coords, set_cursor_from_row):
17116 (get_next_display_element, set_iterator_to_next):
17117 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17118 (show_mouse_face): Remove decls
17119 * frame.h (message_buf_print): Likewise.
17120 * lisp.h (pop_message, set_message, check_point_in_composition):
17121 Likewise.
17122 * xterm.h (set_vertical_scroll_bar): Likewise.
17123 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17124 (message_buf_print, scratch_glyph_row, displayed_buffer):
17125 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17126 (get_next_display_element, show_mouse_face, window_box_edges):
17127 (frame_to_window_pixel_xy, check_point_in_composition):
17128 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17129 (glyph_to_pixel_coords): Remove; unused.
17130
16390cd2
PE
17131 * dired.c (file_name_completion): Now static.
17132
17133 * dbusbind.c (xd_in_read_queued_messages): Now static.
17134
a25f4dfa
PE
17135 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17136 * data.c (circular_list_error): Remove.
17137
14a9c8df
PE
17138 * commands.h (last_point_position, last_point_position_buffer):
17139 (last_point_position_window): Remove decls.
17140 * keyboard.c: Make these variables static.
17141
04f2d78b
CB
17142 * coding.h (coding, code_convert_region, encode_coding_gap):
17143 Remove decls.
74ab6df5
PE
17144 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17145 (iso_code_class, detect_coding, code_convert_region): Now static.
17146 (encode_coding_gap): Remove; unused.
17147
38dfbee1
PE
17148 * chartab.c (chartab_chars, chartab_bits): Now static.
17149
a2cb4e63
PE
17150 * charset.h (charset_iso_8859_1): Remove decl.
17151 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17152 Now static.
17153
127198fd
PE
17154 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17155 * ccl.c (Vccl_program_table): Now static.
17156 (check_ccl_update): Remove; unused.
17157
d85b608f
PE
17158 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17159 * category.h: ... from here.
17160 * category.c (check_category_table, set_category_set): Now static.
17161
31cd66f3
PE
17162 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17163 * lisp.h: Remove these decls.
17164
c358e587
PE
17165 * buffer.c (buffer_count): Remove unused var.
17166
e78aecca
PE
17167 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17168 so that it's not optimized away.
17169 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17170 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17171 exported only to the debugger.
17172
e192d7d3 17173 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 17174 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 17175
92470028
PE
17176 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17177 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17178 was inaccessible from Lisp.
17179 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17180 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17181
244ed907
PE
17182 alloc.c: Import and export fewer symbols, and remove unused items.
17183 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17184 is defined.
17185 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17186 it's not optimized away by whole-program optimization.
17187 (message_enable_multibyte, free_misc): Remove.
17188 (catchlist, handlerlist, mark_backtrace):
17189 Declare only if BYTE_MARK_STACK.
17190 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17191 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17192 (message_enable_multibyte): Remove decl.
17193 (free_misc, interval_free_list, float_block, float_block_index):
17194 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17195 (cons_free_list, last_marked_index):
17196 Now static.
17197 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17198 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17199 (mark_backtrace): Define only if BYTE_MARK_STACK.
17200 * xdisp.c (message_enable_multibyte): Now static.
17201
61c2b50e 17202 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
17203 This makes it easier for human readers (and static analyzers)
17204 to see whether these variables are used from other modules.
17205 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17206 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17207 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17208 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17209 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17210 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17211 * xmenu.c, xselect.c:
17212 Declare Q* vars static if they are not used in other modules.
17213 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17214 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17215 Remove decls of unexported vars.
17216 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17217
95c82688
PE
17218 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17219
16a97296
PE
17220 Make Emacs functions such as Fatom 'static' by default.
17221 This makes it easier for human readers (and static analyzers)
17222 to see whether these functions can be called from other modules.
17223 DEFUN now defines a static function. To make the function external
17224 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
17225 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17226 (Finit_image_library):
16a97296
PE
17227 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17228 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17229 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17230 Remove decls, since these functions are now static.
17231 (Funintern, Fget_internal_run_time): New decls, since these functions
17232 were already external.
95c82688 17233
16a97296
PE
17234 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17235 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17236 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17237 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17238 * keyboard.c, keymap.c, lread.c:
17239 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17240 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17241 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17242 Mark functions with DEFUE instead of DEFUN,
17243 if they are used in other modules.
17244 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17245 decls for now-static functions.
17246 * buffer.h (Fdelete_overlay): Remove decl.
17247 * callproc.c (Fgetenv_internal): Mark as internal.
17248 * composite.c (Fremove_list_of_text_properties): Remove decl.
17249 (Fcomposition_get_gstring): New forward static decl.
17250 * composite.h (Fcomposite_get_gstring): Remove decl.
17251 * dired.c (Ffile_attributes): New forward static decl.
17252 * doc.c (Fdocumntation_property): New forward static decl.
17253 * eval.c (Ffetch_bytecode): New forward static decl.
17254 (Funintern): Remove extern decl; now in .h file where it belongs.
17255 * fileio.c (Fmake_symbolic_link): New forward static decl.
17256 * image.c (Finit_image_library): New forward static decl.
17257 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17258 * intervals.h (Fprevious_property_change):
17259 (Fremove_list_of_text_properties): Remove decls.
17260 * keyboard.c (Fthis_command_keys): Remove decl.
17261 (Fcommand_execute): New forward static decl.
17262 * keymap.c (Flookup_key): New forward static decl.
17263 (Fcopy_keymap): Now static.
17264 * keymap.h (Flookup_key): Remove decl.
17265 * process.c (Fget_process): New forward static decl.
17266 (Fprocess_datagram_address): Mark as internal.
17267 * syntax.c (Fsyntax_table_p): New forward static decl.
17268 (skip_chars): Remove duplicate decl.
17269 * textprop.c (Fprevious_property_change): New forward static decl.
17270 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17271 Now internal.
17272 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17273 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17274
785bbd42
PE
17275 * editfns.c (Fformat): Remove unreachable code.
17276
8b913b57
AS
172772011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17278
17279 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17280 change. (Bug#8496)
17281
a6744a35
EZ
172822011-04-13 Eli Zaretskii <eliz@gnu.org>
17283
17284 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17285 when at ZV. (Bug#8487)
17286
e7974947
AS
172872011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17288
baad03f0
AS
17289 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17290 (Bug#8437)
17291 * keyboard.c (parse_tool_bar_item): Likewise.
17292 * sound.c (sound_cleanup, alsa_close): Likewise.
17293 * termcap.c (tgetent): Likewise.
17294 * xfns.c (x_default_font_parameter): Likewise.
17295 * xsettings.c (read_and_apply_settings): Likewise.
17296
e7974947
AS
17297 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17298 (overrun_check_free): Protoize.
17299
28272684
PE
173002011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17301
17302 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17303 since callers should never pass a negative size.
17304 Change the signature to match that of plain 'read' and 'write'; see
17305 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17306 * lisp.h: Update prototypes of emacs_write and emacs_read.
17307
11997c76
EZ
173082011-04-11 Eli Zaretskii <eliz@gnu.org>
17309
17310 * xdisp.c (redisplay_window): Don't try to determine the character
17311 position of the scroll margin if the window start point w->startp
e896f03c 17312 is outside the buffer's accessible region. (Bug#8468)
11997c76 17313
8a2cbd72
EZ
173142011-04-10 Eli Zaretskii <eliz@gnu.org>
17315
17316 Fix write-region and its subroutines for buffers > 2GB.
17317 * fileio.c (a_write, e_write): Modify declaration of arguments and
17318 local variables to support buffers larger than 2GB.
17319 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17320
17321 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17322 argument, local variables, and return value.
17323
17324 * lisp.h: Update prototypes of emacs_write and emacs_read.
17325
17326 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17327
4073e537 173282011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 17329
1ebfdcb6
PE
17330 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17331
b2ded58d
PE
17332 Fix more problems found by GCC 4.6.0's static checks.
17333
7d66342c
PE
17334 * xdisp.c (vmessage): Use a better test for character truncation.
17335
bbf47d44
PE
17336 * charset.c (load_charset_map): <, not <=, for optimization,
17337 and to avoid potential problems with integer overflow.
9248994d 17338 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 17339 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 17340 * editfns.c (Fformat): Likewise.
1e69125e 17341 * syntax.c (skip_chars): Likewise.
3befa583 17342
e3019616
PE
17343 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17344 This also lets GCC 4.6.0 generate slightly better loop code.
17345
becfa255
PE
17346 * callint.c (Fcall_interactively): <, not <=, for optimization.
17347 (Fcall_interactively): Count the number of arguments produced,
17348 not the number of arguments given. This is simpler and lets GCC
17349 4.6.0 generate slightly better code.
17350
dae0cd48
PE
17351 * ftfont.c: Distingish more carefully between FcChar8 and char.
17352 The previous code passed unsigned char * to a functions like
17353 strlen and xstrcasecmp that expect char *, which does not
17354 conform to the C standard.
17355 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17356 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17357 char * when the C standard requires it.
17358
76032d70
PE
17359 * keyboard.c (read_char): Remove unused var.
17360
eb3f1cc8
PE
17361 * eval.c: Port to Windows vsnprintf (Bug#8435).
17362 Include <limits.h>.
17363 (SIZE_MAX): Define if the headers do not.
17364 (verror): Do not give up if vsnprintf returns a negative count.
17365 Instead, grow the buffer. This ports to Windows vsnprintf, which
17366 does not conform to C99. Problem reported by Eli Zaretskii.
17367 Also, simplify the allocation scheme, by avoiding the need for
17368 calling realloc, and removing the ALLOCATED variable.
17369
70476b54
PE
17370 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17371
12020a9e
PE
17372 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17373 But keep the doprint source code for now, as we might revamp it
17374 and use it again (Bug#8435).
ea6c7ae6
PE
17375 * lisp.h (doprnt): Remove.
17376 * Makefile.in (base_obj): Remove doprnt.o.
17377 * deps.mk (doprnt.o): Remove.
17378
5fdb398c
PE
17379 error: Print 32- and 64-bit integers portably (Bug#8435).
17380 Without this change, on typical 64-bit hosts error ("...%d...", N)
17381 was used to print both 32- and 64-bit integers N, which relied on
17382 undefined behavior.
61bdb816 17383 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
17384 * lisp.h (error, verror): Mark as printf-like functions.
17385 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17386 Report overflow in size calculations when allocating printf buffer.
17387 Do not truncate output string at its first null byte.
17388 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17389 Truncate the output at a character boundary, since vsnprintf does not
17390 do that.
17391 * charset.c (check_iso_charset_parameter): Convert internal
17392 character to string before calling 'error', since %c now has the
17393 printf meaning.
17394 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17395 overflow when computing char to be passed to 'error'. Do not
17396 pass Lisp_Object to 'error'; pass the integer instead.
17397 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17398 formatted with plain %d.
17399
b189fa66
PE
17400 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17401
bff87ef0
PE
17402 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17403
7e2cac20
PE
17404 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17405
ce4d90b5
PE
17406 * xterm.c (x_catch_errors): Remove duplicate declaration.
17407
266c9547
PE
17408 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17409
79c49ad2
PE
17410 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17411
368f4090
JM
174122011-04-10 Jim Meyering <meyering@redhat.com>
17413
17414 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17415 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17416 return ssize_t not "int", and use size_t as the buffer length.
17417 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17418 * gnutls.h: Update declarations.
17419 * process.c (read_process_output): Use ssize_t, to match.
17420 (send_process): Likewise.
17421
a32d4040
CY
174222011-04-09 Chong Yidong <cyd@stupidchicken.com>
17423
17424 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17425
8546720e 174262011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 17427
04f2d78b
CB
17428 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17429 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 17430
8546720e
GM
17431 * xterm.c (handle_one_xevent):
17432 * xmenu.c (create_and_show_popup_menu):
17433 * xselect.c (x_decline_selection_request)
17434 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 17435
0a2f5c1a 174362011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
17437
17438 Fix some uses of `int' instead of EMACS_INT.
17439 * search.c (string_match_1, fast_string_match)
17440 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17441 (scan_buffer, find_next_newline_no_quit)
17442 (find_before_next_newline, search_command, Freplace_match)
17443 (Fmatch_data): Make some `int' variables be EMACS_INT.
17444
17445 * xdisp.c (display_count_lines): 3rd argument and return value now
17446 EMACS_INT. All callers changed.
17447 (pint2hrstr): Last argument is now EMACS_INT.
17448
17449 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17450 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17451 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17452 (decode_coding_utf_16, decode_coding_emacs_mule)
17453 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17454 (decode_coding_ccl, decode_coding_charset)
17455 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17456 (decode_coding_iso_2022, decode_coding_emacs_mule)
17457 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17458 <char_offset, last_offset>: Declare EMACS_INT.
17459 (encode_coding_utf_8, encode_coding_utf_16)
17460 (encode_coding_emacs_mule, encode_invocation_designation)
17461 (encode_designation_at_bol, encode_coding_iso_2022)
17462 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17463 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17464 Declare EMACS_INT.
17465 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17466 (encode_invocation_designation): Last argument P_NCHARS is now
17467 EMACS_INT.
17468 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17469 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17470
17471 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17472 All users changed.
17473
17474 * ccl.c (Fccl_execute_on_string): Declare some variables
17475 EMACS_INT.
17476
8546720e 174772011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
17478
17479 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17480
4e19a977
CS
174812011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17482
17483 * process.c (Fformat_network_address): Doc fix.
17484
87302331
R
174852011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17486
ee7683eb 17487 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 17488
cbb59342
CY
174892011-04-08 Chong Yidong <cyd@stupidchicken.com>
17490
17491 * keyboard.c (read_char): Call Lisp function help-form-show,
17492 instead of using internal_with_output_to_temp_buffer.
17493 (Qhelp_form_show): New var.
e0d38eeb 17494 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
17495
17496 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17497
17498 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17499
e67a13ab
CY
175002011-04-06 Chong Yidong <cyd@stupidchicken.com>
17501
04f2d78b
CB
17502 * process.c (Flist_processes): Remove to Lisp.
17503 (list_processes_1): Delete.
e67a13ab 17504
973f782d
EZ
175052011-04-06 Eli Zaretskii <eliz@gnu.org>
17506
7c106b1e
EZ
17507 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17508
973f782d
EZ
17509 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17510
41cf7d1a 175112011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 17512
ca23cc88
PE
17513 Fix more problems found by GCC 4.6.0's static checks.
17514
f390e2d5
PE
17515 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17516
42eea0d0
PE
17517 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17518
b69769da 17519 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 17520
f9541e84
PE
17521 * xdisp.c (vmessage): Mark as a printf-like function.
17522
13841b55
PE
17523 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17524
c136c10f
PE
17525 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17526
5e2d4a30
PE
17527 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17528 printf-like functions.
17529 (tiff_load): Add casts to remove these marks before passing them
17530 to system-supplied API.
17531
583f48b9
PE
17532 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17533
b25d760e
PE
17534 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17535 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
17536 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17537 directly, rather than having caller test rule sign. This avoids
17538 some unnecessary tests.
17539 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17540 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17541 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 17542
bc7b6697 17543 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 17544 (xfont_open): Avoid unnecessary tests.
bc7b6697 17545
27ccc379
PE
17546 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17547
dcd5c89a
PE
17548 * composite.h, composite.c (composition_gstring_put_cache):
17549 Use EMACS_INT, not int, for length.
17550
b13a45c6
PE
17551 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17552 breaking out part of COMPOSITION_DECODE_RULE.
17553 (COMPOSITION_DECODE_RULE): Use it.
17554 * composite.c (get_composition_id): Remove unused local vars,
17555 by using the new macro.
17556
1e792e4d
PE
17557 * textprop.c (set_text_properties_1): Change while to do-while,
17558 since the condition is always true at first.
17559
dc6c6455 17560 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
17561 (interval_deletion_adjustment): Return unsigned value.
17562 All uses changed.
dc6c6455 17563
aba7731a
PE
17564 * process.c (list_processes_1, create_pty, read_process_output):
17565 (exec_sentinel): Remove vars that were set but not used.
afd4052b 17566 (create_pty): Remove unnecessary "volatile"s.
bc57d757 17567 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 17568 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 17569 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 17570
fdfc4bf3
PE
17571 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17572
fca8fe46 17573 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 17574 (update_syntax_table): Use unsigned instead of int.
fca8fe46 17575
06a0259a 17576 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 17577 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 17578 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 17579
e7b9e80f
PE
17580 * print.c (print_error_message): Avoid int overflow.
17581
56201685
PE
17582 * font.c (font_list_entities): Redo for clarity,
17583 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17584
78834453 17585 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 17586 (font_score): Avoid potential overflow in diff calculation.
78834453 17587
0bc0b309 17588 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 17589 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 17590
e610eaca
PE
17591 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17592
b895abce
PE
17593 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17594 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17595 can always succeed if overflow has undefined behavior.
17596
1f1d9321 17597 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 17598 (wordify): Omit three unnecessary tests.
1f1d9321 17599
c59478bc
PE
17600 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17601 All callers changed. This avoids the need for an unused var.
17602
79b73827
PE
17603 * casefiddle.c (casify_region): Remove var that is set but not used.
17604
a4db5dfe
PE
17605 * dired.c (file_name_completion): Remove var that is set but not used.
17606
43aae36e
PE
17607 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17608
2a47c44d 17609 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 17610 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 17611
a37c69bf
PE
17612 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17613 Check for integer overflow on size calculations.
17614
328ab8e7
PE
17615 * buffer.c (Fprevious_overlay_change): Remove var that is set
17616 but not used.
17617
e5a2a5cb
PE
17618 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17619 Remove vars that are set but not used.
8d84a6eb 17620 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 17621 (timer_check_2): Mark vars as initialized.
e5a2a5cb 17622
a60e5f68
PE
17623 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17624
f661cb61 17625 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 17626 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 17627
f0397f5a
PE
17628 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17629 that are set but not used.
17630
8664db06 17631 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 17632 if XCreateBitmapFromData fails (Bug#8410).
8664db06 17633
6abdaa4a
PE
17634 * xselect.c (x_get_local_selection, x_handle_property_notify):
17635 Remove vars that are set but not used.
17636
0ce7538d 17637 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 17638 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 17639
9ae848fc
PE
17640 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17641 Remove var that is set but not used.
0b918413
PE
17642 (scroll_bar_windows_size): Now size_t, not int.
17643 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17644 Check for overflow.
9ae848fc 17645
a5a62657
PE
17646 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17647 (map_tty_color) [!defined MSDOS]: Likewise.
17648
5c5cdd39
PE
17649 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17650
66ebf983
PE
17651 * coding.c: Remove vars that are set but not used.
17652 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17653 All callers changed.
17654 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17655 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17656 (decode_coding_charset): Remove vars that are set but not used.
17657
1be4d761
PE
17658 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17659 that is set but not used.
17660
47553fa8
PE
17661 * print.c (print_object): Remove var that is set but not used.
17662
1f7196bf 17663 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
17664 The gnulib version avoids calling malloc in the usual case,
17665 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17666 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17667 * filelock.c (current_lock_owner): Likewise.
17668 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17669 * sysdep.c: Include allocator.h, careadlinkat.h.
17670 (emacs_no_realloc_allocator): New static constant.
17671 (emacs_readlink): New function.
fdb61804
PE
17672 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17673 ../lib/careadlinkat.h.
d1fdcab7 17674
f84c17c7
SM
176752011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17676
17677 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17678 first non-nil return value).
17679
ef3862ad
JD
176802011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17681
17682 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17683 if not defined (Bug#8403).
17684
376a7006
JB
176852011-04-02 Juanma Barranquero <lekktu@gmail.com>
17686
17687 * xdisp.c (display_count_lines): Remove parameter `start',
17688 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17689 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17690 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17691 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17692 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17693 and thereabouts. All callers changed.
17694 (get_per_char_metric): Remove parameter `f', unused since
17695 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17696
6ca3801d
JM
176972011-04-02 Jim Meyering <meyering@redhat.com>
17698
17699 do not dereference NULL upon failed strdup
17700 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17701 (ns_get_family): Likewise.
17702
d8e2b5ba
JB
177032011-04-02 Juanma Barranquero <lekktu@gmail.com>
17704
17705 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17706
8c74fcbd
JD
177072011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17708
17709 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17710 later (Bug#8403).
17711
7200d79c
SM
177122011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17713
03408648 17714 Add lexical binding.
7200d79c 17715
03408648
SM
17716 * window.c (Ftemp_output_buffer_show): New fun.
17717 (Fsave_window_excursion):
17718 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17719
17720 * lread.c (lisp_file_lexically_bound_p): New function.
17721 (Fload): Bind Qlexical_binding.
17722 (readevalloop): Remove `evalfun' arg.
17723 Bind Qinternal_interpreter_environment.
17724 (Feval_buffer): Bind Qlexical_binding.
17725 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17726 Mark as dynamic.
17727 (syms_of_lread): Declare `lexical-binding'.
17728
17729 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17730
17731 * keyboard.c (eval_dyn): New fun.
17732 (menu_item_eval_property): Use it.
ca105506
SM
17733
17734 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 17735
03408648
SM
17736 * fns.c (concat, mapcar1): Accept byte-code-functions.
17737
17738 * eval.c (Fsetq): Handle lexical vars.
17739 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17740 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17741 (FletX, Flet): Obey lexical binding.
17742 (Fcommandp): Handle closures.
17743 (Feval): New `lexical' arg.
17744 (eval_sub): New function extracted from Feval. Use it almost
17745 everywhere where Feval was used. Look up vars in lexical env.
17746 Handle closures.
17747 (Ffunctionp): Move from subr.el.
17748 (Ffuncall): Handle closures.
17749 (apply_lambda): Remove `eval_flags'.
17750 (funcall_lambda): Handle closures and new byte-code-functions.
17751 (Fspecial_variable_p): New function.
17752 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17753 but without exporting it to Lisp.
23aba0ea 17754
23aba0ea 17755 * doc.c (Fdocumentation, store_function_docstring):
03408648 17756 * data.c (Finteractive_form): Handle closures.
23aba0ea 17757
03408648
SM
17758 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17759 interactive spec.
ba83908c 17760
04f2d78b
CB
17761 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17762 New byte-codes.
03408648
SM
17763 (exec_byte_code): New function extracted from Fbyte_code to handle new
17764 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 17765
03408648 17766 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 17767
03408648 17768 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 17769
e2abce01
JB
177702011-03-31 Juanma Barranquero <lekktu@gmail.com>
17771
17772 * xdisp.c (redisplay_internal): Fix prototype.
17773
63696a73 177742011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 17775
63696a73 17776 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
17777 (try_scrolling): Use it when setting scroll_limit.
17778 Limit scrolling to 100 screen lines.
63696a73
EZ
17779 (redisplay_window): Even when falling back on "recentering",
17780 position point in the window according to scroll-conservatively,
17781 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17782
17783 (try_scrolling): When point is above the window, allow searching
17784 as far as scroll_max, or one screenful, to compute vertical
17785 distance from PT to the scroll margin position. This prevents
17786 try_scrolling from unnecessarily failing when
17787 scroll-conservatively is set to a value slightly larger than the
17788 window height. Clean up the case of PT below the margin at bottom
17789 of window: scroll_max can no longer be INT_MAX. When aggressive
17790 scrolling is in use, don't let point enter the opposite scroll
17791 margin as result of the scroll.
17792 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
17793 threshold of 100 lines for never-recentering scrolling.
17794
e4cc2dfc
JB
177952011-03-31 Juanma Barranquero <lekktu@gmail.com>
17796
17797 * dispextern.h (move_it_by_lines):
17798 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17799 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17800 (message_log_check_duplicate): Remove parameters `prev_bol' and
17801 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17802 (redisplay_internal): Remove parameter `preserve_echo_area',
17803 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17804
17805 * indent.c (Fvertical_motion):
17806 * window.c (window_scroll_pixel_based, Frecenter):
17807 Don't pass `need_y_p' to `move_it_by_lines'.
17808
1c470562
SM
178092011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17810
44f230aa
SM
17811 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17812 steal a few bits to be more compact.
17813 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17814 Remove unneeded casts.
17815
1c470562
SM
17816 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17817
888adce9
ZK
178182011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17819
17820 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17821 binding" message (bug#7967).
17822
f838ed7b
PE
178232011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17824
77861b95
PE
17825 Fix more problems found by GCC 4.6.0's static checks.
17826
de6dbc14
PE
17827 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17828 Remove unused local var.
17829
f838ed7b
PE
17830 * editfns.c (Fmessage_box): Remove unused local var.
17831
792c7b2b
PE
17832 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17833 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17834 Omit unused local vars.
c499e557 17835 * window.c (shrink_windows): Omit unused local var.
b01a1c29 17836 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
17837 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17838 Omit unused local var.
17839
ba0165e1
PE
17840 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17841 Don't assume string length fits in int.
32ad8845 17842 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 17843 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 17844
3c59b4c9
PE
17845 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17846 instead of alloca (Bug#8344).
17847
a3eed478 17848 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 17849 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 17850
eb4d412d
PE
17851 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17852
1658b401
PE
17853 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17854 concerns.
17855
17856 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17857
17858 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 17859
9a2c6e05
PE
17860 * keyboard.c (syms_of_keyboard): Use the same style as later
17861 in this function when indexing through an array. This also
17862 works around GCC bug 48267.
17863
03d0a109
PE
17864 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17865
44f730c8
PE
17866 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17867
fe75f926
PE
17868 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17869 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17870
ffa8c828
PE
17871 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17872 This avoids undefined behavior on integer overflow, and is a bit
17873 more convenient anyway since it is compared to a size_t variable.
17874
c5101a77
PE
17875 Variadic C functions now count arguments with size_t, not int.
17876 This avoids an unnecessary limitation on 64-bit machines, which
17877 caused (substring ...) to crash on large vectors (Bug#8344).
17878 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17879 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 17880 All variadic functions and their callers changed accordingly.
c5101a77
PE
17881 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17882 * data.c (arith_driver, float_arith_driver): Likewise.
17883 * editfns.c (general_insert_function): Likewise.
17884 * eval.c (struct backtrace.nargs, interactive_p)
17885 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17886 (funcall_lambda, mark_backtrace): Likewise.
17887 * fns.c (concat): Likewise.
17888 * frame.c (x_set_frame_parameters): Likewise.
17889 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17890 0 if not found, not -1. All callers changed.
17891
dd3f25f7
PE
17892 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17893 (stack_copy_size): Now size_t, not int.
17894 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17895
461c2ab9
JB
178962011-03-28 Juanma Barranquero <lekktu@gmail.com>
17897
17898 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17899 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17900 All callers changed.
17901
17902 * lisp.h (multibyte_char_to_unibyte):
17903 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17904 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17905 * character.h (CHAR_TO_BYTE8):
17906 * cmds.c (internal_self_insert):
17907 * editfns.c (general_insert_function):
17908 * keymap.c (push_key_description):
17909 * search.c (Freplace_match):
17910 * xdisp.c (message_dolog, set_message_1): All callers changed.
17911
f6d62986
SM
179122011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17913
17914 * keyboard.c (safe_run_hook_funcall): New function.
17915 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17916 don't set the hook to nil, but remove the offending function instead.
17917 (Qcommand_hook_internal): Remove, unused.
17918 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17919 Vcommand_hook_internal.
17920
17921 * eval.c (enum run_hooks_condition): Remove.
17922 (funcall_nil, funcall_not): New functions.
17923 (run_hook_with_args): Call each function through a `funcall' argument.
17924 Remove `cond' argument, now redundant.
17925 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17926 (Frun_hook_with_args_until_failure): Adjust accordingly.
17927 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17928
1db5b1ad
JB
179292011-03-28 Juanma Barranquero <lekktu@gmail.com>
17930
17931 * dispextern.h (string_buffer_position): Remove declaration.
17932
17933 * print.c (strout): Remove parameter `multibyte', unused since
17934 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17935
17936 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17937 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17938 All callers changed.
17939
17940 * w32.c (_wsa_errlist): Use braces for struct initializers.
17941
17942 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17943 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17944 All callers changed.
17945 (string_buffer_position): Likewise. Also, make static (it's never
17946 used outside xdisp.c).
17947 (cursor_row_p): Remove parameter `w', unused since
17948 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17949 (decode_mode_spec): Remove parameter `precision', introduced during
17950 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17951 All callers changed.
17952
5ffb62aa
JD
179532011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17954
17955 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17956
461c2ab9 179572011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
17958
17959 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17960 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17961 (ns_update_auto_hide_menu_bar): New functions.
17962 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17963 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17964 ns_constrain_all_frames.
17965 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17966 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17967
5c380ffb
JD
179682011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17969
17970 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17971
9af30bdf
GM
179722011-03-27 Glenn Morris <rgm@gnu.org>
17973
17974 * syssignal.h: Replace RETSIGTYPE with void.
17975 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17976 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17977 Replace SIGTYPE with void everywhere.
17978 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17979 * s/template.h (SIGTYPE): Remove commented out definition.
17980
e2abce01
JB
179812011-03-26 Eli Zaretskii <eliz@gnu.org>
17982
17983 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17984 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17985
f868cd8a
JB
179862011-03-26 Juanma Barranquero <lekktu@gmail.com>
17987
59eb0929
JB
17988 * w32.c (read_unc_volume): Use parameter `henum', instead of
17989 global variable `wget_enum_handle'.
17990
17991 * keymap.c (describe_vector): Remove parameters `indices' and
17992 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17993 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17994
f868cd8a
JB
17995 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17996
17997 * keyboard.c (timer_check): Remove parameter `do_it_now',
17998 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17999 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18000 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18001
18002 * keyboard.c (read_char):
18003 * w32menu.c (w32_menu_display_help):
18004 * xmenu.c (show_help_event, menu_help_callback):
18005 Adjust calls to `show_help_echo'.
18006
18007 * gtkutil.c (xg_maybe_add_timer):
18008 * keyboard.c (readable_events):
18009 * process.c (wait_reading_process_output):
18010 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18011
18012 * insdel.c (adjust_markers_gap_motion):
18013 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18014 (gap_left, gap_right): Don't call it.
18015
2ecf6fdb
CY
180162011-03-25 Chong Yidong <cyd@stupidchicken.com>
18017
18018 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18019 incurred during fontification.
18020
6b1f9ba4
JB
180212011-03-25 Juanma Barranquero <lekktu@gmail.com>
18022
18023 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18024 (DEFVAR_PER_BUFFER): Don't pass it.
18025
18026 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18027 (scrolling_window): Don't pass it.
18028
0f4a96b5
JB
180292011-03-25 Juanma Barranquero <lekktu@gmail.com>
18030
18031 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18032
18033 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18034 and `suffix'.
18035 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18036 of variables specific to SELinux and computation of `encoded_absname'.
18037
18038 * image.c (XPutPixel): Remove unused variable `height'.
18039
18040 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18041
18042 * unexw32.c (get_section_info): Remove unused variable `section'.
18043
18044 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18045 (system_process_attributes): Remove unused variable `sess'.
18046 (sys_read): Remove unused variable `err'.
18047
18048 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18049 (w32_wnd_proc): Remove unused variable `isdead'.
18050 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18051 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18052 (x_create_tip_frame): Remove unused variable `tem'.
18053
18054 * w32inevt.c (w32_console_read_socket):
18055 Remove unused variable `no_events'.
18056
18057 * w32term.c (x_draw_composite_glyph_string_foreground):
18058 Remove unused variable `width'.
18059
1149507c
JB
180602011-03-24 Juanma Barranquero <lekktu@gmail.com>
18061
18062 * w32term.c (x_set_glyph_string_clipping):
18063 Don't pass uninitialized region to CombineRgn.
18064
9c88f339
JB
180652011-03-23 Juanma Barranquero <lekktu@gmail.com>
18066
18067 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18068 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18069 (Fx_close_connection): Remove unused variable `i'.
18070
18071 * w32font.c (w32font_draw): Return number of glyphs.
18072 (w32font_open_internal): Remove unused variable `i'.
18073 (w32font_driver): Add missing initializer.
18074
18075 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18076 (fill_in_menu): Remove unused variable `items_added'.
18077
18078 * w32term.c (last_mouse_press_frame): Remove static global variable.
18079 (w32_clip_to_row): Remove unused variable `f'.
18080 (x_delete_terminal): Remove unused variable `i'.
18081
18082 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18083 (NOTHING): Remove unused static global variable.
18084 (uniscribe_check_otf): Remove unused variable `table'.
18085 (uniscribe_font_driver): Add missing initializers.
18086
dee091a3
JD
180872011-03-23 Julien Danjou <julien@danjou.info>
18088
18089 * term.c (Fsuspend_tty, Fresume_tty):
18090 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18091 * window.c (temp_output_buffer_show):
18092 * insdel.c (signal_before_change):
18093 * frame.c (Fhandle_switch_frame):
18094 * fileio.c (Fdo_auto_save):
18095 * emacs.c (Fkill_emacs):
18096 * editfns.c (save_excursion_restore):
18097 * cmds.c (internal_self_insert):
18098 * callint.c (Fcall_interactively):
18099 * buffer.c (Fkill_all_local_variables):
18100 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18101 Use Frun_hooks.
0f4a96b5 18102 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 18103 unconditionally since it does the check itself.
dee091a3 18104
2c520ab5 181052011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 18106
c9c49752
PE
18107 Fix more problems found by GCC 4.5.2's static checks.
18108
8abc3f12
PE
18109 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18110 the first time through the loop, since we know p0 < p1 then.
18111 This also avoids a gcc -Wstrict-overflow warning.
18112
a2d26660
PE
18113 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18114 leading to a memory leak, possible in functions like
18115 load_charset_map_from_file that can allocate an unbounded number
b12ef411 18116 of objects (Bug#8318).
a2d26660 18117
916c72e9
PE
18118 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18119 that could (at least in theory) be that large.
18120
19ab8a18
PE
18121 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18122 This is less likely to overflow, and avoids undefined behavior if
18123 overflow does occur. All callers changed. Use strtoul to scan
18124 for the unsigned long integer.
b7cbbd6f
PE
18125 (pint2hrstr): Simplify and tune code slightly.
18126 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 18127
f0641eff
PE
18128 * scroll.c (do_scrolling): Work around GCC bug 48228.
18129 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18130
7f650bb9
PE
18131 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18132 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
18133 (validate_x_resource_name): Simplify count usage.
18134 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 18135
37dd57d1
PE
18136 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18137 fail (Bug#8306).
81e56e61 18138
699979fc 18139 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 18140
401bf9b4
PE
18141 * process.c (Fmake_network_process): Use socklen_t, not int,
18142 where POSIX says socklen_t is required in portable programs.
18143 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 18144 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
18145 (Fmake_network_process, server_accept_connection):
18146 (wait_reading_process_output, read_process_output):
18147 Likewise.
18148
b93aacde
PE
18149 * process.c: Rename or move locals to avoid shadowing.
18150 (list_processes_1, Fmake_network_process):
18151 (read_process_output_error_handler, exec_sentinel_error_handler):
18152 Rename or move locals.
4dc343ee 18153 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 18154 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 18155 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 18156 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 18157 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 18158
af8a867c 18159 Make tparam.h and terminfo.c consistent.
44f230aa
SM
18160 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18161 Include tparam.h instead, since it declares them.
af8a867c
PE
18162 * cm.h (PC): Remove extern decl; tparam.h now does this.
18163 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18164 * terminfo.c: Include tparam.h, to check interfaces.
18165 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18166 (tparam): Adjust signature to match interface in tparam.h;
18167 this removes some undefined behavior. Check that outstring and len
18168 are zero, which they always are with Emacs.
18169 * tparam.h (PC, BC, UP): New extern decls.
18170
0248044d 18171 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 18172 (xftfont_open): Rename locals to avoid shadowing.
0248044d 18173
8ff096c1 18174 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
18175 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18176 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 18177 (ftfont_list): Remove unused local.
49eaafba
PE
18178 (get_adstyle_property, ftfont_pattern_entity):
18179 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18180 Rename locals to avoid shadowing.
8ff096c1 18181
e2be39f6
PE
18182 * xfont.c (xfont_list_family): Mark var as initialized.
18183
c9735e30
PE
18184 * xml.c (make_dom): Now static.
18185
8f5201ae
PE
18186 * composite.c (composition_compute_stop_pos): Rename local to
18187 avoid shadowing.
b246f932
PE
18188 (composition_reseat_it): Remove unused locals.
18189 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 18190 (composition_update_it): Mark var as initialized.
11b61122
PE
18191 (find_automatic_composition): Mark vars as initialized,
18192 with a FIXME (Bug#8290).
8f5201ae 18193
760fbc2c
PE
18194 character.h: Rename locals to avoid shadowing.
18195 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18196 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18197 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18198 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18199 to avoid shadowing.
18200
ff08eb85
PE
18201 * textprop.c (property_change_between_p): Remove; unused.
18202
fc7bf025
PE
18203 * intervals.c (interval_start_pos): Now static.
18204
235d7abc
PE
18205 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18206
44f230aa
SM
18207 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18208 Rename locals to avoid shadowing.
3e7d6594 18209
50060332
PE
18210 * sound.c (wav_play, au_play, Fplay_sound_internal):
18211 Fix pointer signedness.
d01f234b 18212 (alsa_choose_format): Remove unused local var.
c83b8872
PE
18213 (wav_play): Initialize a variable to 0, to prevent undefined
18214 behavior (Bug#8278).
50060332 18215
c4fc4e30
PE
18216 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18217
918436ed
PE
18218 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18219
c939f91b
PE
18220 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18221 clobbering (Bug#8298).
b9c7f648
PE
18222 * sysdep.c (sys_subshell): Likewise.
18223 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 18224
6bd8c144
PE
18225 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18226 This should get cleaned up, so that child_setup has the
18227 same signature on all platforms.
18228
7710357c 18229 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 18230 (relocate_fd): Rename locals to avoid shadowing.
7710357c 18231
c59da222
CY
182322011-03-22 Chong Yidong <cyd@stupidchicken.com>
18233
18234 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18235 not to be necessary, and produces flickering.
18236
66b87493
GM
182372011-03-20 Glenn Morris <rgm@gnu.org>
18238
18239 * config.in: Remove file.
18240
45b6f6d5
JB
182412011-03-20 Juanma Barranquero <lekktu@gmail.com>
18242
18243 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18244 are now in src/globals.h.
18245 (syms_of_minibuf): Remove spurious & from previous change.
18246
cd394be1 182472011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
18248
18249 * minibuf.c (completing-read-function): New variable.
18250 (completing-read-default): Rename from completing-read.
18251 (completing-read): Call completing-read-function.
18252
b14e3e21
CY
182532011-03-19 Juanma Barranquero <lekktu@gmail.com>
18254
18255 * xfaces.c (Fx_load_color_file):
18256 Read color file from absolute filename (bug#8250).
18257
f2b726e6
JB
182582011-03-19 Juanma Barranquero <lekktu@gmail.com>
18259
18260 * makefile.w32-in: Update dependencies.
18261
09f6ff02
EZ
182622011-03-17 Eli Zaretskii <eliz@gnu.org>
18263
18264 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18265
29a6015a
PE
182662011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18267
a3a6c54e
PE
18268 Fix more problems found by GCC 4.5.2's static checks.
18269
b766f867
PE
18270 * process.c (make_serial_process_unwind, send_process_trap):
18271 (sigchld_handler): Now static.
18272
be02381c
PE
18273 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18274 That way, the code declares only the vars that it needs.
18275 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18276 * s/cygwin.h (PTY_ITERATION): Likewise.
18277 * s/darwin.h (PTY_ITERATION): Likewise.
18278 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18279
57048744
PE
18280 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18281 * process.c (allocate_pty): Don't declare stb unless it's needed.
18282
7914961c 18283 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
18284 (CONSTANTLIM): Remove; unused.
18285 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18286 Define only if needed.
7914961c 18287
b3967b18
PE
18288 * unexelf.c (unexec): Name an expression,
18289 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
18290 Use a different way to cause a compilation error if anyone uses
18291 n rather than nn, a way that does not involve shadowing.
73366a00 18292 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 18293
29a6015a
PE
18294 * deps.mk (unexalpha.o): Remove; unused.
18295
43cfc33e 18296 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 18297 * unexec.h: New file.
ce701a33
PE
18298 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18299 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18300 Depend on unexec.h.
18301 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18302 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18303 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 18304 Change as necessary to match prototype in unexec.h.
ce701a33 18305
01f44d5a
PE
18306 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18307 shadowing.
4f63c6bb 18308 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 18309
a6670b0b
PE
18310 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18311 Rename locals to avoid shadowing.
18312
cef2010d 18313 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 18314 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 18315
d4d7173a
PE
18316 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18317
f08b802a
PE
18318 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18319 warning when compiling print.c.
18320
3ddb0639
PE
18321 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18322 instead of using an uninitialized var.
5ad03b97 18323 (font_sort_entities): Mark var as initialized.
3ddb0639 18324
170a2692
PE
18325 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18326
e663c700
PE
18327 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18328 pointers to constants.
89bc529a 18329 (font_parse_fcname): Remove unused vars.
7b81e2d0 18330 (font_delete_unmatched): Now static.
ea838e10 18331 (font_get_spec): Remove; unused.
13a547c6
PE
18332 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18333 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18334 Rename or move locals to avoid shadowing.
e663c700 18335
2a80c887 18336 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 18337 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 18338
1384fa33 18339 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 18340 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 18341
8b2c52e9
PE
18342 * alloc.c (mark_backtrace): Move decl from here ...
18343 * lisp.h: ... to here, so that it can be checked.
18344
475545b5 18345 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 18346 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
18347 (lisp_indirect_variable): Name an expression,
18348 to avoid gcc -Wbad-function-cast warning.
1faed8ae 18349 (Fdefvar): Rename locals to avoid shadowing.
475545b5 18350
b1349114 18351 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 18352 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 18353 Use const pointer when appropriate.
b1349114 18354
a2928364
PE
18355 * lisp.h (get_system_name, get_operating_system_release):
18356 Move decls here, to check interfaces.
18357 * process.c (get_operating_system_release): Move decl to lisp.h.
18358 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
18359 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18360 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18361 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
18362 (Fformat_time_string, Fencode_time, Finsert_char):
18363 (Ftranslate_region_internal, Fformat):
18364 Rename or remove local vars to avoid shadowing.
9710023e 18365 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 18366
a415e694
PE
18367 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18368 avoid shadowing.
18369
8ef4622d
PE
18370 * lisp.h (eassert): Check that the argument compiles, even if
18371 ENABLE_CHECKING is not defined.
18372
946f9a5b
PE
18373 * data.c (Findirect_variable): Name an expression, to avoid
18374 gcc -Wbad-function-cast warning.
112396d6 18375 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 18376 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
18377 (Fmake_variable_buffer_local, Fmake_local_variable):
18378 Mark variables as initialized.
52746918 18379 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 18380
e5aab7e7 18381 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
18382 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18383 Rename locals to avoid shadowing.
dff45157
PE
18384 (mark_stack): Move local variables into the #ifdef region where
18385 they're used.
7bc26fdb
PE
18386 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18387 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18388 needed otherwise.
18389 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18390 (GC_STRING_CHARS): Remove; not used.
d40d4be1 18391 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 18392
e5aab7e7
PE
18393 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18394 avoids undefined behavior in theory.
18395
4da60324
PE
18396 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18397
88043301
PE
18398 Use functions, not macros, for up- and down-casing (Bug#8254).
18399 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18400 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18401 to use the following functions instead of these macros.
18402 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18403 EMACS_INT, since callers assume the returned value fits in int.
18404 (upcase1): Likewise, for UPCASE_TABLE.
18405 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 18406 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 18407 the race-condition problem in the old DOWNCASE.
88043301 18408
19ed5445
PE
18409 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18410 Rename locals to avoid shadowing.
18411 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
18412 (regex_compile, re_search_2, re_match_2_internal):
18413 Remove unused local vars.
952db0d7
PE
18414 (FREE_VAR): Rewrite so as not to use empty "else",
18415 which gcc can warn about.
da053e48 18416 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
18417 (RETALLOC_IF): Define only if needed.
18418 (WORDCHAR_P): Likewise. This one is never needed, but is used
18419 only in a comment talking about a compiler bug, so put inside
18420 the #if 0 of that comment.
18421 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18422 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18423 Remove; unused.
19ed5445 18424
1f3561e4 18425 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
18426 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18427 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 18428
ded6f8f7
PE
18429 * search.c (simple_search): Remove unused var.
18430
dbd37a95
PE
18431 * dired.c (compile_pattern): Move decl from here ...
18432 * lisp.h: ... to here, so that it can be checked.
18433 (struct re_registers): New forward decl.
18434
7e47afad
PE
18435 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18436
85f24f61
PE
18437 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18438 All uses changed.
18439 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18440 Rename locals to avoid shadowing.
5671df8f 18441 (Fvertical_motion): Mark locals as initialized.
85f24f61 18442
181aa2be 18443 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 18444 (casify_region): Mark local as initialized.
181aa2be 18445
930d429c
PE
18446 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18447
7082eac6
PE
18448 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18449 New macros, so that the caller can use some names other than
18450 gcpro1, gcpro2, etc.
18451 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18452 of the new macros.
18453 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18454 argument, for consistency with GCPRO2_VAR, etc: it is now the
18455 prefix of the variable, not the variable itself. All uses
18456 changed.
38b2c076
PE
18457 * dired.c (directory_files_internal, file_name_completion):
18458 Rename locals to avoid shadowing.
18459
15206ed9
PE
18460 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18461 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18462 dired.c's scmp function, had undefined behavior.
18463 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18464 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18465 * buffer.h: ... to here, because these macros use current_buffer,
18466 and the new implementation with inline functions needs to have
18467 current_buffer in scope now, rather than later when the macros
18468 are used.
18469 (downcase, upcase1): New static inline functions.
18470 (DOWNCASE, UPCASE1): Reimplement using these functions.
18471 This avoids undefined behavior in expressions like
18472 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18473 from race conditions in accessing the global variables
18474 case_temp1 and case_temp2.
18475 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18476 * lisp.h (case_temp1, case_temp2): Remove their decls.
18477 * character.h (ASCII_CHAR_P): Move from here ...
18478 * lisp.h: ... to here, so that the inline functions mentioned
18479 above can use them.
18480
4a6bea26
PE
18481 * dired.c (directory_files_internal_unwind): Now static.
18482
f14b7e14
PE
18483 * fileio.c (file_name_as_directory, directory_file_name):
18484 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18485 Now static.
2893f146
PE
18486 (file_name_as_directory): Use const pointers when appropriate.
18487 (Fexpand_file_name): Likewise. In particular, newdir might
18488 point at constant storage, so make it a const pointer.
fd4ead52 18489 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
18490 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18491 signedness issues.
f839df0c
PE
18492 (Fset_file_times, Finsert_file_contents, auto_save_error):
18493 Rename locals to avoid shadowing.
f14b7e14 18494
5716756e 18495 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
18496 (Ftry_completion, Fall_completions): Rename or remove locals
18497 to avoid shadowing.
5716756e 18498
b4c3046a
PE
18499 * marker.c (bytepos_to_charpos): Remove; unused.
18500
b45db522
PE
18501 * lisp.h (verify_bytepos, count_markers): New decls,
18502 so that gcc does not warn that these functions aren't declared.
18503
85876d07
PE
18504 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18505 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 18506 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 18507 (copy_text): Remove unused local var.
85876d07 18508
03d78a21 18509 * filelock.c (within_one_second): Now static.
b3dd38ab 18510 (lock_file_1): Rename local to avoid shadowing.
03d78a21 18511
5df8f01b
PE
18512 * buffer.c (fix_overlays_before): Mark locals as initialized.
18513 (fix_start_end_in_overlays): Likewise. This function should be
18514 simplified by using pointers-to-pointers, but that's a different
18515 matter.
b1d876f1 18516 (switch_to_buffer_1): Now static.
8f54f30a
PE
18517 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18518 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 18519
a70072c9 18520 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 18521 Fix pointer signedness issue.
edced198
PE
18522 (sys_subshell): Mark local as volatile if checking for lint,
18523 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 18524 (MAXPATHLEN): Define only if needed.
a70072c9 18525
a0977c44
PE
18526 * process.c (serial_open, serial_configure): Move decls from here ...
18527 * systty.h: ... to here, so that they can be checked.
18528
a884fdcc
PE
18529 * fns.c (get_random, seed_random): Move extern decls from here ...
18530 * lisp.h: ... to here, so that they can be checked.
18531
604efe86 18532 * sysdep.c (reset_io): Now static.
b8950c94 18533 (wait_for_termination_signal): Remove; unused.
604efe86 18534
38fc62d9
PE
18535 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18536 (copy_keymap_item, append_key, push_text_char_description):
18537 Now static.
1004a21a 18538 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 18539 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
18540 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18541 (describe_map_tree):
18542 Rename locals to avoid shadowing.
38fc62d9 18543
2f2650da
PE
18544 * keyboard.c: Declare functions static if they are not used elsewhere.
18545 (echo_char, echo_dash, cmd_error, top_level_2):
18546 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
18547 (read_char, kbd_buffer_get_event, make_lispy_position):
18548 (make_lispy_event, make_lispy_movement, apply_modifiers):
18549 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18550 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18551 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 18552 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 18553 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 18554
a053e86c 18555 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
18556 (mark_kboards): Move decl here ...
18557 * alloc.c (mark_kboards): ... from here.
a053e86c 18558
4752793e
PE
18559 * lisp.h (force_auto_save_soon): New decl.
18560
74f10ca7 18561 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
18562 (DEFINE_DUMMY_FUNCTION): New macro.
18563 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18564 Use it.
c03cd23f
PE
18565 (main): Add casts to avoid warnings
18566 if GCC considers string literals to be constants.
74f10ca7 18567
022e70d4
PE
18568 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18569
59d6fe83
PE
18570 * dbusbind.c: Pointer signedness fixes.
18571 (xd_signature, xd_append_arg, xd_initialize):
18572 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18573 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18574 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18575 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18576
78320123
PE
18577 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18578 if GCC considers string literals to be constants.
49cebcca 18579 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 18580
35ac2a97
SM
185812011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18582
fb103ca9
SM
18583 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18584 (print_preprocess, print_object): New macro to fix last change.
18585
35ac2a97
SM
18586 * print.c (print_preprocess): Don't forget font objects.
18587
62973b41
JB
185882011-03-16 Juanma Barranquero <lekktu@gmail.com>
18589
18590 * emacs.c (USAGE3): Doc fixes.
18591
0e48bb22
AS
185922011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18593
18594 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18595 structure.
18596
7684e57b
JB
185972011-03-14 Juanma Barranquero <lekktu@gmail.com>
18598
18599 * lisp.h (VWindow_system, Qfile_name_history):
18600 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18601 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18602 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18603
18604 * w32select.c: Don't #include "keyboard.h".
c96bbc66 18605 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
18606
18607 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18608 * w32console.c (detect_input_pending, read_input_pending)
18609 (encode_terminal_code):
18610 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18611 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18612 (w32_system_caret_y, Qfile_name_history):
18613 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18614 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18615 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18616 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18617 * w32proc.c (Qlocal, report_file_error):
18618 * w32term.c (Vwindow_system, updating_frame):
18619 * w32uniscribe.c (initialized, uniscribe_font_driver):
18620 Remove unneeded extern declarations.
18621
2aa46d6c
CY
186222011-03-14 Chong Yidong <cyd@stupidchicken.com>
18623
c96bbc66 18624 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 18625
cffc6f3b
CY
186262011-03-13 Chong Yidong <cyd@stupidchicken.com>
18627
18628 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18629 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18630 These macros can no longer be used for assignment.
18631
44f230aa
SM
18632 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18633 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
18634 (record_buffer_markers, fetch_buffer_markers): New functions for
18635 recording and fetching special buffer markers.
18636 (set_buffer_internal_1, set_buffer_temp): Use them.
18637
18638 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18639
18640 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18641
18642 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18643 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18644
18645 * xdisp.c (hscroll_window_tree):
18646 (reconsider_clip_changes): Use PT instead of BUF_PT.
18647
d251f04b
EZ
186482011-03-13 Eli Zaretskii <eliz@gnu.org>
18649
18650 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18651 $(EMACS_ROOT)/lib/intprops.h.
18652
f0c77cd1
PE
186532011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18654
3eca4629
PE
18655 Fix more problems found by GCC 4.5.2's static checks.
18656
7c86ee98
PE
18657 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18658 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
18659 (xg_free_frame_widgets): Make it clear that a local variable is
18660 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
18661 (gdk_window_get_screen): Make it clear that this macro is needed
18662 only if USE_GTK_TOOLTIP.
1e5524e7
PE
18663 (int_gtk_range_get_value): New function, which avoids a diagnostic
18664 from gcc -Wbad-function-cast.
18665 (xg_set_toolkit_scroll_bar_thumb): Use it.
18666 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18667 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
18668 (get_utf8_string, xg_get_file_with_chooser):
18669 Rename locals to avoid shadowing.
18670 (create_dialog): Move locals to avoid shadowing.
7c86ee98 18671
41729b81
PE
18672 * xgselect.c (xg_select): Remove unused var.
18673
f0c77cd1
PE
18674 * image.c (four_corners_best): Mark locals as initialized.
18675 (gif_load): Initialize transparent_p to zero (Bug#8238).
18676 Mark another local as initialized.
ec6cf4c6 18677 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 18678
ce0ad53d 18679 * image.c (clear_image_cache): Now static.
d5d5a617 18680 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 18681 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
18682 (x_edge_detection): Remove unnecessary cast that
18683 gcc -Wbad-function-cast diagnoses.
2037898d 18684 (gif_load): Fix pointer signedness.
6ae141d6
PE
18685 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18686 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 18687
33383987 186882011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 18689
d32df629
PE
18690 Improve quality of tests for time stamp overflow.
18691 For example, without this patch (encode-time 0 0 0 1 1
18692 1152921504606846976) returns the obviously-bogus value (-948597
18693 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18694 reports time overflow. See
18695 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
18696 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18697 * editfns.c: Include limits.h and intprops.h.
18698 (TIME_T_MIN, TIME_T_MAX): New macros.
18699 (time_overflow): Move earlier, to before first use.
18700 (hi_time, lo_time): New functions, for an accurate test for
18701 out-of-range times.
18702 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18703 (Fget_internal_run_time): Don't assume time_t fits in int.
18704 (make_time): Use list2 instead of Fcons twice.
18705 (Fdecode_time): More accurate test for out-of-range times.
18706 (check_tm_member): New function.
18707 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
18708 (lisp_time_argument): Don't rely on undefined left-shift and
18709 right-shift behavior when checking for time stamp overflow.
8be6f318 18710
fe31d94c
PE
18711 * editfns.c (time_overflow): New function, refactoring common code.
18712 (Fformat_time_string, Fdecode_time, Fencode_time):
18713 (Fcurrent_time_string): Use it.
18714
8be6f318
PE
18715 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18716 * dired.c (make_time): Move to ...
18717 * editfns.c (make_time): ... here.
18718 * systime.h: Note the move.
18719
09d9db2c 187202011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 18721
126bc0dc
YM
18722 * fringe.c (update_window_fringes): Remove unused variables.
18723
c47cbdfd
YM
18724 * unexmacosx.c (copy_data_segment): Also copy __got section.
18725 (Bug#8223)
18726
7ac80be9
EZ
187272011-03-12 Eli Zaretskii <eliz@gnu.org>
18728
c96bbc66 18729 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
18730 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18731 Constify `char *' arguments and their references according to
18732 prototypes in tparam.h.
18733
ecb0f94d 18734 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 18735
7ac80be9
EZ
18736 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18737 Adapt all references accordingly.
18738
18739 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18740
ef1fd07e
TT
187412011-03-11 Tom Tromey <tromey@redhat.com>
18742
18743 * buffer.c (syms_of_buffer): Remove obsolete comment.
18744
7ef4b50c
EZ
187452011-03-11 Eli Zaretskii <eliz@gnu.org>
18746
18747 * termhooks.h (encode_terminal_code): Declare prototype.
18748
18749 * msdos.c (encode_terminal_code): Don't declare prototype.
18750
18751 * term.c (encode_terminal_code): Now external again, used by
18752 w32console.c and msdos.c.
18753
44f230aa
SM
18754 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18755 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 18756
4b1ec863 187572011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 18758
1714f52b 18759 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 18760
4b1ec863
PE
18761 * fringe.c (update_window_fringes): Mark locals as initialized
18762 (Bug#8227).
18763 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 18764
524c7aa6
PE
18765 * alloc.c (mark_fringe_data): Move decl from here ...
18766 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18767 to check its interface.
18768 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18769
a5c0af81 18770 * fontset.c (free_realized_fontset): Now static.
7519b8cd 18771 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 18772 (fontset_font): Mark local as initialized.
a9a06e0b 18773 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 18774
b4716021
PE
18775 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18776
811e9bac 18777 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 18778 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
18779 (x_own_selection, Fx_disown_selection_internal): Rename locals
18780 to avoid shadowing.
18781 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 18782
7e3ab302
PE
18783 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18784 so that the caller can use some name other than gcpro1.
18785 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
18786 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18787 (Fx_backspace_delete_keys_p):
18788 Use them to avoid shadowing, and rename vars to avoid shadowing.
18789 (x_decode_color, x_set_name, x_window): Now static.
6b437900 18790 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 18791 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
18792 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18793 Remove unused locals.
7e3ab302
PE
18794 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18795 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18796 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18797 macros.
f78faa98 18798
e2b13473
PE
18799 * xterm.h (x_mouse_leave): New decl.
18800
77f23912
PE
18801 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18802 Remove unused functions.
cdf4ba58
PE
18803 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18804 (x_calc_absolute_position): Now static.
7411c686 18805 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 18806 Don't declare local "event" unless it's used.
ed7bf3a5
PE
18807 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18808 unless they are used.
38d0b34a
PE
18809 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18810 (x_fatal_error_signal): Remove; not used.
a6067996
PE
18811 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18812 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18813 (x_error_catcher, x_connection_closed, x_error_handler):
18814 (x_error_quitter, xembed_send_message, x_iconify_frame):
18815 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 18816 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 18817 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 18818
44f230aa
SM
18819 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18820 Rename or move locals to avoid shadowing.
6b463e58 18821 (tty_defined_color, merge_face_heights): Now static.
5967d051 18822 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
18823 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18824 does not deduce is never used uninitialized.
73719eba
PE
18825 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18826 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 18827
426994c3 18828 * terminal.c (store_terminal_param): Now static.
5489860b 18829
032f1620 18830 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 18831 (set_frame_menubar): Remove unused local.
d4323972 18832 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
18833 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18834 since they might point to immutable storage.
281585b0
PE
18835 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18836 since it's unused otherwise.
032f1620 18837
367c19e5 18838 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 18839 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
18840 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18841 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 18842 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
18843 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18844 does not deduce are never used uninitialized.
70739cbe 18845
07b48fa9
PE
18846 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18847
8868a238 18848 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
18849 * window.c (window_loop, size_window):
18850 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 18851
7e5cf297 18852 * window.c (display_buffer): Now static.
d6550a9f
PE
18853 (size_window): Mark variables that gcc -Wuninitialized
18854 does not deduce are never used uninitialized.
a586633d
PE
18855 * window.h (check_all_windows): New decl, to forestall
18856 gcc -Wmissing-prototypes diagnostic.
5b555da1 18857 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 18858
f6095868
PE
18859 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18860 shadowing.
18861 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
18862 Include <limits.h>.
18863 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18864 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
18865 (load_charset_map): Mark variables that gcc -Wuninitialized
18866 does not deduce are never used uninitialized.
53df7c11 18867 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 18868
f38b440c
PE
18869 * coding.c (coding_set_source, coding_set_destination):
18870 Use "else { /* comment */ }" rather than "else /* comment */;"
18871 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
18872 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18873 a block, when the outer 'i' will do.
18874 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18875 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18876 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18877 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18878 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18879 Rename locals to avoid shadowing.
18880 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
18881 * coding.c (emacs_mule_char, encode_invocation_designation):
18882 Now static, since they're not used elsewhere.
413bb2db 18883 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 18884 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
18885 (decode_coding_emacs_mule): Mark variables that gcc
18886 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
18887 (detect_coding_iso_2022): Initialize a local variable that might
18888 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 18889 this initialization is needed. (Bug#8211)
5f58e762
PE
18890 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18891 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18892 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18893 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18894 Remove unused macros.
f38b440c 18895
232b38b9 18896 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 18897 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 18898 * character.c (string_count_byte8): Likewise.
232b38b9 18899
fb90da1b
PE
18900 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18901 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18902
fb93dbc2
PE
18903 * chartab.c (copy_sub_char_table): Now static, since it's not used
18904 elsewhere.
5c156ace
PE
18905 (sub_char_table_ref_and_range, char_table_ref_and_range):
18906 Rename locals to avoid shadowing.
bbcd0949 18907 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 18908
7d3b3862 18909 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 18910 (BIDI_BOB): Remove unused macro.
7d3b3862 18911
6be7d3da
PE
18912 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18913 deduce are never used uninitialized.
c2ed9c8b 18914 * term.c (encode_terminal_code): Likewise.
6be7d3da 18915
75f8807f 18916 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 18917
50938595
PE
18918 * tparam.h: New file.
18919 * term.c, tparam.h: Include it.
18920 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18921 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18922 Move these decls to tparam.h, and make them agree with what
18923 is actually in tparam.c. The previous trick of using incompatible
18924 decls in different modules does not conform to the C standard.
18925 All callers of tparam changed to use tparam's actual API.
18926 * tparam.c (tparam1, tparam, tgoto):
18927 Use const pointers where appropriate.
18928
fbceeba2
PE
18929 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18930 * cm.h (struct cm): Likewise.
18931 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18932 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18933 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18934 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18935 (turn_on_face, init_tty): Likewise.
18936 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 18937
7f3f1250
PE
18938 * term.c (term_mouse_position): Rename local to avoid shadowing.
18939
e6ca6543
PE
18940 * alloc.c (mark_ttys): Move decl from here ...
18941 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18942
c40f8d15
AS
189432011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18944
18945 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18946
cfe0661d
JB
189472011-03-09 Juanma Barranquero <lekktu@gmail.com>
18948
18949 * search.c (compile_pattern_1): Remove argument regp, unused since
18950 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18951 (compile_pattern): Don't pass it.
18952
0afb4571
J
189532011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18954
18955 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18956 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18957 for ! HAVE_GTK3.
18958 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18959
18960 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18961
18962 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18963 gdk_window_get_screen, gdk_window_get_geometry,
18964 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18965 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18966 (xg_get_pixbuf_from_pixmap): New function.
18967 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18968 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18969 Call xg_get_pixbuf_from_pixmap instead of
18970 gdk_pixbuf_get_from_drawable.
18971 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18972 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18973 (xg_check_special_colors): Use GtkStyleContext and its functions
18974 for HAVE_GTK3.
18975 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18976 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18977 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18978 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18979 Call gtk_widget_get_preferred_size.
0afb4571
J
18980 (xg_frame_resized): gdk_window_get_geometry only takes 5
18981 parameters.
44f230aa
SM
18982 (xg_win_to_widget, xg_event_is_for_menubar):
18983 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18984 (xg_set_widget_bg): New function.
18985 (delete_cb): New function.
895009e1 18986 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18987 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18988 (xg_set_background_color): Call xg_set_widget_bg.
18989 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18990 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18991 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18992 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18993 if ! HAVE_GTK3.
18994 (update_frame_tool_bar): Call gtk_widget_hide.
18995 (xg_initialize): Use GDK_KEY_g.
18996
18997 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18998 if ! HAVE_GTK3
18999 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19000
19001 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19002 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19003 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19004
1c2cc4ef
JB
190052011-03-08 Juanma Barranquero <lekktu@gmail.com>
19006
19007 * w32xfns.c (select_palette): Check success of RealizePalette against
19008 GDI_ERROR, not zero.
19009
33383987 19010See ChangeLog.11 for earlier changes.
aac0c6e3
MR
19011
19012;; Local Variables:
19013;; coding: utf-8
aac0c6e3
MR
19014;; End:
19015
2f097256 19016 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
19017
19018 This file is part of GNU Emacs.
19019
19020 GNU Emacs is free software: you can redistribute it and/or modify
19021 it under the terms of the GNU General Public License as published by
19022 the Free Software Foundation, either version 3 of the License, or
19023 (at your option) any later version.
19024
19025 GNU Emacs is distributed in the hope that it will be useful,
19026 but WITHOUT ANY WARRANTY; without even the implied warranty of
19027 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19028 GNU General Public License for more details.
19029
19030 You should have received a copy of the GNU General Public License
19031 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.