Remove CHECK_LIB_AVAILABLE from image.c, mistakenly reintroduced by cygw32.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
d424f3d8
EZ
12012-10-08 Eli Zaretskii <eliz@gnu.org>
2
3 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4 Cygwin.
5
e08348a0
DC
62012-10-08 Daniel Colascione <dancol@dancol.org>
7
8 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
9 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
10 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
11 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
12 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
13 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
14 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
15 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
16 now a supported configuration.
17
18 * Makefile.in: consolidate image variables into LIBIMAGE; add
19 W32_OBJ and W32_LIBS. Compile new files.
20
21 * conf_post.h:
22 (_DebPrint) declare tracing facility for W32 debugging. We need
23 to unify tracing later.
24
25 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
26 unconditional use of W32 Unicode functions. Cygwin runs only on
27 100% Unicode operating systems.
28
29 * cygw32.c: New file. Define Cygwin-specific facilities.
30 (Fcygwin_convert_path_to_windows)
31 (Fcygwin_convert_path_from_windows): New user functions for
32 accessing Cygwin path-munging routines.
33
34 * cygw32.h: New file.
35 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
36 UTF-16LE strings temporarily inside non-Lisp-visible string
37 objects.
38
39 (w32_strerror): Just what it says on the tin.
40
41 * emacs.c: Make the NS fork-then-exec code for daemon-launching
42 also run for Cygwin; both systems have the same problem with using
43 GUI facilities in a forked child. Also call syms_of_cygw32,
44 syms_of_w32select in correct places.
45
46 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
47 needs fork-then-exec for daemon launching.
48
49 * font.h: Include frame.h.
50
51 * image.c: Use the image library cache machinery only when we're
52 compiling for native WINDOWSNT; Cygwin can use shared libraries
53 like any other Unixlike system.
54
55 * keyboard.c: Clarify a comment regarding the input loop.
56
57 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
58 functions directly instead of trying to detect at runtime that our
59 host operating system supports them. We make this change for two
60 reasons: Cygwin lacks support for the multibyte character
61 conversion functions used by the legacy menu code, and Cygwin
62 never needs to rely on non-Unicode APIs.
63
64 * unexw32.c (hinst): Declare extern.
65
66 * w32.c: Change header order;
67 (w32_strerror): Move to w32fns.c because we need it for
68 non-WINDOWSNT builds.
69
70 * w32.h: Add #error macro to make sure we don't include w32.h for
71 Cygwin builds. Remove w32select declarations.
72
73 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
74 w32fns.c. w32console.c is WINDOWSNT-only.
75
76 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
77 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
78 POSIXy alternative.
79 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
80 (w32_major_version, w32_minor_version, w32_build_number)
81 (os_subtype, sound_type): Define here
82 (w32_defined_color): Make color parameter const for consistency
83 with other _defined_color functions.
84 (w32_createwindow): Unconditionally call w32_init_class instead of
85 doing so only when hprevinst is non-NULL. Plumbing hprevinst
86 through the code is complex and unnecessary because class
87 registration is practically free.
88 (w32_name_of_message): New EMACSDEBUG-only function.
89 (Fset_message_beep): Move here
90 (Fx_open_connection): Require that the display name for Windows be
91 "w32" for consistency, emacsclient disambiguation, and maybe, one
92 day, multi-window-system support.
93 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
94 Cygwin files for W32 GUI facilities, since these clearly don't
95 expect Cygwin names.
96 (_DebPrint): Define.
97 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
98 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
99 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
100 (w32_last_error): Remove.
101
102 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
103
104 * w32heap.c (syspage_mask): Declare here.
105 (cache_system_info): Remove.
106
107 * w32inevt.c (faked_key): Define globally, not statically.
108 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
109 (w32_console_toggle_lock_key): Move to w32fns.c.
110
111 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
112
113 * w32proc.c (_DebPrint): Move to w32fns.c.
114 * w32select.c: Include string.h, stdio.h for Cygwin.
115 * w32select.h: New File.
116
117 * w32term.c: Include io.h for non-CYGWIN builds; needed for
118 get_osfhandle.
119 (w32_message_fd): New variable. Under Cygwin, holds the file
120 descriptor the system used to tell us about pending thread
121 messages.
122
123 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
124 that prevented compilation under non-WINDOWSNT systems.
125
126 (w32_initialize): Open /dev/windows and assign it to
127 w32_message_fd. Provide w32 feature.
128
129 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
130 (WM_EMACS_INPUT_READY): add.
131 (prepend_msg, w32_message_fd): Declare globally.
132
133 * w32xfns.c:
134 (keyboard_handle): Use only when WINDOWSNT.
135 (notify_msg_ready): New function. Posts a message to the main
136 thread's message queue under CYGWIN, which wakes up the main
137 thread from select(2) by making the /dev/windows file descriptor
138 ready. Under WINDOWSNT, it sets an event the same way the old
139 code did.
140
141 (post, prepend_msg): Actually call notify_msg_ready instead of
142 setting the input event directly.
143
98daa893
EZ
1442012-10-07 Eli Zaretskii <eliz@gnu.org>
145
146 * ralloc.c (relinquish): If a heap is ready to be relinquished,
147 but it still has blocs in it, don't return it to the system,
148 instead of aborting. (Bug#12402)
149
3bc0a2f7
JD
1502012-10-07 Jan Djärv <jan.h.d@swipnet.se>
151
8ad5b73b 152 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 153
335f5ae4
JD
154 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
155 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
156 (syms_of_nsterm): Remove comment about Panther and above for
157 ns-antialias-text.
335f5ae4
JD
158 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
159 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
160 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
161
162 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
163 MAC_OS_X_VERSION_10_4.
164
8ad5b73b
JD
165 * nsmenu.m (fillWithWidgetValue:): Remove code for <
166 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
167
168 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
169
170 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
171 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
172
3bc0a2f7
JD
173 * nsterm.m (ns_in_resize): Remove (Bug#12479).
174 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8ad5b73b
JD
175 (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove
176 ns_in_resize check.
3bc0a2f7
JD
177 (ns_clear_frame_area): Remove resize handle code.
178
179 * nsfns.m (ns_in_resize): Remove.
8ad5b73b
JD
180 (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
181 ns_in_resize check.
3bc0a2f7 182
c622b48f
PE
1832012-10-07 Paul Eggert <eggert@cs.ucla.edu>
184
185 Improve sys_siglist detection.
186 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
187 defined as a macro, as is done in Solaris.
188 (sys_siglist_entries): New macro.
189 (save_strsignal): Use it.
190 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
191 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
192
04fafa46
JD
1932012-10-06 Jan Djärv <jan.h.d@swipnet.se>
194
195 * nsfns.m (Fx_create_frame): Call x_default_parameter with
196 fullscreen/Fullscreen.
197
198 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
199 tobar_height is new.
200
201 * nsterm.m (x_make_frame_visible): Check for fullscreen.
202 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
203 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
204 (windowDidResize:): Check for correct window if old style fullscreen.
205 Capitalize word in comment. Remove incorrect comment.
206 (initFrameFromEmacs:): tbar_height renamed tibar_height.
207 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
208 error in drawing background.
209 (toggleFullScreen:): Remove comment. Rearrange calls.
210 Set toolbar values to zero, save old height in tobar_height.
211 Restore tool bar height when leaving fullscreen.
212 (canBecomeMainWindow): New function.
213
c6e21c03
PE
2142012-10-06 Paul Eggert <eggert@cs.ucla.edu>
215
216 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
217
0d9f584b
EZ
2182012-10-05 Eli Zaretskii <eliz@gnu.org>
219
a65fbb5f
EZ
220 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
221
0d9f584b
EZ
222 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
223 that time stamps of directories could also be changed. Don't
224 request the too broad GENERIC_WRITE, only the more restrictive
225 FILE_WRITE_ATTRIBUTES access rights.
226
227 * fileio.c (Fset_file_times): Special-case ignoring errors for
228 directories only on MSDOS, not on MS-Windows.
229
e8757f09 2302012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
231
232 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
233
7604f298
EZ
2342012-10-04 Eli Zaretskii <eliz@gnu.org>
235
236 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
237 see whether CreateFile failed.
238
88d69b7d
PE
2392012-10-04 Paul Eggert <eggert@cs.ucla.edu>
240
241 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
242 to avoid similar races.
243 * keyboard.c (pending_signals): Now bool, not int.
244
7509f454
PE
245 Port timers to OpenBSD, plus check for timer failures.
246 OpenBSD problem reported by Han Boetes.
247 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
248 and/or setitimer.
249 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
250 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
251 like OpenBSD, which has timer_settime but does not declare it.
252 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
253 whether to use itimerspec-related primitives. All uses of
254 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
255
a3c5c0c5
PE
2562012-10-02 Paul Eggert <eggert@cs.ucla.edu>
257
258 * profiler.c (handle_profiler_signal): Fix a malloc race
259 that caused Emacs to hang on Fedora 17 when profiling Lisp.
260
914e743b
JD
2612012-10-02 Jan Djärv <jan.h.d@swipnet.se>
262
263 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
264
d8ab37a8
EZ
2652012-10-02 Eli Zaretskii <eliz@gnu.org>
266
267 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
268 consistent with the change in return value of 'safe_strsignal'.
269
b3ecad33
PE
2702012-10-02 Paul Eggert <eggert@cs.ucla.edu>
271
0a99eee1
PE
272 Prefer plain 'static' to 'static inline' (Bug#12541).
273 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
274 (bidi_set_sor_type, bidi_push_embedding_level)
275 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
276 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
277 (bidi_cache_search, bidi_cache_ensure_space)
278 (bidi_cache_iterator_state, bidi_cache_find)
279 (bidi_peek_at_next_level, bidi_set_paragraph_end)
280 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
281 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
282 Now 'static', not 'static inline'.
283
b3ecad33
PE
284 Count overruns when profiling; change units to ns.
285 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
286 Give extra weight to samples after overruns, to attempt to count
287 the time more accurately.
288 (setup_cpu_timer): Change sampling interval units from ms to ns, since
289 the underlying primitives nominally do ns.
290 (Fprofiler_cpu_start): Document the change. Mention that
291 the sampling intervals are only approximate.
292
090cf9db
SM
2932012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
294
295 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
296
297 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
298 case for the special 0 coding-system.
299
300 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
301 (Fmake_overlay): Remove redundant tests.
64edc777 302 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 303
81550bf4
JB
3042012-10-02 Juanma Barranquero <lekktu@gmail.com>
305
306 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
307 Update dependencies.
308
aa1ba90e
PE
3092012-10-01 Paul Eggert <eggert@cs.ucla.edu>
310
311 Fix a malloc race condition involving strsignal.
312 A signal can arrive in the middle of a malloc, and Emacs's signal
313 handler can invoke strsignal, which can invoke malloc, which is
314 not portable. This race condition bug makes Emacs hang on GNU/Linux.
315 Fix it by altering the signal handler so that it does not invoke
316 strsignal.
317 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
318 * process.c (status_message): Use const pointer, in case strsignal
319 is #defined to safe_strsignal.
320 * sysdep.c (sys_siglist, init_signals): Always define and
321 initialize a substitute sys_siglist if the system does not define
322 one, even if HAVE_STRSIGNAL.
323 (safe_strsignal): Rename from strsignal. Always define,
324 using sys_siglist. Return a const pointer.
325 * syssignal.h (safe_strsignal): New decl.
326 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
327
ace917bd
EZ
3282012-10-01 Eli Zaretskii <eliz@gnu.org>
329
330 * w32proc.c (timer_loop): Fix code that waits for timer
331 expiration, to avoid high CPU usage.
332
9eb71b9c
SM
3332012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
334
335 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
336 (sweep_weak_table): Remove redundant prototypes.
337
b3317662
FP
3382012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
339
340 * emacs.c: Move the inclusion of TERM_HEADER after including
341 windows.h on WINDOWSNT. This avoids compilation problems with
342 MSVC.
343
f0e5f225
EZ
3442012-10-01 Eli Zaretskii <eliz@gnu.org>
345
2d7d1608
EZ
346 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
347 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
348 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
349 as the previous version used 'void *'.
350
351 * ralloc.c (ROUNDUP): Fix last change.
352 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
353 'size_t'.
354
f0e5f225
EZ
355 * w32proc.c <disable_itimers>: New static flag.
356 (init_timers): Initialize it to zero, after creating the critical
357 sections used by the timer threads.
358 (term_timers): Set to 1 before deleting the critical sections.
359 (getitimer, setitimer): If disable_itimers is non-zero, return an
360 error indication without doing anything. Reported by Fabrice
361 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
362 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
363 return results.
364 [!HAVE_SETITIMER]: Behave as the previous version that didn't
365 support timers.
f0e5f225
EZ
366
367 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
368 term_ntproc after all the other bookkeeping, to get timers working
369 as long as possible.
370
82ef37c1
PE
3712012-10-01 Paul Eggert <eggert@cs.ucla.edu>
372
b3a4c387
PE
373 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
374 Suggested by Juri Linkov in
375 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
376
b0ab8123
PE
377 Prefer plain 'static' to 'static inline' (Bug#12541).
378 With static functions, modern compilers inline pretty well by
379 themselves; advice from programmers often hurts as much as it helps.
380 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
381 this change shrinks the text size of the Emacs executable by 1.1%
382 without affecting CPU significantly in my benchmark.
383 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
384 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
385 (mark_maybe_object, mark_maybe_pointer, bounded_number):
386 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
387 (bset_auto_fill_function, bset_auto_save_file_format)
388 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
389 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
390 (bset_cache_long_line_scans, bset_case_fold_search)
391 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
392 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
393 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
394 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
395 (bset_header_line_format, bset_indicate_buffer_boundaries)
396 (bset_indicate_empty_lines, bset_invisibility_spec)
397 (bset_left_fringe_width, bset_major_mode, bset_mark)
398 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
399 (bset_name, bset_overwrite_mode, bset_pt_marker)
400 (bset_right_fringe_width, bset_save_length)
401 (bset_scroll_bar_width, bset_scroll_down_aggressively)
402 (bset_scroll_up_aggressively, bset_selective_display)
403 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
404 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
405 (set_buffer_overlays_after):
406 * category.c (bset_category_table):
407 * charset.c (read_hex):
408 * coding.c (produce_composition, produce_charset)
409 (handle_composition_annotation, handle_charset_annotation)
410 (char_encodable_p):
411 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
412 (assign_row, set_frame_matrix_frame, make_current)
413 (add_row_entry):
414 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
415 * fns.c (maybe_resize_hash_table):
416 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
417 * gmalloc.c (register_heapinfo):
418 * image.c (lookup_image_type):
419 * intervals.c (set_interval_object, set_interval_left)
420 (set_interval_right, copy_interval_parent, rotate_right)
421 (rotate_left, balance_possible_root_interval):
422 * keyboard.c (kset_echo_string, kset_kbd_queue)
423 (kset_keyboard_translate_table, kset_last_prefix_arg)
424 (kset_last_repeatable_command, kset_local_function_key_map)
425 (kset_overriding_terminal_local_map, kset_real_last_command)
426 (kset_system_key_syms, clear_event, set_prop):
427 * lread.c (digit_to_number):
428 * marker.c (attach_marker, live_buffer, set_marker_internal):
429 * nsterm.m (ns_compute_glyph_string_overhangs):
430 * process.c (pset_buffer, pset_command)
431 (pset_decode_coding_system, pset_decoding_buf)
432 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
433 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
434 (pset_status, pset_tty_name, pset_type, pset_write_queue):
435 * syntax.c (bset_syntax_table, dec_bytepos):
436 * terminal.c (tset_param_alist):
437 * textprop.c (interval_has_some_properties)
438 (interval_has_some_properties_list):
439 * window.c (wset_combination_limit, wset_dedicated)
440 (wset_display_table, wset_hchild, wset_left_fringe_width)
441 (wset_left_margin_cols, wset_new_normal, wset_new_total)
442 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
443 (wset_right_fringe_width, wset_right_margin_cols)
444 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
445 (wset_vertical_scroll_bar_type, wset_window_parameters):
446 * xdisp.c (wset_base_line_number, wset_base_line_pos)
447 (wset_column_number_displayed, wset_region_showing)
448 (window_box_edges, run_window_scroll_functions)
449 (append_glyph_string_lists, prepend_glyph_string_lists)
450 (append_glyph_string, set_glyph_string_background_width)
451 (append_glyph, append_composite_glyph)
452 (take_vertical_position_into_account):
453 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
454 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
455 (lface_hash, lface_same_font_attributes_p, lookup_face):
456 * xml.c (libxml2_loaded_p):
457 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
458 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
459 Now 'static', not 'static inline'.
460
05584c31
PE
461 * bidi.c: Tune.
462 (bidi_copy_it): Do the whole copy with a single memcpy.
463 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
464
86ec63ba
PE
465 Revert the FOLLOW-SYMLINKS change for file-attributes.
466 Doing it right would require several changes to Tramp, and there's
467 not enough time to get that tested before the freeze today.
468 * dired.c (directory_files_internal, Ffile_attributes):
469 Undo last change.
470
82ef37c1
PE
471 * frame.c (x_report_frame_params): Port better to wider ints.
472 Do not assume that EMACS_UINT is the same width as uprintmax_t,
473 or that pointers can be printed in 15 decimal digits.
474 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
475
62aba0d4
FP
4762012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
477
478 Support x64 build on MS-Windows.
479 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
480 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
481 compatibility with x64.
5e4daaf3 482 (x_get_focus_frame): Add prototype.
62aba0d4
FP
483
484 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
485 defining an XRectangle structure.
486
487 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
488 arithmetics for compatibility with x64.
489
490 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
491 compatibility with x64.
492
493 * w32heap.h: Adjust prototypes and declarations.
494
495 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
496 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
497 DWORD, long, and unsigned long, for compatibility with x64.
498 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
499 (sbrk): Argument is now of type ptrdiff_t.
500
501 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
502 less than 0x0500.
503 (w32_msg_pump): Use WPARAM type for 'result'.
504
505 * w32.c (init_environment, get_emacs_configuration): Support AMD64
506 architecture.
507 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
508 compatibility with x64.
509
510 * vm-limit.c (lim_data): Now size_t.
511 (check_memory_limits): Adjust prototypes of real_morecore and
512 __morecore to receive argument of type ptrdiff_t. Use size_t for
513 five_percent and data_size.
514
515 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
516 variables, for compatibility with x64.
517 (rva_to_section, offset_to_section, relocate_offset)
518 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
519 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
520 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
521 for compatibility with x64.
522
523 * sysdep.c (STDERR_FILENO): Define if not already defined.
524
525 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
526 (__morecore): Argument type is now ptrdiff_t.
527 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
528 (relinquish): Use ptrdiff_t type for 'excess'.
529 (r_alloc_sbrk): Argument type is now ptrdiff_t.
530
531 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
532 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
533 instead of a literal number.
534
535 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
536 (min): Define only if not already defined.
537
538 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
539 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
540 hosts.
541
542 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
543 'bitmaps' is a pointer.
544
545 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
546
547 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
548
e7a2937b
PE
5492012-09-30 Paul Eggert <eggert@cs.ucla.edu>
550
551 file-attributes has a new optional arg FOLLOW-SYMLINKS.
552 * dired.c (directory_files_internal, Ffile_attributes):
553 New arg follow_symlinks. All uses changed.
554
b43d62ae
SM
5552012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
556
557 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
558
c06c382a
EZ
5592012-09-30 Eli Zaretskii <eliz@gnu.org>
560
561 Support atimers and CPU profiler via profile.c on MS-Windows.
562 * w32proc.c (sig_mask, crit_sig): New static variables.
563 (sys_signal): Support SIGALRM and SIGPROF.
564 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 565 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
566 sigfillset, and sigprocmask are no longer no-ops.
567 (sigismember): New function.
568 (struct itimer_data): New definition.
569 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
570 (crit_prof): New static variables.
571 (MAX_SINGLE_SLEEP): New definition.
572 (timer_loop, stop_timer_thread, term_timers, init_timers)
573 (start_timer_thread, getitimer, setitimer): New functions.
574 (alarm): No longer a no-op, calls setitimer.
575
576 * w32.c (term_ntproc): Call term_timers.
577 (init_ntproc): Make sure all signals are unblocked at startup, to
578 erase any traces of dumping. Call init_timers.
579
580 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
581 Windows-specific code to display the hourglass mouse pointer is no
582 longer used.
583 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
584 to hourglass timer expiration.
585 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
586 Remove, no longer used.
b43d62ae
SM
587 (w32_note_current_window, show_hourglass, hide_hourglass):
588 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
589 window systems.
590 (syms_of_w32fns): Don't initialize hourglass_timer.
591
592 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
593 WINDOWSNT as well.
594 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
595
596 * w32.h (init_timers, term_timers): Add prototypes.
597
95402d5f
KH
5982012-09-30 Kenichi Handa <handa@gnu.org>
599
600 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
601 to the buffer relocation which may be caused by ccl_driver.
602
dd946752
JD
6032012-09-30 Jan Djärv <jan.h.d@swipnet.se>
604
d7e642cc
JD
605 * xfns.c (Fx_file_dialog): Update comment.
606
607 * w32fns.c (Fx_file_dialog): Update comment.
608
609 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
610 Initialize panel name field if OSX >= 10.6.
611
612 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
613
dd946752
JD
614 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
615
616 * nsterm.m (NEW_STYLE_FS): New define.
617 (ns_fullscreen_hook, windowWillEnterFullScreen)
618 (windowDidEnterFullScreen, windowWillExitFullScreen)
619 (windowDidExitFullScreen, toggleFullScreen, handleFS)
620 (setFSValue): New functions.
621 (EmacsFSWindow): New implementation.
622 (canBecomeKeyWindow): New function for EmacsFSWindow.
623 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
624 (dealloc): Release nonfs_window if in fullscreen.
625 (updateFrameSize:): Call windowDidMove to update top/left.
626 (windowWillResize:toSize:): Check if frame is still maximized.
627 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
628 next_maximized, maximized_width, maximized_height and nonfs_window.
629 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
630 tbar_height.
631 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
632 fullscreen. Set maximized_width/height. Act on next_maximized.
633
634 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
635 (EmacsView): Add variables for fullscreen.
636 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
637 (EmacsFSWindow): New interface for fullscreen.
638
427730eb
JB
6392012-09-30 Juanma Barranquero <lekktu@gmail.com>
640
641 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
642
48de8b12
CY
6432012-09-30 Chong Yidong <cyd@gnu.org>
644
645 * fns.c (Frandom): Doc fix.
646
5938d519
MR
6472012-09-30 Martin Rudalics <rudalics@gmx.at>
648
649 * window.c (Vwindow_combination_limit): New default value.
650 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
651
cb5b0266
PE
6522012-09-30 Paul Eggert <eggert@cs.ucla.edu>
653
654 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
655 Suggested by Eli Zaretskii in
656 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
657
84f72efd
EZ
6582012-09-30 Eli Zaretskii <eliz@gnu.org>
659
660 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
661 HAVE_TIMER_SETTIME is defined.
662
9d4dcdc9
PE
6632012-09-30 Paul Eggert <eggert@cs.ucla.edu>
664
d89460ed
PE
665 Profiler improvements: more-accurate timers, overflow checks.
666 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
667 signal.h, setjmp.h. Include systime.h instead.
668 (saturated_add): New function.
669 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
670 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
671 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
672 New static vars.
84f72efd 673 (enum profiler_cpu_running): New enum.
d89460ed
PE
674 (profiler_cpu_running): Now of that enum type, not bool.
675 All uses changed to store the new value.
676 (handle_profiler_signal): Rename from sigprof_handler_1,
677 for consistency with other handlers. Do not check whether
678 cpu_log is a hash-table if garbage collecting, since it
679 doesn't matter in that case.
680 (deliver_profiler_signal): Rename from sigprof_handler,
681 for consistency with other handlers.
682 (setup_cpu_timer): New function, with much of what used to be in
683 Fprofiler_cpu_start. Check for out-of-range argument.
684 Prefer timer_settime if available, and prefer
685 thread cputime clocks, then process cputime clocks, then
686 monotonic clocks, to the old realtime clock. Use make_timeval
687 to round more-correctly when falling back to setitimer.
688 (Fprofiler_cpu_start): Use it.
689 (Fprofiler_cpu_stop): Prefer timer_settime if available.
690 Don't assume that passing NULL as the 2nd argument of setitimer
691 is the same as passing a pointer to all-zero storage.
692 Ignore SIGPROF afterwards.
693 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
694 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
695 non-fatal signal handlers. Ignore SIGPROF on startup.
696 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
697 in profiler.c, since sysdep.c now uses it.
698
9d4dcdc9
PE
699 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
700 Suggested by Eli Zaretskii in
701 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
702
8e5691a0
JB
7032012-09-29 Juanma Barranquero <lekktu@gmail.com>
704
705 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
706
e7c1b6ef
SM
7072012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
708
709 * lisp.h (struct backtrace): Remove indirection for `function' field.
710 * xdisp.c (redisplay_internal):
711 * profiler.c (record_backtrace, sigprof_handler_1):
712 * alloc.c (Fgarbage_collect):
713 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
714 (Fbacktrace_frame): Adjust accordingly.
715
e61d39cd 7162012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
717
718 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
719 (Frun_hook_with_args_until_failure): Doc fixes.
720
404043ea
EZ
7212012-09-28 Eli Zaretskii <eliz@gnu.org>
722
723 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
724 Qautomatic_redisplay and change the symbol name. All users changed.
725
704d3f45
TM
7262012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
727
728 * profiler.c (sigprof_handler): Fix race condition.
729
757140ff
GM
7302012-09-28 Glenn Morris <rgm@gnu.org>
731
732 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
733
a615a3ae
PE
7342012-09-27 Paul Eggert <eggert@cs.ucla.edu>
735
736 Check more robustly for timer_settime.
89d17fd0
PE
737 * Makefile.in (LIB_TIMER_TIME): New macro.
738 (LIBES): Add it.
a615a3ae
PE
739 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
740 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
741 call timer_settime.
742
3670daf7
TM
7432012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
744
745 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
746
6a586b7f
JB
7472012-09-26 Juanma Barranquero <lekktu@gmail.com>
748
749 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
750
41c8bfcf
PE
7512012-09-26 Paul Eggert <eggert@cs.ucla.edu>
752
753 * character.h (MAYBE_UNIFY_CHAR): Remove.
754 * charset.c, charset.h (maybe_unify_char): Now static.
755 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
756 Since this stuff is now private to charset.c, there's no need for
757 a public macro and no need to inline by hand.
758
3a880af4
SM
7592012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
760 Stefan Monnier <monnier@iro.umontreal.ca>
761 Juanma Barranquero <lekktu@gmail.com>
611b7507 762
3a880af4
SM
763 * profiler.c: New file.
764 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
765 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
766 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
767 * emacs.c (main): Call syms_of_profiler.
768 * alloc.c (Qautomatic_gc): New constant.
769 (MALLOC_PROBE): New macro.
770 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
771 (total_bytes_of_live_objects): New function.
772 (Fgarbage_collect): Use it. Record itself in backtrace_list.
773 Call malloc_probe for the memory profiler.
774 (syms_of_alloc): Define Qautomatic_gc.
775 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
776 race condition.
777 (struct backtrace): Move definition...
778 * lisp.h (struct backtrace): ..here.
779 (Qautomatic_gc, profiler_memory_running): Declare vars.
780 (malloc_probe, syms_of_profiler): Declare functions.
781 * xdisp.c (Qautomatic_redisplay): New constant.
782 (redisplay_internal): Record itself in backtrace_list.
783 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 784
5938d519 7852012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
7862012-09-25 Juanma Barranquero <lekktu@gmail.com>
787
788 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
789
e26fd2e4
PE
7902012-09-25 Paul Eggert <eggert@cs.ucla.edu>
791
792 Prefer POSIX timers if available.
793 They avoid a race if the timer is too close to the current time.
794 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
795 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 796 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 797
eedec3ee
EZ
7982012-09-25 Eli Zaretskii <eliz@gnu.org>
799
800 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
801 CHAR_STRING_ADVANCE.
802 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
803 STRING_CHAR_ADVANCE.
804
aa15c6bb
JB
8052012-09-25 Juanma Barranquero <lekktu@gmail.com>
806
807 Move Vlibrary_cache to emacs.c and reset before dumping.
808
809 * lisp.h (reset_image_types): Declare.
810 [WINDOWSNT] (Vlibrary_cache): Declare.
811
812 * image.c (reset_image_types): New function.
813
814 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
815 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
816 (Fdump_emacs): Reset Vlibrary_cache and image_types.
817
818 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
819 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
820
821 * w32.h (Vlibrary_cache): Do not declare.
822
54d629be
EZ
8232012-09-25 Eli Zaretskii <eliz@gnu.org>
824
16b22fef
EZ
825 * w32proc.c (sys_signal): Handle all signals defined by the
826 MS-Windows runtime, not just SIGCHLD. Actually install the signal
827 handlers for signals supported by Windows. Don't override
828 term_ntproc as the handler for SIGABRT.
829 (sigaction): Rewrite to call sys_signal instead of duplicating its
830 code.
831 (sys_kill): Improve commentary.
832
833 * w32.c (term_ntproc): Accept (and ignore) one argument, for
834 consistency with a signature of a signal handler. All callers
835 changed.
836 (init_ntproc): Accept an argument DUMPING. If dumping, don't
837 install term_ntproc as a signal handler for SIGABRT, as that
838 should be done by the dumped Emacs.
839
840 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
841
842 * w32select.c (term_w32select): Protect against repeated
843 invocation by setting clipboard_owner to NULL after calling
844 DestroyWindow.
845
846 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
847 and term_ntproc to their modified signatures.
848
54d629be
EZ
849 * character.c (char_string, string_char): Remove calls to
850 MAYBE_UNIFY_CHAR. See the discussion starting at
851 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
852 for the details.
853
59f7af81
CY
8542012-09-25 Chong Yidong <cyd@gnu.org>
855
856 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
857
22e8cf4a
SM
8582012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
859
860 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
861 when encountering an unknown bytecode.
862
578098f3
PE
8632012-09-24 Paul Eggert <eggert@cs.ucla.edu>
864
865 image.c, indent.c: Use bool for booleans.
866 * dispextern.h (struct image_type): Members valid_p, load, init
867 now return bool, not int. All uses changed.
868 * image.c: Omit unnecessary static decls.
869 (x_create_bitmap_mask, x_build_heuristic_mask):
870 Return void, not int, since callers don't care about the return value.
871 (x_create_bitmap_mask, define_image_type, valid_image_p)
872 (struct image_keyword, parse_image_spec, image_spec_value)
873 (check_image_size, image_background)
874 (image_background_transparent, x_clear_image_1)
875 (postprocess_image, lookup_image, x_check_image_size)
876 (x_create_x_image_and_pixmap, xbm_image_p)
877 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
878 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
879 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
880 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
881 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
882 (png_image_p, init_png_functions, png_load_body, png_load)
883 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
884 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
885 (init_gif_functions, gif_load, imagemagick_image_p)
886 (imagemagick_load_image, imagemagick_load, svg_image_p)
887 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
888 (gs_load):
889 * nsimage.m (ns_load_image):
890 * nsterm.m (ns_defined_color):
891 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
892 * xfns.c (x_defined_color):
893 * xterm.c (x_alloc_lighter_color_for_widget)
894 (x_alloc_nearest_color_1, x_alloc_nearest_color)
895 (x_alloc_lighter_color):
896 * indent.c (disptab_matches_widthtab, current_column)
897 (scan_for_column, string_display_width, indented_beyond_p)
898 (compute_motion, vmotion, Fvertical_motion):
899 Use bool for booleans.
900
a5f2b6ec
CY
9012012-09-24 Chong Yidong <cyd@gnu.org>
902
903 * chartab.c (Fset_char_table_default): Obsolete function removed.
904
18e27ea8
PE
9052012-09-23 Paul Eggert <eggert@cs.ucla.edu>
906
afea8a8a
PE
907 Move pid_t related decls out of lisp.h.
908 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
909 (interruptible_wait_for_termination):
910 Move these decls from lisp.h to syswait.h, since they use pid_t.
911 Needed on FreeBSD; see Herbert J. Skuhra in
912 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
913 * callproc.c: Include syswait.h.
914
18e27ea8
PE
915 gnutls.c, gtkutil.c: Use bool for boolean.
916 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
917 (emacs_gnutls_handle_error):
918 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
919 (xg_hide_tooltip, xg_create_frame_widgets)
920 (create_dialog, xg_uses_old_file_dialog)
921 (xg_get_file_with_chooser, xg_get_file_with_selection)
922 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
923 (xg_item_label_same_p, xg_update_menubar)
924 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
925 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
926 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
927 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
928 (update_frame_tool_bar, free_frame_tool_bar):
929 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
930 * nsmenu.m (ns_update_menubar):
931 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
932 * xfns.c (Fx_show_tip) [USE_GTK]:
933 Use bool for boolean.
934 * gtkutil.c (xg_update_frame_menubar):
935 * xmenu.c (update_frame_menubar):
936 Return void, not int, since caller ignores return value.
937 * gtkutil.c (xg_change_toolbar_position):
938 Return void, not 1.
939
af0e9f75
JB
9402012-09-23 Juanma Barranquero <lekktu@gmail.com>
941
942 * makefile.w32-in (BLOCKINPUT_H): Remove.
943 (SYSSIGNAL_H): New macro.
944 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
945 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
946 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
947 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
948 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
949 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
950 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
951 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
952 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
953 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
954 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
955 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
956 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
957 ($(BLD)/w32xfns.$(O)): Update dependencies.
958
5101529e
EZ
9592012-09-23 Eli Zaretskii <eliz@gnu.org>
960
961 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
962 fatal_error_backtrace.
963
964 * w32proc.c (sys_kill): Undo last change: don't do anything when
965 invoked to deliver SIGABRT to our own process. This is now
966 handled by emacs_raise.
967
2c3ee0ad
JB
9682012-09-23 Juanma Barranquero <lekktu@gmail.com>
969
970 * w32term.c (w32_read_socket): Remove leftover reference to
971 interrupt_input_pending.
972
62a1d661
PE
9732012-09-23 Paul Eggert <eggert@cs.ucla.edu>
974
975 Do not use SA_NODEFER.
976 Problem reported by Dani Moncayo in
977 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
978 * alloc.c (die):
979 * sysdep.c (emacs_abort): Do not reset signal handler.
980 * emacs.c (terminate_due_to_signal): Reset signal handler here.
981 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
982 wanted even on POSIXish hosts, and it doesn't work on Windows.
983
a0942b9a
JD
9842012-09-23 Jan Djärv <jan.h.d@swipnet.se>
985
986 * xterm.c (x_term_init): Call fixup_locale before and after calling
987 gtk_init (Bug#12392).
988
d07ff9db
CY
9892012-09-23 Chong Yidong <cyd@gnu.org>
990
991 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
992 Vdynamic_library_alist.
993
994 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
995 (Fgnutls_available_p): Caller changed.
996
997 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
998 (Flibxml_parse_xml_region): Likewise.
999
1000 * dispextern.h (struct image_type): Remove arg from init function.
1001
1002 * image.c (Finit_image_library, lookup_image_type)
1003 (define_image_type): Remove now-unneeded second arg.
1004 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1005 (init_tiff_functions, init_gif_functions, init_svg_functions):
1006 Arglist and w32_delayed_load calling convention changed.
1007 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 1008 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 1009
4d7e6e51
PE
10102012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1011
1012 Simplify and avoid signal-handling races (Bug#12471).
1013 * alloc.c (die):
1014 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1015 Avoid recursive loop if there's a fatal error in the function itself.
1016 * atimer.c (pending_atimers):
1017 * blockinput.h: Don't include "atimer.h"; no longer needed.
1018 (interrupt_input_pending): Remove. All uses removed.
1019 pending_signals now counts both atimers and ordinary interrupts.
1020 This is less racy than having three separate pending-signal flags.
1021 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1022 (input_blocked_p):
1023 Rename from their upper-case counterparts BLOCK_INPUT,
1024 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1025 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1026 This makes it easier to access volatile variables more accurately.
1027 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1028 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1029 that's more reliable if the code is buggy and sets
1030 interrupt_input_blocked to a negative value. All uses changed.
1031 * atimer.c (deliver_alarm_signal):
1032 Remove. No need to deliver this to the parent; any thread can
1033 handle this signal now. All uses replaced by underlying handler.
1034 * atimer.c (turn_on_atimers):
1035 * dispnew.c (handle_window_change_signal):
1036 * emacs.c (handle_danger_signal):
1037 * keyboard.c (kbd_buffer_get_event):
1038 Don't reestablish signal handler; not needed with sigaction.
1039 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1040 (UNBLOCK_INPUT_TO):
1041 Rework to avoid unnecessary accesses to volatile variables.
1042 (UNBLOCK_INPUT_TO): Now a function.
1043 (totally_unblock_input, unblock_input): New decls.
1044 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1045 (init_data): Remove. Necessary stuff now done in init_signal.
1046 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1047 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1048 (fatal_error_code): Remove; no longer needed.
1049 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1050 it doesn't always backtrace. All uses changed. No need to reset
1051 signal to default, since sigaction and/or die does that for us now.
1052 Use emacs_raise (FOO), not kill (getpid (), FOO).
1053 (main): Check more-accurately whether we're dumping.
1054 Move fatal-error setup to sysdep.c
1055 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1056 * gtkutil.c (xg_get_file_name, xg_get_font):
1057 Remove no-longer-needed signal-mask manipulation.
1058 * keyboard.c, process.c (POLL_FOR_INPUT):
1059 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1060 * keyboard.c (read_avail_input): Remove.
1061 All uses replaced by gobble_input.
1062 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1063 (kbd_buffer_store_event_hold, gobble_input):
1064 (record_asynch_buffer_change) [USABLE_SIGIO]:
1065 (store_user_signal_events):
1066 No need to mess with signal mask.
1067 (gobble_input): If blocking input and there are terminals, simply
1068 set pending_signals to 1 and return. All hooks changed to not
1069 worry about whether input is blocked.
1070 (process_pending_signals): Clear pending_signals before processing
1071 them, in case a signal comes in while we're processing.
1072 By convention callers now test pending_signals before calling us.
1073 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1074 New functions, to support changes to blockinput.h.
1075 (handle_input_available_signal): Now extern.
1076 (reinvoke_input_signal): Remove. All uses replaced by
1077 handle_async_input.
1078 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
1079 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1080 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
1081 Clear sigmask reliably, even if Fsignal returns, which it can.
1082 Omit unnecessary accesses to volatile var.
1083 (quit_throw_to_read_char): No need to restore sigmask.
1084 * keyboard.c (gobble_input, handle_user_signal):
1085 * process.c (wait_reading_process_output):
1086 Call signal-handling code rather than killing ourselves.
1087 * lisp.h: Include <float.h>, for...
1088 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1089 (pending_signals): Now volatile.
1090 (syms_of_data): Now const if IEEE floating point.
1091 (handle_input_available_signal) [USABLE_SIGIO]:
1092 (terminate_due_to_signal, record_child_status_change): New decls.
1093 * process.c (create_process): Avoid disaster if memory is exhausted
1094 while we're processing a vfork, by tightening the critical section
1095 around the vfork.
1096 (send_process_frame, process_sent_to, handle_pipe_signal)
1097 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1098 ignores SIGPIPE.
1099 (send_process): No need for setjmp/longjmp any more, since the
1100 SIGPIPE stuff is now gone. Instead, report an error if errno
1101 is EPIPE.
1102 (record_child_status_change): Now extern. PID and W are now args.
1103 Return void, not bool. All callers changed.
1104 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1105 Remove. All uses removed. This bug should be fixed now in a
1106 different way.
1107 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1108 and record the child status change directly. This avoids the
1109 need to futz with the signal mask.
1110 (process_fatal_action): Move here from emacs.c.
1111 (emacs_sigaction_flags): New function, containing
1112 much of what used to be in emacs_sigaction_init.
1113 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1114 caught by emacs, to make races less likely.
1115 (deliver_process_signal): Rename from handle_on_main_thread.
1116 All uses changed.
1117 (BACKTRACE_LIMIT_MAX): Now at top level.
1118 (thread_backtrace_buffer, threadback_backtrace_pointers):
1119 New static vars.
1120 (deliver_thread_signal, deliver_fatal_thread_signal):
1121 New functions, for more-accurate delivery of thread-specific signals.
1122 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1123 (deliver_arith_signal): Handle in this thread, not
1124 in the main thread, since it's triggered by this thread.
1125 (maybe_fatal_sig): New function.
1126 (init_signals): New arg DUMPING so that we can be more accurate
1127 about whether we're dumping. Caller changed.
1128 Treat thread-specific signals differently from process-general signals.
1129 Block all signals while handling fatal error; that's safer.
1130 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1131 on IEEE hosts.
1132 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1133 Ignore SIGPIPE unless batch.
1134 (emacs_backtrace): Output backtrace for the appropriate thread,
1135 which is not necessarily the main thread.
1136 * syssignal.h: Include <stdbool.h>.
1137 (emacs_raise): New macro.
1138 * xterm.c (x_connection_signal): Remove; no longer needed
1139 now that we use sigaction.
1140 (x_connection_closed): No need to mess with sigmask now.
1141 (x_initialize): No need to reset SIGPIPE handler here, since
1142 init_signals does this for us now.
1143
8f4635e9
JD
11442012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1145
1146 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 1147 background rect may be larger (Bug#12245).
8f4635e9 1148
3296976d
CY
11492012-09-23 Chong Yidong <cyd@gnu.org>
1150
1151 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1152
d41e491e
PE
11532012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1154
1155 * .gdbinit: Just stop at fatal_error_backtrace.
1156 See Stefan Monnier's request in
1157 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1158 Remove no-longer-used query of system type.
1159
c88b867f
CY
11602012-09-22 Chong Yidong <cyd@gnu.org>
1161
1162 * search.c (Freplace_match): Doc fix (Bug#12325).
1163
1164 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1165
1166 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1167 (Fline_end_position): Doc fix.
1168
1169 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1170
bb4d86b4
CY
11712012-09-22 Chong Yidong <cyd@gnu.org>
1172
1173 * dispextern.h (struct image_type): Add new slot, storing a type
1174 initialization function.
1175
1176 * image.c (define_image_type): Call the image initializer function
1177 if it is defined. Arguments and return value changed.
1178 (valid_image_p, make_image): Callers changed.
1179 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
1180 (gif_type, imagemagick_type, svg_type, gs_type):
1181 Add initialization functions.
bb4d86b4
CY
1182 (Finit_image_library): Call lookup_image_type.
1183 (CHECK_LIB_AVAILABLE): Macro deleted.
1184 (lookup_image_type): Call define_image_type here, rather than via
1185 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1186 (syms_of_image): Move define_image_type calls for xbm_type and
1187 pbm_type to lookup_image_type.
1188
df9685f3
EZ
11892012-09-22 Eli Zaretskii <eliz@gnu.org>
1190
1191 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1192 'idle_timers' from here ...
1193 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1194 lists, to avoid infloops when the timer does something stupid,
1195 like reinvoke itself with the same or smaller time-out.
1196 (Bug#12447)
1197
8e17c9ba
MR
11982012-09-22 Martin Rudalics <rudalics@gmx.at>
1199
1200 * window.c (Fsplit_window_internal): Handle only Qt value of
1201 Vwindow_combination_limit separately.
1202 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
1203 (Vwindow_combination_limit): New default value.
1204 Rewrite doc-string.
8e17c9ba 1205
589bd69b
EZ
12062012-09-22 Eli Zaretskii <eliz@gnu.org>
1207
1208 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1209 the new overlay string. (Bug#10159)
1210
01108e3f
PE
12112012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1212
1213 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1214 or that fprintf is async-signal-safe. POSIX doesn't require
1215 either assumption.
1216
82f8cd94
CY
12172012-09-22 Chong Yidong <cyd@gnu.org>
1218
1219 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1220 (Bug#8207).
1221
3cccbd87
KH
12222012-09-22 Kenichi Handa <handa@gnu.org>
1223
1224 * composite.c (composition_reseat_it): Handle the case that a
1225 grapheme cluster is not covered by a single font (Bug#12352).
1226
09c01941
CY
12272012-09-21 Chong Yidong <cyd@gnu.org>
1228
1229 * image.c (define_image_type): Avoid adding duplicate types to
1230 image_types (Bug#12463). Suggested by Jörg Walter.
1231
acfa068f 12322012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
1233
1234 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1235 (print_load_command_name): Add case LC_DATA_IN_CODE.
1236 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1237
acfa068f 12382012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
1239
1240 * eval.c (Frun_hook_with_args_until_success)
1241 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1242
acfa068f 12432012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
1244
1245 * fileio.c (Ffile_selinux_context): Only call freecon when
1246 lgetfilecon succeeded.
1247 (Fset_file_selinux_context): Likewise. (Bug#12444)
1248
acfa068f 12492012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
1250
1251 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1252 reordering, locate the cursor by calling set_cursor_from_row; if
1253 that fails, clear the desired glyph matrix before returning a
1254 failure indication to the caller. Fixes leaving garbled display
1255 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
1256 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1257 scrolling through multibyte text.
aa36e4d2 1258
e99f70c8
SM
12592012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1260
1261 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1262 calling mark_vectorlike since that's the one that marks the window.
1263 (mark_discard_killed_buffers): Mark the final cdr.
1264 * window.h (struct window): Move prev/next_buffers to the
1265 non-standard fields.
1266 * window.c (make_window): Initialize prev/next_buffers manually.
1267
f75beb47
PE
12682012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1269
1270 Omit unused arg EXPECTED from socket hooks.
1271 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1272 * nsterm.m (ns_term_init):
1273 * termhooks.h (struct terminal.read_socket_hook):
1274 * w32inevt.c (w32_console_read_socket):
1275 * w32term.c (w32_read_socket):
1276 * xterm.c (XTread_socket):
1277 Omit unused arg EXPECTED. All callers changed.
1278 (store_user_signal_events): Return void, not int, since callers no
1279 longer care about the return value. All uses changed.
1280
b019b76a
JB
12812012-09-20 Juanma Barranquero <lekktu@gmail.com>
1282
1283 * w32gui.h (XParseGeometry): Do not declare.
1284
05642592
PE
12852012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1286
e4bce92a
PE
1287 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1288 Ignore 'expected'. See Eli Zaretskii in
1289 <http://bugs.gnu.org/12471#8> (last line).
1290
05642592
PE
1291 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1292 (XParseGeometry): Now static. Substitute extremal values for
1293 values that are out of range.
1294
e543ae91
JD
12952012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1296
1297 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1298
1299 * nsfns.m (XParseGeometry): Remove.
1300 (Fx_create_frame): Call x_set_offset to correctly interpret
1301 top_pos in geometry.
1302
3a880af4 1303 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
1304 (Fx_parse_geometry): If there is a space in string, call
1305 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1306
45ba16c7
EZ
13072012-09-17 Eli Zaretskii <eliz@gnu.org>
1308
c8b9f1bc
EZ
1309 * search.c (scan_buffer): Use character positions in calls to
1310 region_cache_forward and region_cache_backward, not byte
1311 positions. (Bug#12196)
1312
b4c932a2
EZ
1313 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1314 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1315
45ba16c7
EZ
1316 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1317 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1318 emacs_blocked_malloc, now deleted.
1319
eeceac93
PE
13202012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1321
1322 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1323 The workaround was for improving performance on Solaris 2.4, but
1324 is getting in the way now. Emacs will still work if someone is
1325 still running Solaris 2.4 in a museum somewhere; Sun dropped
1326 support for Solaris 2.4 in 2003.
1327 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1328 * process.c (create_process) [HAVE_WORKING_VFORK]:
1329 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1330 since Emacs no longer uses vfork on that platform.
1331
78f83752
GM
13322012-09-17 Glenn Morris <rgm@gnu.org>
1333
1334 * emacs.c: Use COPYRIGHT.
1335
634b8cac
PE
13362012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1337
0caaedb1
PE
1338 Remove configure's --without-sync-input option (Bug#12450).
1339 When auditing signal-handling in preparation for cleaning it up,
1340 I found that SYNC_INPUT has race conditions and would be a real
1341 pain to fix. Since it's an undocumented and deprecated
1342 configure-time option, now seems like a good time to remove it.
1343 Also see <http://bugs.gnu.org/11080#16>.
1344 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1345 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1346 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1347 (malloc_hysteresis):
1348 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1349 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1350 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1351 (dont_register_blocks, bytes_used_when_reconsidered)
1352 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1353 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1354 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1355 Remove. All uses removed.
1356 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1357 implementation, one that depends on whether the new macro
1358 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1359 is defined.
1360 * atimer.c (run_timers, handle_alarm_signal):
1361 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1362 (handle_async_input, process_pending_signals)
1363 (handle_input_available_signal, init_keyboard):
1364 * nsterm.m (ns_read_socket):
1365 * process.c (wait_reading_process_output):
1366 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1367 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1368 (emacs_write):
1369 * xterm.c (XTread_socket):
1370 Assume SYNC_INPUT.
1371 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1372 * eval.c (handling_signal): Remove. All uses removed.
1373 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1374 All uses replaced with the SYNC_INPUT version.
1375 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1376 Remove decls.
1377 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1378 Now static.
1379
634b8cac
PE
1380 * font.c (Ffont_shape_gstring): Remove unused local.
1381
83da1b55
GM
13822012-09-16 Glenn Morris <rgm@gnu.org>
1383
518650a5
GM
1384 * Makefile.in (clean): No longer run nextstep's clean.
1385
83da1b55
GM
1386 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1387 (ns_frag): Remove.
1388 (ns-app): Move here from ns.mk, and simplify.
1389 (clean): Simplify nextstep entry.
1390 * ns.mk: Remove file.
1391
85a43e2e
KH
13922012-09-17 Kenichi Handa <handa@gnu.org>
1393
1394 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1395 not covert the last few charactes.
1396
ba13e616 13972012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
1398
1399 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1400 here, but just check the validity of glyphs in the glyph-string.
1401
a8c729af
MR
14022012-09-16 Martin Rudalics <rudalics@gmx.at>
1403
3a880af4
SM
1404 * window.c (Fwindow_parameter, Fset_window_parameter):
1405 Accept any window as argument (Bug#12452).
a8c729af 1406
c077c059
JD
14072012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1408
1409 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1410 to ns_term_init to avoid memory leak.
1411
1412 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1413 explicit retain/release.
1414 (ns_term_init): Only allow one display. Initialize outerpool and
1415 ns_*_types.
1416
39a57ad0
PE
14172012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1418
1419 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1420 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1421 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1422 the Microsoft problem in a different way, by altering ../nt/config.nt.
1423
7105c8cb
EZ
14242012-09-15 Eli Zaretskii <eliz@gnu.org>
1425
1426 * w32xfns.c:
1427 * w32uniscribe.c:
1428 * w32term.c:
1429 * w32select.c:
1430 * w32reg.c:
1431 * w32proc.c:
1432 * w32menu.c:
1433 * w32inevt.c:
1434 * w32heap.c:
1435 * w32font.c:
1436 * w32fns.c:
1437 * w32console.c:
1438 * w32.c:
1439 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1440 by lisp.h. This completes removal of setjmp.h inclusion
1441 erroneously announced in the previous commit. (Bug#12446)
1442
1443 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1444 more accurate.
1445
1446 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1447 not defined as a macro. The latter happens on MS-Windows.
1448 (Bug#12446)
1449
0328b6de
PE
14502012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1451
1452 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1453 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 1454 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
1455 only reason for the instance was because "lisp.h" was included.
1456 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1457 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1458 and _longjmp with the new symbols. Emacs already uses _setjmp if
1459 available, so this change affects only POSIXish hosts that have
1460 sigsetjmp but not _setjmp, such as some versions of Solaris and
1461 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1462 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1463 (png_load_body) [HAVE_PNG]:
1464 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1465 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1466 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1467 since PNG requires jmp_buf. This is the only exception to the
1468 general rule that we now use sys_setjmp and sys_longjmp.
1469 This exception is OK since this code does not change the signal
1470 mask or longjmp out of a signal handler.
1471
2af03429
PE
14722012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1473
1474 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1475 Include "syssignal.h", for 'main_thread'.
1476
2f294edf
DA
14772012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1478
1479 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
1480 * insdel.c (replace_range, replace_range_2):
1481 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
1482 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1483 Remove redundant check before calling offset_intervals.
1484
6b533e9c
MR
14852012-09-14 Martin Rudalics <rudalics@gmx.at>
1486
1487 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1488 current buffer (Bug#12387).
1489
2a7931e3
JB
14902012-09-14 Juanma Barranquero <lekktu@gmail.com>
1491
1492 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1493
c18e885b
PE
14942012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1495
1496 Use a more backwards-compatible timer format (Bug#12430).
1497 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1498 vector element, not from the 4th, since PSECS is now at the end.
1499 (Fcurrent_idle_time): Doc fix.
1500
d59a1afb
DA
15012012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1502
1503 Function to mark objects and remove killed buffers at once.
1504 * alloc.c (discard_killed_buffers): Rename to ...
1505 (mark_discard_killed buffers) ... new name. Add marking
1506 of remaining objects. Fix comment. Adjust users.
1507 (mark_object): Do not touch frame buffer lists here.
1508 * frame.c (delete_frame): Reset frame buffer lists here.
1509
5f0cb45a
PE
15102012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1511
8ea47e3a
PE
1512 Better workaround for GNOME bug when --enable-gcc-warnings.
1513 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1514 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1515 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1516
4a4bbad2
PE
1517 Simplify SIGIO usage (Bug#12408).
1518 The code that dealt with SIGIO was crufty and confusing, e.g., it
1519 played tricks like "#undef SIGIO" but these tricks were not used
1520 consistently. Simplify mostly by not #undeffing standard symbols,
1521 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1522 or not as we please) rather than "defined SIGIO" (standard symbol
1523 that we probably shouldn't #undef).
1524 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1525 Modules that need it can include it.
1526 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1527 * dispextern.h (ignore_sigio): New decl.
1528 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1529 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1530 * emacs.c (shut_down_emacs):
1531 * keyboard.c (kbd_buffer_store_event_hold):
1532 Use ignore_sigio rather than invoking 'signal' directly.
1533 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1534 for FIONREAD.
1535 (FIONREAD, SIGIO): Do not #undef.
1536 (tty_read_avail_input): Use #error rather than a syntax error.
1537 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1538 for I_PIPE, used by SETUP_SLAVE_PTY.
1539 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1540 * sysdep.c (croak): Remove; no longer needed. This bit of
1541 temporary code, with Fred N. Fish's comment that it's temporary,
1542 has been in Emacs since at least 1992!
1543 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1544 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1545 * syssignal.h (croak): Remove decl.
1546 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1547 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1548 now that we're termios-only.
1549 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1550 * term.c (dissociate_if_controlling_tty): Use #error rather than
1551 a run-time error.
1552
5f0cb45a
PE
1553 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1554 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1555 to work around GNOME bug 683906.
1556 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1557 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1558 This works around GCC bug 54561.
1559
40bce90b
PE
15602012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1561
1562 More fixes for 'volatile' and setjmp/longjmp.
1563 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1564 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1565 (png_load_body) [HAVE_PNG]:
1566 (jpeg_load_body) [HAVE_JPEG]:
1567 New function, with most of the old parent function's body.
1568 (png_load) [HAVE_PNG]:
1569 (jpeg_load) [HAVE_JPEG]:
1570 Invoke the new function, to avoid longjmp munging our locals.
1571 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1572 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1573 longjmp is passed 2, as the C standard doesn't guarantee this.
1574 Instead, store the failure code into mgr->failure_code.
1575
bfeae2cf
SM
15762012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1577
1578 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1579 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1580 (syms_of_keyboard): Remove support for unread-command-char.
1581
8099e36b
EZ
15822012-09-12 Eli Zaretskii <eliz@gnu.org>
1583
1584 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1585 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1586 violation. (Bug#12426)
1587
92547ff9
PE
15882012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1589
1590 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1591
45b82ad0
SM
15922012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1593
1594 * eval.c: Add `inhibit-debugger'.
1595 (Qinhibit_debugger): New symbol.
1596 (call_debugger): Bind it instead of Qdebug_on_error.
1597 (maybe_call_debugger): Test Vinhibit_debugger.
1598 (syms_of_eval): Define inhibit-debugger.
1599 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1600 (syms_of_xdisp): Remove inhibit-debug-on-message.
1601
5779a1dc
PE
16022012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1603
50f2e553
PE
1604 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1605 If a nonvolatile local variable is written before a _longjmp to
1606 the frame containing the variable, and is read after the _longjmp,
1607 the value read is indeterminate. Some local variables of type
1608 'struct handler' and 'struct catchtag' are used in this way, so
1609 mark each of their slots as volatile if the slot can be set before
1610 _longjmp and read afterwards.
1611 * lisp.h (struct handler): var and chosen_clause are now volatile.
1612 (struct catchtag): val, next, and pdlcount are now volatile.
1613
ae1d87e2
PE
1614 * bidi.c (bidi_push_it, bidi_pop_it):
1615 * fns.c (copy_hash_table):
1616 * image.c (define_image_type):
1617 * keyboard.c (kbd_buffer_store_event_hold):
1618 * process.c (Fprocess_send_eof):
1619 * xfaces.c (x_create_gc) [HAVE_NS]:
1620 * xgselect.c (xg_select):
1621 Prefer assignment to memcpy when either will do.
1622
5779a1dc
PE
1623 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1624 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1625 time an item is removed. No need to mark this function 'inline';
1626 the compiler knows better than we do.
1627
c4c9756b
JD
16282012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1629
1630 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1631 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1632 to change_frame_size (Bug#12388).
1633 (windowDidResize:): Pass YES to updateFrameSize.
1634
1635 * nsterm.h: Add delay parameter to updateFrameSize.
1636
d73e321c
DA
16372012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1638
1639 Discard killed buffers from deleted window and frame objects.
1640 This reduces an amount of references to killed buffers and
1641 helps GC to reclaim them faster.
1642 * alloc.c (discard_killed_buffers): New function.
1643 (mark_object): Use it for deleted windows and frames.
1644 (mark_object): If symbol's value is set up for a killed buffer
1645 or deleted frame, restore it's global binding.
1646 * data.c (swap_in_global_binding): Add GC notice.
1647 (swap_in_symval_forwarding): Use convenient set_blv_where.
1648 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1649 * window.h: ... to here.
1650
e578f381
DA
16512012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1652
1653 Convenient macro to check whether the buffer is live.
1654 * buffer.h (BUFFER_LIVE_P): New macro.
1655 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1656 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1657
3057e615
YM
16582012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1659
1660 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1661 composition cases (Bug#12364).
1662
1663 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1664 overhang of succeeding glyphs overlapping box cursor.
1665
1666 * w32term.c (x_draw_glyph_string): Likewise.
1667
6fda35f2
PE
16682012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1669
c990426a
PE
1670 Simplify, document, and port floating-point (Bug#12381).
1671 The porting part of this patch fixes bugs on non-IEEE platforms
1672 with frexp, ldexp, logb.
1673 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1674 Now static.
1675 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1676 support, by removing commented-out code and briefly listing the
1677 C89 functions excluded. The commented-out stuff was confusing
1678 maintenance, e.g., we thought we needed cbrt but it was commented out.
1679 (logb): Remove decl; no longer needed.
1680 (isfinite): New macro, if not already supplied.
1681 (isnan): Don't replace any existing macro.
1682 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1683 are present on all C89 platforms.
1684 (Ffrexp): Do not special-case zero, as frexp does the right thing
1685 for that case.
1686 (Flogb): Do not use logb, as it doesn't have the desired meaning
1687 on hosts that use non-base-2 floating point. Instead, stick with
1688 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1689 frexp, to avoid getting an unspecified result.
1690
6fda35f2
PE
1691 * xdisp.c (Qinhibit_debug_on_message): Now static.
1692
16130a58
JD
16932012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1694
1695 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1696 NSBezierPath (Bug#12131).
1697
d105a573
CY
16982012-09-10 Chong Yidong <cyd@gnu.org>
1699
1700 * fns.c (Fdelq, Fdelete): Doc fix.
1701
ff55dfe8
PE
17022012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1703
1704 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1705 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1706
e7032e7c
SM
17072012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1708
1709 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1710 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1711 Use it.
1712
e9957956
EZ
17132012-09-09 Eli Zaretskii <eliz@gnu.org>
1714
aba05ce9
EZ
1715 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1716 left fringe if the window has a left margin. This avoids leaving
1717 traces of the cursor because its leftmost pixel is not drawn over.
1718
e9957956
EZ
1719 * dispnew.c (update_window_line): When the left margin area of a
1720 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1721 that screen line. (Bug#12277)
1722
f6196b87
PE
17232012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1724
1725 Assume C89 or later for math functions (Bug#12381).
1726 This simplifies the code, and makes it a bit smaller and faster,
1727 and (most important) makes it easier to clean up signal handling
1728 since we can stop worring about floating-point exceptions in
1729 library code. That was a problem before C89, but the problem
1730 went away many years ago on all practical Emacs targets.
1731 * data.c, image.c, lread.c, print.c:
1732 Don't include <math.h>; no longer needed.
1733 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1734 might be autoconfigured, as that never happens.
1735 * data.c (fmod):
1736 * doprnt.c (DBL_MAX_10_EXP):
1737 * print.c (DBL_DIG):
1738 Remove. C89 or later always defines these.
1739 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1740 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1741 (arith_error, domain_error, domain_error2):
1742 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1743 no longer needed -- we simply return what C returns. All uses removed.
1744 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1745 the wrapped code.
1746 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1747 Remove. All uses expanded, as these macros are no longer used
1748 more than once and are now more trouble than they're worth.
1749 (Ftan): Use tan, not sin / cos.
1750 (Flogb): Assume C89 frexp.
1751 (fmod_float): Assume C89 fmod.
1752 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1753 (init_floatfns): Remove. All uses removed.
1754
9d7f1863
JD
17552012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1756
1757 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1758 compositeToPoint for OSX < 10.6 (Bug#12390).
1759
eabf0404
PE
17602012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1761
1762 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1763 This produces more-accurate results.
1764
0b3b1d23
JD
17652012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1766
1767 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1768 changes (Bug#12088).
1769
6dcef6ec
CY
17702012-09-08 Chong Yidong <cyd@gnu.org>
1771
1772 * syntax.c (Fstring_to_syntax): Doc fix.
1773
aa7d57c5
JD
17742012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1775
1776 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1777 in the internal border.
1778 (x_set_window_size): Remove static variables and their usage.
1779 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1780 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1781 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1782 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1783 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1784 (ns_fix_rect_ibw): Remove.
1785 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1786 (ns_dumpglyphs_box_or_relief): Ditto.
1787 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1788 adjustment.
1789 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1790 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1791 border adjustment.
1792 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1793 their usage. Add fringe_extended_p and its use as in other terms.
1794 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1795 scroll bar was removed.
1796 (updateFrameSize): New function.
1797 (windowDidResize): Move code to updateFrameSize and call it.
1798
1799 * nsterm.h (EmacsView): Add updateFrameSize.
1800
1a5432bc
CY
18012012-09-07 Chong Yidong <cyd@gnu.org>
1802
b4f5313e
CY
1803 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1804
1a5432bc
CY
1805 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1806
1a4f1e9b
PE
18072012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1808
1809 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1810 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1811 Problem introduced when merging patches. Noted by Eli Zaretskii in
1812 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1813 * floatfns.c: Comment fix.
1814 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1815 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1816 and anyway the declaration is harmless even if SIGDANGER is not defined.
1817 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1818 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1819 source files not surprisingly expected syssignal.h to define, or
1820 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1821 Include <sys/ioctl.h>, for FIONREAD.
1822 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1823 This eliminates a problem whereby other files mysteriously had
1824 to include "syssignal.h" before including "systty.h" if they
1825 wanted to use "#ifdef SIGIO".
1826
bc8000ff
EZ
18272012-09-07 Eli Zaretskii <eliz@gnu.org>
1828
3e6d6928
EZ
1829 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1830
1831 * w32.c (sigemptyset): Empty the set.
1832 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1833
bc8000ff
EZ
1834 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1835
b4fa72f2
DA
18362012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1837
1838 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1839 (mark_object): Likewise for frame objects.
1840
30730c93
PE
18412012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1842
1843 * syssignal.h (handle_on_main_thread): Always declare,
1844 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1845 This ports to platforms without HAVE_PTHREAD.
1846
2fe28299
PE
18472012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1848
1849 Signal-handler cleanup (Bug#12327).
1850 Emacs's signal handlers were written in the old 4.2BSD style with
1851 sigblock and sigmask and so forth, and this led to some
1852 inefficiencies and confusion. Rewrite these to use
1853 pthread_sigmask etc. without copying signal sets around. Also,
1854 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1855 'signal', and instead use functions that do not attempt to take
1856 over the system name space. This patch causes Emacs's text
1857 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1858 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1859 Do not include <signal.h> or "syssignal.h", as these
1860 modules do not use signals.
1861 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1862 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1863 Do not include <signal.h>, as "syssignal.h" does that for us now.
1864 * atimer.c (sigmask_atimers): New function.
1865 (block_atimers, unblock_atimers): New functions,
1866 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1867 All uses replaced.
1868 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1869 no longer needed here.
1870 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1871 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1872 * sysdep.c (struct save_signal): New member 'action', replacing
1873 old member 'handler'.
1874 (save_signal_handlers, restore_signal_handlers):
1875 Use sigaction instead of 'signal' to save and restore.
1876 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1877 New function. All users of 'signal' modified to use set_sighandler
1878 if they're writeonly, and to use sys_signal if they're read+write.
1879 (emacs_sigaction_init, forwarded_signal): New functions.
1880 (sys_signal): Remove. All uses replaced by calls to sigaction
1881 and emacs_sigaction_init, or by direct calls to 'signal'.
1882 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1883 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1884 all uses replaced by pthread_sigmask etc. calls.
1885 * syssignal.h: Include <signal.h>.
1886 (emacs_sigaction_init, forwarded_signal): New decls.
1887 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1888 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1889 (sigmask, sys_sigmask): Remove; no longer needed.
1890 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1891 (sigblock, sigunblock, sigfree):
1892 (sigsetmask) [!defined sigsetmask]:
1893 Remove. All uses replaced by pthread_sigmask.
1894 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1895 no longer need to be replaced, and its typical old uses
1896 are now done via emacs_sigaction_init and sigaction.
1897 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1898 (sys_sigdel): Remove; unused.
1899 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1900
0216c128
EZ
19012012-09-06 Eli Zaretskii <eliz@gnu.org>
1902
1903 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1904 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1905
c752cfa9
DA
19062012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1907
1908 Explicitly mark buffer_defaults and buffer_local_symbols.
1909 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1910 mark_local_symbols here.
1911 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1912 since special buffers aren't marked here any more.
1913 (allocate_buffer): Chain new buffer with all_buffers here...
1914 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1915 not here.
1916 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1917 (syms_of_buffer): Remove staticpro of the above.
1918 (init_buffer_once): Set names for buffer_defaults and
1919 buffer_local_symbols.
1920
a864ef14
PE
19212012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1922
1923 Use bool for booleans in font-related modules.
1924 * font.c (font_intern_prop, font_style_to_value)
1925 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1926 (generate_otf_features, font_check_otf_features, font_check_otf)
1927 (font_match_p, font_list_entities, font_at):
1928 * fontset.c (fontset_id_valid_p, reorder_font_vector
1929 (fontset_find_font, Fset_fontset_font)
1930 (face_suitable_for_char_p) [0]:
1931 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1932 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1933 (m17n_flt_initialized, ftfont_shape_by_flt):
1934 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1935 * nsfont.m (nsfont_draw):
1936 * w32font.c (w32font_draw):
1937 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1938 Use bool for booleans.
1939 * font.h: Adjust to above API changes.
1940 (struct font, struct font_driver, struct font_driver_list):
1941 Use bool for booleans.
1942 (struct font): Remove useless member encoding_type.
1943 All users removed.
1944 * fontset.c, xftfont.c: Omit unnecessary static decls.
1945
0699fc18
DA
19462012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1947
1948 * alloc.c (mark_object): Revert window marking code
1949 since it's unsafe for the Fset_window_configuration.
1950
20ef56db
PE
19512012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1952
2fe28299 1953 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
1954 Be more systematic about preserving errno whenever a signal
1955 handler returns, even if it's not in the main thread. Do this by
1956 renaming signal handlers to distinguish between signal delivery
1957 and signal handling. All uses changed.
1958 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1959 * data.c (deliver_arith_signal): Rename from arith_error.
1960 * dispnew.c (deliver_window_change_signal): Rename from
1961 window_change_signal.
1962 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1963 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1964 * keyboard.c (deliver_input_available_signal): Rename from
1965 input_available_signal.
1966 (deliver_user_signal): Rename from handle_user_signal.
1967 (deliver_interrupt_signal): Rename from interrupt_signal.
1968 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1969 (deliver_child_signal): Rename from sigchld_handler.
1970 * atimer.c (handle_alarm_signal):
1971 * data.c (handle_arith_signal):
1972 * dispnew.c (handle_window_change_signal):
1973 * emacs.c (handle_fatal_signal, handle_danger_signal):
1974 * keyboard.c (handle_input_available_signal):
1975 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1976 * process.c (handle_pipe_signal, handle_child_signal):
1977 New functions, with the actual signal-handling code taken from the
1978 original respective signal handlers, sans the sporadic attempts to
1979 preserve errno, since that's now done by handle_on_main_thread.
1980 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1981 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1982 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1983 Move to sysdep.c.
1984 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1985 Move initialization of main_thread to sysdep.c's init_signals.
1986 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1987 our usage, and simplifies the mainline code.
1988 (record_child_status_change): New static function, as a helper
1989 for handle_child_signal, and with most of the old child handler's
1990 contents.
1991 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1992 (handle_child_signal): Use the above.
1993 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1994 Moved here from emacs.c.
1995 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1996 code moved here from emacs.c's main function.
1997 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
1998 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1999 This lets callers save and restore errno properly.
20ef56db 2000
e3ccf108
DA
20012012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2002
2003 Remove redundant or unused things here and there.
2004 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2005 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2006 * editfns.c (Fcompare_buffer_substrings): Likewise.
2007 * frame.h (struct terminal, struct font_driver_list):
2008 Remove redundant declarations.
2009 * window.h (Qleft, Qright): Likewise.
2010
697e1e39
DA
20112012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2012
2013 Do not mark objects from deleted buffers, windows and frames.
2014 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2015 (mark_object): Likewise for windows and frames.
2016
c1ca42ca
DA
20172012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2018
2019 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2020 buffer_defaults and buffer_local_symbols as valid objects.
2021 Return special value to denote them.
2022
014d93be
PE
20232012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2024
f75d7a91
PE
2025 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2026 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2027 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2028 (file_name_absolute_p, Fsubstitute_in_file_name):
2029 (check_executable, check_writable, Ffile_accessible_directory_p)
2030 (Fset_file_selinux_context, Fdefault_file_modes)
2031 (Finsert_file_contents, choose_write_coding_system)
2032 (Fwrite_region, build_annotations, a_write, e_write)
2033 (Fdo_auto_save):
2034 * filelock.c (boot_time_initialized, get_boot_time)
2035 (get_boot_time_1, lock_file_1, within_one_second):
2036 * floatfns.c (in_float):
2037 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2038 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2039 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2040 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2041 * window.c (compare_window_configurations):
2042 Use bool for booleans.
2043 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2044 (Fdefault_file_modes): Now mode_t, not int, for modes.
2045 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2046 (internal_delete_file): Now returns void, not a (boolean) int,
2047 since nobody was looking at the return value.
2048 * lisp.h, window.h: Adjust to above API changes.
2049
014d93be
PE
2050 * xdisp.c (set_message): Simplify and reindent last change.
2051
776f29e1
JB
20522012-09-05 Juanma Barranquero <lekktu@gmail.com>
2053
2054 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2055
7f7e0167
LI
20562012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2057
2058 * eval.c (call_debugger): Make the function non-static so that we
2059 can call it from set_message.
2060
2061 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2062 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2063
cf29dd84
PE
20642012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2065
2066 Give more-useful info on a fatal error (Bug#12328).
2067 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2068 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2069 of doing the work ourselves.
2070 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2071 do most of the work.
2072 (fatal_error_backtrace): New function, taken from the guts
2073 of the old fatal_error_signal, but with a new option to output
2074 a backtrace.
2075 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2076 info about the signal than just its number.
2077 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2078 * sysdep.c: Include <execinfo.h>
2079 (emacs_backtrace): New function, taken partly from the previous
2080 code of the 'die' function.
2081 (emacs_abort): Call fatal_error_backtrace rather than abort.
2082
972debf2
SM
20832012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2084
2085 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2086 eager (load-time) macro-expansion.
2087 * lisp.mk (lisp): Add macroexp.
2088
1088b922
PE
20892012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2090
2091 Simplify redefinition of 'abort' (Bug#12316).
2092 Do not try to redefine the 'abort' function. Instead, redo
2093 the code so that it calls 'emacs_abort' rather than 'abort'.
2094 This removes the need for the NO_ABORT configure-time macro
2095 and makes it easier to change the abort code to do a backtrace.
2096 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2097 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2098 Remove; sysdep.c's emacs_abort now takes its place.
2099 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2100 'abort' changed to use 'emacs_abort'.
2101 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2102 (abort) [!defined abort]: Rename to ...
2103 (emacs_abort): ... new name.
2104 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2105 the place of the old 'abort' in emacs.c.
2106 * w32.c, w32fns.c (abort): Do not #undef.
2107 * w32.c (emacs_abort): Rename from w32_abort.
2108
30934d33
EZ
21092012-09-04 Eli Zaretskii <eliz@gnu.org>
2110
2111 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2112 offsets[j].dv, since the y axis of the screen coordinates points
2113 down, while the y axis of the font definition coordinates points
2114 up. This fixes display of Arabic diacritics such as KASRA and
2115 KASRATAN. (Bug#11860)
2116
af26b72c
PE
21172012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2118
2119 Be more systematic about _setjmp vs setjmp.
2120 * alloc.c (test_setjmp, mark_stack):
2121 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2122 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2123 (png_load, my_error_exit, jpeg_load):
2124 * process.c (send_process_trap, send_process):
2125 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2126 The underscored versions are up to 30x faster on some hosts.
2127 Formerly, the code used setjmp+longjmp sometimes and
2128 _setjmp+_longjmp at other times, with no particular reason to
2129 prefer setjmp+longjmp.
2130
26d4541d
PE
21312012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2132
d42f4f0f 2133 Fix minor problem found by static checking.
26d4541d 2134 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 2135
c5e28e39
MR
21362012-09-03 Martin Rudalics <rudalics@gmx.at>
2137
2138 * buffer.c (Fdelete_all_overlays): New function.
2139
3eab3ca9
CY
21402012-09-03 Chong Yidong <cyd@gnu.org>
2141
2142 * gtkutil.c: Add extern decl for Qxft.
2143
c04889f8
PE
21442012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2145
1882aa38
PE
2146 * emacs.c, eval.c: Use bool for boolean.
2147 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2148 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2149 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2150 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2151 (main, decode_env_path, Fdaemon_initialized):
2152 * eval.c (call_debugger, Finteractive_p, interactive_p):
2153 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2154 (maybe_call_debugger, Fbacktrace):
2155 * process.c (read_process_output, exec_sentinel):
2156 Use bool for booleans.
2157 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2158 All callers changed.
2159 * eval.c (interactive_p): Omit always-true boolean argument
2160 EXCLUDE_SUBRS_P. All callers changed.
2161 * dispextern.h, lisp.h: Reflect above API changes.
2162 * firstfile.c (dummy): Use the address of 'main', whose signature
2163 won't change, instead of the address of 'initialize', whose
2164 signature just changed from int to bool.
2165 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2166 * msdos.c (fatal_error_in_progress): ... from here.
2167 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2168 of incrementing it.
2169 (redisplay_internal, unwind_redisplay): Simply clear
2170 REDISPLAYING_P when unwinding, instead of saving its previous,
2171 always-false value and then restoring it.
2172
a411ac43
PE
2173 Clean up some extern decls.
2174 Mostly, this hoists extern decls out of .c files and into .h files.
2175 That way, we're more likely to catch errors if the interfaces change.
2176 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2177 declare xg_mark_data.
2178 * dispextern.h (x_frame_parm_handlers):
2179 * font.h (Qxft):
2180 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2181 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2182 (Qultra_bold, Qoblique, Qitalic):
2183 Move extern decl here from .c file.
2184 * alloc.c (xg_mark_data) [USE_GTK]:
2185 * doc.c (Qclosure):
2186 * eval.c (Qlexical_binding):
2187 * fns.c (time) [!HAVE_UNISTD_H]:
2188 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2189 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2190 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2191 * lread.c (Qinternal_interpreter_environment):
2192 * minibuf.c (Qbuffer):
2193 * process.c (QCfamily, QCfilter):
2194 * widget.c (free_frame_faces):
2195 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2196 * xfont.c (x_clear_errors):
2197 * xterm.c (x_frame_parm_handlers):
2198 Remove now-redundant extern decls.
2199 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2200 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2201 Now static.
2202 * xfaces.c: Remove unnecessary static decls.
2203 * xterm.c (updating_frame): Remove decl of nonexistent object.
2204
c04889f8
PE
2205 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2206 when building globals.h, as the objects that are not built on
2207 this host are not needed to compile C files on this host.
2208
8b339673
JD
22092012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2210
2211 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2212
2213 * frame.h: Add missing prototype for x_wm_set_size_hint.
2214
a08d4ba7
PE
22152012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2216
2217 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2218 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2219 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2220 (Fsubstitute_command_keys):
2221 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2222 (save_excursion_save, save_excursion_restore)
2223 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2224 (format_time_string, general_insert_function)
2225 (make_buffer_string, make_buffer_string_both)
2226 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2227 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2228 (copy_text, insert_1, insert_1_both, insert_from_string)
2229 (insert_from_string_before_markers, insert_from_string_1)
2230 (insert_from_buffer, insert_from_buffer_1, replace_range)
2231 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2232 (del_range_2, modify_region):
2233 * intervals.c (intervals_equal, balance_possible_root_interval)
2234 (adjust_intervals_for_insertion, merge_properties_sticky)
2235 (graft_intervals_into_buffer, lookup_char_property)
2236 (adjust_for_invis_intang, set_point_both)
2237 (get_property_and_range, compare_string_intervals)
2238 (set_intervals_multibyte_1, set_intervals_multibyte):
2239 * keyboard.c (decode_timer):
2240 Use bool for boolean.
2241 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2242 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2243
48c948de
CY
22442012-09-02 Chong Yidong <cyd@gnu.org>
2245
2246 * keymap.c (push_key_description): Print M-TAB as C-M-i
2247 (Bug#11758).
2248
6c49a40b
JB
22492012-09-02 Juanma Barranquero <lekktu@gmail.com>
2250
2251 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2252 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2253 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2254 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2255 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2256 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2257 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2258
4dfbd238
EZ
22592012-09-01 Eli Zaretskii <eliz@gnu.org>
2260
7e510e28
EZ
2261 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2262 more than one grapheme cluster passed to the shaper: compute the
2263 offset adjustment values separately for each cluster. (Bug#11860)
2264
4dfbd238
EZ
2265 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2266 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2267 about implicit conversions from integer to pointer.
2268
86571ae0
DC
22692012-09-01 Daniel Colascione <dancol@dancol.org>
2270
2271 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2272 system used too early.
2273
0e23ef9d
PE
22742012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2275
2276 Better seed support for (random).
2277 * emacs.c (main): Call init_random.
2278 * fns.c (Frandom): Set the seed from a string argument, if given.
2279 Remove long-obsolete Gentzel cruft.
2280 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2281 (init_random): New function.
2282
17a2cbbd
DC
22832012-09-01 Daniel Colascione <dancol@dancol.org>
2284
2285 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2286 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2287 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2288 x_wm_set_size_hint, x_query_colors, x_real_positions,
2289 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2290 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2291 all of which have been moved to common code.
2292
2293 * xfaces.c: Include TERM_HEADER instead of listing all possible
2294 window-system headers.
2295
2296 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2297 to match header.
2298
2299 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2300 directly accessing frame internals.
2301
f18cbb28 2302 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
2303 globals_of_w32font.
2304
2305 * process.c: Include TERM_HEADER instead of listing all possible
2306 window-system headers.
2307
3a880af4
SM
2308 * nsterm.h: Remove declarations now in frame.h.
2309 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
2310
2311 * menu.c: Include TERM_HEADER instead of listing all possible
2312 window-system headers.
2313
2314 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2315 window system.
2316
2317 * keyboard.c: Include TERM_HEADER instead of listing all possible
2318 window-system headers.
2319
2320 * image.c: Include TERM_HEADER instead of listing all possible
2321 window-system headers. Declare Vlibrary_cache when compiling for
2322 Windows.
2323
2324 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2325 window system declarations.
2326
2327 * frame.h: Move common functions here: set_frame_menubar,
2328 x_set_window_size, x_sync, x_get_focus_frame,
2329 x_set_mouse_position, x_set_mouse_pixel_position,
2330 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2331 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2332 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2333 x_activate_menubar, x_real_positions, x_bitmap_icon,
2334 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2335 and x_query_colors.
2336
2337 * frame.c: Include TERM_HEADER instead of listing all possible
2338 window-system headers.
2339
2340 * font.c: Include TERM_HEADER instead of listing all possible
2341 window-system headers.
2342
2343 * emacs.c: Include TERM_HEADER.
2344
f18cbb28
EZ
2345 * dispnew.c: Include TERM_HEADER instead of listing all possible
2346 window-system headers.
17a2cbbd 2347
f18cbb28 2348 * ccl.h: Include character.h.
17a2cbbd
DC
2349
2350 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2351 the current window system; include in list of objects to link into
2352 Emacs.
2353
c650a5de
DA
23542012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2355
2356 Remove mark_ttys function and fix tty_display_info initialization.
2357 * lisp.h (mark_ttys): Remove prototype.
2358 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2359 to mark_ttys because all possible values of 'top_frame' slot are
2360 the frames which are reachable from Vframe_list.
2361 * term.c (mark_ttys): Remove.
2362 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2363
4e0f6479
DA
23642012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2365
2366 Change struct frame bitfields from unsigned char to unsigned.
2367 * frame.h (struct frame): Change type of 'display_preempted',
2368 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2369 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2370 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2371 bitfields from unsigned char to unsigned.
2372
8b96a52c
DA
23732012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2374
2375 Remove unused member of struct x_output and struct w32_output.
2376 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2377 * w32term.h (struct w32_output): Likewise.
2378
b4444c8a
JD
23792012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2380
2381 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2382 does not become zero (Bug#12234).
2383
b98521db
PE
23842012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2385
2386 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2387 for GCC 4.7.1 x86-64.
2388
31d02438
GM
23892012-08-30 Glenn Morris <rgm@gnu.org>
2390
2391 * lread.c (init_lread): For out-of-tree builds, only add the
2392 source directory's site-lisp dir to the load-path if it exists,
2393 consistent with in-tree builds. (Bug#12302)
2394
7f8941d8
JD
23952012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2396
2397 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 2398 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
2399 (windowShouldClose:): Set window_closed.
2400 (dealloc): New member, free button_values.
fc0c31f8
JB
2401 (process_dialog:): Make member function. Remove window argument,
2402 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
2403 in button_values.
2404 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 2405 with tag. Remove return self, declare return value as void.
7f8941d8
JD
2406 (addString:row:): Remove return self, declare return value as void.
2407 (addSplit): Remove return self, declare return value as void.
2408 (clicked:): Remove return self, declare return value as void.
fc0c31f8 2409 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
2410 (initFromContents:isQuestion:): Adjust call to process_dialog.
2411 Code formatting change.
2412 (timeout_handler:): Set timer_fired to YES.
2413 (runDialogAt:): Set timer_fired to NO.
2414 Handle click on close button as quit.
2415
2416 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2417 Add window_closed and button_values. Add void as return value for
2418 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2419 Add process_dialog as new member.
2420
eada0861 24212012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 2422
eada0861
GM
2423 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2424 is not one of the heaps we manage. (Bug#12242)
2425
24262012-08-28 Glenn Morris <rgm@gnu.org>
2427
2428 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2429
457294dd
MR
24302012-08-28 Martin Rudalics <rudalics@gmx.at>
2431
2432 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
2433 auto-buffer-name window parameter. Install revision of reverted
2434 fix.
457294dd 2435
4f2daf31
DA
24362012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2437
2438 Do not allow to set major mode for a dead buffer.
2439 * buffer.c (Fset_buffer_major_mode): Signal an error
2440 if the buffer is dead.
2441 (Fother_buffer, other_buffer_safely): Remove redundant
2442 nested declaration.
2443
66322887
DA
24442012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2445
2446 Always use set_buffer_if_live to restore original buffer at unwind.
2447 * buffer.h (record_unwind_current_buffer): New function.
2448 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2449 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2450 * undo.c, window.c: Adjust users.
2451 * buffer.c (set_buffer_if_live): Fix comment.
2452
a3d794a1
DA
24532012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2454
2455 Fix usage of set_buffer_internal.
2456 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2457 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2458 * coding.c (decode_coding): Omit redundant test.
2459 * fileio.c (decide_coding_unwind): Likewise.
2460 * fns.c (secure_hash): Likewise.
2461 * insdel.c (modify_region): Likewise.
2462 * keyboard.c (command_loop_1): Likewise.
2463 * print.c (PRINTFINISH): Likewise.
2464 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2465
59ea14cd
PE
24662012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2467
2468 * dispnew.c: Use bool for boolean.
2469 (frame_garbaged, display_completed, delayed_size_change)
2470 (fonts_changed_p, add_window_display_history)
2471 (add_frame_display_history, verify_row_hash)
2472 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2473 (row_equal_p, realloc_glyph_pool)
2474 (allocate_matrices_for_frame_redisplay)
2475 (showing_window_margins_p)
2476 (adjust_frame_glyphs_for_frame_redisplay)
2477 (build_frame_matrix_from_leaf_window, make_current)
2478 (mirrored_line_dance, mirror_line_dance, update_frame)
2479 (update_window_tree, update_single_window)
2480 (check_current_matrix_flags, update_window, update_text_area)
2481 (update_window_line, set_window_update_flags, scrolling_window)
2482 (update_frame_1, scrolling, buffer_posn_from_coords)
2483 (do_pending_window_change, change_frame_size)
2484 (change_frame_size_1, sit_for):
2485 Use bool for boolean.
2486 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2487 and remove last int (actually boolean) argument, which was always 0.
2488 All callers changed.
2489 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2490 * dispextern.h (struct composition_it): Use bool for boolean.
2491 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2492 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2493 * dired.c (file_name_completion):
2494 Use bool for boolean. (This was missed in an earlier change.)
2495
95072a94
MR
24962012-08-27 Martin Rudalics <rudalics@gmx.at>
2497
2498 * window.c (Fset_window_configuration): Revert first part of
2499 last change.
2500
0f19feff
JD
25012012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2502
2503 * nsterm.h (NSPanel): New class variable dialog_return.
2504
3a880af4
SM
2505 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2506 Initialize dialog_return.
0f19feff
JD
2507 (windowShouldClose:): Use stop instead of stopModalWithCode.
2508 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2509 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2510 event.
2511 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2512 modal loop returns.
2513
f10fe38f
PE
25142012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2515
de1339b0
PE
2516 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2517 * composite.c (find_composition, composition_gstring_p)
2518 (composition_reseat_it, find_automatic_composition):
2519 * data.c (let_shadows_buffer_binding_p)
2520 (let_shadows_global_binding_p, set_internal, make_blv)
2521 (Fmake_variable_buffer_local, Fmake_local_variable)
2522 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2523 (cons_to_signed, arith_driver):
2524 * dbusbind.c (xd_in_read_queued_messages):
2525 * dired.c (directory_files_internal, file_name_completion):
2526 Use bool for booleans.
2527 * dired.c (file_name_completion):
2528 * process.h (fd_callback):
2529 Omit int (actually boolean) argument. It wasn't being used.
2530 All uses changed.
2531 * composite.h, lisp.h: Reflect above API changes.
2532
f10fe38f
PE
2533 * cmds.c, coding.c: Use bool for booleans.
2534 * cmds.c (move_point, Fself_insert_command):
2535 * coding.h (struct composition status, struct coding_system):
2536 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2537 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2538 (emacs_mule_char, decode_coding_emacs_mule)
2539 (encode_coding_emacs_mule, detect_coding_iso_2022)
2540 (decode_coding_iso_2022, encode_invocation_designation)
2541 (encode_designation_at_bol, encode_coding_iso_2022)
2542 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2543 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2544 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2545 (encode_coding_raw_text, detect_coding_charset)
2546 (decode_coding_charset, encode_coding_charset, detect_eol)
2547 (detect_coding, get_translation_table, produce_chars)
2548 (consume_chars, reused_workbuf_in_use)
2549 (make_conversion_work_buffer, code_conversion_save)
2550 (decode_coding_object, encode_coding_object)
2551 (detect_coding_system, char_encodable_p)
2552 (Funencodable_char_position, code_convert_region)
2553 (code_convert_string, code_convert_string_norecord)
2554 (Fset_coding_system_priority):
2555 * fileio.c (Finsert_file_contents):
2556 Use bool for booleans.
2557 * coding.h, lisp.h: Reflect above API changes.
2558 * coding.c: Remove unnecessary static function decls.
2559 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2560 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2561 not a boolean 'int', since callers never look at the return value.
2562 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2563 * coding.h (decoding_buffer_size, encoding_buffer_size)
2564 (emacs_mule_string_char): Remove unused extern decls.
2565 (struct iso_2022_spec, struct coding_system):
2566 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2567 (struct emacs_mule_spec): Remove unused field 'full_support'.
2568 All initializations removed.
2569 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2570
5474c384
DA
25712012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2572
f10fe38f 2573 Fix spare memory change (Bug#12286).
5474c384
DA
2574 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2575 (valid_lisp_object_p): Likewise.
2576
c4b6914d
MR
25772012-08-27 Martin Rudalics <rudalics@gmx.at>
2578
2579 * window.c (Fset_window_configuration): Record any window's old
2580 buffer if it's replaced (see Bug#8789). If the new current
2581 buffer doesn't appear in the selected window, go to its old
2582 point (Bug#12208).
2583
35aaa1ea
DA
25842012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2585
2586 Special MEM_TYPE_SPARE to denote reserved memory.
2587 * alloc.c (enum mem_type): New memory type.
2588 (refill_memory_reserve): Use new type for spare memory.
2589 This prevents live_cons_p and live_string_p from incorrect
2590 detection of uninitialized objects from spare memory as live.
2591
6af64513
PE
25922012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2593
8b2e00a3
PE
2594 Spelling fixes.
2595 * Makefile.in (.PHONY): versioclean -> versionclean.
2596
b52d6985
PE
2597 Remove unused external symbols.
2598 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2599 * window.c (Qwindow_valid_p, decode_valid_window):
2600 Now static, not extern.
2601 * data.c (Qinterval): Remove; unused.
2602 (syms_of_data): Do not define 'interval'.
2603 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2604 * window.h (decode_valid_window):
2605 Remove decls.
2606
d5172d4f
PE
2607 * character.c, charset.c, chartab.c: Use bool for booleans.
2608 * character.c (lisp_string_width, string_count_byte8)
2609 (string_escape_byte8):
2610 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2611 (load_charset_map_from_file, map_charset_chars)
2612 (Fdefine_charset_internal, define_charset_internal)
2613 (Fdeclare_equiv_charset, find_charsets_in_text)
2614 (Ffind_charset_region, char_charset, Fiso_charset):
2615 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2616 (sub_char_table_set, sub_char_table_set_range)
2617 (char_table_set_range, optimize_sub_char_table)
2618 (map_sub_char_table):
2619 Use bool for boolean.
2620 * character.c (str_to_unibyte): Omit last boolean argument; it was
2621 always 0. All callers changed.
2622 * character.h, charset.h: Adjust to match previous changes.
2623 * character.h (char_printable_p): Remove decl of nonexistent function.
2624 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2625 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2626 are all boolean, so make them single-bit bitfields.
2627
6af64513
PE
2628 * lisp.h (ASET): Remove attempt to detect side effects.
2629 It was meant to be temporary and it often doesn't work,
2630 because when IDX has side effects the behavior of IDX==IDX
2631 is undefined. See Stefan Monnier in
2632 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2633
e1f29348
BR
26342012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2635
2636 * lisp.h (functionp): New function (extracted from Ffunctionp).
2637 (FUNCTIONP): Use it.
2638 * eval.c (Ffunctionp): Use it.
2639
17c05d74
PE
26402012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2641
0f46bc75
PE
2642 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2643 as that's faster and simpler than static storage. Don't bother
2644 with the g_main_context_query overhead if g_main_context_pending
2645 says no events are pending.
2646 (gfds, gfds_size): Remove these static vars.
2647 (xgselect_initialize): Remove; no longer needed.
2648 All uses and decls removed.
2649
ee4c0f69
PE
2650 * emacs.c (fatal_error_signal_hook): Remove.
2651 All uses removed. This leftover from old code was always 0.
2652
17c05d74
PE
2653 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2654 * casefiddle.c (casify_object, casify_region):
2655 * casetab.c (set_case_table):
2656 * category.c, category.h (word_boundary_p):
2657 * category.h (CHAR_HAS_CATEGORY):
2658 Use bool for booleans, instead of int.
2659
391ceac5
EZ
26602012-08-25 Eli Zaretskii <eliz@gnu.org>
2661
2662 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2663
2f221583
PE
26642012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2665
f4a681b0
PE
2666 On assertion failure, print backtrace if available.
2667 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2668 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2669 * Makefile.in (LIB_EXECINFO): New macro.
2670 (LIBES): Use it.
2671
2f221583
PE
2672 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2673 * bytecode.c (exec_byte_code):
2674 * callint.c (check_mark, Fcall_interactively):
2675 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2676 (getenv_internal, sync_process_alive, call_process_exited):
2677 * lisp.h (USE_SAFE_ALLOCA):
2678 Use bool for booleans, instead of int.
2679 * lisp.h, process.h: Adjust prototypes to match above changes.
2680 * callint.c (Fcall_interactively): Don't assume the mark's
2681 offset fits in 'int'.
2682
37ef52bb
PE
26832012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2684
2685 * buffer.c, buffer.h: Use bool for boolean.
2686 * buffer.c (reset_buffer_local_variables)
2687 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2688 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2689 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2690 (overlay_touches_p, overlay_strings, Foverlay_put)
2691 (report_overlay_modification, call_overlay_mod_hooks):
2692 (mmap_enlarge, mmap_set_vars):
2693 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2694 Use bool for booleans, instead of int.
2695 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2696 since the 1-or-0 return value is always ignored anyway.
2697 (mmap_initialized_p):
2698 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2699 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2700
2cc21167
PE
27012012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2702
2703 * bidi.c: Use bool for boolean.
2704 This is a bit more readable, and makes the text segment of bidi.o
2705 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2706 Presumably it's faster too.
2707 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2708 Now bool.
2709 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2710 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2711 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2712 (bidi_explicit_dir_char, bidi_level_of_next_char)
2713 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2714 Use bool for booleans, instead of int.
2715 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2716 (bidi_unshelve_cache): Adjust decls to match code.
2717
7db4ddf4
MR
27182012-08-23 Martin Rudalics <rudalics@gmx.at>
2719
2720 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2721 argument.
2722
b1bb8011
PE
27232012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2724
2725 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2726 * atimer.h: Include <stdbool.h>.
2727
ff687885
DN
27282012-08-22 Dan Nicolaescu <dann@gnu.org>
2729
2730 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2731 compile time tests instead of run time tests on systems that do
2732 not use them.
2733 (FRAME_MAC_P): Remove leftover from deleted code.
2734 * frame.c (syms_of_frame): Remove leftover from deleted code.
2735
4ce7a138
JD
27362012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2737
2738 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2739
d733ec6d
PE
27402012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2741
2742 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2743 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2744 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2745 (fontset_add): Return void, for FONTSET_ADD.
2746
d0d2d26f
PE
27472012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2748
fce31d69
PE
2749 * alloc.c: Use bool for booleans.
2750 (gc_in_progress, abort_on_gc)
2751 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2752 (dont_register_blocks) [GC_MALLOC_CHECK]:
2753 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2754 (check_string_bytes, make_specified_string, memory_full)
2755 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2756 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2757 (mark_stack, valid_pointer_p, make_pure_string)
2758 (Fgarbage_collect, survives_gc_p, gc_sweep):
2759 Use bool for booleans, instead of int.
2760 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2761 Remove unused local.
2762 * alloc.c (PURE_POINTER_P):
2763 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2764 * editfns.c (Fformat):
2765 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2766 (Fdo_auto_save):
2767 * fns.c (sweep_weak_table):
2768 * lisp.h (suppress_checking, push_message, survives_gc_p)
2769 (make_pure_string, gc_in_progress, abort_on_gc):
2770 * lread.c (readchar, read1):
2771 * print.c (Fprin1_to_string):
2772 * xdisp.c (push_message):
2773 Use bool for booleans affected directly or indirectly by
2774 alloc.c's changes.
2775
d0d2d26f
PE
2776 Make recently-introduced setters macros.
2777 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2778 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2779 (set_fontset_default, set_fontset_fallback): Rename from their
2780 upper-case counterparts, and make them functions rather than macros.
2781 This is more consistent with the other recently-introduced setters.
2782 These don't need to be inline, since they're local.
2783
d18e2bb6
JD
27842012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2785
2786 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2787 the loop (Bug#12247).
2788
1b9d9d16
PE
27892012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2790
2791 * lisp.h (vcopy): Use memcpy rather than our own loop.
2792 This fixes a performance regression introduced by the recent
2793 addition of vcopy. This means 'vcopy' will need to be modified
2794 for a copying collector, but that's OK. Also, tighten the
2795 checking in the assertion.
2796
b2f09701
EZ
27972012-08-21 Eli Zaretskii <eliz@gnu.org>
2798
2799 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2800 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2801 non-base glyph for the width of the base character, according to
e1f29348
BR
2802 what x_draw_composite_glyph_string_foreground expects.
2803 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2804 expectations, to produce correct width of the composed character.
2805 Reverse the sign of the DU offset produced by ScriptPlace.
2806
9b994fed
PE
28072012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2808
2809 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2810
086ca913
DA
28112012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2812
2813 Avoid direct writes to contents member of struct Lisp_Vector.
2814 * lisp.h (vcopy): New function to copy data into vector.
2815 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2816 * fns.c (Ffillarray): Use ASET.
2817 * keyboard.c (timer_check_2): Use AREF and ASET.
2818 (append_tool_bar_item, Frecent_keys): Use vcopy.
2819 * lread.c (read_vector): Use ASET.
2820 * msdos.c (Frecent_doskeys): Use vcopy.
2821 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2822 (Finternal_merge_in_global_face): Use ASET and vcopy.
2823 * xfont.c (xfont_list_pattern): Likewise.
2824
5481664a
MR
28252012-08-21 Martin Rudalics <rudalics@gmx.at>
2826
2827 * window.c (Fwindow_point): For the selected window always return
2828 the position of its buffer's point.
2829 (Fset_window_point): For the selected window always go in its
2830 buffer to the specified position.
2831
6d470bdd
DA
28322012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2833
2834 Setter macros for fontsets.
2835 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2836 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2837 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2838 Adjust users.
2839
24564fe1
GM
28402012-08-20 Glenn Morris <rgm@gnu.org>
2841
2842 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2843 Don't assume that `ln -f' works.
2844
0a05a035
EZ
28452012-08-20 Eli Zaretskii <eliz@gnu.org>
2846
2847 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2848 and later about non-assignments with no effect. See discussion at
2849 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2850 details.
2851
e46f2325
DA
28522012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2853
2854 Inline setter functions for Lisp_Objects slots of struct specbinding.
2855 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2856 Adjust users.
2857
734fbd86
MR
28582012-08-20 Martin Rudalics <rudalics@gmx.at>
2859
2860 * window.c (select_window): Always make selected window's buffer
2861 current.
2862
f1a95992
DA
28632012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2864
2865 Use AREF and ASET for docstrings of category tables.
2866 * category.h (CATEGORY_DOCSTRING): Use AREF.
2867 (SET_CATEGORY_DOCSTRING): Use ASET.
2868 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2869
e83064be
DA
28702012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2871
2872 Inline setter functions for hash table members.
2873 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2874 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2875 (set_hash_key_and_value, set_hash_index, set_hash_next)
2876 (set_hash_hash): New functions.
2877 * charset.c, fns.c: Adjust users.
2878
4ce60d2e
DA
28792012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2880
2881 Inline getter and setter functions for per-buffer values.
2882 * buffer.h (per_buffer_default, set_per_buffer_default)
2883 (per_buffer_value, set_per_buffer_value): New functions.
2884 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2885 * buffer.c, data.c: Adjust users.
2886
c06c9690
JB
28872012-08-20 Juanma Barranquero <lekktu@gmail.com>
2888
2889 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2890
32bd4250
PE
28912012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2892
bad03192 2893 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2894 as gnulib does this if the system doesn't.
2895 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2896 Remove declaration. MS-Windows declares it on stdlib.h which is
2897 included by conf_post.h.
b69a6d22
PE
2898 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2899 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2900 * vm-limit.c: Include <unistd.h>, for 'environ'.
2901
22d7feb2
PE
2902 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2903 (start_of_data): Remove decl; mem-limits.h provides it.
2904
32bd4250
PE
2905 * xdisp.c (handle_invisible_prop): Make it a bit faster
2906 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2907
450809af
CY
29082012-08-19 Chong Yidong <cyd@gnu.org>
2909
2910 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2911 ends (Bug#3874).
2912
9e677988
AS
29132012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2914
6b1319ce
AS
2915 * .gdbinit: Use call instead of set when calling a function in the
2916 inferior.
2917
9e677988
AS
2918 * data.c (set_internal): Don't use set_blv_found.
2919 (Fkill_local_variable): Likewise.
2920
d7191076
AA
29212012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2922
2923 * nsfont.m (ns_ascii_average_width): Ensure the string
2924 ascii_printable is initialized with a null-terminated character
2925 array. Otherwise, it can contain undesired extra characters.
2926
e757f1c6
PE
29272012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2928
2929 port new setting code to Sun C 5.8 2005/10/13
2930 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2931 Return void, not Lisp_Object. Otherwise, the compiler
2932 complains about (A?B:C) where B is void and C is Lisp_Object
2933 when compiling CHAR_TABLE_SET, due to the recent change to
2934 the API of sub_char_table_set_contents.
2935
a999ce26
CY
29362012-08-18 Chong Yidong <cyd@gnu.org>
2937
2938 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2939 for the string case (Bug#3874).
2940
3f22b86f
PE
29412012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2942
39eb03f1
PE
2943 * buffer.h (BSET): Remove (Bug#12215).
2944 Replace all uses with calls to new setter functions.
2945 (bset_bidi_paragraph_direction, bset_case_canon_table)
2946 (bset_case_eqv_table, bset_directory, bset_display_count)
2947 (bset_display_time, bset_downcase_table)
2948 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2949 (bset_last_selected_window, bset_local_var_alist)
2950 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2951 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2952 (bset_width_table):
2953 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2954 (bset_auto_fill_function, bset_auto_save_file_format)
2955 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2956 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2957 (bset_cache_long_line_scans, bset_case_fold_search)
2958 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2959 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2960 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2961 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2962 (bset_header_line_format, bset_indicate_buffer_boundaries)
2963 (bset_indicate_empty_lines, bset_invisibility_spec)
2964 (bset_left_fringe_width, bset_major_mode, bset_mark)
2965 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2966 (bset_name, bset_overwrite_mode, bset_pt_marker)
2967 (bset_right_fringe_width, bset_save_length)
2968 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2969 (bset_scroll_up_aggressively, bset_selective_display)
2970 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2971 (bset_word_wrap, bset_zv_marker):
2972 * category.c (bset_category_table):
2973 * syntax.c (bset_syntax_table):
2974 New setter functions.
2975
6a09a33b
PE
2976 * process.h (PSET): Remove (Bug#12215).
2977 Replace all uses with calls to new setter functions.
2978 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2979 (PROCESS_INLINE): New macro.
2980 (pset_childp): New setter function.
2981 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2982 * process.c (PROCESS_INLINE):
2983 Define to EXTERN_INLINE, so that the corresponding functions
2984 are compiled into code.
2985 (pset_buffer, pset_command, pset_decode_coding_system)
2986 (pset_decoding_buf, pset_encode_coding_system)
2987 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2988 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2989 (pset_type, pset_write_queue): New setter functions.
2990
e8c17b81
PE
2991 * window.h (WSET): Remove (Bug#12215).
2992 Replace all uses with calls to new setter functions.
2993 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2994 (WINDOW_INLINE): New macro.
2995 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2996 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2997 (wset_total_lines, wset_vertical_scroll_bar)
2998 (wset_window_end_pos, wset_window_end_valid)
2999 (wset_window_end_vpos): New setter functions.
3000 * window.c (WINDOW_INLINE):
3001 Define to EXTERN_INLINE, so that the corresponding functions
3002 are compiled into code.
3003 (wset_combination_limit, wset_dedicated, wset_display_table)
3004 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3005 (wset_new_normal, wset_new_total, wset_next_buffers)
3006 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3007 (wset_prev_buffers, wset_right_fringe_width)
3008 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3009 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3010 (wset_window_parameters):
3011 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3012 (wset_column_number_displayed, wset_region_showing):
3013 New setter functions.
3014
3f22b86f
PE
3015 * termhooks.h (TSET): Remove (Bug#12215).
3016 Replace all uses with calls to new setter functions.
3017 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3018 (TERMHOOKS_INLINE): New macro.
3019 (tset_charset_list, tset_selection_alist): New setter functions.
3020 * terminal.c (TERMHOOKS_INLINE):
3021 Define to EXTERN_INLINE, so that the corresponding functions
3022 are compiled into code.
3023 (tset_param_alist): New setter function.
3024
742af32f
PE
30252012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3026
15dbb4d6
PE
3027 * keyboard.h (KSET): Remove (Bug#12215).
3028 Replace all uses with calls to new setter functions.
3029 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3030 (KEYBOARD_INLINE): New macro.
3031 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3032 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3033 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3034 New setter functions.
3035 * keyboard.c (KEYBOARD_INLINE):
3036 Define to EXTERN_INLINE, so that the corresponding functions
3037 are compiled into code.
3038 (kset_echo_string, kset_kbd_queue)
3039 (kset_keyboard_translate_table, kset_last_prefix_arg)
3040 (kset_last_repeatable_command, kset_local_function_key_map)
3041 (kset_overriding_terminal_local_map, kset_real_last_command)
3042 (kset_system_key_syms): New setter functions.
3043
f00af5b1
PE
3044 * frame.h (FSET): Remove (Bug#12215).
3045 Replace all uses with calls to new setter functions.
3046 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3047 (FRAME_INLINE): New macro.
3048 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3049 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3050 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3051 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3052 (fset_param_alist, fset_root_window, fset_scroll_bars)
3053 (fset_selected_window, fset_title, fset_tool_bar_items)
3054 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3055 * frame.c (FRAME_INLINE):
3056 Define to EXTERN_INLINE, so that the corresponding functions
3057 are compiled into code.
3058 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3059
0c94c8d6
PE
3060 A few more naming-convention fixes for getters and setters.
3061 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3062 and rename from buffer_overlays_set_before.
3063 (set_buffer_overlays_after): Move here from buffer.h, and rename
3064 from buffer_overlays_set_after.
3065 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3066 All uses changed.
3067 (set_buffer_intervals): Rename from buffer_set_intervals.
3068 * intervals.c (set_interval_object): Move here from intervals.h,
3069 and rename from interval_set_object.
3070 (set_interval_left): Move here from intervals.h, and rename from
3071 interval_set_left.
3072 (set_interval_right): Move here from intervals.h, and rename from
3073 interval_set_right.
3074 (copy_interval_parent): Move here from intervals.h, and rename from
3075 interval_copy_parent.
3076 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3077 (set_interval_plist): Rename from interval_set_plist.
3078 Return void, not Lisp_Object, since no caller uses the result.
3079 * lisp.h (string_intervals): Rename from string_get_intervals.
3080 (set_string_intervals): Rename from string_set_intervals.
3081
34dabdb7
PE
3082 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3083 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 3084 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
3085 All uses changed. See the end of
3086 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3087
742af32f
PE
3088 * lisp.h (CSET): Remove (Bug#12215).
3089 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3090 (set_char_table_purpose): New functions,
3091 replacing CSET. All uses changed. For example, replace
3092 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 3093 "set_char_table_parent (char_table, parent);".
742af32f
PE
3094 The old version was confusing because it used the same name
3095 'parent' for two different things.
3096
a04e2c62
DA
30972012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3098
3099 Functions to get and set Lisp_Object fields of buffer-local variables.
3100 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3101 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3102 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3103 * data.c, eval.c, frame.c: Adjust users.
3104
383dcbf9
CY
31052012-08-17 Chong Yidong <cyd@gnu.org>
3106
3107 * xfaces.c (merge_face_vectors): If the target font specfies a
3108 font spec, make the font's attributes take precedence over
3109 directly-specified attributes.
3110 (merge_face_ref): Recognize :font.
3111
44386687
DA
31122012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3113
3114 Do not use memcpy for copying intervals.
3115 * intervals.c (reproduce_interval): New function.
3116 (reproduce_tree, reproduce_tree_obj): Use it.
3117 (reproduce_tree_obj): Remove prototype.
3118
927c7216
PE
31192012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3120
3121 * lisp.h (duration_to_sec_usec): Remove unused decl.
3122
93044f7b
AA
31232012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3124
3125 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3126 to an allocated instance of NSString, not to the class itself.
3127
9851e4a5
JB
31282012-08-17 Juanma Barranquero <lekktu@gmail.com>
3129
3130 * makefile.w32-in (C_CTYPE_H): New macro.
3131 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3132 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3133 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3134
620f13b0
PE
31352012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3136
3137 Use ASCII tests for character types.
3138 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3139 * xfns.c, xterm.c:
3140 Don't include <ctype.h>; was not needed.
3141 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3142 * sysdep.c, xfaces.c:
3143 Include <c-ctype.h> instead of <ctype.h>.
3144 * nsterm.m: Include <c-ctype.h>.
3145 * charset.c (read_hex):
3146 * doc.c (Fsnarf_documentation):
3147 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3148 (DRIVE_LETTER) [DOS_NT]:
3149 (Ffile_name_directory, Fexpand_file_name)
3150 (Fsubstitute_in_file_name):
3151 * font.c (font_parse_xlfd, font_parse_fcname):
3152 * frame.c (x_set_font_backend):
3153 * gtkutil.c (xg_get_font):
3154 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3155 * nsimage.m (hexchar):
3156 * nsterm.m (ns_xlfd_to_fontname):
3157 * sysdep.c (system_process_attributes):
3158 * xfaces.c (hash_string_case_insensitive):
3159 Use C-locale tests instead of locale-specific tests for character
3160 types, since we want the ASCII interpretation here, not the
3161 interpretation suitable for whatever happens to be the current locale.
3162
52162052
MR
31632012-08-16 Martin Rudalics <rudalics@gmx.at>
3164
3165 Consistently check windows for validity/liveness
3166 (Bug#11984, Bug#12025, Bug#12026).
3167 * lisp.h (CHECK_VALID_WINDOW): New macro.
3168 * window.c (decode_window): Rename to decode_live_window.
3169 (decode_valid_window, Fwindow_valid_p): New functions.
3170 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3171 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3172 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3173 (Fwindow_prev_sibling, Fwindow_combination_limit)
3174 (Fset_window_combination_limit, Fwindow_use_time)
3175 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3176 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3177 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3178 (Fwindow_hscroll, Fset_window_hscroll)
3179 (Fwindow_redisplay_end_trigger)
3180 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3181 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3182 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3183 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3184 (Fwindow_end, Fset_window_point, Fset_window_start)
3185 (Fpos_visible_in_window_p, Fwindow_line_height)
3186 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3187 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3188 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3189 (Fset_window_parameter, Fwindow_display_table)
3190 (Fset_window_display_table, Fdelete_other_windows_internal)
3191 (Fset_window_buffer, Fset_window_new_total)
3192 (Fset_window_new_normal, Fdelete_window_internal)
3193 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3194 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3195 (Fwindow_scroll_bars): Check whether argument window is a valid or
3196 live window. Update doc-strings.
3197 (syms_of_window): New symbol Qwindow_valid_p.
3198 * keyboard.c (Fposn_at_x_y): Check whether argument
3199 frame_or_window denotes a valid window.
3200
2751c80f
DA
32012012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3202
3203 Fix previous char table change.
3204 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3205 * chartab.c (optimize_sub_char_table): Likewise.
3206
032a42c8
CY
32072012-08-16 Chong Yidong <cyd@gnu.org>
3208
a2d19368
CY
3209 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3210
032a42c8
CY
3211 * xfont.c (xfont_open):
3212 * xftfont.c (xftfont_open): Set the font's max_width field.
3213
3214 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3215 min_width to space_width and average_width to the average over
3216 printable ASCII characters.
3217 (ns_char_width): Code cleanup.
3218 (ns_ascii_average_width): New utility function.
3219
3220 * font.h (struct font): Update comments.
3221
a098c930
DA
32222012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3223
032a42c8 3224 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
3225 * lisp.h (CSET): New macro.
3226 (char_table_set_extras, char_table_set_contents)
3227 (sub_char_table_set_contents): New function.
3228 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3229 * syntax.c: Adjust users.
3230
8be3a09c
SM
32312012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3232
3233 * eval.c (eval_sub): Bind lexical-binding.
3234 * lread.c (Qlexical_binding): Make non-static.
3235
ac4845a6
JD
32362012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3237
ddee6515
JD
3238 * nsmenu.m (popupSession): Remove.
3239 (pop_down_menu): Remove endModalSession.
3240 (timeout_handler:): New method.
3241 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3242 Call runModalForWindow. Check timer_fired when it returns.
3243 If not set, cancel timer and break out of loop.
3244 Otherwise loop again, with a new timeout.
3245
3246 * nsterm.m: Include fcntl.h if present.
3247 (fd_entry, t_readfds, inNsSelect): Remove.
3248 (select_writefds, select_valid, select_timeout, selfds)
3249 (select_mutex, apploopnr): Add.
3250 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3251 Otherwise call kbd_buffer_store_event.
3252 (ns_send_appdefined): Remove release of fd_entry.
3253 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3254 Increment and decrement apploopnr.
3255 (ns_select): If no file descriptors, just do a NSTimer.
3256 Otherwise copy read/write masks and start select thread (fd_handler).
3257 Start main loop and wait for application defined event.
3258 Inform select thread to stop selecting after main loop is exited.
3259 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 3260 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
3261 (fd_handler:): Loop forever, wait for info from the main thread
3262 to either start or stop selecting. When select returns, send
3263 and appdefined event.
3264 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3265 If not call kbd_buffer_store_event.
3266
3267 * nsterm.h (EmacsApp): fd_handler takes id argument.
3268 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3269
ac4845a6
JD
3270 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3271
eb424fe3
EZ
32722012-08-15 Eli Zaretskii <eliz@gnu.org>
3273
3274 * region-cache.c (move_cache_gap): Update gap_len using the actual
3275 growth of the boundaries array. Do not change cache_len.
3276 (Bug#12196)
3277
4e6a86c6
DA
32782012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3279
3280 Generalize and cleanup font subsystem checks.
3281 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
3282 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3283 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 3284
5bf192ca
DA
32852012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3286
3287 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3288
f2045622
CY
32892012-08-15 Chong Yidong <cyd@gnu.org>
3290
8be3a09c
SM
3291 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3292 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3293 extract the font descriptor instead of just the font name.
3294 In that case, return a font spec instead of a string.
f2045622
CY
3295 (x_last_font_name): Move to this file from xfns.c.
3296
3297 * xfns.c (Fx_select_font): The return value can also be a font
3298 spec. Move x_last_font_name management to gtkutil.c.
3299
3300 * xfaces.c: Make font weight and style symbols non-static.
3301
7f6feb56
SM
33022012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3303
3304 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3305 (bug#12117).
3306
fecbd8ff
SM
33072012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3308
3309 * alloc.c (Fgarbage_collect): Use plural form consistently.
3310
9b8d5165
EZ
33112012-08-14 Eli Zaretskii <eliz@gnu.org>
3312
3313 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3314 iteration through the command loop. Fixes a problem whereby mouse
3315 movements are ignored until the first mouse click.
3316
f5d9e83a
PE
33172012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3318
3319 Use bool, not int, for Lisp booleans.
3320 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3321 makes Emacs a bit smaller and presumably a bit faster.
3322 * lisp.h: Include <stdbool.h>.
3323 (struct Lisp_Boolfwd, defvar_bool):
3324 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3325 * regex.c [!emacs]: Include <stdbool.h>.
3326 (false, true): Remove; <stdbool.h> does this for us now.
3327
55802e4a
CY
33282012-08-14 Chong Yidong <cyd@gnu.org>
3329
4abcdac8
CY
3330 * character.c (Fcharacterp): Doc fix (Bug#12076).
3331
3332 * data.c (Findirect_variable): Doc fix (Bug#11040).
3333
55802e4a
CY
3334 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3335
3336 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 3337 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 3338
8e99d072
BR
33392012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3340
3341 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3342 (bug#12022).
3343
08908aca
MR
33442012-08-14 Martin Rudalics <rudalics@gmx.at>
3345
3346 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3347 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3348 * minibuf.c (choose_minibuf_frame, read_minibuf):
3349 * w32fns.c (x_create_tip_frame):
3350 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3351 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3352
56120d6f
PE
33532012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3354
3355 * intervals.c (offset_intervals): Remove obsolete comment.
3356
67b77c0b
AS
33572012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3358
3359 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3360
f48b82fd
GR
33612012-08-14 Gergely Risko <gergely@risko.hu>
3362
3363 * coding.c (decode_coding): Record buffer modification before
3364 disabling undo_list (Bug#11773).
3365
fd318b54
DA
33662012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3367
3368 Revert and cleanup some recent overlay changes.
3369 * buffer.h (enum overlay_type): Remove.
3370 (buffer_get_overlays, buffer_set_overlays): Likewise.
3371 (buffer_set_overlays_before, buffer_set_overlays_after):
3372 New function. Adjust users.
3373 (unchain_both): Add eassert.
3374
41a62dd9
DA
33752012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3376
3377 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3378
5884c324
PE
33792012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3380
3381 * gtkutil.c (xg_mark_data): Don't assume C99.
3382
ca06f160
JD
33832012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3384
3385 * gtkutil.c (xg_frame_tb_info): New struct.
3386 (TB_INFO_KEY): New define.
3387 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3388 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3389 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3390 if not present.
3391 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 3392 is up to date. Otherwise store new data.
ca06f160
JD
3393 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3394
7864a3f7
DA
33952012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3396
3397 Use KSET for write access to Lisp_Object members of struct kboard.
3398 * keyboard.h (KSET): New macro.
3399 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3400 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3401 * xterm.c: Adjust users.
3402
4c31be61
DA
34032012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3404
3405 Use BSET for write access to Lisp_Object members of struct buffer.
3406 * buffer.h (BSET): New macro.
3407 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3408 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3409 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3410 * window.c, xdisp.c, xfns.c: Adjust users.
3411
14ae4239
BT
34122012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3413
3414 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3415
32bcadb4
JD
34162012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3417
3d29b2ce 3418 * nsterm.m (not_in_argv): New function.
fc0c31f8 3419 (application:openFile, application:openTempFile:):
3d29b2ce
JD
3420 (application:openFileWithoutUI:, application:openFiles:): Open file
3421 if not_in_argv returns non-zero (bug#12171).
3422
32bcadb4 3423 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
3424 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3425 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
3426 (xg_get_font_name): Use those functions/macros here.
3427 Reported by Frans Oilinki <moilinki@gmail.com>.
3428
9ff9402d 34292012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
3430
3431 * unexmacosx.c (copy_data_segment): Copy initialized data in
3432 statically linked libraries from input file rather than memory.
3433
db74a5fc
YM
3434 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3435 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3436 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3437
25e65510
GM
34382012-08-10 Glenn Morris <rgm@gnu.org>
3439
3440 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3441 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3442
7961135c
DA
34432012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3444
3445 Fix last change to allow compilation with low optimization levels.
3446 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3447 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3448
42b3a444
DA
34492012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3450
3451 Use common inline syntax in intervals.h.
3452 * intervals.h (INTERVALS_INLINE): New macro.
3453 Change all users from LISP_INLINE.
3454
9fb0c957
DA
34552012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3456
3457 Define Qnone once for all platforms.
3458 * frame.c (Qnone): Define here.
3459 (syms_of_frame): DEFSYM it.
3460 * lisp.h (Qnone): New declaration.
3461 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3462 * xfns.c: Remove duplication. Adjust users.
3463
65e8ee52
DA
34642012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3465
3466 Remove unused macros from intervals.h.
3467 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3468 * intervals.c: Adjust comment.
3469
9b855fd6
EZ
34702012-08-10 Eli Zaretskii <eliz@gnu.org>
3471
3472 * w32fns.c <w32_unicode_gui>: New static variable.
3473 (globals_of_w32fns): Initialize it according to os_subtype.
3474 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3475 testing os_subtype.
3476
39cb9e56 34772012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
3478 Eli Zaretskii <eliz@gnu.org>
3479
3480 Fix bug #10299 with Unicode characters sent by customized
3481 keyboards created by MSKLC.
3482 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3483 (w32_init_class): Use it to initialize the Emacs class with either
3484 ANSI or Unicode API calls.
3485 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3486 later.
3487 (w32_wnd_proc): If the character code sent by WM_CHAR or
3488 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3489 original message. Call DefWindowProcW on NT and later.
3490
9374581a
GM
34912012-08-10 Glenn Morris <rgm@gnu.org>
3492
4b94e8cf
GM
3493 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3494
9374581a
GM
3495 * lisp.h (DIRECTORY_SEP): Let configure set it.
3496
a2752828
DA
34972012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3498
3499 Use TSET for write access to Lisp_Object slots of struct terminal.
3500 * termhooks.h (TSET): New macro.
3501 * coding.c, terminal.c, xselect.c: Adjust users.
3502
cc92c454
SM
35032012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3504
3505 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3506 the failing expression, include them in the error message.
3507 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3508 * lisp.h (internal_condition_case_n): Update declaration.
3509
4cb3e6b3
DA
35102012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3511
3512 Inline functions to examine and change buffer overlays.
3513 * buffer.c (unchain_both): New function.
3514 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3515 (buffer_has_overlays): New function.
3516 (enum overlay_type): New enum.
3517 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3518 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3519
8707c1e5
DA
35202012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3521
3522 Inline functions to examine and change buffer intervals.
3523 * alloc.c (mark_interval_tree): Remove.
3524 (MARK_INTERVAL_TREE): Simplify.
3525 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3526 * intervals.c (buffer_balance_intervals): New function.
3527 (graft_intervals_into_buffer): Adjust indentation.
3528 (set_intervals_multibyte): Simplify.
3529 * buffer.h (BUF_INTERVALS): Remove.
3530 (buffer_get_intervals, buffer_set_intervals): New function.
3531 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3532 * intervals.c, textprop.c: Adjust users.
3533
ad8c997f
DA
35342012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3535
3536 Inline functions to examine and change string intervals.
3537 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3538 (string_get_intervals, string_set_intervals): New function.
3539 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3540 * lread.c, print.c, textprop.c: Adjust users.
3541
32ac3a6b
GM
35422012-08-08 Glenn Morris <rgm@gnu.org>
3543
3544 * lisp.mk (lisp): Remove language/persian.elc.
3545
77c7bcb1
DA
35462012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3547
3548 Cleanup intervals.
3549 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3550 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
3551 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3552 Adjust comment. Move under #if 0.
77c7bcb1
DA
3553 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3554 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3555
9c08a8d4
DA
35562012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3557
3558 Check total length of intervals with eassert.
3559 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3560 * intervals.c: Change all users to eassert.
3561
26d16b35
EZ
35622012-08-07 Eli Zaretskii <eliz@gnu.org>
3563
14ae4239
BT
3564 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3565 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
3566 INTERNAL_FIELD in Lisp_Cons.
3567
c644523b
DA
35682012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3569
3570 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3571 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3572 name since all xname users are fixed long time ago. Do not
3573 use INTERNAL_FIELD.
3574 (set_symbol_name, set_symbol_function, set_symbol_plist):
3575 (set_symbol_next, set_overlay_plist): New function.
3576 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3577 (struct Lisp_Overlay): Likewise.
3578 (CVAR, MVAR, SVAR): Remove.
3579 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3580 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3581 * xterm.c: Adjust users.
3582 * .gdbinit: Change to use name field of struct Lisp_Symbol
3583 where appropriate.
3584
6a3d20cc
DA
35852012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3586
3587 Basic functions to set Lisp_Object and pointer slots of intervals.
3588 * intervals.h (interval_set_parent, interval_set_object):
3589 (interval_set_left, interval_set_right, interval_set_plist):
3590 (interval_copy_parent): New function.
3591 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
3592 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3593 Adjust indentation.
6a3d20cc
DA
3594 (INTERVAL_SIZE): Remove. Adjust users.
3595 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3596
4d2b044c
DA
35972012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3598
3599 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3600 * process.h (PGET): Remove.
3601 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3602 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3603
d3d50620
DA
36042012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3605
3606 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3607 * window.h (WGET): Remove.
3608 (struct window): Do not use INTERNAL_FIELD.
3609 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3610 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3611 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3612 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3613 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3614 Adjust users.
3615
d10a51dc
CY
36162012-08-07 Chong Yidong <cyd@gnu.org>
3617
3618 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3619 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3620 (Fdelete_window_internal): Signal an error if the window is not on
3621 a live frame (Bug#12025).
3622
e69b0960
DA
36232012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3624
3625 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3626 * frame.h (FGET): Remove.
3627 (struct frame): Do not use INTERNAL_FIELD.
3628 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3629 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3630 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3631 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3632
25a20a3a
JB
36332012-08-06 Juanma Barranquero <lekktu@gmail.com>
3634
3635 * w32.c: Silence compiler warnings.
3636 (map_w32_filename): Remove unused variable `is_fat'.
3637 (chase_symlinks): Add parentheses around expression.
3638
1c6f11f4
GM
36392012-08-06 Glenn Morris <rgm@gnu.org>
3640
1db4583a
GM
3641 * sysdep.c: Respect BROKEN_GETWD.
3642
1c6f11f4
GM
3643 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3644 Let configure handle it.
3645 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3646
2b90362b
DA
36472012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3648
3649 Use GCALIGNMENT where appropriate.
3650 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3651 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3652 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3653
5f50daf2
EZ
36542012-08-06 Eli Zaretskii <eliz@gnu.org>
3655
14ae4239
BT
3656 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3657 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3658
cbcc7007
SM
36592012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3660
3661 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3662 that should be sufficient for everyone.
3663
4d365fa4
JD
36642012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3665
3666 * keyboard.c (timer_check_2): Add break so timer_check returns next
3667 timeout.
3668
dd86bd82
DA
36692012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3670
3671 Fix Windows build errors introduced after converting to WGET and WSET.
3672 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3673 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3674
054e1668
JD
36752012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3676
3677 * nsterm.m (ns_frame_rehighlight): Use FSET.
3678
3679 * nsmenu.m (ns_update_menubar): Use FSET.
3680
21238f11
DA
36812012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3682
3683 Separate read and write access to Lisp_Object slots of Lisp_Process.
3684 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3685 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3686
077288cf
DA
36872012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3688
3689 Separate read and write access to Lisp_Object slots of struct window.
3690 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3691 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3692 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3693 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3694 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3695 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3696 Adjust users.
3697
71688bd7
DA
36982012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3699
3700 Fix Windows build errors introduced after converting to FGET and FSET.
3701 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3702 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3703 (w32_judge_scroll_bars): Change to use FSET.
3704 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3705
f99bac93
DA
37062012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3707
3708 Fix replacement typo.
3709 * window.c (replace_window): Set root_window instead of
3710 selected_window. This fixes a total window subsystem
3711 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3712
8c2a0f2d
GM
37132012-08-06 Glenn Morris <rgm@gnu.org>
3714
3715 * lisp.mk (lisp): Add language/persian.elc.
3716
edd74c35
DA
37172012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3718
3719 Separate read and write access to Lisp_Object slots of struct frame.
3720 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3721 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3722 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3723 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3724 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3725
8671676c
AS
37262012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3727
3728 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3729
663e2b3f
DA
37302012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3731
3732 Generalize common compile-time constants.
3733 * lisp.h (header_size, bool_header_size, word_size): Now here.
3734 (struct Lisp_Vector): Add comment.
3735 (struct Lisp_Bool_Vector): Move up to define handy constants.
3736 (VECSIZE, PSEUDOVECSIZE): Simplify.
3737 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3738 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3739 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3740 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3741 * xfont.c, xmenu.c: Use word_size where appropriate.
3742
d32e47af
LM
37432012-08-05 Lawrence Mitchell <wence@gmx.li>
3744
3745 * search.c (Freplace_match): Treat \? in the replacement text
3746 literally (Bug#8161).
3747
e5d9c0d1
CY
37482012-08-05 Chong Yidong <cyd@gnu.org>
3749
3750 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3751 * frame.c (Vdelete_frame_functions):
3752 * emacs.c (Vkill_emacs_hook): Doc fix.
3753
8da0576b
EZ
37542012-08-04 Eli Zaretskii <eliz@gnu.org>
3755
3756 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3757 --with-x-toolkit=no builds.
3758 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3759
02676e5d
CY
37602012-08-04 Chong Yidong <cyd@gnu.org>
3761
3762 * syntax.c (Fmodify_syntax_entry): Doc fix.
3763
97147da9
EZ
37642012-08-04 Eli Zaretskii <eliz@gnu.org>
3765
76151e2c
EZ
3766 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3767 * w32.c (init_environment): Change the default values of many
3768 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3769 them into environment when they were not already defined.
3770 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3771 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3772 (check_windows_init_file): Now external, not static.
3773 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3774 called when Vload_path is already set up.
3775
3776 * w32.h (check_windows_init_file): Add prototype.
3777
3778 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3779 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3780 compatibility with Posix platforms.
3781 (main): Move the call to check_windows_init_file to here from
3782 w32.c.
3783 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3784 any, in the DEFALT argument into the root of the Emacs build or
3785 installation tree, as appropriate.
3786
3787 * callproc.c (init_callproc_1): Call decode_env_path instead of
3788 doing its equivalent by hand.
3789 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3790 the code that sets Vexec_path run on MS-Windows.
3791
3792 * lread.c (init_lread): Add comments to #ifdef's.
3793
97147da9
EZ
3794 * msdos.c (dos_set_window_size, IT_update_begin)
3795 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3796 instead of direct references.
3797
185ee146
PE
37982012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3799
3800 Export DEFAULT_REHASH_* to GDB.
3801 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3802 Now constants, not macros.
3803
8834c57a
PE
38042012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3805
98c6f1e3
PE
3806 Remove unnecessary casts involving pointers.
3807 These casts are no longer needed now that we assume C89 or later,
3808 since they involve casting to or from void *.
3809 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3810 (make_pure_float, make_pure_vector):
3811 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3812 * macros.c (Fstart_kbd_macro):
3813 * menu.c (find_and_return_menu_selection):
3814 * minibuf.c (read_minibuf_noninteractive):
3815 * sysdep.c (closedir):
3816 * xdisp.c (x_produce_glyphs):
3817 * xfaces.c (compare_fonts_by_sort_order):
3818 * xfns.c (x_real_positions, select_visual):
3819 * xselect.c (x_stop_queuing_selection_requests)
3820 (x_get_window_property, x_get_window_property_as_lisp_data):
3821 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3822 Remove unnecessary pointer casts.
3823 * alloc.c (record_xmalloc): New function.
3824 * lisp.h (record_xmalloc): New decl.
3825 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3826 more like a function. This is because the pointer cast is not
3827 needed. All uses changed.
3828 * print.c (print_string, print_error_message): Avoid length recalc.
3829
8834c57a
PE
3830 Improve fix for macroexp crash with debugging (Bug#12118).
3831 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3832 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3833 not supposed to be invoked from the garbage collector.
3834 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3835 (gc_aset): New function, which is like ASET but can be
3836 used in the garbage collector.
3837 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3838 (set_hash_index): Use it instead of ASET.
3839
6dad7178
EZ
38402012-08-03 Eli Zaretskii <eliz@gnu.org>
3841
3842 Support symlinks on latest versions of MS-Windows.
3843 * w32.c: Include winioctl.h and aclapi.h.
3844 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3845 (revert_to_self): Forward declarations of static functions.
3846 <static BOOL g_b_init_get_security_info>:
3847 <g_b_init_create_symbolic_link>: New static flags.
3848 (globals_of_w32): Initialize them to zero.
3849 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3850 (map_w32_filename): Improve commentary. Simplify switch.
3851 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3852 headers (most versions of MinGW w32api don't).
3853 (get_security_info, create_symbolic_link)
3854 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3855 New functions.
3856 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3857 in the argument file name.
3858 (sys_access): Call unc_volume_file_attributes only if
3859 GetFileAttributes fails with network-related error codes.
3860 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3861 have the required privileges.
14ae4239 3862 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3863 get_file_security_desc.
3864 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3865 with addition of handling of symlinks and support for 'lstat'.
3866 If possible, get file's attributes and security information by
6dad7178
EZ
3867 handle, not by name. Produce S_IFLNK bit for symlinks, when
3868 called from 'lstat'.
3869 (stat, lstat): New functions, call 'stat_worker'.
3870 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3871 symlinks when the underlying filesystem supports them.
3872
f162bcc3
PE
38732012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3874
79ea6c20
PE
3875 Fix macroexp crash on Windows with debugging (Bug#12118).
3876 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3877 checking subscripts; problem introduced with the recent
3878 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3879 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3880 since it's used in non-static inline functions now.
3881
c0ce93fd
PE
3882 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3883 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3884
f162bcc3
PE
3885 Use C99-style 'extern inline' if available.
3886 * buffer.h (BUFFER_INLINE):
3887 * category.h (CATEGORY_INLINE):
3888 * character.h (CHARACTER_INLINE):
3889 * charset.h (CHARSET_INLINE):
3890 * composite.h (COMPOSITE_INLINE):
3891 * dispextern.h (DISPEXTERN_INLINE):
3892 * lisp.h (LISP_INLINE):
3893 * systime.h (SYSTIME_INLINE):
3894 New macro, replacing 'static inline' in this header.
3895 * buffer.h, category.h, character.h, charset.h, composite.h:
3896 * dispextern.h, lisp.h, systime.h:
3897 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3898 * alloc.c (LISP_INLINE):
3899 * buffer.c (BUFFER_INLINE):
3900 * category.c (CATEGORY_INLINE):
3901 * character.c (CHARACTER_INLINE):
3902 * charset.c (CHARSET_INLINE):
3903 * composite.c (COMPOSITE_INLINE):
3904 * dispnew.c (DISPEXTERN_INLINE):
3905 * sysdep.c (SYSTIME_INLINE):
3906 Define to EXTERN_INLINE, so that the corresponding functions
3907 are compiled into code.
3908 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3909 (INLINE_HEADER_END): New macros.
3910 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3911 since it's used in non-static inline functions now.
a8333d03 3912 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3913
837b365b
GM
39142012-08-02 Glenn Morris <rgm@gnu.org>
3915
d66b744d
GM
3916 * s/: Remove empty directory.
3917
837b365b
GM
3918 * s/ms-w32.h: Move to ../nt/inc.
3919 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3920 Update for new ms-w32.h location.
3921
13294f95
PE
39222012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3923
3924 Port to Solaris 8.
3925 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3926
90df0db3
GM
39272012-08-02 Glenn Morris <rgm@gnu.org>
3928
3929 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3930 hard-coding the path separator.
3931
4939150c
PE
39322012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3933
3934 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3935 This how ASET and AREF are supposed to work, and makes
3936 it easier to think about future improvements. See
3937 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3938 * charset.h (set_charset_attr): New function.
3939 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3940 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3941 (aref_addr): New function. All uses of &AREF(...) changed.
3942 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3943 (set_hash_index): New functions. All lvalue-style uses of
3944 HASH_KEY etc. changed.
3945 * keyboard.c (set_prop): New function. All lvalue-style uses
3946 of PROP changed.
3947
947b2afd
AA
39482012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3949
3950 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3951 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3952 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3953 * nsfns.m (ns_set_name_as_filename): Likewise.
3954 * nsmenu.m (ns_update_menubar): Likewise.
3955 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3956
4f5d0325
EZ
39572012-08-01 Eli Zaretskii <eliz@gnu.org>
3958
2008beae
EZ
3959 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3960 Adapt to latest changes in field names of the corresponding Lisp
288479f6 3961 objects.
2008beae 3962
4f5d0325
EZ
3963 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3964
fe3cc771
GM
39652012-08-01 Glenn Morris <rgm@gnu.org>
3966
3967 * s/msdos.h: Remove file.
3968 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3969 * Makefile.in (S_FILE): Remove.
3970 (config_h): Remove S_FILE.
3971
c90acc54
JB
39722012-08-01 Juanma Barranquero <lekktu@gmail.com>
3973
3974 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3975 Remove; moved to nt/config.nt.
3976
d8a05828
DA
39772012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3978
3979 Use INTERNAL_FIELD for conses and overlays.
3980 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3981 Remove obsolete comment.
3982 (MVAR): New macro.
3983 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3984 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3985
8271d590
DA
39862012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3987
3988 Use INTERNAL_FIELD for symbols.
3989 * lisp.h (SVAR): New macro. Adjust users.
3990 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3991 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3992
3193acd2
DA
39932012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3994
3995 Use INTERNAL_FIELD for processes.
3996 * process.h (PVAR): New macro. Adjust style.
3997 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3998 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3999
3a45383a
DA
40002012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4001
4002 Use INTERNAL_FIELD for windows.
4003 * window.h (WVAR): New macro.
4004 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4005 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4006 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4007 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4008 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4009 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4010
c1dbc63c
PE
40112012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4012
4013 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4014
5c0c0e8a
GM
40152012-08-01 Glenn Morris <rgm@gnu.org>
4016
4017 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4018 Move to configure.ac.
4019
552a99b4
JB
40202012-08-01 Juanma Barranquero <lekktu@gmail.com>
4021
4022 * makefile.w32-in (CONFIG_H): Update dependencies.
4023 (CONF_POST_H): New macro.
4024
4025 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4026
8d8e2dfe
GM
40272012-07-31 Glenn Morris <rgm@gnu.org>
4028
bc96620a
GM
4029 * Makefile.in (S_FILE): No longer set by configure.
4030
476b1b2d
GM
4031 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4032 is available.
4033 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4034
b2c7a106
GM
4035 * process.h (NULL_DEVICE):
4036 * emacs.c (SEPCHAR):
4037 * editfns.c (USER_FULL_NAME): Let configure set them.
4038
d53d062a
GM
4039 * s/README, s/template.h: Remove files.
4040
4515017f
GM
4041 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4042
8d8e2dfe
GM
4043 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4044 Move to configure.ac.
4045
5b20b3cc
EZ
40462012-07-31 Eli Zaretskii <eliz@gnu.org>
4047
1e0afd9a
EZ
4048 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4049 resulting renaming of 'struct frame' members.
4050
5b20b3cc
EZ
4051 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4052
4053 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4054 after introduction of FVAR.
4055
f1310128
JD
40562012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4057
79e721e0
JD
4058 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4059
4060 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4061 instead of compositeToPoint.
4062 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4063
8d7c7eed 4064 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 4065
e34f7f79
DA
40662012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4067
4068 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4069 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 4070 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
4071 (BVAR): Change to use INTERNAL_FIELD.
4072 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4073 (KVAR): Change to use INTERNAL_FIELD.
4074 * frame.h (FVAR): New macro.
4075 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
4076 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4077 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4078 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
4079 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4080
c09bfb2f
DA
40812012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4082
4083 Miscellaneous fixes for non-default X toolkits.
4084 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4085 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4086 Move under #ifdef USE_LUCID.
4087 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4088 definition and usage to avoid warnings.
4089
14c114ae
JD
40902012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4091
4092 * nsterm.m (openFiles): Fix previous checkin.
4093
3bd21e82
PE
40942012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4095
4096 * indent.c (compute_motion): Remove unused local.
4097
c1529ded
GM
40982012-07-31 Glenn Morris <rgm@gnu.org>
4099
400d5621
GM
4100 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4101
268e2432
GM
4102 * conf_post.h [USG5_4]:
4103 Move remaining contents of s/usg5-4-common.h here.
4104 * s/usg5-4-common.h: Remove file.
4105
7552f3ee
GM
4106 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4107 * s/irix6-5.h: Remove file.
4108
6a381852
GM
4109 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4110 * s/darwin.h: Remove file.
4111
c1529ded
GM
4112 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4113 * s/hpux10-20.h: Remove file, which is now empty.
4114
b429a4ee
GM
41152012-07-30 Glenn Morris <rgm@gnu.org>
4116
4117 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4118 * Makefile.in (config_h): Add conf_post.h.
4119 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4120
adff3182
JD
41212012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4122
4123 * nsterm.m (ns_do_open_file): New variable.
b9031d69 4124 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
4125 (openFile, openTempFile, openFileWithoutUI, openFiles):
4126 Open files only if ns_do_open_file.
adff3182 4127
c32af1e4
PE
41282012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4129
7393bcbb
PE
4130 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4131 This no-op macro hasn't been needed for many years.
4132 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4133
c32af1e4
PE
4134 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4135 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4136 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4137 gdb_make_enums_visible.
4138 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4139 (DIRECTORY_SEP): Now a constant, not a macro.
4140
302fc036
EZ
41412012-07-30 Eli Zaretskii <eliz@gnu.org>
4142
4143 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4144 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4145
4146 * w32term.c <w32_keyboard_codepage>: Renamed from
4147 keyboard_codepage and now external. All users changed.
4148
4149 * w32term.h: Add declaration of w32_keyboard_codepage.
4150
4151 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4152 the codepage to translate keys to Unicode. If this argument is
4153 -1, use the value returned by GetConsoleCP. All callers changed.
4154
88fb40b4
PE
41552012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4156
0aee6912
PE
4157 Update .PHONY listings in makefiles.
4158 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4159 bootstrap-clean, distclean, maintainer-clean, versioclean,
4160 extraclean, frc.
4161
88fb40b4
PE
4162 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4163 This is a bit clearer. Fix some commentary typos.
4164
0a763bd1
GM
41652012-07-30 Glenn Morris <rgm@gnu.org>
4166
32bac6d6
GM
4167 * s/netbsd.h: Let configure include signal.h if needed.
4168 Remove file, which is now empty.
4169
b65e7c46
GM
4170 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4171 Let configure set them.
4172 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4173 No more need to undefine.
0a763bd1 4174
169304bd
AS
41752012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4176
4177 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4178 non-single-byte char when adding meta modifier. (Bug#12090)
4179
6cd7a139
DA
41802012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4181
4182 Convert safe_call to use variable number of arguments.
4183 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4184 (safe_call2): Fix comment.
4185 * lisp.h (safe_call): Adjust prototype.
4186 * coding.c (encode_coding_object): Change to use safe_call2.
4187 * xfaces.c (merge_face_heights): Change to use safe_call1.
4188
d34d6ffc
GM
41892012-07-30 Glenn Morris <rgm@gnu.org>
4190
7b8a48e4 4191 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 4192 does that unconditionally. Remove file, which is now empty.
7b8a48e4 4193
d34d6ffc
GM
4194 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4195 Remove empty files.
4196
03a660a6
PE
41972012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4198
4199 Export to GDB most of lisp.h's remaining object-like macros.
4200 * lisp.h (min, max): Move earlier, because they're used earlier now.
4201 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4202 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4203 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4204 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4205 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4206 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4207 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4208 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4209 Now constants, for GDB. They need not be macros.
4210 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4211 Now constants, for GDB, as well as macros, for static initializers.
4212 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4213 Move to after the definition of struct Lisp_Char_Table,
4214 since the former now needs that type defined.
4215 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4216 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4217 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4218 New enums, for gdb_make_enums_visible.
4219 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 4220 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
4221 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4222 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4223 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4224 enum maxargs, enum MAX_ALLOCA.
4225 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4226 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4227 no longer needed, now that they are done in lisp.h.
4228
e499d0ee
DA
42292012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4230
4231 Cleanup string bytes checking.
4232 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4233 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4234 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4235 (check_sblock, compact_small_strings): Simplify.
4236
d5040d2d
PE
42372012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4238
4239 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4240 These macros are confusing and no longer need to be defined, as
4241 the enum values now suffice. All uses replaced with definiens.
4242 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4243
7f259ae6
JB
42442012-07-29 Juanma Barranquero <lekktu@gmail.com>
4245
4246 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4247 ($(BLD)/w32console.$(O)): Update dependencies.
4248
7e63e0c3
DA
42492012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4250
4251 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4252 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4253 time. Adjust users.
4254 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4255
ffd817eb
JD
42562012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4257
4258 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4259 setting sitelisp (Bug#12010).
4260
417a7a0e
EZ
42612012-07-29 Eli Zaretskii <eliz@gnu.org>
4262
14ae4239 4263 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
4264
4265 * w32heap.c (cache_system_info):
4266 * w32.c (sys_rename):
4267 * w32proc.c (find_child_console, sys_kill): All users changed.
4268
387d4d92
PE
42692012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4270
4271 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4272
55a6cca6
EZ
42732012-07-29 Eli Zaretskii <eliz@gnu.org>
4274
4275 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4276
dbcf001c
DA
42772012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4278
4279 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
4280 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4281 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 4282
e2688e4a
DA
42832012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4284
4285 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4286 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4287 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4288 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4289 (replace_range, replace_range_2, del_range_2): Change to eassert.
4290 * marker.c (byte_char_debug_check): Adjust style.
4291
b46a6a83
PE
42922012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4293
4294 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4295 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4296 long-ago-commented-out code that talks about "WIN32".
4297 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4298 All uses changed.
4299
e32a5799
PE
43002012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4301
4302 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4303 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4304 Simplify by using alignof.
4305 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4306 * lisp.h: Include <stdalign.h>.
4307 (GCALIGNMENT): New macro and constant.
4308 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4309 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4310 (stdalign): New macro, if not already defined.
4311
df81cd29
EZ
43122012-07-28 Eli Zaretskii <eliz@gnu.org>
4313
01bd1b0d
EZ
4314 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4315 * w32inevt.c: Include w32inevt.h.
4316 (w32_read_console_input): New inline function, calls either
4317 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4318 w32_console_unicode_input.
4319 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4320 (w32_kbd_patch_key, key_event): Use the codepage returned by
4321 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4322 (key_event): use uChar.UnicodeChar only if
4323 w32_console_unicode_input is non-zero.
4324
4325 * w32console.c: Include w32heap.h.
4326 <w32_console_unicode_input>: New global variable.
4327 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4328 family of Windows, zero otherwise.
4329
4330 * w32inevt.h: Declare w32_console_unicode_input.
4331
df81cd29
EZ
4332 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4333 --without-x. (Bug#11742)
4334
c20fdd9e
PE
43352012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4336
4337 Adjust GDB to reflect pvec_type changes (Bug#12036).
4338 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
4339 2012-07-04 changes to pseudovector representation.
4340 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 4341
32770973 43422012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
4343
4344 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4345 bus address.
4346 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4347
3438fe21
EZ
43482012-07-27 Eli Zaretskii <eliz@gnu.org>
4349
bcfbc9de
EZ
4350 * alloc.c (listn): Fix the order the arguments are consed onto the
4351 list.
4352
3438fe21
EZ
4353 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4354 enumeration constants, as PURE and HEAP are too general, and clash
4355 with other headers and sources, such as gmalloc.c and the
4356 MS-Windows system headers. All users changed.
4357
eeaea515
DA
43582012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4359
4360 Revert last save_excursion_save and save_excursion_restore changes.
4361 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4362 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4363
073c88c2
DA
43642012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4365
4366 Fix recently-introduced typos in Windows port.
4367 Reported by Martin Rudalics <rudalics@gmx.at>.
4368 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 4369 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 4370
4706125e
PE
43712012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4372
4373 Improve GDB symbol export (Bug#12036).
4374 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4375 arms of an 'if', not using conditional expressions; otherwise GDB
4376 complains about the types in the unevaluated arm when the argument
4377 is an integer literal.
4378 (xgetint): Simplify expression.
4379 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4380 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4381 Zaretskii in <http://bugs.gnu.org/12036#13>.
4382 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4383 needed now that we have gdb_make_enums_visible.
4384 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4385 (enum enum_USE_LSB_TAG):
4386 New enum types, packaging up enums that need to be exported to GDB.
4387
694b6c97
DA
43882012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4389
4390 Utility function to make a list from specified amount of objects.
4391 * lisp.h (enum constype): New datatype.
4392 (listn): New prototype.
4393 * alloc.c (listn): New function.
4394 (Fmemory_use_count, syms_of_alloc): Use it.
4395 * buffer.c (syms_of_buffer): Likewise.
4396 * callint.c (syms_of_callint): Likewise.
4397 * charset.c (define_charset_internal): Likewise.
4398 * coding.c (syms_of_coding): Likewise.
4399 * keymap.c (syms_of_keymap): Likewise.
4400 * search.c (syms_of_search): Likewise.
4401 * syntax.c (syms_of_syntax): Likewise.
4402 * w32.c (init_environment): Likewise.
4403 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4404 * xdisp.c (syms_of_xdisp): Likewise.
4405 * xfns.c (syms_of_xfns): Likewise.
4406
6195f384
DA
44072012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4408
4409 Fast save_excursion_save and save_excursion_restore.
4410 * lisp.h (struct Lisp_Excursion): New data type.
4411 (PVEC_EXCURSION): New pseudovector type.
4412 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4413 to deal with it. Adjust comments.
4414 (init_marker, attach_marker): New prototype.
4415 (unchain_marker): Adjust prototype.
4416 * marker.c (attach_marker): Change to global.
4417 (init_marker): New function.
4418 * alloc.c (Fmake_marker, build_marker): Use it.
4419 (build_marker): More easserts.
4420 (mark_object): Handle struct Lisp_Excursion.
4421 * editfns.c (save_excursion_save, save_excursion_restore):
4422 Reimplement to use struct Lisp_Excursion. Add comments.
4423
5eceb8fb
PE
44242012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4425
4426 Fix export of symbols to GDB (Bug#12036).
4427 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4428 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4429 emacs.c, as this is a more-suitable home. Had this been done earlier
4430 the fix for 12036 would have avoided some of the problems noted in
4431 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4432 would have been more obvious.
562157c8
PE
4433 * emacs.c: Do not include <verify.h>; no longer needed.
4434 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
4435 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4436 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4437 Remove; now done in lisp.h.
4438 * lisp.h (PUBLISH_TO_GDB): New macro.
4439 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4440 (DATA_SEG_BITS): Use it.
4441 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4442 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4443 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4444 not be usable in #if. This simplifies things.
4445
d6749401
JB
44462012-07-26 Juanma Barranquero <lekktu@gmail.com>
4447
4448 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4449
1781b9e9
PE
44502012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4451
d89518db 4452 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
4453 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4454 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4455 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4456 Adjust to changes in lisp.h and emacs.c, by using
4457 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4458 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4459 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4460 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4461 instead of gdb_valbits.
4462 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4463 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4464 instead of gdb_array_mark_flag.
4465 (xboolvector): Get size from $->size, not $->header.size.
4466 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4467 (xreload, hook-run, hookpost-run): Remove.
4468 * emacs.c: Include <verify.h>.
4469 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4470 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4471 Remove.
4472 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4473 (gdb_USE_LSB_TAG): New enum constants.
4474 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4475 Also define these as enum constants, so they're visible to GDB.
4476 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4477 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4478 as constants, so they're visible to GDB.
4479 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4480 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4481 Now enum constants, not macros, so they're visible to GDB.
4482 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4483 more convenient now. All uses changed.
4484 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4485 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4486
3628596a
DA
44872012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4488
4489 Explicitly free restriction data that are not needed anymore.
4490 * editfns.c (save_restriction_restore): Free restriction data.
4491
7abaf5cc
SM
44922012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4493
4494 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4495 add argument, tune behavior, and adjust all callers.
4496
71f88e00
PE
44972012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4498
4499 Use typedef for EMACS_INT, EMACS_UINT.
4500 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4501 than macros. This simplifies debugging in the usual case, since
4502 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4503 and it allows expressions involving EMACS_INT casts.
4504 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4505
57ec3034
JD
45062012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4507
4508 * nsterm.m (ns_read_socket): Return early if there is a modal
4509 window (Bug#12043).
4510
8137e7b3
MR
45112012-07-25 Martin Rudalics <rudalics@gmx.at>
4512
4513 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4514 that FOCUS-FRAME can be omitted.
4515
04e9897c
DA
45162012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4517
4518 Adjust buffer text indirection counters at the end of Fkill_buffer.
4519 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4520 buffer is definitely dead. This should really fix an issue reported
4521 by Christoph Scholtes again. (Bug#12007).
4522 (init_buffer_once): Initialize indirection counters of
4523 buffer_defaults and buffer_local_symbols (for sanity and safety).
4524
8a0484e1
EZ
45252012-07-24 Eli Zaretskii <eliz@gnu.org>
4526
4527 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4528 and continuation glyphs on tooltip frames, leave them at zero.
4529 Avoids continued lines in tooltips. (Bug#11832)
4530
fa691a83
DA
45312012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4532
4533 Simplify copy_overlay.
04e9897c 4534 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
4535 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4536
436bc8e0
EZ
45372012-07-23 Eli Zaretskii <eliz@gnu.org>
4538
4539 * print.c (print_object): Don't crash when a frame's name is nil
4540 or invalid. (Bug#12025)
4541
4542 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4543 it signals an error when a tooltip frame is being created.
4544
d7a7fda3
DA
45452012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4546
4547 Cleanup miscellaneous objects allocation and initialization.
4548 * alloc.c (allocate_misc): Change to static. Add argument to
4549 specify the subtype. Adjust comment and users.
4550 (build_overlay): New function.
4551 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4552 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4553 (allocate_misc): Remove prototype.
4554 (build_overlay): Add prototype.
4555
45562012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
4557
4558 Swap buffer text indirection counters in Fbuffer_swap_text.
4559 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4560 This avoids crash reported by Christoph Scholtes at
4561 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4562
9d7fa573
JD
45632012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4564
4565 * nsmenu.m (Popdown_data): New struct.
4566 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4567 free Popdown_data.
4568 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4569 (initWithContentRect): Make imgView and contentView non-static
4570 and autorelease them. Also autorelease img and matrix (Bug#12005).
4571 (dealloc): Remove (Bug#12005).
4572
0dd6d66d
DA
45732012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4574
4575 Adjust consing_since_gc when objects are explicitly freed.
4576 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4577 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4578 (free_cons, free_misc): Subtract object size from consing_since_gc.
4579
d36d71df
DA
45802012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4581
4582 Simplify and cleanup markers positioning code.
4583 * marker.c (attach_marker): More useful eassert.
4584 (live_buffer, set_marker_internal): New function.
4585 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4586 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4587
fb9ea40f
PE
45882012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4589
4590 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4591 as it's limited by the amount of memory, not by INT_MAX.
4592
2d5c5f7d
EZ
45932012-07-21 Eli Zaretskii <eliz@gnu.org>
4594
07fb592e
EZ
4595 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4596 in special-event-map. See the discussion at
4597 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4598 for the reasons.
4599
37a9eac8 4600 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
4601 info.dwItemData. Fixes crashes on 64-bit Windows.
4602 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 4603
c4328746
JD
46042012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4605
fc0c31f8 4606 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 4607 (conversationIdentifier): Return value is NSInteger.
784051c4 4608 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 4609
6e5d1c12
CY
46102012-07-21 Chong Yidong <cyd@gnu.org>
4611
4612 * window.c (decode_any_window): Signal an error if the window is
4613 on a dead frame (Bug#11984).
4614
9928463d
DA
46152012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4616
4617 Add indirection counting to speed up Fkill_buffer.
4618 * buffer.h (struct buffer): New member.
4619 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4620 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4621 base buffer indirection counter.
4622 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4623 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4624 through buffer list if indirection counter is 0.
4625
f8643a6b
DA
46262012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4627
4628 Extend the value returned by Fgarbage_collect with heap statistics.
4629 * alloc.c (Qheap): New symbol.
4630 (syms_of_alloc): DEFSYM it.
4631 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4632 (Fmemory_free): Remove.
4633 (syms_of_alloc): Don't defsubr it.
4634 * buffer.c (Fcompact_buffer): Remove.
4635 (syms_of_buffer): Don't defsubr it.
4636
dac616ff
DA
46372012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4638
4639 Make maybe_gc inline.
4640 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4641 * lisp.h (consing_since_gc, gc_relative_threshold)
4642 (memory_full_cons_threshold): Revert declaration.
4643 (maybe_gc): Remove prototype, define as inline.
4644 * alloc.c: Remove old commented-out code.
4645 (consing_since_gc, gc_relative_threshold)
4646 (memory_full_cons_threshold): Revert to global.
4647 (maybe_gc): Remove.
4648
d7ea76b4
DA
46492012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4650
4651 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4652 * lisp.h (build_unibyte_string): New function.
4653 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4654 * sysdep.c, w32fns.c, xfns.c: Use it.
4655 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4656 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4657 Adjust users accordingly.
4658 * font.h (font_open_by_name): Adjust prototype.
4659
765e61e3
DA
46602012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4661
4662 Cleanup calls to Fgarbage_collect.
4663 * lisp.h (maybe_gc): New prototype.
4664 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4665 Remove declarations.
4666 * alloc.c (maybe_gc): New function.
4667 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4668 Make them static.
4669 * bytecode.c (MAYBE_GC): Use maybe_gc.
4670 * eval.c (eval_sub, Ffuncall): Likewise.
4671 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4672 to avoid dependency from auto-save feature.
4673
52b852c7
PE
46742012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4675
4676 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4677 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4678 'for_each_per_buffer_object_at'.
4679 All uses changed. It's better to use upper-case for macros that
4680 cannot be implemented as functions, to give the reader a clue
4681 that they're special.
4682
5db81e33
SM
46832012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4684
4685 * alloc.c (Fgarbage_collect): Tweak docstring.
4686
5b835e1d
DA
46872012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4688
4689 Tweak the value returned from Fgarbage_collect again.
4690 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4691 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4692 Adjust documentation.
4693 (total_vector_bytes): Rename to total_vector_slots, adjust
4694 accounting.
4695 (total_free_vector_bytes): Rename to total_free_vector_slots,
4696 adjust accounting.
4697 (Qstring_bytes, Qvector_slots): New symbols.
4698 (syms_of_alloc): DEFSYM them.
4699
9cd47b72
DA
47002012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4701
4702 Buffer compaction primitive which may be used from Lisp.
4703 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4704 (syms_of_buffer): Register Fcompact_buffer.
4705 * alloc.c (Fgarbage_collect): Use compact_buffer.
4706 * buffer.h (compact_buffer): New prototype.
4707 (struct buffer_text): New member.
4708
d17337e5
DA
47092012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4710
4711 New macro to iterate over all buffers, miscellaneous cleanups.
4712 * lisp.h (all_buffers): Remove declaration.
4713 * buffer.h (all_buffers): Add declaration, with comment.
4714 (for_each_buffer): New macro.
4715 * alloc.c (Fgarbage_collect, mark_object): Use it.
4716 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4717 (init_buffer): Likewise.
4718 * data.c (Fset_default): Likewise.
4719 * coding.c (code_conversion_restore): Remove redundant check
4720 for dead buffer.
4721 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4722
60cfd278
AS
47232012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4724
4725 Fix bug that created negative-length intervals.
4726 * intervals.c (merge_interval_right, merge_interval_left):
4727 Do not zero out this interval if it is absorbed by its children,
4728 as this interval's total length doesn't change in that case. See
4729 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4730
d06714cb
PE
47312012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4732
83713154
PE
4733 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4734 when invoking (make-bool-vector N t) and N is a positive
4735 multiple of 8 -- the last 8 bits were mistakenly cleared.
4736
d06714cb
PE
4737 Remove some struct layout assumptions in bool vectors.
4738 * alloc.c (bool_header_size): New constant.
4739 (header_size, word_size): Move earlier, as they're now used earlier.
4740 Use 'word_size' in a few more places, where it's appropriate.
4741 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4742 padding before the data member of a bool vector.
4743 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4744 than doing the check by hand with an abort ().
4745
464d5a5e
SM
47462012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4747
5fbc0409
SM
4748 * eval.c (Fdefvar): Don't check constants since we only set the var if
4749 it's not yet defined anyway (bug#11904).
4750
464d5a5e
SM
4751 * lisp.h (last_undo_boundary): Declare new var.
4752 * keyboard.c (command_loop_1): Set it.
4753 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4754 were auto-added by the command loop (bug#11774).
4755
8dc2e44a
AS
47562012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4757
4758 * w32font.c (Qsymbol): Remove local definition.
4759 (syms_of_w32font): Don't DEFSYM it.
4760
169925ec
DA
47612012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4762
4763 Fix sweep_vectors to handle large bool vectors correctly.
4764 * alloc.c (sweep_vectors): Account total_vector_bytes for
4765 bool vectors larger than VBLOCK_BYTES_MAX.
4766
5fbfb018
CY
47672012-07-18 Chong Yidong <cyd@gnu.org>
4768
4769 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4770 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4771
3ab6e069
DA
47722012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4773
4774 Return more descriptive data from Fgarbage_collect.
4775 Suggested by Stefan Monnier in
4776 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4777 * alloc.c (bounded_number): New function.
4778 (total_buffers, total_vectors): New variable.
4779 (total_string_size): Rename to total_string_bytes, adjust users.
4780 (total_vector_size): Rename to total_vector_bytes, adjust users.
4781 (sweep_vectors): Account total_vectors and total_vector_bytes.
4782 (Fgarbage_collect): New return value. Adjust documentation.
4783 (gc_sweep): Account total_buffers.
4784 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4785 (VECTOR_SIZE): Remove.
4786 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4787 (Qinterval, Qmisc): New symbols.
4788 (syms_of_data): Initialize them.
4789 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4790 (Qcons, Qbuffer): New declarations.
4791
6d02fe5b
PE
47922012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4793
4794 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4795 Round up, not down. Improve doc.
4796
b7ffe040
DA
47972012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4798
4799 Restore old code in allocate_string_data to avoid Faset breakage.
4800 Reported by Julien Danjou <julien@danjou.info> in
4801 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4802 * alloc.c (allocate_string_data): Restore old code with minor
4803 adjustments, fix comment to explain this subtle issue.
4804
4dc7c8d5
SM
48052012-07-17 Eli Zaretskii <eliz@gnu.org>
4806
4807 Remove FILE_SYSTEM_CASE.
4808 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4809
4810 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4811 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4812 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4813 call-process-region passes it through expand-file-name.
4814
4815 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4816
48172012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4818
4819 Fix crash when creating indirect buffer (Bug#11917)
4820 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4821 Don't handle unbound variables specially if non-zero.
4822 (Fbuffer_local_variables): Pass zero.
4823 (clone_per_buffer_values): Pass non-zero.
4824
48252012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4826
4827 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4828 to make the loop interruptible.
4829
48302012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4831
4832 * gnutls.c (emacs_gnutls_handshake): Only retry if
4833 GNUTLS_E_INTERRUPTED.
4834
cce7fefc
DA
48352012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4836
4837 Cleanup and convert miscellaneous checks to eassert.
4838 * alloc.c (mark_interval): Fix comment, partially rephrase
4839 old comment from intervals.h (see below).
4840 * intervals.c (find_interval, adjust_intervals_for_insertion)
4841 (delete_interval, adjust_intervals_for_deletion)
4842 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4843 Convert to eassert.
4844 (adjust_intervals_for_insertion, make_new_interval):
4845 Remove obsolete and unused code.
4846 * intervals.h (struct interval): Remove obsolete comment.
4847 * textprotp.c (erase_properties): Remove unused code.
4848 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4849 (Fremove_list_of_text_properties): Convert to eassert.
4850
9ea10cc3
CY
48512012-07-17 Chong Yidong <cyd@gnu.org>
4852
4853 * editfns.c (Finsert_char): Doc fix.
4854
3900d5de
DA
48552012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4856
4857 Fix previous change to make Fmemory_free always accurate.
4858 * alloc.c (make_interval): Update total_free_intervals.
4859 (make_float): Likewise for total_free_floats.
4860 (free_cons, Fcons): Likewise for total_free_conses.
4861 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4862 Likewise for total_free_vector_bytes.
4863 (Fmake_symbol): Likewise for total_free_symbols.
4864 (bytes_free): Remove.
4865
7098646f
DA
48662012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4867
4868 Simple free memory accounting feature.
4869 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4870 (sweep_vectors): Accumulate size of free vectors.
4871 (Fgarbage_collect): Setup bytes_free.
4872 (Fmemory_free): New function.
4873 (syms_of_alloc): Register it.
4874
22657b40
DA
48752012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4876
4877 Cleanup overlays checking.
4878 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4879 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4880 eassert and OVERLAYP.
4881 (sort_overlays): Change to use OVERLAYP.
4882
ddfc8813
RK
48832012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4884
4885 * editfns.c (Finsert_char): Make it interactive, and make the
4886 second arg optional. Copy interactive spec and docstring from
4887 ucs-insert.
4888
7c26cf3c
PE
48892012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4890
4891 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4892 Unlike the other wrapped functions, fabs has an unspecified
4893 effect on errno.
4894
5d127af9
JD
48952012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4896
4897 * nsterm.m (keyDown): Interpret flags without left/right bits
4898 as the left key (Bug#11670).
4899
6a0dd1d7
DA
49002012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4901
4902 Remove empty and useless init functions.
4903 * lisp.h (init_character_once, init_fns, init_image)
4904 (init_filelock, init_sound): Remove prototype.
4905 * character.c (init_character_once): Remove.
4906 * filelock.c (init_filelock): Likewise.
4907 * fns.c (init_fns): Likewise.
4908 * image.c (init_image): Likewise.
4909 * sound.c (init_sound): Likewise.
4910 * emacs.c (main): Adjust accordingly.
4911
7a6136fd
DA
49122012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4913
4914 * gtkutil.h: Tiny cleanups.
4915 (use_old_gtk_file_dialog): Remove useless declaration.
4916 (xg_uses_old_file_dialog): Add suggested const attribute.
4917
ce811ad9
EZ
49182012-07-15 Eli Zaretskii <eliz@gnu.org>
4919
4920 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4921 (bidi_paragraph_init): Use it to limit search forward for a strong
4922 directional character in abnormally large paragraphs full of
4923 neutral or weak characters. (Bug#11943)
4924
c9adfeaa
SF
49252012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4926
4927 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4928 the toolbar (Bug#9451).
4929 (xg_make_tool_item): Give the widget event box a transparent
4930 background.
4931
fff62aa9
DA
49322012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4933
4934 Cleanup basic allocation variables and functions.
4935 * alloc.c (ignore_warnings, init_intervals, init_float)
4936 (init_cons, init_symbol, init_marker): Remove.
4937 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4938 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4939 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4940 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4941 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4942 (staticidx, init_alloc_once, init_strings, free_ablock):
4943 Remove redundant initialization.
4944 * fns.c (init_weak_hash_tables): Remove.
4945 * lisp.h (init_weak_hash_tables): Remove prototype.
4946
9730daca
DA
49472012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4948
4949 Use zero_vector where appropriate.
4950 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4951 accordingly.
4952 * lisp.h (zero_vector): New declaration.
4953 * font.c (null_vector): Remove.
4954 (syms_of_font): Remove initialization and staticpro.
4955 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4956 * keymap.c (Faccessible_keymaps): Likewise.
4957
2e2d2a13
LL
49582012-07-15 Leo Liu <sdl.web@gmail.com>
4959
4960 * fringe.c: Fix typo in comments.
4961
cd276f6e
LL
49622012-07-14 Leo Liu <sdl.web@gmail.com>
4963
4964 * fringe.c: Add a new bitmap exclamation-mark.
4965
5a1131d9
EZ
49662012-07-14 Eli Zaretskii <eliz@gnu.org>
4967
4968 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4969
4970 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4971 (HAVE_MENUS): Don't define, defined by editing config.in with
4972 msdos/sed2v2.inp.
4973 (GMALLOC_INHIBIT_VALLOC): Don't define.
4974 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4975
22e983b7
JB
49762012-07-14 Juanma Barranquero <lekktu@gmail.com>
4977
4978 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4979
5b3f250f
GM
49802012-07-14 Glenn Morris <rgm@gnu.org>
4981
4982 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4983 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4984 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4985
33d63ff4
GM
49862012-07-13 Glenn Morris <rgm@gnu.org>
4987
5b633342
GM
4988 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4989
33d63ff4
GM
4990 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4991 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4992
b55b9f85
JD
49932012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4994
0dc8cf50
JD
4995 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4996 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4997 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4998 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4999 where appropriate.
5000 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5001 as boolean expression.
5002 (x_set_window_size): Remove unused variable toolbar.
5003 (ns_get_color_default, ns_mod_to_lisp): Remove.
5004 (ns_mouse_position): Remove unused variables xchar and ychar.
5005 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5006 (ns_set_vertical_scroll_bar): Remove unused variable count.
5007 (ns_delete_terminal): Remove unused variable i.
5008 (ns_term_init): Remove unused variables r, g and b.
5009 (mouseDown): Remove unused variable window.
5010 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5011 (initFrameFromEmacs): Remove unused variable vbextra.
5012 (mouseEntered): Remove unused variables p and dpyinfo.
5013 (mouseExited): Remove unused variables p and r.
5014 (ns_define_frame_cursor, ns_clear_frame_area)
5015 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5016 (menuDown): Assign [sender tag] to variable and cast the variable.
5017
5018 * nsterm.h (menuDown): Add id as type to argument sender.
5019 (ns_display_info_for_name): Add Lisp_Object argument.
5020 (ns_term_init): Add Lisp_Object argument.
5021 (ns_map_event_to_object): Add void argument.
5022 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5023 prototype with arguments and only declare if __OBJC__.
5024 (nxatoms_of_nsselect): Add void argument.
5025 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5026 (ns_alloc_autorelease_pool): Add void argument.
5027 (ns_release_autorelease_pool): Add void* argument.
5028 (ns_get_defaults_value): Add const char* argument.
5029
5030 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5031 (initFromContents): Use SSDATA where appropriate.
5032 (ns_update_menubar): Add braces to ambigous if-else.
5033 (initWithTitle): Put () around assignment in if statement.
5034 (ns_menu_show): Remove unused variables window and keymap.
5035 (update_frame_tool_bar): Remove unused variable selected_p.
5036 (initWithContentRect): Remove unused variable this_cmd_name.
5037
5038 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5039 appropriate.
5040 (setXBMColor): Remove unused variable len.
5041 (setPixmapData): Put () around assignment in loop statement.
5042
5043 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5044 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5045 where appropriate.
5046 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5047 around assignment in loop statement.
5048 (nsfont_open): Remove unused variable i.
5049 (nsfont_open): Remove unused variable len.
5050 (nsfont_draw): Remove unused variable cs.
5051
5052 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5053 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5054 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5055 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5056 (Fns_font_name, Fns_perform_service)
5057 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5058 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5059 (ns_set_name): Remove unused variable view.
5060 (x_set_menu_bar_lines): Remove unused variable olines.
5061 (x_set_tool_bar_lines): Remove unused variable root_window.
5062 (Fns_list_colors): Put () around assignment in while statement.
5063 (Fns_perform_service): Remove unused variable len.
5064 (Fns_display_usable_bounds): Remove unused variable top.
5065 (syms_of_nsfns): Remove unused variable i.
5066
b55b9f85
JD
5067 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5068 memcpy (Bug#11907).
5069
ed9265fc 50702012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
5071
5072 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5073 and free it with DestroyExceptionInfo (Bug#11558).
5074
ef099b57
JB
50752012-07-13 Juanma Barranquero <lekktu@gmail.com>
5076
5077 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5078 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5079 Set here, not in nt/config.nt.
5080
ea814a5d
EZ
50812012-07-13 Eli Zaretskii <eliz@gnu.org>
5082
5083 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5084 cursor overflow into the last glyph on display line when the right
5085 fringe is off. (Bug#11832)
5086
1a952767
PE
50872012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5088
5089 * xdisp.c (produce_special_glyphs): Now static.
5090 * dispextern.h (produce_special_glyphs): Remove decl.
5091
983188fd
GM
50922012-07-13 Glenn Morris <rgm@gnu.org>
5093
8d7c7eed 5094 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
5095 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5096
983188fd
GM
5097 * s/usg5-4-common.h (USG, USG5):
5098 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5099 * s/sol2-6.h (SOLARIS2):
5100 * s/irix6-5.h (IRIX6_5):
5101 * s/hpux10-20.h (USG, USG5, HPUX):
5102 * s/gnu-linux.h (USG, GNU_LINUX):
5103 * s/freebsd.h (BSD_SYSTEM):
5104 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5105 * s/cygwin.h (CYGWIN):
5106 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5107 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5108
d1e68667 51092012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
5110
5111 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 5112
6de0e799
GM
51132012-07-13 Glenn Morris <rgm@gnu.org>
5114
739ae010
GM
5115 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5116
dbee5793
GM
5117 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5118
6de0e799
GM
5119 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5120 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5121
b82da769
GM
51222012-07-12 Glenn Morris <rgm@gnu.org>
5123
4fae5a7a 5124 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
5125
5126 * process.c (init_process_emacs): Rename from init_process.
5127 The old name is also the name of a Mach system call.
5128 * lisp.h, emacs.c: Update for this name change.
5129 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5130 longer needed.
5131
5a979817
EZ
51322012-07-12 Eli Zaretskii <eliz@gnu.org>
5133
5134 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5135 memmove call that removes glyphs covered by the left truncation
5136 glyph. Improve commentary.
5137 (display_line): Fix display of continuation glyphs on GUI frames
5138 when the right fringe is turned off and variable-size fonts are
5139 used in the window. Move the code that appends a stretch glyph to
5140 produce_special_glyphs, so that it could be used for truncation
5141 and continuation glyphs alike.
5142 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5143 glyph of a suitably computed width, to align the special glyphs at
5144 the window margin. Code moved from display_line. (Bug#11832)
5145
3e91a053
GM
51462012-07-12 Glenn Morris <rgm@gnu.org>
5147
ba9e4b84
GM
5148 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5149
5150 * s/gnu-linux.h, s/hpux10-20.h:
5151 Do not unconditionally define HAVE_XRMSETDATABASE.
5152
3e91a053
GM
5153 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5154
b300b1f4
PE
51552012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5156
5157 Fix typos that broke OS X build.
5158 Reported by Randal L. Schwartz in
5159 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5160 * nsterm.m (ns_timeout): Add missing local decl.
5161 (ns_get_color): snprintf -> sprintf, to fix typo.
5162
6e777848
GM
51632012-07-12 Glenn Morris <rgm@gnu.org>
5164
3f922c37
GM
5165 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5166 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5167 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5168 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5169
0ab7b23a
GM
5170 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5171 Move PTY_OPEN to configure.
5172
6e777848
GM
5173 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5174 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5175 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5176
4a7edc24
DA
51772012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5178
5179 Use empty_unibyte_string where applicable.
5180 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5181 * lread.c (read1): Likewise.
5182 * xsettings.c (syms_of_xsettings): Likewise.
5183
308aab79
GM
51842012-07-12 Glenn Morris <rgm@gnu.org>
5185
42bd1719
GM
5186 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5187 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
5188 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5189 * s/hpux10-20.h (RUN_TIME_REMAP):
5190 * s/bsd-common.h (TABDLY): Move to configure.
5191
5192 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5193
5194 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5195
ea0bbd17 5196 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 5197 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
5198
5199 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 5200
308aab79
GM
5201 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5202 * s/template.h: Move NARROWPROTO to configure.
5203
ee1cf5cf
GM
52042012-07-11 Glenn Morris <rgm@gnu.org>
5205
30fe9bf4
GM
5206 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5207 unused since 2011-01-17 change to systty.h.
5208
ee1cf5cf
GM
5209 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5210 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5211 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5212
63e47e07
PE
52132012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5214
5215 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5216
c43fb4c3
GM
52172012-07-11 Glenn Morris <rgm@gnu.org>
5218
5219 * s/darwin.h, s/gnu-linux.h, s/template.h:
5220 Move INTERRUPT_INPUT to configure.
5221
e8df9267
DA
52222012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5223
5224 Minor adjustments to interning code.
5225 * lisp.h (intern, intern_c_string): Redefine as static inline
5226 wrappers for intern_1 and intern_c_string_1, respectively.
5227 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
5228 * lread.c (intern_1, intern_c_string_1, oblookup):
5229 Simplify Vobarray checking.
e8df9267
DA
5230 * font.c (font_intern_prop): Likewise. Adjust comment.
5231 * w32font.c (intern_font_name): Likewise.
5232
34348bd4
AS
52332012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5234
d96a1e0c
AS
5235 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5236
34348bd4
AS
5237 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5238 of Fcar/Fcdr if possible.
5239 * font.c (check_otf_features): Likewise.
5240 * fontset.c (Fnew_fontset): Likewise.
5241 * gnutls.c (Fgnutls_boot): Likewise.
5242 * minibuf.c (read_minibuf): Likewise.
5243 * msdos.c (IT_set_frame_parameters): Likewise.
5244 * xmenu.c (Fx_popup_dialog): Likewise.
5245 * w32menu.c (Fx_popup_dialog): Likewise.
5246
c8add24e
GM
52472012-07-11 Glenn Morris <rgm@gnu.org>
5248
4b575b3c
GM
5249 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5250 since nothing has defined it on these platforms.
5251
09f4e3b0
GM
5252 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5253 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5254
172bedef
GM
5255 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5256 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5257 Move CLASH_DETECTION to configure.
5258
249685df
GM
5259 * s/gnu.h: Remove file, which is now empty.
5260
c8add24e
GM
5261 * s/gnu.h, s/gnu-linux.h:
5262 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5263
b41253a3
JW
52642012-07-11 John Wiegley <johnw@newartisans.com>
5265
5266 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5267 function attribute, so we only use it if it exists in the
5268 compiler.
5269
d923b542
DA
52702012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5271
5272 Avoid call to strlen in fast_c_string_match_ignore_case.
5273 * search.c (fast_c_string_match_ignore_case): Change to use
5274 length argument. Adjust users accordingly.
5275 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5276
5ebbef1d
PE
52772012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5278
bb352260
PE
5279 Assume mkdir, rmdir.
5280 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5281 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5282
57054ddd
PE
5283 Assume rename.
5284 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5285
b747d3f7
PE
5286 Assume perror.
5287 * s/hpux10-20.h (HAVE_PERROR): Remove.
5288 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5289 Remove dummy definition, as this problem was obsolete long ago.
5290
5ebbef1d
PE
5291 Assume strerror.
5292 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5293
984e7f30
DA
52942012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5295
5296 Avoid calls to strlen in font processing functions.
5297 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
5298 (font_open_by_name): Change to use length argument.
5299 Adjust users accordingly.
d923b542
DA
5300 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5301 Adjust prototypes.
5302 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5303 Change to return ptrdiff_t.
984e7f30
DA
5304 (xfont_list_pattern, xfont_match): Use length returned by
5305 xfont_decode_coding_xlfd.
5306 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5307
20e94fdd
GM
53082012-07-11 Glenn Morris <rgm@gnu.org>
5309
9d596af3
GM
5310 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5311 Move DONT_REOPEN_PTY to configure.
5312
20e94fdd
GM
5313 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5314 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5315
e99a530f
PE
53162012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5317
22ffb973
PE
5318 Remove "#define unix" that is no longer needed (Bug#11905).
5319 * s/aix4-2.h (unix): Remove; no longer needed.
5320
e9a9ae03
PE
5321 EMACS_TIME simplification (Bug#11875).
5322 This replaces macros (which typically do not work in GDB)
5323 with functions, typedefs and enums, making the code easier to debug.
5324 The functional style also makes code easier to read and maintain.
5325 * systime.h: Include <sys/time.h> on all hosts, not just if
5326 WINDOWSNT, since 'struct timeval' is needed in general.
5327 (EMACS_TIME): Now a typedef, not a macro.
5328 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5329 not macros.
5330 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5331 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5332 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5333 (EMACS_TIME_LE): Now functions, not macros.
5334 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5335 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5336 which are not functions. All uses rewritten to use:
5337 (make_emacs_time): New function.
5338 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5339 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5340 not functions. All uses rewritten to use the following, respectively:
5341 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5342 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 5343 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
5344 * fileio.c (Fcopy_file):
5345 * xterm.c (XTflash): Get the current time closer to when it's used.
5346 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5347
ffacb126
PE
5348 * bytecode.c (targets): Suppress -Woverride-init warnings.
5349
e99a530f
PE
5350 Simplify by avoiding confusing use of strncpy etc.
5351 * doc.c (Fsnarf_documentation):
5352 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5353 * frame.c (Fmake_terminal_frame):
5354 * gtkutil.c (get_utf8_string):
5355 * lread.c (openp):
5356 * nsmenu.m (ns_update_menubar):
5357 * regex.c (regerror):
5358 Prefer memcpy to strncpy and strncat when either will do.
5359 * fileio.c (Fsubstitute_in_file_name):
5360 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5361 (menu_separator_name_p):
5362 * nsmenu.m (ns_update_menubar):
5363 Prefer memcmp to strncmp when either will do.
5364 * nsterm.m: Include <ftoastr.h>.
5365 (ns_get_color):
5366 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5367 Prefer snprintf to strncpy.
5368 * nsterm.m (ns_term_init):
5369 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5370 * nsterm.m (ns_term_init):
5371 Avoid the need for strncpy, by using build_string or
5372 make_unibyte_string directly. Use dtoastr, not snprintf.
5373 * process.c (Fmake_network_process): Diagnose service names that
5374 are too long, rather than silently truncating them or creating
5375 non-null-terminated names.
5376 (Fnetwork_interface_info): Likewise, for interface names.
5377 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5378 Prefer sprintf to strncat.
5379 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5380 Prefer vsnprintf to vsprintf + strncpy.
5381
c59592b3
GM
53822012-07-10 Glenn Morris <rgm@gnu.org>
5383
5384 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5385 Clarify fallback case.
5386
7d7bbefd
DA
53872012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5388
5389 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5390 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5391 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 5392 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
5393 where argument type is known to be a Lisp_Cons.
5394
3a4c8000
TT
53952012-07-10 Tom Tromey <tromey@redhat.com>
5396
5397 * bytecode.c (BYTE_CODE_THREADED): New macro.
5398 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5399 (enum byte_code_op): New type.
5400 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5401 (exec_byte_code): Use them. Use token threading when applicable.
5402
2a0213a6
DA
54032012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5404
5405 Optimize pure C strings initialization.
5406 * lisp.h (make_pure_string): Fix prototype.
5407 (build_pure_c_string): New function, defined as static inline. This
5408 provides a better opportunity to optimize away calls to strlen when
5409 the function is called with compile-time constant argument.
5410 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5411 argument, adjust users accordingly. Use build_pure_c_string where
5412 appropriate.
5413 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5414 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5415 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5416
cb1caeaf
DA
54172012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5418
5419 Avoid calls to strlen in miscellaneous functions.
5420 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5421 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5422 * lread.c (openp): Likewise.
5423
c293e30c
DA
54242012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5425
5426 Avoid calls to strlen in path processing functions.
5427 * fileio.c (file_name_as_directory): Add comment. Change to add
5428 srclen argument and return the length of result. Adjust users
5429 accordingly.
5430 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
5431 swap 1st and 2nd arguments to obey the common convention.
5432 Adjust users accordingly.
c293e30c
DA
5433 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5434
9e059e3f
GM
54352012-07-10 Glenn Morris <rgm@gnu.org>
5436
d02eb359
GM
5437 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5438 Move PENDING_OUTPUT_COUNT definition to configure.
5439
882cf227
GM
5440 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5441 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5442 * s/gnu.h (DATA_START): Move definitions to configure.
5443
af6e839f
GM
5444 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5445 We include usg5-4-common.h, which defines them both.
5446
40289a12
GM
5447 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5448 O_RDONLY already includes it).
5449
9e059e3f
GM
5450 Stop ns builds setting the EMACSLOADPATH environment variable.
5451 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5452 Now it does not set EMACSLOADPATH, just returns the load-path string.
5453 * nsterm.h: Update accordingly.
5454 * lread.c [HAVE_NS]: Include nsterm.h.
5455 (init_lread) [HAVE_NS]: Use ns_load_path.
5456 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5457
7c4e8ec0
GM
54582012-07-09 Glenn Morris <rgm@gnu.org>
5459
d4f600ff
GM
5460 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5461 since the included bsd-common.h does so.
5462
cbb31951
GM
5463 Stop ns builds setting the EMACSPATH environment variable.
5464 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5465 (ns_init_paths): Do not set EMACSPATH.
5466 * nsterm.h (ns_exec_path): Add it.
5467 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5468 Use ns_exec_path.
5469
7c4e8ec0
GM
5470 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5471
26bccfae
PE
54722012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5473
a0bee46f
PE
5474 * process.c (wait_reading_process_output): 'waitchannels' was unset
5475 when read_kbd || !NILP (wait_for_cell); fix this.
5476
5994c183
PE
5477 Add GCC-style 'const' attribute to functions that can use it.
5478 * character.h (char_resolve_modifier_mask):
5479 * keyboard.h (make_ctrl_char):
5480 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5481 (init_character_once, next_almost_prime, init_fns, init_image)
5482 (flush_pending_output, init_sound):
5483 * mem-limits.h (start_of_data):
5484 * menu.h (finish_menu_items):
5485 Add ATTRIBUTE_CONST.
5486 * emacs.c (DEFINE_DUMMY_FUNCTION):
5487 Declare the dummy function with ATTRIBUTE_CONST.
5488 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5489 Add decls with ATTRIBUTE_CONST.
5490
26bccfae
PE
5491 Minor improvements to make_formatted_string.
5492 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5493 where int is good enough, as vsprintf returns an int.
5494 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5495
a8290ec3
DA
54962012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5497
5498 Use make_formatted_string to avoid double length calculation.
5499 * lisp.h (make_formatted_string): New prototype.
5500 * alloc.c (make_formatted_string): New function.
5501 * buffer.c (Fgenerate_new_buffer_name): Use it.
5502 * dbus.c (syms_of_dbusbind): Likewise.
5503 * editfns.c (Fcurrent_time_zone): Likewise.
5504 * filelock.c (get_boot_time): Likewise.
5505 * frame.c (make_terminal_frame, set_term_frame_name)
5506 (x_report_frame_params): Likewise.
5507 * image.c (gs_load): Likewise.
5508 * minibuf.c (get_minibuffer): Likewise.
5509 * msdos.c (dos_set_window_size): Likewise.
5510 * process.c (make_process): Likewise.
5511 * xdisp.c (ensure_echo_area_buffers): Likewise.
5512 * xsettings.c (apply_xft_settings): Likewise.
5513
d01ba2f1
GM
55142012-07-09 Glenn Morris <rgm@gnu.org>
5515
5516 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5517 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5518 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5519 * nsterm.h (ns_etc_directory): Add it.
5520 * callproc.c [HAVE_NS]: Include nsterm.h.
5521 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5522
f1f924b6
DA
55232012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5524
5525 Move marker debugging code under MARKER_DEBUG.
5526 * marker.c (MARKER_DEBUG): Move marker debugging code under
5527 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5528 for bootstrap with --enable-checking (~3x slowdown reported
5529 by Juanma Barranquero <lekktu@gmail.com>).
5530 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5531
ab531b66
PE
55322012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5533
5534 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5535 See <http://bugs.gnu.org/11825#29>.
5536
c4b3bc8a
EZ
55372012-07-08 Eli Zaretskii <eliz@gnu.org>
5538
5539 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5540 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
5541 (display_line): Add commentary about displaying truncation glyphs
5542 on GUI frames.
5543 (produce_special_glyphs): Move here from term.c.
5544
5545 * term.c (produce_special_glyphs): Move to xdisp.c.
5546
5547 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5548 section.
c4b3bc8a 5549
b676b881
AS
55502012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5551
f17c5273
AS
5552 * xdisp.c (display_line): Avoid warning about implicit declaration
5553 of FRAME_FONT.
5554
298819b9
AS
5555 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5556
b676b881
AS
5557 * lisp.h: Remove empty conditional.
5558
6045c4fd
PE
55592012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5560
b3350bf9
PE
5561 * lread.c (load_path_check): Now static.
5562
6045c4fd
PE
5563 Fix some minor --with-ns problems found by static checking.
5564 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5565 (x_set_font) [!HAVE_X_WINDOWS]:
5566 * image.c (xpm_load_image) [HAVE_NS]:
5567 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5568 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5569 Remove unused local.
5570 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5571 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5572 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5573 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5574 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5575 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5576 Fix pointer signedness problem.
5577 * xfaces.c (FRAME_X_FONT_TABLE):
5578 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5579
929e7845
GM
55802012-07-07 Glenn Morris <rgm@gnu.org>
5581
5582 * lread.c (load_path_check): New function, split from init_lread.
5583 (init_lread): Reorganize. Motivation:
5584 If EMACSLOADPATH is set, check/warn about that rather than the
5585 defaults, which we are not going to use. Hence we can remove
5586 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5587 Don't warn if site-lisp directories are missing.
5588 If not installed, start from a blank load-path, since
5589 PATH_LOADSEARCH refers to the eventual installation directories.
5590
58dd0aa4
EZ
55912012-07-07 Eli Zaretskii <eliz@gnu.org>
5592
5593 Support truncation and continuation glyphs on GUI frames, when
5594 fringes are disabled. (Bug#11832)
5595 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
5596 continuation glyphs even if on GUI frames.
5597 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
5598 or both, are absent.
5599 (start_display, move_it_in_display_line_to): Handle the case of a
5600 GUI frame without a fringe to display continuation or truncation
5601 glyphs.
5602 (insert_left_trunc_glyphs): Support GUI frames: make sure
5603 truncation glyphs overwrite enough glyphs from the current line to
5604 have sufficient space in pixels.
5605 (display_line): Support truncation and continuation glyphs on GUI
5606 frames. If some spare pixels are left on the line after inserting
5607 the truncation glyphs, fill that space with a stretch glyph of a
5608 suitably computed width.
5609
5610 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5611 produce_glyphs, to support GUI sessions.
5612
31571fd7
PE
56132012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5614
5a16b9bc
PE
5615 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5616
f3047c75
PE
5617 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5618
31571fd7
PE
5619 Do not require float-time's arg to fit in time_t (Bug#11825).
5620 This works better on hosts where time_t is unsigned, and where
5621 float-time is applied to the (negative) difference between two times.
5622 * editfns.c (decode_time_components): Last arg is now double *,
5623 not int *, and means to store all the result as a double, without
5624 worrying about whether the seconds part fits in time_t.
5625 All callers changed.
5626 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5627 All callers changed.
5628 (Ffloat_time): Do not fail merely because the specified time falls
5629 outside of time_t range.
5630
4516fbef
GM
56312012-07-07 Glenn Morris <rgm@gnu.org>
5632
5633 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5634 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5635 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5636
07adc2c6
JB
56372012-07-07 Juanma Barranquero <lekktu@gmail.com>
5638
5639 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5640 Update dependencies.
5641
5642 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5643
fd573f31
PE
56442012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5645
fee5959d
PE
5646 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5647 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5648 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5649 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5650 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5651 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5652
fd573f31
PE
5653 * xfont.c (compare_font_names): Redo to omit the need for casts.
5654
ddadbc0e
AS
56552012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5656
fca8d6b6
AS
5657 * xfns.c (Fx_change_window_property): Doc fix.
5658 * w32fns.c (Fx_change_window_property): Doc fix.
5659
ddadbc0e
AS
5660 * w32fns.c (Fx_window_property): Accept the same arguments as the
5661 X Windows version. Doc fix.
5662 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5663
ed9265fc 56642012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5665 Eli Zaretskii <eliz@gnu.org>
5666
5667 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5668 Windows-specific code from nt/config.nt moved here.
5669 Obsolete settings removed.
5670
216ee680
PE
56712012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5672
5673 * process.c: Avoid unnecessary calls to gettime.
5674 (wait_reading_process_output): Don't get the time of day
5675 when gobbling data immediately and not waiting, as there's no need
5676 for it in that case. This removes a FIXME.
5677
bdd091e4
JD
56782012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5679
5680 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5681 is defined (Bug#11768).
5682
9d44f8ce
DA
56832012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5684
5685 Fix marker debugging code.
5686 * marker.c (byte_char_debug_check): Do not perform the check
5687 if buffer is not multibyte.
090bd7cb
JB
5688 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5689 Call byte_char_debug_check with correct arguments.
9d44f8ce 5690
90fc4786
DA
56912012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5692
5693 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
5694 * marker.c (byte_char_debug_check, count_markers):
5695 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
5696 (byte_debug_flag): Remove.
5697 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5698 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5699
7b7ae965
DA
57002012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5701
4e57b342
DA
5702 Avoid code repetition in marker-related functions.
5703 * marker.c (attach_marker): New function.
5704 (Fset_marker, set_marker_restricted, set_marker_both)
5705 (set_marker_restricted_both): Use it.
5706 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5707 Consistently rename charno to charpos.
5708 (marker_position): Add eassert.
5709 (marker_byte_position): Convert to eassert.
5710
57112012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5712
5713 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 5714 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 5715 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 5716
657924ff
DA
57172012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5718
5719 Introduce fast path for the widely used marker operation.
5720 * alloc.c (build_marker): New function.
5721 * lisp.h (build_marker): New prototype.
5722 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5723 * composite.c (autocmp_chars): Likewise.
5724 * editfns.c (buildmark): Remove.
5725 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5726 (save_restriction_save): Use build_marker.
5727 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5728 * window.c (save_window_save): Likewise.
5729
041a49a6
DA
57302012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5731
5732 Do not use Fdelete_overlay in delete_all_overlays
5733 to avoid redundant calls to unchain_overlay.
5734 * buffer.c (drop_overlay): New function.
5735 (delete_all_overlays, Fdelete_overlay): Use it.
5736 * minibuf.c (get_minibuffer): Fix comment.
5737
7dca65a4
PE
57382012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5739
5740 Port to OpenBSD 5.1 amd64.
5741 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5742 This is needed for OpenBSD, and should be harmless on all BSD systems.
5743 Also, include <sys/sysctl.h>, as it should be available on all
5744 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5745 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5746 use p_pid member, not kp_proc.pid.
5747
8eb876e2
GM
57482012-07-06 Glenn Morris <rgm@gnu.org>
5749
5750 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5751
38182d90
PE
57522012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5753
5754 More xmalloc and related cleanup.
5755 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5756 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5757 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5758 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5759 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5760 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5761 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5762 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5763 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5764 * xterm.c:
5765 Omit needless casts involving void * pointers and allocation.
5766 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5767 as the former is more robust if P's type is changed.
5768 Prefer xzalloc to xmalloc + memset 0.
5769 Simplify malloc-or-realloc to realloc.
5770 Don't worry about xmalloc returning a null pointer.
5771 Prefer xstrdup to xmalloc + strcpy.
5772 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5773 growing it.
5774 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5775 alloca of a constant.
5776
6dd5a677
EZ
57772012-07-05 Eli Zaretskii <eliz@gnu.org>
5778
5779 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5780 hscroll is larger than the line width. Fixes long and futile
5781 looping inside extend_face_to_end_of_line (on a TTY) producing
5782 glyphs that are not needed and thrown away.
5783
6b312f0f
DA
57842012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5785
5786 * marker.c (set_marker_restricted_both): Simplify by using
5787 clip_to_bounds.
5788
f520ef9b
PE
57892012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5790
5791 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5792
383b7c95
JD
57932012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5794
5795 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5796 not defined (Bug#11768).
5797 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5798 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5799 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5800 followed by gtk_box_set_homogeneous (Bug#11768).
5801 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5802 (update_theme_scrollbar_width, xg_create_scroll_bar):
5803 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5804 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5805 (is_box_type): New function (Bug#11768).
5806 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5807 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5808 with default display (Bug#11768).
5809
d6e7bf45
EZ
58102012-07-05 Eli Zaretskii <eliz@gnu.org>
5811
5812 * xdisp.c (window_hscroll_limited): New function.
5813 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5814 coordinates when window's hscroll is set to insanely large
5815 values. (Bug#11857)
5816
431391ec
JB
58172012-07-05 Juanma Barranquero <lekktu@gmail.com>
5818
5819 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5820 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5821
23f86fce
DA
58222012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5823
5824 Cleanup xmalloc.
5825 * lisp.h (xzalloc): New prototype. Omit needless casts.
5826 * alloc.c (xzalloc): New function. Omit needless casts.
5827 * charset.c: Omit needless casts. Convert all calls to
5828 xmalloc with following memset to xzalloc.
5829 * dispnew.c: Likewise.
5830 * fringe.c: Likewise.
5831 * image.c: Likewise.
5832 * sound.c: Likewise.
5833 * term.c: Likewise.
5834 * w32fns.c: Likewise.
5835 * w32font.c: Likewise.
5836 * w32term.c: Likewise.
5837 * xfaces.c: Likewise.
5838 * xfns.c: Likewise.
5839 * xterm.c: Likewise.
5840 * atimer.c: Omit needless casts.
5841 * buffer.c: Likewise.
5842 * callproc.c: Likewise.
5843 * ccl.c: Likewise.
5844 * coding.c: Likewise.
5845 * composite.c: Likewise.
5846 * doc.c: Likewise.
5847 * doprnt.c: Likewise.
5848 * editfns.c: Likewise.
5849 * emacs.c: Likewise.
5850 * eval.c: Likewise.
5851 * filelock.c: Likewise.
5852 * fns.c: Likewise.
5853 * gtkutil.c: Likewise.
5854 * keyboard.c: Likewise.
5855 * lisp.h: Likewise.
5856 * lread.c: Likewise.
5857 * minibuf.c: Likewise.
5858 * msdos.c: Likewise.
5859 * print.c: Likewise.
5860 * process.c: Likewise.
5861 * region-cache.c: Likewise.
5862 * search.c: Likewise.
5863 * sysdep.c: Likewise.
5864 * termcap.c: Likewise.
5865 * terminal.c: Likewise.
5866 * tparam.c: Likewise.
5867 * w16select.c: Likewise.
5868 * w32.c: Likewise.
5869 * w32reg.c: Likewise.
5870 * w32select.c: Likewise.
5871 * w32uniscribe.c: Likewise.
5872 * widget.c: Likewise.
5873 * xdisp.c: Likewise.
5874 * xmenu.c: Likewise.
5875 * xrdb.c: Likewise.
5876 * xselect.c: Likewise.
5877
0497dc44
PE
58782012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5879
5880 * fileio.c (time_error_value): Check the right error number.
5881 Problem reported by Troels Nielsen in
5882 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5883
356e7178
PE
58842012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5885
4e71fd89
PE
5886 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5887 This should be fixed in a better way; see Eli Zaretskii in
5888 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5889 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5890
f0941253
PE
5891 * fileio.c (time_error_value): Rename from special_mtime.
5892 The old name's problems were noted by Eli Zaretskii in
5893 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5894
065c9eb4
PE
5895 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5896 This variable's comment says Emacs needs at least one GDB-visible
5897 symbol of type enum pvec_type, to work around GDB problems.
5898 The symbol's value doesn't matter.
5899
356e7178
PE
5900 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5901 that causes compilation to fail on pre-C99 compilers.
5902
ed9265fc 59032012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5904
5905 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5906 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5907
3884d954
DA
59082012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5909
d209e2fb 5910 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5911 headers for buffer_defaults and buffer_local_symbols.
5912 Reported by Juanma Barranquero <lekktu@gmail.com>.
5913
ee28be33
SM
59142012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5915
5916 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5917 * lisp.h (enum pvec_type): Use fewer bits.
5918 (PSEUDOVECTOR_SIZE_BITS): New constant.
5919 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5920 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5921 change in pvec_type.
5922 (PSEUDOVECTOR_TYPEP): New macro.
5923 (TYPED_PSEUDOVECTORP): Use it.
5924 * fns.c (internal_equal): Adapt code to extract pvectype.
5925 * emacs.c (gdb_pvec_type): Update type.
5926 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5927 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5928 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5929 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5930 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5931 abusing vector->header.next.nbytes.
5932 (live_vector_p): Use PVEC_TYPE.
5933 (mark_object): Adapt code to extract pvectype. Use switch.
5934
c7f2cd7f
PE
59352012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5936
5937 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5938 Tighten new eassert a bit.
5939
8ce70ed2
DA
59402012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5941
5942 Fix compilation with --enable-gcc-warnings and -O1
5943 optimization level.
5944 * doprnt.c (doprnt): Change type of tem to int, initialize
5945 to avoid compiler warning. Add eassert.
5946 * search.c (simple_search): Initialize match_byte to avoid
5947 compiler warning. Add eassert.
5948
dea7f1e5
PE
59492012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5950
24a212eb
PE
5951 Avoid weird behavior with large horizontal scrolls.
5952 Without this change, for example, large hscroll values would
5953 mess up Emacs's display on Fedora 15 x86, presumably due to
5954 overflows in int calculations in the display code.
5955 Also, if buffers had long lines, Emacs would freeze.
5956 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5957 (set_window_hscroll): New function, containing the old guts of
5958 Fset_window_hscroll. Return the clipped value.
5959 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5960 This avoids the need to check against PTRDIFF_MAX.
5961
dea7f1e5
PE
5962 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5963
76046526
DA
59642012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5965
5966 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5967
39adff0d
PE
59682012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5969
63807d47
PE
5970 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5971 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5972 since GCC 4.4.6 issues a bogus warning for them.
5973
39adff0d
PE
5974 Fix bugs in file timestamp newness comparisons.
5975 * fileio.c (Ffile_newer_than_file_p):
5976 * lread.c (Fload): Use full timestamp resolution of files,
5977 not just the 1-second resolution, so that files that are only
5978 slightly newer still count as newer.
5979 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5980 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5981
dbeed9a6
PE
59822012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5983
5984 * fileio.c: Improve handling of file time marker. (Bug#11852)
5985 (special_mtime): New function.
5986 (Finsert_file_contents, Fverify_visited_file_modtime):
5987 Use it to set special mtime values consistently.
5988
636334d6
AS
59892012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5990
5991 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5992 marker for non-existing file. (Bug#11852)
5993
e2017fe2
GM
59942012-07-03 Glenn Morris <rgm@gnu.org>
5995
5996 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5997 and did not make it into globals.h).
5998
404dbd37
TT
59992012-07-03 Tom Tromey <tromey@redhat.com>
6000
6001 * window.c (Fset_window_margins, Fset_window_fringes)
6002 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6003 * textprop.c (Fprevious_property_change): No longer static.
6004 * syntax.c (Fsyntax_table_p): No longer static.
6005 * process.c (Fget_process, Fprocess_datagram_address): No longer
6006 static.
6007 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6008 * keyboard.c (Fcommand_execute): No longer static.
6009 Remove EXFUN.
6010 * insdel.c (Fcombine_after_change_execute): No longer static.
6011 * image.c (Finit_image_library): No longer static.
6012 * fileio.c (Fmake_symbolic_link): No longer static.
6013 * eval.c (Ffetch_bytecode): No longer static.
6014 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
6015 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6016 No longer static.
404dbd37
TT
6017 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6018 static.
6019 * dired.c (Ffile_attributes): No longer static.
6020 * composite.c (Fcomposition_get_gstring): No longer static.
6021 * callproc.c (Fgetenv_internal): No longer static.
6022
6023 * ccl.h: Remove EXFUNs.
6024 * buffer.h: Remove EXFUNs.
6025 * dispextern.h: Remove EXFUNs.
6026 * intervals.h: Remove EXFUNs.
6027 * fontset.h: Remove EXFUN.
6028 * font.h: Remove EXFUNs.
6029 * dosfns.c (system_process_attributes): Remove EXFUN.
6030 * keymap.h: Remove EXFUNs.
6031 * lisp.h: Remove EXFUNs.
6032 * w32term.h: Remove EXFUNs.
6033 * window.h: Remove EXFUNs.
6034 * xsettings.h: Remove EXFUN.
6035 * xterm.h: Remove EXFUN.
6036
8e4fd1e1
GM
60372012-07-03 Glenn Morris <rgm@gnu.org>
6038
6039 * lisp.h (Frandom): Make it visible to C.
6040 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6041 buffer for invisible buffers. (Bug#1229)
6042
ca95b3eb
DA
60432012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6044
6045 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6046 values which aren't power of 2.
14ae4239
BT
6047 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6048 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
6049 accordingly.
6050
7555c33f
SM
60512012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6052
6053 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6054
6055 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6056
d12e8f5a
DA
60572012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6058
6059 * alloc.c (allocate_vector_block): Remove redundant
6060 calls to mallopt if DOUG_LEA_MALLOC is defined.
6061 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6062 avoid calls to mallopt if zero_vector is returned.
6063
296094c3
DA
60642012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6065
6066 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6067 is enabled, avoid dereferencing NULL current_sblock if
6068 running undumped.
6069
36429c89
DA
60702012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6071
6072 Cleanup basic buffer management.
6073 * buffer.h (struct buffer): Change layout to use generic vector
6074 marking code. Fix some comments. Change type of 'clip_changed'
6075 to bitfield. Remove unused #ifndef old.
6076 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6077 (GET_OVERLAYS_AT): Fix indentation.
6078 (for_each_per_buffer_object_at): New macro.
6079 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6080 (Fbuffer_local_variables): Use it.
6081 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6082 * alloc.c (allocate_buffer): Adjust to match new layout of
6083 struct buffer. Fix comment.
6084 (mark_overlay): New function.
6085 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6086 Lisp area of struct buffer.
6087 (mark_object): Use it. Adjust marking of misc objects
6088 and related comments.
6089
3b3e4cac
PE
60902012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6091
6092 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6093 wrapper that is not needed because the wrapped code is a no-op (zero
6094 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6095 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6096
cf5c0175
DA
60972012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6098
6099 * alloc.c (mark_buffer): Simplify. Remove prototype.
6100 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 6101 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
6102 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6103 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 6104
ca26824c
GM
61052012-06-30 Glenn Morris <rgm@gnu.org>
6106
2e4c5312
GM
6107 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6108
ca26824c
GM
6109 * epaths.in (PATH_SITELOADSEARCH): New.
6110 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6111 This is rather than relying on --enable-locallisppath elements
6112 having "site-lisp" in their names. (Bug#10208#25, 11658)
6113
0d23c240
EZ
61142012-06-30 Eli Zaretskii <eliz@gnu.org>
6115
c9240d7a
EZ
6116 * w32proc.c (sys_select): Accept and ignore one more argument.
6117
6118 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6119
0d23c240 6120 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 6121 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
6122
6123 * sysdep.c: Don't include dos.h and dosfns.h.
6124
6125 * process.c (sys_select):
6126 * msdos.c (sys_select): Accept one more argument and ignore it.
6127
6128 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6129 adapt data types and code to that.
6130
6131 * dosfns.c:
6132 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6133 which clashes with the gnulib function of the same name.
6134
af5a5a98
AS
61352012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6136
c5e4379c
AS
6137 * font.c (font_style_to_value, font_style_symbolic)
6138 (font_prop_validate_style): Add type checks for values in
6139 font_style_table.
6140
af5a5a98
AS
6141 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6142 argument.
6143 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6144 uses.
6145
8d38f461
EZ
61462012-06-29 Eli Zaretskii <eliz@gnu.org>
6147
2e5a6631
EZ
6148 * xdisp.c (try_window_id): Undo last change.
6149
8d38f461
EZ
6150 * w32.c (getwd): Adjust commentary about startup_dir.
6151 (init_environment): Always call sys_access, even in non-MSVC
6152 builds. Don't chdir to the directory of the Emacs executable.
6153 This undoes code from 1997 which was justified by the need to
6154 "avoid conflicts when removing and renaming directories". But its
6155 downside was that every relative file name was being interpreted
6156 relative to the directory of the Emacs executable, which can never
6157 be TRT. In particular, it broke sys_access when called with
6158 relative file names.
6159 (sys_access): Map GetLastError to errno.
6160
2af3565e
DA
61612012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6162
6163 * window.h (struct window): Change type of 'fringes_outside_margins'
6164 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 6165 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
6166 Adjust comment.
6167 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6168 to ptrdiff_t.
6169
c8d3a25c 61702012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 6171
c8d3a25c
GM
6172 * gnutls.c (emacs_gnutls_handshake):
6173 Add QUIT to make the loop interruptible.
57570cd3 6174
c8d3a25c 61752012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 6176
c8d3a25c
GM
6177 * charset.c (init_charset): Make lack of etc/charsets fatal.
6178
3e984ee8
DA
61792012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6180
6181 * editfns.c (region_limit): Fix type mismatch.
6182
ef884f23
DA
61832012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6184
6185 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6186 undefined. Convert from xassert to eassert.
6187 * nsmenu.m: Convert from xassert to eassert.
6188 * nsterm.m: Likewise.
6189
7d7e0027
SM
61902012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6191
6192 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6193
aa754e6a
PE
61942012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6195
6196 Avoid integer overflow on scroll-left and scroll-right.
6197 * window.c (HSCROLL_MAX): New macro.
6198 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6199 overflow when requested scroll falls outside ptrdiff_t range.
6200
80b00b08
DA
62012012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6202
6203 * window.h (struct window): Change type of 'hscroll',
6204 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6205 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6206 Adjust users accordingly.
6207 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6208 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6209 from EMACS_INT to ptrdiff_t.
6210 (make_window): Omit redundant initialization.
6211
62b2bcf6
JB
62122012-06-28 Juanma Barranquero <lekktu@gmail.com>
6213
6214 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6215
45942c7d
DA
62162012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6217
6218 * window.h (struct window): Change type of 'use_time' and
6219 'sequence_number' from Lisp_Object to int.
6220 * frame.c (make_frame): Adjust users accordingly.
6221 * print.c (print_object): Likewise.
6222 * window.c (select_window, Fwindow_use_time, make_parent_window)
6223 (make_window): Likewise.
6224
e509cfa6
DA
62252012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6226
6227 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6228 enabled with --enable-checking=[all,glyphs] configure option.
6229 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6230 adjust comments accordingly.
6231 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6232 undefined, adjust comments accordingly.
6233 * image.c: Likewise.
6234 * scroll.c: Likewise.
6235 * w32fns.c: Likewise.
6236 * w32term.c: Likewise.
6237 * xdisp.c: Likewise.
6238 * xfaces.c: Likewise.
6239 * xfns.c: Likewise.
6240 * xterm.c: Likewise.
6241
a54e2c05
DA
62422012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6243
6244 Generalize run-time debugging checks.
6245 * dispextern.h (XASSERTS): Remove.
6246 * fontset.c (xassert): Remove.
6247 Convert from xassert to eassert.
6248 * alloc.c: Convert from xassert to eassert.
6249 * bidi.c: Likewise.
6250 * dispnew.c: Likewise.
6251 * fns.c: Likewise.
6252 * fringe.c: Likewise.
6253 * ftfont.c: Likewise.
6254 * gtkutil.c: Likewise.
6255 * image.c: Likewise.
6256 * keyboard.c: Likewise.
6257 * menu.c: Likewise.
6258 * process.c: Likewise.
6259 * scroll.c: Likewise.
6260 * sound.c: Likewise.
6261 * term.c: Likewise.
6262 * w32console.c: Likewise.
6263 * w32fns.c: Likewise.
6264 * w32term.c: Likewise.
6265 * window.c: Likewise.
6266 * xdisp.c: Likewise.
6267 * xfaces.c: Likewise.
6268 * xfns.c: Likewise.
6269 * xselect.c: Likewise.
6270 * xterm.c: Likewise.
6271
1ec4b7b2
SM
62722012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6273
6274 * fns.c (maybe_resize_hash_table): Output message when growing the
6275 purify-hashtable.
6276
2014308a
DA
62772012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6278
6279 * alloc.c (allocate_string_data): Remove dead code.
6280 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6281 avoid GCC warning about unused macro.
6282
246155eb
DA
62832012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6284
6285 * alloc.c (allocate_string): Omit intervals initialization.
6286 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6287 as in make_pure_string and make_pure_c_string.
6288
43184b7b
DA
62892012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6290
d209e2fb 6291 * alloc.c (allocate_string): Fix last change.
43184b7b 6292
3fe6dd74
DA
62932012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6294
d209e2fb 6295 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
6296 to memset, add explicit initialization where appropriate.
6297
1ba6038a
GM
62982012-06-27 Glenn Morris <rgm@gnu.org>
6299
6300 * lisp.mk (lisp): Remove paths.elc.
6301
c89926a5
CY
63022012-06-27 Chong Yidong <cyd@gnu.org>
6303
6304 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6305
ed6b3510
JW
63062012-06-26 John Wiegley <johnw@newartisans.com>
6307
1ec4b7b2 6308 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
6309 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6310
ed6b3510
JW
6311 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6312 when building with Clang.
6313
8edd4a2b
SM
63142012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6315
6316 * eval.c (Fapply): Allow calling it with a single argument.
6317
f6f62d1b
EZ
63182012-06-26 Eli Zaretskii <eliz@gnu.org>
6319
6320 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6321 _stricmp and _strnicmp.
6322 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6323
62efea5e
DA
63242012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6325
6326 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6327 allocated window.
6328 (allocate_process): Likewise for new process.
8edd4a2b 6329 (allocate_terminal): Change to use offsetof.
62efea5e
DA
6330 (allocate_frame): Likewise.
6331 * frame.c (make_frame): Omit redundant initialization.
6332 * window.c (make_parent_window): Use memset.
6333 (make_window): Omit redundant initialization.
6334 * process.c (make_process): Omit redundant initialization.
6335 * terminal.c (create_terminal): Likewise.
6336
42997f4d
DA
63372012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6338
6339 * term.c (delete_tty): Remove redundant call to memset.
6340
1130ecfc
DA
63412012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6342
6343 * alloc.c: Remove build_string.
6344 * lisp.h: Define build_string as static inline. This provides
6345 a better opportunity to optimize away calls to strlen when the
6346 function is called with compile-time constant argument.
6347 * image.c (imagemagick_error): Convert to build_string.
6348 * w32proc.c (sys_spawnve): Likewise.
6349 * xterm.c (x_term_init): Likewise.
6350
cf38a720
PE
63512012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6352
99027bdd
PE
6353 Use sprintf return value instead of invoking strlen on result.
6354 In the old days this wasn't portable, since some sprintf
6355 implementations returned char *. But they died out years ago and
6356 Emacs already assumes sprintf returns int.
6357 Similarly for float_to_string.
6358 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6359 * ccl.c (ccl_driver):
6360 * character.c (string_escape_byte8):
6361 * data.c (Fnumber_to_string):
6362 * doprnt.c (doprnt):
6363 * print.c (print_object):
6364 * xdisp.c (message_dolog):
6365 * xfns.c (syms_of_xfns):
6366 Use sprintf or float_to_string result to avoid need to call strlen.
6367 * data.c (Fnumber_to_string):
6368 Use make_unibyte_string, since the string must be ASCII.
6369 * lisp.h, print.c (float_to_string): Now returns int length.
6370 * term.c (produce_glyphless_glyph):
6371 Use sprintf result rather than recomputing it.
6372
cf38a720
PE
6373 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6374 * Makefile.in (ALL_CFLAGS):
6375 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6376 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6377
3511c784
DA
63782012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6379
0a08eb21 6380 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
6381 strcasecmp if available.
6382 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6383
fb7da12e
AS
63842012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6385
6386 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6387 Avoid comma operator.
6388 * menu.c (push_submenu_start, push_submenu_end)
6389 (push_left_right_boundary, push_menu_pane): Likewise.
6390 * msdos.c (dos_rawgetc): Likewise.
6391
afa2ffd8
DA
63922012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6393
6394 * xfns.c (xic_create_fontsetname): Remove redundant calls
6395 to memset.
6396
b3b4476b
PE
63972012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6398
4495ff38
PE
6399 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6400 sprintf already null-terminates its output.
6401
b3b4476b
PE
6402 * xfns.c (x_window): Remove redundant cast.
6403
b00876c9
DA
64042012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6405
6406 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6407 `const char *' to `char *' to avoid compiler warning.
6408
d188e26b
PE
64092012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6410
885d1d74
PE
6411 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6412 instead of truncating it to 63 (admittedly a generous limit).
6413
d188e26b
PE
6414 * process.c: Fix spelling and caps in comments.
6415
e2f560b1
DN
64162012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6417
e86db54b 6418 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
6419 * sysdep.c (setpgrp): Remove definition, not used in this file.
6420
7583a3a1
JB
64212012-06-24 Juanma Barranquero <lekktu@gmail.com>
6422
6423 * makefile.w32-in: Update dependencies.
6424
696056c2
EZ
64252012-06-24 Eli Zaretskii <eliz@gnu.org>
6426
6427 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6428 (SYSTIME_H): Add nt/inc/sys/time.h.
6429
6430 * systime.h [WINDOWSNT]: Include sys/time.h.
6431
6432 * s/ms-w32.h (struct timespec): Definition moved from
6433 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6434
845ca893
PE
64352012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6436
6437 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6438 * buffer.h (buffer_slot_type_mismatch):
6439 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6440 * eval.c (unwind_to_catch):
6441 * image.c (my_png_error, my_error_exit):
6442 * keyboard.c (quit_throw_to_read_char, user_error)
6443 (Fexit_recursive_edit, Fabort_recursive_edit):
6444 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6445 (wrong_type_argument, buffer_overflow, __executable_start)
6446 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6447 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6448 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6449 (fatal):
6450 (child_setup) [!DOS_NT]:
6451 * lread.c (end_of_file_error, invalid_syntax):
6452 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6453 * puresize.h (pure_write_error):
6454 * search.c (matcher_overflow):
6455 * sound.c (sound_perror, alsa_sound_perror):
6456 * sysdep.c, syssignal.h (croak):
6457 * term.c (maybe_fatal, vfatal):
6458 * textprop.c (text_read_only):
6459 * undo.c (user_error):
6460 * unexmacosx.c (unexec_error):
6461 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6462 Use _Noreturn rather than NO_RETURN.
6463 No need for separate decl merely because of _Noreturn.
6464 * sound.c (sound_warning, parse_sound):
6465 Remove unnecessary forward decls.
6466
f1dd8073
PE
64672012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6468
6469 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6470 * lisp.h (WAIT_READING_MAX): New macro.
6471 * dispnew.c (Fsleep_for, sit_for):
6472 * keyboard.c (kbd_buffer_get_event):
6473 * process.c (Faccept_process_output):
6474 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6475 This improves on the previous patch, which introduced a bug
6476 when time_t is unsigned and as wide as intmax_t.
6477 See <http://bugs.gnu.org/9000#51>.
6478
b82c1755
EZ
64792012-06-23 Eli Zaretskii <eliz@gnu.org>
6480
6481 * dispnew.c (sit_for, Fsleep_for):
6482 * keyboard.c (kbd_buffer_get_event):
6483 * process.c (Faccept_process_output): Avoid compiler warnings when
6484 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6485
ca300656
JB
64862012-06-23 Juanma Barranquero <lekktu@gmail.com>
6487
049ec95b
JB
6488 * makefile.w32-in: Update dependencies.
6489
ca300656
JB
6490 * w32.c (ltime): Add return type and declare static.
6491 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6492
db7b8d06
PE
64932012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6494
6495 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6496 Privately reported by Herbert J. Skuhra.
6497 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6498 All uses changed.
6499 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6500 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6501
0bd8297f
EZ
65022012-06-23 Eli Zaretskii <eliz@gnu.org>
6503
96512555
EZ
6504 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6505 last argument of make_unibyte_string.
6506
0bd8297f
EZ
6507 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6508 language ID in the event parameters.
6509
6510 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6511 event.code, not the obscure "character set ID".
6512
63def6b6
CY
65132012-06-23 Chong Yidong <cyd@gnu.org>
6514
6515 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6516
e8a02204
EZ
65172012-06-23 Eli Zaretskii <eliz@gnu.org>
6518
388cdec0
EZ
6519 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6520 * w32.c (fdutimens): New function.
6521
6522 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6523
6524 * s/ms-w32.h (pselect): Redirect to sys_select.
6525
6526 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6527
e8a02204
EZ
6528 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6529 in the logic of incrementing and decrementing the value of
6530 use_relocatable_buffers.
6531
d054f3fb
PE
65322012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6533
6534 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6535 Privately reported by Herbert J. Skuhra.
6536 [__FreeBSD__]: Remove "*/" typo after "#include".
6537 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6538 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6539 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6540 Don't assume EMACS_TIME and struct timeval are the same type.
6541
d35af63c
PE
65422012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6543
6544 Support higher-resolution time stamps (Bug#9000).
6545 The time stamps are only nanosecond-resolution at the C level,
6546 since that's the best that any real-world system supports now.
6547 But they are picosecond-resolution at the Lisp level, as that's
6548 easy, and leaves room for future OS improvements.
6549
6550 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6551 (LIBES): Use it.
6552
6553 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6554 Don't get current time unless it's needed.
6555
6556 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6557 now provides it if it's absent.
6558 (start_atimer): Port to higher-res time stamps.
6559 Check for time stamp overflow. Don't get current time more
6560 often than is needed.
6561
6562 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6563 Include systime.h, not time.h.
6564 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6565
6566 * dired.c: Include stat-time.h.
6567 (Ffile-attributes): File times now have higher resolution.
6568
6569 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6570 (struct image): Timestamp now has higher resolution.
6571
6572 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6573 has at least microseconds now. All uses removed.
6574 (update_frame, update_single_window, update_window, update_frame_1)
6575 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 6576 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
6577
6578 * editfns.c (time_overflow): Now extern.
6579 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6580 (float-time, Fformat_time_string, Fcurrent_time_string)
6581 (Fcurrent_time_zone): Accept and generate higher-resolution
6582 time stamps.
6583 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6584 (decode_time_components, lisp_seconds_argument): New functions.
6585 (make_time): Now static.
6586 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6587 Report an error if the time is invalid, rather than having the caller
6588 do that.
6589
6590 * fileio.c: Include <stat-time.h>
6591 (Fcopy_file): Copy higher-resolution time stamps.
6592 Prefer to set the time stamp via a file descriptor if that works.
6593 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6594 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6595 (Fvisited_file_modtime, Fset_visited_file_modtime):
6596 Support higher-resolution time stamps.
6597
6598 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6599
6600 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6601
6602 * image.c (prepare_image_for_display, clear_image_cache)
6603 (lookup_image): Port to higer-resolution time stamps.
6604
6605 * keyboard.c (start_polling, bind_polling_period):
6606 Check for time stamp overflow.
6607 (read_char, kbd_buffer_get_event, timer_start_idle)
6608 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6609 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6610 Port to higher-resolution time stamps. Do not assume time_t is signed.
6611 (decode_timer): New function. Timers are now vectors of length 9,
6612 not 8, to accommodate the picosecond component.
6613 (timer_check_2): Use it.
6614
6615 * nsterm.m (select_timeout, timeval_subtract): Remove.
6616 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6617 as they're a bit more accurate and handle overflow better.
6618 (ns_select): Change prototype to be compatible with pselect.
6619 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6620 * nsterm.h (ns_select): Adjust prototype.
6621
6622 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6623 us-resolution time stamps.
6624 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6625
6626 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6627
6628 * lisp.h (time_overflow): New decl.
6629 (wait_reading_process_output): First arg is now intmax_t, not int,
6630 to accommodate larger waits.
6631
6632 * process.h (struct Lisp_Process.read_output_delay):
6633 Now counts nanoseconds, not microseconds.
6634 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6635 EMACS_HAS_USECS.
6636 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6637 (wait_reading_process_output):
6638 Port to ns-resolution time stamps.
6639 (Faccept_process_output, wait_reading_process_output):
6640 Check for time stamp overflow. Do not assume time_t is signed.
6641 (select_wrapper): Remove; we now use pselect.
6642 (Fprocess_attributes): Now generates ns-resolution time stamps.
6643
6644 * sysdep.c: Include utimens.h. Don't include utime.h
6645 or worry about struct utimbuf; gnulib does that for us now.
6646 (gettimeofday): Remove; gnulib provides a substitute.
6647 (make_timeval): New function.
6648 (set_file_times): Now sets ns-resolution time stamps.
6649 New arg FD; all uses changed.
6650 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6651 (system_process_attributes):
6652 Now returns ns-resolution time stamp. All uses changed.
6653 Check for time stamp overflow.
6654
6655 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6656 provides a substitute now.
6657
6658 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6659 since it guarantees struct timespec.
6660 (EMACS_TIME): Now struct timespec, so that we can support
6661 ns-resolution time stamps.
6662 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6663 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6664 (EMACS_USECS): Remove.
6665 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6666 so multiply the arg by 1000 before storing it.
6667 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6668 New macros.
6669 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6670 Port to ns-resolution time stamps.
6671 (EMACS_TIME_NEG_P): Remove; replaced by....
6672 (EMACS_TIME_SIGN): New macro.
6673 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6674 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6675 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6676 (make_timeval, make_lisp_time, decode_time_components): New decls.
6677 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6678 that it mishandled time_t overflow. You can't compare by subtracting!
6679 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6680 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6681
6682 * term.c: Include <sys/time.h>.
6683 (timeval_to_Time): New function, for proper overflow wraparound.
6684 (term_mouse_position, term_mouse_click): Use it.
6685
6686 * undo.c (record_first_change): Support higher-resolution time stamps
6687 in the undo buffer.
6688 (Fprimitive_undo): Use them when restoring time stamps.
6689
6690 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6691 (w32_get_internal_run_time):
6692 Port to higher-resolution Emacs time stamps.
6693 (ltime): Now accepts single 64-bit integer, as that's more convenient
6694 for callers.
6695
6696 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6697
6698 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6699 for compatibility with pselect. Support ns-resolution time stamps.
6700
6701 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6702
6703 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6704 Check for time stamp overflow, and support ns-resolution time stamps.
6705
6706 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6707 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6708 (timeval_subtract): Remove; no longer needed.
6709 (XTflash, XTring_bell, x_wait_for_event):
6710 Port to ns-resolution time stamps. Don't assume time_t is signed.
6711
b6a92dfe
CY
67122012-06-22 Chong Yidong <cyd@gnu.org>
6713
6714 * xdisp.c (x_consider_frame_title): Revert last change.
6715
d251c37c
EZ
67162012-06-22 Eli Zaretskii <eliz@gnu.org>
6717
6718 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6719 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6720 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6721 staticidx goes up to 1597 out of 1600 = 0x640.)
6722
f10deafb
PE
67232012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6724
6725 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6726 Otherwise, the umask might be mistakenly 0 while handling input signals.
6727
ec6de1e2
SM
67282012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6729
6730 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6731
28be1ada
DA
67322012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6733
6734 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6735 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6736 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6737 access to `contents' member of Lisp_Vector objects with AREF and ASET
6738 where appropriate.
6739
c6bf3022
CY
67402012-06-19 Chong Yidong <cyd@gnu.org>
6741
6742 * frame.c (delete_frame): When selecting a frame on a different
6743 text terminal, do not alter the terminal's top-frame.
6744
6745 * xdisp.c (format_mode_line_unwind_data): Record the target
6746 frame's selected window and its terminal's top-frame.
6747 (unwind_format_mode_line): Restore them.
6748 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6749 Callers changed.
6750 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6751 since tty frames can be explicitly named.
6752 (prepare_menu_bars): Likewise.
6753
6754 * term.c (Ftty_top_frame): New function.
6755
defd4196
PE
67562012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6757
6758 Port byte-code-meter to modern targets.
6759 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6760 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6761 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6762 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6763 (METER_1, METER_2): Simplify.
6764
1053a871
SM
67652012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6766
6767 * data.c (Fdefalias): Return `symbol' (bug#11686).
6768
b7e8d081
MR
67692012-06-18 Martin Rudalics <rudalics@gmx.at>
6770
6771 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6772 gets killed during executing of this function (Bug#11665).
6773 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6774 (Vkill_buffer_query_functions): In doc-string say that functions
6775 run by this hook should not change the current buffer.
6776
7ea2b339
PE
67772012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6778
6779 Fix recently-introduced process.c problems found by static checking.
6780 * process.c (write_queue_push, write_queue_pop, send_process):
6781 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6782 (write_queue_pop): Fix pointer signedness problem.
6783 (send_process): Remove unused local.
6784
96a313a1
CY
67852012-06-17 Chong Yidong <cyd@gnu.org>
6786
6787 * xdisp.c (redisplay_internal): No need to redisplay terminal
6788 frames that are not on top.
6789
20ca2e94
TN
67902012-06-17 Troels Nielsen <bn.troels@gmail.com>
6791
6792 * process.c (make_process): Initialize write_queue.
6793 (write_queue_push, write_queue_pop): New functions.
6794 (send_process): Use them to maintain correct ordering of process
6795 writes (Bug#10815).
6796
9a900ca9
PE
67972012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6798
310fbfa8
PE
6799 * lisp.h (eassert): Assume C89 or later.
6800 This removes the need for CHECK.
6801 (CHECK): Remove. Its comments about always evaluating its
6802 argument were confusing, as 'eassert' typically does not evaluate
6803 its argument.
6804
27bb1ca4
PE
6805 * coding.c (produce_chars): Use ptrdiff_t, not int.
6806
9a900ca9
PE
6807 * xterm.c (x_draw_underwave): Check for integer overflow.
6808 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6809
41b7f8bc 68102012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6811
6812 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6813 referenced (Bug#11583).
6814
9b0e3eba
AA
68152012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6816
6817 Implement wave-style variant of underlining.
6818 * dispextern.h (face_underline_type): New enum.
6819 (face): Add field for underline type.
6820 * nsterm.m (ns_draw_underwave): New function.
6821 (ns_draw_text_decoration): Use it.
6822 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6823 New functions.
6824 (x_draw_glyph_string): Use them.
6825 * xfaces.c (Qline, Qwave): New Lisp objects.
6826 (check_lface_attrs, merge_face_ref)
1053a871
SM
6827 (Finternal_set_lisp_face_attribute, realize_x_face):
6828 Handle wave-style underline face attributes.
9b0e3eba
AA
6829 * xterm.c (x_draw_underwave): New function.
6830 (x_draw_glyph_string): Use it.
6831
0fb52f11
JB
68322012-06-16 Juanma Barranquero <lekktu@gmail.com>
6833
6834 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6835 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6836 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6837 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6838 ($(BLD)/w32select.$(O)): Update dependencies.
6839
e5560ff7
AS
68402012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6841
6842 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6843 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6844 * character.c (_fetch_multibyte_char_p): Remove.
6845 * alloc.c: Include "character.h" before "buffer.h".
6846 * bidi.c: Likewise.
6847 * buffer.c: Likewise.
6848 * bytecode.c: Likewise.
6849 * callint.c: Likewise.
6850 * callproc.c: Likewise.
6851 * casefiddle.c: Likewise.
6852 * casetab.c: Likewise.
6853 * category.c: Likewise.
6854 * cmds.c: Likewise.
6855 * coding.c: Likewise.
6856 * composite.c: Likewise.
6857 * dired.c: Likewise.
6858 * dispnew.c: Likewise.
6859 * doc.c: Likewise.
6860 * dosfns.c: Likewise.
6861 * editfns.c: Likewise.
6862 * emacs.c: Likewise.
6863 * fileio.c: Likewise.
6864 * filelock.c: Likewise.
6865 * font.c: Likewise.
6866 * fontset.c: Likewise.
6867 * fringe.c: Likewise.
6868 * indent.c: Likewise.
6869 * insdel.c: Likewise.
6870 * intervals.c: Likewise.
6871 * keyboard.c: Likewise.
6872 * keymap.c: Likewise.
6873 * lread.c: Likewise.
6874 * macros.c: Likewise.
6875 * marker.c: Likewise.
6876 * minibuf.c: Likewise.
6877 * nsfns.m: Likewise.
6878 * nsmenu.m: Likewise.
6879 * print.c: Likewise.
6880 * process.c: Likewise.
6881 * regex.c: Likewise.
6882 * region-cache.c: Likewise.
6883 * search.c: Likewise.
6884 * syntax.c: Likewise.
6885 * term.c: Likewise.
6886 * textprop.c: Likewise.
6887 * undo.c: Likewise.
6888 * unexsol.c: Likewise.
6889 * w16select.c: Likewise.
6890 * w32fns.c: Likewise.
6891 * w32menu.c: Likewise.
6892 * window.c: Likewise.
6893 * xdisp.c: Likewise.
6894 * xfns.c: Likewise.
6895 * xmenu.c: Likewise.
6896 * xml.c: Likewise.
6897 * xselect.c: Likewise.
6898
2f07e6af
EZ
68992012-06-16 Eli Zaretskii <eliz@gnu.org>
6900
1053a871
SM
6901 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6902 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6903 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6904 row.
6905 (handle_face_prop): Use chunk-relative overlay string index when
6906 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6907 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6908 the rightmost. (Bug#11720)
2f07e6af 6909
29b83cec
AS
69102012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6911
6912 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6913 (CATEGORY_MEMBER): Enforce 1/0 value.
6914 * category.c (_temp_category_set): Remove.
6915
4c5501e9
EZ
69162012-06-16 Eli Zaretskii <eliz@gnu.org>
6917
6918 * window.c (Fdelete_other_windows_internal)
6919 (Fdelete_window_internal): Don't access frame's mouse highlight
6920 info of the initial frame. (Bug#11677)
6921
2b570124
PE
69222012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6923
e93864f9
PE
6924 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6925 Assume USE_2_TAGS_FOR_INTS.
6926 (xreload): Adjust $tagmask width to match recent lisp.h change.
6927
2b570124
PE
6928 Simplify lisp.h in minor ways that should not affect code.
6929 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6930 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6931 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6932 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6933 (INTTYPEBITS): New macro, for clarity.
6934 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
6935 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6936 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
6937 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6938 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6939
81755f69
JB
69402012-06-13 Juanma Barranquero <lekktu@gmail.com>
6941
6942 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6943
16192a57
GM
69442012-06-13 Glenn Morris <rgm@gnu.org>
6945
6946 * s/bsd-common.h (BSD4_3):
6947 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6948
646b5f55
AS
69492012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6950
6951 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6952 instead of union.
6953 (XLI, XIL): Define.
1053a871
SM
6954 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6955 Use them.
6956 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 6957 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 6958 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
6959 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6960 * frame.c (delete_frame): Remove outdated comment.
6961 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6962 USE_LISP_UNION_TYPE.
6963 (Fw32_unregister_hot_key): Likewise.
6964 (Fw32_toggle_lock_key): Likewise.
6965 * w32menu.c (add_menu_item): Likewise.
6966 (w32_menu_display_help): Use XIL instead of checking
6967 USE_LISP_UNION_TYPE.
6968 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6969 (init_heap): Likewise.
6970 * w32term.c (w32_read_socket): Update comment.
6971
1d3823c9
GM
69722012-06-13 Glenn Morris <rgm@gnu.org>
6973
c62ff706
GM
6974 * s/usg5-4-common.h, src/s/unixware.h:
6975 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6976
1d3823c9
GM
6977 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6978
bfe3e0a2
PE
69792012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6980
6981 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6982 * alloc.c (make_number) [!defined make_number]:
6983 Remove, as lisp.h always defines this now.
6984 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6985 (roundup_size): Verify that it is a power of 2.
6986 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6987 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6988 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6989 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6990 USE_LSB_TAG now is always defined to be either 0 or 1.
6991 All uses changed.
6992 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6993 code works fine either way, and efficiency is not a concern here,
6994 as the union type is for debugging, not for production.
6995 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6996 Use an inline function on all platforms when using the union type,
6997 since this is simpler and 'static inline' can be used portably
6998 within Emacs now.
6999 (LISP_INITIALLY_ZERO): New macro.
7000 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7001 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7002
45fa9c0f
GM
70032012-06-12 Glenn Morris <rgm@gnu.org>
7004
b4492cba
GM
7005 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7006
7007 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 7008
45fa9c0f
GM
7009 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7010 Move BROKEN_SIGIO to configure.
7011
7012 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7013 Move NO_TERMIO to configure.
7014
0e25d334
CY
70152012-06-12 Chong Yidong <cyd@gnu.org>
7016
7017 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7018 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7019 MagickExportImagePixels is undefined.
7020
43682bb6
PE
70212012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7022
7023 * image.c (imagemagick_load_image): Remove unused label.
7024
a9be7d2b
GM
70252012-06-11 Glenn Morris <rgm@gnu.org>
7026
7027 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7028 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7029 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7030 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7031
3017f87f
SM
70322012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7033
7034 * alloc.c (make_byte_code): New function.
7035 (Fmake_byte_code): Use it. Don't purify here.
7036 * lread.c (read1): Use it as well to avoid extra allocation.
7037
1b9b4cf4
CY
70382012-06-11 Chong Yidong <cyd@gnu.org>
7039
7040 * image.c (imagemagick_load_image): Implement transparency.
7041
95988fcf
AS
70422012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7043
7044 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7045 account for preceding backslashes. (Bug#11663)
7046
cd4eb164
CY
70472012-06-09 Chong Yidong <cyd@gnu.org>
7048
7049 * term.c: Support italics in capable terminals (Bug#9652).
7050 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7051 (turn_on_face): Output using TS_enter_italic_mode if available.
7052 Don't handle unused blinking and alt-charset cases.
7053 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7054 and tty_alt_charset_p cases.
7055 (tty_capable_p, init_tty): Support italics.
7056
7057 * termchar.h (struct tty_display_info): Add field for italics.
7058 Remove unused blink field.
7059
7060 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7061 Handle slant.
7062
7063 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7064 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7065 tty_alt_charset_p. Add tty_italic_p.
7066
ff88beb8
MA
70672012-06-09 Michael Albinus <michael.albinus@gmx.de>
7068
7069 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7070 dbus_type_is_basic if available.
7071 (xd_extract_signed, xd_extract_unsigned): Rename from
7072 extract_signed and extract_unsigned, respectively. Adapt callers.
7073
44286096
CY
70742012-06-09 Chong Yidong <cyd@gnu.org>
7075
1682701f
CY
7076 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7077
44286096
CY
7078 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7079 case (Bug#9752).
7080
d86feb17
PE
70812012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7082
7083 * xdisp.c (vmessage): Treat frame message as multibyte.
7084 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7085 would generate the diagnostic "Making \302\247 buffer-local while
7086 let-bound!".
7087
d5c20fe8
EZ
70882012-06-08 Eli Zaretskii <eliz@gnu.org>
7089
7090 * dispnew.c (showing_window_margins_p): Undo last change, which
7091 was done due to an inadvertent commit.
7092 (adjust_frame_glyphs_for_frame_redisplay): Do call
7093 showing_window_margins_p.
7094
513749ee
SM
70952012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7096
7097 * eval.c (Fmake_var_non_special): New primitive.
7098 (syms_of_eval): Defsubr it.
7099 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7100
d4a8f5c1
JB
71012012-06-08 Juanma Barranquero <lekktu@gmail.com>
7102
7103 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7104 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7105
8bbbc977
EZ
71062012-06-08 Eli Zaretskii <eliz@gnu.org>
7107
7108 * alloc.c (allocate_vectorlike): Fix last change.
7109
f3372c87
DA
71102012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7111
7112 Block-based vector allocation of small vectors.
7113 * lisp.h (struct vectorlike_header): New field `nbytes',
7114 adjust comment accordingly.
7115 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 7116 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
7117 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7118 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7119 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7120 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7121 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7122 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7123 (roundup_size): New constant.
7124 (struct vector_block): New data type.
7125 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 7126 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
7127 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7128 (sweep_vectors): New functions.
7129 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 7130 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
7131 or equal to VBLOCK_BYTES_MAX.
7132 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7133 (init_alloc_once): Add call to init_vectors.
7134
4f18a4ed
SM
71352012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7136
7137 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7138
86f158bc
PE
71392012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7140
7141 * doprnt.c (doprnt): Truncate multibyte char correctly.
7142 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7143 would mishandle a string argument "Xc" if X was a multibyte
7144 character of length 2: it would truncate after X's first byte
7145 rather than including all of X.
7146
c5cfcbe0
CY
71472012-06-06 Chong Yidong <cyd@gnu.org>
7148
7149 * buffer.c (word_wrap): Doc fix.
7150
c05cf390
PE
71512012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7152
7153 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7154
0c3461de
GM
71552012-06-03 Glenn Morris <rgm@gnu.org>
7156
7157 * xdisp.c (tool-bar-style): Doc fix.
7158
c71232db
UM
71592012-06-03 Ulrich Müller <ulm@gentoo.org>
7160
7161 * Makefile.in (PAXCTL): Define.
7162 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7163 binary via PaX flags if the paxctl utility is available.
7164 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7165 Restore PaX flags to their default. (Bug#11398)
7166
383f7350
CY
71672012-06-03 Chong Yidong <cyd@gnu.org>
7168
7169 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7170 buffer (Bug#11226).
7171
5f2c76c6
CY
71722012-06-03 Chong Yidong <cyd@gnu.org>
7173
7174 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7175 (note_mode_line_or_margin_highlight): If there is no help echo,
7176 use mode-line-default-help-echo. Handle the case where the mouse
7177 position is past the end of the mode line string.
7178
7179 * buffer.c (buffer_local_value_1): New function, split from
7180 Fbuffer_local_value; can return Qunbound.
7181 (Fbuffer_local_value): Use it.
7182 (Vmode_line_format): Docstring tweaks.
7183
773d47f6
PE
71842012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7185
7186 * sysdep.c (system_process_attributes): Improve comment.
7187
f2d6a3df
SM
71882012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7189
7190 * keyboard.c: Export real-this-command to Elisp.
7191 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7192 and DEFVAR it. Update all users.
7193
63810350
PE
71942012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7195
7bd5c1f4
PE
7196 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7197
63810350
PE
7198 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7199 Convert pctcpu and pctmem to Lisp float properly.
7200 Let the compiler fold better, as 100.0/0x8000 is exact.
7201
a2821611
AS
72022012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7203
7204 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7205 cons_block.
7206
5fceba1d
PE
72072012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7208
7209 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7210
c98ff5dd
DA
72112012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7212
7213 For a 'struct window', replace some Lisp_Object fields to
7214 bitfields where appropriate, remove unused fields.
7215 * window.h (struct window): Remove unused 'last_mark_x' and
7216 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7217 change it's type from Lisp_Object to bitfield.
7218 Change type of 'force_start', 'optional_new_start',
7219 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 7220 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 7221
ca34e0be
PE
72222012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7223
7224 Pacify gcc -Wdouble-precision when using Xaw.
7225 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7226 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7227 Use 'float' consistently, rather than 'float' in most places
7228 and 'double' in a couple of places.
7229
efc00ab1 72302012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
7231
7232 * xdisp.c (handle_stop): Detect whether we have overlay strings
7233 loaded by testing it->current.overlay_string_index to be
7234 non-negative, instead of checking whether n_overlay_strings is
7235 positive. (Bug#11587)
7236
efc00ab1 72372012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
7238
7239 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7240
7241 * doc.c (Fsubstitute_command_keys): Doc fix.
7242
efc00ab1 72432012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
7244
7245 * search.c (search_buffer): Remove calls to
7246 r_alloc_inhibit_buffer_relocation, as it is now called by
7247 maybe_unify_char, which was the cause of relocation of buffer text
7248 in bug#11519.
7249
efc00ab1 72502012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
7251
7252 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7253 for the duration of call to load_charset, to avoid problems with
7254 callers of maybe_unify_char that access buffer text through C
7255 pointers.
7256
7257 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7258 decrement the inhibition flag, instead of just setting or
7259 resetting it.
7260
ba93a187
PE
72612012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7262
7263 Remove obsolete '#define static' cruft.
7264 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7265 This #undef was "temporary" in 2000; it is no longer needed
7266 now that '#define static' has gone away.
7267 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7268 (gray_bitmap_bits): Remove; no longer needed.
7269 All uses replaced with definiens.
7270 * xterm.c: Include "bitmaps/gray.xbm".
7271
9e4bf381
PE
72722012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7273
7274 Clean up __executable_start, monstartup when --enable-profiling.
7275 The following changes affect the code only when profiling.
7276 * dispnew.c (__executable_start): Rename from safe_bcopy.
7277 Define only on platforms that need it.
7278 * emacs.c: Include <sys/gmon.h> when profiling.
7279 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7280 (__executable_start): Remove decl, since lisp.h does it now.
7281 (safe_bcopy): Remove decl; no longer has that name.
7282 (main): Coalesce #if into single bit of code, for simplicity.
7283 Cast pointers to uintptr_t, since standard libraries want integers
7284 and not pointers.
7285 * lisp.h (__executable_start): New decl.
7286
32d72c2f
GM
72872012-05-31 Glenn Morris <rgm@gnu.org>
7288
7289 * image.c (Fimagemagick_types): Doc fix.
7290
baac5bc7
JM
72912012-05-30 Jim Meyering <meyering@redhat.com>
7292
7293 * callproc.c (Fcall_process_region): Include directory component
7294 in mkstemp error message (Bug#11586).
7295
72cb32cf
PE
72962012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7297
7298 * alloc.c, lisp.h (make_pure_vector): Now static.
7299
61b108cc
SM
73002012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7301
7302 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7303 Move to byte-run.el.
7304 (Fautoload): Do the hash-doc more carefully.
7305 * data.c (Fdefalias): Purify definition, except for keymaps.
7306 (Qdefun): Move from eval.c.
7307 * lisp.h (Qdefun): Remove.
7308 * lread.c (read1): Tiny simplification.
7309
471fe23d
TN
73102012-05-29 Troels Nielsen <bn.troels@gmail.com>
7311
934f3f58 7312 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
7313 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7314 Bug#9642, but explicitly check that the buffer the overlay would
7315 be moved to is live and rearrange lines to make sure that errors
7316 will not put the overlay in an inconsistent state.
7317 (Fdelete_overlay): Cosmetics.
7318
85d0efd1
EZ
73192012-05-28 Eli Zaretskii <eliz@gnu.org>
7320
7321 * w32term.c (my_bring_window_to_top): New function.
7322 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
7323 could be different from the original one.
7324 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
7325 (Bug#11513)
7326
7327 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7328 by calling BringWindowToTop.
7329
7330 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7331 (WM_EMACS_END): Increase by one.
7332
da92a98c
PE
73332012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7334
7335 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7336 This avoids undefined behavior that might cause the eassert
7337 to not catch an out-of-range value.
7338
74d1f848
JB
73392012-05-28 Juanma Barranquero <lekktu@gmail.com>
7340
7341 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7342 Update dependencies.
7343
9e1a06fc
EZ
73442012-05-27 Eli Zaretskii <eliz@gnu.org>
7345
7346 * bidi.c (bidi_mirror_char): Fix last change.
7347
f3dd7312
AS
73482012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7349
7350 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7351 when referring to sectname field in printf format.
7352
81899c91
PE
73532012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7354
57b81a9f
PE
7355 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7356 Only r_alloc_inhibit_buffer_relocation needed to be added;
7357 the others were already declared.
7358
81899c91
PE
7359 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7360 before checking whether it's out of range. Put the check inside
7361 eassert. See
7362 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7363
33017faf 73642012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
7365
7366 * callproc.c (Fcall_process): Restore a line that was accidentally
7367 commented out in the 2011-02-13 change (bug#11547).
7368
33017faf 73692012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
7370
7371 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7372 defined on ralloc.c.
7373
7374 * buffer.c [REL_ALLOC]: Remove prototypes of
7375 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7376 they are now on lisp.h.
7377
7378 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7379
7380 * search.c (search_buffer): Use it to inhibit relocation of buffer
7381 text while re_search_2 is doing its job, because re_search_2 is
7382 passed C pointers to buffer text. (Bug#11519)
7383
23415acf
EZ
7384 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7385 Update value to 24.
7386
44e27368
EZ
7387 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7388 state after an additional call to move_it_in_display_line_to, keep
7389 the values of it->max_ascent and it->max_descent found for the
7390 entire line.
7391 (pos_visible_p): Revert the comparison against bottom_y to what it
7392 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7393 (Bug#11464)
7394
c1892f11
PE
73952012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7396
7397 Fix coding-related core dumps with gcc -ftrapv.
7398 The code was computing A - B, where A and B are pointers, and B is
7399 random garbage. This can lead to core dumps on platforms that
7400 have special pointer registers, and it also leads to core dumps on
7401 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7402 A - B only when B is initialized properly.
7403 * coding.c (coding_set_source, coding_set_destination): Return void.
7404 (coding_change_source, coding_change_destinations): New functions,
7405 with the old behaviors of coding_set_source and coding_set_destination.
7406 All callers that need an offset changed to use these new functions.
7407
eb7afdad
GM
74082012-05-26 Glenn Morris <rgm@gnu.org>
7409
7410 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7411
f12fdf02
EZ
74122012-05-26 Eli Zaretskii <eliz@gnu.org>
7413
53a63be6 7414 Extend mouse support on W32 text-mode console.
61b108cc
SM
7415 * xdisp.c (draw_row_with_mouse_face):
7416 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 7417
eb3f6f01 7418 * w32console.c: Include window.h.
61b108cc
SM
7419 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7420 New functions.
eb3f6f01
EZ
7421 (initialize_w32_display): Initialize mouse-highlight data.
7422
53a63be6
EZ
7423 * w32inevt.c: Include termchar.h and window.h.
7424 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7425 moves, call note_mouse_highlight. If help_echo changed, call
7426 gen_help_event to produce help-echo message in the echo area.
7427 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7428 highlight info.
7429
4cfd81f6
PE
74302012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7431
7432 * lread.c (read1): Simplify slightly to avoid an overflow warning
7433 with GCC 4.7.0 on x86-64.
7434
4446092a
EZ
74352012-05-26 Eli Zaretskii <eliz@gnu.org>
7436
7437 * bidi.c (bidi_mirror_char): Revert last change: an int is
7438 definitely wide enough here.
7439
42b2a986 74402012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 7441
42b2a986 7442 Fix integer width and related bugs (Bug#9874).
eb106a49 7443 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
7444 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7445 (string_bytes, check_sblock, allocate_string_data):
7446 (compact_small_strings, Fmake_bool_vector, make_string)
7447 (make_unibyte_string, make_multibyte_string)
7448 (make_string_from_bytes, make_specified_string)
7449 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7450 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7451 (mark_vectorlike):
7452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7453 (allocate_pseudovector):
7454 Use int, not EMACS_INT, where int is wide enough.
7455 (inhibit_garbage_collection, Fgarbage_collect):
7456 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7457 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7458 int might not be wide enough.
7459 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7460 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7461 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7462 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7463 (bidi_level_of_next_char, bidi_move_to_visually_next):
7464 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7465 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7466 (Fkill_buffer, Fset_buffer_major_mode)
7467 (advance_to_char_boundary, Fbuffer_swap_text)
7468 (Fset_buffer_multibyte, overlays_at, overlays_in)
7469 (overlay_touches_p, struct sortvec, record_overlay_string)
7470 (overlay_strings, recenter_overlay_lists)
7471 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7472 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7473 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7474 (Foverlay_recenter, last_overlay_modification_hooks_used)
7475 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
7477 (validate_region): Omit unnecessary test for b <= e,
7478 since that's guaranteed by the previous test.
d311d28c
PE
7479 (adjust_overlays_for_delete): Avoid pos + length overflow.
7480 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7481 (report_overlay_modification):
7482 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7483 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7484 Omit pointer cast, which isn't needed anyway, and doesn't work
7485 after the EMACS_INT -> ptrdiff_t change.
02481186 7486 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
7487 * buffer.h: Adjust decls to match defn changes elsewhere.
7488 (struct buffer_text, struct buffer):
7489 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7490 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
7491 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7492 not int, to avoid needless 32-bit limit on 64-bit hosts.
7493 (exec_byte_code): Use tighter memory-full test, one that checks
7494 for alloca overflow. Don't compute the address of the object just
7495 before an array, as that's not portable. Use EMACS_INT, not
7496 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
7497 * callint.c (Fcall_interactively):
7498 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7499 * callproc.c (call_process_kill, Fcall_process):
7500 Don't assume pid_t fits into an Emacs fixnum.
7501 (call_process_cleanup, Fcall_process, child_setup):
7502 Don't assume pid_t fits into int.
7503 (call_process_cleanup, Fcall_process, delete_temp_file)
7504 (Fcall_process_region):
7505 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7506 (Fcall_process): Simplify handling of volatile integers.
7507 Use int, not EMACS_INT, where int will do.
7508 * casefiddle.c (casify_object, casify_region, operate_on_word)
7509 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7510 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7511 (casify_object): Avoid integer overflow when overallocating buffer.
7512 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 7513 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
7514 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7515 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7516 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7517 integers are now checked earlier. All uses replaced with XINT.
7518 (ccl_driver):
7519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7520 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
7521 (ccl_driver, Fregister_code_conversion_map):
7522 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
7523 (resolve_symbol_ccl_program): Check that vector header is in range.
7524 Always copy the vector, so that we can check its contents reliably
7525 now rather than having to recheck each instruction as it's being
7526 executed. Check that vector words fit in 'int'.
7527 (ccl_get_compiled_code, Fregister_ccl_program)
7528 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7529 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7530 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7531 contents are in range.
7532 (Fccl_execute_on_string): Check that status is in range.
7533 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7534 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7535 Accept and return EMACS_INT, not int, because callers can pass values
7536 out of 'int' range.
7537 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7538 (multibyte_chars_in_text, parse_str_as_multibyte)
7539 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7540 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7541 (string_escape_byte8, Fget_byte):
7542 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 7543 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
7544 avoid mishandling large integers.
7545 * character.h: Adjust decls to match defn changes elsewhere.
7546 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7547 (Ffind_charset_region):
7548 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7549 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7550 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 7551 Don't assume fixnum fits in int.
d311d28c
PE
7552 (load_charset_map_from_vector, Fmap_charset_chars):
7553 Remove now-unnecessary CHECK_NATNUMs.
7554 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
7555 Don't rely on undefined behavior with signed left shift overflow.
7556 Don't assume unsigned int fits into fixnum, or that fixnum fits
7557 into unsigned int. Don't require max_code to be a valid fixnum;
7558 that's not true for gb10830 4-byte on a 32-bit host. Allow
7559 invalid_code to be a cons, for the same reason. Require code_offset
7560 to be a character. Avoid int overflow if max_char is close
7561 to INT_MAX.
7562 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7563 this is intended anyway and avoids some undefined behavior.
7564 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7565 INDEX_TO_CODE_POINT, as that's what it expects.
7566 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
7567 * charset.h (DECODE_CHAR): Return int, not unsigned;
7568 this is what was intended anyway, and it avoids undefined behavior.
7569 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7570 integer-overflow issues.
7571 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7572 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7573 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
7574 * chartab.c (Fmake_char_table, Fset_char_table_range)
7575 (uniprop_get_decoder, uniprop_get_encoder):
7576 Don't assume fixnum fits in int.
7577 * cmds.c (move_point): New function, that does the gist of
7578 Fforward_char and Fbackward_char, but does so while checking
7579 for integer overflow more accurately.
c96e5d6a 7580 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
7581 (Fforward_line, Fend_of_line, internal_self_insert)
7582 (internal_self_insert):
7583 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7584 Fix a FIXME, by checking for integer overflow when calculating
7585 target_clm and actual_clm.
7586 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 7587 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
7588 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7589 (coding_alloc_by_making_gap, alloc_destination)
7590 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7591 (encode_coding_utf_16, detect_coding_emacs_mule)
7592 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7593 (detect_coding_iso_2022, decode_coding_iso_2022)
7594 (encode_invocation_designation, encode_designation_at_bol)
7595 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7596 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7597 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7598 (encode_coding_ccl, encode_coding_raw_text)
7599 (detect_coding_charset, decode_coding_charset)
7600 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7601 (produce_composition, produce_charset, produce_annotation)
7602 (decode_coding, handle_composition_annotation)
7603 (handle_charset_annotation, consume_chars, decode_coding_gap)
7604 (decode_coding_object, encode_coding_object, detect_coding_system)
7605 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7606 (code_convert_region, code_convert_string)
8f50130c
PE
7607 (Fdefine_coding_system_internal)
7608 (coding_set_source, coding_set_destination):
d311d28c
PE
7609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7610 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7611 (Fdefine_coding_system_internal):
7612 Don't assume fixnums fit in int.
7613 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 7614 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
7615 (Funencodable_char_position, Fcheck_coding_systems_region)
7616 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 7617 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 7618 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 7619 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 7620 Don't access memory outside of the args array.
d311d28c 7621 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
7622 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7623 result of ENCODE_CHAR.
d311d28c
PE
7624 * coding.h: Adjust decls to match defn changes elsewhere.
7625 (struct coding_system):
7626 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7627 * composite.c (get_composition_id, find_composition)
7628 (run_composition_function, update_compositions)
7629 (compose_text, composition_gstring_put_cache)
7630 (composition_gstring_p, composition_gstring_width)
7631 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7632 (composition_compute_stop_pos, composition_reseat_it)
7633 (composition_update_it, struct position_record)
7634 (find_automatic_composition, composition_adjust_point)
7635 (Fcomposition_get_gstring, Ffind_composition_internal):
7636 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7637 (update_compositions):
7638 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7639 * composite.h: Adjust decls to match defn changes elsewhere.
7640 (struct composition):
7641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7642 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7643 Do not attempt to compute the address of the object just before a
7644 buffer; this is not portable.
7645 (Faref, Faset):
7646 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7647 (Faset): Use int, not EMACS_INT, where int is wide enough.
7648 (Fstring_to_number): Don't assume fixnums fit in int.
7649 (Frem): Don't assume arg is nonnegative.
7650 * dbusbind.c (xd_append_arg): Check for integers out of range.
7651 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7652 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7653 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7654 (xd_get_connection_references): Return ptrdiff_t, not int.
7655 All uses changed.
7656 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7657 (xd_read_message_1):
7658 Use int, not unsigned, where the dbus API uses int.
7659 (Fdbus_message_internal): Don't overflow mtype.
7660 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7661 * dired.c (directory_files_internal, file_name_completion, scmp)
7662 (file_name_completion_stat):
7663 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7664 (file_name_completion): Don't overflow matchcount.
7665 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7666 * dispextern.h: Adjust decls to match defn changes elsewhere.
7667 (struct text_pos, struct glyph, struct bidi_saved_info)
7668 (struct bidi_string_data, struct bidi_it, struct composition_it)
7669 (struct it):
7670 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7671 (struct display_pos, struct composition_it, struct it):
7672 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7673 * dispnew.c (increment_matrix_positions)
7674 (increment_row_positions, mode_line_string)
7675 (marginal_area_string):
7676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7677 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7678 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7679 (duration_to_sec_usec): New function, to check for overflow better.
7680 (Fsleep_for, sit_for): Use it.
7681 * doc.c (get_doc_string, store_function_docstring):
7682 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7683 (get_doc_string, Fsnarf_documentation):
7684 Use int, not EMACS_INT, where int is wide enough.
7685 (get_doc_string):
7686 Use SAFE_ALLOCA, not alloca.
7687 Check for overflow when converting EMACS_INT to off_t.
7688 * doprnt.c (doprnt):
7689 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7690 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7691 Don't assume uid_t fits into fixnum.
7692 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7693 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7694 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7695 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7696 (general_insert_function)
7697 (Finsert_char, make_buffer_string, make_buffer_string_both)
7698 (update_buffer_properties, Fbuffer_substring)
7699 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7700 (Fsubst_char_in_region, check_translation)
7701 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7702 (transpose_markers, Ftranspose_regions):
7703 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7704 (clip_to_bounds): Move to lisp.h as an inline function).
7705 (Fconstrain_to_field): Don't assume integers are nonnegative.
7706 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7707 (Fsubst_char_in_region, Fsave_restriction):
7708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7709 (Femacs_pid): Don't assume pid_t fits into fixnum.
7710 (lo_time): Use int, not EMACS_INT, when int suffices.
7711 (lisp_time_argument): Check for usec out of range.
7712 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
7713 (Fuser_login_name, Fuser_full_name): Signal an error
7714 if a uid argument is out of range, rather than relying on
7715 undefined behavior.
c8d5c857
PE
7716 (Fformat_time_string): Remove now-unnecessary check.
7717 lisp_time_argument checks for out-of-range usec now.
243e0530 7718 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
7719 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7720 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7721 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7722 (init_cmdargs, Fdump_emacs):
7723 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7724 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7725 the bottom (typically) 32 bits of the fixnum.
7726 * eval.c (specpdl_size, call_debugger):
7727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7728 (when_entered_debugger, Fbacktrace_debug):
7729 Don't assume fixnum can fit in int.
7730 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7731 the object just before a buffer; this is not portable.
7732 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7733 (grow_specpdl, unbind_to):
7734 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7735 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7736 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7737 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7738 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7739 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7740 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7741 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7742 (a_write, e_write):
7743 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7744 (Fcopy_file, non_regular_nbytes, read_non_regular)
7745 (Finsert_file_contents):
7746 Use int, not EMACS_INT, where int is wide enough.
7747 (READ_BUF_SIZE): Verify that it fits in int.
7748 (Finsert_file_contents): Check that counts are in proper range,
7749 rather than assuming fixnums fit into ptrdiff_t etc.
7750 Don't assume fixnums fit into int.
125b3835 7751 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7752 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7753 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7754 (string_char_to_byte, string_byte_to_char)
7755 (string_make_multibyte, string_to_multibyte)
7756 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7757 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7758 (substring_both, Fdelete, internal_equal, Ffillarray)
7759 (Fclear_string, mapcar1)
7760 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7761 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7762 (larger_vector, make_hash_table, maybe_resize_hash_table)
7763 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7764 (Fmaphash, secure_hash):
7765 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7766 (concat): Check for string index and length overflow.
7767 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7768 (Frequire):
7769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7770 (larger_vector): New API (vec, incr_min, size_max) replaces old
7771 one (vec, new_size, init). This catches size overflow.
7772 INIT was removed because it was always Qnil.
7773 All callers changed.
7774 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7775 the upper bound on a hash table index size.
7776 (make_hash_table, maybe_resize_hash_table): Use it.
7777 (secure_hash): Computer start_byte and end_byte only after
7778 they're known to be in ptrdiff_t range.
7779 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7780 (Ffont_get_glyphs, Ffont_at):
7781 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7782 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7783 (Flist_fonts, Fopen_font):
7784 Don't assume fixnum can fit in int.
7785 (check_gstring): Don't assume index can fit in int.
7786 (font_match_p): Check that fixnum is a character, not a nonnegative
7787 fixnum, since the later code needs to stuff it into an int.
7788 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7789 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7790 conversion overflow issues.
7791 (Fopen_font): Check for integer out of range.
7792 (Ffont_get_glyphs): Don't assume index can fit in int.
7793 * font.h: Adjust decls to match defn changes elsewhere.
7794 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7795 integer overflow.
7796 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7797 printmax_t, where ptrdiff_t is wide enough.
7798 (Finternal_char_font):
7799 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7800 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7801 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7802 (Fset_frame_position, x_set_frame_parameters)
7803 (x_set_line_spacing, x_set_border_width)
7804 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7805 Check that fixnums are in proper range for system types.
7806 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7807 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7808 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7809 Use SAFE_ALLOCA_LISP, not alloca.
7810 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7811 intptr_t is wide enough.
7812 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7813 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7814 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7815 Check for fixnum out of range.
7816 * ftfont.c (ftfont_list): Don't assume index fits in int.
7817 Check that fixnums are in proper range for system types.
7818 (ftfont_shape_by_flt):
7819 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7820 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7821 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7822 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7823 Check that fixnums are in proper range for system types.
7824 * gnutls.h: Adjust decls to match defn changes elsewhere.
7825 * gtkutil.c (xg_dialog_run):
7826 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7827 (update_frame_tool_bar):
7828 Check that fixnums are in proper range for system types.
7829 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7830 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7831 * indent.c (last_known_column, last_known_column_point):
7832 (current_column_bol_cache):
7833 (skip_invisible, current_column, check_display_width):
7834 (check_display_width, scan_for_column, current_column_1)
7835 (Findent_to, Fcurrent_indentation, position_indentation)
7836 (indented_beyond_p, Fmove_to_column, compute_motion):
7837 (Fcompute_motion, Fvertical_motion):
7838 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7839 (last_known_column_modified): Use EMACS_INT, not int.
7840 (check_display_width):
7841 (Fcompute_motion):
7842 Check that fixnums and floats are in proper range for system types.
7843 (compute_motion): Don't assume index or fixnum fits in int.
7844 (compute_motion, Fcompute_motion):
7845 Use int, not EMACS_INT, when it is wide enough.
7846 (vmotion): Omit local var start_hpos that is always 0; that way
7847 we don't need to worry about overflow in expressions involving it.
7848 * indent.h: Adjust decls to match defn changes elsewhere.
7849 (struct position):
7850 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7851 Use int, not EMACS_INT, where int is wide enough.
7852 Remove unused members ovstring_chars_done and tab_offset;
7853 all uses removed.
7854 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7855 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7856 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7857 (make_gap, copy_text, insert, insert_and_inherit)
7858 (insert_before_markers, insert_before_markers_and_inherit)
7859 (insert_1, count_combining_before, count_combining_after)
7860 (insert_1_both, insert_from_string)
7861 (insert_from_string_before_markers, insert_from_string_1)
7862 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7863 (adjust_after_replace, adjust_after_insert, replace_range)
7864 (replace_range_2, del_range, del_range_1, del_range_byte)
7865 (del_range_both, del_range_2, modify_region)
7866 (prepare_to_modify_buffer, signal_before_change)
7867 (signal_after_change, Fcombine_after_change_execute):
7868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7869 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7870 (balance_an_interval, split_interval_right, split_interval_left)
7871 (find_interval, next_interval, update_interval)
7872 (adjust_intervals_for_insertion, delete_node, delete_interval)
7873 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7874 (static_offset_intervals, offset_intervals)
7875 (merge_interval_right, merge_interval_left, make_new_interval)
7876 (graft_intervals_into_buffer, temp_set_point_both)
7877 (temp_set_point, set_point, adjust_for_invis_intang)
7878 (set_point_both, move_if_not_intangible, get_property_and_range)
7879 (get_local_map, copy_intervals, copy_intervals_to_string)
7880 (compare_string_intervals, set_intervals_multibyte_1):
7881 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7882 * intervals.h: Adjust decls to match defn changes elsewhere.
7883 (struct interval):
7884 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7885 * keyboard.c (this_command_key_count, this_single_command_key_start)
7886 (before_command_key_count, before_command_echo_length, echo_now)
7887 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7888 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7889 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7890 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7891 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7892 (last_non_minibuf_size, last_point_position, echo_truncate)
7893 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7894 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7895 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7896 (stuff_buffered_input):
7897 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7898 (last_auto_save, command_loop_1, read_char):
7899 Use EMACS_INT, not int, to avoid integer overflow.
7900 (record_char): Avoid overflow in total_keys computation.
7901 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7902 * keyboard.h: Adjust decls to match defn changes elsewhere.
7903 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7904 (Fkey_description, Fdescribe_vector, Flookup_key):
7905 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7906 (click_position): New function, to check that positions are in range.
7907 (Fcurrent_active_maps):
7908 (describe_command):
7909 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7910 (Faccessible_keymaps, Fkey_description):
7911 (preferred_sequence_p):
7912 Don't assume fixnum can fit into int.
7913 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7914 Check for integer overflow in size calculations.
7915 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7916 avoid mishandling large integers.
7917 * lisp.h: Adjust decls to match defn changes elsewhere.
7918 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7919 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7920 (struct Lisp_Marker):
7921 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7922 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
7923 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7924 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7925 All callers changed.
7926 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7927 Assume the arg has valid form, since it always does.
7928 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7929 unsigned integer system type.
7930 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7931 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7932 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7933 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7934 (duration_to_sec_usec): New decl.
7935 * lread.c (read_from_string_index, read_from_string_index_byte)
7936 (read_from_string_limit, readchar, unreadchar, openp)
7937 (read_internal_start, read1, oblookup):
7938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7939 (Fload, readevalloop, Feval_buffer, Feval_region):
7940 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7941 (openp): Check for out-of-range argument to 'access'.
7942 (read1): Use int, not EMACS_INT, where int is wide enough.
7943 Don't assume fixnum fits into int.
6efdadfd 7944 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
7945 (read_filtered_event): Use duration_to_sec_usec
7946 to do proper overflow checking on durations.
d311d28c
PE
7947 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7948 in size calculation.
7949 (Fexecute_kbd_macro):
7950 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7951 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7952 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7953 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7954 (set_marker_both, set_marker_restricted_both, marker_position)
7955 (marker_byte_position, Fbuffer_has_markers_at):
7956 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7957 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 7958 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
7959 It now merely ensures that the menu is large enough, without
7960 necessarily growing it, as this avoids some integer overflow issues.
7961 All callers changed.
7962 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7963 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7964 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7965 Use SAFE_ALLOCA_LISP, not alloca.
7966 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7967 to EMACS_INT. Check that fixnums are in proper range for system types.
7968 * minibuf.c (minibuf_prompt_width, string_to_object)
7969 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7970 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7971 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7972 (get_minibuffer, read_minibuf_unwind):
7973 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7974 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7975 this simplifies overflow checking. All callers changed.
7976 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7977 (Ftest_completion):
7978 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7979 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7980 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7981 Check that fixnums are in proper range for system types.
7982 (Fx_create_frame, Fx_show_tip):
7983 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7984 * nsfont.m (ns_findfonts, nsfont_list_family):
7985 Don't assume fixnum fits in long.
7986 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7987 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7988 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7989 wide enough.
17fdb222 7990 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7992 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7993 (PRINTDECLARE, PRINTPREPARE):
7994 (strout, print_string):
7995 (print, print_preprocess, print_check_string_charset_prop)
7996 (print_object):
7997 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7998 (PRINTDECLARE):
7999 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8000 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8001 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 8002 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 8003 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
8004 (print_error_message): Use SAFE_ALLOCA, not alloca.
8005 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
8006 (print_depth, new_backquote_output, print_number_index):
8007 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
8008 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8009 (Fset_process_window_size, Fformat_network_address)
8010 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 8011 (sigchld_handler):
d311d28c 8012 Check that fixnums are in proper range for system types.
d44287d4 8013 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
8014 Check for process-ids out of pid_t range rather than relying on
8015 undefined behavior.
e4d81efc 8016 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
8017 (Fformat_network_address, read_process_output, send_process)
8018 (Fprocess_send_region, status_notify):
8019 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8020 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8021 (wait_reading_process_output, read_process_output, exec_sentinel):
8022 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8023 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8024 (Faccept_process_output): Use duration_to_sec_usec to do proper
8025 overflow checking on durations.
dde14581
PE
8026 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8027 Don't assume pid_t fits in int.
02481186
PE
8028 * process.h (struct Lisp_Process): Members tick and update_tick
8029 are now of type EMACS_INT, not int.
b62b53e8
PE
8030 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8031 configured --with-wide-int.
d311d28c
PE
8032 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8033 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8034 * search.c (looking_at_1, string_match_1):
8035 (fast_string_match, fast_c_string_match_ignore_case)
8036 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8037 (scan_newline, find_before_next_newline, search_command)
8038 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8039 (set_search_regs, wordify):
8040 (Freplace_match):
8041 (Fmatch_data):
8042 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8043 (string_match_1, search_buffer, set_search_regs):
8044 (Fmatch_data):
8045 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8046 (wordify): Check for overflow in size calculation.
8047 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8048 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8049 Check that fixnums are in proper range for system types.
8050 * sound.c (struct sound_device)
8051 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8052 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8053 (Fplay_sound_internal):
8054 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 8055 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
8056 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8057 (Fparse_partial_sexp):
8058 Don't assume fixnums can fit in int.
8059 (struct lisp_parse_state, find_start_pos, find_start_value)
8060 (find_start_value_byte, find_start_begv)
8061 (update_syntax_table, char_quoted, dec_bytepos)
8062 (find_defun_start, prev_char_comend_first, back_comment):
8063 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8064 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8065 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8066 (Finternal_describe_syntax_value): Check that match_lisp is a
8067 character, not an integer, since the code stuffs it into int.
8068 (scan_words, scan_sexps_forward):
8069 Check that fixnums are in proper range for system types.
8070 (Fforward_word):
8071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8072 (scan_sexps_forward):
8073 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8074 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8075 * syntax.h: Adjust decls to match defn changes elsewhere.
8076 (struct gl_state_s):
8077 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
8078 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8079 MOST_POSITIVE_FIXNUM.
d311d28c
PE
8080 * sysdep.c (wait_for_termination_1, wait_for_termination)
8081 (interruptible_wait_for_termination, mkdir):
8082 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8083 (emacs_read, emacs_write):
8084 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
8085 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8086 and double all fit in int.
d311d28c
PE
8087 * term.c (set_tty_color_mode):
8088 Check that fixnums are in proper range for system types.
8089 * termhooks.h (struct input_event):
8090 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8091 * textprop.c (validate_interval_range, interval_of)
8092 (Fadd_text_properties, set_text_properties_1)
8093 (Fremove_text_properties, Fremove_list_of_text_properties)
8094 (Ftext_property_any, Ftext_property_not_all)
8095 (copy_text_properties, text_property_list, extend_property_ranges)
8096 (verify_interval_modification):
8097 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8098 (Fnext_single_char_property_change)
8099 (Fprevious_single_char_property_change):
8100 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
8101 (copy_text_properties):
8102 Check for integer overflow in index calculation.
d311d28c
PE
8103 * undo.c (last_boundary_position, record_point, record_insert)
8104 (record_delete, record_marker_adjustment, record_change)
8105 (record_property_change):
8106 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8107 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8108 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8109 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8110 (Fx_hide_tip, Fx_file_dialog):
8111 * w32menu.c (set_frame_menubar):
8112 Use ptrdiff_t, not int, for consistency with rest of code.
8113 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8114 (select_window, Fdelete_other_windows_internal)
8115 (window_scroll_pixel_based, window_scroll_line_based)
8116 (Frecenter, Fset_window_configuration):
8117 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8118 (Fset_window_hscroll, run_window_configuration_change_hook)
8119 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 8120 (Fscroll_other_window, Frecenter):
d311d28c
PE
8121 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8122 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8123 Don't assume fixnum fits in int.
8124 (Fset_window_scroll_bars):
8125 Check that fixnums are in proper range for system types.
8126 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8127 (string_pos, c_string_pos, number_of_chars, init_iterator)
8128 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8129 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8130 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
8131 (face_before_or_after_it_pos, handle_invisible_prop)
8132 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
8133 (display_prop_intangible_p, string_buffer_position_lim)
8134 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8135 (get_overlay_strings_1, get_overlay_strings)
8136 (iterate_out_of_display_property, forward_to_next_line_start)
8137 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8138 (get_next_display_element, set_iterator_to_next)
8139 (get_visually_first_element, compute_stop_pos_backwards)
8140 (handle_stop_backwards, next_element_from_buffer)
8141 (move_it_in_display_line_to, move_it_in_display_line)
8142 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8143 (add_to_log, message_dolog, message_log_check_duplicate)
8144 (message2, message2_nolog, message3, message3_nolog
8145 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8146 (current_message_1, truncate_echo_area, truncate_message_1)
8147 (set_message, set_message_1, store_mode_line_noprop)
8148 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8149 (text_outside_line_unchanged_p, check_point_in_composition)
8150 (reconsider_clip_changes)
8151 (redisplay_internal, set_cursor_from_row, try_scrolling)
8152 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8153 (redisplay_window, find_last_unchanged_at_beg_row)
8154 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8155 (trailing_whitespace_p, find_row_edges, display_line)
8156 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8157 (display_mode_element, store_mode_line_string)
8158 (pint2str, pint2hrstr, decode_mode_spec)
8159 (display_count_lines, display_string, draw_glyphs)
8160 (x_produce_glyphs, x_insert_glyphs)
8161 (rows_from_pos_range, mouse_face_from_buffer_pos)
8162 (fast_find_string_pos, mouse_face_from_string_pos)
8163 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8164 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8165 (safe_call, init_from_display_pos, handle_fontified_prop)
8166 (handle_single_display_spec, load_overlay_strings)
8167 (with_echo_area_buffer, setup_echo_area_for_printing)
8168 (display_echo_area, echo_area_display)
8169 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8170 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
8171 (redisplay_window, dump_glyph_row, display_mode_line)
8172 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 8173 (handle_display_spec, display_prop_string_p):
d311d28c
PE
8174 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8175 (handle_single_display_spec, build_desired_tool_bar_string)
8176 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8177 (get_specified_cursor_type):
8178 Check that fixnums are in proper range for system types.
8179 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8180 (Flookup_image_map):
8181 Don't assume fixnums fit in int.
8182 (compare_overlay_entries):
8183 Avoid mishandling comparisons due to subtraction overflow.
8184 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8185 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8186 (handle_tool_bar_click):
8187 Use int, not unsigned, since we prefer signed and the signedness
8188 doesn't matter here.
8189 (get_next_display_element, next_element_from_display_vector):
8190 Use int, not EMACS_INT, when int is wide enough.
8191 (start_hourglass): Use duration_to_sec_usec to do proper
8192 overflow checking on durations.
8193 * xfaces.c (Fbitmap_spec_p):
8194 Check that fixnums are in proper range for system types.
8195 (compare_fonts_by_sort_order):
8196 Avoid mishandling comparisons due to subtraction overflow.
8197 (Fx_family_fonts, realize_basic_faces):
8198 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8199 (Fx_family_fonts):
8200 Don't assume fixnum fits in int.
8201 Use SAFE_ALLOCA_LISP, not alloca.
8202 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8203 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8204 (face_at_buffer_position, face_for_overlay_string)
8205 (face_at_string_position):
8206 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8207 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8208 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8209 (Fx_show_tip):
8210 Check that fixnums are in proper range for system types.
8211 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8212 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8213 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8214 (Fx_change_window_property): Don't assume fixnums fit in int.
8215 * xfont.c (xfont_chars_supported):
8216 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8217 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8218 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8219 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8220 * xml.c (parse_region):
8221 * xrdb.c (magic_file_p):
8222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8223 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8224 (x_get_local_selection, x_reply_selection_request)
8225 (x_handle_selection_request, wait_for_property_change):
8226 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8227 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8228 short is wide enough.
8229 (x_send_client_event): Don't assume fixnum fits in int.
8230 * xterm.c (x_x_to_emacs_modifiers):
8231 Don't assume EMACS_INT overflows nicely into int.
8232 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8233 may come from Lisp.
8234 (handle_one_xevent): NATNUMP can eval its arg twice.
8235 (x_connection_closed):
8236 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8237 * xterm.h: Adjust decls to match defn changes elsewhere.
8238 (struct scroll_bar): Use struct vectorlike_header
8239 rather than rolling our own approximation.
8240 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8241
c6574eb5
GM
82422012-05-25 Glenn Morris <rgm@gnu.org>
8243
8244 * lisp.mk (lisp): Update for more files being compiled now.
8245
e8d32c7e
SM
82462012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8247
48def666
SM
8248 * lread.c: Remove `read_pure' which makes no difference.
8249 (read_pure): Remove var.
8250 (unreadpure): Remove function.
8251 (readevalloop): Don't call read_list with -1 flag.
8252 (read1, read_vector): Don't test read_pure any more.
8253 (read_list): Simplify.
8254
e8d32c7e
SM
8255 * fileio.c, character.h: Minor style tweaks.
8256
4b2addb7
DA
82572012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8258
8259 * window.h (clip_changed): Remove useless declaration.
8260
584461b2
JB
82612012-05-22 Juanma Barranquero <lekktu@gmail.com>
8262
8263 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8264 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8265
34374650
PE
82662012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8267
8268 Remove src/m/*.
8269 This directory predates autoconf and is no longer needed nowadays.
8270 Move its few remaining bits of functionality to where they're needed.
8271 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8272 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8273 * m/template.h: Remove.
8274 * Makefile.in (M_FILE): Remove. All uses removed.
8275 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8276 * lisp.h (USE_LSB_TAG):
8277 * mem-limits.h (EXCEEDS_LISP_PTR):
8278 Use VAL_MAX, not VALBITS, in #if.
8279 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8280 (EMACS_UINT): Define unconditionally now.
8281 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8282 (BITS_PER_EMACS_INT): New constants, replacing
8283 what used to be in config.h, but not useful in #if.
8284 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8285 define them any more.
8286 (VAL_MAX): New macro.
8287 (VALMASK): Use it.
8288 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8289 BITS_PER_EMACS_INT, in #if.
8290 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8291 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8292 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8293 * s/ms-w32.h (DATA_START):
8294 Move here from removed file m/intel386.h.
8295 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8296 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8297
261cb4bb
PE
82982012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8299
8300 Assume C89 or later.
8301 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8302 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8303 (xrealloc):
8304 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8305 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8306 * textprop.c, tparam.c (NULL): Remove.
8307 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8308 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8309 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8310 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8311 * xterm.c (input_signal_count): Assume volatile works.
8312
ff23cd9f
KB
83132012-05-21 Ken Brown <kbrown@cornell.edu>
8314
8315 * xgselect.c (xg_select): Fix first argument in call to 'select'
8316 (bug#11508).
8317
1b170bc6
KB
83182012-05-20 Ken Brown <kbrown@cornell.edu>
8319
8320 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 8321 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 8322
b2f4d39f
KB
83232012-05-19 Ken Brown <kbrown@cornell.edu>
8324
8325 * xfns.c (x_in_use): Remove `static' qualifier.
8326 * xterm.h (x_in_use): Declare.
8327 * xgselect.c: Include xterm.h.
8328 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8329 and `display_arg' (bug#9754).
8330
003fdae2
PE
83312012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8332
9232a6d9
PE
8333 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8334
003fdae2
PE
8335 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8336 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8337
784b56e2
EZ
83382012-05-18 Eli Zaretskii <eliz@gnu.org>
8339
8340 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8341
8342 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 8343 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
8344
8345 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8346 reference to image_cache->refcount.
8347 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8348
a0a79cde
JL
83492012-05-17 Juri Linkov <juri@jurta.org>
8350
8351 * search.c (Fword_search_regexp, Fword_search_backward)
8352 (Fword_search_forward, Fword_search_backward_lax)
8353 (Fword_search_forward_lax): Move functions to isearch.el
8354 (bug#10145, bug#11381).
8355
b0572523
PE
83562012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8357
8358 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8359
9660f5fc
SM
83602012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8361
8362 * lread.c (init_obarray): Declare Qt and Qnil as special.
8363
4374de83
GM
83642012-05-14 Glenn Morris <rgm@gnu.org>
8365
8366 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 8367 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 8368
dc44c39a
PE
83692012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8370
078c97cb
PE
8371 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8372
dc44c39a
PE
8373 * unexaix.c: Port to more-recent AIX compilers.
8374 (report_error, report_error_1, make_hdr, copy_sym)
8375 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8376 Make arguments const char *, not char *, to avoid violations of C
8377 standard and to fix some AIX warnings reported by Gilles Pion.
8378
e18afed7 83792012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
8380
8381 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8382 already have overlays loaded.
8383 (handle_single_display_spec): Before returning without displaying
8384 fringe bitmap, synchronize the bidi iterator with the main display
8385 iterator, by calling iterate_out_of_display_property.
8386 (iterate_out_of_display_property): Detect buffer iteration by
8387 testing that it->string is a Lisp string.
8388 (get_next_display_element): When the current object is exhausted,
8389 and there's something on it->stack, call set_iterator_to_next to
8390 proceed with what's on the stack, instead of returning zero.
8391 (set_iterator_to_next): If called at the end of a Lisp string,
8392 proceed to consider_string_end without incrementing string
8393 position. Don't increment display vector index past the end of
8394 the display vector. (Bug#11417)
c8fb9dc6
EZ
8395 (pos_visible_p): Don't report a position visible when move_it_to
8396 stopped at the last line of window, which happens to be scanned
8397 backwards by the bidi iteration. (Bug#11464)
ac268e67 8398
e18afed7 83992012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
8400
8401 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8402 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
8403 are on a TTY, and thus unable to display on the fringes.
8404 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
8405 so we need to signal to the caller that this is a "replacing"
8406 display spec. This fixes display when the spec is invalid or we
8407 are on a TTY.
8408
e18afed7 84092012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
8410
8411 * unexaix.c (make_hdr): Fix typo in prototype.
8412 This bug broke the build on AIX. Problem reported by Gilles Pion.
8413
9d0a235a
MA
84142012-05-14 Michael Albinus <michael.albinus@gmx.de>
8415
8416 * keyboard.c (kbd_buffer_get_event): Read special events also in
8417 batch mode. (Bug#11415)
8418
9e6b06ed
GM
84192012-05-12 Glenn Morris <rgm@gnu.org>
8420
8421 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8422
c1a1d7a3
EZ
84232012-05-12 Eli Zaretskii <eliz@gnu.org>
8424
8425 * lisp.mk (lisp): Add newcomment.elc.
8426
3fe7cdc8
GM
84272012-05-12 Glenn Morris <rgm@gnu.org>
8428
8429 * Makefile.in (MKDIR_P): New, set by configure.
8430 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8431
53f7d2c0
PE
84322012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8433
8434 Remove unused function hourglass_started.
8435 * dispextern.h (hourglass_started):
8436 * w32fns.c (hourglass_started):
8437 * xdisp.c (hourglass_started): Remove.
8438
75aafb17
JB
84392012-05-10 Juanma Barranquero <lekktu@gmail.com>
8440
8441 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8442 Update dependencies.
8443
12959e8e
PE
84442012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8445
97107e2e
PE
8446 * xgselect.c (xg_select): Put maxfds+1 into a var.
8447 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8448
12959e8e
PE
8449 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8450
836d29b3
DA
84512012-05-10 Dave Abrahams <dave@boostpro.com>
8452
8453 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8454 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8455
5cb67954
MA
84562012-05-09 Michael Albinus <michael.albinus@gmx.de>
8457
8458 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8459 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8460 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8461 Initialize xd_registered_buses.
8462
3478ec45
PE
84632012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8464
b263a6b0
PE
8465 Untag more efficiently if USE_LSB_TAG.
8466 This is based on a proposal by YAMAMOTO Mitsuharu in
8467 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8468 For an admittedly artificial (nth 8000 longlist) benchmark on
8469 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8470 Emacs's overall text size by 1%.
8471 * lisp.h (XUNTAG): New macro.
8472 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8473 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8474 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8475 * eval.c (Fautoload):
8476 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8477 * frame.h (XFRAME): Use XUNTAG.
8478
3478ec45
PE
8479 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8480 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8481 Remove unportable assumptions about print widths of types like
8482 dbus_uint32_t.
8483 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8484 intptr_t when converting between pointer and integer, to avoid GCC
8485 warnings about wrong width.
8486
666b903b 84872012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
8488
8489 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8490 stack for each reader_thread, instead of defaulting to 8MB
8491 determined by the linker. This avoids failures in creating
8492 subprocesses on Windows 7, see the discussion in this thread:
8493 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8494
b120cc17
JC
84952012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8496
8497 Fix up display of the *Minibuf-0* buffer in the mini window.
8498 * keyboard.c (read_char): Don't clear the echo area if there's no
8499 message to clear.
8500 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 8501 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 8502
9a4b36f8
MA
85032012-05-07 Michael Albinus <michael.albinus@gmx.de>
8504
8505 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8506 batch mode.
8507
e5f9458f
CY
85082012-05-06 Chong Yidong <cyd@gnu.org>
8509
8510 * lisp.mk (lisp): Update.
8511
eceeb5fc 85122012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
8513
8514 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8515
71873e2b
SM
85162012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8517
8518 * data.c (PUT_ERROR): New macro.
8519 (syms_of_data): Use it. Add new error type `user-error'.
8520 * undo.c (user_error): New function.
8521 (Fprimitive_undo): Use it.
8522 * print.c (print_error_message): Adjust print style for `user-error'.
8523 * keyboard.c (user_error): New function.
8524 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8525
ab0fa4e4
PE
85262012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8527
8528 Do not limit current-time-string to years 1000..9999.
8529 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8530 (Fcurrent_time_string): Support any year that is supported by the
8531 underlying localtime representation. Don't use asctime, as it
8532 has undefined behavior for years outside the range -999..9999.
8533
7ed806a7
PE
85342012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8535
8536 Fix race conditions involving setenv, gmtime, localtime, asctime.
8537 Without this fix, interrupts could mess up code that uses these
8538 nonreentrant functions, since setting TZ invalidates existing
8539 tm_zone or tzname values, and since most of these functions return
8540 pointers to static storage.
8541 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8542 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8543 Grow the critical sections to include not just invoking
8544 localtime/gmtime, but also accessing these functions' results
8545 including their tm_zone values if any, and any related TZ setting.
8546 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
8547 so that the struct tm is saved in the critical section.
8548 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
8549 motivated by the fact that memory allocation needs to be outside
8550 the critical section.
8551
0c16dfed
DA
85522012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8553
8554 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8555 with RESET_INTERVAL.
8556
8557 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8558 Remove duplicated buffer name initialization.
8559
3f83ace8
JM
85602012-05-02 Jim Meyering <jim@meyering.net>
8561
8562 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8563
c7b8541e
JM
8564 * xfns.c (x_window): Use xstrdup (Bug#11375).
8565
90207a15 85662012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
8567
8568 * xdisp.c (pos_visible_p): If already at a newline from the
8569 display string before the 'while' loop, don't walk back the glyphs
8570 from it3.glyph_row. Solves assertion violation when the display
8571 string begins with a newline (egg.el). (Bug#11367)
8572
b593d6a9
AH
85732012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8574
8575 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8576 Move to simple.el.
8577
4737362e
GM
85782012-05-01 Glenn Morris <rgm@gnu.org>
8579
99cf43f9
GM
8580 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8581 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8582 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8583 All were removed before 23.1.
8584
9311dcff
GM
8585 * dispnew.c: Remove HAVE_LIBNCURSES test;
8586 it is always true on relevant platforms.
8587
4d5c6349
GM
8588 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8589 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8590
4737362e
GM
8591 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8592
74dd3a6b
AS
85932012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8594
8595 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8596 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8597 Remove.
8598
13c379ee
PE
85992012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8600
8601 Do not avoid creating empty evaporating overlays (Bug#9642).
8602 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8603 That is, do not delete an evaporating overlay if it becomes
8604 empty after its bounds are adjusted to fit within its buffer.
8605 This fix caused other problems, and I'm reverting it until we get
8606 to the bottom of them.
8607
a8e7d6d7 86082012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
8609
8610 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8611
a8e7d6d7 86122012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
8613
8614 * xdisp.c (pos_visible_p): If the window start position is beyond
8615 ZV, start the display from buffer beginning. Prevents assertion
8616 violation in init_iterator when the minibuffer window is scrolled
8617 via the scroll bar.
8618
8619 * window.c (window_scroll_pixel_based): Likewise.
8620
a8e7d6d7 86212012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
8622
8623 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8624
a8e7d6d7 86252012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
8626
8627 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8628 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8629
a8e7d6d7 86302012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 8631
b593d6a9
AH
8632 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8633 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 8634
1c6900d9
EZ
86352012-04-26 Eli Zaretskii <eliz@gnu.org>
8636
4c3fa1d9
EZ
8637 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8638 display element, check also the underlying string or buffer
8639 character. (Bug#11341)
8640
1c6900d9
EZ
8641 * w32menu.c: Include w32heap.h.
8642 (add_menu_item): If the call to AppendMenuW (via
8643 unicode_append_menu) fails, disable Unicode menus only if we are
8644 running on Windows 9X/Me.
8645
42bf8205
AS
86462012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8647
8648 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8649 (xgetint): Add missing shift for LSB tags.
8650
b1bac16e
MR
86512012-04-24 Martin Rudalics <rudalics@gmx.at>
8652
8653 * keyboard.c (read_char): Don't wipe echo area for select window
8654 events: These might get delayed via `mouse-autoselect-window'
8655 (Bug#11304).
8656
d69621cc
JB
86572012-04-24 Juanma Barranquero <lekktu@gmail.com>
8658
8659 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8660 manipulation of :loaded-from data.
8661
02fd101b
JB
86622012-04-23 Juanma Barranquero <lekktu@gmail.com>
8663
8664 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8665 now a cons (bug#11311).
8666
888bec30
PE
86672012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8668
89a438bd
PE
8669 Do not create empty overlays with the evaporate property (Bug#9642).
8670 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8671 if it becomes empty after its bounds are adjusted to fit within
8672 its buffer. Without this fix, in a nonempty buffer (let ((o
8673 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8674 yields an empty overlay that has the evaporate property, which is
8675 not supposed to happen.
8676
1068fe4d
PE
8677 Fix minor GTK3 problems found by static checking.
8678 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8679 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8680 (struct _EmacsFixedClass, emacs_fixed_get_type):
8681 Move decls here from emacsgtkfixed.h, since they needn't be public.
8682 (emacs_fixed_get_type): Now static.
8683 (emacs_fixed_class_init): Omit unused local.
8684 (emacs_fixed_child_type): Remove; unused.
8685 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8686 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8687 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8688 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8689 (EMACS_FIXED_GET_CLASS): Remove; unused.
8690 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8691
888bec30
PE
8692 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8693 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8694
de85e130
PE
86952012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8696
d0baac98 8697 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 8698 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
8699 (__malloc_size_t, __malloc_ptrdiff_t):
8700 Remove. All uses removed, replaced by the definiens if needed,
8701 since we can assume C89 or better now.
8702 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8703 (protect_malloc_state, align, get_contiguous_space)
8704 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8705 (malloc_atfork_handler_child, malloc_enable_thread)
8706 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8707 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8708 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8709 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8710 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8711 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8712 Define using prototypes, not old style.
8713 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8714 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8715 (align): Don't assume that signed integer overflow wraps around.
8716 Omit unused local var.
8717 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8718 (_free_internal_nolock, memalign, mallochook, reallochook):
8719 Omit no-longer-needed casts.
8720 (valloc): Use getpagesize, not __getpagesize.
8721 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8722 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8723
de85e130
PE
8724 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8725
dcbf5805
MA
87262012-04-22 Michael Albinus <michael.albinus@gmx.de>
8727
8728 Move functions from C to Lisp. Make non-blocking method calls
8729 the default. Implement further D-Bus standard interfaces.
8730
8731 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8732 (QCdbus_request_name_allow_replacement)
8733 (QCdbus_request_name_replace_existing)
8734 (QCdbus_request_name_do_not_queue)
8735 (QCdbus_request_name_reply_primary_owner)
8736 (QCdbus_request_name_reply_in_queue)
8737 (QCdbus_request_name_reply_exists)
8738 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8739 (QCdbus_registered_serial, QCdbus_registered_method)
8740 (QCdbus_registered_signal): New Lisp objects.
8741 (XD_DEBUG_MESSAGE): Use sizeof.
8742 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8743 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8744 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8745 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8746 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8747 (xd_signature, xd_append_arg): Allow float for integer types.
8748 (xd_get_connection_references): New function.
b593d6a9
AH
8749 (xd_get_connection_address): Rename from xd_initialize.
8750 Return cached address.
dcbf5805
MA
8751 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8752 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8753 level.
8754 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8755 Return number of refcounts.
dcbf5805
MA
8756 (Fdbus_get_unique_name): Make stronger parameter check.
8757 (Fdbus_message_internal): New defun.
8758 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8759 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8760 (Fdbus_send_signal, Fdbus_register_service)
8761 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8762 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8763 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8764 (Vdbus_compiled_version, Vdbus_runtime_version)
8765 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8766 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8767 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8768 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8769 Adapt docstring.
dcbf5805 8770
52828e02
PE
87712012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8772
da05bc4c
PE
8773 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8774 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8775 Do not assume ptrdiff_t is the same width as 'int'.
8776
52828e02
PE
8777 * alloc.c: Handle unusual debugging option combinations.
8778 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8779 since the two debugging options are incompatible.
8780 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8781 is defined.
8782 (mem_init, mem_insert, mem_insert_fixup):
8783 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8784 (NEED_MEM_INSERT): Remove; no longer needed.
8785
f01769f9
LL
87862012-04-22 Leo Liu <sdl.web@gmail.com>
8787
8788 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8789
5790543d
PE
87902012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8791
8792 * sysdep.c [__FreeBSD__]: Minor cleanups.
8793 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8794 Use Emacs indenting style more consistently. Avoid some casts.
8795 Use 'double' consistently rather than mixing 'float' and 'double'.
8796
b91b7e4d
EW
87972012-04-21 Eduard Wiebe <usenet@pusto.de>
8798
b593d6a9
AH
8799 * sysdep.c (list_system_processes, system_process_attributes):
8800 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8801
6114eb15
AS
88022012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8803
8804 * lisp.mk (lisp): Update.
8805
2f38dff7
PE
88062012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8807
8808 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8809 It is never used otherwise.
8810
4ae29f89
SM
88112012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8812
8813 * print.c (print_preprocess): Only check print_depth if print-circle
8814 is nil.
8815 (print_object): Check for cycles even when print-circle is nil and
8816 print-gensym is t, but only check print_depth if print-circle is nil.
8817
f30d612a
CY
88182012-04-20 Chong Yidong <cyd@gnu.org>
8819
8820 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8821 set the status to "failed" and ensure that sentinel is run.
8822
c07a4c0b 88232012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8824
8825 * process.c (Fset_process_inherit_coding_system_flag)
8826 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8827 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8828
c07a4c0b 88292012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8830
8831 * xdisp.c (string_buffer_position_lim): Limit starting position to
8832 BEGV.
8833 (set_cursor_from_row): If called for a mode-line or header-line
8834 row, return zero immediately.
8835 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8836 farther than the first row after the header line, if any.
8837 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8838 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8839
c07a4c0b 88402012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8841
4ae29f89
SM
8842 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8843 (bug#11238).
ad3a2b41 8844
c07a4c0b 88452012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 88462012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8847
8848 configure: new option --enable-gcc-warnings (Bug#11207)
8849 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8850 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8851 (ALL_CFLAGS): Use new macros rather than old.
8852 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8853 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8854 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8855 -Wunused-result, -Wunused-variable. This should go away once
8856 the Emacs and Gnulib regex code is merged.
8857 (xmalloc, xrealloc): Now static.
8858
aba027e8
PE
88592012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8860
8861 * dired.c (Fsystem_groups): Remove unused local.
8862
e5a36063
GM
88632012-04-17 Glenn Morris <rgm@gnu.org>
8864
8865 * dired.c (Fsystem_users): Doc fix.
8866
316411f0
DA
88672012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8868
8869 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8870 (syms_of_dired): Add them.
8871
9426aba4
PE
88722012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8873
b62a57be
PE
8874 Fix minor alloc.c problems found by static checking.
8875 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8876 New extern decls, to avoid calling undeclared functions.
8877 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8878 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8879 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8880 (NEED_MEM_INSERT): New macro.
8881 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8882 Remove one incorrect comment and fix another.
b62a57be 8883
3539f31f
PE
8884 Fix minor ralloc.c problems found by static checking.
8885 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8886 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8887 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8888 (r_alloc_sbrk): Now static.
8889
a041960a
PE
8890 Improve ralloc.c interface checking.
8891 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8892 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8893 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8894 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8895 [REL_ALLOC]: ... to here, to check interface.
8896 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8897 Remove decls. This fixes an "It stinks!".
8898
9426aba4
PE
8899 * alloc.c (which_symbols): Fix alignment issue / type clash.
8900
d55c12ed
AS
89012012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8902
8903 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8904 (struct Lisp_Misc_Any): Likewise.
8905 (struct Lisp_Free): Likewise.
8906 * alloc.c (union aligned_Lisp_Symbol): Define.
8907 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8908 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8909 (union aligned_Lisp_Misc): Define.
8910 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8911 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8912 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8913
b948ce8b
PE
89142012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8915
8916 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8917 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8918 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8919 * s/netbsd.h, s/sol2-6.h:
8920 Remove definition of GC_MARK_STACK, since the default now works.
8921 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8922 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8923 no longer the default.
8924 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8925
35dc09a1 89262012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8927
35dc09a1
GM
8928 * lread.c (lisp_file_lexically_bound_p):
8929 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 8930
35dc09a1
GM
89312012-04-14 Eli Zaretskii <eliz@gnu.org>
8932
8933 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8934 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8935
89362012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8937
8938 * nsterm.m (constrainFrameRect): Always constrain when there is only
8939 one screen (Bug#10962).
8940
bcd86815
KB
89412012-04-13 Ken Brown <kbrown@cornell.edu>
8942
8943 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8944
c25df26e
RT
89452012-04-13 Reuben Thomas <rrt@sc3d.org>
8946
8947 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8948
0fc59f1e
DC
89492012-04-11 Daniel Colascione <dancol@dancol.org>
8950
8951 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8952 against is gone. It's better to use vfork now so that when Cygwin
8953 gains a new, working vfork, we use it automatically (bug#10398).
8954
de8c03dc
SM
89552012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8956
8957 * window.c (save_window_save): Obey window-point-insertion-type.
8958
2f097256
GM
89592012-04-11 Glenn Morris <rgm@gnu.org>
8960
8961 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8962
453b951e
SM
89632012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8964
8965 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8966
75f1671a 89672012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
8968
8969 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8970 (force_quit_count): New var.
8971 (handle_interrupt): Use it.
8972
2a8ce227
JB
89732012-04-10 Juanma Barranquero <lekktu@gmail.com>
8974
8975 * w32.c (w32_delayed_load): Record the full path of the library
8976 being loaded (bug#10424).
8977
935396c0
GM
89782012-04-09 Glenn Morris <rgm@gnu.org>
8979
05920a43
GM
8980 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8981 not just in the obarray, before snarfing them. (Bug#11036)
8982
935396c0
GM
8983 * Makefile.in ($(leimdir)/leim-list.el):
8984 Pass EMACS rather than BUILT_EMACS.
8985
a18ecafa
TZ
89862012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8987
8988 * process.c (make_process):
8989 * process.h: Add integer `gnutls_handshakes_tried' member to
8990 process struct.
8991
6bbef4e5
JC
8992 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8993 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8994
8995 * gnutls.c (gnutls_log_function2i): Convenience log function.
8996 (emacs_gnutls_read): Use new log functions,
8997 `gnutls_handshakes_tried' process member, and
8998 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8999 attempts per process (connection).
9000
b4d3bc10
CY
90012012-04-09 Chong Yidong <cyd@gnu.org>
9002
9003 * eval.c (Fuser_variable_p, user_variable_p_eh)
9004 (lisp_indirect_variable): Functions deleted.
9005 (Fdefvar): Caller changed.
9006
9007 * callint.c (Finteractive, Fcall_interactively):
9008 * minibuf.c (Fread_variable): Callers changed.
9009
70f4d973
EZ
90102012-04-09 Eli Zaretskii <eliz@gnu.org>
9011
9012 * xdisp.c (set_cursor_from_row): If the display string appears in
9013 the buffer at position that is closer to point than the position
9014 after the display string, display the cursor on the first glyph of
9015 the display string. Fixes cursor display when a 'display' text
9016 property immediately follows invisible text. (Bug#11094)
9017
cb3c2e3e
PE
90182012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9019
9020 composite.c: use 'double' consistently
9021 * composite.c (get_composition_id): Use 'double' consistently
9022 instead of converting 'float' to 'double' and vice versa; this is
9023 easier to understand and avoids a GCC warning.
9024
fd06db5d
GM
90252012-04-09 Glenn Morris <rgm@gnu.org>
9026
50fe702a
GM
9027 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9028 preparation for dumping it with emacs. (Bug#4789)
9029 (leimdir): New variable.
9030 ($(leimdir)/leim-list.el): New rule.
9031 (emacs$(EXEEXT)): Depend on leim-list.el.
9032
fd06db5d
GM
9033 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9034 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9035 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9036
55c131ee
AS
90372012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9038
9039 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9040 proper alignment.
9041
9209588f
JB
90422012-04-07 Juanma Barranquero <lekktu@gmail.com>
9043
9044 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9045 Remove unused local variable.
9046
e3fb2efb
PE
90472012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9048
9049 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9050 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9051 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9052 objects, as mark_maybe_pointer will catch them otherwise.
9053 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9054 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9055
b5385551
PE
90562012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9057
9058 Fix typo that broke non-Windows builds.
9059 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9060
9078ead6
EZ
90612012-04-07 Eli Zaretskii <eliz@gnu.org>
9062
9063 Support building on MS-Windows with libxml2.
9064
9065 * makefile.w32-in (OBJ2): Add xml.$(O).
9066 (GLOBAL_SOURCES): Add xml.c.
9067 ($(BLD)/xml.$(O)): New dependency list.
9068
9069 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9070 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9071 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9072 [!WINDOWSNT]: New macros.
9073 (init_libxml2_functions, libxml2_loaded_p): New functions.
9074 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9075 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9076 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9077 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9078 linked in).
6bbef4e5
JC
9079 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9080 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
9081 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9082
9083 * emacs.c: Don't include libxml/parser.h.
9084 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9085 xmlCleanupParser directly.
9086
9087 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9088
3811fdf3
EZ
90892012-04-07 Eli Zaretskii <eliz@gnu.org>
9090
9091 * indent.c (Fvertical_motion): If there is a display string at
9092 point, use it.vpos to compute how many lines to backtrack after
9093 move_it_to point. (Bug#11133)
9094
2f8e16b2
EZ
90952012-04-06 Eli Zaretskii <eliz@gnu.org>
9096
9097 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9098 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9099 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9100 macros related to unification of CJK characters. For the details,
9101 see the discussion following the message here:
9102 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9103
3d439cd1
CY
91042012-04-04 Chong Yidong <cyd@gnu.org>
9105
9106 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9107
8bc53d00
EZ
91082012-04-01 Eli Zaretskii <eliz@gnu.org>
9109
9110 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9111 instead of alloca. (Bug#11138)
9112
3b0512a3
AS
91132012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9114
9115 * w32menu.c (is_simple_dialog): Properly check lisp types.
9116 (Bug#11141)
9117
8427ddd2
EZ
91182012-03-31 Eli Zaretskii <eliz@gnu.org>
9119
979022ef
EZ
9120 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9121 position we get to after a call to move_it_to fails the
9122 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9123 only if we wind up in a string from display property. (Bug#11063)
9124
a6b1c7cc
EZ
9125 * window.c (Fdelete_other_windows_internal): Invalidate the row
9126 and column information about mouse highlight, so that redisplay
9127 restores it after reallocating the glyph matrices. (Bug#7464)
9128
8427ddd2
EZ
9129 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9130 string comes from a `display' text property, use the buffer
9131 position of that property as if we actually saw that position in
9132 the row's glyphs.
697ba24b
EZ
9133 (move_it_by_lines): Remove the assertion that
9134 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9135 violated when there's a before-string at the beginning of a line.
9136 (Bug#11063)
8427ddd2 9137
65a0a738
EZ
91382012-03-30 Eli Zaretskii <eliz@gnu.org>
9139
9140 * xdisp.c (append_space_for_newline): If the default face was
9141 remapped, use the remapped face for the appended newline.
9142 (extend_face_to_end_of_line): Use the remapped default face for
9143 extending the face to the end of the line.
9144 (display_line): Call extend_face_to_end_of_line when the default
9145 face was remapped. (Bug#11068)
9146
581355cc
EZ
91472012-03-29 Eli Zaretskii <eliz@gnu.org>
9148
9149 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9150
e8fc049f
SM
91512012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9152
9153 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9154
4fb9a543
GM
91552012-03-27 Glenn Morris <rgm@gnu.org>
9156
9157 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9158 Doc fixes.
9159
679910f1
KH
91602012-03-26 Kenichi Handa <handa@m17n.org>
9161
9162 * dispextern.h (struct glyph): Fix previous change. Change the
9163 bit length of glyphless.ch to 25 (Bug#11082).
9164
90d49b7f
CY
91652012-03-26 Chong Yidong <cyd@gnu.org>
9166
9167 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9168 (command_loop_1): Use it; inhibit selection update for
9169 handle-select-window too (Bug#8996).
9170
f514f6f0
FP
91712012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9172
e8fc049f 9173 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 9174
bf43fa51
KH
91752012-03-25 Kenichi Handa <handa@m17n.org>
9176
9177 * dispextern.h (struct glyph): Change the bit length of
9178 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9179
8a0c01dd
EZ
91802012-03-24 Eli Zaretskii <eliz@gnu.org>
9181
9182 * s/ms-w32.h (tzname): Include time.h before redirecting to
9183 _tzname. Fixes the MSVC build. (Bug#9960)
9184
7d1c3a76
AS
91852012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9186
8ed79523
AS
9187 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9188 characters.
9189
7d1c3a76
AS
9190 * xterm.c (XTread_socket): Only modify handling_signal if
9191 !SYNC_INPUT. (Bug#11080)
9192
e99a9b8b
EZ
91932012-03-23 Eli Zaretskii <eliz@gnu.org>
9194
9195 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9196 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9197 when fetching a multibyte character consumes more bytes than
9198 CHAR_BYTES returns, due to unification of CJK characters in
9199 string_char. (Bug#11073)
9200
5063c0e1
TN
92012012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9202
9203 * process.c (wait_reading_process_output): Handle pty disconnect
9204 by refraining from sending oneself a SIGCHLD (bug#10933).
9205
9f851fbd
CY
92062012-03-22 Chong Yidong <cyd@gnu.org>
9207
9208 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9209
5063c0e1 9210 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
9211 Mark string as coming from a prefix property.
9212 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9213 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9214
fb5b8aca
CY
92152012-03-21 Chong Yidong <cyd@gnu.org>
9216
9217 * xfaces.c (Vface_remapping_alist): Doc fix.
9218
62356a1b
EZ
92192012-03-20 Eli Zaretskii <eliz@gnu.org>
9220
9221 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
9222 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9223 Doc fixes.
62356a1b 9224
025de85b
CY
92252012-03-20 Chong Yidong <cyd@gnu.org>
9226
9227 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9228 to reflect default non-nil value of redisplay-dont-pause.
9229
4827f94e
KH
92302012-03-19 Kenichi Handa <handa@m17n.org>
9231
9232 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9233 it fit in a valid range (Bug#11003).
9234
e50a24a2
EZ
92352012-03-18 Eli Zaretskii <eliz@gnu.org>
9236
9237 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9238 that is not from display property, accept the row as a "cursor
9239 row" if one of the string's character has a non-nil `cursor'
9240 property. Fixes cursor positioning when there are newlines in
9241 overlay strings, e.g. in icomplete.el. (Bug#11035)
9242
9af5ed87
PE
92432012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9244
9245 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9246
d1f55f16
CY
92472012-03-12 Chong Yidong <cyd@gnu.org>
9248
9249 * eval.c (inhibit_lisp_code): Rename from
9250 inhibit_window_configuration_change_hook; move from window.c.
9251
9252 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9253 * window.c (run_window_configuration_change_hook)
9254 (syms_of_window): Callers changed.
9255
66c5eebd
CY
92562012-03-11 Chong Yidong <cyd@gnu.org>
9257
413df973
CY
9258 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9259
66c5eebd
CY
9260 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9261
1de11f56
CY
92622012-03-10 Chong Yidong <cyd@gnu.org>
9263
9264 * frame.c (other_visible_frames): Don't assume the selected frame
9265 is visible (Bug#10955).
9266
cae07000
SM
92672012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9268
9269 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9270
89c94350
JD
92712012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9272
9273 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9274 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9275 zero (Bug#10954).
9276
999dd333
GM
92772012-03-03 Glenn Morris <rgm@gnu.org>
9278
01a6dcc8 9279 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 9280
de0100f2
EZ
92812012-03-02 Eli Zaretskii <eliz@gnu.org>
9282
9283 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9284 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
9285 (redisplay_window, next_element_from_string): Fix typos in
9286 comments.
3e441275
EZ
9287 (redisplay_window): Pass to move_it_vertically the margin in
9288 pixels, not in screen lines.
de0100f2 9289
96a72ee9
GM
92902012-03-02 Glenn Morris <rgm@gnu.org>
9291
9292 * buffer.c (buffer-list-update-hook): Doc fix.
9293
312508d7
EZ
92942012-02-29 Eli Zaretskii <eliz@gnu.org>
9295
9296 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9297 push_it before setting up the iterator for the first overlay
9298 string, even if we have an empty string loaded.
9299 (next_overlay_string): If there's an empty string on the iterator
9300 stack, pop the stack. (Bug#10903)
9301
27f3c637
PE
93022012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9303
9304 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9305 Suggested by Stefan Monnier in
9306 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9307 * alloc.c (widen_to_Lisp_Object): New static function.
9308 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9309 and widening them to Lisp_Objects. This would work even if
9310 USE_LSB_TAG is defined and wide integers are used, which might
9311 happen in a future version of Emacs.
9312
3c9dfce6
CY
93132012-02-25 Chong Yidong <cyd@gnu.org>
9314
fa74b241
CY
9315 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9316 Doc fix.
9317
3c9dfce6
CY
9318 * xselect.c (Fx_selection_exists_p): Doc fix.
9319 (x_clipboard_manager_save_all): Print an informative message
9320 before saving to clipboard manager.
9321
9486df08
CY
93222012-02-24 Chong Yidong <cyd@gnu.org>
9323
9324 * keyboard.c (process_special_events): Handle all X selection
9325 requests in kbd_buffer, not just the next one (Bug#8869).
9326
f01d3321
CY
93272012-02-23 Chong Yidong <cyd@gnu.org>
9328
9329 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9330 call when setting menu-bar-lines and tool-bar-lines parameters.
9331 (unwind_create_frame_1): New helper function.
9332
9333 * window.c (inhibit_window_configuration_change_hook): New var.
9334 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 9335 (syms_of_window): Initialize it.
f01d3321 9336
86b847b6
CY
93372012-02-22 Chong Yidong <cyd@gnu.org>
9338
9339 * xterm.c (x_draw_image_relief): Add missing type check for
9340 Vtool_bar_button_margin (Bug#10743).
9341
a59225b1
CY
93422012-02-21 Chong Yidong <cyd@gnu.org>
9343
9344 * fileio.c (Vfile_name_handler_alist): Doc fix.
9345
9346 * buffer.c (Fget_file_buffer): Protect against invalid file
9347 handler return value.
9348
310f5bd4
PE
93492012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9350
cb3a28cc
PE
9351 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9352 when computing $valmask.
9353
310f5bd4
PE
9354 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9355 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9356 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9357 It's useless in that case, and it can cause problems on hosts
9358 that allocate halves of EMACS_INT values separately.
9359 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9360 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9361 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9362 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9363 it avoids undefined behavior on hosts where shifting right by more
9364 than the word width has undefined behavior.
9365
2375c96a
CY
93662012-02-19 Chong Yidong <cyd@gnu.org>
9367
9368 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9369 (Funhandled_file_name_directory, Ffile_name_as_directory)
9370 (Fdirectory_file_name, Fexpand_file_name)
9371 (Fsubstitute_in_file_name): Protect against invalid file handler
9372 return values (Bug#10845).
9373
3eb49e71
EZ
93742012-02-18 Eli Zaretskii <eliz@gnu.org>
9375
9376 * .gdbinit (pitx): Fix incorrect references to fields of the
9377 iterator stack.
9378
7b926f3f
CY
93792012-02-17 Chong Yidong <cyd@gnu.org>
9380
9381 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9382
11273115
PE
93832012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9384
9385 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9386 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9387
c3a70e2b
CY
93882012-02-15 Chong Yidong <cyd@gnu.org>
9389
9390 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9391 marked as special. Also, starting docstrings with * is obsolete.
9392
0ca43699
AS
93932012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9394
9395 * gnutls.c (emacs_gnutls_write): Fix last change.
9396
2e8f3c56
LI
93972012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9398
9399 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9400 send_process.
9401
af70074f
SM
94022012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9403
9404 * keymap.c (Fsingle_key_description): Handle char ranges.
9405
95986d52
CY
94062012-02-12 Chong Yidong <cyd@gnu.org>
9407
afd83bd1
CY
9408 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9409 as that creates a dangerous corner case.
9410
95986d52
CY
9411 * window.c (Fdelete_window_internal): Invalidate the mouse
9412 highlight (Bug#9904).
9413
bd7da63e
GM
94142012-02-12 Glenn Morris <rgm@gnu.org>
9415
9416 * xselect.c (Fx_own_selection_internal)
9417 (Fx_get_selection_internal, Fx_disown_selection_internal)
9418 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9419 * nsselect.m (Fx_own_selection_internal)
9420 (Fx_disown_selection_internal, Fx_selection_exists_p)
9421 (Fx_selection_owner_p, Fx_get_selection_internal):
9422 Sync docs and argument specs with the xselect.c versions.
9423
77abcbc2
LI
94242012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9425
9426 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9427
90b671e2
EZ
94282012-02-11 Eli Zaretskii <eliz@gnu.org>
9429
1c0ca0b7
EZ
9430 * w32select.c (Fx_selection_exists_p): Sync doc string and
9431 argument list with xselect.c. (Bug#10783)
9432
9433 * w16select.c (Fx_selection_exists_p): Sync doc string and
9434 argument list with xselect.c. (Bug#10783)
90b671e2 9435
49241268
GM
94362012-02-10 Glenn Morris <rgm@gnu.org>
9437
9438 * fns.c (Fsecure_hash): Doc fix.
9439
f998bbe7 94402012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
9441
9442 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9443
0992bd9c
CY
94442012-02-07 Chong Yidong <cyd@gnu.org>
9445
9446 * buffer.c (Fbuffer_local_variables)
9447 (buffer_lisp_local_variables): Handle unbound vars correctly;
9448 don't let Qunbound leak into Lisp.
9449
af008560
GM
94502012-02-07 Glenn Morris <rgm@gnu.org>
9451
dd605cc4
GM
9452 * image.c (Fimagemagick_types): Doc fix.
9453
af008560
GM
9454 * image.c (imagemagick-render-type): Change it from a lisp object
9455 to an integer. Move the doc here from the lisp manual.
9456 Treat all values not equal to 0 the same.
9457
1449fa1d
CY
94582012-02-06 Chong Yidong <cyd@gnu.org>
9459
9460 * doc.c (store_function_docstring): Avoid applying docstring of
9461 alias to base function (Bug#2603).
9462
3723ec07
AS
94632012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9464
9465 * .gdbinit (pp1, pv1): Remove redundant defines.
9466 (pr): Use pp.
9467
79c1cc1e
CY
94682012-02-04 Chong Yidong <cyd@gnu.org>
9469
9470 * nsterm.m: Declare a global (Bug#10694).
9471
d7f29f8e
EZ
94722012-02-04 Eli Zaretskii <eliz@gnu.org>
9473
cae07000
SM
9474 * w32.c (get_emacs_configuration_options):
9475 Include --enable-checking, if specified, in the return value.
d7f29f8e 9476
3b95a6f9
MR
94772012-02-04 Martin Rudalics <rudalics@gmx.at>
9478
9479 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9480 after rounding frame sizes. (Bug#9723)
9481
d6fa96a6
EZ
94822012-02-04 Eli Zaretskii <eliz@gnu.org>
9483
9484 * keyboard.c (adjust_point_for_property): Don't position point
9485 before BEGV. (Bug#10696)
9486
df0b2940
PE
94872012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9488
9489 Handle overflow when computing char display width (Bug#9496).
9490 * character.c (char_width): Return EMACS_INT, not int.
9491 (char_width, c_string_width): Check for overflow when
9492 computing the width; this is possible now that individual
9493 characters can have unbounded width. Problem introduced
9494 by merge from Emacs 23 on 2012-01-19.
9495
6bee44d6
MA
94962012-02-02 Michael Albinus <michael.albinus@gmx.de>
9497
9498 * dbusbind.c (Fdbus_register_method): Mention the return value
9499 :ignore in the docstring.
9500
44f92739
GM
95012012-02-02 Glenn Morris <rgm@gnu.org>
9502
1b9f60cc
GM
9503 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9504
44f92739
GM
9505 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9506 Unconditionally set to t. (Bug#10673)
9507 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9508 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9509 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9510
c5d3843c
KH
95112012-02-02 Kenichi Handa <handa@m17n.org>
9512
9513 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9514 0, do not call append_composite_glyph.
9515
159462d4 95162012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
9517
9518 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9519 NULL (Bug#6988).
9520 (x_produce_glyphs): If the component of a composition is a null
9521 string, set it->pixel_width to 1 to avoid zero-width glyph.
9522
78cef877
EZ
95232012-02-01 Eli Zaretskii <eliz@gnu.org>
9524
9525 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9526 first 2 arguments are identical. This makes inserting large
9527 output from a subprocess an order of magnitude faster on
9528 MS-Windows, where all sbrk'ed memory is always contiguous.
9529
97897668
GM
95302012-01-31 Glenn Morris <rgm@gnu.org>
9531
9532 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 9533 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
9534 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9535
31fd3586
GM
95362012-01-29 Glenn Morris <rgm@gnu.org>
9537
9538 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9539
0e24a8b2
CY
95402012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9541
9542 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9543
cc0adcb0
CY
95442012-01-28 Chong Yidong <cyd@gnu.org>
9545
9546 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9547
acc28cb9
CY
95482012-01-26 Chong Yidong <cyd@gnu.org>
9549
9c69cfb7
CY
9550 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9551
acc28cb9
CY
9552 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9553 repeat counts (Bug#10507).
9554
48da7392
GM
95552012-01-26 Glenn Morris <rgm@gnu.org>
9556
9557 * lread.c (syms_of_lread): Doc fix.
9558
14af5f7f
CY
95592012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9560
9561 * coding.c (encode_designation_at_bol): Change return value to
9562 EMACS_INT.
9563
0b21c100
CY
95642012-01-25 Chong Yidong <cyd@gnu.org>
9565
9566 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9567
3c2907f7
CY
95682012-01-21 Chong Yidong <cyd@gnu.org>
9569
9570 * floatfns.c (Fcopysign): Make the second argument non-optional,
9571 since nil is not allowed anyway.
9572
959ad23f
AS
95732012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9574
9575 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9576 (send_process): Likewise.
9577
34a02f46
MR
95782012-01-19 Martin Rudalics <rudalics@gmx.at>
9579
9580 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
9581 (Vwindow_persistent_parameters): Do not use Qstate.
9582 Rewrite doc-strings.
34a02f46 9583
1259009a 95842012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
9585
9586 * character.c (char_width): New function.
70d4fdf6
GM
9587 (Fchar_width, c_string_width, lisp_string_width):
9588 Use char_width (Bug#9496).
25ed9e61 9589
6a6ee00d
MR
95902012-01-16 Martin Rudalics <rudalics@gmx.at>
9591
9592 * window.c (Vwindow_persistent_parameters): New variable.
9593 (Fset_window_configuration, save_window_save): Handle persistent
9594 window parameters.
9595
c85efaf7
EZ
95962012-01-14 Eli Zaretskii <eliz@gnu.org>
9597
9598 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9599 thrashing the stack of the thread. (Bug#9087)
9600
5944709e
PE
96012012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9602
9603 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9604
e71f5d99
EZ
96052012-01-11 Eli Zaretskii <eliz@gnu.org>
9606
9607 * xdisp.c (rows_from_pos_range): Handle the case where the
9608 highlight ends on a newline. (Bug#10464)
9609 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9610 he end column for display of highlight that ends on a newline
9611 before a R2L line.
9612
ce316182
GM
96132012-01-11 Glenn Morris <rgm@gnu.org>
9614
9615 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9616 from load-path also when installation-directory is nil. (Bug#10208)
9617
5b43da69
GM
96182012-01-10 Glenn Morris <rgm@gnu.org>
9619
74cc8ff9
GM
9620 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9621
7d8d6e4e
GM
9622 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9623 Update template values to be closer to their typical values these days.
5b43da69 9624
a0db8d43
EZ
96252012-01-09 Eli Zaretskii <eliz@gnu.org>
9626
9627 * xdisp.c (rows_from_pos_range): Accept additional argument
9628 DISP_STRING, and accept any glyph in a row whose object is that
9629 string as eligible for mouse highlight. Fixes mouse highlight of
9630 display strings from overlays. (Bug#10464)
9631
9a0115ab 96322012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 9633
b9110d6a 9634 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
9635 * fileio.c (auto_saving_dir_umask): New static var.
9636 (Fmake_directory_internal): Use it.
9637 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9638 creating the directory. The old code temporarily assigns
9639 too-generous permissions to the directory.
9640 (do_auto_save_eh): Clear it.
b9110d6a 9641 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
9642 that the var is always cleared.
9643
6c1bd3f3
EZ
96442012-01-07 Eli Zaretskii <eliz@gnu.org>
9645
9646 * search.c (scan_buffer): Pass character positions to
9647 know_region_cache, not byte positions. (Bug#6540)
9648
069d2b50
L
96492012-01-07 LynX <_LynX@bk.ru> (tiny change)
9650
9651 * w32.c (sys_rename): Report EXDEV when rename of a directory
9652 fails because the target is on another logical disk. (Bug#10284)
9653
75bf0d33
DB
96542012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9655
9656 * xterm.c (x_embed_request_focus): New function.
9657
9658 * xterm.h: Add prototype.
9659
9660 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9661
1c6e5a32
GM
96622012-01-05 Glenn Morris <rgm@gnu.org>
9663
9664 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9665
651e947e
EZ
96662012-01-01 Eli Zaretskii <eliz@gnu.org>
9667
9668 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9669 Load gnutls_transport_set_lowat only if GnuTLS version is below
9670 2.11.1.
9671 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9672 GnuTLS versions below 2.11.1.
9673
3778cdd8
AL
96742011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9675
9676 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9677 to the doc string advising against its use for altering the way
9678 windows are scrolled.
9679
0e5317f7
KH
96802011-12-28 Kenichi Handa <handa@m17n.org>
9681
9682 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9683 coding-system ASCII compatible only when it does not produce BOM
9684 on encoding (Bug#10383).
9685
93d5ca1f
JD
96862011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9687
9688 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9689 can scroll.
9690 (create_and_show_popup_menu): Always use menu_position_func for
9691 Gtk3 (Bug#10361).
9692
ca22b785
AS
96932011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9694
9695 * callint.c (Fcall_interactively): Don't truncate prompt string.
9696
d048e1e6
EZ
96972011-12-23 Eli Zaretskii <eliz@gnu.org>
9698
9699 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9700 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 9701 resumed from there (after widening). (Bug#10360)
d048e1e6 9702
5ccaba1f
JD
97032011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9704
9705 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9706
204ee57f
JD
97072011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9708
b81d40f0
JB
9709 * nsterm.m (x_free_frame_resources):
9710 Release f->output_data.ns->miniimage.
204ee57f
JD
9711 (ns_index_color): Fix indentation. Do not retain
9712 color_table->colors[i].
9713
9714 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9715 before returning.
9716
9717 * nsfns.m (x_set_background_color): Assign return value from
9718 ns_index_color to face-background instead of NSColor*.
9719 (ns_implicitly_set_icon_type): Fix indentation.
9720 Change assignment in for loop to comparison.
9721
9722 * emacs.c (ns_pool): New variable.
9723 (main): Assign ns_pool.
9724 (Fkill_emacs): Call ns_release_autorelease_pool.
9725
9726 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9727 autorelease fdesc, release fdAttrs and tdict.
9728 (ns_get_covering_families): Release charset.
9729 (ns_findfonts): Release NSFontDescriptor created with new.
9730 (ns_uni_to_glyphs): Fix indentation.
9731 (setString): Release attrStr before assigning new value.
9732
c803b2b7
JD
97332011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9734
678f4426
JD
9735 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9736 and NS_IMPL_COCOA.
9737 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9738 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9739
cd394be1 97402011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9741
5fecd5fc
JD
9742 * nsterm.m (ns_term_init): Subscribe for notifications
9743 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9744 to method trackingNotification in EmacsMenu.
9745
9746 * nsmenu.m (trackingMenu): New variable.
3771cb17 9747 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9748 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9749 from Aquamacs (Bug#7030).
678f4426
JD
9750
97512011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9752
c803b2b7
JD
9753 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9754 (symbol_to_nsstring): Fix indentation.
9755 (ns_symbol_to_pb): New function.
cae07000
SM
9756 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9757 (Fns_rotate_cut_buffers_internal): Remove.
9758 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9759 Fns_store_cut_buffer_internal.
9760 (ns_get_foreign_selection, Fx_own_selection_internal)
9761 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9762 (Fns_get_selection_internal, Fns_store_selection_internal):
9763 Use ns_symbol_to_pb and check if return value is nil.
9764 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9765 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9766 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9767 renamed to Sns_store_selection_internal.
9768 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9769 and remove this function.
9770 (ns_handle_selection_clear): Remove, never used.
9771 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9772 here.
9773
e1b01a3a
KB
97742011-12-17 Ken Brown <kbrown@cornell.edu>
9775
9776 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9777 GID is unknown (Bug#10257).
9778
2adb6e85
PE
97792011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9780
9781 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9782 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9783 which caused a build failure on GNU/Linux IA-64. This problem was
9784 introduced by my 2011-10-07 patch.
9785
d1d7b339
JL
97862011-12-15 Juri Linkov <juri@jurta.org>
9787
9788 * image.c (imagemagick_error): New function. (Bug#10112)
9789 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9790 Use `imagemagick_error' where ImageMagick functions return
9791 `MagickFalse'.
9792 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9793 proper order.
9794
100d5755
KH
97952011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9796
9797 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9798 fill background (Bug#8992).
9799
454592a6
MR
98002011-12-13 Martin Rudalics <rudalics@gmx.at>
9801
9802 * window.c (Vwindow_combination_resize)
9803 (Vwindow_combination_limit): Use t instead of non-nil in
9804 doc-strings.
61d4b438
MR
9805 (Vrecenter_redisplay): Add first sentence of doc-string on
9806 separate line.
53524d93 9807 (Frecenter): Fix doc-string typo.
454592a6 9808
3633e3aa
KH
98092011-12-11 Kenichi Handa <handa@m17n.org>
9810
9811 * coding.c (Funencodable_char_position): Pay attention to the
9812 buffer text relocation (Bug#9389).
9813
7b9d523a 98142011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9815
7b9d523a
JD
9816 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9817 gtk_init (Bug#10100).
9818
b73189c6
EZ
98192011-12-10 Eli Zaretskii <eliz@gnu.org>
9820
9821 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9822 IT->string is nil. (Bug#10263)
9823
f7dfe5d6
JD
98242011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9825
83faebb4
JD
9826 * nsterm.h (x_free_frame_resources): Declare.
9827
f7dfe5d6
JD
9828 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9829 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9830
9831 * nsterm.h (ns_get_defaults_value): Declare.
9832
9833 * nsterm.m (ns_default): Call ns_get_defaults_value.
9834
7cd4e72c
EZ
98352011-12-09 Eli Zaretskii <eliz@gnu.org>
9836
9837 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9838 (Bug#10170)
9839
b34d7317
YM
98402011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9841
9842 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9843 that where the value of an _OBJC_* symbol points to is in the .bss
9844 section (Bug#10240).
9845
76470ad1
KH
98462011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9847
9848 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9849 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9850
745fff94
KH
98512011-12-08 Kenichi Handa <handa@m17n.org>
9852
9853 * ftfont.c (get_adstyle_property): Fix previous change
9854 (Bug#10233).
9855
6e44397c
JB
98562011-12-07 Juanma Barranquero <lekktu@gmail.com>
9857
9858 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9859 dirs from the default value of EMACSLOADPATH (bug#10208).
9860
7efa6272
GM
98612011-12-07 Glenn Morris <rgm@gnu.org>
9862
9863 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9864 installation and source directories as well. (Bug#10208)
9865
f6fc4d87
CY
98662011-12-06 Chong Yidong <cyd@gnu.org>
9867
9868 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9869
2bf26180
GM
98702011-12-06 Glenn Morris <rgm@gnu.org>
9871
9872 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9873 as an error, not just -1. (Bug#10217)
9874
3a6ad4f0
CY
98752011-12-05 Chong Yidong <cyd@gnu.org>
9876
9877 * keyboard.c (process_special_events): New function.
9878 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9879
75a3b399
PE
98802011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9881
9882 * coding.c (encode_designation_at_bol): Don't use uninitialized
9883 local variable (Bug#9318).
9884
c3c9e25e
KH
98852011-12-05 Kenichi Handa <handa@m17n.org>
9886
9887 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9888 return Qnil (Bug#8046, Bug#10193).
9889
5eb05ea3
KH
98902011-12-05 Kenichi Handa <handa@m17n.org>
9891
9892 * coding.c (encode_designation_at_bol): New args charbuf_end and
9893 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9894 (coding_set_source): Return how many bytes coding->source was
9895 relocated.
9896 (coding_set_destination): Return how many bytes
9897 coding->destination was relocated.
9898 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9899 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9900
99012011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9902
9903 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9904 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9905 macro (Bug#9318).
9906
99072011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9908
9909 The following changes are to fix Bug#9318.
9910
a79703f5 9911 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9912 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9913 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9914 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9915
7dbda6df
JB
99162011-12-05 Juanma Barranquero <lekktu@gmail.com>
9917
9918 * lisp.h (process_quit_flag): Fix external declaration.
9919
6d5eb5b0
SM
99202011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9921
9922 Don't macro-inline non-performance-critical code.
9923 * eval.c (process_quit_flag): New function.
9924 * lisp.h (QUIT): Use it.
9925
a0c3fad0
JD
99262011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9927
9928 * nsfns.m (get_geometry_from_preferences): New function.
9929 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9930
6c07aac2
AS
99312011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9932
9933 * emacs.c (Qkill_emacs): Define.
9934 (syms_of_emacs): Initialize it.
9935 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9936 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
9937 (quit_throw_to_read_char): Add parameter `from_signal'.
9938 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
9939 * lisp.h (QUIT): Call Fkill_emacs if requested.
9940
c052ead4
JD
99412011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9942
9943 * widget.c (update_wm_hints): Return if wmshell is null.
9944 (widget_update_wm_size_hints): New function.
9945
9946 * widget.h (widget_update_wm_size_hints): Declare.
9947
9948 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9949 widget_update_wm_size_hints (Bug#10104).
9950
9e49252b
EZ
99512011-12-03 Eli Zaretskii <eliz@gnu.org>
9952
9953 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9954 before a newline, prepare the bidi iterator for consuming the
9955 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 9956 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 9957
02b16839
JL
99582011-12-02 Juri Linkov <juri@jurta.org>
9959
9960 * search.c (Fword_search_regexp): New Lisp function created from
9961 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9962 (Fword_search_backward, Fword_search_forward)
9963 (Fword_search_backward_lax, Fword_search_forward_lax):
9964 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9965 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9966
0068070e
SM
99672011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9968
9969 * fileio.c (Finsert_file_contents): Move after-change-function call
9970 to before the "handled:" label, since all "goto handled" appear in
9971 cases where the *-change-functions have already been properly called
9972 (bug#10117).
9973
3360a3fc
AS
99742011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9975
9976 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9977 waiting for input. (Bug#10169)
9978
73d6c093
EZ
99792011-11-30 Eli Zaretskii <eliz@gnu.org>
9980
9981 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9982 verifies glyph row's hash code--we have just reallocated the
9983 glyphs, so their contents can be complete garbage. (Bug#10164)
9984
febe6bea
JB
99852011-11-30 Juanma Barranquero <lekktu@gmail.com>
9986
9987 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9988
801a4313
EZ
99892011-11-30 Eli Zaretskii <eliz@gnu.org>
9990
9991 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9992 attributes are tested _before_ calling verify_row_hash, to protect
9993 against GCC re-ordering of the tests. (Bug#10164)
9994
2b56b87e
JD
99952011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9996
9997 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9998
9999 * xterm.c (handle_one_xevent): Only set async_visible and friends
10000 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 10001 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
10002 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10003
dbf31225
PE
100042011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10005
10006 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10007 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10008 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10009 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10010 All uses changed to use GCPRO1 etc.
10011 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10012 Revert to old implementation (i.e., before 2011-03-11).
10013
1305621b
YM
100142011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10015
10016 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10017 of scroll runs so as to avoid assigning disabled bogus rows and
10018 unnecessary graphics copy operations.
10019
8c9afb46
EZ
100202011-11-27 Eli Zaretskii <eliz@gnu.org>
10021
10022 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10023 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10024 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10025 (malloc, free, realloc, calloc): Redirect to e_* only when
10026 compiling Emacs.
10027
10028 * lisp.h (GCTYPEBITS): Move before first use.
10029 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10030 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10031 this macro definition.
10032
10033 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10034 _MSC_VER.
10035
54e9e3bf
JD
100362011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10037
6d5eb5b0
SM
10038 * gtkutil.c (xg_create_frame_widgets):
10039 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
10040 present with Gtk+ 2.0.
10041
83aca1cb
PE
100422011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10043
10044 * fileio.c (Finsert_file_contents): Undo previous change; see
10045 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10046
5b76caa4
PE
100472011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10048
10049 Rename locals to avoid shadowing.
10050 * fileio.c (Finsert_file_contents):
10051 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10052 * process.c (wait_reading_process_output):
10053 Rename inner 'proc' to 'p' to avoid shadowing.
10054 Indent for consistency with usual Emacs style.
10055
8c535114
EZ
100562011-11-25 Eli Zaretskii <eliz@gnu.org>
10057
10058 * xdisp.c (redisplay_window): If cursor row is not fully visible
10059 after recentering, and scroll-conservatively is set to a large
10060 number, scroll window by a few more lines to make the cursor fully
10061 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
10062 (start_display): Don't move to the next line if the display should
10063 start at a newline that is part of a display vector or an overlay
10064 string. (Bug#10119)
8c535114 10065
fa4fdb5c
JL
100662011-11-24 Juri Linkov <juri@jurta.org>
10067
10068 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10069 after the `MagickPingImage' call. (Bug#10112)
10070
90ec88df
CY
100712011-11-23 Chong Yidong <cyd@gnu.org>
10072
10073 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10074
56e2e794
MR
100752011-11-23 Martin Rudalics <rudalics@gmx.at>
10076
10077 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10078 making another buffer current. (Bug#10114)
10079
b6e64c41
GM
100802011-11-23 Glenn Morris <rgm@gnu.org>
10081
10082 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10083
6b21de18
CY
100842011-11-23 Chong Yidong <cyd@gnu.org>
10085
10086 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10087 using it (Bug#5984).
10088
b12cd789
EZ
100892011-11-22 Eli Zaretskii <eliz@gnu.org>
10090
10091 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10092 and header-lines, as they don't have one computed for them.
10093 (Bug#10098)
10094
10095 * .gdbinit (prow): Make displayed values more self-explaining.
10096 Add row's hash code.
10097
261b6fd4
LMI
100982011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10099
10100 * process.c (wait_reading_process_output): Fix asynchrounous
10101 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 10102 (wait_reading_process_output): Add comment and URL.
261b6fd4 10103
e7cfd277
JD
101042011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10105
10106 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10107
a9b9b7f5
CY
101082011-11-21 Chong Yidong <cyd@gnu.org>
10109
10110 * window.c (Fnext_window, Fprevious_window): Doc fix.
10111
b0d15b4f
SM
101122011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10113
10114 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10115
fe7a3057
JB
101162011-11-20 Juanma Barranquero <lekktu@gmail.com>
10117
10118 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10119
d2999b1a
MR
101202011-11-20 Martin Rudalics <rudalics@gmx.at>
10121
10122 * window.c (Fset_window_combination_limit): Rename argument
10123 STATUS to LIMIT.
10124 (Vwindow_combination_limit): Remove "status" from doc-string.
10125
d5ff9cd0
AS
101262011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10127
10128 * m/ibms390.h: Remove.
10129 * m/ibms390x.h: Don't include "ibms390.h".
10130
a5bb9bd3
SM
101312011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10132
10133 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10134 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10135
cd1181db
JB
101362011-11-20 Juanma Barranquero <lekktu@gmail.com>
10137
10138 * casetab.c (Fset_case_table):
10139 * charset.c (Fcharset_after): Fix typos.
10140
615a3b8d 101412011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 10142
17e845af
PE
10143 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10144 Otherwise, valgrind does not work on some platforms.
10145 Problem reported by Andreas Schwab in
6a0bf43d
PE
10146 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10147 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10148 is set, removing the need for VIRT_ADDRESS_VARIES.
10149 (PURE_P): Use a more-efficient implementation that needs just one
10150 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10151 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10152 to 4 (xorl, subq, cmpq, setbe).
10153 * alloc.c (pure): Always extern now, since that's the
10154 VIRT_ADDR_VARIES behavior.
10155 (PURE_POINTER_P): Use a single comparison, not two, for
10156 consistency with the new puresize.h.
10157 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10158 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10159 Remove VIRT_ADDR_VARIES no longer needed.
10160
f8fe6f96
EZ
101612011-11-19 Eli Zaretskii <eliz@gnu.org>
10162
10163 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10164 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10165 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10166 behave as if the cursor position were at the window margin.
10167
10168 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10169 and the cursor position is out of bounds, behave as if the cursor
10170 position were at the window margin. (Bug#10075)
10171
df05a53c
CY
101722011-11-18 Chong Yidong <cyd@gnu.org>
10173
10174 * window.c (Fwindow_combination_limit): Make first argument
10175 non-optional, since it is meaningless for live windows like the
10176 selected window.
61ccba97 10177
2071918e
DA
101782011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10179
10180 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10181
b50a28de
SM
101822011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10183
10184 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10185 (graft_intervals_into_buffer): Simplify.
10186
015137db
EZ
101872011-11-18 Eli Zaretskii <eliz@gnu.org>
10188
10189 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10190 hash values of the two rows.
10191 (copy_row_except_pointers): Preserve the used[] arrays and the
10192 hash values of the two rows. (Bug#10035)
68c95424 10193 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
10194
10195 * xdisp.c (row_hash): New function, body extracted from
10196 compute_line_metrics.
10197 (compute_line_metrics): Call row_hash, instead of computing the
10198 hash code inline.
10199
10200 * dispnew.c (verify_row_hash): Call row_hash for computing the
10201 hash code of a row, instead of duplicating code from xdisp.c.
10202
10203 * dispextern.h (row_hash): Add prototype.
10204
a2addb04
TH
102052011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10206
10207 * frame.c (delete_frame): Don't delete the terminal when the last
10208 X frame is closed if emacs is built with GTK toolkit.
10209
df85d315
JB
102102011-11-17 Juanma Barranquero <lekktu@gmail.com>
10211
10212 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10213
a0c2d0ae
MR
102142011-11-17 Martin Rudalics <rudalics@gmx.at>
10215
10216 * window.c (Vwindow_splits): Rename to
10217 Vwindow_combination_resize. Suggested by Juri Linkov.
10218 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10219 of Vwindow_splits.
10220
58179cce
JB
102212011-11-16 Juanma Barranquero <lekktu@gmail.com>
10222
7877f373
JB
10223 * nsfns.m (Fns_font_name):
10224 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 10225
b6f67890
MR
102262011-11-16 Martin Rudalics <rudalics@gmx.at>
10227
10228 * window.h (window): Rename slot "nest" to "combination_limit".
10229 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10230 (Fset_window_nest): Rename to Fset_window_combination_limit.
10231 (Vwindow_nest): Rename to Vwindow_combination_limit.
10232 (recombine_windows, make_parent_window, make_window)
10233 (Fsplit_window_internal, saved_window)
10234 (Fset_window_configuration, save_window_save): Rename all
10235 occurrences of window_nest to window_combination_limit.
10236
c7015153
JB
102372011-11-15 Juanma Barranquero <lekktu@gmail.com>
10238
10239 * image.c (imagemagick_load_image): Fix typo.
10240
322ad6ec
EZ
102412011-11-14 Eli Zaretskii <eliz@gnu.org>
10242
10243 * xdisp.c (display_line): Move the call to
10244 highlight_trailing_whitespace before the call to
10245 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
10246 faces of all the glyphs to compute ROW's hash value.
10247 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 10248
f067b8ec
JB
102492011-11-14 Juanma Barranquero <lekktu@gmail.com>
10250
10251 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10252 just return (bug#10044).
10253
1e5b2111
EZ
102542011-11-12 Eli Zaretskii <eliz@gnu.org>
10255
7ef3cbd5
EZ
10256 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10257 with user-defined heap size. Bump the default size of the temacs
10258 heap to 27MB, to avoid memory warning when running temacs.
10259 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10260
1e5b2111
EZ
10261 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10262 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
10263 (verify_row_hash) [XASSERTS]: New function.
10264 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10265 that the hash value of glyph rows is correct.
1e5b2111 10266
89d61221
MR
102672011-11-12 Martin Rudalics <rudalics@gmx.at>
10268
10269 * window.h (window): Remove splits slot.
10270 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10271 (Fdelete_other_windows_internal, make_parent_window)
10272 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10273 (Fset_window_configuration, save_window_save): Don't deal with
10274 split status of windows.
10275 (saved_window): Remove splits slot.
10276 (Vwindow_splits): Rewrite doc-string.
10277
97f18cc8
JD
102782011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10279
10280 * xfns.c (unwind_create_frame):
10281 * nsfns.m (unwind_create_frame):
10282 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10283 Vframe_list (Bug#9999).
10284
22a648b4
DA
102852011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10286
0b381c7e 10287 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 10288
659afede
KH
102892011-11-11 Kenichi Handa <handa@m17n.org>
10290
10291 * callproc.c (Fcall_process): Set the member dst_multibyte of
10292 process_coding.
10293
9ac0394b
KH
102942011-11-11 Johan Bockgård <bojohan@gnu.org>
10295
10296 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10297 avoid a crash (bug#9496).
10298
2fbdc249
CY
102992011-11-09 Chong Yidong <cyd@gnu.org>
10300
10301 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10302 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10303
ac6b1f81
PE
103042011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10305
10306 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10307
09db192c
PE
103082011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10309
10310 Avoid some portability problems by eschewing 'extern inline' functions.
10311 The trivial performance wins aren't worth the portability hassles; see
10312 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10313 et seq.
10314 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10315 (window_box_width, window_box_left, window_box_left_offset)
10316 (window_box_right, window_box_right_offset): Undo previous change,
10317 by removing the "extern"s.
10318 * intervals.c (adjust_intervals_for_insertion)
10319 (adjust_intervals_for_deletion): Undo previous change,
10320 making these static again.
10321 (offset_intervals, temp_set_point_both, temp_set_point)
10322 (copy_intervals_to_string): No longer inline.
10323 * xdisp.c (window_text_bottom_y, window_box_width)
10324 (window_box_height, window_box_left_offset)
10325 (window_box_right_offset, window_box_left, window_box_right)
10326 (window_box): No longer inline.
10327
105216ed
CY
103282011-11-08 Chong Yidong <cyd@gnu.org>
10329
10330 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
10331 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10332 Signal an error if not a live window.
105216ed
CY
10333 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10334 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10335
ae9e237f
JB
103362011-11-07 Juanma Barranquero <lekktu@gmail.com>
10337
10338 * lisp.h (syms_of_abbrev): Remove declaration.
10339 Reported by CHENG Gao <chenggao@royau.me>.
10340
c7aa8333
EZ
103412011-11-07 Eli Zaretskii <eliz@gnu.org>
10342
10343 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10344 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10345 of temacs in GUI mode.
10346
be7f5545
MR
103472011-11-07 Martin Rudalics <rudalics@gmx.at>
10348
10349 * window.h: Declare delete_all_child_windows instead of
10350 delete_all_subwindows.
10351 * window.c (Fwindow_nest, Fset_window_nest)
10352 (Fset_window_new_total, Fset_window_new_normal)
10353 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10354 (delete_all_subwindows): Rename to delete_all_child_windows.
10355 (Fdelete_other_windows_internal, Fset_window_configuration):
10356 Call delete_all_child_windows instead of delete_all_subwindows.
10357 * frame.c (delete_frame): Call delete_all_child_windows instead
10358 of delete_all_subwindows.
10359
ca78dc43
PE
103602011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10361
10362 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10363 This is also needed for porting to any host where GC_MARK_STACK is
10364 not GC_MAKE_GCPROS_NOOPS.
10365 (which_symbols): Use it.
10366
a0241d01
KH
103672011-11-07 Kenichi Handa <handa@m17n.org>
10368
10369 * coding.c (coding_set_destination): Check coding->src_pos only
10370 when coding->src_object is a buffer (bug#9910).
10371
10372 * process.c (send_process): Set the member src_multibyte of coding
10373 to 0 (bug#9911) when sending a unibyte text.
10374
10375 * callproc.c (Fcall_process): Set the member src_multibyte of
10376 process_coding to 0 (bug#9912).
10377
a64bfdfa 103782011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
10379
10380 * xmenu.c (cleanup_widget_value_tree): New function.
10381 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10382 calling free_menubar_widget_value_tree directly (Bug#9830).
10383
cb41b32a
PE
103842011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10385
10386 Fix some portability problems with 'inline'.
10387 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10388 (window_box_width, window_box_left, window_box_left_offset)
10389 (window_box_right, window_box_right_offset): Declare extern.
10390 Otherwise, these inline functions do not conform to C99 and
10391 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10392 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10393 * intervals.c (adjust_intervals_for_insertion)
10394 (adjust_intervals_for_deletion): Now extern, because otherwise the
10395 extern inline functions 'offset_intervals' couldn't refer to it.
10396 (static_offset_intervals): Remove.
10397 (offset_intervals): Rewrite using the old contents of
10398 static_offset_intervals. The old version didn't conform to C99
10399 because an extern inline function contained a reference to an
10400 identifier with static linkage.
10401
b7041366
AS
104022011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10403
10404 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10405 GC.
10406
88a37c4d
EZ
104072011-11-06 Eli Zaretskii <eliz@gnu.org>
10408
10409 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10410 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10411 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10412 return Qleft_to_right.
10413
49745b39
CY
104142011-11-06 Chong Yidong <cyd@gnu.org>
10415
10416 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10417 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10418 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10419 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10420 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10421 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10422 (Fwindow_vscroll): Doc fix.
10423 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10424 argument, since it makes no sense to pass a live window and for
10425 consistency with window-child.
10426
1f05cd82
CS
104272011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10428
10429 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10430 support MSVC.
10431
22610910
JR
104322011-11-05 Jason Rumney <jasonr@gnu.org>
10433
10434 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10435 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10436 fonts (Bug#6029).
10437 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10438 bitwise arithmetic preventing use of unicode-sip and non-truetype
10439 opentype fonts.
10440
a06776b2
EZ
104412011-11-05 Eli Zaretskii <eliz@gnu.org>
10442
3ad924ba
EZ
10443 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10444 "emacs"-only part.
10445
a06776b2
EZ
10446 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10447 initialization code to keep similarity to xfns.c after changes
10448 from 2011-11-05.
10449
c9e7db78
JD
104502011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10451
a97f8f3f
JD
10452 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10453 (unwind_create_frame): New function (Bug#9943).
10454 (Fx_create_frame): Restructure code to be more similar to the one in
10455 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10456 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10457 Move terminal->reference_count++ just before making the frame official
10458 (Bug#9943).
10459
10460 * nsterm.m (x_free_frame_resources): New function.
10461 (x_destroy_window): Move code to x_free_frame_resources.
10462
c9e7db78 10463 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
10464 (Fx_create_frame, x_create_tip_frame):
10465 Move terminal->reference_count++ just before making the frame
75f1671a 10466 official. Move initialization of image_cache_refcount and
c9e7db78
JD
10467 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10468
a6fc3b5c
EZ
104692011-11-05 Eli Zaretskii <eliz@gnu.org>
10470
10471 Support MSVC build with newer versions of Visual Studio.
10472 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10473 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10474 nt/gmake.defs.
10475
10476 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10477 which are not supported by MSVC.
10478 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10479 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10480 bitfields.
10481 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10482 types in bitfields.
10483 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10484
10485 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10486
58179cce 104872011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
10488
10489 Support MSVC build with newer versions of Visual Studio.
10490 * w32.c: Don't include w32api.h for MSVC.
10491 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10492
10493 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10494 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10495 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10496 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10497 e_* cousins.
10498 (alloca) [_MSC_VER]: Define to _alloca.
10499
10500 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10501
10502 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10503
a58c13ed
EZ
105042011-11-04 Eli Zaretskii <eliz@gnu.org>
10505
10506 * xdisp.c (note_mouse_highlight): If either of
10507 previous/next-single-property-change returns nil, treat that as
10508 the beginning or the end of the buffer. (Bug#9955)
10509
fe0b6370
JD
105102011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10511
a58c13ed 10512 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
10513 label is not null (Bug#9951).
10514 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10515 may be NULL.
10516
89bd5ee1
EZ
105172011-11-04 Eli Zaretskii <eliz@gnu.org>
10518
10519 * window.c (Fwindow_body_size): Mention in the doc string that the
10520 return value is in frame's canonical units. (Bug#9949)
10521
84c3edb9
EZ
105222011-11-03 Eli Zaretskii <eliz@gnu.org>
10523
4e2fb5c7
EZ
10524 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10525
84c3edb9 10526 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 10527 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 10528 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 10529
bc17a887
EZ
105302011-11-01 Eli Zaretskii <eliz@gnu.org>
10531
10532 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10533 Don't stop backward scan on the continuation glyph, even though
10534 its CHARPOS is positive.
6d5eb5b0
SM
10535 (mouse_face_from_buffer_pos, note_mouse_highlight):
10536 Rename cover_string to disp_string.
bc17a887 10537
4ee88440
MR
105382011-11-01 Martin Rudalics <rudalics@gmx.at>
10539
10540 * window.c (temp_output_buffer_show): Don't use
10541 Vtemp_buffer_show_specifiers.
10542 (Vtemp_buffer_show_specifiers): Remove unused variable.
10543
c2ff3c02
EZ
105442011-10-30 Eli Zaretskii <eliz@gnu.org>
10545
10546 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10547 past the beginning of the current glyph matrix.
10548
58179cce 105492011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
10550
10551 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10552 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10553 HAVE_GTK3 (Bug#9869).
b77a6a7f 10554
3b574623
JD
10555 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10556 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10557
b77a6a7f
JD
10558 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10559
10560 * xterm.c: Declare x_handle_net_wm_state to return int.
10561 (handle_one_xevent): Check if we are iconified but don't have
10562 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10563 (get_current_wm_state): Return non-zero if not hidden,
10564 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10565 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10566 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10567 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10568
196e41e4
PE
105692011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10570
10571 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10572 so that this new function doesn't get optimized away by a
10573 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10574
021f2e1a
AS
105752011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10576
10577 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10578
8b058d44
EZ
105792011-10-29 Eli Zaretskii <eliz@gnu.org>
10580
10581 Fix the `xbytecode' command.
10582 * .gdbinit (xprintbytestr): New command.
b50a28de 10583 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
10584 (xbytecode): Print the byte-code string as well.
10585
4452fb80
EZ
105862011-10-29 Kim Storm <storm@cua.dk>
10587
8b058d44
EZ
10588 * alloc.c (which_symbols): New function.
10589
21b72067
AS
105902011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10591
10592 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10593 line. (Bug#9903)
10594
83ed7b5c
GM
105952011-10-29 Glenn Morris <rgm@gnu.org>
10596
10597 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10598 Not clear what it was for, and it causes various bugs. (Bug#9839)
10599
5a7a728b
EZ
106002011-10-28 Eli Zaretskii <eliz@gnu.org>
10601
10602 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10603 possible random value that matches one of those tested as
10604 condition to clear the mouse face.
10605
d3d0842f
CY
106062011-10-28 Chong Yidong <cyd@gnu.org>
10607
10608 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10609
31b39d13
DN
106102011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10611
10612 * window.c (make_window): Initialize phys_cursor_on_p.
10613
9aba6043
SM
106142011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10615
10616 * lisp.h (struct Lisp_Symbol): Update comments.
10617
c20992f4
JB
106182011-10-28 Juanma Barranquero <lekktu@gmail.com>
10619
10620 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10621
db4f02f2
EZ
106222011-10-28 Eli Zaretskii <eliz@gnu.org>
10623
10624 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10625 <oslsachem@gmail.com> for helping to debug this.
10626
10627 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10628 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10629 (g_b_init_get_glyph_outline_w): New static variables.
10630 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10631 (GetGlyphOutlineW_Proc): New typedefs.
10632 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
10633 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10634 New functions.
10635 (w32font_open_internal, compute_metrics):
10636 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
10637 instead of calling the "wide" APIs directly.
10638
10639 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10640
10641 * w32.h (syms_of_w32font): Add prototype.
10642
87e68db4
JB
106432011-10-27 Juanma Barranquero <lekktu@gmail.com>
10644
10645 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10646 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10647 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10648 (Fmove_to_window_line): Doc fix.
10649
435c1d67
CY
106502011-10-27 Chong Yidong <cyd@gnu.org>
10651
10652 * process.c (make_process): Set gnutls_state to NULL.
10653
10654 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10655 non-NULL, regardless of GNUTLS_INITSTAGE.
10656 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10657 an error. Set process slots as soon as we allocate them.
10658
10659 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10660
9c6c6f49
CY
106612011-10-27 Chong Yidong <cyd@gnu.org>
10662
9aba6043
SM
10663 * gnutls.c (emacs_gnutls_deinit): New function.
10664 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10665 (Fgnutls_deinit, Fgnutls_boot): Use it.
10666
10667 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10668 (deactivate_process): Call emacs_gnutls_deinit.
10669
657d08d3
JB
106702011-10-27 Juanma Barranquero <lekktu@gmail.com>
10671
10672 * image.c (x_create_x_image_and_pixmap):
10673 * w32.c (sys_rename, w32_delayed_load):
10674 * w32font.c (fill_in_logfont):
10675 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10676
5430d399
JB
106772011-10-26 Juanma Barranquero <lekktu@gmail.com>
10678
10679 * w32fns.c (w32_default_color_map): New function,
10680 extracted from Fw32_default_color_map.
a7ef684b 10681 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10682
fe0055fa
PE
106832011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10684
10685 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10686
e6346438
SM
106872011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10688
10689 * keyboard.c (test_undefined): New function (bug#9751).
10690 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10691
e112cc37
ET
106922011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10693
10694 * sysdep.c (init_sys_modes): Fix the check for the controlling
10695 terminal (Bug#6649).
10696
7b5d6677
EZ
106972011-10-20 Eli Zaretskii <eliz@gnu.org>
10698
10699 * dispextern.h (struct bidi_it): New member next_en_type.
10700
10701 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10702 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10703 current character, check also for next_en_type being WEAK_EN.
10704 (bidi_resolve_weak): Don't enter the expensive loop if the current
10705 position is before next_en_pos. Record the bidi type of the first
10706 non-ET, non-BN character we find, in addition to its position.
10707 (bidi_level_of_next_char): Invalidate next_en_type when
10708 next_en_pos is over-stepped.
10709
7da0b018
PE
107102011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10711
10712 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10713 * editfns.c: Rewrite current-time-zone so that it invokes
10714 the equivalent of (format-time-string "%Z") to get the time zone name.
10715 This fixes a bug when the time zone name contains characters that
10716 need converting from the system time locale to Emacs internal format.
10717 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10718 that patch fixed format-time-string to do the conversion, but
10719 I forgot to fix current-time-zone.
10720 (format_time_string): New function, containing most of
10721 what Fformat_time_string used to contain.
10722 (Fformat_time_string): Rewrite in terms of format_time_string.
10723 This doesn't change this function's behavior.
10724 (current-time-zone): Rewrite to use format_time_string.
10725 This fixes the bug reported by Michael Schierl in
10726 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10727 Jason Rumney's 2007-06-07 change worked around this bug, but
10728 didn't fix it.
10729 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10730
8547b010
EZ
107312011-10-19 Eli Zaretskii <eliz@gnu.org>
10732
10733 * xdisp.c (start_display): If the character at POS is displayed
10734 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10735 (try_window_reusing_current_matrix): If a line ends in a display
10736 vector or the next line starts in a display vector, continue
10737 redrawing the window even though the character position of
10738 start_row was reached.
8547b010
EZ
10739 (Bug#9771, part 2)
10740
4e948d15
CY
107412011-10-18 Chong Yidong <cyd@gnu.org>
10742
10743 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10744 with nobreak-char-display too.
10745
4787455f
EZ
107462011-10-18 Eli Zaretskii <eliz@gnu.org>
10747
10748 Fix part 3 of bug#9771.
10749 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10750 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10751 non-neutral characters if the current character is a paragraph
10752 separator (a.k.a. Newline). This avoids running the same
10753 expensive loop twice, once when we consume the preceding newline
10754 and the other time when the line actually needs to be displayed.
10755 Avoid the loop when we see neutrals on the base embedding level
10756 following a character whose directionality is the same as the
10757 paragraph's. This avoids running the expensive loop when a line
10758 ends in a long sequence of neutrals, like control characters.
10759 Add assertion against STRONG_AL type. Slightly rearrange code
10760 that determines the type of a neutral given the first non-neutral
10761 that follows it.
10762 (bidi_level_of_next_char): Set next_en_pos to zero when
10763 invalidating its info.
10764
2c91f553
EZ
107652011-10-17 Eli Zaretskii <eliz@gnu.org>
10766
10767 * xdisp.c (push_display_prop): Determine whether to record string
10768 or buffer position by IT->string, not by IT->method. Allow
10769 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10770 (move_it_vertically_backward): Don't look for character position
10771 immediately after the newline when in a continuation line.
10772 (Bug#9771, part 1)
2c91f553 10773
c7b08b0d
MR
107742011-10-15 Martin Rudalics <rudalics@gmx.at>
10775
10776 * window.c (coordinates_in_window): Rewrite and delabelize
10777 vertical border check. (Bug#5357) (Bug#9618)
10778
6b02f655
SM
107792011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10780
10781 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10782 errors in XSetWindowBorder (bug#9310).
10783
81d40c92
DA
107842011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10785
10786 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10787 avoid crash when xmalloc overrun checking is enabled.
10788
d4172c3b
EZ
107892011-10-13 Eli Zaretskii <eliz@gnu.org>
10790
10791 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10792 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10793 cursor motion with <left> and <right> arrow keys.
10794
10795 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10796 some callers set that themselves.
10797
b00eea75
EZ
107982011-10-12 Eli Zaretskii <eliz@gnu.org>
10799
10800 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10801 display string and the previous row comes from the same string and
10802 is empty. (Bug#9739) (Bug#9738)
10803
8fe012c4
SM
108042011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10805
10806 * doc.c (get_doc_string): Encode file name (bug#9735).
10807
0074aef2
EZ
108082011-10-12 Eli Zaretskii <eliz@gnu.org>
10809
79beb178
EZ
10810 * bidi.c (bidi_level_of_next_char):
10811 * xdisp.c (get_visually_first_element): Remove old incorrect
10812 comments regarding the Unicode Line Separator character.
10813
0074aef2
EZ
10814 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10815
6e4b3fbe
DA
108162011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10817
10818 * alloc.c (Fgc_status): Do not access beyond zombies array
10819 boundary if nzombies > MAX_ZOMBIES.
10820 * alloc.c (dump_zombies): Add missing format specifier.
10821
0324f3af
PE
108222011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10823
b5525cac
PE
10824 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10825 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10826
0324f3af
PE
10827 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10828 Some packages use them to denote characters with modifiers.
10829
e9b5f888
AS
108302011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10831
10832 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10833 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10834 matching a pp-number. Rename parameter var to var1.
10835
127827c0
SM
108362011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10837
10838 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10839
c8fd3bd0
GM
108402011-10-08 Glenn Morris <rgm@gnu.org>
10841
10842 * callint.c (Fcall_interactively): Give a more explicit error for the
10843 'c' case with a non-character input. (Bug#8479)
10844
352ec8ff
EZ
108452011-10-08 Eli Zaretskii <eliz@gnu.org>
10846
03669ccb
EZ
10847 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10848 lines.
7061c986
EZ
10849 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10850 lines that are hscrolled on the left.
03669ccb 10851
352ec8ff
EZ
10852 * dispnew.c (buffer_posn_from_coords): Account for a possible
10853 presence of header-line. (Bug#4426)
10854
a66cfb1c
SM
108552011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10856
6b02f655
SM
10857 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10858 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10859
7c5ee88e
PE
108602011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10861
10862 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10863 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10864 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10865 this makes Emacs dump core during garbage collection on rare
10866 occasions. sizeof is obviously inferior to offsetof here, so
10867 stick with offsetof.
10868 (GC_POINTER_ALIGNMENT): New macro.
10869 (mark_memory): Omit 3rd (offset) arg; caller changed.
10870 Don't assume EMACS_INT alignment is the same as pointer alignment.
10871
df1bbe5b
SM
108722011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10873
10874 * keyboard.c (read_key_sequence_remapped): New var.
10875 (read_key_sequence): Compute remapping in the right buffer.
10876 (command_loop_1): Use read_key_sequence's remapping directly.
10877
51553db6
SM
108782011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10879
32c1fffd
SM
10880 * dired.c (file_name_completion): Don't expand file name.
10881 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10882 before checking file name handler.
10883
51553db6
SM
10884 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10885 they've been requested explicitly (bug#9591).
10886
b6bd1599 108872011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10888
10889 * keymap.c (Fsingle_key_description): Use make_specified_string
10890 instead of build_string to build string from push_key_description.
10891 (Bug#5193)
10892
f701dc2a
PE
108932011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10894
4222c55d
PE
10895 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10896 This fixes a Y2038 bug on 64-bit hosts.
10897 * buffer.c (reset_buffer):
10898 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10899 (Fclear_buffer_auto_save_failure):
10900 Use 0, not -1, to represent an unset failure time, since time_t
10901 might not be signed.
10902
f701dc2a
PE
10903 Remove dependency on glibc malloc internals.
10904 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10905 Move back here from lisp.h, but with their new implementations.
10906 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10907 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10908 * charset.c (charset_table_init): New static var.
10909 (syms_of_charset): Use it instead of xmalloc. This removes a
10910 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10911 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10912 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10913 Move back to alloc.c.
10914 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10915 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10916
9ceebf39
JD
109172011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10918
10919 * nsterm.m (windowDidResize): Call x_set_window_size only when
10920 ns_in_resize is true. Otherwise set pixelwidth/height and
10921 call change_frame_size (Bug#9628).
10922
cb993c58
PE
109232011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10924
3930c88b
PE
10925 Port --enable-checking=all to Fedora 14 x86-64.
10926 * charset.c (syms_of_charset): Also account for glibc malloc's
10927 internal overhead when calculating the initial malloc maximum.
10928
cb993c58
PE
10929 Port --enable-checking=all to Fedora 14 x86.
10930 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10931 Move to lisp.h.
10932 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10933 (overrun_check_realloc, overrun_check_free):
10934 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10935 That way, xmalloc returns a properly-aligned pointer even if
10936 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10937 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10938 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10939 into account when calculating the initial malloc maximum.
10940 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10941 Move here from alloc.c, so that charset.c can use it too.
10942 Properly align; the old code wasn't right for common 32-bit hosts
10943 when configured with --enable-checking=all.
10944 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10945 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10946
31bed486
EZ
109472011-09-29 Eli Zaretskii <eliz@gnu.org>
10948
04c70788 10949 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
10950 use EDOM.
10951
fbcaa2f3
EZ
109522011-09-28 Eli Zaretskii <eliz@gnu.org>
10953
10954 * xdisp.c (compute_display_string_end): If there's no display
10955 string at CHARPOS, return -1.
10956
10957 * bidi.c (bidi_fetch_char): When compute_display_string_end
10958 returns a negative value, treat the character as a normal
10959 character not covered by a display string. (Bug#9624)
10960
a239d4e9
JB
109612011-09-28 Juanma Barranquero <lekktu@gmail.com>
10962
10963 * lread.c (Fread_from_string): Fix typo in docstring.
10964
88652fd5
EZ
109652011-09-27 Eli Zaretskii <eliz@gnu.org>
10966
10967 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10968 newline, reseat the iterator instead of bidi-iterating there one
10969 character at a time. (Bug#9610)
32c1fffd
SM
10970 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10971 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 10972
ed497dd4
AS
109732011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10974
10975 * lread.c (readevalloop): Use correct code for NBSP.
10976 (read1): Likewise. (Bug#9608)
10977
b2bf61aa
MA
109782011-09-25 Michael Albinus <michael.albinus@gmx.de>
10979
10980 * dbusbind.c (Fdbus_register_signal): When service is not
10981 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10982
32bbb17c
GM
109832011-09-25 Glenn Morris <rgm@gnu.org>
10984
10985 * buffer.c (truncate-lines): Doc fix.
10986
94e0933e
CY
109872011-09-24 Chong Yidong <cyd@stupidchicken.com>
10988
10989 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10990 (Fset_window_next_buffers): Doc fix.
10991
cddde921
GM
109922011-09-24 Glenn Morris <rgm@gnu.org>
10993
10994 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10995
1260aef1
PE
109962011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10997
25b4bfa0
PE
10998 Fix minor problems found by static checking.
10999 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
11000 * indent.c (Fvertical_motion): Fix == vs = typo.
11001
e3cbd34b
EZ
110022011-09-24 Eli Zaretskii <eliz@gnu.org>
11003
a66cfb1c
SM
11004 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11005 Default value is now t. Doc fix.
6bf7006f 11006
e3cbd34b 11007 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 11008 logic when moving up, not only when moving down. Fix the
e3cbd34b 11009 confusing name and values of the it_overshoot_expected variable;
32c1fffd 11010 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
11011
11012 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11013 CHARPOS is covered by a display string which includes newlines.
11014 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11015 is covered by a display string with embedded newlines.
11016
a3de0cbd
MA
110172011-09-24 Michael Albinus <michael.albinus@gmx.de>
11018
11019 * dbusbind.c (Fdbus_register_signal): Add match rule to
11020 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
11021 (Fdbus_register_method, Vdbus_registered_objects_table):
11022 Fix docstring.
a3de0cbd 11023
b260039d
JM
110242011-09-24 Jim Meyering <meyering@redhat.com>
11025
32c1fffd 11026 do not ignore write error for any output size
b260039d
JM
11027 The previous change was incomplete.
11028 While it makes emacs --batch detect the vast majority of stdout
11029 write failures, errors were still ignored whenever the output size is
11030 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11031 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11032 && echo FAIL: ignored write error
11033 FAIL: ignored write error
11034 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11035 && echo FAIL: ignored write error
11036 FAIL: ignored write error
11037 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11038
8eca8a7c
AS
110392011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11040
11041 * emacs.c (Fkill_emacs): In noninteractive mode exit
11042 non-successfully if a write error occurred on stdout. (Bug#9574)
11043
3341db62
EZ
110442011-09-21 Eli Zaretskii <eliz@gnu.org>
11045
11046 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11047 the xassert test.
11048
11049 * dispextern.h (struct it): Update the comment documenting what
11050 can it->OBJECT be.
11051
8c203dbf
EZ
110522011-09-20 Eli Zaretskii <eliz@gnu.org>
11053
11054 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11055 a display string, extend search for cursor position to end of row.
11056 (find_row_edges): If the row ends in a newline from a display
11057 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11058 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
11059 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11060 non-empty line. Fixes confusing cursor motion with arrow keys at
11061 the beginning of a line that starts with whitespace.
8c203dbf 11062
a4824228
LMI
110632011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11064
11065 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11066 (bug#9493).
11067
33ed493b
CY
110682011-09-18 Chong Yidong <cyd@stupidchicken.com>
11069
11070 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11071 boolean (Bug#9154).
11072
56cd55c8
EZ
110732011-09-18 Eli Zaretskii <eliz@gnu.org>
11074
11075 * xdisp.c (display_line): Record maximum and minimum buffer
11076 positions even if no glyphs were produced (e.g., by a zero-width
11077 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11078 buffer positions that will be removed from the glyph row because
11079 they don't fit.
c02dcedf
EZ
11080 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11081 column is beyond frame width: don't subtract 1 "pixel" when
11082 computing width of the stretch.
3e62b7e0
EZ
11083 (reseat_at_next_visible_line_start): Undo the change made on
11084 2011-09-17 that saved paragraph information and restored it after
11085 the call to `reseat'. (Bug#9545)
56cd55c8 11086
5ed99d36 110872011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
11088
11089 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11090 and turn window cursor on if cleared (Bug#9415).
11091
5ed99d36 110922011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
11093
11094 * search.c (boyer_moore): Take unibyte characters from pattern
11095 literally. (Bug#9458)
11096
9bade7b2
EZ
110972011-09-18 Eli Zaretskii <eliz@gnu.org>
11098
11099 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11100
e5e9d610
PE
111012011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11102
87e4427a
PE
11103 Fix minor problem found by static checking.
11104 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11105 initialized, to pacify gcc -Wuninitialized.
11106
e5e9d610
PE
11107 * fileio.c: Report proper errno when syscall falls.
11108 (Finsert_file_contents): Save and restore errno,
11109 so that report_file_error outputs the correct diagnostic.
11110 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11111
a1674f0b
EZ
111122011-09-18 Eli Zaretskii <eliz@gnu.org>
11113
11114 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11115
fbfb6dd4
EZ
111162011-09-17 Eli Zaretskii <eliz@gnu.org>
11117
11118 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11119 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11120
bb187662
EZ
111212011-09-17 Eli Zaretskii <eliz@gnu.org>
11122
1137e8b8 11123 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 11124 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
11125
11126 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11127 (bidi_find_paragraph_start): Search back for paragraph beginning
11128 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11129 (bidi_move_to_visually_next): Only trigger paragraph-related
11130 computations when the last character is a newline or at EOB, not
11131 just any NEUTRAL_B. (Bug#9470)
11132
bb187662
EZ
11133 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11134 truncated lines if point is covered by a display string. (Bug#9524)
11135
2e621251
PE
111362011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11137
11138 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11139 (cons_to_x_long): New function.
11140 (lisp_data_to_selection_data): Use it. Correct the test for
11141 short-versus-long data; it was negated. Break out of vector
11142 loop, for efficiency, when a long datum is discovered.
11143
91a15bc6
SM
111442011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11145
11146 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11147
b41c3a35
EZ
111482011-09-16 Eli Zaretskii <eliz@gnu.org>
11149
11150 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11151 GCC PR/17406) by declaring this function with external scope.
11152
7812ba2d
PE
111532011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11154
11155 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11156 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11157
cf7edc2a
AS
111582011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11159
11160 * editfns.c (Fformat): Correctly handle text properties on "%%".
11161
bd01620e
EZ
111622011-09-15 Eli Zaretskii <eliz@gnu.org>
11163
11164 * xterm.c (x_draw_composite_glyph_string_foreground):
11165 * w32term.c (x_draw_composite_glyph_string_foreground):
11166 * term.c (encode_terminal_code):
11167 * composite.c (composition_update_it, get_composition_id):
11168 * xdisp.c (get_next_display_element)
11169 (fill_composite_glyph_string): Add comments about special meaning
11170 of TAB characters in a composition.
11171
a02719a3
PE
111722011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11173
11174 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
11175 This occurs when processing a multibyte format.
11176 Problem reported by Wolfgang Jenker.
a02719a3 11177
72589a3c
JB
111782011-09-15 Johan Bockgård <bojohan@gnu.org>
11179
11180 * xdisp.c (try_cursor_movement): Only check for exact match if
11181 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11182
1c14176c
PE
111832011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11184
11185 Remove unused external symbols.
11186 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11187 * xdisp.c (calc_pixel_width_or_height): Now static.
11188 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11189 * indent.c (check_display_width):
11190 * w32term.c: Fix comment to match code.
11191 * xterm.c, xterm.h (x_catching_errors): Remove.
11192
d2eea5b5
PE
111932011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11194
11195 * xselect.c: Use signed conversions more consistently (Bug#9498).
11196 (selection_data_to_lisp_data): Assume incoming selection data are
11197 signed integers, not unsigned. This is to be consistent with
11198 outgoing selection data, which was modified to use signed integers
11199 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11200 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11201 expects long, not unsigned long.
11202
46888499
EZ
112032011-09-14 Eli Zaretskii <eliz@gnu.org>
11204
11205 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11206 computation of loop end. Reported by Johan Bockgård
11207 <bojohan@gnu.org>.
11208
ef8ef9fb
CY
112092011-09-13 Chong Yidong <cyd@stupidchicken.com>
11210
11211 * frame.c (Fother_visible_frames_p): Function deleted.
11212
fa819fed
EZ
112132011-09-12 Eli Zaretskii <eliz@gnu.org>
11214
11215 * indent.c (compute_motion): Process display vector front to back
11216 rather than the other way around. (Bug#2496)
11217
2ba8e008
SM
112182011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11219
11220 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11221
20f53c69
CY
112222011-09-11 Chong Yidong <cyd@stupidchicken.com>
11223
11224 * minibuf.c (Fread_from_minibuffer): Doc fix.
11225
d562d7a4
EZ
112262011-09-11 Eli Zaretskii <eliz@gnu.org>
11227
11228 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11229 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11230
1c4d7f3d
LMI
112312011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11232
11233 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11234 value for non-existent files.
11235
b885bf36
EZ
112362011-09-11 Eli Zaretskii <eliz@gnu.org>
11237
11238 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11239 set its "size" to -1. This will set the modtime_size field of
11240 the corresponding buffer to -1, which is what
11241 verify-visited-file-modtime expects for files that do not exist.
11242 (Bug#9139)
11243
6612f0bf
PE
112442011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11245
11246 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11247 here ...
11248 * lisp.h: ... from here. push_key_description is no longer
11249 defined in keyboard.c, so its declaration should not be in
11250 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11251 logically belongs with push_key_description.
11252
dfb3f755
PE
112532011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11254
11255 * buffer.h: Include <sys/types.h> instead of <time.h>.
11256 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11257 Problem reported by Herbert J. Skuhra.
11258
3134906c
LMI
112592011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11260
11261 * xml.c (parse_region): Make the parsing work for
11262 non-comment-starting XML files again (bug#9144).
11263
8d903f4e
AS
112642011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11265
11266 * image.c (gif_load): Fix calculation of bottom and right corner.
11267 (Bug#9468)
11268
80ad64f4
EZ
112692011-09-10 Eli Zaretskii <eliz@gnu.org>
11270
11271 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11272 redisplay in small windows.
11273
208a048d
EZ
112742011-09-09 Eli Zaretskii <eliz@gnu.org>
11275
11276 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11277
9b1c252e
MR
112782011-09-08 Martin Rudalics <rudalics@gmx.at>
11279
11280 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11281 Operate on live windows only.
11282
2949f33b
JB
112832011-09-08 Juanma Barranquero <lekktu@gmail.com>
11284
11285 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11286
e08dcafd
EZ
112872011-09-07 Eli Zaretskii <eliz@gnu.org>
11288
11289 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11290 only under bidi iteration.
11291
115b96bd
JD
112922011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11293
11294 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11295
c8199d0f
PE
112962011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11297
11298 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11299 Without this fix, the command to link temacs failed due to an
11300 undefined symbol __builtin_isnan. This is because
11301 /usr/include/iso/math_c99.h #defines isnan(x) to
11302 __builtin_isnan(x), but the bundled gcc, which identifies itself
11303 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11304 a __builtin_isnan.
11305 * floatfns.c (isnan): #undef, and then #define to a clone of
11306 what's in data.c.
11307 (Fisnan): Always define, since it's always available now.
11308 (syms_of_floatfns): Always define isnan at the Lisp level.
11309
e39b275c 113102011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
11311
11312 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11313
b2db44d9 113142011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 11315
f4af5137 11316 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
11317 The previous code assumed that file offsets (off_t values) fit in
11318 EMACS_INT variables, which is not true on typical 32-bit hosts.
11319 The code messed up by falsely reporting buffer overflow in cases
11320 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11321 when "big" contains more than 2**29 bytes, even though this
11322 inserts just one byte and does not overflow the buffer.
11323 (Finsert_file_contents): Store file offsets as off_t
11324 values, not as EMACS_INT values. Check for overflow when
11325 converting between EMACS_INT and off_t. When checking for
11326 buffer overflow or for overlap, take the offsets into account.
11327 Don't use EMACS_INT for small values where int suffices.
11328 When checking for overlap, fix a typo: ZV was used where
11329 ZV_BYTE was intended.
11330 (Fwrite_region): Don't assume off_t fits into 'long'.
11331 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11332
ecfc0a49
MA
113332011-09-05 Michael Albinus <michael.albinus@gmx.de>
11334
11335 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11336
6511acf2 113372011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 11338
0999621a 11339 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
11340
11341 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 11342 (esprintf, exprintf, evxprintf): New functions.
62f19c19 11343 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 11344 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
11345 (modify_event_symbol): Do not assume that the length of
11346 name_alist_or_stem is safe to alloca and fits in int.
11347 (Fexecute_extended_command): Likewise for function name and binding.
11348 (Frecursion_depth): Wrap around reliably on integer overflow.
11349 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11350 since some callers pass EMACS_INT values.
11351 (Fsingle_key_description): Don't crash if symbol name contains more
11352 than MAX_ALLOCA bytes.
11353 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11354 (get_minibuffer): Arg is now EMACS_INT, not int.
11355 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 11356 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
11357 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11358
2be7d702
PE
11359 * dbusbind.c (signature_cat): New function.
11360 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
11361 Do not overrun buffer; instead, report string overflow.
11362
9d1df220
PE
11363 * dispnew.c (add_window_display_history): Don't overrun buffer.
11364 Truncate instead; this is OK since it's just a log.
11365
33ef5c64
PE
11366 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11367 even if the time zone offset is outlandishly large.
11368 Don't mishandle offset == INT_MIN.
11369
66c6fdd5
PE
11370 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11371 when creating daemon; the previous buffer-overflow check was incorrect.
11372
d749b01b
PE
11373 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11374 which has the guts of the old verror function.
11375
b5cd1905
PE
11376 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11377 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11378
6e1a67fb
PE
11379 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11380 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 11381 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 11382 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
11383 length of string rather than counting it via multiple sprintfs;
11384 that's simpler and more reliable.
c21721cc
PE
11385 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11386 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11387 sprintf, in case result does not fit in int.
11388
c57b67fc
PE
11389 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11390 (fontset_from_font): Print it.
11391
8a401434
PE
11392 * frame.c (tty_frame_count): Now printmax_t, not int.
11393 (make_terminal_frame, set_term_frame_name): Print it.
11394 (x_report_frame_params): In X, window IDs are unsigned long,
11395 not signed long, so print them as unsigned.
11396 (validate_x_resource_name): Check for implausibly long names,
11397 and don't assume name length fits in 'int'.
11398 (x_get_resource_string): Don't blindly alloca invocation name;
11399 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11400 not fit in int.
11401
6e1a67fb
PE
11402 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11403 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
11404 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11405
0df02bf3
PE
11406 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11407 Use esprintf, not sprintf, in case result does not fit in int.
11408
48e30793
PE
11409 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11410 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11411 it as a large positive number.
11412 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11413 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11414
a66ff6d8
PE
11415 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11416 in case result does not fit in int.
11417
aca216ff
PE
11418 * print.c (float_to_string): Detect width overflow more reliably.
11419 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11420 buffer overrun. Don't assume list length fits in 'int'. Treat
11421 print length of 0 as 0, not as infinity; to be consistent with other
11422 uses of print length in this function. Don't overflow print length
11423 index. Don't assume hash table size fits in 'long', or that
11424 vectorlike size fits in 'unsigned long'.
11425
31c286f7
PE
11426 * process.c (make_process): Use printmax_t, not int, to format
11427 process-name gensyms.
11428
55e5faa1
PE
11429 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11430
80f2e268
PE
11431 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11432 to avoid potential buffer overrun.
11433
670741ab
PE
11434 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11435 if X resource line is longer than 512 bytes.
11436
b7163a50
PE
11437 * xfns.c (x_window): Make sprintf buffer a bit bigger
11438 to avoid potential buffer overrun.
11439
ae58ff1f
PE
11440 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11441
c43c8a6a
PE
11442 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11443
3f8236f4
PE
114442011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11445
53e9fe90 11446 Integer overflow fixes for scrolling, etc.
6511acf2
PE
11447 Without these, Emacs silently mishandles large integers sometimes.
11448 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
11449 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11450
6511acf2
PE
11451 * xdisp.c (try_window_id): Check Emacs fixnum range before
11452 converting to 'int'.
806add1d 11453
6511acf2 11454 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
11455 Check that an Emacs fixnum is in range before assigning it to 'int'.
11456 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11457 values converted from Emacs fixnums.
11458 (Frecenter): Don't wrap around a line count if it is out of 'int'
11459 range; instead, treat it as an extreme value.
11460 (Fset_window_configuration, compare_window_configurations):
11461 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11462
6511acf2
PE
11463 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11464 that can exceed INT_MAX. Check that EMACS_INT value is in range
11465 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
11466 (match_limit): Don't assume that a fixnum can fit in 'int'.
11467
6511acf2 11468 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
11469 exceed INT_MAX.
11470
6511acf2 11471 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
11472 (Fvertical_motion): Don't wrap around LINES values that don't fit
11473 in 'int'. Instead, treat them as extreme values. This is good
11474 enough for windows, which can't have more than INT_MAX lines anyway.
11475
fcb901a7
LMI
114762011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11477
0f2f6b6d
LMI
11478 * Require libxml/parser.h to avoid compilation warning.
11479
fcb901a7
LMI
11480 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11481
11482 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11483 since this reportedly can destroy thread storage.
11484
6e20a0d4
CY
114852011-08-30 Chong Yidong <cyd@stupidchicken.com>
11486
11487 * syntax.c (find_defun_start): Update all cache variables if
11488 exiting early (Bug#9401).
11489
148ae00e
EZ
114902011-08-30 Eli Zaretskii <eliz@gnu.org>
11491
f6cfbd8f
EZ
11492 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11493
148ae00e
EZ
11494 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11495 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11496 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11497
11498 * term.c (tty_append_glyph): New function.
11499 (produce_stretch_glyph): Static function and its prototype deleted.
11500
a66cfb1c
SM
11501 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11502 Add prototypes.
148ae00e 11503
c4a07a4c
PE
115042011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11505
11506 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11507 when checking :margin (Bug#9390).
11508 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 11509 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
11510 so that the name doesn't mislead. All uses changed.
11511
6bc8cd65
JB
115122011-08-28 Johan Bockgård <bojohan@gnu.org>
11513
11514 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11515 set_tty_hooks.
11516
dca4927e
EZ
115172011-08-27 Eli Zaretskii <eliz@gnu.org>
11518
11519 * xdisp.c (move_it_to): Don't bail out early when reaching
11520 position beyond to_charpos, if we are scanning backwards.
11521 (move_it_vertically_backward): When DY == 0, make sure we get to
11522 the first character in the line after the newline.
11523
f2cad773
PE
115242011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11525
11526 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11527 (ccl_driver): Do not generate an out-of-range pointer.
11528 (Fccl_execute_on_string): Remove unnecessary check for
11529 integer overflow, noted by Stefan Monnier in
11530 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11531 Remove a FIXME that didn't need fixing.
11532 Simplify the newly-introduced buffer reallocation code.
11533
0cae2cdb
JB
115342011-08-27 Juanma Barranquero <lekktu@gmail.com>
11535
11536 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11537
5fc295a4 115382011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 11539
70c60eb2 11540 Integer and memory overflow issues (Bug#9196).
726e0ab1 11541
d31850da
PE
11542 * doc.c (get_doc_string): Rework so that
11543 get_doc_string_buffer_size is the actual buffer size, rather than
11544 being 1 less than the actual buffer size; this makes xpalloc more
11545 convenient.
11546
a69fbedb
PE
11547 * image.c (x_allocate_bitmap_record, cache_image):
11548 * xselect.c (Fx_register_dnd_atom):
11549 Simplify previous changes by using xpalloc.
11550
fe5c5d37
PE
11551 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11552 since either will do and ptrdiff_t is convenient with xpalloc.
11553
0065d054
PE
11554 * charset.c (charset_table_size)
11555 (struct charset_sort_data.priority): Now ptrdiff_t.
11556 (charset_compare): Don't overflow if priorities differ greatly.
11557 (Fsort_charsets): Don't assume list length fits in int.
11558 Check for size-calculation overflow when allocating sort data.
11559 (syms_of_charset): Allocate an initial charset table that is
11560 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11561
11562 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11563
11564 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11565 The actual value is always <= INT_MAX, and leaving it unsigned made
11566 overflow checking harder.
11567
11568 * dispextern.h (struct glyph_matrix.rows_allocated)
11569 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11570 with xpalloc. The values are still always <= INT_MAX.
11571
11572 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11573
11574 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11575 (SAFE_NALLOCA): New macro.
11576
11577 * region-cache.c (struct boundary.pos, find_cache_boundary)
11578 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11579 (set_cache_region, invalidate_region_cache)
11580 (revalidate_region_cache, know_region_cache, region_cache_forward)
11581 (region_cache_backward, pp_cache):
11582 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11583 so that ptrdiff_t * can be passed to xpalloc.
11584 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11585 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11586 (pp_cache): Don't assume cache_len fits in int.
11587 * region-cache.h: Adjust extern decls to match.
11588
11589 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11590 EMACS_INT, since either will do, for xpalloc.
11591
11592 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11593 (xnmalloc, xnrealloc, xpalloc): New functions.
11594
726e0ab1
PE
11595 * bidi.c (bidi_shelve_header_size): New constant.
11596 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11597 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11598
51f30bc5 11599 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
11600 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11601 (overlay_strings):
11602 Don't update size of array until after memory allocation succeeds,
11603 because xmalloc/xrealloc may not return.
0065d054
PE
11604 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11605 now that we have proper integer overflow checking.
11606 (record_overlay_string, overlay_strings): Catch overflows when
11607 calculating size of overlay_str_buf.
726e0ab1 11608
0065d054
PE
11609 * callproc.c (Fcall_process): Check for size overflow when
11610 calculating size of args2.
11611 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11612 Normally we prefer signed values, but sticking with ptrdiff_t would
11613 require adding more-complicated checks.
726e0ab1
PE
11614
11615 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11616 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11617 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 11618 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
11619
11620 * character.c (Fstring): Check for size-calculation overflow.
11621
11622 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11623 unnecessary integer overflow. Check for size overflow.
11624 (encode_coding_object): Don't update size until xmalloc succeeds.
11625
11626 * composite.c (get_composition_id): Check for overflow in glyph
11627 length calculations.
11628
11629 Integer and memory overflow fixes for display code.
11630 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11631 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11632 (scrolling_window): Check for overflow in size calculations.
11633 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11634 Don't assume glyph table len fits in int.
11635 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11636 (row_table_size): Now ptrdiff_t, not int.
11637 (scrolling_window): Avoid overflow in size calculations.
11638 Don't update size until allocation succeeds.
11639 * fns.c (concat): Check for overflow in size calculations.
11640 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11641 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11642 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11643
11644 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11645 (get_doc_string): Check for size calculation overflow.
11646 Don't update size until allocation succeeds.
11647 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11648 EMACS_INT, where ptrdiff_t will do.
11649 (Fsubstitute_command_keys): Check for string overflow.
11650
11651 * editfns.c (set_time_zone_rule): Don't assume environment length
11652 fits in int.
11653 (message_length): Now ptrdiff_t, not int.
11654 (Fmessage_box): Don't update size until allocation succeeds.
11655 Don't assume message length fits in int.
11656 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11657
0065d054
PE
11658 * emacs.c (main): Do not reallocate argv, since there is a null at
11659 the end that can be overwritten, and this way there's no need to
11660 worry about size-calculation overflow.
11661 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11662
11663 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11664 alloc succeeds.
11665 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11666
11667 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11668 (x_set_scroll_bar_width, x_figure_window_size):
11669 Check for integer overflow.
11670 (x_set_alpha): Do not assume XINT fits in int.
11671
11672 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11673 This is for the members text_lines, text_cols, total_lines, total_cols,
11674 where the system imposes an 'int' limit.
11675
11676 * fringe.c (Fdefine_fringe_bitmap):
11677 Don't update size until alloc works.
11678
11679 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11680 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11681
11682 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11683 Check for size-calculation overflow.
11684 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11685 do, as we prefer signed integers.
11686 (id_to_widget.max_size, id_to_widget.used)
11687 (xg_store_widget_in_map, xg_remove_widget_from_map)
11688 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11689 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11690 Use and return ptrdiff_t, not int.
11691 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11692 * gtkutil.h: Change prototypes to match the above.
11693
11694 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11695 are duplicate now that they've been promoted to lisp.h.
11696 (x_allocate_bitmap_record, x_alloc_image_color)
11697 (make_image_cache, cache_image, xpm_load):
11698 Don't update size until alloc is done.
11699 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11700 (x_detect_edges):
3256efce 11701 Check for size calculation overflow.
726e0ab1
PE
11702 (ct_colors_allocated_max): New constant.
11703 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11704 overflow.
3256efce 11705
726e0ab1
PE
11706 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11707 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11708 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11709 Use ptrdiff_t, not int, to count maps.
11710 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
11711 calculations. Don't update size until allocation succeeds.
11712 Redo calculations to avoid overflow.
726e0ab1
PE
11713 * keyboard.h: Change prototypes to match the above.
11714
11715 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11716 to count maps.
11717 (current_minor_maps): Check for size calculation overflow.
11718 * keymap.h: Change prototypes to match the above.
11719
11720 * lread.c (read1, init_obarray): Don't update size until alloc done.
11721
11722 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11723 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11724
726e0ab1
PE
11725 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11726 Now ptrdiff_t, not int.
11727 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11728 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11729
11730 * process.c (Fnetwork_interface_list): Check for overflow
11731 in size calculation.
11732
11733 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11734
11735 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11736 overflow. Don't bother calling xmalloc when xrealloc will do.
11737
11738 * search.c (Freplace_match): Check for size calculation overflow.
11739 (Fset_match_data): Don't assume list lengths fit in 'int'.
11740
11741 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11742 for command line length. Do not attempt to address one before the
11743 beginning of an array, as that's not portable.
11744
11745 * term.c (max_frame_lines): Remove; unused.
11746 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11747 not int.
11748 (encode_terminal_code, calculate_costs): Check for size
11749 calculation overflow.
11750 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11751 table lengths and related sizes. Don't update size until alloc
11752 done. Redo calculations to avoid overflow.
11753 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11754
11755 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11756 subtracting pointers.
11757 (gobble_line): Check for overflow more carefully. Don't update size
11758 until alloc done.
11759
11760 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11761 Don't update size until alloc done.
11762 Redo size calculations to avoid overflow.
11763 Check for size calculation overflow.
0065d054 11764 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11765
11766 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11767 Use ptrdiff_t, not int, for sizes.
11768 (store_mode_line_noprop_char): Don't update size until alloc done.
11769
0065d054
PE
11770 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11771 Use ptrdiff_t, not int, for sizes.
11772 (Finternal_make_lisp_face, cache_face):
11773 Check for size calculation overflow.
11774 (cache_face): Treat size calculation overflows as if they were
11775 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11776
11777 * xfns.c (x_encode_text, x_set_name_internal)
11778 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11779 sizes, since they can exceed INT_MAX in size. Check for size
11780 calculation overflow.
11781
0065d054
PE
11782 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11783 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11784 Don't update size until alloc done.
11785
0065d054 11786 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11787 as sprintf is limited to int lengths.
1d526e2f 11788
252c5ee1
PE
11789 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11790 (X_LONG_MIN): New macros.
864d7ce7
PE
11791 Use them to make the following changes clearer.
11792 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11793 This change doesn't affect the value now, but it may help remind
11794 future maintainers not to raise the value too much later.
11795 (SELECTION_QUANTUM): Remove, replacing with ...
11796 (selection_quantum): ... new function, which avoids overflow.
11797 All uses changed.
11798 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11799 assumption that selection length fits in 'int'.
11800 (x_reply_selection_request, x_handle_selection_request)
11801 (x_get_window_property, receive_incremental_selection)
11802 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11803 (lisp_data_to_selection_data, clean_local_selection_data):
11804 Use ptrdiff_t, not int, to record length of selection.
11805 (x_reply_selection_request, x_get_window_property)
11806 (receive_incremental_selection, x_property_data_to_lisp):
11807 Redo calculations to avoid overflow.
11808 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11809 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11810 something.
11811 (x_get_window_property, receive_incremental_selection)
11812 (lisp_data_to_selection_data, x_property_data_to_lisp):
11813 Check for size-calculation overflow.
11814 (x_get_window_property, receive_incremental_selection)
11815 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11816 Don't store size until memory allocation succeeds.
11817 (x_get_window_property): Plug memory leak on memory exhaustion.
11818 Don't double-block input; malloc is safe here. Don't assume 2**34
11819 - 4 fits in unsigned long. Add an xassert to check
11820 XGetWindowProperty overflow. Be more careful about overflow
11821 calculations, and distinguish size from memory overflow better.
11822 (receive_incremental_selection): When tracing, don't assume
11823 unsigned int is less than INT_MAX.
11824 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11825 harmful) conversions of unsigned short to int.
11826 (lisp_data_to_selection_data): Don't assume that integers
11827 in the range -65535 through -1 fit in an X unsigned short.
11828 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11829 result parameters unless successful. Rely on cons_to_unsigned
11830 to report problems with elements; the old code wasn't right anyway.
11831 (x_check_property_data): Check for int overflow; we cannot use
11832 a wider type due to X limits.
11833 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11834
726e0ab1 11835 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11836
0065d054
PE
11837 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11838 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11839 (x_color_cells): Don't store size until memory allocation succeeds.
11840 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11841 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11842 (x_term_init): Don't assume length fits in int (sprintf is limited
11843 to int size).
bc18e09d 11844
ebfa62c0
PE
11845 Use ptrdiff_t for composition IDs.
11846 * character.c (lisp_string_width):
11847 * composite.c (composition_table_size, n_compositions)
11848 (get_composition_id, composition_gstring_from_id):
11849 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11850 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11851 * window.c (Frecenter):
11852 Use ptrdiff_t, not int, for composition IDs.
11853 * composite.c (get_composition_id): Check for integer overflow.
11854 * composite.h: Adjust prototypes to match the above changes.
11855
d3411f89
PE
11856 Use ptrdiff_t for hash table indexes.
11857 * category.c (hash_get_category_set):
11858 * ccl.c (ccl_driver):
11859 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11860 * coding.c (coding_system_charset_list, detect_coding_system):
11861 * coding.h (struct coding_system.id):
11862 * composite.c (get_composition_id, gstring_lookup_cache):
11863 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11864 * image.c (xpm_get_color_table_h):
11865 * lisp.h (hash_lookup, hash_put):
11866 * minibuf.c (Ftest_completion):
11867 Use ptrdiff_t for hash table indexes, not int (which is too
11868 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11869 32-bit --with-wide-int hosts).
11870
e097a6fa
PE
11871 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11872 Add a FIXME comment about memory leaks.
11873 (syms_of_charset): Don't assume xmalloc returns.
11874
5637687f
PE
11875 Don't assume that stated character widths fit in int.
11876 * character.c (Fchar_width, c_string_width, lisp_string_width):
11877 * character.h (CHAR_WIDTH):
11878 * indent.c (MULTIBYTE_BYTES_WIDTH):
11879 Use sanitize_char_width to avoid undefined and/or bad behavior
11880 with outlandish widths.
a66cfb1c 11881 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11882 now that we have two such functions. All uses changed.
11883 (sanitize_char_width): New inline function.
11884
a2271ba2
PE
11885 Don't assume that tab-width fits in int.
11886 * character.h (sanitize_width): New inline function.
11887 (SANE_TAB_WIDTH): New macro.
11888 (ASCII_CHAR_WIDTH): Use it.
11889 * indent.c (sane_tab_width): Remove. All uses replaced by
11890 SANE_TAB_WIDTH (current_buffer).
11891 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11892
18c52557
PE
11893 * fileio.c: Integer overflow issues with file modes.
11894 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11895
caeeedc1
PE
11896 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11897 Remove unreachable code.
11898 (read_hex, load_charset_map_from_file): Check for integer overflow.
11899
6df6ae42 11900 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11901 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11902 (x_send_scroll_bar_event): Likewise. Check that the size does not
11903 exceed limits imposed by XClientMessageEvent, as well as the usual
11904 ptrdiff_t and size_t limits.
11905
b13995db
PE
11906 * keyboard.c: Overflow, signedness and related fixes.
11907 (make_lispy_movement): Use same integer type in forward decl
11908 that is used in the definition.
11909 (read_key_sequence, keyremap_step):
11910 Change bufsize argument back to int, undoing my 2011-03-30 change.
11911 We prefer signed types, and int is wide enough here.
11912 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11913 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11914 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11915 length, not size_t. Use ptrdiff_t for index, not int.
11916 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11917 possibility of integer overflow.
11918
13464394
PE
11919 Overflow, signedness and related fixes for images.
11920
11921 * dispextern.h (struct it.stack[0].u.image.image_id)
11922 (struct_it.image_id, struct image.id, struct image_cache.size)
11923 (struct image_cache.used, struct image_cache.ref_count):
11924 * gtkutil.c (update_frame_tool_bar):
11925 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11926 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11927 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11928 * nsmenu.m (update_frame_tool_bar):
11929 * xdisp.c (calc_pixel_width_or_height):
11930 * xfns.c (image_cache_refcount):
11931 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11932 on typical 64-bit hosts.
11933
11934 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11935 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11936 Omit unnecessary casts to int.
11937 (parse_image_spec): Check that integers fall into 'int' range
11938 when the callers expect that.
11939 (image_ascent): Redo ascent calculation to avoid int overflow.
11940 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11941 (lookup_image): Remove unnecessary tests.
11942 (xbm_image_p): Locals are now of int, not EMACS_INT,
11943 since parse_image_check makes sure they fit into int.
11944 (png_load, gif_load, svg_load_image):
11945 Prefer int to unsigned where either will do.
11946 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
11947 old tiff_error_handler and tiff_warning_handler.
11948 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
11949 stack buffer overflows. It uses only the features of vsnprintf
11950 that are common to both POSIX and native Microsoft.
11951 (tiff_error_handler, tiff_warning_handler): Use it.
11952 (tiff_load, gif_load, imagemagick_load_image):
11953 Don't assume :index value fits in 'int'.
11954 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11955 (imagemagick_load_image): Check that crop parameters fit into
11956 the integer types that MagickCropImage accepts. Don't assume
11957 Vimagemagick_render_type has a nonnegative value. Don't assume
11958 size_t fits in 'long'.
11959 (gs_load): Use printmax_t to print the widest integers possible.
11960 Check for integer overflow when computing image height and width.
11961
c11821d4
EZ
119622011-08-26 Eli Zaretskii <eliz@gnu.org>
11963
11964 * xdisp.c (redisplay_window): Don't force window start if point
11965 will be invisible in the resulting window. (Bug#9324)
11966
0c95fcf7
EZ
119672011-08-25 Eli Zaretskii <eliz@gnu.org>
11968
11969 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11970 the display spec is of the form `(space ...)'.
11971 (handle_display_spec): Return the value returned by
11972 handle_single_display_spec, not just 1 or zero.
11973 (handle_single_display_spec): If the display spec is of the form
11974 `(space ...)', and specifies display in the text area, return 2
11975 rather than 1.
fee65a97 11976 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
11977 accurately, and prefer exact match for point under bidi.
11978 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
11979
11980 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11981 into disp_prop; all users changed.
11982
11983 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11984 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11985 for the text covered by the display property.
11986
e4ed06f1
CY
119872011-08-25 Chong Yidong <cyd@stupidchicken.com>
11988
11989 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11990 Change return value to nil.
11991 (Frecord_buffer): Delete unused function.
11992
f67cdd7f
EZ
119932011-08-24 Eli Zaretskii <eliz@gnu.org>
11994
5980d4c6
EZ
11995 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11996 buffers, return left-to-right.
8610fe8b
EZ
11997 (set_cursor_from_row): Consider candidate row a win if its glyph
11998 represents a newline and point is on that newline. Fixes cursor
11999 positioning on the newline at EOL of R2L text within L2R
12000 paragraph, and vice versa.
12001 (try_cursor_movement): Check continued rows, in addition to
12002 continuation rows. Fixes unwarranted scroll when point enters a
12003 continued line of R2L text within an L2R paragraph, or vice versa.
12004 (cursor_row_p): Consider the case of point being equal to
12005 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12006 from the end of a short line to the beginning of a continued line
12007 of R2L text within L2R paragraph.
12008 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12009 composed characters.
5980d4c6 12010
f67cdd7f
EZ
12011 * bidi.c (bidi_check_type): Use xassert.
12012 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12013 members.
12014
bca633fb
EZ
120152011-08-23 Eli Zaretskii <eliz@gnu.org>
12016
12017 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12018 a character.
12019
4a5885a7
CY
120202011-08-23 Chong Yidong <cyd@stupidchicken.com>
12021
12022 * nsfont.m (ns_otf_to_script): Fix typo.
12023
0902a04e
KH
120242011-08-22 Kenichi Handa <handa@m17n.org>
12025
12026 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12027 extra slot even if the purpose is char-code-property-table.
12028
1a2e6670
EZ
120292011-08-23 Eli Zaretskii <eliz@gnu.org>
12030
8ddde651
EZ
12031 * xdisp.c (redisplay_window): When computing centering_position,
12032 account for the height of the header line. (Bug#8874)
12033
425cc014
EZ
12034 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12035 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12036 candidate is selected by the mouse, and that candidate has a
12037 composed character under the mouse.
12038
1a2e6670
EZ
12039 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12040 coordinates reported by pos-visible-in-window-p for a composed
12041 character in column zero.
12042
8b76d6f8
SM
120432011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12044
12045 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12046
dac347dd
EZ
120472011-08-22 Eli Zaretskii <eliz@gnu.org>
12048
12049 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12050 consider it a hit if to_charpos is anywhere in the range of the
12051 composed buffer positions.
12052
e013fb34
CY
120532011-08-22 Chong Yidong <cyd@stupidchicken.com>
12054
12055 * image.c (gif_load): Don't assume that each subimage has the same
12056 dimensions as the base image. Handle disposal method that is
12057 "undefined" by the gif spec (Bug#9335).
12058
bd1ba3e8
CY
120592011-08-20 Chong Yidong <cyd@stupidchicken.com>
12060
12061 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 12062 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 12063
54a1215b
EZ
120642011-08-19 Eli Zaretskii <eliz@gnu.org>
12065
823564e5
EZ
12066 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12067 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12068 from an Org mode buffer to a Speedbar frame.
12069
54a1215b
EZ
12070 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12071 a composition, take its buffer position from IT->cmp_it.charpos.
12072 Fixes cursor positioning at the beginning of a line that begins
12073 with a composed character.
12074
9778ebcc
EZ
120752011-08-18 Eli Zaretskii <eliz@gnu.org>
12076
0be6ee06
EZ
12077 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12078 character bidirectional type, use STRONG_L instead. Fixes crashes
12079 in a buffer produced by `describe-categories'.
12080
9778ebcc
EZ
12081 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12082 members before the level stack, so they would be saved and
12083 restored when copying iterator state. Fixes incorrect reordering
12084 around TABs covered by display properties.
12085
156bffbe
AS
120862011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12087
6b02f655 12088 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 12089
72ad093b
CY
120902011-08-17 Chong Yidong <cyd@stupidchicken.com>
12091
12092 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
12093 (internal_condition_case_2, internal_condition_case_n):
12094 Remove unnecessary aborts (Bug#9081).
72ad093b 12095
35774242
EZ
120962011-08-17 Eli Zaretskii <eliz@gnu.org>
12097
12098 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12099 has no `load' handler, try opening the file locally. (Bug#9311)
12100
db76dd85
KB
121012011-08-16 Ken Brown <kbrown@cornell.edu>
12102
12103 * gmalloc.c: Expand comment.
12104
b215eee5
EZ
121052011-08-16 Eli Zaretskii <eliz@gnu.org>
12106
12107 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12108 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12109
a4579d33
KB
121102011-08-16 Ken Brown <kbrown@cornell.edu>
12111
12112 Fix memory allocation problems in Cygwin build (Bug#9273).
12113
12114 * unexcw.c ( __malloc_initialized): Declare external variable.
12115 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12116
8b76d6f8
SM
12117 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12118 New variables.
a4579d33
KB
12119 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12120 dumped emacs.
12121 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12122 in the static heap.
12123 [CYGWIN] (special_realloc): New function.
12124 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12125 requests to realloc storage in the static heap.
12126
3ebec551
PE
121272011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12128
12129 * bidi.c (bidi_initialize): Remove unused local.
12130
9fd8be00
EZ
121312011-08-15 Eli Zaretskii <eliz@gnu.org>
12132
6b02f655
SM
12133 * bidimirror.h:
12134 * biditype.h: Remove file.
12135 * makefile.w32-in ($(BLD)/bidi.$(O)):
12136 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
12137
12138 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12139
12140 * chartab.c: Improve commentary for the uniprop_table API.
12141
32413314
EZ
12142 * bidi.c (bidi_paragraph_init): Support zero value of
12143 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
12144 (bidi_initialize): Use uniprop_table instead of including
12145 biditype.h and bidimirror.h.
32413314 12146
9fd8be00
EZ
12147 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12148 coordinates of the iterator when restoring from ppos_it.
12149 (Bug#9296)
12150
5cf2b69b
KH
121512011-08-14 Kenichi Handa <handa@m17n.org>
12152
12153 * process.c (create_process): Call setup_process_coding_systems
72ad093b 12154 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 12155
daf17d00
EZ
121562011-08-14 Eli Zaretskii <eliz@gnu.org>
12157
12158 * xdisp.c (move_it_in_display_line_to): Don't invoke
12159 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12160 ppos_it. Fixes vertical cursor motion when line beginning is
12161 covered by an image. (Bug#9296)
12162
08e3161a
JD
121632011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12164
12165 * nsterm.h (ns_run_ascript): Declare.
12166 (NSAPP_DATA2_RUNASSCRIPT): Define.
12167
12168 * nsfns.m (as_script, as_result, as_status): New static variables.
12169 (ns_run_ascript): New function.
5e617bc2 12170 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
12171 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12172 the event loop. Get status from as_status (Bug#7276).
12173
12174 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12175 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12176 the event loop (Bug#7276).
12177
a3720aa2
AS
121782011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12179
12180 * gnutls.c (QCgnutls_bootprop_priority)
12181 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12182 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12183 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12184 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12185 (QCgnutls_bootprop_verify_hostname_error)
12186 (QCgnutls_bootprop_callbacks_verify): Rename from
12187 Qgnutls_bootprop_..., all uses changed.
12188
12189 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12190 uses changed.
12191
0a0d27fb
PE
121922011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12193
19d5c50c
PE
12194 * xfaces.c (Qframe_set_background_mode): Now static.
12195 * dispextern.h (Qframe_set_background_mode): Remove decl.
12196
0a0d27fb
PE
12197 * process.c (Fnetwork_interface_info): Declare local only if needed.
12198
377538cb
JD
121992011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12200
12201 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12202 (Fnetwork_interface_list): Allocate in increments of bytes instead
12203 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12204 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12205 sockaddr.
12206 (struct ifflag_def): notrailers is smart on OSX.
12207 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12208 Get hardware address with getifaddrs if available.
12209
08fff70c
EZ
122102011-08-12 Eli Zaretskii <eliz@gnu.org>
12211
12212 * xdisp.c (iterate_out_of_display_property): xassert that
12213 IT->position is set to within IT->object's boundaries. Break from
12214 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
12215 when IT->position is set up wrongly due to some bug.
12216 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
12217 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12218 entry. Force push_it to save on the stack the current
12219 buffer/string position, to be restored by pop_it. Fix flags in
12220 the iterator structure wrt the object coming from a display
12221 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12222 properties. (Bug#9284)
12223
7be1c708 122242011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 12225
7be1c708
CY
12226 * fontset.c (fontset_get_font_group): Add proper type checks.
12227 (Bug#9172)
aac0c6e3 12228
7be1c708 122292011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 12230
7be1c708
CY
12231 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12232 and LC_VERSION_MIN_MACOSX.
12233 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12234 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 12235
97bb72a6
EZ
122362011-08-08 Eli Zaretskii <eliz@gnu.org>
12237
12238 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
12239 no-display-properties-and-no-overlays under bidi display.
12240 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 12241 properties and overlays.
97bb72a6 12242
d5617611
CY
122432011-08-08 Chong Yidong <cyd@stupidchicken.com>
12244
37e11a63
CY
12245 * editfns.c (Fset_time_zone_rule): Document relationship with the
12246 setenv function.
12247
d5617611
CY
12248 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12249 the font entity extracted from the cache (Bug#8109).
12250
58872834
CY
122512011-08-07 Chong Yidong <cyd@stupidchicken.com>
12252
12253 * composite.c (autocmp_chars): Don't reset point. That is done by
12254 restore_point_unwind (Bug#5984).
12255
75bfc667
JL
122562011-08-07 Juri Linkov <juri@jurta.org>
12257
12258 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12259 to show the arg `TIME' instead of `TIMEVAL'.
12260
d1410150
EZ
122612011-08-06 Eli Zaretskii <eliz@gnu.org>
12262
12263 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12264 display property strides EOL and includes a newline, as in
12265 longlines-mode. (Bug#9254)
75b771e4
EZ
12266 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12267 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
12268
12269 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12270 is non-zero, even if the data buffer is NULL. Fixes a crash in
12271 vertical-motion with longlines-mode. (Bug#9254)
12272
35928349
EZ
122732011-08-05 Eli Zaretskii <eliz@gnu.org>
12274
ec7cc85b
EZ
12275 * bidi.c <bidi_cache_total_alloc>: Now static.
12276 (bidi_initialize): Initialize bidi_cache_total_alloc.
12277
8b76d6f8 12278 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
12279 cache. (Bug#9221)
12280
12281 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12282 amount allocated this far in `bidi_cache_total_alloc'.
12283 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12284 non-zero, only free the data buffer without restoring the cache
12285 contents. All callers changed.
12286
12287 * dispextern.h (bidi_unshelve_cache): Update prototype.
12288
12289 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12290 (move_it_in_display_line, move_it_to)
12291 (move_it_vertically_backward, move_it_by_lines): Replace the call
12292 to xfree to an equivalent call to bidi_unshelve_cache.
12293 (move_it_in_display_line_to): Fix logic of returning
412b6358 12294 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 12295
e2e2423b
EZ
122962011-08-05 Eli Zaretskii <eliz@gnu.org>
12297
12298 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12299 came from a string character with a `cursor' property. (Bug#9229)
12300
ae9e757a
JD
123012011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12302
12303 * Makefile.in (LIB_PTHREAD): New variable.
12304 (LIBES): Add LIB_PTHREAD (Bug#9216).
12305
12306 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12307 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12308
213bd7f2
AS
123092011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12310
6b02f655 12311 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 12312
99aaf75f
JD
123132011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12314
12315 * xterm.c (x_find_topmost_parent): New function.
12316 (x_set_frame_alpha): Find topmost parent window with
12317 x_find_topmost_parent and set the property there also (bug#9181).
12318 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12319
c74e9d86
PE
123202011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12321
12322 * callproc.c (Fcall_process): Avoid vfork clobbering
12323 the local vars buffer, coding_systems, current_dir.
12324
640c8776
SM
123252011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12326
12327 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12328
f26d0e4c
PE
123292011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12330
8a10d76c
PE
12331 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12332 so that it is not optimized away.
12333
f26d0e4c
PE
12334 * xdisp.c (compute_display_string_pos): Remove unused local.
12335
55439c61
EZ
123362011-08-02 Eli Zaretskii <eliz@gnu.org>
12337
12338 Fix slow cursor motion and scrolling in large buffers with
12339 selective display, like Org Mode buffers. (Bug#9218)
12340
12341 * dispextern.h (struct bidi_it): New member disp_prop_p.
12342
12343 * xdisp.c: Remove one-slot cache of display string positions.
12344 (compute_display_string_pos): Accept an additional argument
5e617bc2 12345 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
12346 for a display string or property. If found, set DISP_PROP_P
12347 non-zero.
12348
12349 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
12350 DISP_PROP_P, and pass it to compute_display_string_pos.
12351 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
12352 non-zero. All callers of bidi_fetch_char changed.
12353
fb33fa43
SM
123542011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12355
12356 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12357
b099e063
DM
123582010-12-03 Don March <don@ohspite.net>
12359
12360 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12361 last character M-[char] is translated to ESC [char] (bug#7541).
12362
5cc7f7af
KH
123632011-08-02 Kenichi Handa <handa@m17n.org>
12364
d0fffa3f 12365 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
12366
12367 * chartab.c (uniprop_table): Make it non-static.
12368
525d5e6e
EZ
123692011-08-01 Eli Zaretskii <eliz@gnu.org>
12370
12371 * xdisp.c (forward_to_next_line_start): Accept additional argument
12372 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12373 on the newline.
12374 (reseat_at_next_visible_line_start): Use the bidi iterator state
12375 returned by forward_to_next_line_start to restore the state of
12376 it->bidi_it after backing up to previous newline. (Bug#9212)
12377
31011111
AS
123782011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12379
12380 * regex.c (re_comp): Protoize.
12381 (re_exec): Fix return type.
12382 (regexec): Fix type of `ret'. (Bug#9203)
12383
476371c4
PE
123842011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12385
e5d76069
PE
12386 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12387 This is needed if max-image-size is a floating-point number.
12388
9a79b20c
AS
123892011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12390
12391 * print.c (print_object): Print empty symbol as ##.
12392
12393 * lread.c (read1): Read ## as empty symbol.
12394
d8c2fa78
AA
123952011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12396
12397 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12398 setting frame foreground color (Bug#9175).
12399 (x_set_background_color): Likewise.
12400
ffe57a7a
AA
12401 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12402 contents (Bug#9176).
12403 (EmacsTooltip -init): Remove bezels and add shadows to
12404 tooltip windows.
12405
bf3492a5
AA
12406 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12407 or scroll bar (Bug#8470).
12408
d55e9c53
AA
12409 * nsfont.m (nsfont_open): Remove assignment to voffset and
12410 unnecessary vars hshink, expand, hd, full_height, min_height.
12411 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12412
12413 * nsterm.h (nsfont_info): Remove voffset field.
12414
d8c2fa78 124152011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
12416
12417 Implement strike-through and overline on NextStep (Bug#8863).
12418
12419 * nsfont.m (nsfont_open): Use underline position provided by font,
12420 instead of hard-coded value of 2.
12421 (nsfont_draw): Call ns_draw_text_decoration instead.
12422
12423 * nsterm.h: Add declaration for ns_draw_text_decoration.
12424
12425 * nsterm.m (ns_draw_text_decoration): New function for drawing
12426 underline, overline, and strike-through.
12427 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12428 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 12429 accommodate underlining, etc.
4843aac3 12430
4cc60b9b
EZ
124312011-07-28 Eli Zaretskii <eliz@gnu.org>
12432
bc7ece87
EZ
12433 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12434 default.
4cc60b9b 12435
476371c4
PE
124362011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12437
66606eea
PE
12438 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12439 Without this fix, if a signal arrives just after memory fills up,
12440 'malloc' might be invoked reentrantly.
12441
476371c4
PE
12442 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12443 In other words, assume that every image size is allowed, on non-X
12444 hosts. This assumption is probably wrong, but it lets Emacs compile.
12445
f3fcc40d
AS
124462011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12447
12448 * regex.c (re_iswctype): Convert return values to boolean.
12449
350c992f
EZ
124502011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12451
12452 * xdisp.c (compute_display_string_pos): Don't use cached display
12453 string position if the buffer had its restriction changed.
12454 (Bug#9184)
12455
5266b4bb
PE
124562011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12457
12458 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12459
2573a837 124602011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 12461
41f55ccd 12462 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 12463
39e378da
PE
12464 * bidi.c: Integer size and overflow fixes.
12465 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12466 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12467 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12468 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12469 (bidi_find_other_level_edge):
12470 Use ptrdiff_t instead of EMACS_INT where either will do.
12471 This works better on 32-bit hosts configured --with-wide-int.
12472 (bidi_cache_ensure_space): Check for size-calculation overflow.
12473 Use % rather than repeated addition, for better worst-case speed.
12474 Don't set bidi_cache_size until after xrealloc returns, because it
12475 might not return.
12476 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
12477 (bidi_cache_ensure_space): Also check that the bidi cache size
12478 does not exceed that of the largest Lisp string or buffer. See Eli
12479 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 12480
5e927815
PE
12481 * alloc.c (__malloc_size_t): Remove.
12482 All uses replaced by size_t. See Andreas Schwab's note
12483 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12484
ca4aa935
PE
12485 * image.c: Improve checking for integer overflow.
12486 (check_image_size): Assume that f is nonnull, since
12487 it is always nonnull in practice. This is one less thing to
12488 worry about when checking for integer overflow later.
12489 (x_check_image_size): New function, which checks for integer
12490 overflow issues inside X.
12491 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12492 This removes the need for a memory_full check.
12493 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12494 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12495 (xbm_read_bitmap_data): Change locals back to 'int', since
12496 their values must fit in 'int'.
12497 (xpm_load_image, png_load, tiff_load):
12498 Invoke x_create_x_image_and_pixmap earlier,
12499 to avoid much needless work if the image is too large.
12500 (tiff_load): Treat overly large images as if
12501 x_create_x_image_and_pixmap failed, not as malloc failures.
12502 (gs_load): Use x_check_image_size.
12503
5f8f9cc2
PE
12504 * gtkutil.c: Omit integer casts.
12505 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12506 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12507
5adf60bc
PE
12508 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12509
c8907a93
PE
12510 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12511 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12512 would wrongly return t on a 64-bit host.
12513
e3c25c68
PE
12514 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12515 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12516 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12517 and therefore cause GCC to emit a bogus diagnostic in some cases.
12518
3f791afe
PE
12519 * image.c: Integer signedness and overflow and related fixes.
12520 This is not an exhaustive set of fixes, but it's time to
12521 record what I've got.
12522 (lookup_pixel_color, check_image_size): Remove redundant decls.
12523 (check_image_size): Don't assume that arbitrary EMACS_INT values
12524 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12525 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12526 (tiff_load, imagemagick_load_image):
12527 Check for overflow in size calculations.
12528 (x_create_x_image_and_pixmap): Remove unnecessary test for
12529 xmalloc returning NULL; that can't happen.
12530 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12531 (xpm_color_bucket): Use better integer hashing function.
12532 (xpm_cache_color): Don't possibly over-allocate memory.
12533 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12534 (gif_memory_source):
12535 Use ptrdiff_t, not int or size_t, to record sizes.
12536 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12537 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12538 either works, as we prefer signed integers.
12539 (tiff_read_from_memory, tiff_write_from_memory):
12540 Return tsize_t, not size_t, since that's what the TIFF API wants.
12541 (tiff_read_from_memory): Don't fail simply because the read would
12542 go past EOF; instead, return a short read.
12543 (tiff_load): Omit no-longer-needed casts.
12544 (Fimagemagick_types): Don't assume size fits into 'int'.
12545
3cc5a532
PE
12546 Improve hashing quality when configured --with-wide-int.
12547 * fns.c (hash_string): New function, taken from sxhash_string.
12548 Do not discard information about ASCII character case; this
12549 discarding is no longer needed.
12550 (sxhash-string): Use it. Change sig to match it. Caller changed.
12551 * lisp.h: Declare it.
12552 * lread.c (hash_string): Remove, since we now use fns.c's version.
12553 The fns.c version returns a wider integer if --with-wide-int is
12554 specified, so this should help the quality of the hashing a bit.
12555
b312a492
PE
12556 * emacs.c: Integer overflow minor fix.
12557 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12558 Define only if GNU_LINUX.
12559 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12560
dfd153ae
PE
12561 * dispnew.c: Integer signedness and overflow fixes.
12562 Remove unnecessary forward decls, that were a maintenance hassle.
12563 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12564 All uses changed.
12565 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12566 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12567 (prepare_desired_row, line_draw_cost):
12568 Use int, not unsigned, where either works.
12569 (save_current_matrix, restore_current_matrix):
12570 Use ptrdiff_t, not size_t, where either works.
12571 (init_display): Check for overflow more accurately, and without
12572 relying on undefined behavior.
12573
a81d11a3
PE
12574 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12575 Remove, replacing with the new symbols in lisp.h. All uses changed.
12576 * fileio.c (make_temp_name):
12577 * filelock.c (lock_file_1, lock_file):
12578 * xdisp.c (message_dolog):
12579 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12580 Use pMd etc. instead.
12581 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12582 replacing the pWIDE etc. symbols removed from editfns.c.
12583
3300e6fd
PE
12584 * keyboard.h (num_input_events): Now uintmax_t.
12585 This is (very slightly) less likely to mess up due to wraparound.
12586 All uses changed.
12587
fd05c7e9
PE
12588 * buffer.c: Integer signedness fixes.
12589 (alloc_buffer_text, enlarge_buffer_text):
12590 Use ptrdiff_t rather than size_t when either will do, as we prefer
12591 signed integers.
12592
903fe15d
PE
12593 * alloc.c: Integer signedness and overflow fixes.
12594 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12595 (__malloc_size_t): Default to size_t, not to int.
12596 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12597 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12598 Prefer ptrdiff_t to size_t when either would do, as we prefer
12599 signed integers.
12600 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12601 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12602 Now const. Initialize with values that are in range even if char
12603 is signed.
12604 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12605 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12606 These functions do the right thing with sizes > 2**32.
12607 (check_depth): Now ptrdiff_t, not int.
12608 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12609 Adjust to new way of storing sizes. Check for size overflow bugs
12610 in rest of code.
12611 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12612 slightly wrong anyway, as it missed one instance of
12613 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12614 (refill_memory_reserve): Omit needless cast to size_t.
12615 (mark_object_loop_halt): Mark as externally visible.
12616
ac82cc6a
PE
12617 * xselect.c: Integer signedness and overflow fixes.
12618 (Fx_register_dnd_atom, x_handle_dnd_message):
12619 Use ptrdiff_t, not size_t, since we prefer signed.
12620 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12621 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12622 x_dnd_atoms_size and x_dnd_atoms_length.
12623
c2d1e36d
PE
12624 * doprnt.c: Prefer signed to unsigned when either works.
12625 * eval.c (verror):
12626 * doprnt.c (doprnt):
12627 * lisp.h (doprnt):
12628 * xdisp.c (vmessage):
12629 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12630 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12631 prefer signed arithmetic to avoid comparison confusion.
12632 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12633 but is a bit tricky.
12634
0e926e56
PE
12635 Assume freestanding C89 headers, string.h, stdlib.h.
12636 * data.c, doprnt.c, floatfns.c, print.c:
12637 Include float.h unconditionally.
12638 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12639 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12640 * regex.c: Likewise for stddef.h, string.h.
12641 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12642 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12643 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12644 (STDC_HEADERS): Remove obsolete defines.
12645 * sysdep.c: Include limits.h unconditionally.
12646
9cfdb3ec
PE
12647 Assume support for memcmp, memcpy, memmove, memset.
12648 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12649 * regex.c (memcmp, memcpy):
12650 Remove; we assume C89 now.
12651
12652 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12653 (__malloc_safe_bcopy): Remove; no longer needed.
12654
cf950e6b 12655 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12656 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12657 well either way, and we prefer signed to unsigned.
12658
dbf38e02
LMI
126592011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12660
12661 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12662 closes the connection while we're reading (bug#9182).
12663
d6f0886c 126642011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12665
d6f0886c
JD
12666 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12667 are specified (Bug#9168).
24e0f6b1 12668
2eb1f9e6
PE
126692011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12670
12671 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12672 Found by GCC static checking and --with-wide-int on a 32-bit host.
12673
22381272 126742011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12675
12676 * xdisp.c (compute_display_string_pos): Fix logic of caching
12677 previous display string position. Initialize cached_prev_pos to
12678 -1. Fixes slow-down at the beginning of a buffer.
12679
f25e39b4
EZ
126802011-07-24 Eli Zaretskii <eliz@gnu.org>
12681
12682 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12683 for attrs[LFACE_FONTSET_INDEX].
12684
04c4b52e
PE
126852011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12686
12687 * xml.c (parse_region): Remove unused local
12688 that was recently introduced.
12689
c1734fbd
EZ
126902011-07-23 Eli Zaretskii <eliz@gnu.org>
12691
be18c5a5
EZ
12692 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12693 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12694
c1734fbd
EZ
12695 * xdisp.c (move_it_in_display_line_to): Record the best matching
12696 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
12697 exit if none of the characters scanned was an exact match.
12698 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
12699 when exact match is impossible due to invisible text, and the
12700 lines are truncated.
12701
a258d627
JD
127022011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12703
12704 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12705 for OSX >= 10.7.
12706
b6d5a689
EZ
127072011-07-22 Eli Zaretskii <eliz@gnu.org>
12708
0f74f785
EZ
12709 Fix a significant slow-down of cursor motion with C-n, C-p,
12710 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12711 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 12712 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
12713 (next_element_from_buffer): Call compute_stop_pos_backwards to
12714 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
12715 base_level_stop.
12716 (reseat): Don't look for prev_stop, as that could mean a very long
12717 run.
12718 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12719 <cached_disp_overlay_modiff>: Cache for last found display string
12720 position.
551918c1 12721 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
12722 about the same buffer in the same area of character positions, and
12723 the buffer wasn't changed since the time the display string
12724 position was cached.
551918c1 12725
b2d0c91a
EZ
127262011-07-22 Eli Zaretskii <eliz@gnu.org>
12727
12728 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12729 is an integer, which is important for empty lines. (Bug#9149)
12730
043604ee
CY
127312011-07-22 Chong Yidong <cyd@stupidchicken.com>
12732
12733 * frame.c (Fmodify_frame_parameters): In tty case, update the
12734 default face if necessary (Bug#4238).
12735
da4adb04
CY
127362011-07-21 Chong Yidong <cyd@stupidchicken.com>
12737
12738 * editfns.c (Fstring_to_char): No need to explain what a character
12739 is in the docstring (Bug#6576).
12740
9abd0532
LMI
127412011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12742
12743 * xml.c (parse_region): Make sure we always return a tree.
12744
36881d16
HK
127452011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12746
12747 * xml.c (parse_region): If a document contains only comments,
12748 return that, too.
12749
1e98674d
LMI
127502011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12751
12752 * xml.c (make_dom): Return comments, too.
12753
590bd467
PE
127542011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12755
12756 Port to OpenBSD.
12757 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12758 and the surrounding thread.
12759 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12760 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12761 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12762 timer goes off.
12763 * s/openbsd.h (BROKEN_SIGIO): Define.
12764 * unexelf.c (unexec) [__OpenBSD__]:
12765 Don't update the .mdebug section of the Alpha COFF symbol table.
12766
f41628b2
LMI
127672011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12768
12769 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12770 (bug#8460).
12771
b59b67c5
PE
127722011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12773
15e3a074
PE
12774 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12775 This fixes some race conditions on the permissions of any newly
12776 created file.
12777
41bed37d
PE
12778 * alloc.c (valid_pointer_p): Use pipe, not open.
12779 This fixes some permissions issues when debugging.
12780
b59b67c5
PE
12781 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12782 If fchown fails to set both uid and gid, try to set just gid,
12783 as that is sometimes allowed. Adjust the file's mode to eliminate
12784 setuid or setgid bits that are inappropriate if fchown fails.
12785
925a6be7
SM
127862011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12787
12788 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12789 to compare Lisp_Objects.
12790 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12791 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12792 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12793
52968808
AS
127942011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12795
0a6a104b
AS
12796 * lread.c (read_integer): Unread even EOF character.
12797 (read1): Likewise. Properly record start position of symbol.
12798
52968808
AS
12799 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12800 symbol character follows.
12801
9e381cdd
PE
128022011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12803
12804 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12805 This works around a problem with the previous change to Fcopy_file.
12806 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12807 and without this change, GCC might complain about discarding
12808 fchown's return value.
12809
b5641435
JB
128102011-07-16 Juanma Barranquero <lekktu@gmail.com>
12811
12812 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12813
a8031457
PE
128142011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12815
12816 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12817
dd889327
LMI
128182011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12819
750c33f7
LMI
12820 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12821 it's used from the C level.
12822
dd889327
LMI
12823 * process.c: Use the same condition for POLL_FOR_INPUT in both
12824 keyboard.c and process.c (bug#1858).
12825
87e86684
LM
128262011-07-09 Lawrence Mitchell <wence@gmx.li>
12827
12828 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12829 (Fgnutls_boot): Use it.
12830
64348f40
AS
128312011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12832
12833 * doc.c (Fsubstitute_command_keys): Revert last change.
12834
1d698799
LMI
128352011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12836
f863868c
LMI
12837 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12838 quotes the next character, and doesn't affect other longer
12839 sequences (bug#8935).
12840
1d698799
LMI
12841 * lread.c (syms_of_lread): Clarify that is isn't only
12842 `eval-buffer' and `eval-defun' that's affected by
12843 `lexical-binding' (bug#8460).
12844
aa4b6df6
EZ
128452011-07-15 Eli Zaretskii <eliz@gnu.org>
12846
12847 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12848 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12849
5d856da6
PE
128502011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12851
ad6042bb
PE
12852 Fix minor problems found by static checking.
12853 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12854 (elsz): Now a signed constant, not a size_t var. We prefer signed
12855 types to unsigned, to avoid integer comparison confusion. Without
12856 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12857 "cannot optimize loop, the loop counter may overflow", a symptom
12858 of the confusion.
f00bbb22 12859 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12860 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12861
6468f31c
LMI
128622011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12863
49080b10
LMI
12864 * search.c (Fre_search_backward): Mention `case-fold-search' in
12865 all the re_search_* functions (bug#8138).
12866
6468f31c
LMI
12867 * keyboard.c (Fopen_dribble_file): Document when the file is
12868 closed (bug#8056).
12869
c965adc5
EZ
128702011-07-14 Eli Zaretskii <eliz@gnu.org>
12871
df9733bf
EZ
12872 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12873 bidi_cache_idx.
12874
0bb23927
EZ
12875 Support bidi reordering of display and overlay strings.
12876 * xdisp.c (compute_display_string_pos)
12877 (compute_display_string_end): Accept additional argument STRING.
12878 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12879 (reseat_to_string): Initialize bidi_it->string.s and
12880 bidi_it->string.schars.
12881 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12882 NULL (avoids a crash in bidi_paragraph_init).
12883 Initialize itb.string.lstring.
0bb23927
EZ
12884 (init_iterator): Call bidi_init_it only of a valid
12885 buffer position was specified. Initialize paragraph_embedding to
12886 L2R.
12887 (reseat_to_string): Initialize the bidi iterator.
12888 (display_string): If we need to ignore text properties of
12889 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12890 original value of -1 will not work with bidi.)
12891 (compute_display_string_pos): First arg is now struct
12892 `text_pos *'; all callers changed. Support display properties on
12893 Lisp strings.
12894 (compute_display_string_end): Support display properties on Lisp
12895 strings.
12896 (init_iterator, reseat_1, reseat_to_string): Initialize the
12897 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12898 when iterating on a string not from display properties).
640c8776
SM
12899 (compute_display_string_pos, compute_display_string_end):
12900 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12901 arrow keys.
12902 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12903 base_level_stop; instead, set base_level_stop to BEGV.
12904 Fixes crashes in vertical-motion.
0bb23927
EZ
12905 (next_element_from_buffer): Improve commentary for when
12906 the iterator is before prev_stop.
12907 (init_iterator): Initialize bidi_p from the default value of
12908 bidi-display-reordering, not from buffer-local value. Use the
12909 buffer-local value only if initializing for buffer iteration.
12910 (handle_invisible_prop): Support invisible properties on strings
12911 that are being bidi-reordered.
12912 (set_iterator_to_next): Support bidi reordering of C strings and
12913 Lisp strings.
12914 (next_element_from_string): Support bidi reordering of Lisp
12915 strings.
12916 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12917 (display_string): Support display of R2L glyph rows.
12918 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
12919 (init_iterator): Don't initialize it->bidi_p for strings
12920 here.
12921 (reseat_to_string): Initialize it->bidi_p for strings here.
12922 (next_element_from_string, next_element_from_c_string)
12923 (next_element_from_buffer): Add xassert's for correspondence
12924 between IT's object being iterated and it->bidi_it.string
12925 structure.
12926 (face_before_or_after_it_pos): Support bidi iteration.
12927 (next_element_from_c_string): Handle the case of the first string
12928 character that is not the first one in the visual order.
12929 (get_visually_first_element): New function, refactored from common
12930 parts of next_element_from_buffer, next_element_from_string, and
12931 next_element_from_c_string.
12932 (tool_bar_lines_needed, redisplay_tool_bar)
12933 (display_menu_bar): Force left-to-right direction. Add a FIXME
12934 comment for making that be controlled by a user option.
12935 (push_it, pop_it): Save and restore the state of the
12936 bidi iterator. Save and restore the bidi_p flag.
12937 (pop_it): Iterate out of display property for string iteration as
12938 well.
12939 (iterate_out_of_display_property): Support iteration over strings.
12940 (handle_single_display_spec): Set up it->bidi_it for iteration
12941 over a display string, and call bidi_init_it.
12942 (handle_single_display_spec, next_overlay_string)
12943 (get_overlay_strings_1, push_display_prop): Set up the bidi
12944 iterator for displaying display or overlay strings.
12945 (forward_to_next_line_start): Don't use the shortcut if
12946 bidi-iterating.
12947 (back_to_previous_visible_line_start): If handle_display_prop
12948 pushed the iterator stack, restore the internal state of the bidi
12949 iterator by calling bidi_pop_it same number of times.
12950 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12951 and we are bidi-iterating, don't decrement the iterator position;
12952 instead, set the first_elt flag in the bidi iterator, to produce
12953 the same effect.
12954 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12955 (push_display_prop): xassert that we are iterating a buffer.
12956 (push_it, pop_it): Save and restore paragraph_embedding member.
12957 (handle_single_display_spec, next_overlay_string)
12958 (get_overlay_strings_1, reseat_1, reseat_to_string)
12959 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12960 correctly. Don't assume unibyte strings are not bidi-reordered.
12961 (compute_display_string_pos)
12962 (compute_display_string_end): Fix handling the case of C string.
12963 (push_it, pop_it): Save and restore from_disp_prop_p.
12964 (handle_single_display_spec, push_display_prop): Set the
12965 from_disp_prop_p flag.
12966 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12967 (pop_it): Call iterate_out_of_display_property only if we are
12968 popping after iteration over a string that came from a display
12969 property. Fix a typo in popping stretch info. Add an assertion
12970 for verifying that the iterator position is in sync with the bidi
12971 iterator.
12972 (handle_single_display_spec, get_overlay_strings_1)
12973 (push_display_prop): Fix initialization of paragraph direction for
12974 string when that of the parent object is not yet determined.
12975 (reseat_1): Call bidi_init_it to resync the bidi
12976 iterator with IT's position. (Bug#7616)
12977 (find_row_edges): If ROW->start.pos gives position
12978 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12979 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12980 Reset the from_disp_prop_p flag.
12981 (SAVE_IT, RESTORE_IT): New macros.
12982 (pos_visible_p, face_before_or_after_it_pos)
12983 (back_to_previous_visible_line_start)
12984 (move_it_in_display_line_to, move_it_in_display_line)
12985 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12986 (try_scrolling, redisplay_window, display_line): Use them when
12987 saving a temporary copy of the iterator and restoring it back.
12988 (back_to_previous_visible_line_start, reseat_1)
12989 (init_iterator): Empty the bidi cache "stack".
12990 (move_it_in_display_line_to): If iterator ended up at
12991 EOL, but we never saw any buffer positions smaller than
12992 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12993 motion in bidi-reordered lines.
12994 (move_it_in_display_line_to): Record prev_method and prev_pos
12995 immediately before the call to set_iterator_to_next. Fixes cursor
12996 motion in bidi-reordered lines with stretch glyphs and strings
12997 displayed in margins. (Bug#8133) (Bug#8867)
12998 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12999 TO_CHARPOS.
640c8776
SM
13000 (pos_visible_p): Support positions in bidi-reordered lines.
13001 Save and restore bidi cache.
0bb23927
EZ
13002
13003 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13004 (bidi_paragraph_info): Delete unused struct.
13005 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13006 (bidi_cache_start): New variable.
13007 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13008 to zero.
13009 (bidi_cache_fetch_state, bidi_cache_search)
13010 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13011 (bidi_cache_find, bidi_peek_at_next_level)
13012 (bidi_level_of_next_char, bidi_find_other_level_edge)
13013 (bidi_move_to_visually_next): Compare cache index with
13014 bidi_cache_start rather than with zero.
13015 (bidi_fetch_char): Accept new argument STRING; all callers
13016 changed. Support iteration over a string. Support strings with
13017 display properties. Support unibyte strings. Fix the type of
13018 `len' according to what STRING_CHAR_AND_LENGTH expects.
13019 (bidi_paragraph_init, bidi_resolve_explicit_1)
13020 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
13021 (bidi_level_of_next_char, bidi_move_to_visually_next):
13022 Support iteration over a string.
0bb23927
EZ
13023 (bidi_set_sor_type, bidi_resolve_explicit_1)
13024 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13025 can now be zero (for strings); special values 0 and -1 were
13026 changed to -1 and -2, respectively.
13027 (bidi_char_at_pos): New function.
13028 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13029 Call it instead of FETCH_MULTIBYTE_CHAR.
13030 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13031 initialized to valid values.
13032 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13033 values.
13034 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13035 the test for valid cached positions. Fix the logic for looking up
13036 the sentinel state in the cache. GCPRO the Lisp string we are
13037 iterating.
13038 (bidi_push_it, bidi_pop_it): New functions.
13039 (bidi_initialize): Initialize the bidi cache start stack pointer.
13040 (bidi_cache_ensure_space): New function, refactored from part of
13041 bidi_cache_iterator_state. Don't assume the required size is just
13042 one BIDI_CACHE_CHUNK away.
13043 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13044 (bidi_count_bytes, bidi_char_at_pos): New functions.
13045 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13046 always valid if bidi_cache_idx is valid.
13047 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13048 is valid if it's going to be used.
13049 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13050 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
13051 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13052 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
13053 (bidi_find_other_level_edge, bidi_cache_start_stack):
13054 All variables related to cache indices are now EMACS_INT.
c965adc5 13055
0bb23927
EZ
13056 * dispextern.h (struct bidi_string_data): New structure.
13057 (struct bidi_it): New member `string'. Make flag members be 1-bit
13058 fields, and put them last in the struct.
640c8776
SM
13059 (compute_display_string_pos, compute_display_string_end):
13060 Update prototypes.
0bb23927
EZ
13061 (bidi_push_it, bidi_pop_it): Add prototypes.
13062 (struct iterator_stack_entry): New members bidi_p,
13063 paragraph_embedding, and from_disp_prop_p.
13064 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
13065 (bidi_shelve_cache, bidi_unshelve_cache):
13066 Declare prototypes.
0bb23927
EZ
13067
13068 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13069 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13070 and vector-like objects.
13071
13072 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13073 cache around display iteration.
13074
13075 * window.c (Fwindow_end, window_scroll_pixel_based)
13076 (displayed_window_lines, Frecenter): Save and restore the bidi
13077 cache around display iteration.
13078
3bbd2265
LMI
130792011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13080
13081 * editfns.c (Fdelete_region): Clarify the use of the named
13082 parameters (bug#6788).
13083
adc47434
MR
130842011-07-14 Martin Rudalics <rudalics@gmx.at>
13085
13086 * indent.c (Fvertical_motion): Set and restore w->pointm when
13087 saving and restoring the window's buffer (Bug#9006).
13088
837c31f8
LMI
130892011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13090
13091 * editfns.c (Fstring_to_char): Clarify just what is returned
13092 (bug#6576). Text by Eli Zaretskii.
13093
ac389d0c
JB
130942011-07-13 Juanma Barranquero <lekktu@gmail.com>
13095
13096 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13097
0be0ce47
EZ
130982011-07-13 Eli Zaretskii <eliz@gnu.org>
13099
13100 * buffer.c (mmap_find): Fix a typo.
13101
cd18e7e3
JB
131022011-07-13 Johan Bockgård <bojohan@gnu.org>
13103
13104 Fix execution of x selection hooks.
13105 * xselect.c (Qx_lost_selection_functions)
13106 (Qx_sent_selection_functions): New vars.
13107 (syms_of_xselect): DEFSYM them.
13108 (x_handle_selection_request): Pass Qx_sent_selection_functions
13109 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13110 (x_handle_selection_clear,x_clear_frame_selections):
13111 Pass Qx_lost_selection_functions rather than
13112 Vx_lost_selection_functions to Frun_hook_with_args.
13113
47ea7f44
PE
131142011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13115
ac389d0c 13116 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
13117 The old code sometimes used this field without initializing it.
13118
47ea7f44
PE
13119 * alloc.c (gc_sweep): Don't read past end of array.
13120 In theory, the old code could also have corrupted Emacs internals,
13121 though it'd be very unlikely.
13122
bc985c87
AS
131232011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13124
13125 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 13126 argument. (Bug#4026)
bc985c87 13127
0cf34688
LMI
131282011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13129
b3dadd76
LMI
13130 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13131 key" (bug#4257).
13132
0cf34688
LMI
13133 * window.c (Fset_window_start): Doc fix (bug#4199).
13134 (Fset_window_hscroll): Ditto.
13135
270768cd
PE
131362011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13137
077e3dda 13138 Fix minor new problems caught by GCC 4.6.1.
270768cd 13139 * term.c (init_tty): Remove unused local.
490011a6 13140 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 13141 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 13142 not used otherwise.
270768cd 13143
b1f58454
CY
131442011-07-12 Chong Yidong <cyd@stupidchicken.com>
13145
13146 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13147
22b9578d
LMI
131482011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13149
6e70ab07
LMI
13150 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13151 are the mini-buffer and the echo area (bug#3320).
13152
22b9578d
LMI
13153 * term.c (init_tty): Remove support for supdup, c10 and perq
13154 terminals, which are no longer supported (bug#1482).
13155
8974cc9f
JB
131562011-07-10 Johan Bockgård <bojohan@gnu.org>
13157
13158 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13159
a560d974
JD
131602011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13161
13162 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13163 for non-popups (Bug#3642).
13164
1dae0f0a
AS
131652011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13166
268c2c36 13167 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 13168 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
13169 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13170 * cm.c (losecursor): Likewise.
1dae0f0a
AS
13171 * data.c (fmod): Likewise.
13172 * dispnew.c (swap_glyphs_in_rows): Likewise.
13173 * emacs.c (memory_warning_signal): Likewise.
13174 * floatfns.c (float_error): Likewise.
13175 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13176 (otf_open, font_otf_capability, generate_otf_features)
13177 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13178 Likewise.
13179 * image.c (pbm_read_file): Likewise.
13180 * indent.c (string_display_width): Likewise.
13181 * intervals.c (check_for_interval, search_for_interval)
13182 (inc_interval_count, count_intervals, root_interval)
13183 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13184 * lread.c (defalias): Likewise.
268c2c36 13185 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
13186 * regex.c (set_image_of_range_1, set_image_of_range)
13187 (regex_grow_registers): Likewise.
13188 * sysdep.c (strerror): Likewise.
13189 * termcap.c (valid_filename_p, tprint, main): Likewise.
13190 * tparam.c (main): Likewise.
13191 * unexhp9k800.c (run_time_remap, save_data_space)
13192 (update_file_ptrs, read_header, write_header, calculate_checksum)
13193 (copy_file, copy_rest, display_header): Likewise.
13194 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13195 Likewise.
13196 * xdisp.c (check_it): Likewise.
13197 * xfaces.c (register_color, unregister_color, unregister_colors):
13198 Likewise.
13199 * xfns.c (print_fontset_result): Likewise.
13200 * xrdb.c (member, fatal, main): Likewise.
13201
99033785
PE
132022011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13203
13204 Fix minor problems found by static checking (Bug#9031).
13205 * chartab.c (char_table_set_range, map_sub_char_table):
13206 Remove unused locals.
13207 (uniprop_table): Now static.
13208 * composite.c (_work_char): Remove unused static var.
13209
9cb2ac56
JB
132102011-07-09 Juanma Barranquero <lekktu@gmail.com>
13211
13212 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13213
f25661f0
JD
132142011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13215
13216 * gtkutil.c (qttip_cb): Remove code without function.
13217
8278c4fe
EZ
132182011-07-09 Eli Zaretskii <eliz@gnu.org>
13219
13220 * w32.c (pthread_sigmask): New stub.
13221
1692ae2d 132222011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 13223
8a6ebd58 13224 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
13225 sigprocmask is portable only for single-threaded applications, and
13226 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
13227 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13228 (LIBES): Use it.
13229 * callproc.c (Fcall_process):
13230 * process.c (create_process):
13231 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13232 Use pthread_sigmask, not sigprocmask.
123403e4 13233
1b854618
JD
132342011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13235
13236 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13237 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13238 wrong (Bug#8591).
13239
3fe4b549
JD
132402011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13241
0ce7e563
JD
13242 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13243 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13244 (xg_hide_tooltip): Fix comment.
13245
3fe4b549
JD
13246 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13247 in registerServicesMenuSendTypes.
13248 (validRequestorForSendType): Don't check ns_return_types.
13249
13250 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13251 ns_return_type.
13252
5df75e47
JR
132532011-07-08 Jason Rumney <jasonr@gnu.org>
13254
22610910
JR
13255 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13256 SH_SHOW for hidden windows (Bug#5482).
13257
5df75e47
JR
13258 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13259 frame struct members of non-existent frames (Bug#6284).
13260
699c10bd
JD
132612011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13262
4393663b
JD
13263 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13264 variable firstTime not needed on OSX >= 10.6.
13265 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13266 >= 10.5. Use setKnobProportion, setDoubleValue.
13267
13268 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13269 (MAC_OS_X_VERSION_10_5): Define if not defined.
13270 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13271 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13272 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13273
13274 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 13275 cString and lossyCString on OSX >= 10.4.
4393663b 13276
58179cce 13277 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
13278 sizeToFit on OSX >= 10.2.
13279
13280 * nsimage.m (allocInitFromFile): Don't use deprecated method
13281 bestRepresentationForDevice on OSX >= 10.6.
13282
13283 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13284 to avoid warning.
13285
13286 * emacs.c: Declare unexec_init_emacs_zone.
13287
a63e0781
JD
13288 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13289
699c10bd
JD
13290 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13291
13292 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13293 on svcsMenu (Bug#8842).
13294
13295 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13296 ns_return_types.
13297 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13298
13299 * nsterm.m (QUTF8_STRING): Declare.
13300 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13301 (validRequestorForSendType): Return type is (id).
13302 Change indexOfObjectIdenticalTo to indexOfObject.
13303 Check if we have local selection before returning self (Bug#8842).
13304 (writeSelectionToPasteboard): Put local selection into paste board
13305 if we have a local selection (Bug#8842).
13306 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13307
13308 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13309 (ns_get_local_selection): Declare.
13310
54e10184
LMI
133112011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13312
9888ff71
LMI
13313 * keymap.c (describe_map_tree): Don't insert a double newline at
13314 the end of the buffer (bug#1169) and return whether we inserted
13315 something.
13316
54e10184
LMI
13317 * callint.c (Fcall_interactively): Change "reading args" to
13318 "providing args" to try to clarify what it does (bug#1010).
13319
15fa4783
KH
133202011-07-07 Kenichi Handa <handa@m17n.org>
13321
13322 * composite.c (composition_compute_stop_pos): Ignore a static
13323 composition starting before CHARPOS (Bug#8915).
13324
13325 * xdisp.c (handle_composition_prop): Likewise.
13326
a8815b00
EZ
133272011-07-07 Eli Zaretskii <eliz@gnu.org>
13328
13329 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13330 (Bug#9015)
13331
ef7b981d 133322011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
13333
13334 * character.h (unicode_category_t): New enum type.
13335
13336 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13337 (Qchar_code_property_table): New variable.
13338 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13339 (UNIPROP_COMPRESSED_FORM_P): New macros.
13340 (char_table_ascii): Uncompress the compressed values.
13341 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13342 Uncompress the compressed values.
ac389d0c 13343 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
13344 (char_table_ref_and_range): Uncompress the compressed values.
13345 (sub_char_table_set): New arg is_uniprop. Callers changed.
13346 Uncompress the compressed values.
13347 (sub_char_table_set_range): Args changed. Callers changed.
13348 (char_table_set_range): Adjuted for the above change.
13349 (map_sub_char_table): Delete args default_val and parent. Add arg
13350 top. Give decoded values to a Lisp function.
640c8776 13351 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
13352 values to a Lisp function. Gcpro more variables.
13353 (uniprop_table_uncompress)
13354 (uniprop_decode_value_run_length): New functions.
13355 (uniprop_decoder, uniprop_decoder_count): New variables.
13356 (uniprop_get_decoder, uniprop_encode_value_character)
13357 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13358 New functions.
13359 (uniprop_encoder, uniprop_encoder_count): New variables.
13360 (uniprop_get_encoder, uniprop_table)
13361 (Funicode_property_table_internal, Fget_unicode_property_internal)
13362 (Fput_unicode_property_internal): New functions.
13363 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13364 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 13365 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
13366 char-code-property-alist.
13367
640c8776 13368 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
13369 Vunicode_category_table.
13370
640c8776 13371 * font.c (font_range): Adjust for the change of
c805dec0
KH
13372 Vunicode_category_table.
13373
76b397fb
DN
133742011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13375
13376 * m/iris4d.h: Remove file, move contents ...
13377 * s/irix6-5.h: ... here.
13378
22b4128e
PE
133792011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13380
13381 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
13382 * alloc.c (mark_buffer):
13383 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13384 (clone_per_buffer_values): Don't assume that
22b4128e
PE
13385 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13386 This isn't true in general, and it's particularly not true
13387 if Emacs is configured with --with-wide-int.
13388 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13389 New macros, used in the buffer.c change.
13390
869795d6
JD
133912011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13392
13393 * xsettings.c: Use both GConf and GSettings if both are available.
13394 (store_config_changed_event): Add comment.
13395 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13396 (store_tool_bar_style_changed): New functions.
5e617bc2 13397 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
13398 (struct xsettings): Move font inside HAVE_XFT.
13399 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 13400 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 13401 Move inside HAVE_XFT.
640c8776 13402 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
13403 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13404 also.
13405 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 13406 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 13407 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
13408 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13409 (parse_settings): Move check for font inside HAVE_XFT.
13410 (read_settings, apply_xft_settings): Add comment.
13411 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13412 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13413 call store_font_name_changed.
13414 (xft_settings_event): Add comment.
13415 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13416 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13417 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13418 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13419 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
13420 (xsettings_get_system_font, xsettings_get_system_normal_font):
13421 Add comment.
869795d6 13422
d8ed26bd
PE
134232011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13424
13425 Random fixes. E.g., (random) never returned negative values.
13426 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13427 subseconds part to the entropy, as that's a bit more random.
13428 Prefer signed to unsigned, since the signedness doesn't matter and
13429 in general we prefer signed. When given a limit, use a
13430 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13431 latter isn't right if USE_2_TAGS_FOR_INTS.
13432 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13433 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13434
cabf1cac
SM
134352011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13436
13437 * textprop.c (text_property_stickiness):
13438 Obey Vtext_property_default_nonsticky.
13439 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13440 * w32fns.c (syms_of_w32fns):
13441 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13442
6e9b2be9
PE
134432011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13444
13445 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13446 This is more efficient than Ffile_directory_p and avoids a minor race.
13447
90186c68
LMI
134482011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13449
7c301272
LMI
13450 * buffer.c (Foverlay_put): Say what the return value is
13451 (bug#7835).
13452
c4f2d8d4
LMI
13453 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13454 is a directory before asking whether to use the file name
13455 (bug#7564).
ad637907
LMI
13456 (barf_or_query_if_file_exists): Make the "File is a directory"
13457 error be more correct.
c4f2d8d4 13458
90186c68
LMI
13459 * fns.c (Frequire): Remove the mention of the .gz files, since
13460 that's installation-specific, but keep the mention of
13461 `get-load-suffixes'.
13462
da64016e
PE
134632011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13464
13465 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13466 Report string overflow if the output is too long.
13467
7d47b580
JB
134682011-07-04 Juanma Barranquero <lekktu@gmail.com>
13469
a555cb87
JB
13470 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13471 (syms_of_gnutls): Remove duplicate DEFSYM for
13472 Qgnutls_bootprop_verify_hostname_error, an error for
13473 Qgnutls_bootprop_verify_error (which is no longer used).
13474
7d47b580
JB
13475 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13476 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13477 Also (re)move comments that are misplaced or no longer relevant.
13478
1e49bfab
LMI
134792011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13480
13481 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13482
1485f4c0
CY
134832011-07-03 Chong Yidong <cyd@stupidchicken.com>
13484
13485 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13486 and background color parameters if they have been changed.
13487
a9ab721e
LMI
134882011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13489
13490 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13491
cf7cff57
PE
134922011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13493
2e13213d
PE
13494 * xsettings.c (SYSTEM_FONT): Define only when used.
13495 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13496
cf7cff57
PE
13497 * keymap.c (access_keymap_1): Now static.
13498
7a8e04f7
CY
134992011-07-02 Chong Yidong <cyd@stupidchicken.com>
13500
13501 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13502 leave any prefix arg for the up event (Bug#1586).
13503
61352f62
LMI
135042011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13505
69bb1ef7
LMI
13506 * lread.c (syms_of_lread): Mention single symbols defined by
13507 `defvar' or `defconst' (bug#7154).
13508
61352f62 13509 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 13510 (Frequire): Mention get-load-suffixes.
61352f62 13511
28545e04
MR
135122011-07-02 Martin Rudalics <rudalics@gmx.at>
13513
13514 * window.h (window): Remove clone_number slot.
13515 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13516 Remove.
13517 (make_parent_window, make_window, saved_window)
13518 (Fset_window_configuration, save_window_save): Don't deal with
13519 clone numbers.
13520 * buffer.c (Qclone_number): Remove declaration.
13521 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13522
3349e122
SM
135232011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13524
13525 Add multiple inheritance to keymaps.
13526 * keymap.c (Fmake_composed_keymap): New function.
13527 (Fset_keymap_parent): Simplify.
13528 (fix_submap_inheritance): Remove.
13529 (access_keymap_1): New function extracted from access_keymap to handle
13530 embedded parents and handle lists of maps.
13531 (access_keymap): Use it.
13532 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13533 (Fcopy_keymap): Handle embedded parents.
13534 (Fcommand_remapping, define_as_prefix): Simplify.
13535 (Fkey_binding): Simplify.
13536 (syms_of_keymap): Move minibuffer-local-completion-map,
13537 minibuffer-local-filename-completion-map,
13538 minibuffer-local-must-match-map, and
13539 minibuffer-local-filename-must-match-map to Elisp.
13540 (syms_of_keymap): Defsubr make-composed-keymap.
13541 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13542 (parse_menu_item): Trivial simplification.
13543
3279eb87
GM
135442011-07-01 Glenn Morris <rgm@gnu.org>
13545
13546 * Makefile.in (SETTINGS_LIBS): Fix typo.
13547
39cb9e56 135482011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
13549
13550 * coding.c (Fencode_coding_string): Record the last coding system
13551 used, as the function doc string says (bug#8738).
13552
0949d2b6
JD
135532011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13554
13555 * xsettings.c (store_monospaced_changed): Take new font as arg and
13556 check for change against current_mono_font.
13557 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13558 (emacs_settings_constructor, emacs_settings_get_property)
13559 (emacs_settings_set_property, emacs_settings_class_init)
13560 (emacs_settings_init, gsettings_obj): Remove.
13561 (something_changedCB): New function for HAVE_GSETTINGS.
13562 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13563 with value as argument.
13564 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13565 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 13566 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
13567 "changed".
13568
13569 * xgselect.c: Add defined (HAVE_GSETTINGS).
13570 (xgselect_initialize): Ditto.
13571
13572 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13573 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13574 xg_select.
13575
bbc6b304
PE
135762011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13577
13578 * eval.c (struct backtrace): Simplify and port the data structure.
13579 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13580 signed bit field, as this assumption is not portable and it makes
13581 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13582 "char debug_on_exit : 1" as this is not portable either; instead,
13583 use the portable "unsigned int debug_on_exit : 1". Remove unused
13584 member evalargs. Remove obsolete comments about cc bombing out.
13585
9851bfc5
JD
135862011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13587
51bb811f 13588 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
13589 Let HAVE_GSETTINGS override HAVE_GCONF.
13590 (store_monospaced_changed): New function.
13591 (EMACS_SETTINGS): A new type derived from GObject to handle
13592 GSettings notifications.
13593 (emacs_settings_constructor, emacs_settings_get_property)
13594 (emacs_settings_set_property, emacs_settings_class_init):
13595 New functions.
13596 (gsettings_client, gsettings_obj): New variables.
13597 (GSETTINGS_SCHEMA): New define.
13598 (something_changedCB): Call store_monospaced_changed.
13599 (init_gsettings): New function.
13600 (xsettings_initialize): Call init_gsettings.
13601 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13602 to NULL.
13603
640c8776 13604 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
13605 GCONF_CFLAGS/LIBS.
13606
5386012d
MR
136072011-06-29 Martin Rudalics <rudalics@gmx.at>
13608
13609 * window.c (resize_root_window, grow_mini_window)
13610 (shrink_mini_window): Rename Qresize_root_window to
13611 Qwindow_resize_root_window and Qresize_root_window_vertically to
13612 Qwindow_resize_root_window_vertically.
13613
f13e0b08
PE
136142011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13615
13616 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13617
94515237
JB
136182011-06-27 Juanma Barranquero <lekktu@gmail.com>
13619
13620 * makefile.w32-in: Redesign dependencies so they reflect more
13621 clearly which files are directly included by each source file,
13622 and not through other includes.
13623
e43b6e43
MR
136242011-06-27 Martin Rudalics <rudalics@gmx.at>
13625
13626 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13627 (sort_overlays, overlay_strings): When an overlay's clone number
13628 matches the window's clone number process the overlay even if
13629 the overlay's window property doesn't match the current window.
13630
d68443dc
MR
13631 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13632 (Fwindow_hchild): Rename to Fwindow_left_child.
13633 (Fwindow_next): Rename to Fwindow_next_sibling.
13634 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
13635 (resize_window_check): Rename to window_resize_check.
13636 (resize_window_apply): Rename to window_resize_apply.
13637 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13638 (Fdelete_other_windows_internal, resize_frame_windows)
13639 (Fsplit_window_internal, Fdelete_window_internal)
13640 (grow_mini_window, shrink_mini_window)
13641 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 13642
c7e73be5
JD
136432011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13644
13645 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13646 (emacs_fixed_set_min_size): Remove.
13647 (emacs_fixed_new): Take frame as argument.
13648
13649 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13650 (_EmacsFixedPrivate): Remove minwidth/height.
13651 Add struct frame *f.
13652 (emacs_fixed_init): Initialize priv->f.
13653 (get_parent_class, emacs_fixed_set_min_size): Remove.
13654 (emacs_fixed_new): Set priv->f to argument.
13655 (emacs_fixed_get_preferred_width)
13656 (emacs_fixed_get_preferred_height): Use min_width/height from
13657 frames size_hint to set minimum and natural (Bug#8919).
13658 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13659 and use min_width/height from frames size_hint to set
13660 min_width/height (Bug#8919).
13661
13662 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13663 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13664 Fix indentation.
c7e73be5 13665
cf99dcf8
EZ
136662011-06-26 Eli Zaretskii <eliz@gnu.org>
13667
13668 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13669 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13670 called at ZV.
13671
029529ac
CY
136722011-06-26 Chong Yidong <cyd@stupidchicken.com>
13673
13674 * process.c (wait_reading_process_output): Bypass select if
13675 waiting for a cell while ignoring keyboard input, and input is
13676 pending. Suggested by Jan Djärv (Bug#8869).
13677
7a7ef429
PE
136782011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13679
13680 Use gnulib's dup2 module instead of rolling our own.
13681 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13682
11fdef7d 136832011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13684
13685 * dispnew.c (scrolling_window): Before scrolling, turn off a
13686 mouse-highlight in the window being scrolled.
13687
cd3520a4
JB
136882011-06-24 Juanma Barranquero <lekktu@gmail.com>
13689
13690 Move DEFSYM to lisp.h and use everywhere.
13691
13692 * character.h (DEFSYM): Move declaration...
13693 * lisp.h (DEFSYM): ...here.
13694
13695 * gnutls.c:
13696 * minibuf.c:
13697 * w32menu.c:
13698 * w32proc.c:
13699 * w32select.c: Don't include character.h.
13700
13701 * alloc.c (syms_of_alloc):
13702 * buffer.c (syms_of_buffer):
13703 * bytecode.c (syms_of_bytecode):
13704 * callint.c (syms_of_callint):
13705 * casefiddle.c (syms_of_casefiddle):
13706 * casetab.c (init_casetab_once):
13707 * category.c (init_category_once, syms_of_category):
13708 * ccl.c (syms_of_ccl):
13709 * cmds.c (syms_of_cmds):
13710 * composite.c (syms_of_composite):
13711 * dbusbind.c (syms_of_dbusbind):
13712 * dired.c (syms_of_dired):
13713 * dispnew.c (syms_of_display):
13714 * doc.c (syms_of_doc):
13715 * editfns.c (syms_of_editfns):
13716 * emacs.c (syms_of_emacs):
13717 * eval.c (syms_of_eval):
13718 * fileio.c (syms_of_fileio):
13719 * fns.c (syms_of_fns):
13720 * frame.c (syms_of_frame):
13721 * fringe.c (syms_of_fringe):
13722 * insdel.c (syms_of_insdel):
13723 * keymap.c (syms_of_keymap):
13724 * lread.c (init_obarray, syms_of_lread):
13725 * macros.c (syms_of_macros):
13726 * msdos.c (syms_of_msdos):
13727 * print.c (syms_of_print):
13728 * process.c (syms_of_process):
13729 * search.c (syms_of_search):
13730 * sound.c (syms_of_sound):
13731 * syntax.c (init_syntax_once, syms_of_syntax):
13732 * terminal.c (syms_of_terminal):
13733 * textprop.c (syms_of_textprop):
13734 * undo.c (syms_of_undo):
13735 * w32.c (globals_of_w32):
13736 * window.c (syms_of_window):
13737 * xdisp.c (syms_of_xdisp):
13738 * xfaces.c (syms_of_xfaces):
13739 * xfns.c (syms_of_xfns):
13740 * xmenu.c (syms_of_xmenu):
13741 * xsettings.c (syms_of_xsettings):
13742 * xterm.c (syms_of_xterm): Use DEFSYM.
13743
4228cf16
TZ
137442011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13745
cd3520a4 13746 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13747
7fcccf1e
PE
137482011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13749
7efb4e0e
PE
13750 Integer and buffer overflow fixes (Bug#8873).
13751
ff5844ad
PE
13752 * print.c (printchar, strout): Check for string overflow.
13753 (PRINTPREPARE, printchar, strout):
13754 Don't set size unless allocation succeeds.
13755
90532f02
PE
13756 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13757 for sizes. Check for string overflow more accurately.
13758 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13759
6d84508d
PE
13760 * macros.c: Integer and buffer overflow fixes.
13761 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13762 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13763 Use ptrdiff_t, not int, for sizes.
13764 Don't increment bufsize until after realloc succeeds.
13765 Check for size-calculation overflow.
13766 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13767
437b2cb4
PE
13768 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13769
8b9ac8b4
PE
13770 * lread.c: Integer overflow fixes.
13771 (read_integer): Radix is now EMACS_INT, not int,
13772 to improve quality of diagnostics for out-of-range radices.
13773 Calculate buffer size correctly for out-of-range radices.
13774 (read1): Check for integer overflow in radices, and in
13775 read-circle numbers.
82cb60d3
PE
13776 (read_escape): Avoid int overflow.
13777 (Fload, openp, read_buffer_size, read1)
13778 (substitute_object_recurse, read_vector, read_list, map_obarray):
13779 Use ptrdiff_t, not int, for sizes.
13780 (read1): Use EMACS_INT, not int, for sizes.
20270765 13781 Check for size overflow.
8b9ac8b4 13782
7fcccf1e
PE
13783 * image.c (cache_image): Check for size arithmetic overflow.
13784
bfbbd7e7
PE
13785 * lread.c: Integer overflow issues.
13786 (saved_doc_string_size, saved_doc_string_length)
13787 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13788 Now ptrdiff_t, not int.
13789 (read1): Don't assume doc string length fits in int. Check for
13790 out-of-range doc string lengths.
13791 (read_list): Don't assume file position fits in int.
39019e54 13792 (read_escape): Check for hex character overflow.
bfbbd7e7 13793
4e323265
LL
137942011-06-22 Leo Liu <sdl.web@gmail.com>
13795
13796 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13797 Move to minibuffer.el.
13798
85fece3e
PE
137992011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13800
20b84ce9 13801 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13802 The following patches are for when GLYPH_DEBUG && !XASSERT.
13803 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13804 * dispnew.c (flush_stdout):
13805 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13806 Mark as externally visible.
13807 * dispnew.c (check_window_matrix_pointers): Now static.
13808 * dispnew.c (window_to_frame_vpos):
13809 * xfns.c (unwind_create_frame):
13810 * xterm.c (x_check_font): Remove unused local.
13811 * scroll.c (CHECK_BOUNDS):
13812 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13813 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13814 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13815 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13816 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13817 Now static.
13818 (debug_method_add): Use va_list and vsprintf rather than relying
13819 on undefined behavior with wrong number of arguments.
13820 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13821 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13822 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13823 since we're not interested in debugging glyphs with old libraries.
13824 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13825 GCC 4.6.0's static checking.
13826
0766b489
PE
138272011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13828
31fd4b32
PE
13829 Integer overflow and signedness fixes (Bug#8873).
13830 A few related buffer overrun fixes, too.
13831
b79e8648
PE
13832 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13833
0766b489
PE
13834 * dispextern.h (struct face.stipple):
13835 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13836 (x_bitmap_mask, x_allocate_bitmap_record)
13837 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13838 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13839 (x_create_bitmap_from_xpm_data):
13840 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13841 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13842 (.bitmaps_last):
13843 * xfaces.c (load_pixmap):
13844 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13845 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13846 (.bitmaps_last, struct x_output.icon_bitmap):
13847 Use ptrdiff_t, not int, for bitmap indexes.
13848 (x_allocate_bitmap_record): Check for size overflow.
13849 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13850
b081724f
PE
13851 Use ptrdiff_t, not int, for overlay counts.
13852 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13853 * editfns.c (overlays_around, get_pos_property):
13854 * textprop.c (get_char_property_and_overlay):
13855 * xdisp.c (next_overlay_change, note_mouse_highlight):
13856 * xfaces.c (face_at_buffer_position):
21514da7
PE
13857 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13858 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13859 (Fnext_overlay_change, Fprevious_overlay_change)
13860 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13861 Use ptrdiff_t, not int, for sizes.
21514da7 13862 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13863
3de73e5e
PE
13864 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13865
2606c57b
PE
13866 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13867 (x_session_initialize): Do not assume string length fits in int.
13868
aaafe47a
PE
13869 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13870 This is unlikely, but can occur if DPI is outlandish.
13871
2674ddc8 13872 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13873 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13874
28154962
PE
13875 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13876 * xrdb.c (magic_file_p, search_magic_path):
13877 Omit last arg SUFFIX; it was always 0. All callers changed.
13878 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13879
7de51af5
PE
13880 * xfont.c (xfont_match): Avoid need for strlen.
13881
25ed6cc3
PE
13882 * xfns.c: Don't assume strlen fits in int.
13883 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13884
4eab31dd
PE
13885 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13886 not unsigned long, as we prefer signed integers. All callers changed.
13887 Detect integer overflow in repeat count.
13888 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13889 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13890
171e2a58
PE
13891 * termcap.c: Don't assume sizes fit in int and never overflow.
13892 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13893 (gobble_line): Check for size-calculation overflow.
13894
ad39faca 13895 * minibuf.c (Fread_buffer):
6e5bb2dc 13896 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13897 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13898 Don't assume string length fits in int.
13899
52c61c22 13900 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13901 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13902
b5b8c9e5
PE
13903 * font.c: Don't assume string length fits in int.
13904 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13905 Use ptrdiff_t, not int.
ccd6111c
PE
13906 (font_intern_prop): Don't assume string length fits in int.
13907 Don't assume integer property fits in fixnum.
13908 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13909
882f0d81 13910 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13911 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13912 Reformulate so as not to need the command string.
13913 Invoke gzip -cd rather than gunzip, as it's more portable.
13914 (lock_info_type, lock_file_1, lock_file):
13915 Don't assume pid_t and time_t fit in unsigned long.
13916 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13917 (current_lock_owner): Prefer signed type for sizes.
13918 Use memcpy, not strncpy, where memcpy is what is really wanted.
13919 Don't assume (via atoi) that time_t and pid_t fit in int.
13920 Check for time_t and/or pid_t out of range, e.g., via a network share.
13921 Don't alloca where an auto var works fine.
13922
93f4cf88
PE
13923 * fileio.c: Fix some integer overflow issues.
13924 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13925 Don't assume string length fits in int.
13926 (directory_file_name): Don't assume string length fits in long.
13927 (make_temp_name): Don't assume pid fits in int, or that its print
13928 length is less than 20.
13929
f3e92b69
PE
13930 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13931
1bfdaf10
PE
13932 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13933
35016e9a
PE
13934 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13935
3d1e65a1
PE
13936 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13937 We prefer signed integers, even for size calculations.
13938
0b963a93
PE
13939 * emacs.c: Don't assume string length fits in 'int'.
13940 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13941 (main): Don't invoke strlen when not needed.
13942
573f4b54
PE
13943 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13944 (XD_DEBUG_MESSAGE): Don't waste a byte.
13945
989f33ba
PE
13946 * callproc.c (getenv_internal_1, getenv_internal)
13947 (Fgetenv_internal):
965d34eb
PE
13948 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13949
e4d29b33
PE
13950 * lread.c (invalid_syntax): Omit length argument.
13951 All uses changed. This doesn't fix a bug, but it simplifies the
13952 code away from its former Hollerith-constant appearance, and it's
13953 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 13954 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 13955
eb49b136
PE
13956 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13957 This didn't break anything, but it didn't help either.
13958 It's confusing to put a bogus integer in a place where the actual
13959 value does not matter.
9f62aeb1 13960 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 13961 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 13962
15375a22
PE
13963 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13964 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13965 implementation.
b61cc01c
PE
13966 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13967 We prefer signed types, and the value cannot exceed the EMACS_INT
13968 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
13969 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13970 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13971 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 13972
53b2623d
PE
13973 * indent.c (sane_tab_width): New function.
13974 (current_column, scan_for_column, Findent_to, position_indentation)
13975 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 13976 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 13977
51cab52b 13978 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 13979
f2ed8a70
PE
13980 * lisp.h (lint_assume): New macro.
13981 * composite.c (composition_gstring_put_cache):
13982 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13983
abe80cc6
PE
13984 * editfns.c, insdel.c:
13985 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13986
b02c740e
PE
13987 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13988
ebc96716
PE
13989 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13990
b4e50fa0 13991 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13992 Use much-faster test for byte-length change.
311d5d7c 13993 Don't assume string byte-length fits in 'int'.
a4cf38e4 13994 Check that character arg fits in 'int'.
85461888 13995 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13996
c0c1ee9f
PE
13997 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13998
a498d7f4
PE
13999 * fns.c (concat): Catch string overflow earlier.
14000 Do not rely on integer wraparound.
14001
51cab52b
PE
14002 * dispextern.h (struct it.overlay_strings_charpos)
14003 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
14004 * xdisp.c (forward_to_next_line_start)
14005 (back_to_previous_visible_line_start)
14006 (reseat_at_next_visible_line_start, next_element_from_buffer):
14007 Don't arbitrarily truncate the value of 'selective' to int.
14008
76031fad
PE
14009 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14010
5eb55db9
PE
14011 * composite.c: Don't truncate sizes to 'int'.
14012 (composition_gstring_p, composition_reseat_it)
14013 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
14014 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14015 not EMACS_UINT, for indexes.
5eb55db9 14016
0703a717
PE
14017 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14018
d6202519
PE
14019 * buffer.c: Include <verify.h>.
14020 (struct sortvec.priority, struct sortstr.priority):
8961a454 14021 Now EMACS_INT, not int.
c20998a7 14022 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
14023 (struct sortstr.size, record_overlay_string)
14024 (struct sortstrlist.size, struct sortlist.used):
14025 Don't truncate size to int.
14026 (record_overlay_string): Check for size-calculation overflow.
d6202519 14027 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 14028
d5a19415
JM
140292011-06-22 Jim Meyering <meyering@redhat.com>
14030
029529ac 14031 Don't leak an XBM-image-sized buffer
d5a19415
JM
14032 * image.c (xbm_load): Free the image buffer after using it.
14033
a9041e6c
PE
140342011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14035
14036 Port to Sun C.
14037 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14038 that Sun C diagnosed.
14039 * fns.c (secure_hash): Fix pointer signedness issue.
14040 * intervals.c (static_offset_intervals): New function.
14041 (offset_intervals): Use it.
14042
7f3f739f
LL
140432011-06-21 Leo Liu <sdl.web@gmail.com>
14044
14045 * deps.mk (fns.o):
14046 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14047 sha512.h.
14048
14049 * fns.c (secure_hash): Rename from crypto_hash_function and change
14050 the first arg to accept symbols.
5b66d427 14051 (Fsecure_hash): New primitive.
7f3f739f
LL
14052 (syms_of_fns): New symbols.
14053
76147d94
DD
140542011-06-20 Deniz Dogan <deniz@dogan.se>
14055
14056 * process.c (Fset_process_buffer): Clarify return value in
14057 docstring.
14058
7d7d0045
CY
140592011-06-18 Chong Yidong <cyd@stupidchicken.com>
14060
14061 * dispnew.c (add_window_display_history): Use BVAR.
14062
14063 * xdisp.c (debug_method_add): Use BVAR.
14064 (check_window_end, dump_glyph_matrix, dump_glyph)
14065 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14066
14067 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14068 Likewise.
14069
14070 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14071 check till after the cache is created in init_frame_faces.
14072
ff2bc410
SM
140732011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14074
14075 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14076
28177add
PE
140772011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14078
dd3482fe
PE
14079 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14080 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14081 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14082
393d71f3 14083 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
14084 * fileio.c (Finsert_file_contents):
14085 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14086 Remove the old (too-loose) buffer overflow checks.
14087 They weren't needed, since make_gap checks for buffer overflow.
14088 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14089 The old code merely checked for Emacs fixnum overflow, and relied
14090 on undefined (wraparound) behavior. The new code avoids undefined
14091 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14092
2e6813b0 14093 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
14094 Tune. Don't use wider integers than needed. Don't use alloca.
14095 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 14096
599a9e4f
PE
14097 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14098
99561444
PE
14099 * insdel.c, lisp.h (buffer_overflow): New function.
14100 (insert_from_buffer_1, replace_range, replace_range_2):
14101 * insdel.c (make_gap_larger):
14102 * editfns.c (Finsert_char):
14103 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14104
28177add
PE
14105 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14106
e69dafad
PE
141072011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14108
4baa020d 14109 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 14110
b1c46f02
PE
14111 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14112 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14113
e69dafad
PE
14114 * fileio.c: Don't assume EMACS_INT fits in off_t.
14115 (emacs_lseek): New static function.
14116 (Finsert_file_contents, Fwrite_region): Use it.
14117 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14118
566684ea
PE
14119 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14120
e6966cd6
PE
14121 * fns.c: Don't overflow int when computing a list length.
14122 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14123 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14124 truncation on 64-bit hosts. Check for QUIT every
14125 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14126 faster and is responsive enough.
14127 (Flength): Report an error instead of overflowing an integer.
14128 (Fsafe_length): Return a float if the value is not representable
14129 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 14130 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 14131 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 14132
dd0b0efb
PE
14133 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14134 (header_size, word_size): New constants.
14135 (allocate_vectorlike): Don't check size overflow here.
14136 (allocate_vector): Check it here instead, since this is the only
14137 caller of allocate_vectorlike that could cause overflow.
14138 Check that the new vector's length is representable as a fixnum.
14139
86fe5cfe
PE
14140 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14141 The previous code was bogus. For example, next_almost_prime (32)
14142 returned 39, which is undesirable as it is a multiple of 3; and
14143 next_almost_prime (24) returned 25, which is a multiple of 5 so
14144 why was the code bothering to check for multiples of 7?
14145
80e88859
PE
14146 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14147
4a2f0ad6
PE
14148 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14149
f66c7cf8
PE
14150 Variadic C functions now count arguments with ptrdiff_t.
14151 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14152 Back then I didn't know that the Emacs coding style prefers signed int.
14153 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
14154 were being counted with int, which may truncate counts on 64-bit
14155 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
14156 * lisp.h (struct Lisp_Subr.function.aMANY)
14157 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14158 Arg counts are now ptrdiff_t, not size_t.
14159 All variadic functions and their callers changed accordingly.
14160 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14161 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14162 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14163 * callint.c (Fcall_interactively): Check arg count for overflow,
14164 to avoid potential buffer overrun. Use signed char, not 'int',
14165 for 'varies' array, so that we needn't bother to check its size
14166 calculation for overflow.
14167 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14168 * eval.c (apply_lambda):
14169 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14170 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14171 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14172
a1759b76
PE
14173 * callint.c (Fcall_interactively): Don't use index var as event count.
14174
d96be9fc
PE
14175 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14176 * mem-limits.h (SIZE): Remove; no longer used.
14177
a690a978 14178 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 14179
578c21e6
PE
14180 Remove unnecessary casts.
14181 * xterm.c (x_term_init):
14182 * xfns.c (x_set_border_pixel):
14183 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14184 These aren't needed now that we assume ANSI C.
14185
96f53c6c
PE
14186 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14187 It's more likely to cause problems (due to unsigned overflow)
14188 than to cure them.
14189
83c77d31
PE
14190 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14191
ee2079f1
PE
14192 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14193
6da65536
PE
14194 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14195
7147c4a4
PE
14196 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14197
193e32d9
PE
14198 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14199
e5533da6
PE
14200 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14201
9910e595
PE
14202 GLYPH_CODE_FACE returns EMACS_INT, not int.
14203 * dispextern.h (merge_faces):
14204 * xfaces.c (merge_faces):
01103c44
PE
14205 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14206 Don't assume EMACS_INT fits in int.
9910e595 14207
2638320e
PE
14208 * character.h (CHAR_VALID_P): Remove unused parameter.
14209 * fontset.c, lisp.h, xdisp.c: All uses changed.
14210
045eb8d9
PE
14211 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14212
c1f134b5
PE
14213 * fns.c (concat): Minor tuning based on overflow analysis.
14214 This doesn't fix any bugs. Use int to hold character, instead
14215 of constantly refetching from Emacs object. Use XFASTINT, not
14216 XINT, for value known to be a character. Don't bother comparing
14217 a single byte to 0400, as it's always less.
14218
395fcb93 14219 * floatfns.c (Fexpt):
327eeec8
PE
14220 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14221
abbd3d23
PE
14222 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14223 for characters.
14224
684a03ef
PE
14225 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14226
0fed43f3
PE
14227 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14228 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14229 incorrectly succeed when S was a string, because 4294967386 was
14230 truncated before it was used.
14231
8fd02eb7
PE
14232 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14233 Otherwise, an out-of-range integer could cause undefined behavior
14234 on a 64-bit host.
14235
f8c86b69
PE
14236 * composite.c: Use int, not EMACS_INT, for characters.
14237 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14238 EMACS_INT, for values that are known to be in character range.
14239 This doesn't fix any bugs but is the usual style inside Emacs and
14240 may generate better code on 32-bit machines.
14241
34206dd2
PE
14242 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14243 This is for reasons similar to the recent CHAR_STRING fix.
14244 * charset.c (Fencode_char): Check that character arg is actually
14245 a character. Pass an int to ENCODE_CHAR.
14246 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14247 wider than 'int', as a compile-time check to prevent future regressions
14248 in this area.
14249
c5958d4c 14250 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
14251
14252 Make sure a 64-bit char is never passed to CHAR_STRING.
14253 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14254 by silently ignoring the top 32 bits, allowing some values
14255 that were far too large to be valid characters.
14256 * character.h: Include <verify.h>.
14257 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14258 arguments are no wider than unsigned, as a compile-time check
14259 to prevent future regressions in this area.
14260 * data.c (Faset):
01103c44 14261 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
14262 (Fsubst_char_in_region):
14263 * fns.c (concat):
14264 * xdisp.c (decode_mode_spec_coding):
14265 Adjust to CHAR_STRING's new requirement.
14266 * editfns.c (Finsert_char, Fsubst_char_in_region):
14267 * fns.c (concat): Check that character args are actually
14268 characters. Without this test, these functions did the wrong
14269 thing with wildly out-of-range values on 64-bit hosts.
14270
d37ca623
PE
14271 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14272 These casts should not be needed on 32-bit hosts, either.
14273 * keyboard.c (read_char):
14274 * lread.c (Fload): Remove casts to unsigned.
14275
ea204efb
PE
14276 * lisp.h (UNSIGNED_CMP): New macro.
14277 This fixes comparison bugs on 64-bit hosts.
14278 (ASCII_CHAR_P): Use it.
14279 * casefiddle.c (casify_object):
01103c44 14280 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
14281 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14282 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14283 * dispextern.h (FACE_FROM_ID):
14284 * keyboard.c (read_char): Use UNSIGNED_CMP.
14285
41cb286c
PE
14286 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14287 not to EMACS_INT, to avoid GCC warning.
14288
4a1b9832
PE
14289 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14290
55daad71
PE
14291 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14292 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14293 isn't needed on 32-bit machines.
8f95c75c 14294
01103c44
PE
14295 * buffer.c (Fgenerate_new_buffer_name):
14296 Use EMACS_INT for count, not int.
0ceccced 14297 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
14298
14299 * data.c (Qcompiled_function): Now static.
14300
c6f072e7
PE
14301 * window.c (window_body_lines): Now static.
14302
20ce5912
PE
14303 * image.c (gif_load): Rename local to avoid shadowing.
14304
9c4c5f81
PE
14305 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14306 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14307 * alloc.c (make_save_value): Integer argument is now of type
14308 ptrdiff_t, not int.
14309 (mark_object): Use ptrdiff_t, not int.
14310 * lisp.h (pD): New macro.
14311 * print.c (print_object): Use it.
14312
c0c5c8ae
PE
14313 * alloc.c: Use EMACS_INT, not int, to count objects.
14314 (total_conses, total_markers, total_symbols, total_vector_size)
14315 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
14316 (total_free_floats, total_floats, total_free_intervals)
14317 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
14318 Now EMACS_INT, not int. All uses changed.
14319 (Fgarbage_collect): Compute overall total using a double, so that
14320 integer overflow is less likely to be a problem. Check for overflow
14321 when converting back to an integer.
5a25e253
PE
14322 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14323 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14324 These were 'int' variables that could overflow on 64-bit hosts;
14325 they were never used, so remove them instead of repairing them.
211a0b2a 14326 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
14327 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14328 Previously, this ceilinged at INT_MAX, but that doesn't work on
14329 64-bit machines.
e46bb31a 14330 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 14331
c78baabf 14332 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 14333 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
14334 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14335 when a (possibly-narrower) signed value would do just as well.
14336 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 14337
c9d624c6
PE
14338 * alloc.c: Catch some string size overflows that we were missing.
14339 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14340 for convenience in STRING_BYTES_MAX.
14341 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14342 The definition here is exact; the one in lisp.h was approximate.
14343 (allocate_string_data): Check for string overflow. This catches
14344 some instances we weren't catching before. Also, it catches
14345 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14346 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14347 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 14348
c9d624c6
PE
14349 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14350 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 14351 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 14352
353032ce
PE
14353 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14354
2bccce07
PE
14355 * alloc.c (Fmake_string): Check for out-of-range init.
14356
0ac30604
SM
143572011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14358
14359 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14360
c195f2de
JD
143612011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14362
14363 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14364 xg_get_default_scrollbar_width.
14365
14366 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14367 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14368 (style_changed_cb): Call update_theme_scrollbar_width and call
14369 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14370 all frames (Bug#8505).
14371 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14372 Call gtk_window_set_resizable if HAVE_GTK3.
14373 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14374 and height if HAVE_GTK3 (Bug#8505).
14375 (scroll_bar_width_for_theme): New variable.
14376 (update_theme_scrollbar_width): New function.
14377 (xg_get_default_scrollbar_width): Move code to
14378 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14379 (xg_initialize): Call update_theme_scrollbar_width.
14380
14381 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14382
14383 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14384
e10ac9f1
MR
143852011-06-12 Martin Rudalics <rudalics@gmx.at>
14386
14387 * frame.c (make_frame): Call other_buffer_safely instead of
14388 other_buffer.
14389
14390 * window.c (temp_output_buffer_show): Call display_buffer with
14391 second argument Vtemp_buffer_show_specifiers and reset latter
14392 immediately after the call.
14393 (Vtemp_buffer_show_specifiers): New variable.
14394 (auto_window_vscroll_p, next_screen_context_lines)
14395 (Vscroll_preserve_screen_position): Remove leading asterisks from
14396 doc-strings.
14397
2d3c217e 143982011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 14399
7b7f97e8 14400 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
14401 * buffer.c (Qclone_number): Remove for now, as it's unused.
14402 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14403 (record_buffer): Remove unused local.
14404 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14405 (set_frame_buffer_list): Remove; unused.
14406 * frame.h (other_visible_frames): Remove decl.
14407 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14408 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14409 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14410 if HAVE_GPM.
14411 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14412 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14413 Define only if HAVE_GPM.
14414 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14415 (update_hints_inhibit): Remove; never set. All uses removed.
14416 * widgetprv.h (emacsFrameClassRec): Remove decl.
14417 * window.c (delete_deletable_window): Now returns void, since it
14418 wasn't returning anything.
14419 (compare_window_configurations): Remove unused locals.
14420 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14421 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
14422 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14423 the same widths as pointers. This follows up on the 2011-05-06 patch.
14424 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14425 * xterm.h: Likewise.
14426 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14427
1384b89e
JB
144282011-06-12 Juanma Barranquero <lekktu@gmail.com>
14429
14430 * makefile.w32-in: Update dependencies.
14431 (LISP_H): Add lib/intprops.h.
14432
1100a63c
CY
144332011-06-11 Chong Yidong <cyd@stupidchicken.com>
14434
14435 * image.c (gif_load): Add animation frame delay to the metadata.
14436 (syms_of_image): Use DEFSYM. New symbol `delay'.
14437
6198ccd0
MR
144382011-06-11 Martin Rudalics <rudalics@gmx.at>
14439
14440 * window.c (delete_deletable_window): Re-add.
14441 (Fset_window_configuration): Rewrite to handle dead buffers and
14442 consequently deletable windows.
14443 (window_tree, Fwindow_tree): Remove. Supply functionality in
14444 window.el.
14445 (compare_window_configurations): Simplify code.
14446
b6e3633c
AS
144472011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14448
1ab0dee5
AS
14449 * image.c (imagemagick_load_image): Fix type mismatch.
14450 (Fimagemagick_types): Likewise.
14451
b6e3633c
AS
14452 * window.h (replace_buffer_in_windows): Declare.
14453
9397e56f
MR
144542011-06-11 Martin Rudalics <rudalics@gmx.at>
14455
14456 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14457 Qclone_number. Remove external declaration of Qdelete_window.
14458 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14459 code.
640c8776
SM
14460 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14461 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
14462 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14463 buffer list implementation.
14464 (other_buffer_safely): New function.
14465 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14466 calls to replace_buffer_in_windows and
14467 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14468 if allowed.
14469 (record_buffer): Inhibit quitting and rewrite using quittable
14470 functions. Run Qbuffer_list_update_hook if allowed.
14471 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
14472 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14473 Move switch-to-buffer to window.el.
9397e56f
MR
14474 (bury-buffer): Move to window.el.
14475 (Vbuffer_list_update_hook): New variable.
14476
14477 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14478 section.
14479
14480 * window.h (resize_frame_windows): Move up in code.
14481 (Fwindow_frame): Remove EXFUN.
14482 (replace_buffer_in_all_windows): Remove prototype.
14483 (replace_buffer_in_windows_safely): Add prototype.
14484
14485 * window.c: Declare Qdelete_window static again. Move down
14486 declaration of select_count.
14487 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14488 (Fother_window): Move to window.el.
14489 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14490 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14491 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14492 window.el.
14493 (replace_buffer_in_windows): Implement by calling
14494 Qreplace_buffer_in_windows.
14495 (replace_buffer_in_all_windows): Remove with some functionality
14496 moved into replace_buffer_in_windows_safely.
14497 (replace_buffer_in_windows_safely): New function.
14498 (select_window_norecord, select_frame_norecord): Move in front
14499 of run_window_configuration_change_hook. Remove now obsolete
14500 declarations.
640c8776
SM
14501 (Fset_window_buffer): Rewrite doc-string.
14502 Call Qrecord_window_buffer.
9397e56f
MR
14503 (keys_of_window): Move binding for other-window to window.el.
14504
b50691aa
CY
145052011-06-11 Chong Yidong <cyd@stupidchicken.com>
14506
14507 * dispextern.h (struct image): Replace data member, whose int_val
14508 and ptr_val fields were not used by anything, with a single
14509 lisp_val object.
14510
14511 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14512 (gif_clear_image, gif_load, imagemagick_load_image)
14513 (gs_clear_image, gs_load): Callers changed.
14514
3f754b86
PE
145152011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14516
cca69397
PE
14517 * buffer.h: Include <time.h>, for time_t.
14518 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14519
109e28d0
PE
14520 Fix minor problems found by static checking.
14521
60737f02
PE
14522 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14523
4b66faf3
PE
14524 Make identifiers static if they are not used in other modules.
14525 * data.c (Qcompiled_function, Qframe, Qvector):
14526 * image.c (QimageMagick, Qsvg):
14527 * minibuf.c (Qmetadata):
14528 * window.c (resize_window_check, resize_root_window): Now static.
14529 * window.h (resize_window_check, resize_root_window): Remove decls.
14530
109e28d0
PE
14531 * window.c (window_deletion_count, delete_deletable_window):
14532 Remove; unused.
46a4ce9e
PE
14533 (window_body_lines): Now static.
14534 (Fdelete_other_windows_internal): Mark vars as initialized.
14535 Make sure 'resize_failed' is initialized.
14536 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14537 (resize_window_apply): Remove unused local.
14538 * window.h (delete_deletable_window): Remove decl.
14539
109e28d0 14540 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
14541 (imagemagick_load_image): Fix pointer signedness problem by changing
14542 last arg from unsigned char * to char *. All uses changed.
14543 Also, fix a local for similar reasons.
14544 Remove unused locals. Remove locals to avoid shadowing.
14545 (fn_rsvg_handle_free): Remove; unused.
14546 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 14547 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 14548
3f754b86
PE
14549 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14550
2547adb1
CY
145512011-06-10 Chong Yidong <cyd@stupidchicken.com>
14552
14553 * image.c (gif_load): Fix omitted cast error introduced by
14554 2011-06-06 change.
14555
2c8e37d4
MR
145562011-06-10 Martin Rudalics <rudalics@gmx.at>
14557
14558 * window.h (resize_proportionally, orig_total_lines)
14559 (orig_top_line): Remove from window structure.
14560 (set_window_height, set_window_width, change_window_heights)
14561 (Fdelete_window): Remove prototypes.
14562 (resize_frame_windows): Remove duplicate declaration.
14563
440a42e3
EZ
145642011-06-10 Eli Zaretskii <eliz@gnu.org>
14565
14566 * window.h (resize_frame_windows, resize_window_check)
14567 (delete_deletable_window, resize_root_window)
14568 (resize_frame_windows): Declare prototypes.
14569
14570 * window.c (resize_window_apply): Make definition be "static" to
14571 match the prototype.
14572
562dd5e9
MR
145732011-06-10 Martin Rudalics <rudalics@gmx.at>
14574
14575 * window.c: Remove declarations of Qwindow_size_fixed,
14576 window_min_size_1, window_min_size_2, window_min_size,
14577 size_window, window_fixed_size_p, enlarge_window, delete_window.
14578 Remove static from declaration of Qdelete_window, it's
14579 temporarily needed by Fbury_buffer.
14580 (replace_window): Don't assign orig_top_line and
14581 orig_total_lines.
14582 (Fdelete_window, delete_window): Remove. Window deletion is
14583 handled by window.el.
640c8776
SM
14584 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14585 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
14586 (Fdelete_other_windows): Remove. Deleting other windows is
14587 handled by window.el.
14588 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14589 handled in window.el.
14590 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14591 Window minimum sizes are handled in window.el.
14592 (shrink_windows, size_window, set_window_height)
14593 (set_window_width, change_window_heights, window_height)
14594 (window_width, CURBEG, CURSIZE, enlarge_window)
14595 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14596 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14597 handled in window.el.
14598 (make_dummy_parent): Rename to make_parent_window and give it a
14599 second argument horflag.
14600 (make_window): Don't set resize_proportionally any more.
14601 (Fsplit_window): Remove. Windows are split in window.el.
14602 (save_restore_action, save_restore_orig_size)
14603 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14604 Resize mini windows in window.el.
14605 (grow_mini_window, shrink_mini_window): Implement by calling
14606 Qresize_root_window_vertically, resize_window_check and
14607 resize_window_apply.
640c8776
SM
14608 (saved_window, Fset_window_configuration, save_window_save):
14609 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
14610 resize_proportionally.
14611 (window_min_height, window_min_width): Move to window.el.
14612 (keys_of_window): Move bindings for delete-other-windows,
14613 split-window, delete-window and enlarge-window to window.el.
14614
14615 * buffer.c: Temporarily extern Qdelete_window.
14616 (Fbury_buffer): Temporarily call Qdelete_window instead of
14617 Fdelete_window (Fbury_buffer will move to window.el soon).
14618
14619 * frame.c (set_menu_bar_lines_1): Remove code handling
14620 orig_top_line and orig_total_lines.
14621
14622 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14623 set_window_height but set heights directly.
14624 (change_frame_size_1): Use resize_frame_windows.
14625
14626 * xdisp.c (init_xdisp): Don't use set_window_height but set
14627 heights directly.
14628
640c8776
SM
14629 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14630 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
14631 run_window_configuration_change_hook.
14632
14633 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14634 instead of change_window_heights and run
14635 run_window_configuration_change_hook.
14636
1a13852e
MR
146372011-06-09 Martin Rudalics <rudalics@gmx.at>
14638
14639 * window.c (replace_window): Rename second argument REPLACEMENT to
14640 NEW. New third argument SETFLAG. Rewrite.
14641 (delete_window, make_dummy_parent): Call replace_window with
14642 third argument 1.
14643 (window_list_1): Move down in code.
14644 (run_window_configuration_change_hook): Move set_buffer part
14645 before select_frame_norecord part in order to unwind correctly.
14646 Rename count1 to count.
14647 (recombine_windows, delete_deletable_window, resize_root_window)
14648 (Fdelete_other_windows_internal)
14649 (Frun_window_configuration_change_hook, make_parent_window)
14650 (resize_window_check, resize_window_apply, Fresize_window_apply)
14651 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14652 (Fdelete_window_internal, Fresize_mini_window_internal):
14653 New functions.
1a13852e
MR
14654 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14655
f3d1777e
MR
146562011-06-08 Martin Rudalics <rudalics@gmx.at>
14657
496e208e
MR
14658 * window.h (window): Add some new members to window structure -
14659 normal_lines, normal_cols, new_total, new_normal, clone_number,
14660 splits, nest, prev_buffers, next_buffers.
14661 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14662 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14663
f3d1777e
MR
14664 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14665 Remove.
496e208e
MR
14666 (make_dummy_parent): Set new members of windows structure.
14667 (make_window): Move down in code. Handle new members of window
14668 structure.
14669 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14670 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14671 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14672 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14673 (Fset_window_next_buffers, Fset_window_clone_number):
14674 New functions.
496e208e
MR
14675 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14676 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14677 Doc-string fixes.
14678 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14679 Argument WINDOW can be now internal window too.
14680 (Fwindow_use_time): Move up in code.
14681 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14682 Rewrite doc-string.
14683 (Fset_window_configuration, saved_window)
14684 (Fcurrent_window_configuration, save_window_save): Handle new
14685 members of window structure.
b9e809c2
MR
14686 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14687 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14688 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14689 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14690 Qget_mru_window, Qresize_root_window,
14691 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14692 Qauto_buffer_name; staticpro them.
f3d1777e 14693
abde8f8c
MR
146942011-06-07 Martin Rudalics <rudalics@gmx.at>
14695
14696 * window.c (Fwindow_total_size, Fwindow_left_column)
14697 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14698 (Fwindow_list_1): New functions.
14699 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
14700 (Fwindow_width, Fscroll_left, Fscroll_right):
14701 Use window_body_cols instead of window_box_text_cols.
14702 (delete_window, Fset_window_configuration):
14703 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
14704 (delete_all_subwindows): Take a window as argument and not a
14705 structure. Rewrite.
190b47e6
MR
14706 (window_loop): Remove handling of GET_LRU_WINDOW and
14707 GET_LARGEST_WINDOW.
14708 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
14709
14710 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
14711 window_box_text_cols. delete_all_subwindows now takes a
14712 Lisp_Object as argument.
abde8f8c 14713
640c8776
SM
14714 * indent.c (compute_motion, Fcompute_motion):
14715 Use window_body_cols instead of window_box_text_cols.
abde8f8c 14716
fa8a67e6
MR
14717 * frame.c (delete_frame): Call delete_all_subwindows with root
14718 window as argument.
14719
a54e3482
DC
147202011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14721
14722 * fns.c (Fputhash): Document return value.
14723
60002bf5
CY
147242011-06-06 Chong Yidong <cyd@stupidchicken.com>
14725
14726 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14727
0c671da6 147282011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 14729
b862a52a 14730 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14731
be44ca6c
PE
14732 Check for overflow when converting integer to cons and back.
14733 * charset.c (Fdefine_charset_internal, Fdecode_char):
14734 Use cons_to_unsigned to catch overflow.
14735 (Fencode_char): Use INTEGER_TO_CONS.
14736 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14737 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14738 * data.c (long_to_cons, cons_to_long): Remove.
14739 (cons_to_unsigned, cons_to_signed): New functions.
14740 These signal an error for invalid or out-of-range values.
14741 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14742 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14743 * font.c (Ffont_variation_glyphs):
14744 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14745 * lisp.h: Include <intprops.h>.
14746 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14747 (cons_to_signed, cons_to_unsigned): New decls.
14748 (long_to_cons, cons_to_long): Remove decls.
14749 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14750 (Fprimitive_undo): Use CONS_TO_INTEGER.
14751 * xfns.c (Fx_window_property): Likewise.
14752 * xselect.c: Include <limits.h>.
14753 (x_own_selection, selection_data_to_lisp_data):
14754 Use INTEGER_TO_CONS.
14755 (x_handle_selection_request, x_handle_selection_clear)
14756 (x_get_foreign_selection, Fx_disown_selection_internal)
14757 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14758 (lisp_data_to_selection_data): Use cons_to_unsigned.
14759 (x_fill_property_data): Use cons_to_signed.
14760 Report values out of range.
14761
d1f3d2af
PE
14762 Check for buffer and string overflow more precisely.
14763 * buffer.h (BUF_BYTES_MAX): New macro.
14764 * lisp.h (STRING_BYTES_MAX): New macro.
14765 * alloc.c (Fmake_string):
14766 * character.c (string_escape_byte8):
14767 * coding.c (coding_alloc_by_realloc):
14768 * doprnt.c (doprnt):
14769 * editfns.c (Fformat):
14770 * eval.c (verror):
14771 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14772 since they may not be the same number.
14773 * editfns.c (Finsert_char):
14774 * fileio.c (Finsert_file_contents):
14775 Likewise for BUF_BYTES_MAX.
14776
dd52fcea
PE
14777 * image.c: Use ptrdiff_t, not int, for sizes.
14778 (slurp_file): Switch from int to ptrdiff_t.
14779 All uses changed.
14780 (slurp_file): Check that file size fits in both size_t (for
14781 malloc) and ptrdiff_t (for sanity and safety).
14782
7f9bbdbb
PE
14783 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14784 if b->modtime has its maximal value.
14785
dfe18f82
PE
14786 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14787
84acfcf0
PE
14788 Don't assume time_t can fit into int.
14789 * buffer.h (struct buffer.modtime): Now time_t, not int.
14790 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14791 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14792
ccd9a01a
PE
14793 Minor fixes for signed vs unsigned integers.
14794 * character.h (MAYBE_UNIFY_CHAR):
14795 * charset.c (maybe_unify_char):
14796 * keyboard.c (read_char, reorder_modifiers):
14797 XINT -> XFASTINT, since the integer must be nonnegative.
14798 * ftfont.c (ftfont_spec_pattern):
14799 * keymap.c (access_keymap, silly_event_symbol_error):
14800 XUINT -> XFASTINT, since the integer must be nonnegative.
14801 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14802 since it makes no difference and we prefer signed.
14803 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14804 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14805 nonnegative.
14806
d6d100dd
SM
148072011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14808
14809 * window.h (Fwindow_frame): Declare.
14810
2b6148e4
PE
148112011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14812
14813 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14814 (SPARE_MEMORY): Always define.
14815 (LARGE_REQUEST): Remove.
14816 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14817
f230ecc9
MR
148182011-06-06 Martin Rudalics <rudalics@gmx.at>
14819
727e958e
MR
14820 * lisp.h: Move EXFUNS for Fframe_root_window,
14821 Fframe_first_window and Fset_frame_selected_window to window.h.
14822
14823 * window.h: Move EXFUNS for Fframe_root_window,
14824 Fframe_first_window and Fset_frame_selected_window here from
14825 lisp.h.
14826
14827 * frame.c (Fwindow_frame, Fframe_first_window)
14828 (Fframe_root_window, Fframe_selected_window)
14829 (Fset_frame_selected_window): Move to window.c.
14830 (Factive_minibuffer_window): Move to minibuf.c.
14831 (Fother_visible_frames_p): New function.
14832
14833 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14834
f230ecc9
MR
14835 * window.c (decode_window, decode_any_window): Move up in code.
14836 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14837 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14838 (Fwindow_buffer): Move up and rewrite doc-string.
14839 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14840 (Fwindow_prev): New functions.
727e958e
MR
14841 (Fwindow_frame): Move here from frame.c. Accept any window as
14842 argument.
14843 (Fframe_root_window, Fframe_first_window)
14844 (Fframe_selected_window): Move here from frame.c. Accept frame
14845 or arbitrary window as argument. Update doc-strings.
14846 (Fminibuffer_window): Move up in code.
14847 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14848 (Fset_frame_selected_window): Move here from frame.c.
14849 Marginal rewrite.
727e958e
MR
14850 (Fselected_window, select_window, Fselect_window): Move up in
14851 code. Minor doc-string fixes.
f230ecc9 14852
4d09bcf6
PE
148532011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14854
14855 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14856 Do not assume that spare memory exists; that assumption is valid
14857 only if SYSTEM_MALLOC.
14858 (LARGE_REQUEST): New macro, so that the issue of large requests
14859 is separated from the issue of spare memory.
14860
810928a2
AS
148612011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14862
172418ad
AS
14863 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14864 format. (Bug#8806)
14865
43f862f7
AS
14866 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14867
810928a2
AS
14868 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14869 before statements.
14870
a059fe24
JD
148712011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14872
14873 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14874
14875 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14876
14877 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14878 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14879
989bf368
JB
148802011-06-05 Juanma Barranquero <lekktu@gmail.com>
14881
14882 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14883
4b80f674
CY
148842011-06-04 Chong Yidong <cyd@stupidchicken.com>
14885
14886 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14887 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14888 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14889 New error handlers.
4b80f674
CY
14890 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14891 Obey Vx_select_enable_clipboard_manager. Catch errors in
14892 x_clipboard_manager_save (Bug#8779).
14893 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14894 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14895
99a33b77 148962011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14897
14898 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14899
99a33b77 149002011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14901
14902 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14903 in the current matrix if keep_current_p is non-zero.
14904
8264569d
EZ
149052011-06-04 Eli Zaretskii <eliz@gnu.org>
14906
14907 * bidi.c (bidi_level_of_next_char): Fix last change.
14908
57f97249
EZ
149092011-06-03 Eli Zaretskii <eliz@gnu.org>
14910
fec2107c 14911 Support bidi reordering of text covered by display properties.
57f97249 14912
fec2107c
EZ
14913 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14914 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14915 (bidi_cache_search, bidi_cache_iterator_state)
14916 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14917 (bidi_level_of_next_char, bidi_move_to_visually_next):
14918 Support character positions inside a run of characters covered by a
fec2107c
EZ
14919 display string.
14920 (bidi_paragraph_init, bidi_resolve_explicit_1)
14921 (bidi_level_of_next_char): Call bidi_fetch_char and
14922 bidi_fetch_char_advance instead of FETCH_CHAR and
14923 FETCH_CHAR_ADVANCE.
14924 (bidi_init_it): Initialize new members.
14925 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14926 definitions.
14927 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14928 instead of using explicit *_CHAR codes.
d6d100dd
SM
14929 (bidi_resolve_explicit, bidi_resolve_weak):
14930 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
14931 bidirectional text is supported only in multibyte buffers.
14932 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14933 it to initialize the frame_window_p member of struct bidi_it.
14934 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14935 (bidi_resolve_explicit, bidi_resolve_weak)
14936 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14937 bidi_it->nchars is non-positive.
14938 (bidi_level_of_next_char): Don't try to lookup the cache for the
14939 next/previous character if nothing is cached there yet, or if we
14940 were just reseat()'ed to a new position.
c40e2fb2 14941
0e14fe90
EZ
14942 * xdisp.c (set_cursor_from_row): Set start and stop points
14943 according to the row's direction when priming the loop that looks
14944 for the glyph on which to display cursor.
14945 (single_display_spec_intangible_p): Function deleted.
14946 (display_prop_intangible_p): Reimplement to call
14947 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
14948 Accept 3 additional arguments needed by handle_display_spec.
14949 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
14950 values: lists, `(when COND...)' forms, etc.
14951 (single_display_spec_string_p): Support property values that are
14952 lists with the argument STRING its top-level element.
14953 (display_prop_string_p): Fix the condition for processing a
14954 property that is a list to be consistent with handle_display_spec.
fec2107c 14955 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
14956 last portion of handle_display_prop.
14957 (compute_display_string_pos): Accept additional argument
14958 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14959 value of a `display' property is a "replacing spec".
14960 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14961 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14962 the display property, but just return a value indicating whether
14963 the display property will replace the characters it covers.
14964 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14965 frame_window_p members of struct bidi_it.
d6d100dd
SM
14966 (compute_display_string_pos, compute_display_string_end):
14967 New functions.
fec2107c
EZ
14968 (push_it): Accept second argument POSITION, where pop_it should
14969 jump to continue iteration.
14970 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 14971
fec2107c
EZ
14972 * keyboard.c (adjust_point_for_property): Adjust the call to
14973 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
14974
14975 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
14976 (bidi_init_it): Update prototypes.
14977 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
14978 (compute_display_string_pos, compute_display_string_end):
14979 Declare prototypes.
fec2107c
EZ
14980 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14981 EMACS_INT.
fc6f18ce 14982
40087514 149832011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14984
57f53182
PE
14985 Malloc failure behavior now depends on size of allocation.
14986 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14987 * lisp.h: Change signatures accordingly.
14988 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14989 All callers changed. (Bug#8762)
14990
14991 * gnutls.c: Use Emacs's memory allocators.
14992 Without this change, the gnutls library would invoke malloc etc.
14993 directly, which causes problems on non-SYNC_INPUT hosts, and which
14994 runs afoul of improving memory_full behavior. (Bug#8761)
14995 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14996 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14997 xfree instead of the default malloc, realloc, free.
14998 (Fgnutls_boot): No need to check for memory allocation failure,
14999 since xmalloc does that for us.
15000
ac32cd99 15001 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
15002 * category.c (hash_get_category_set):
15003 * ccl.c (ccl_driver):
15004 * charset.c (Fdefine_charset_internal):
15005 * charset.h (struct charset.hash_index):
15006 * composite.c (get_composition_id, gstring_lookup_cache)
15007 (composition_gstring_put_cache):
15008 * composite.h (struct composition.hash_index):
15009 * dispextern.h (struct image.hash):
15010 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15011 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15012 (hashfn_equal, hashfn_user_defined, make_hash_table)
15013 (maybe_resize_hash_table, hash_lookup, hash_put)
15014 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15015 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15016 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15017 * image.c (make_image, search_image_cache, lookup_image)
15018 (xpm_put_color_table_h):
15019 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 15020 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 15021 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 15022 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
15023 * alloc.c (allocate_vectorlike):
15024 Check for overflow in vector size calculations.
15025 * ccl.c (ccl_driver):
15026 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
15027 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15028 need to be updated by these changes.
40087514
PE
15029 * fns.c (make_hash_table, maybe_resize_hash_table):
15030 Check for integer overflow with large hash tables.
0de4bb68
PE
15031 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15032 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15033 (SXHASH_REDUCE): New macro.
15034 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15035 Use it instead of discarding useful hash info with large hash values.
15036 (sxhash_float): New function.
15037 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15038 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
15039 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15040 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
15041 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15042 Adjust signatures to match updated version of code.
15043 (consing_since_gc): Now EMACS_INT, since a single hash table can
15044 use more than INT_MAX bytes.
15045
698d32e2
DN
150462011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15047
15048 Make it possible to build with GCC-4.6+ -O2 -flto.
15049
15050 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15051
fd6fa53f
SM
150522011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15053
15054 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15055 Call minibuffer-inactive-mode.
15056
864db017
JB
150572011-05-31 Juanma Barranquero <lekktu@gmail.com>
15058
15059 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15060 Update dependencies.
15061
2ad0baf4
DN
150622011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15063
15064 * data.c (init_data): Remove code for UTS, this system is not
15065 supported anymore.
15066
4fcc2638
DN
150672011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15068
15069 Don't force ./temacs to start in terminal mode.
15070
15071 * frame.c (make_initial_frame): Initialize faces in all cases, not
15072 only when CANNOT_DUMP is defined.
15073 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15074
c56e0fd5
DN
150752011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15076
15077 * dispnew.c (add_window_display_history): Use const for the string
15078 pointer. Remove declaration, not needed.
15079
333d54da 150802011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 15081
55d4c1b2 15082 Use 'inline', not 'INLINE'.
333d54da 15083 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
15084 * alloc.c, fontset.c (INLINE): Remove.
15085 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15086 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15087 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15088 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15089 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15090
738db178
DN
150912011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15092
15093 Make it possible to run ./temacs.
15094
15095 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15096 syms_of_callproc does the same thing. Remove test for
15097 "initialized", do it in the caller.
15098 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15099
620c53a6
SM
151002011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15101
15102 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15103 (read_minibuf): Use get_minibuffer.
15104 (syms_of_minibuf): Use DEFSYM.
15105 (Qmetadata): New var.
15106 * data.c (Qbuffer): Don't make it static.
15107 (syms_of_data): Use DEFSYM.
15108
e003a292
PE
151092011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15110
15111 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15112 (CCL_CODE_MIN): New macro.
15113
ed008a6d
PE
151142011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15115
3687c2ef
PE
15116 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15117
ed008a6d
PE
15118 * eval.c (Qdebug): Now static.
15119 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15120 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15121 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15122
d66c4c7c
CY
151232011-05-29 Chong Yidong <cyd@stupidchicken.com>
15124
15125 * image.c: Various fixes to ImageMagick code comments.
15126 (Fimagemagick_types): Doc fix.
15127
5fbc2025
PE
151282011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15129
0196f88a
PE
15130 Minor fixes prompted by GCC 4.6.0 warnings.
15131
15132 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15133
5fbc2025
PE
15134 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15135 (x_clipboard_manager_save_all): Move extern decl to ...
15136 * xterm.h: ... here, so that it can be checked for consistency.
15137
1dd3c2d9
CY
151382011-05-29 Chong Yidong <cyd@stupidchicken.com>
15139
15140 * xselect.c (x_clipboard_manager_save_frame)
15141 (x_clipboard_manager_save_all): New functions.
15142 (Fx_clipboard_manager_save): Lisp function deleted.
15143
15144 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15145 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15146
15147 * xterm.h: Update prototype.
15148
5ba6571d
WX
151492011-05-28 William Xu <william.xwl@gmail.com>
15150
15151 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15152 exiting (Bug#8239).
15153
3eaff834
JM
151542011-05-28 Jim Meyering <meyering@redhat.com>
15155
e1900994 15156 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
15157 * fns.c (to_uchar): Define.
15158 (crypto_hash_function): Use it to convert some newly-signed
15159 variables to unsigned, to avoid sign-extension bugs. For example,
15160 without this change, (md5 "truc") would evaluate to
15161 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15162 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 15163 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 15164
0f6990a7
PE
151652011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15166
15167 Integer overflow fixes.
c8a9ca5a 15168
08686060
PE
15169 * dbusbind.c: Serial number integer overflow fixes.
15170 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
15171 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15172 to hold a serial number that is too large for a fixnum.
15173 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15174 Check for serial numbers out of range. Decode any serial number
59568bf0 15175 that was so large that it became a float. (Bug#8722)
08686060 15176
2d1fc3c7
PE
15177 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15178 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15179 Use XFASTINT rather than XUINT when numbers are nonnegative.
15180 (xd_append_arg, Fdbus_method_return_internal):
15181 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15182 arguments, check that Lisp number is nonnegative, rather than
59568bf0 15183 silently wrapping negative numbers around. (Bug#8722)
30217ff0 15184 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 15185 (Bug#8722)
2d1fc3c7 15186
c8a9ca5a
PE
15187 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15188
519e1d69
PE
15189 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15190
6df6ae42 15191 ccl: Add integer overflow checks.
30569699
PE
15192 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15193 (IN_INT_RANGE): New macros.
15194 (ccl_driver): Use them to check for integer overflow when
15195 decoding a CCL program. Many of the new checks are whether XINT (x)
15196 fits in int; it doesn't always, on 64-bit hosts. The new version
15197 doesn't catch all possible integer overflows, but it's an
847044ea 15198 improvement. (Bug#8719)
30569699 15199
c11285dc
PE
15200 * alloc.c (make_event_array): Use XINT, not XUINT.
15201 There's no need for unsigned here.
15202
fdccd48e
PE
15203 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15204 This follows up to the 2011-05-06 change that substituted uintptr_t
15205 for EMACS_INT. This case wasn't caught back then.
15206
37910ab2
PE
15207 Rework Fformat to avoid integer overflow issues.
15208 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15209 now (part of C89). Include <verify.h>.
15210 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15211 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15212 (Fformat): Avoid the prepass trying to compute sizes; it was only
15213 approximate and thus did not catch overflow reliably. Instead, walk
15214 through the format just once, formatting and computing sizes as we go,
15215 checking for integer overflow at every step, and allocating a larger
15216 buffer as needed. Keep track separately whether the format is
15217 multibyte. Keep only the most-recently calculated precision, rather
15218 than them all. Record whether each argument has been converted to
15219 string. Use EMACS_INT, not int, for byte and char and arg counts.
15220 Support field widths and precisions larger than INT_MAX. Avoid
15221 sprintf's undefined behavior with conversion specifications such as %#d
15222 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15223 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15224 formatting out-of-range floating point numbers with int
9173deec 15225 formats. (Bug#8668)
37910ab2 15226
2e6578fb
PE
15227 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15228
0ae6bdee
PE
15229 * data.c: Avoid integer truncation in expressions involving floats.
15230 * data.c: Include <intprops.h>.
15231 (arith_driver): When there's an integer overflow in an expression
15232 involving floating point, convert the integers to floating point
15233 so that the resulting value does not suffer from catastrophic
15234 integer truncation. For example, on a 64-bit host (* 4
15235 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15236 Do not rely on undefined behavior after integer overflow.
15237
de883a70
PE
15238 merge count_size_as_multibyte, parse_str_to_multibyte
15239 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 15240 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
15241 Check for integer overflow.
15242 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15243 since it's now a duplicate of the other. This is more of
15244 a character than a buffer op, so better that it's in character.c.
15245 * fns.c, print.c: Adjust to above changes.
15246
2ff916cb
PE
152472011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15248
15249 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15250
f1b54466
PE
152512011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15252
fb1ac845
PE
15253 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15254 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15255 (x_clipboard_manager_save): Now static.
15256 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15257
f1b54466
PE
15258 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15259 (crypto_hash_function): Now static.
15260 Fix pointer signedness problems. Avoid unnecessary initializations.
15261
a9f737ee
CY
152622011-05-27 Chong Yidong <cyd@stupidchicken.com>
15263
15264 * termhooks.h (Vselection_alist): Make it terminal-local.
15265
15266 * terminal.c (create_terminal): Initialize it.
15267
15268 * xselect.c: Support for clipboard managers.
15269 (Vselection_alist): Move to termhooks.h as terminal-local var.
15270 (LOCAL_SELECTION): New macro.
15271 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15272 (symbol_to_x_atom): Remove gratuitous arg.
15273 (x_handle_selection_request, lisp_data_to_selection_data)
15274 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
15275 (x_own_selection, x_get_local_selection, x_convert_selection):
15276 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
15277 (some_frame_on_display): Delete unused function.
15278 (Fx_own_selection_internal, Fx_get_selection_internal)
15279 (Fx_disown_selection_internal, Fx_selection_owner_p)
15280 (Fx_selection_exists_p): New optional frame arg.
15281 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15282 (x_handle_selection_clear): Don't treat other terminals with the
15283 same keyboard specially. Use the terminal-local Vselection_alist.
15284 (x_clear_frame_selections): Use Frun_hook_with_args.
15285
15286 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15287
15288 * xterm.h: Add support for those atoms.
15289
e067f0c1
CY
152902011-05-26 Chong Yidong <cyd@stupidchicken.com>
15291
15292 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15293 (converted_selections, conversion_fail_tag): New global variables.
15294 (x_selection_request_lisp_error): Free the above.
15295 (x_get_local_selection): Remove unnecessary code.
15296 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
15297 of converted selections stored in converted_selections.
15298 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
15299 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15300 (x_convert_selection): New function.
15301 (x_handle_selection_event): Simplify.
15302 (x_get_foreign_selection): Don't ignore incoming requests while
15303 waiting for an answer; this will fail when we implement
15304 SAVE_TARGETS, and seems unnecessary anyway.
15305 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15306 (Vx_sent_selection_functions): Doc fix.
15307
0f4aebc0
LL
153082011-05-26 Leo Liu <sdl.web@gmail.com>
15309
15310 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15311
e61124cd
YM
153122011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15313
15314 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15315
15316 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15317 for fringe update if it has periodic bitmap.
ac389d0c 15318 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
15319 and fringe_bitmap_periodic_p.
15320
15321 * fringe.c (get_fringe_bitmap_data): New function.
15322 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15323 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15324 row. Mark glyph row for fringe update if periodicity changed.
15325
15326 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15327 for fringe update unless it has periodic bitmap.
15328
f16d9837
KH
153292011-05-25 Kenichi Handa <handa@m17n.org>
15330
15331 * xdisp.c (get_next_display_element): Set correct it->face_id for
15332 a static composition.
15333
e1b90ef6
LL
153342011-05-24 Leo Liu <sdl.web@gmail.com>
15335
15336 * deps.mk (fns.o):
15337 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15338
15339 * fns.c (crypto_hash_function, Fsha1): New function.
15340 (Fmd5): Use crypto_hash_function.
15341 (syms_of_fns): Add Ssha1.
15342
7400048f
PE
153432011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15344
15345 * gnutls.c: Remove unused macros.
15346 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15347 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15348 Remove macros that are defined and never used.
15349 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15350
abb71cf4
CY
153512011-05-22 Chong Yidong <cyd@stupidchicken.com>
15352
15353 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15354 (Fx_get_selection_internal): Minor cleanup.
15355 (Fx_own_selection_internal): Rename arguments for consistency with
15356 select.el.
15357
6307db39
PE
153582011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15359
15360 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15361
f3d4e0a4
CY
153622011-05-22 Chong Yidong <cyd@stupidchicken.com>
15363
15364 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15365
4d8ade89
YM
153662011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15367
15368 * dispnew.c (scrolling_window): Don't exclude the case that the
15369 last enabled row in the desired matrix touches the bottom boundary.
15370
32078c8d
GM
153712011-05-21 Glenn Morris <rgm@gnu.org>
15372
15373 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
15374 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15375 and add some more files.
32078c8d 15376
7285dc67
EZ
153772011-05-20 Eli Zaretskii <eliz@gnu.org>
15378
15379 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15380 report_file_error introduced by the change from 2011-05-07.
15381
89d1bd22
PE
153822011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15383
15384 * systime.h (Time): Define only if emacs is defined.
15385 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15386 where the include path doesn't have X11/X.h by default. See
15387 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15388
cd394be1 153892011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
15390
15391 * composite.c (find_automatic_composition): Fix previous change.
15392
b9704ad9
GM
153932011-05-20 Glenn Morris <rgm@gnu.org>
15394
15395 * lisp.mk: New file, split from Makefile.in.
15396 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15397 (shortlisp): Remove.
15398 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15399
4a720484
GM
154002011-05-19 Glenn Morris <rgm@gnu.org>
15401
15402 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15403 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15404 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15405 (lisp): Set the order to that of loadup.el.
15406 (shortlisp): Make it a copy of $lisp.
15407 (SOME_MACHINE_LISP): Remove.
15408 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15409 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15410
a28d4396
KH
154112011-05-18 Kenichi Handa <handa@m17n.org>
15412
15413 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15414 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15415 (find_automatic_composition): Mostly rewrite for efficiency.
15416
a2b1fa8e
JB
154172011-05-18 Juanma Barranquero <lekktu@gmail.com>
15418
15419 * makefile.w32-in: Update dependencies.
15420
8e1f5610
CS
154212011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15422
15423 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 15424 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 15425
7025ee00 154262011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 15427
cdfa6eab
PE
15428 Fix some integer overflow issues, such as string length overflow.
15429
06d6db33
PE
15430 * insdel.c (count_size_as_multibyte): Check for string overflow.
15431
2b4560a8
PE
15432 * character.c (lisp_string_width): Check for string overflow.
15433 Use EMACS_INT, not int, for string indexes and lengths; in
15434 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15435 the resulting string length overflows an EMACS_INT; instead,
15436 report a string overflow if no precision given. When checking for
15437 precision exhaustion, use a check that cannot possibly have
15438 integer overflow. (Bug#8675)
15439 * character.h (lisp_string_width): Adjust to new signature.
15440
cb93f9be
PE
15441 * alloc.c (string_overflow): New function.
15442 (Fmake_string): Use it. This doesn't change behavior, but saves
15443 a few bytes and will simplify future changes.
15444 * character.c (string_escape_byte8): Likewise.
15445 * lisp.h (string_overflow): New decl.
15446
1a1f3366
PE
15447 Fixups, following up to the user-interface timestamp change.
15448 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15449 for UI timestamps, instead of unsigned long.
9fbd6841
PE
15450 * msdos.c (mouse_get_pos): Likewise.
15451 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
15452 * w32gui.h (Time): Define by including "systime.h" rather than by
15453 declaring it ourselves. (Bug#8664)
15454
d4e3e4d3
PE
15455 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15456 * image.c (clear_image_cache): Likewise.
15457
f6a24d19
PE
15458 * term.c (term_mouse_position): Don't assume time_t wraparound.
15459
08dc5ae6
PE
15460 Be more systematic about user-interface timestamps.
15461 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
15462 and sometimes 'EMACS_UINT', to represent these timestamps.
15463 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
15464 This makes the code easier to follow, and makes it easier to catch
15465 integer overflow bugs such as Bug#8664.
15466 * frame.c (Fmouse_position, Fmouse_pixel_position):
15467 Use Time, not unsigned long, for user-interface timestamps.
15468 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15469 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15470 * keyboard.h (last_event_timestamp): Likewise.
15471 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15472 * menu.h (xmenu_show): Likewise.
15473 * term.c (term_mouse_position): Likewise.
15474 * termhooks.h (struct input_event.timestamp): Likewise.
15475 (struct terminal.mouse_position_hook): Likewise.
15476 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15477 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15478 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15479 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15480 what it was before.
15481 * menu.h, termhooks.h: Include "systime.h", for Time.
15482
8e55734a
PE
15483 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15484 Don't assume that the difference between two unsigned long values
15485 can fit into an integer. At this point, we know button_down_time
15486 <= event->timestamp, so the difference must be nonnegative, so
15487 there's no need to cast the result if double-click-time is
15488 nonnegative, as it should be; check that it's nonnegative, just in
15489 case. This bug is triggered when events are more than 2**31 ms
86db42d2 15490 apart (about 25 days). (Bug#8664)
8e55734a 15491
841f1b75 15492 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 15493 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 15494
3e26f69c
PE
15495 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15496 that always fit in int. Use a sentinel instead of a counter, to
15497 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
15498 * frame.h (struct frame): Use int for menu_bar_items_used
15499 instead of EMACS_INT, since it always fits in int.
3e26f69c 15500
5cc152c0
PE
15501 * menu.c (grow_menu_items): Check for int overflow.
15502
d89eb65e
PE
15503 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15504
5235bd3e
PE
15505 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15506 Before, the code was not consistent. These values cannot exceed
15507 2**31 - 1 so there's no need to make them unsigned.
15508 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15509 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15510 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15511 as modifiers.
15512 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15513
bc827e23
PE
15514 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15515 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15516 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15517 presumably because the widths might not match.
15518
78eb494e
PE
15519 * window.c (size_window): Avoid needless test at loop start.
15520
04f2d78b
CB
155212011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15522
15523 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15524
d2fc7e3d 155252011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
15526
15527 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15528
d2fc7e3d 155292011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
15530
15531 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15532 `width' to `bar_area_x' and `bar_area_width', respectively.
15533 (x_scroll_run): Take account of fringe background extension.
15534
04f2d78b
CB
15535 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15536 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
15537 `bar_area_width', respectively.
15538 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15539 background extension.
15540
79b70037
GM
155412011-05-10 Jim Meyering <meyering@redhat.com>
15542
15543 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15544
2f142cc5
JB
155452011-05-10 Juanma Barranquero <lekktu@gmail.com>
15546
15547 * image.c (Finit_image_library): Return t for built-in image types,
15548 like pbm and xbm. (Bug#8640)
15549
57679c86
AS
155502011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15551
15552 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15553
888c9e86
EZ
155542011-05-07 Eli Zaretskii <eliz@gnu.org>
15555
b0512a1d
EZ
15556 * w32console.c (Fset_screen_color): Doc fix.
15557 (Fget_screen_color): New function.
15558 (syms_of_ntterm): Defsubr it.
15559
7285dc67
EZ
15560 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15561 unlink the temporary file if Fcall_process didn't create it in the
15562 first place.
15563 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15564 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
15565 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15566 cue to call_process_cleanup not to close that handle.
15567
4d3fcc8e
BK
155682011-05-07 Ben Key <bkey76@gmail.com>
15569
15570 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15571 one of two shell specific rules, either bootstrap-temacs-CMD or
15572 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15573 to the previous implementation of the bootstrap-temacs rule.
15574 The bootstrap-temacs-CMD rule is similar to the previous
15575 implementation of the bootstrap-temacs rule except that it
15576 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15577 variable.
15578
15579 These changes, along with some changes to nt/configure.bat,
15580 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15581 earlier fix to add support for --cflags and --ldflags options
15582 that include quotes so that it works whether make uses cmd or
15583 sh as the shell.
15584
b4289b64
MA
155852011-05-06 Michael Albinus <michael.albinus@gmx.de>
15586
15587 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15588 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15589 is a constant.
15590 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15591 a string. Handle both cases.
15592 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15593 (Fdbus_register_method): Use Qinvalid_function.
15594
af4c0e28
JB
155952011-05-06 Juanma Barranquero <lekktu@gmail.com>
15596
15597 * makefile.w32-in: Update dependencies.
15598 (LISP_H): Add inttypes.h and stdin.h.
15599 (PROCESS_H): Add unistd.h.
15600
c51453d9
EZ
156012011-05-06 Eli Zaretskii <eliz@gnu.org>
15602
15603 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15604 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15605
8ff0ac3c 156062011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 15607
4c4b566b
PE
15608 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15609
aab2b9b5
PE
15610 * term.c (vfatal): Remove stray call to va_end.
15611 It's not needed and the C Standard doesn't allow it here anyway.
15612
c378da0b
PE
15613 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15614 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15615
288b08c7
PE
15616 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15617 bytes.
15618
e3601888
PE
15619 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15620
db6c0e74
PE
15621 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15622
dd5963ea
PE
15623 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15624
88c9450f
PE
15625 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15626
2f9442b8
PE
15627 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15628
c032b5f8
PE
15629 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15630 * charset.c (Fdefine_charset_internal): Don't initialize
15631 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 15632 32-bit int (Bug#8600).
a108c10b
PE
15633
15634 * lread.c (read_integer): Be more consistent with string-to-number.
15635 Use string_to_number to do the actual conversion; this avoids
15636 rounding errors and fixes some other screwups. Without this fix,
15637 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15638 (digit_to_number): Move earlier, for benefit of read_integer.
15639 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 15640 not a digit in any supported base. (Bug#8602)
a108c10b 15641
ad5f9eea
PE
15642 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15643
aec1708a
PE
15644 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15645 to match comment at start of function. This also removes a
15646 GCC warning about overflow in a 32+64-bit port.
15647
47be4ab5
PE
15648 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15649
371cac43
PE
15650 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15651 Reported by Stefan Monnier in
15652 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15653 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15654 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15655
d01a7826
PE
15656 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15657 (EMACS_UINTPTR): Likewise, with uintptr_t.
15658
7fd47d5c
PE
15659 * lisp.h: Prefer 64-bit EMACS_INT if available.
15660 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15661 on 32-bit hosts that have 64-bit int, so that they can access
15662 large files.
122b0c86
PE
15663 However, temporarily disable this change unless the temporary
15664 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15665
8727937b
PE
15666 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15667
8ac068ac
PE
15668 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15669 This removes an assumption that EMACS_INT and long are the same
15670 width as pointers. The assumption is true for Emacs porting targets
15671 now, but we want to make other targets possible.
15672 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15673 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15674 In the rest of the code, change types of integers that hold casted
15675 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15676 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15677 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15678 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15679 No need to cast type when ORing.
15680 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15681 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15682 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15683 assume EMACS_INT is the same width as char *.
15684 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15685 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15686 Remove no-longer-needed casts.
15687 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15688 (xg_tool_bar_help_callback, xg_make_tool_item):
15689 Use EMACS_INTPTR to hold an integer
15690 that will be cast to void *; this can avoid a GCC warning
15691 if EMACS_INT is not the same width as void *.
15692 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15693 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15694 (current_message_1, set_message_1):
15695 Use a local to convert to proper width without a cast.
15696 * xmenu.c (dialog_selection_callback): Likewise.
15697
ede49d71
PE
15698 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15699 Also, don't assume VALBITS / RAND_BITS is less than 5,
15700 and don't rely on undefined behavior when shifting a 1 left into
15701 the sign bit.
15702 * lisp.h (get_random): Change signature to match.
15703
2f30ecd0
PE
15704 * lread.c (hash_string): Use size_t, not int, for hash computation.
15705 Normally we prefer signed values; but hashing is special, because
15706 it's better to use unsigned division on hash table sizes so that
15707 the remainder is nonnegative. Also, size_t is the natural width
15708 for hashing into memory. The previous code used 'int', which doesn't
15709 retain enough info to hash well into very large tables.
15710 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15711
2a866e7b
PE
15712 * dbusbind.c: Don't possibly lose pointer info when converting.
15713 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15714 Use XPNTR rather than XHASH, so that the high-order bits of
15715 the pointer aren't lost when converting through void *.
15716
51639eac
PE
15717 * eval.c (Fautoload): Don't double-shift a pointer.
15718
92394119
PE
15719 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15720
dbdb9a7c
JB
157212011-05-06 Juanma Barranquero <lekktu@gmail.com>
15722
15723 * gnutls.c (DEF_GNUTLS_FN):
15724 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15725
db7a0b4f
AS
157262011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15727
15728 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15729 marker. (Bug#8610)
15730
cd394be1 157312011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15732
15733 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15734 New version that can reserve upto 2GB of heap space.
15735
f7ff1b0f 157362011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15737
15738 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15739
639c109b
TZ
157402011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15741
15742 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15743 `gnutls_certificate_set_x509_key_file'.
15744
d2127135
JB
157452011-05-05 Juanma Barranquero <lekktu@gmail.com>
15746
15747 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15748 Update dependencies.
15749
e968f4f3
JB
157502011-05-04 Juanma Barranquero <lekktu@gmail.com>
15751
15752 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15753 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15754 Remove unused parameter `fildes'.
15755 * process.c (read_process_output, send_process): Don't pass it.
15756
84d358f0
JB
157572011-05-04 Juanma Barranquero <lekktu@gmail.com>
15758
15759 Fix previous change: the library cache is defined in w32.c.
15760 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15761 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15762
0898ca10
JB
157632011-05-04 Juanma Barranquero <lekktu@gmail.com>
15764
15765 Implement dynamic loading of GnuTLS on Windows.
15766
15767 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15768 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15769 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15770 Declare.
15771
15772 * gnutls.c (Qgnutls_dll): Define.
15773 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15774 (gnutls_*): Declare function pointers.
15775 (init_gnutls_functions): New function to initialize function pointers.
15776 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15777 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15778 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15779 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15780 (emacs_gnutls_write, emacs_gnutls_read)
15781 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15782 (Fgnutls_available_p): New function.
15783 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15784 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15785 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15786
15787 * image.c: Include w32.h.
15788 (Vimage_type_cache): Delete.
15789 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15790 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15791 (w32_delayed_load): Move to w32.c.
15792
15793 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15794
15795 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15796 (w32_delayed_load): Move from image.c. When loading a library, record
15797 its filename in the :loaded-from property of the library id.
15798 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15799 Initialize and staticpro them.
15800 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15801
15802 * process.c: Include lisp.h before w32.h, not after.
15803 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15804 instead of gnutls_record_check_pending.
15805
15806 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15807
ff4de4aa
TZ
158082011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15809
15810 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15811 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15812 as passed in.
15813
abe95abb
JD
158142011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15815
15816 * xterm.c (x_set_frame_alpha): Do not set property on anything
15817 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15818
e16e55d4
JB
158192011-05-02 Juanma Barranquero <lekktu@gmail.com>
15820
15821 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15822
bafcf6a5
JB
158232011-05-02 Juanma Barranquero <lekktu@gmail.com>
15824
15825 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15826 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15827 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15828 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15829 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15830 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15831 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15832 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15833 (Qgnutls_bootprop_callbacks_verify): Make static.
15834
e7a6747f
AS
158352011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15836
19ed11ba
AS
15837 * callproc.c: Indentation fixup.
15838
e7a6747f 15839 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15840 (wait_for_termination, interruptible_wait_for_termination):
15841 Move after wait_for_termination_1.
e7a6747f 15842
1ef14cb4
LMI
158432011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15844
15845 * sysdep.c (interruptible_wait_for_termination): New function
15846 which is like wait_for_termination, but allows keyboard
15847 interruptions.
15848
15849 * callproc.c (Fcall_process): Add (:file "file") as an option for
15850 the STDOUT buffer.
15851 (Fcall_process_region): Ditto.
15852
330d880c
EZ
158532011-04-30 Eli Zaretskii <eliz@gnu.org>
15854
8db90b73
EZ
15855 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15856 rather than `XVECTOR (FOO)->size'.
15857
330d880c
EZ
15858 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15859 inttypes.h, as a gnulib replacement is used if it not available in
15860 system headers.
15861
15cbd324
EZ
158622011-04-21 Eli Zaretskii <eliz@gnu.org>
15863
15864 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15865 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15866 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15867
15868 * coding.c (coding_alloc_by_realloc): Error out if destination
15869 will grow beyond MOST_POSITIVE_FIXNUM.
15870 (decode_coding_emacs_mule): Abort if there isn't enough place in
15871 charbuf for the composition carryover bytes. Reserve an extra
15872 space for up to 2 characters produced in a loop.
15873 (decode_coding_iso_2022): Abort if there isn't enough place in
15874 charbuf for the composition carryover bytes.
15875
158762011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15877
ae940cca
EZ
15878 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15879 aborting when %lld or %lll format is passed.
15880 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15881 %llo or %llx format is passed. (Bug#8545)
15882
03ab8921
EZ
15883 * window.c (window_scroll_line_based): Use a marker instead of
15884 simple variables to record original value of point. (Bug#7952)
15885
afda1437
EZ
15886 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15887 produced by %s or %c overflows available buffer space. (Bug#8545)
15888
f76dee0c
PE
158892011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15890
15891 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15892 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15893
fdc5744d
JB
158942011-04-28 Juanma Barranquero <lekktu@gmail.com>
15895
15896 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15897
638f053a
JB
158982011-04-28 Juanma Barranquero <lekktu@gmail.com>
15899
15900 * keyboard.c (Qdelayed_warnings_hook): Define.
15901 (command_loop_1): Run `delayed-warnings-hook'
15902 if Vdelayed_warnings_list is non-nil.
15903 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15904 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15905
d178f871
EZ
159062011-04-28 Eli Zaretskii <eliz@gnu.org>
15907
15908 * doprnt.c (doprnt): Don't return value smaller than the buffer
15909 size if the message was truncated. (Bug#8545).
15910
b124fd93
JB
159112011-04-28 Juanma Barranquero <lekktu@gmail.com>
15912
15913 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15914 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15915
e810457d
PE
159162011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15917
15918 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15919
ea51cceb
JB
159202011-04-27 Juanma Barranquero <lekktu@gmail.com>
15921
15922 * makefile.w32-in: Update dependencies.
15923
94dcfacf
EZ
159242011-04-27 Eli Zaretskii <eliz@gnu.org>
15925
15926 Improve `doprnt' and its usage. (Bug#8545)
15927 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15928 `format_end'. Remove support for %l as a conversion specifier.
15929 Don't use xrealloc. Improve diagnostics when the %l size modifier
15930 is used. Update the commentary.
15931
15932 * eval.c (verror): Simplify calculation of size_t.
15933
15934 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15935 messages.
15936
f61f41d7
PE
159372011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15938
15939 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15940 change.
15941
96fb4434
PE
159422011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15943
15944 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15945 This makes this file independent of the recent pseudovector change.
15946
671875da 159472011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 15948
69e9b5a3
PE
15949 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15950
b5f869a7 15951 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 15952 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 15953 Remove unused local.
c8926152 15954 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 15955
841a1577 15956 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
15957 GCC 4.6.0 optimizes based on type-based alias analysis.
15958 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
15959 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15960 != &v->size, and therefore "v->size = 1; b->size = 2; return
15961 v->size;" must therefore return 1. This assumption is incorrect
15962 for Emacs, since it type-puns struct Lisp_Vector * with many other
15963 types. To fix this problem, this patch adds a new type struct
f904488f 15964 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
15965 and pseudovectors, and helps optimizing compilers not get fooled
15966 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15967 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
15968 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15969 the size member.
eab3844f
PE
15970 (XSETPVECTYPE): Rewrite in terms of new macro.
15971 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15972 This is a bit clearer, and further avoids the possibility of
15973 undesirable aliasing.
15974 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 15975 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
15976 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15977 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
15978 (ASIZE): Now uses header.size rather than size.
15979 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
15980 to avoid the hassle of writing XVECTOR (foo)->header.size.
15981 (struct vectorlike_header): New type.
eab3844f
PE
15982 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15983 object, to help avoid aliasing.
15984 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15985 (SUBRP): Likewise, since Lisp_Subr is a special case.
15986 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15987 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15988 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15989 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15990 changed to be "header.size" and "header.next".
15991 * buffer.h (struct buffer): Likewise.
15992 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15993 * frame.h (struct frame): Likewise.
15994 * process.h (struct Lisp_Process): Likewise.
15995 * termhooks.h (struct terminal): Likewise.
15996 * window.c (struct save_window_data, struct saved_window): Likewise.
15997 * window.h (struct window): Likewise.
15998 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15999 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16000 * buffer.c (init_buffer_once): Likewise.
16001 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16002 special case.
16003 * process.c (Fformat_network_address): Use local var for size,
16004 for brevity.
16005
0df1eac5
PE
16006 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16007
847ab9d1 16008 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
16009 * data.c (atof): Remove decl; no longer used or needed.
16010 (digit_to_number): Move to lread.c.
16011 (Fstring_to_number): Use new string_to_number function, to be
16012 consistent with how the Lisp reader treats infinities and NaNs.
16013 Do not assume that floating-point numbers represent EMACS_INT
16014 without losing information; this is not true on most 64-bit hosts.
16015 Avoid double-rounding errors, by insisting on integers when
16016 parsing non-base-10 numbers, as the documentation specifies.
16017 * lisp.h (string_to_number): New decl, replacing ...
16018 (isfloat_string): Remove.
bc0a5c13 16019 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 16020 (read1): Do not accept +. and -. as integers; this
452f4150
PE
16021 appears to have been a coding error. Similarly, do not accept
16022 strings like +-1e0 as floating point numbers. Do not report
16023 overflow for integer overflows unless the base is not 10 which
16024 means we have no simple and reliable way to continue.
16025 Break out the floating-point parsing into a new
16026 function string_to_number, so that Fstring_to_number parses
16027 floating point numbers consistently with the Lisp reader.
04f2d78b 16028 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
16029 (E_CHAR, EXP_INT): Remove, replacing with ...
16030 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16031 (string_to_number): New function, replacing isfloat_string.
16032 This function checks for valid syntax and produces the resulting
16033 Lisp float number too. Rework it so that string-to-number
bc0a5c13 16034 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
16035 so that overflow for non-base-10 numbers is reported only when
16036 there's no portable and simple way to convert to floating point.
452f4150 16037
67769ffc
PE
16038 * textprop.c (set_text_properties_1): Rewrite for clarity,
16039 and to avoid GCC warning about integer overflow.
16040
c20db43f
PE
16041 * intervals.h (struct interval): Use EMACS_INT for members
16042 where EMACS_UINT might cause problems. See
16043 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16044 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16045 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16046 All uses changed.
37aa2f85
PE
16047 (offset_intervals): Tell GCC not to worry about length overflow
16048 when negating a negative length.
c20db43f 16049
2538aa2f
PE
16050 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16051 (overrun_check_free): Likewise.
16052
f2d3008d
PE
16053 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16054 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16055 word size.
16056
ec8df744
PE
16057 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16058 (gnutls_make_error): Rename local to avoid shadowing.
16059 (gnutls_emacs_global_deinit): ifdef out; not used.
16060 (Fgnutls_boot): Use const for pointer to readonly storage.
16061 Comment out unused local. Fix pointer signedness problems.
16062
640ee02d
PE
16063 * lread.c (openp): Don't stuff size_t into an 'int'.
16064 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16065 about possible signed overflow.
16066
6048fb2a
PE
16067 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16068 (GDK_KEY_g): Don't define if already defined.
16069 (xg_prepare_tooltip): Avoid pointer signedness problem.
16070 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16071
fa3c87e1
PE
16072 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16073 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16074
2172544b
PE
16075 * xfns.c (Fx_window_property): Simplify a bit,
16076 to make a bit faster and to avoid GCC 4.6.0 warning.
16077 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16078
9b821a21
PE
16079 * fns.c (internal_equal): Don't assume size_t fits in int.
16080
3c616cfa
PE
16081 * alloc.c (compact_small_strings): Tighten assertion a little.
16082
c2982e87
PE
16083 Replace pEd with more-general pI, and fix some printf arg casts.
16084 * lisp.h (pI): New macro, generalizing old pEd macro to other
16085 conversion specifiers. For example, use "...%"pI"d..." rather
16086 than "...%"pEd"...".
16087 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 16088 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
16089 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16090 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16091 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16092 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16093 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16094 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16095 64-bit hosts.
16096 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16097 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16098 * print.c (safe_debug_print, print_object): Likewise.
16099 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16100 to int.
6f04d126
PE
16101 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16102 avoiding the 0 flag, which is not portable.
c2982e87
PE
16103 * process.c (Fmake_network_process): Use pI to avoid cast.
16104 * region-cache.c (pp_cache): Likewise.
16105 * xdisp.c (decode_mode_spec): Likewise.
16106 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16107 behavior on 64-bit hosts with printf arg.
6f04d126 16108 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
16109 (x_stop_queuing_selection_requests): Likewise.
16110 (x_get_window_property): Don't truncate byte count to an 'int'
16111 when tracing.
0b432f21 16112
5e073ec7
PE
16113 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16114 here, since it parses constructs like leading '-' and spaces,
16115 which are not wanted; and it overflows with large numbers.
16116 Instead, simply match F[0-9]+, which is what is wanted anyway.
16117
36372bf9
PE
16118 * alloc.c: Remove unportable assumptions about struct layout.
16119 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16120 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16121 (allocate_vectorlike, make_pure_vector): Use the new macros,
16122 plus offsetof, to remove unportable assumptions about struct layout.
16123 These assumptions hold on all porting targets that I know of, but
16124 they are not guaranteed, they're easy to remove, and removing them
16125 makes further changes easier.
16126
0b432f21
PE
16127 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16128 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
16129 (string_overrun_cookie): Now const. Use initializers that
16130 don't formally overflow signed char, to avoid warnings.
000098c1
PE
16131 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16132 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
16133 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16134 multiple of sizeof (EMACS_INT); it need not be, if
16135 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 16136 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 16137
895009e1
JB
161382011-04-26 Juanma Barranquero <lekktu@gmail.com>
16139
16140 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16141
6a7a1b0b
TZ
161422011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16143
16144 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 16145 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
16146 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16147
841a1577 161482011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
16149
16150 * lisp.h (Qdebug): List symbol.
895009e1 16151 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
16152 * keyboard.c (debug-on-event): New variable.
16153 (handle_user_signal): Break into debugger when debug-on-event
16154 matches the current signal symbol.
16155
f2d3ba6f
DN
161562011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16157
16158 * alloc.c (check_sblock, check_string_bytes)
16159 (check_string_free_list): Convert to standard C.
16160
42ce4c63
TZ
161612011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16162
16163 * w32.c (emacs_gnutls_push): Fix typo.
16164
825cd63c
EZ
161652011-04-25 Eli Zaretskii <eliz@gnu.org>
16166
fb11d64d
EZ
16167 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16168 "cast to pointer from integer of different size".
16169
825cd63c
EZ
16170 Improve doprnt and its use in verror. (Bug#8545)
16171 * doprnt.c (doprnt): Document the set of format control sequences
16172 supported by the function. Use SAFE_ALLOCA instead of always
16173 using `alloca'.
16174
16175 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16176 is one byte too soon. Don't use xrealloc; instead xfree and
16177 xmalloc anew.
16178
e061a11b
TZ
161792011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16180
16181 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16182 callbacks stage.
16183
16184 * gnutls.c: Renamed global_initialized to
16185 gnutls_global_initialized. Added internals for the
16186 :verify-hostname-error, :verify-error, and :verify-flags
16187 parameters of `gnutls-boot' and documented those parameters in the
16188 docstring. Start callback support.
9173deec
JB
16189 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16190 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16191 on error. Return error code.
e061a11b
TZ
16192 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16193 (emacs_gnutls_read): Likewise.
16194 (Fgnutls_boot): Return handshake error code.
16195 (emacs_gnutls_handle_error): New function.
16196 (wsaerror_to_errno): Likewise.
16197
16198 * w32.h (emacs_gnutls_pull): Add prototype.
16199 (emacs_gnutls_push): Likewise.
16200
16201 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16202 (emacs_gnutls_push): Likewise.
16203
162042011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16205
16206 * process.c (wait_reading_process_output): Check if GnuTLS
16207 buffered some data internally if no FDs are set for TLS
16208 connections.
16209
16210 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16211 (LIBS): Link to USER_LIBS.
16212 ($(BLD)/gnutls.$(0)): New target.
16213
fa6996bc
EZ
162142011-04-24 Eli Zaretskii <eliz@gnu.org>
16215
eb35682e
EZ
16216 * xdisp.c (handle_single_display_spec): Rename the
16217 display_replaced_before_p argument into display_replaced_p, to
16218 make it consistent with the commentary. Fix typos in the
16219 commentary.
16220
e2ad650c
EZ
16221 * textprop.c (syms_of_textprop): Remove dead code.
16222 (copy_text_properties): Delete obsolete commentary about an
16223 interface that was deleted long ago. Fix typos in the description
16224 of arguments.
16225
1b2de274
EZ
16226 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16227 to changes in oldXMenu/XMenu.h from 2011-04-16.
16228 <menu_help_message, prev_menu_help_message>: Constify.
16229 (IT_menu_make_room): menu->help_text is now `const char **';
16230 adjust.
16231
16232 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16233 to changes in oldXMenu/XMenu.h from 2011-04-16.
16234 (struct XMenu): Declare `help_text' `const char **'.
16235
16236 * xfaces.c <Qunspecified>: Make extern again.
16237
16238 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 16239 required by POSIX.
1b2de274 16240
762b15be
EZ
16241 * doc.c (get_doc_string): Improve the format passed to `error'.
16242
16243 * doprnt.c (doprnt): Improve commentary.
16244
16245 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16246
16247 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16248 them with etags.
16249
f1052e5d
EZ
16250 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16251 changes in globals.h immediately force recompilation.
762b15be
EZ
16252 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16253 $(CURDIR)/s/ms-w32.h.
16254 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 16255
fa6996bc
EZ
16256 * character.c (Fchar_direction): Function deleted.
16257 (syms_of_character): Don't defsubr it.
16258 <char-direction-table>: Deleted.
16259
e6c3da20
EZ
162602011-04-23 Eli Zaretskii <eliz@gnu.org>
16261
16262 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16263 * doprnt.c: Include limits.h.
16264 (SIZE_MAX): New macro.
04f2d78b
CB
16265 (doprnt): Return a size_t value. 2nd arg is now size_t.
16266 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
16267 Improve overflow protection. Support `l' modifier for integer
16268 conversions. Support %l conversion. Don't assume an EMACS_INT
16269 argument for integer conversions and for %c.
16270
16271 * lisp.h (doprnt): Restore prototype.
16272
16273 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16274 $(SRC)/character.h.
16275
16276 * Makefile.in (base_obj): Add back doprnt.o.
16277
16278 * deps.mk (doprnt.o): Add back prerequisites.
16279 (callint.o): Depend on character.h.
16280
16281 * eval.c (internal_lisp_condition_case): Include the handler
16282 representation in the error message.
16283 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16284 when breaking from the loop.
16285
16286 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16287
16288 * callint.c (Fcall_interactively): When displaying error message
16289 about invalid control letter, pass the character's codepoint, not
16290 a pointer to its multibyte form. Improve display of the character
16291 in octal and display also its hex code.
16292
16293 * character.c (char_string): Use %x to display the (unsigned)
16294 codepoint of an invalid character, to avoid displaying a bogus
16295 negative value.
16296
16297 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16298 `error', not SYMBOL_NAME itself.
16299
16300 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16301 character arguments to `error'.
16302
16303 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16304 to `error' in error message about FINAL_CHAR argument. Make sure
16305 FINAL_CHAR is a character, and use %c when it is passed as
16306 argument to `error'.
16307
4ffd0d6b 163082011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
16309
16310 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16311
16312 * w32.c: Include <time.h>.
16313 (sys_localtime): New function.
16314
4ffd0d6b 163152011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
16316
16317 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16318
4ffd0d6b 16319 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 16320
4ffd0d6b 163212011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 16322
4ffd0d6b
GM
16323 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16324 zombies (Bug#8467).
aac0c6e3 16325
04c56954
EZ
163262011-04-19 Eli Zaretskii <eliz@gnu.org>
16327
16328 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16329 gl_state.e_property when gl_state.object is Qt.
16330
16331 * insdel.c (make_gap_larger): Remove limitation of buffer size
16332 to <= INT_MAX.
16333
16a43933
CY
163342011-04-18 Chong Yidong <cyd@stupidchicken.com>
16335
16336 * xdisp.c (lookup_glyphless_char_display)
16337 (produce_glyphless_glyph): Handle cons cell entry in
16338 glyphless-char-display.
16339 (Vglyphless_char_display): Document it.
16340
16341 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16342 glyphless-char-display.
16343
4581706e
CY
163442011-04-17 Chong Yidong <cyd@stupidchicken.com>
16345
16346 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16347
16348 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16349
16350 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16351 definition for no-X builds.
16352
4887c6e2 163532011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 16354
fd35b6f9
PE
16355 Static checks with GCC 4.6.0 and non-default toolkits.
16356
5c1ccb01
PE
16357 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16358
006c5daa
PE
16359 * process.c (keyboard_bit_set): Define only if SIGIO.
16360 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16361 (send_process): Repair possible setjmp clobbering.
16362
efc736d3
PE
16363 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16364
4e2fe2e6
PE
16365 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16366
f97334a2
PE
16367 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16368
4e75f29d
PE
16369 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16370 Define only if needed.
16371
90efadd1
PE
16372 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16373 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 16374 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 16375
3c647824
PE
16376 * dispextern.h (struct redisplay_interface): Rename param
16377 to avoid shadowing.
e264f262 16378 * termhooks.h (struct terminal): Likewise.
761383f4 16379 * xterm.c (xembed_send_message): Likewise.
3c647824 16380
b58c5c4a
PE
16381 * insdel.c (make_gap_smaller): Define only if
16382 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16383
cad59032
PE
16384 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16385 it.
16386
c339dc2e
PE
16387 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16388 so that we aren't warned about unused symbols.
16389
91a3e27b
PE
16390 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16391
399c71d3 16392 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 16393
8ffc96f5
PE
16394 * xfns.c (x_real_positions): Mark locals as initialized.
16395
eef9bc79
PE
16396 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16397
098db9dd
PE
16398 * xterm.c: Fix problems found by static analysis with other toolkits.
16399 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
16400 (x_dispatch_event): Declare static if USE_GTK, and
16401 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 16402 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 16403 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
16404 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16405 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 16406
eb18f6cc
PE
16407 * xmenu.c (menu_help_callback): Pointer type fixes.
16408 Use const pointers when pointing at readonly data. Avoid pointer
16409 signedness clashes.
16410 (FALSE): Remove unused macro.
16411 (update_frame_menubar): Remove unused decl.
16412
1fe72bf8
PE
16413 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16414
60d9e1db
PE
16415 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16416 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16417 (single_menu_item): Rename local to avoid shadowing.
16418
39261c26
PE
16419 * keyboard.c (make_lispy_event): Remove unused local var.
16420
018c5e19
PE
16421 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16422 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16423
63d2b86e
PE
16424 * bitmaps: Change bitmaps from unsigned char back to the X11
16425 compatible char. Avoid the old compiler warnings about
16426 out-of-range initializers by using, for example, '\xab' rather
16427 than 0xab.
16428
aefd87e1
PE
16429 * xgselect.c (xgselect_initialize): Check vs interface
16430 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16431
bf501fb9
PE
16432 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16433
e9829fdf
PE
16434 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16435 to read-only memory.
16436
1086c095
PE
16437 * fns.c (vector): Remove; this old hack is no longer needed.
16438
2baccd04 16439 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 16440 Remove unused var.
dde42981 16441 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 16442
72391843 16443 * xrdb.c (x_load_resources): Omit unused local.
3565b346 16444
436c16df 16445 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 16446 (x_window): Rename locals to avoid shadowing.
dc5ddd85 16447 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 16448
92bb796d 16449 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 16450 (x_term_init): Remove local to avoid shadowing.
92bb796d 16451
764430a3 16452 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
16453
16454 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16455 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16456
d1dfb56c
EZ
164572011-04-16 Eli Zaretskii <eliz@gnu.org>
16458
c4354cb4
EZ
16459 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16460
d1dfb56c
EZ
16461 Fix regex.c, syntax.c and friends for buffers > 2GB.
16462 * syntax.h (struct gl_state_s): Declare character position members
16463 EMACS_INT.
16464
16465 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16466
04f2d78b
CB
16467 * textprop.c (verify_interval_modification, interval_of):
16468 Declare arguments EMACS_INT.
d1dfb56c
EZ
16469
16470 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16471 EMACS_INT.
16472
16473 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16474
16475 * indent.c (Fvertical_motion): Local variable it_start is now
16476 EMACS_INT.
16477
16478 * regex.c (re_match, re_match_2, re_match_2_internal)
16479 (bcmp_translate, regcomp, regexec, print_double_string)
16480 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16481 (re_compile_pattern, re_exec): Declare arguments and local
16482 variables `size_t' and `ssize_t' and return values `regoff_t', as
16483 appropriate.
16484 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16485 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16486 <compile_stack_type>: `size' and `avail' are now `size_t'.
16487
16488 * regex.h <regoff_t>: Use ssize_t, not int.
16489 (re_search, re_search_2, re_match, re_match_2): Arguments that
16490 specify buffer/string position and length are now ssize_t and
16491 size_t. Return type is regoff_t.
16492
613052cd
BK
164932011-04-16 Ben Key <bkey76@gmail.com>
16494
16495 * nsfont.m: Fixed bugs in ns_get_family and
16496 ns_descriptor_to_entity that were caused by using free to
16497 deallocate memory blocks that were allocated by xmalloc (via
16498 xstrdup). This caused Emacs to crash when compiled with
16499 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16500 --enable-checking=xmallocoverrun). xfree is now used to
16501 deallocate these memory blocks.
16502
4170f62f 165032011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 16504
71b41406
PE
16505 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16506
9587a89d
PE
16507 emacs_write: Accept and return EMACS_INT for sizes.
16508 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16509 et seq.
16510 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16511 Accept and return EMACS_INT.
16512 (emacs_gnutls_write): Return the number of bytes written on
16513 partial writes.
16514 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
16515 (emacs_read, emacs_write): Remove check for negative size, as the
16516 Emacs source code has been audited now.
9587a89d
PE
16517 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16518 (emacs_read, emacs_write): Use it.
273a5f82
PE
16519 * process.c (send_process): Adjust to the new signatures of
16520 emacs_write and emacs_gnutls_write. Do not attempt to store
16521 a byte offset into an 'int'; it might overflow.
9587a89d 16522 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 16523
3e047f51
PE
16524 * sound.c: Don't assume sizes fit in 'int'.
16525 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 16526 Return EMACS_INT, not int.
3e047f51 16527 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
16528 Accept EMACS_INT, not int.
16529 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
16530 record read return values.
16531
cc39a9db
BK
165322011-04-15 Ben Key <bkey76@gmail.com>
16533
c9d0ec6d
JB
16534 * keyboard.c (Qundefined): Don't declare static since it is used
16535 in nsfns.m.
16536 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16537 static since they are used in nsfont.m.
cc39a9db 16538
6c60eb9f
SM
165392011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16540
16541 * process.c (Qprocessp): Don't declare static.
16542 * lisp.h (Qprocessp): Declare again.
16543
7990b61a
JB
165442011-04-15 Juanma Barranquero <lekktu@gmail.com>
16545
16546 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16547
5d4cb038
PE
165482011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16549
8bd7b830 16550 Improve C-level modularity by making more things 'static'.
cd64ea1d 16551
e3b27b31
PE
16552 Don't publish debugger-only interfaces to other modules.
16553 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16554 (verify_bytepos, count_markers): Move decls to the only modules
16555 that need them.
16556 * region-cache.h (pp_cache): Likewise.
16557 * window.h (check_all_windows): Likewise.
16558 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16559
5d4cb038
PE
16560 * sysdep.c (croak): Now static, if
16561 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16562 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
16563
16564 * alloc.c (refill_memory_reserve): Now static if
16565 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16566 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 16567
e87b6180
PE
16568 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16569 Define only if USE_LUCID.
16570
ac64929e
PE
16571 * xrdb.c (x_customization_string, x_rm_string): Now static.
16572
6f37259d
PE
16573 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16574 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16575
1683e3ab
PE
16576 * xdisp.c (draw_row_with_mouse_face): Now static.
16577 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16578
de9c2632
PE
16579 * window.h (check_all_windows): Mark externally visible.
16580
2b96acb7
PE
16581 * window.c (window_deletion_count): Now static.
16582
16583 * undo.c: Make symbols static if they're not exported.
16584 (last_undo_buffer, last_boundary_position, pending_boundary):
16585 Now static.
16586
50436f33
PE
16587 * textprop.c (interval_insert_behind_hooks): Now static.
16588 (interval_insert_in_front_hooks): Likewise.
16589
64520e5c
PE
16590 * term.c: Make symbols static if they're not exported.
16591 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16592 (max_frame_lines, tty_set_terminal_modes):
16593 (tty_reset_terminal_modes, tty_turn_off_highlight):
16594 (get_tty_terminal): Now static.
16595 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16596 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 16597 HAVE_WINDOW_SYSTEM.
64520e5c
PE
16598 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16599 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16600
1fa53021
PE
16601 * sysdep.c: Make symbols static if they're not exported.
16602 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16603 Now static.
16604 (sigprocmask_set, full_mask): Remove; unused.
16605 (wait_debugging): Mark as visible.
16606 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16607 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16608
d4b43b22
PE
16609 * syntax.c (syntax_temp): Define only if !__GNUC__.
16610
b7c513d0
PE
16611 * sound.c (current_sound_device, current_sound): Now static.
16612
989b29ad
PE
16613 * search.c (searchbufs, searchbuf_head): Now static.
16614
13a55a78
PE
16615 * scroll.c (scroll_cost): Remove; unused.
16616 * dispextern.h (scroll_cost): Remove decl.
16617
de68a1fc
PE
16618 * region-cache.h (pp_cache): Mark as externally visible.
16619
40ccffa6
PE
16620 * process.c: Make symbols static if they're not exported.
16621 (process_tick, update_tick, create_process, chan_process):
16622 (Vprocess_alist, proc_buffered_char, datagram_access):
16623 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16624 (deactivate_process): Mark defn as static, as well as decl.
16625 * lisp.h (create_process): Remove decl.
16626 * process.h (chan_process, Vprocess_alist): Remove decls.
16627
ad64fc97
PE
16628 * print.c: Make symbols static if they're not exported.
16629 (print_depth, new_backquote_output, being_printed, print_buffer):
16630 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16631 (print_interval, print_number_index, initial_stderr_stream):
16632 Now static.
16633 * lisp.h (Fprinc): Remove decl.
16634 (debug_output_compilation_hack): Mark as externally visible.
16635
adddb265
PE
16636 * sysdep.c (croak): Move decl from here to syssignal.h.
16637 * syssignal.h (croak): Put it here, so the API can be checked when
16638 'croak' is called from dissociate_if_controlling_tty.
16639
1717ede2
PE
16640 * minibuf.c: Make symbols static if they're not exported.
16641 (minibuf_save_list, choose_minibuf_frame): Now static.
16642 * lisp.h (choose_minibuf_frame): Remove decl.
16643
fa5fb2bc
PE
16644 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16645
1e3890d1
PE
16646 * lread.c: Make symbols static if they're not exported.
16647 (read_objects, initial_obarray, oblookup_last_bucket_number):
16648 Now static.
16649 (make_symbol): Remove; unused.
16650 * lisp.h (initial_obarray, make_symbol): Remove decls.
16651
8a1414fa
PE
16652 * keyboard.c: Make symbols static if they're not exported.
16653 (single_kboard, recent_keys_index, total_keys, recent_keys):
16654 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16655 (this_single_command_key_start, echoing, last_auto_save):
16656 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16657 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16658 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16659 (Vlispy_mouse_stem, double_click_count):
16660 Now static.
16661 (force_auto_save_soon): Define only if SIGDANGER.
16662 (ignore_mouse_drag_p): Now static if
16663 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16664 (print_help): Remove; unused.
16665 (stop_character, last_timer_event): Mark as externally visible.
16666 * keyboard.h (ignore_mouse_drag_p): Declare only if
16667 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16668 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16669 * lisp.h (echoing): Remove decl.
16670 (force_auto_save_soon): Declare only if SIGDANGER.
16671 * xdisp.c (redisplay_window): Simplify code, to make it more
16672 obvious that ignore_mouse_drag_p is not accessed if !defined
16673 USE_GTK && !defined HAVE_NS.
16674
93ea6e8f
PE
16675 * intervals.c: Make symbols static if they're not exported.
16676 (merge_properties_sticky, merge_interval_right, delete_interval):
16677 Now static.
16678 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16679
77382fcc
PE
16680 * insdel.c: Make symbols static if they're not exported.
16681 However, leave prepare_to_modify_buffer alone. It's never
16682 called from outside this function, but that appears to be a bug.
16683 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16684 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16685 (adjust_after_replace_noundo): Remove; unused.
16686 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 16687 (signal_before_change): Remove decls.
77382fcc 16688
9306c32e
PE
16689 * indent.c (val_compute_motion, val_vmotion): Now static.
16690
cd44d2eb
PE
16691 * image.c: Make symbols static if they're not exported.
16692 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16693 if USE_GTK.
16694 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16695 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16696
ad9a7a06
PE
16697 * fringe.c (standard_bitmaps): Now static.
16698 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16699
81626931
PE
16700 * frame.c: Make symbols static if they're not exported.
16701 (x_report_frame_params, make_terminal_frame): Now static.
16702 (get_frame_param): Now static, unless HAVE_NS.
16703 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16704 (x_get_resource_string): Remove; not used.
16705 * frame.h (make_terminal_frame, x_report_frame_params):
16706 (x_get_resource_string); Remove decls.
16707 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16708 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16709
239f9db9
PE
16710 * font.c, fontset.c: Make symbols static if they're not exported.
16711 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16712 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16713 * font.c (font_close_object): Now static.
16714 * font.h (font_close_object): Remove.
16715 * fontset.c (FONTSET_OBJLIST): Remove.
16716 (free_realized_fontset) #if-0 the body, which does nothing.
16717 (face_suitable_for_char_p): #if-0, as it's never called.
16718 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
16719 * xfaces.c (face_at_string_position):
16720 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
16721 since 0 is always ASCII.
16722
dfcf3579
PE
16723 * fns.c (weak_hash_tables): Now static.
16724
5045092b
PE
16725 * fileio.c: Make symbols static if they're not exported.
16726 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16727 (Vwrite_region_annotation_buffers): Now static.
16728
57a96f5c
PE
16729 * eval.c: Make symbols static if they're not exported.
16730 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16731 * lisp.h (backtrace_list): Remove decl.
16732
35f08c38
PE
16733 * emacs.c: Make symbols static if they're not exported.
16734 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16735 (fatal_error_code, fatal_error_signal_hook, standard_args):
16736 Now static.
16737 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16738 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16739 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16740 * lisp.h (fatal_error_signal_hook): Remove decl.
16741 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16742
f44bd759
PE
16743 * editfns.c: Move a (normally-unused) function to its only use.
16744 * editfns.c, lisp.h (get_operating_system_release): Remove.
16745 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16746 worth the hassle of breaking this out.
16747
b532497d
PE
16748 * xterm.c: Make symbols static if they're not exported.
16749 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16750 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16751 (x_destroy_window, x_delete_display):
16752 Now static.
16753 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16754 (x_mouse_leave): Remove; unused.
16755 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16756 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16757 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16758 Remove decls.
16759 (x_mouse_leave): Declare only if WINDOWSNT.
16760 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16761 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16762 USE_X_TOOLKIT.
16763
1675728f
PE
16764 * ftxfont.c: Make symbols static if they're not exported.
16765 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16766 HAVE_FREETYPE.
16767 * font.h (ftxfont_driver): Likewise.
16768
e4cebfca
PE
16769 * xfns.c: Make symbols static if they're not exported.
16770 (x_last_font_name, x_display_info_for_name):
16771 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16772 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16773 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16774 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16775 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16776 (last_show_tip_args): Now static.
16777 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16778 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16779 (x_screen_planes): Remove; unused.
16780 * dispextern.h (x_screen_planes): Remove decl.
16781
5bf46f05
PE
16782 * dispnew.c: Make symbols static if they're not exported.
16783 * dispextern.h (redraw_garbaged_frames, scrolling):
16784 (increment_row_positions): Remove.
16785 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16786 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16787 Now static.
16788 (redraw_garbaged_frames): Remove; unused.
16789
435f4c28
PE
16790 * xfaces.c: Make symbols static if they're not exported.
16791 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16792 Remove decls.
16793 * xterm.h (defined_color): Remove decls.
16794 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16795 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16796 (menu_face_changed_default, defined_color, free_realized_face):
16797 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16798 (ascii_face_of_lisp_face): Remove; unused.
16799
8524aef3
PE
16800 * xdisp.c: Make symbols static if they're not exported.
16801 * dispextern.h (scratch_glyph_row, window_box_edges):
16802 (glyph_to_pixel_coords, set_cursor_from_row):
16803 (get_next_display_element, set_iterator_to_next):
16804 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16805 (show_mouse_face): Remove decls
16806 * frame.h (message_buf_print): Likewise.
16807 * lisp.h (pop_message, set_message, check_point_in_composition):
16808 Likewise.
16809 * xterm.h (set_vertical_scroll_bar): Likewise.
16810 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16811 (message_buf_print, scratch_glyph_row, displayed_buffer):
16812 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16813 (get_next_display_element, show_mouse_face, window_box_edges):
16814 (frame_to_window_pixel_xy, check_point_in_composition):
16815 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16816 (glyph_to_pixel_coords): Remove; unused.
16817
16390cd2
PE
16818 * dired.c (file_name_completion): Now static.
16819
16820 * dbusbind.c (xd_in_read_queued_messages): Now static.
16821
a25f4dfa
PE
16822 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16823 * data.c (circular_list_error): Remove.
16824
14a9c8df
PE
16825 * commands.h (last_point_position, last_point_position_buffer):
16826 (last_point_position_window): Remove decls.
16827 * keyboard.c: Make these variables static.
16828
04f2d78b
CB
16829 * coding.h (coding, code_convert_region, encode_coding_gap):
16830 Remove decls.
74ab6df5
PE
16831 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16832 (iso_code_class, detect_coding, code_convert_region): Now static.
16833 (encode_coding_gap): Remove; unused.
16834
38dfbee1
PE
16835 * chartab.c (chartab_chars, chartab_bits): Now static.
16836
a2cb4e63
PE
16837 * charset.h (charset_iso_8859_1): Remove decl.
16838 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16839 Now static.
16840
127198fd
PE
16841 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16842 * ccl.c (Vccl_program_table): Now static.
16843 (check_ccl_update): Remove; unused.
16844
d85b608f
PE
16845 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16846 * category.h: ... from here.
16847 * category.c (check_category_table, set_category_set): Now static.
16848
31cd66f3
PE
16849 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16850 * lisp.h: Remove these decls.
16851
c358e587
PE
16852 * buffer.c (buffer_count): Remove unused var.
16853
e78aecca
PE
16854 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16855 so that it's not optimized away.
16856 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16857 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16858 exported only to the debugger.
16859
e192d7d3 16860 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16861 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16862
92470028
PE
16863 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16864 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16865 was inaccessible from Lisp.
16866 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16867 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16868
244ed907
PE
16869 alloc.c: Import and export fewer symbols, and remove unused items.
16870 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16871 is defined.
16872 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16873 it's not optimized away by whole-program optimization.
16874 (message_enable_multibyte, free_misc): Remove.
16875 (catchlist, handlerlist, mark_backtrace):
16876 Declare only if BYTE_MARK_STACK.
16877 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16878 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16879 (message_enable_multibyte): Remove decl.
16880 (free_misc, interval_free_list, float_block, float_block_index):
16881 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16882 (cons_free_list, last_marked_index):
16883 Now static.
16884 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16885 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16886 (mark_backtrace): Define only if BYTE_MARK_STACK.
16887 * xdisp.c (message_enable_multibyte): Now static.
16888
61c2b50e 16889 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16890 This makes it easier for human readers (and static analyzers)
16891 to see whether these variables are used from other modules.
16892 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16893 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16894 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16895 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16896 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16897 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16898 * xmenu.c, xselect.c:
16899 Declare Q* vars static if they are not used in other modules.
16900 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16901 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16902 Remove decls of unexported vars.
16903 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16904
95c82688
PE
16905 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16906
16a97296
PE
16907 Make Emacs functions such as Fatom 'static' by default.
16908 This makes it easier for human readers (and static analyzers)
16909 to see whether these functions can be called from other modules.
16910 DEFUN now defines a static function. To make the function external
16911 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16912 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16913 (Finit_image_library):
16a97296
PE
16914 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16915 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16916 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16917 Remove decls, since these functions are now static.
16918 (Funintern, Fget_internal_run_time): New decls, since these functions
16919 were already external.
95c82688 16920
16a97296
PE
16921 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16922 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16923 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16924 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16925 * keyboard.c, keymap.c, lread.c:
16926 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16927 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16928 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16929 Mark functions with DEFUE instead of DEFUN,
16930 if they are used in other modules.
16931 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16932 decls for now-static functions.
16933 * buffer.h (Fdelete_overlay): Remove decl.
16934 * callproc.c (Fgetenv_internal): Mark as internal.
16935 * composite.c (Fremove_list_of_text_properties): Remove decl.
16936 (Fcomposition_get_gstring): New forward static decl.
16937 * composite.h (Fcomposite_get_gstring): Remove decl.
16938 * dired.c (Ffile_attributes): New forward static decl.
16939 * doc.c (Fdocumntation_property): New forward static decl.
16940 * eval.c (Ffetch_bytecode): New forward static decl.
16941 (Funintern): Remove extern decl; now in .h file where it belongs.
16942 * fileio.c (Fmake_symbolic_link): New forward static decl.
16943 * image.c (Finit_image_library): New forward static decl.
16944 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16945 * intervals.h (Fprevious_property_change):
16946 (Fremove_list_of_text_properties): Remove decls.
16947 * keyboard.c (Fthis_command_keys): Remove decl.
16948 (Fcommand_execute): New forward static decl.
16949 * keymap.c (Flookup_key): New forward static decl.
16950 (Fcopy_keymap): Now static.
16951 * keymap.h (Flookup_key): Remove decl.
16952 * process.c (Fget_process): New forward static decl.
16953 (Fprocess_datagram_address): Mark as internal.
16954 * syntax.c (Fsyntax_table_p): New forward static decl.
16955 (skip_chars): Remove duplicate decl.
16956 * textprop.c (Fprevious_property_change): New forward static decl.
16957 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16958 Now internal.
16959 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16960 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16961
785bbd42
PE
16962 * editfns.c (Fformat): Remove unreachable code.
16963
8b913b57
AS
169642011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16965
16966 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16967 change. (Bug#8496)
16968
a6744a35
EZ
169692011-04-13 Eli Zaretskii <eliz@gnu.org>
16970
16971 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16972 when at ZV. (Bug#8487)
16973
e7974947
AS
169742011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16975
baad03f0
AS
16976 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16977 (Bug#8437)
16978 * keyboard.c (parse_tool_bar_item): Likewise.
16979 * sound.c (sound_cleanup, alsa_close): Likewise.
16980 * termcap.c (tgetent): Likewise.
16981 * xfns.c (x_default_font_parameter): Likewise.
16982 * xsettings.c (read_and_apply_settings): Likewise.
16983
e7974947
AS
16984 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16985 (overrun_check_free): Protoize.
16986
28272684
PE
169872011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16988
16989 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16990 since callers should never pass a negative size.
16991 Change the signature to match that of plain 'read' and 'write'; see
16992 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16993 * lisp.h: Update prototypes of emacs_write and emacs_read.
16994
11997c76
EZ
169952011-04-11 Eli Zaretskii <eliz@gnu.org>
16996
16997 * xdisp.c (redisplay_window): Don't try to determine the character
16998 position of the scroll margin if the window start point w->startp
e896f03c 16999 is outside the buffer's accessible region. (Bug#8468)
11997c76 17000
8a2cbd72
EZ
170012011-04-10 Eli Zaretskii <eliz@gnu.org>
17002
17003 Fix write-region and its subroutines for buffers > 2GB.
17004 * fileio.c (a_write, e_write): Modify declaration of arguments and
17005 local variables to support buffers larger than 2GB.
17006 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17007
17008 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17009 argument, local variables, and return value.
17010
17011 * lisp.h: Update prototypes of emacs_write and emacs_read.
17012
17013 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17014
4073e537 170152011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 17016
1ebfdcb6
PE
17017 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17018
b2ded58d
PE
17019 Fix more problems found by GCC 4.6.0's static checks.
17020
7d66342c
PE
17021 * xdisp.c (vmessage): Use a better test for character truncation.
17022
bbf47d44
PE
17023 * charset.c (load_charset_map): <, not <=, for optimization,
17024 and to avoid potential problems with integer overflow.
9248994d 17025 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 17026 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 17027 * editfns.c (Fformat): Likewise.
1e69125e 17028 * syntax.c (skip_chars): Likewise.
3befa583 17029
e3019616
PE
17030 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17031 This also lets GCC 4.6.0 generate slightly better loop code.
17032
becfa255
PE
17033 * callint.c (Fcall_interactively): <, not <=, for optimization.
17034 (Fcall_interactively): Count the number of arguments produced,
17035 not the number of arguments given. This is simpler and lets GCC
17036 4.6.0 generate slightly better code.
17037
dae0cd48
PE
17038 * ftfont.c: Distingish more carefully between FcChar8 and char.
17039 The previous code passed unsigned char * to a functions like
17040 strlen and xstrcasecmp that expect char *, which does not
17041 conform to the C standard.
17042 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17043 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17044 char * when the C standard requires it.
17045
76032d70
PE
17046 * keyboard.c (read_char): Remove unused var.
17047
eb3f1cc8
PE
17048 * eval.c: Port to Windows vsnprintf (Bug#8435).
17049 Include <limits.h>.
17050 (SIZE_MAX): Define if the headers do not.
17051 (verror): Do not give up if vsnprintf returns a negative count.
17052 Instead, grow the buffer. This ports to Windows vsnprintf, which
17053 does not conform to C99. Problem reported by Eli Zaretskii.
17054 Also, simplify the allocation scheme, by avoiding the need for
17055 calling realloc, and removing the ALLOCATED variable.
17056
70476b54
PE
17057 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17058
12020a9e
PE
17059 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17060 But keep the doprint source code for now, as we might revamp it
17061 and use it again (Bug#8435).
ea6c7ae6
PE
17062 * lisp.h (doprnt): Remove.
17063 * Makefile.in (base_obj): Remove doprnt.o.
17064 * deps.mk (doprnt.o): Remove.
17065
5fdb398c
PE
17066 error: Print 32- and 64-bit integers portably (Bug#8435).
17067 Without this change, on typical 64-bit hosts error ("...%d...", N)
17068 was used to print both 32- and 64-bit integers N, which relied on
17069 undefined behavior.
61bdb816 17070 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
17071 * lisp.h (error, verror): Mark as printf-like functions.
17072 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17073 Report overflow in size calculations when allocating printf buffer.
17074 Do not truncate output string at its first null byte.
17075 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17076 Truncate the output at a character boundary, since vsnprintf does not
17077 do that.
17078 * charset.c (check_iso_charset_parameter): Convert internal
17079 character to string before calling 'error', since %c now has the
17080 printf meaning.
17081 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17082 overflow when computing char to be passed to 'error'. Do not
17083 pass Lisp_Object to 'error'; pass the integer instead.
17084 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17085 formatted with plain %d.
17086
b189fa66
PE
17087 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17088
bff87ef0
PE
17089 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17090
7e2cac20
PE
17091 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17092
ce4d90b5
PE
17093 * xterm.c (x_catch_errors): Remove duplicate declaration.
17094
266c9547
PE
17095 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17096
79c49ad2
PE
17097 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17098
368f4090
JM
170992011-04-10 Jim Meyering <meyering@redhat.com>
17100
17101 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17102 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17103 return ssize_t not "int", and use size_t as the buffer length.
17104 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17105 * gnutls.h: Update declarations.
17106 * process.c (read_process_output): Use ssize_t, to match.
17107 (send_process): Likewise.
17108
a32d4040
CY
171092011-04-09 Chong Yidong <cyd@stupidchicken.com>
17110
17111 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17112
8546720e 171132011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 17114
04f2d78b
CB
17115 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17116 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 17117
8546720e
GM
17118 * xterm.c (handle_one_xevent):
17119 * xmenu.c (create_and_show_popup_menu):
17120 * xselect.c (x_decline_selection_request)
17121 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 17122
0a2f5c1a 171232011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
17124
17125 Fix some uses of `int' instead of EMACS_INT.
17126 * search.c (string_match_1, fast_string_match)
17127 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17128 (scan_buffer, find_next_newline_no_quit)
17129 (find_before_next_newline, search_command, Freplace_match)
17130 (Fmatch_data): Make some `int' variables be EMACS_INT.
17131
17132 * xdisp.c (display_count_lines): 3rd argument and return value now
17133 EMACS_INT. All callers changed.
17134 (pint2hrstr): Last argument is now EMACS_INT.
17135
17136 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17137 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17138 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17139 (decode_coding_utf_16, decode_coding_emacs_mule)
17140 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17141 (decode_coding_ccl, decode_coding_charset)
17142 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17143 (decode_coding_iso_2022, decode_coding_emacs_mule)
17144 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17145 <char_offset, last_offset>: Declare EMACS_INT.
17146 (encode_coding_utf_8, encode_coding_utf_16)
17147 (encode_coding_emacs_mule, encode_invocation_designation)
17148 (encode_designation_at_bol, encode_coding_iso_2022)
17149 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17150 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17151 Declare EMACS_INT.
17152 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17153 (encode_invocation_designation): Last argument P_NCHARS is now
17154 EMACS_INT.
17155 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17156 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17157
17158 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17159 All users changed.
17160
17161 * ccl.c (Fccl_execute_on_string): Declare some variables
17162 EMACS_INT.
17163
8546720e 171642011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
17165
17166 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17167
4e19a977
CS
171682011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17169
17170 * process.c (Fformat_network_address): Doc fix.
17171
87302331
R
171722011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17173
ee7683eb 17174 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 17175
cbb59342
CY
171762011-04-08 Chong Yidong <cyd@stupidchicken.com>
17177
17178 * keyboard.c (read_char): Call Lisp function help-form-show,
17179 instead of using internal_with_output_to_temp_buffer.
17180 (Qhelp_form_show): New var.
e0d38eeb 17181 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
17182
17183 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17184
17185 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17186
e67a13ab
CY
171872011-04-06 Chong Yidong <cyd@stupidchicken.com>
17188
04f2d78b
CB
17189 * process.c (Flist_processes): Remove to Lisp.
17190 (list_processes_1): Delete.
e67a13ab 17191
973f782d
EZ
171922011-04-06 Eli Zaretskii <eliz@gnu.org>
17193
7c106b1e
EZ
17194 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17195
973f782d
EZ
17196 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17197
41cf7d1a 171982011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 17199
ca23cc88
PE
17200 Fix more problems found by GCC 4.6.0's static checks.
17201
f390e2d5
PE
17202 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17203
42eea0d0
PE
17204 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17205
b69769da 17206 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 17207
f9541e84
PE
17208 * xdisp.c (vmessage): Mark as a printf-like function.
17209
13841b55
PE
17210 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17211
c136c10f
PE
17212 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17213
5e2d4a30
PE
17214 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17215 printf-like functions.
17216 (tiff_load): Add casts to remove these marks before passing them
17217 to system-supplied API.
17218
583f48b9
PE
17219 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17220
b25d760e
PE
17221 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17222 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
17223 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17224 directly, rather than having caller test rule sign. This avoids
17225 some unnecessary tests.
17226 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17227 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17228 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 17229
bc7b6697 17230 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 17231 (xfont_open): Avoid unnecessary tests.
bc7b6697 17232
27ccc379
PE
17233 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17234
dcd5c89a
PE
17235 * composite.h, composite.c (composition_gstring_put_cache):
17236 Use EMACS_INT, not int, for length.
17237
b13a45c6
PE
17238 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17239 breaking out part of COMPOSITION_DECODE_RULE.
17240 (COMPOSITION_DECODE_RULE): Use it.
17241 * composite.c (get_composition_id): Remove unused local vars,
17242 by using the new macro.
17243
1e792e4d
PE
17244 * textprop.c (set_text_properties_1): Change while to do-while,
17245 since the condition is always true at first.
17246
dc6c6455 17247 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
17248 (interval_deletion_adjustment): Return unsigned value.
17249 All uses changed.
dc6c6455 17250
aba7731a
PE
17251 * process.c (list_processes_1, create_pty, read_process_output):
17252 (exec_sentinel): Remove vars that were set but not used.
afd4052b 17253 (create_pty): Remove unnecessary "volatile"s.
bc57d757 17254 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 17255 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 17256 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 17257
fdfc4bf3
PE
17258 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17259
fca8fe46 17260 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 17261 (update_syntax_table): Use unsigned instead of int.
fca8fe46 17262
06a0259a 17263 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 17264 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 17265 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 17266
e7b9e80f
PE
17267 * print.c (print_error_message): Avoid int overflow.
17268
56201685
PE
17269 * font.c (font_list_entities): Redo for clarity,
17270 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17271
78834453 17272 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 17273 (font_score): Avoid potential overflow in diff calculation.
78834453 17274
0bc0b309 17275 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 17276 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 17277
e610eaca
PE
17278 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17279
b895abce
PE
17280 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17281 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17282 can always succeed if overflow has undefined behavior.
17283
1f1d9321 17284 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 17285 (wordify): Omit three unnecessary tests.
1f1d9321 17286
c59478bc
PE
17287 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17288 All callers changed. This avoids the need for an unused var.
17289
79b73827
PE
17290 * casefiddle.c (casify_region): Remove var that is set but not used.
17291
a4db5dfe
PE
17292 * dired.c (file_name_completion): Remove var that is set but not used.
17293
43aae36e
PE
17294 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17295
2a47c44d 17296 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 17297 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 17298
a37c69bf
PE
17299 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17300 Check for integer overflow on size calculations.
17301
328ab8e7
PE
17302 * buffer.c (Fprevious_overlay_change): Remove var that is set
17303 but not used.
17304
e5a2a5cb
PE
17305 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17306 Remove vars that are set but not used.
8d84a6eb 17307 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 17308 (timer_check_2): Mark vars as initialized.
e5a2a5cb 17309
a60e5f68
PE
17310 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17311
f661cb61 17312 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 17313 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 17314
f0397f5a
PE
17315 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17316 that are set but not used.
17317
8664db06 17318 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 17319 if XCreateBitmapFromData fails (Bug#8410).
8664db06 17320
6abdaa4a
PE
17321 * xselect.c (x_get_local_selection, x_handle_property_notify):
17322 Remove vars that are set but not used.
17323
0ce7538d 17324 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 17325 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 17326
9ae848fc
PE
17327 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17328 Remove var that is set but not used.
0b918413
PE
17329 (scroll_bar_windows_size): Now size_t, not int.
17330 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17331 Check for overflow.
9ae848fc 17332
a5a62657
PE
17333 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17334 (map_tty_color) [!defined MSDOS]: Likewise.
17335
5c5cdd39
PE
17336 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17337
66ebf983
PE
17338 * coding.c: Remove vars that are set but not used.
17339 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17340 All callers changed.
17341 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17342 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17343 (decode_coding_charset): Remove vars that are set but not used.
17344
1be4d761
PE
17345 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17346 that is set but not used.
17347
47553fa8
PE
17348 * print.c (print_object): Remove var that is set but not used.
17349
1f7196bf 17350 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
17351 The gnulib version avoids calling malloc in the usual case,
17352 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17353 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17354 * filelock.c (current_lock_owner): Likewise.
17355 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17356 * sysdep.c: Include allocator.h, careadlinkat.h.
17357 (emacs_no_realloc_allocator): New static constant.
17358 (emacs_readlink): New function.
fdb61804
PE
17359 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17360 ../lib/careadlinkat.h.
d1fdcab7 17361
f84c17c7
SM
173622011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17363
17364 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17365 first non-nil return value).
17366
ef3862ad
JD
173672011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17368
17369 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17370 if not defined (Bug#8403).
17371
376a7006
JB
173722011-04-02 Juanma Barranquero <lekktu@gmail.com>
17373
17374 * xdisp.c (display_count_lines): Remove parameter `start',
17375 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17376 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17377 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17378 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17379 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17380 and thereabouts. All callers changed.
17381 (get_per_char_metric): Remove parameter `f', unused since
17382 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17383
6ca3801d
JM
173842011-04-02 Jim Meyering <meyering@redhat.com>
17385
17386 do not dereference NULL upon failed strdup
17387 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17388 (ns_get_family): Likewise.
17389
d8e2b5ba
JB
173902011-04-02 Juanma Barranquero <lekktu@gmail.com>
17391
17392 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17393
8c74fcbd
JD
173942011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17395
17396 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17397 later (Bug#8403).
17398
7200d79c
SM
173992011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17400
03408648 17401 Add lexical binding.
7200d79c 17402
03408648
SM
17403 * window.c (Ftemp_output_buffer_show): New fun.
17404 (Fsave_window_excursion):
17405 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17406
17407 * lread.c (lisp_file_lexically_bound_p): New function.
17408 (Fload): Bind Qlexical_binding.
17409 (readevalloop): Remove `evalfun' arg.
17410 Bind Qinternal_interpreter_environment.
17411 (Feval_buffer): Bind Qlexical_binding.
17412 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17413 Mark as dynamic.
17414 (syms_of_lread): Declare `lexical-binding'.
17415
17416 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17417
17418 * keyboard.c (eval_dyn): New fun.
17419 (menu_item_eval_property): Use it.
ca105506
SM
17420
17421 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 17422
03408648
SM
17423 * fns.c (concat, mapcar1): Accept byte-code-functions.
17424
17425 * eval.c (Fsetq): Handle lexical vars.
17426 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17427 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17428 (FletX, Flet): Obey lexical binding.
17429 (Fcommandp): Handle closures.
17430 (Feval): New `lexical' arg.
17431 (eval_sub): New function extracted from Feval. Use it almost
17432 everywhere where Feval was used. Look up vars in lexical env.
17433 Handle closures.
17434 (Ffunctionp): Move from subr.el.
17435 (Ffuncall): Handle closures.
17436 (apply_lambda): Remove `eval_flags'.
17437 (funcall_lambda): Handle closures and new byte-code-functions.
17438 (Fspecial_variable_p): New function.
17439 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17440 but without exporting it to Lisp.
23aba0ea 17441
23aba0ea 17442 * doc.c (Fdocumentation, store_function_docstring):
03408648 17443 * data.c (Finteractive_form): Handle closures.
23aba0ea 17444
03408648
SM
17445 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17446 interactive spec.
ba83908c 17447
04f2d78b
CB
17448 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17449 New byte-codes.
03408648
SM
17450 (exec_byte_code): New function extracted from Fbyte_code to handle new
17451 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 17452
03408648 17453 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 17454
03408648 17455 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 17456
e2abce01
JB
174572011-03-31 Juanma Barranquero <lekktu@gmail.com>
17458
17459 * xdisp.c (redisplay_internal): Fix prototype.
17460
63696a73 174612011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 17462
63696a73 17463 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
17464 (try_scrolling): Use it when setting scroll_limit.
17465 Limit scrolling to 100 screen lines.
63696a73
EZ
17466 (redisplay_window): Even when falling back on "recentering",
17467 position point in the window according to scroll-conservatively,
17468 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17469
17470 (try_scrolling): When point is above the window, allow searching
17471 as far as scroll_max, or one screenful, to compute vertical
17472 distance from PT to the scroll margin position. This prevents
17473 try_scrolling from unnecessarily failing when
17474 scroll-conservatively is set to a value slightly larger than the
17475 window height. Clean up the case of PT below the margin at bottom
17476 of window: scroll_max can no longer be INT_MAX. When aggressive
17477 scrolling is in use, don't let point enter the opposite scroll
17478 margin as result of the scroll.
17479 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
17480 threshold of 100 lines for never-recentering scrolling.
17481
e4cc2dfc
JB
174822011-03-31 Juanma Barranquero <lekktu@gmail.com>
17483
17484 * dispextern.h (move_it_by_lines):
17485 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17486 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17487 (message_log_check_duplicate): Remove parameters `prev_bol' and
17488 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17489 (redisplay_internal): Remove parameter `preserve_echo_area',
17490 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17491
17492 * indent.c (Fvertical_motion):
17493 * window.c (window_scroll_pixel_based, Frecenter):
17494 Don't pass `need_y_p' to `move_it_by_lines'.
17495
1c470562
SM
174962011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17497
44f230aa
SM
17498 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17499 steal a few bits to be more compact.
17500 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17501 Remove unneeded casts.
17502
1c470562
SM
17503 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17504
888adce9
ZK
175052011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17506
17507 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17508 binding" message (bug#7967).
17509
f838ed7b
PE
175102011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17511
77861b95
PE
17512 Fix more problems found by GCC 4.6.0's static checks.
17513
de6dbc14
PE
17514 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17515 Remove unused local var.
17516
f838ed7b
PE
17517 * editfns.c (Fmessage_box): Remove unused local var.
17518
792c7b2b
PE
17519 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17520 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17521 Omit unused local vars.
c499e557 17522 * window.c (shrink_windows): Omit unused local var.
b01a1c29 17523 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
17524 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17525 Omit unused local var.
17526
ba0165e1
PE
17527 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17528 Don't assume string length fits in int.
32ad8845 17529 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 17530 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 17531
3c59b4c9
PE
17532 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17533 instead of alloca (Bug#8344).
17534
a3eed478 17535 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 17536 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 17537
eb4d412d
PE
17538 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17539
1658b401
PE
17540 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17541 concerns.
17542
17543 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17544
17545 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 17546
9a2c6e05
PE
17547 * keyboard.c (syms_of_keyboard): Use the same style as later
17548 in this function when indexing through an array. This also
17549 works around GCC bug 48267.
17550
03d0a109
PE
17551 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17552
44f730c8
PE
17553 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17554
fe75f926
PE
17555 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17556 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17557
ffa8c828
PE
17558 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17559 This avoids undefined behavior on integer overflow, and is a bit
17560 more convenient anyway since it is compared to a size_t variable.
17561
c5101a77
PE
17562 Variadic C functions now count arguments with size_t, not int.
17563 This avoids an unnecessary limitation on 64-bit machines, which
17564 caused (substring ...) to crash on large vectors (Bug#8344).
17565 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17566 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 17567 All variadic functions and their callers changed accordingly.
c5101a77
PE
17568 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17569 * data.c (arith_driver, float_arith_driver): Likewise.
17570 * editfns.c (general_insert_function): Likewise.
17571 * eval.c (struct backtrace.nargs, interactive_p)
17572 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17573 (funcall_lambda, mark_backtrace): Likewise.
17574 * fns.c (concat): Likewise.
17575 * frame.c (x_set_frame_parameters): Likewise.
17576 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17577 0 if not found, not -1. All callers changed.
17578
dd3f25f7
PE
17579 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17580 (stack_copy_size): Now size_t, not int.
17581 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17582
461c2ab9
JB
175832011-03-28 Juanma Barranquero <lekktu@gmail.com>
17584
17585 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17586 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17587 All callers changed.
17588
17589 * lisp.h (multibyte_char_to_unibyte):
17590 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17591 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17592 * character.h (CHAR_TO_BYTE8):
17593 * cmds.c (internal_self_insert):
17594 * editfns.c (general_insert_function):
17595 * keymap.c (push_key_description):
17596 * search.c (Freplace_match):
17597 * xdisp.c (message_dolog, set_message_1): All callers changed.
17598
f6d62986
SM
175992011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17600
17601 * keyboard.c (safe_run_hook_funcall): New function.
17602 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17603 don't set the hook to nil, but remove the offending function instead.
17604 (Qcommand_hook_internal): Remove, unused.
17605 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17606 Vcommand_hook_internal.
17607
17608 * eval.c (enum run_hooks_condition): Remove.
17609 (funcall_nil, funcall_not): New functions.
17610 (run_hook_with_args): Call each function through a `funcall' argument.
17611 Remove `cond' argument, now redundant.
17612 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17613 (Frun_hook_with_args_until_failure): Adjust accordingly.
17614 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17615
1db5b1ad
JB
176162011-03-28 Juanma Barranquero <lekktu@gmail.com>
17617
17618 * dispextern.h (string_buffer_position): Remove declaration.
17619
17620 * print.c (strout): Remove parameter `multibyte', unused since
17621 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17622
17623 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17624 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17625 All callers changed.
17626
17627 * w32.c (_wsa_errlist): Use braces for struct initializers.
17628
17629 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17630 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17631 All callers changed.
17632 (string_buffer_position): Likewise. Also, make static (it's never
17633 used outside xdisp.c).
17634 (cursor_row_p): Remove parameter `w', unused since
17635 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17636 (decode_mode_spec): Remove parameter `precision', introduced during
17637 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17638 All callers changed.
17639
5ffb62aa
JD
176402011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17641
17642 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17643
461c2ab9 176442011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
17645
17646 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17647 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17648 (ns_update_auto_hide_menu_bar): New functions.
17649 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17650 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17651 ns_constrain_all_frames.
17652 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17653 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17654
5c380ffb
JD
176552011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17656
17657 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17658
9af30bdf
GM
176592011-03-27 Glenn Morris <rgm@gnu.org>
17660
17661 * syssignal.h: Replace RETSIGTYPE with void.
17662 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17663 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17664 Replace SIGTYPE with void everywhere.
17665 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17666 * s/template.h (SIGTYPE): Remove commented out definition.
17667
e2abce01
JB
176682011-03-26 Eli Zaretskii <eliz@gnu.org>
17669
17670 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17671 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17672
f868cd8a
JB
176732011-03-26 Juanma Barranquero <lekktu@gmail.com>
17674
59eb0929
JB
17675 * w32.c (read_unc_volume): Use parameter `henum', instead of
17676 global variable `wget_enum_handle'.
17677
17678 * keymap.c (describe_vector): Remove parameters `indices' and
17679 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17680 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17681
f868cd8a
JB
17682 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17683
17684 * keyboard.c (timer_check): Remove parameter `do_it_now',
17685 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17686 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17687 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17688
17689 * keyboard.c (read_char):
17690 * w32menu.c (w32_menu_display_help):
17691 * xmenu.c (show_help_event, menu_help_callback):
17692 Adjust calls to `show_help_echo'.
17693
17694 * gtkutil.c (xg_maybe_add_timer):
17695 * keyboard.c (readable_events):
17696 * process.c (wait_reading_process_output):
17697 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17698
17699 * insdel.c (adjust_markers_gap_motion):
17700 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17701 (gap_left, gap_right): Don't call it.
17702
2ecf6fdb
CY
177032011-03-25 Chong Yidong <cyd@stupidchicken.com>
17704
17705 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17706 incurred during fontification.
17707
6b1f9ba4
JB
177082011-03-25 Juanma Barranquero <lekktu@gmail.com>
17709
17710 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17711 (DEFVAR_PER_BUFFER): Don't pass it.
17712
17713 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17714 (scrolling_window): Don't pass it.
17715
0f4a96b5
JB
177162011-03-25 Juanma Barranquero <lekktu@gmail.com>
17717
17718 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17719
17720 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17721 and `suffix'.
17722 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17723 of variables specific to SELinux and computation of `encoded_absname'.
17724
17725 * image.c (XPutPixel): Remove unused variable `height'.
17726
17727 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17728
17729 * unexw32.c (get_section_info): Remove unused variable `section'.
17730
17731 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17732 (system_process_attributes): Remove unused variable `sess'.
17733 (sys_read): Remove unused variable `err'.
17734
17735 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17736 (w32_wnd_proc): Remove unused variable `isdead'.
17737 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17738 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17739 (x_create_tip_frame): Remove unused variable `tem'.
17740
17741 * w32inevt.c (w32_console_read_socket):
17742 Remove unused variable `no_events'.
17743
17744 * w32term.c (x_draw_composite_glyph_string_foreground):
17745 Remove unused variable `width'.
17746
1149507c
JB
177472011-03-24 Juanma Barranquero <lekktu@gmail.com>
17748
17749 * w32term.c (x_set_glyph_string_clipping):
17750 Don't pass uninitialized region to CombineRgn.
17751
9c88f339
JB
177522011-03-23 Juanma Barranquero <lekktu@gmail.com>
17753
17754 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17755 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17756 (Fx_close_connection): Remove unused variable `i'.
17757
17758 * w32font.c (w32font_draw): Return number of glyphs.
17759 (w32font_open_internal): Remove unused variable `i'.
17760 (w32font_driver): Add missing initializer.
17761
17762 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17763 (fill_in_menu): Remove unused variable `items_added'.
17764
17765 * w32term.c (last_mouse_press_frame): Remove static global variable.
17766 (w32_clip_to_row): Remove unused variable `f'.
17767 (x_delete_terminal): Remove unused variable `i'.
17768
17769 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17770 (NOTHING): Remove unused static global variable.
17771 (uniscribe_check_otf): Remove unused variable `table'.
17772 (uniscribe_font_driver): Add missing initializers.
17773
dee091a3
JD
177742011-03-23 Julien Danjou <julien@danjou.info>
17775
17776 * term.c (Fsuspend_tty, Fresume_tty):
17777 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17778 * window.c (temp_output_buffer_show):
17779 * insdel.c (signal_before_change):
17780 * frame.c (Fhandle_switch_frame):
17781 * fileio.c (Fdo_auto_save):
17782 * emacs.c (Fkill_emacs):
17783 * editfns.c (save_excursion_restore):
17784 * cmds.c (internal_self_insert):
17785 * callint.c (Fcall_interactively):
17786 * buffer.c (Fkill_all_local_variables):
17787 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17788 Use Frun_hooks.
0f4a96b5 17789 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17790 unconditionally since it does the check itself.
dee091a3 17791
2c520ab5 177922011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17793
c9c49752
PE
17794 Fix more problems found by GCC 4.5.2's static checks.
17795
8abc3f12
PE
17796 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17797 the first time through the loop, since we know p0 < p1 then.
17798 This also avoids a gcc -Wstrict-overflow warning.
17799
a2d26660
PE
17800 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17801 leading to a memory leak, possible in functions like
17802 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17803 of objects (Bug#8318).
a2d26660 17804
916c72e9
PE
17805 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17806 that could (at least in theory) be that large.
17807
19ab8a18
PE
17808 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17809 This is less likely to overflow, and avoids undefined behavior if
17810 overflow does occur. All callers changed. Use strtoul to scan
17811 for the unsigned long integer.
b7cbbd6f
PE
17812 (pint2hrstr): Simplify and tune code slightly.
17813 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17814
f0641eff
PE
17815 * scroll.c (do_scrolling): Work around GCC bug 48228.
17816 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17817
7f650bb9
PE
17818 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17819 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17820 (validate_x_resource_name): Simplify count usage.
17821 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17822
37dd57d1
PE
17823 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17824 fail (Bug#8306).
81e56e61 17825
699979fc 17826 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17827
401bf9b4
PE
17828 * process.c (Fmake_network_process): Use socklen_t, not int,
17829 where POSIX says socklen_t is required in portable programs.
17830 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17831 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17832 (Fmake_network_process, server_accept_connection):
17833 (wait_reading_process_output, read_process_output):
17834 Likewise.
17835
b93aacde
PE
17836 * process.c: Rename or move locals to avoid shadowing.
17837 (list_processes_1, Fmake_network_process):
17838 (read_process_output_error_handler, exec_sentinel_error_handler):
17839 Rename or move locals.
4dc343ee 17840 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17841 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17842 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17843 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17844 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17845
af8a867c 17846 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17847 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17848 Include tparam.h instead, since it declares them.
af8a867c
PE
17849 * cm.h (PC): Remove extern decl; tparam.h now does this.
17850 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17851 * terminfo.c: Include tparam.h, to check interfaces.
17852 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17853 (tparam): Adjust signature to match interface in tparam.h;
17854 this removes some undefined behavior. Check that outstring and len
17855 are zero, which they always are with Emacs.
17856 * tparam.h (PC, BC, UP): New extern decls.
17857
0248044d 17858 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17859 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17860
8ff096c1 17861 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17862 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17863 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17864 (ftfont_list): Remove unused local.
49eaafba
PE
17865 (get_adstyle_property, ftfont_pattern_entity):
17866 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17867 Rename locals to avoid shadowing.
8ff096c1 17868
e2be39f6
PE
17869 * xfont.c (xfont_list_family): Mark var as initialized.
17870
c9735e30
PE
17871 * xml.c (make_dom): Now static.
17872
8f5201ae
PE
17873 * composite.c (composition_compute_stop_pos): Rename local to
17874 avoid shadowing.
b246f932
PE
17875 (composition_reseat_it): Remove unused locals.
17876 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17877 (composition_update_it): Mark var as initialized.
11b61122
PE
17878 (find_automatic_composition): Mark vars as initialized,
17879 with a FIXME (Bug#8290).
8f5201ae 17880
760fbc2c
PE
17881 character.h: Rename locals to avoid shadowing.
17882 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17883 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17884 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17885 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17886 to avoid shadowing.
17887
ff08eb85
PE
17888 * textprop.c (property_change_between_p): Remove; unused.
17889
fc7bf025
PE
17890 * intervals.c (interval_start_pos): Now static.
17891
235d7abc
PE
17892 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17893
44f230aa
SM
17894 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17895 Rename locals to avoid shadowing.
3e7d6594 17896
50060332
PE
17897 * sound.c (wav_play, au_play, Fplay_sound_internal):
17898 Fix pointer signedness.
d01f234b 17899 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17900 (wav_play): Initialize a variable to 0, to prevent undefined
17901 behavior (Bug#8278).
50060332 17902
c4fc4e30
PE
17903 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17904
918436ed
PE
17905 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17906
c939f91b
PE
17907 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17908 clobbering (Bug#8298).
b9c7f648
PE
17909 * sysdep.c (sys_subshell): Likewise.
17910 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17911
6bd8c144
PE
17912 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17913 This should get cleaned up, so that child_setup has the
17914 same signature on all platforms.
17915
7710357c 17916 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17917 (relocate_fd): Rename locals to avoid shadowing.
7710357c 17918
c59da222
CY
179192011-03-22 Chong Yidong <cyd@stupidchicken.com>
17920
17921 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17922 not to be necessary, and produces flickering.
17923
66b87493
GM
179242011-03-20 Glenn Morris <rgm@gnu.org>
17925
17926 * config.in: Remove file.
17927
45b6f6d5
JB
179282011-03-20 Juanma Barranquero <lekktu@gmail.com>
17929
17930 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17931 are now in src/globals.h.
17932 (syms_of_minibuf): Remove spurious & from previous change.
17933
cd394be1 179342011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
17935
17936 * minibuf.c (completing-read-function): New variable.
17937 (completing-read-default): Rename from completing-read.
17938 (completing-read): Call completing-read-function.
17939
b14e3e21
CY
179402011-03-19 Juanma Barranquero <lekktu@gmail.com>
17941
17942 * xfaces.c (Fx_load_color_file):
17943 Read color file from absolute filename (bug#8250).
17944
f2b726e6
JB
179452011-03-19 Juanma Barranquero <lekktu@gmail.com>
17946
17947 * makefile.w32-in: Update dependencies.
17948
09f6ff02
EZ
179492011-03-17 Eli Zaretskii <eliz@gnu.org>
17950
17951 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17952
29a6015a
PE
179532011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17954
a3a6c54e
PE
17955 Fix more problems found by GCC 4.5.2's static checks.
17956
b766f867
PE
17957 * process.c (make_serial_process_unwind, send_process_trap):
17958 (sigchld_handler): Now static.
17959
be02381c
PE
17960 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17961 That way, the code declares only the vars that it needs.
17962 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17963 * s/cygwin.h (PTY_ITERATION): Likewise.
17964 * s/darwin.h (PTY_ITERATION): Likewise.
17965 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17966
57048744
PE
17967 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17968 * process.c (allocate_pty): Don't declare stb unless it's needed.
17969
7914961c 17970 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
17971 (CONSTANTLIM): Remove; unused.
17972 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17973 Define only if needed.
7914961c 17974
b3967b18
PE
17975 * unexelf.c (unexec): Name an expression,
17976 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
17977 Use a different way to cause a compilation error if anyone uses
17978 n rather than nn, a way that does not involve shadowing.
73366a00 17979 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 17980
29a6015a
PE
17981 * deps.mk (unexalpha.o): Remove; unused.
17982
43cfc33e 17983 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17984 * unexec.h: New file.
ce701a33
PE
17985 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17986 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17987 Depend on unexec.h.
17988 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17989 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17990 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17991 Change as necessary to match prototype in unexec.h.
ce701a33 17992
01f44d5a
PE
17993 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17994 shadowing.
4f63c6bb 17995 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17996
a6670b0b
PE
17997 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17998 Rename locals to avoid shadowing.
17999
cef2010d 18000 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 18001 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 18002
d4d7173a
PE
18003 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18004
f08b802a
PE
18005 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18006 warning when compiling print.c.
18007
3ddb0639
PE
18008 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18009 instead of using an uninitialized var.
5ad03b97 18010 (font_sort_entities): Mark var as initialized.
3ddb0639 18011
170a2692
PE
18012 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18013
e663c700
PE
18014 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18015 pointers to constants.
89bc529a 18016 (font_parse_fcname): Remove unused vars.
7b81e2d0 18017 (font_delete_unmatched): Now static.
ea838e10 18018 (font_get_spec): Remove; unused.
13a547c6
PE
18019 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18020 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18021 Rename or move locals to avoid shadowing.
e663c700 18022
2a80c887 18023 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 18024 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 18025
1384fa33 18026 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 18027 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 18028
8b2c52e9
PE
18029 * alloc.c (mark_backtrace): Move decl from here ...
18030 * lisp.h: ... to here, so that it can be checked.
18031
475545b5 18032 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 18033 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
18034 (lisp_indirect_variable): Name an expression,
18035 to avoid gcc -Wbad-function-cast warning.
1faed8ae 18036 (Fdefvar): Rename locals to avoid shadowing.
475545b5 18037
b1349114 18038 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 18039 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 18040 Use const pointer when appropriate.
b1349114 18041
a2928364
PE
18042 * lisp.h (get_system_name, get_operating_system_release):
18043 Move decls here, to check interfaces.
18044 * process.c (get_operating_system_release): Move decl to lisp.h.
18045 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
18046 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18047 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18048 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
18049 (Fformat_time_string, Fencode_time, Finsert_char):
18050 (Ftranslate_region_internal, Fformat):
18051 Rename or remove local vars to avoid shadowing.
9710023e 18052 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 18053
a415e694
PE
18054 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18055 avoid shadowing.
18056
8ef4622d
PE
18057 * lisp.h (eassert): Check that the argument compiles, even if
18058 ENABLE_CHECKING is not defined.
18059
946f9a5b
PE
18060 * data.c (Findirect_variable): Name an expression, to avoid
18061 gcc -Wbad-function-cast warning.
112396d6 18062 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 18063 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
18064 (Fmake_variable_buffer_local, Fmake_local_variable):
18065 Mark variables as initialized.
52746918 18066 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 18067
e5aab7e7 18068 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
18069 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18070 Rename locals to avoid shadowing.
dff45157
PE
18071 (mark_stack): Move local variables into the #ifdef region where
18072 they're used.
7bc26fdb
PE
18073 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18074 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18075 needed otherwise.
18076 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18077 (GC_STRING_CHARS): Remove; not used.
d40d4be1 18078 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 18079
e5aab7e7
PE
18080 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18081 avoids undefined behavior in theory.
18082
4da60324
PE
18083 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18084
88043301
PE
18085 Use functions, not macros, for up- and down-casing (Bug#8254).
18086 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18087 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18088 to use the following functions instead of these macros.
18089 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18090 EMACS_INT, since callers assume the returned value fits in int.
18091 (upcase1): Likewise, for UPCASE_TABLE.
18092 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 18093 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 18094 the race-condition problem in the old DOWNCASE.
88043301 18095
19ed5445
PE
18096 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18097 Rename locals to avoid shadowing.
18098 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
18099 (regex_compile, re_search_2, re_match_2_internal):
18100 Remove unused local vars.
952db0d7
PE
18101 (FREE_VAR): Rewrite so as not to use empty "else",
18102 which gcc can warn about.
da053e48 18103 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
18104 (RETALLOC_IF): Define only if needed.
18105 (WORDCHAR_P): Likewise. This one is never needed, but is used
18106 only in a comment talking about a compiler bug, so put inside
18107 the #if 0 of that comment.
18108 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18109 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18110 Remove; unused.
19ed5445 18111
1f3561e4 18112 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
18113 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18114 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 18115
ded6f8f7
PE
18116 * search.c (simple_search): Remove unused var.
18117
dbd37a95
PE
18118 * dired.c (compile_pattern): Move decl from here ...
18119 * lisp.h: ... to here, so that it can be checked.
18120 (struct re_registers): New forward decl.
18121
7e47afad
PE
18122 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18123
85f24f61
PE
18124 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18125 All uses changed.
18126 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18127 Rename locals to avoid shadowing.
5671df8f 18128 (Fvertical_motion): Mark locals as initialized.
85f24f61 18129
181aa2be 18130 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 18131 (casify_region): Mark local as initialized.
181aa2be 18132
930d429c
PE
18133 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18134
7082eac6
PE
18135 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18136 New macros, so that the caller can use some names other than
18137 gcpro1, gcpro2, etc.
18138 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18139 of the new macros.
18140 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18141 argument, for consistency with GCPRO2_VAR, etc: it is now the
18142 prefix of the variable, not the variable itself. All uses
18143 changed.
38b2c076
PE
18144 * dired.c (directory_files_internal, file_name_completion):
18145 Rename locals to avoid shadowing.
18146
15206ed9
PE
18147 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18148 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18149 dired.c's scmp function, had undefined behavior.
18150 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18151 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18152 * buffer.h: ... to here, because these macros use current_buffer,
18153 and the new implementation with inline functions needs to have
18154 current_buffer in scope now, rather than later when the macros
18155 are used.
18156 (downcase, upcase1): New static inline functions.
18157 (DOWNCASE, UPCASE1): Reimplement using these functions.
18158 This avoids undefined behavior in expressions like
18159 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18160 from race conditions in accessing the global variables
18161 case_temp1 and case_temp2.
18162 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18163 * lisp.h (case_temp1, case_temp2): Remove their decls.
18164 * character.h (ASCII_CHAR_P): Move from here ...
18165 * lisp.h: ... to here, so that the inline functions mentioned
18166 above can use them.
18167
4a6bea26
PE
18168 * dired.c (directory_files_internal_unwind): Now static.
18169
f14b7e14
PE
18170 * fileio.c (file_name_as_directory, directory_file_name):
18171 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18172 Now static.
2893f146
PE
18173 (file_name_as_directory): Use const pointers when appropriate.
18174 (Fexpand_file_name): Likewise. In particular, newdir might
18175 point at constant storage, so make it a const pointer.
fd4ead52 18176 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
18177 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18178 signedness issues.
f839df0c
PE
18179 (Fset_file_times, Finsert_file_contents, auto_save_error):
18180 Rename locals to avoid shadowing.
f14b7e14 18181
5716756e 18182 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
18183 (Ftry_completion, Fall_completions): Rename or remove locals
18184 to avoid shadowing.
5716756e 18185
b4c3046a
PE
18186 * marker.c (bytepos_to_charpos): Remove; unused.
18187
b45db522
PE
18188 * lisp.h (verify_bytepos, count_markers): New decls,
18189 so that gcc does not warn that these functions aren't declared.
18190
85876d07
PE
18191 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18192 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 18193 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 18194 (copy_text): Remove unused local var.
85876d07 18195
03d78a21 18196 * filelock.c (within_one_second): Now static.
b3dd38ab 18197 (lock_file_1): Rename local to avoid shadowing.
03d78a21 18198
5df8f01b
PE
18199 * buffer.c (fix_overlays_before): Mark locals as initialized.
18200 (fix_start_end_in_overlays): Likewise. This function should be
18201 simplified by using pointers-to-pointers, but that's a different
18202 matter.
b1d876f1 18203 (switch_to_buffer_1): Now static.
8f54f30a
PE
18204 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18205 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 18206
a70072c9 18207 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 18208 Fix pointer signedness issue.
edced198
PE
18209 (sys_subshell): Mark local as volatile if checking for lint,
18210 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 18211 (MAXPATHLEN): Define only if needed.
a70072c9 18212
a0977c44
PE
18213 * process.c (serial_open, serial_configure): Move decls from here ...
18214 * systty.h: ... to here, so that they can be checked.
18215
a884fdcc
PE
18216 * fns.c (get_random, seed_random): Move extern decls from here ...
18217 * lisp.h: ... to here, so that they can be checked.
18218
604efe86 18219 * sysdep.c (reset_io): Now static.
b8950c94 18220 (wait_for_termination_signal): Remove; unused.
604efe86 18221
38fc62d9
PE
18222 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18223 (copy_keymap_item, append_key, push_text_char_description):
18224 Now static.
1004a21a 18225 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 18226 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
18227 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18228 (describe_map_tree):
18229 Rename locals to avoid shadowing.
38fc62d9 18230
2f2650da
PE
18231 * keyboard.c: Declare functions static if they are not used elsewhere.
18232 (echo_char, echo_dash, cmd_error, top_level_2):
18233 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
18234 (read_char, kbd_buffer_get_event, make_lispy_position):
18235 (make_lispy_event, make_lispy_movement, apply_modifiers):
18236 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18237 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18238 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 18239 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 18240 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 18241
a053e86c 18242 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
18243 (mark_kboards): Move decl here ...
18244 * alloc.c (mark_kboards): ... from here.
a053e86c 18245
4752793e
PE
18246 * lisp.h (force_auto_save_soon): New decl.
18247
74f10ca7 18248 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
18249 (DEFINE_DUMMY_FUNCTION): New macro.
18250 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18251 Use it.
c03cd23f
PE
18252 (main): Add casts to avoid warnings
18253 if GCC considers string literals to be constants.
74f10ca7 18254
022e70d4
PE
18255 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18256
59d6fe83
PE
18257 * dbusbind.c: Pointer signedness fixes.
18258 (xd_signature, xd_append_arg, xd_initialize):
18259 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18260 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18261 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18262 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18263
78320123
PE
18264 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18265 if GCC considers string literals to be constants.
49cebcca 18266 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 18267
35ac2a97
SM
182682011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18269
fb103ca9
SM
18270 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18271 (print_preprocess, print_object): New macro to fix last change.
18272
35ac2a97
SM
18273 * print.c (print_preprocess): Don't forget font objects.
18274
62973b41
JB
182752011-03-16 Juanma Barranquero <lekktu@gmail.com>
18276
18277 * emacs.c (USAGE3): Doc fixes.
18278
0e48bb22
AS
182792011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18280
18281 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18282 structure.
18283
7684e57b
JB
182842011-03-14 Juanma Barranquero <lekktu@gmail.com>
18285
18286 * lisp.h (VWindow_system, Qfile_name_history):
18287 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18288 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18289 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18290
18291 * w32select.c: Don't #include "keyboard.h".
c96bbc66 18292 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
18293
18294 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18295 * w32console.c (detect_input_pending, read_input_pending)
18296 (encode_terminal_code):
18297 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18298 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18299 (w32_system_caret_y, Qfile_name_history):
18300 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18301 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18302 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18303 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18304 * w32proc.c (Qlocal, report_file_error):
18305 * w32term.c (Vwindow_system, updating_frame):
18306 * w32uniscribe.c (initialized, uniscribe_font_driver):
18307 Remove unneeded extern declarations.
18308
2aa46d6c
CY
183092011-03-14 Chong Yidong <cyd@stupidchicken.com>
18310
c96bbc66 18311 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 18312
cffc6f3b
CY
183132011-03-13 Chong Yidong <cyd@stupidchicken.com>
18314
18315 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18316 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18317 These macros can no longer be used for assignment.
18318
44f230aa
SM
18319 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18320 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
18321 (record_buffer_markers, fetch_buffer_markers): New functions for
18322 recording and fetching special buffer markers.
18323 (set_buffer_internal_1, set_buffer_temp): Use them.
18324
18325 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18326
18327 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18328
18329 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18330 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18331
18332 * xdisp.c (hscroll_window_tree):
18333 (reconsider_clip_changes): Use PT instead of BUF_PT.
18334
d251f04b
EZ
183352011-03-13 Eli Zaretskii <eliz@gnu.org>
18336
18337 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18338 $(EMACS_ROOT)/lib/intprops.h.
18339
f0c77cd1
PE
183402011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18341
3eca4629
PE
18342 Fix more problems found by GCC 4.5.2's static checks.
18343
7c86ee98
PE
18344 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18345 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
18346 (xg_free_frame_widgets): Make it clear that a local variable is
18347 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
18348 (gdk_window_get_screen): Make it clear that this macro is needed
18349 only if USE_GTK_TOOLTIP.
1e5524e7
PE
18350 (int_gtk_range_get_value): New function, which avoids a diagnostic
18351 from gcc -Wbad-function-cast.
18352 (xg_set_toolkit_scroll_bar_thumb): Use it.
18353 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18354 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
18355 (get_utf8_string, xg_get_file_with_chooser):
18356 Rename locals to avoid shadowing.
18357 (create_dialog): Move locals to avoid shadowing.
7c86ee98 18358
41729b81
PE
18359 * xgselect.c (xg_select): Remove unused var.
18360
f0c77cd1
PE
18361 * image.c (four_corners_best): Mark locals as initialized.
18362 (gif_load): Initialize transparent_p to zero (Bug#8238).
18363 Mark another local as initialized.
ec6cf4c6 18364 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 18365
ce0ad53d 18366 * image.c (clear_image_cache): Now static.
d5d5a617 18367 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 18368 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
18369 (x_edge_detection): Remove unnecessary cast that
18370 gcc -Wbad-function-cast diagnoses.
2037898d 18371 (gif_load): Fix pointer signedness.
6ae141d6
PE
18372 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18373 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 18374
33383987 183752011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 18376
d32df629
PE
18377 Improve quality of tests for time stamp overflow.
18378 For example, without this patch (encode-time 0 0 0 1 1
18379 1152921504606846976) returns the obviously-bogus value (-948597
18380 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18381 reports time overflow. See
18382 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
18383 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18384 * editfns.c: Include limits.h and intprops.h.
18385 (TIME_T_MIN, TIME_T_MAX): New macros.
18386 (time_overflow): Move earlier, to before first use.
18387 (hi_time, lo_time): New functions, for an accurate test for
18388 out-of-range times.
18389 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18390 (Fget_internal_run_time): Don't assume time_t fits in int.
18391 (make_time): Use list2 instead of Fcons twice.
18392 (Fdecode_time): More accurate test for out-of-range times.
18393 (check_tm_member): New function.
18394 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
18395 (lisp_time_argument): Don't rely on undefined left-shift and
18396 right-shift behavior when checking for time stamp overflow.
8be6f318 18397
fe31d94c
PE
18398 * editfns.c (time_overflow): New function, refactoring common code.
18399 (Fformat_time_string, Fdecode_time, Fencode_time):
18400 (Fcurrent_time_string): Use it.
18401
8be6f318
PE
18402 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18403 * dired.c (make_time): Move to ...
18404 * editfns.c (make_time): ... here.
18405 * systime.h: Note the move.
18406
09d9db2c 184072011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 18408
126bc0dc
YM
18409 * fringe.c (update_window_fringes): Remove unused variables.
18410
c47cbdfd
YM
18411 * unexmacosx.c (copy_data_segment): Also copy __got section.
18412 (Bug#8223)
18413
7ac80be9
EZ
184142011-03-12 Eli Zaretskii <eliz@gnu.org>
18415
c96bbc66 18416 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
18417 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18418 Constify `char *' arguments and their references according to
18419 prototypes in tparam.h.
18420
ecb0f94d 18421 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 18422
7ac80be9
EZ
18423 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18424 Adapt all references accordingly.
18425
18426 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18427
ef1fd07e
TT
184282011-03-11 Tom Tromey <tromey@redhat.com>
18429
18430 * buffer.c (syms_of_buffer): Remove obsolete comment.
18431
7ef4b50c
EZ
184322011-03-11 Eli Zaretskii <eliz@gnu.org>
18433
18434 * termhooks.h (encode_terminal_code): Declare prototype.
18435
18436 * msdos.c (encode_terminal_code): Don't declare prototype.
18437
18438 * term.c (encode_terminal_code): Now external again, used by
18439 w32console.c and msdos.c.
18440
44f230aa
SM
18441 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18442 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 18443
4b1ec863 184442011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 18445
1714f52b 18446 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 18447
4b1ec863
PE
18448 * fringe.c (update_window_fringes): Mark locals as initialized
18449 (Bug#8227).
18450 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 18451
524c7aa6
PE
18452 * alloc.c (mark_fringe_data): Move decl from here ...
18453 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18454 to check its interface.
18455 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18456
a5c0af81 18457 * fontset.c (free_realized_fontset): Now static.
7519b8cd 18458 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 18459 (fontset_font): Mark local as initialized.
a9a06e0b 18460 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 18461
b4716021
PE
18462 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18463
811e9bac 18464 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 18465 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
18466 (x_own_selection, Fx_disown_selection_internal): Rename locals
18467 to avoid shadowing.
18468 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 18469
7e3ab302
PE
18470 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18471 so that the caller can use some name other than gcpro1.
18472 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
18473 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18474 (Fx_backspace_delete_keys_p):
18475 Use them to avoid shadowing, and rename vars to avoid shadowing.
18476 (x_decode_color, x_set_name, x_window): Now static.
6b437900 18477 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 18478 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
18479 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18480 Remove unused locals.
7e3ab302
PE
18481 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18482 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18483 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18484 macros.
f78faa98 18485
e2b13473
PE
18486 * xterm.h (x_mouse_leave): New decl.
18487
77f23912
PE
18488 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18489 Remove unused functions.
cdf4ba58
PE
18490 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18491 (x_calc_absolute_position): Now static.
7411c686 18492 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 18493 Don't declare local "event" unless it's used.
ed7bf3a5
PE
18494 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18495 unless they are used.
38d0b34a
PE
18496 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18497 (x_fatal_error_signal): Remove; not used.
a6067996
PE
18498 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18499 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18500 (x_error_catcher, x_connection_closed, x_error_handler):
18501 (x_error_quitter, xembed_send_message, x_iconify_frame):
18502 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 18503 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 18504 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 18505
44f230aa
SM
18506 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18507 Rename or move locals to avoid shadowing.
6b463e58 18508 (tty_defined_color, merge_face_heights): Now static.
5967d051 18509 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
18510 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18511 does not deduce is never used uninitialized.
73719eba
PE
18512 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18513 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 18514
426994c3 18515 * terminal.c (store_terminal_param): Now static.
5489860b 18516
032f1620 18517 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 18518 (set_frame_menubar): Remove unused local.
d4323972 18519 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
18520 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18521 since they might point to immutable storage.
281585b0
PE
18522 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18523 since it's unused otherwise.
032f1620 18524
367c19e5 18525 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 18526 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
18527 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18528 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 18529 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
18530 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18531 does not deduce are never used uninitialized.
70739cbe 18532
07b48fa9
PE
18533 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18534
8868a238 18535 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
18536 * window.c (window_loop, size_window):
18537 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 18538
7e5cf297 18539 * window.c (display_buffer): Now static.
d6550a9f
PE
18540 (size_window): Mark variables that gcc -Wuninitialized
18541 does not deduce are never used uninitialized.
a586633d
PE
18542 * window.h (check_all_windows): New decl, to forestall
18543 gcc -Wmissing-prototypes diagnostic.
5b555da1 18544 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 18545
f6095868
PE
18546 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18547 shadowing.
18548 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
18549 Include <limits.h>.
18550 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18551 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
18552 (load_charset_map): Mark variables that gcc -Wuninitialized
18553 does not deduce are never used uninitialized.
53df7c11 18554 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 18555
f38b440c
PE
18556 * coding.c (coding_set_source, coding_set_destination):
18557 Use "else { /* comment */ }" rather than "else /* comment */;"
18558 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
18559 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18560 a block, when the outer 'i' will do.
18561 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18562 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18563 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18564 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18565 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18566 Rename locals to avoid shadowing.
18567 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
18568 * coding.c (emacs_mule_char, encode_invocation_designation):
18569 Now static, since they're not used elsewhere.
413bb2db 18570 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 18571 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
18572 (decode_coding_emacs_mule): Mark variables that gcc
18573 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
18574 (detect_coding_iso_2022): Initialize a local variable that might
18575 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 18576 this initialization is needed. (Bug#8211)
5f58e762
PE
18577 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18578 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18579 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18580 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18581 Remove unused macros.
f38b440c 18582
232b38b9 18583 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 18584 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 18585 * character.c (string_count_byte8): Likewise.
232b38b9 18586
fb90da1b
PE
18587 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18588 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18589
fb93dbc2
PE
18590 * chartab.c (copy_sub_char_table): Now static, since it's not used
18591 elsewhere.
5c156ace
PE
18592 (sub_char_table_ref_and_range, char_table_ref_and_range):
18593 Rename locals to avoid shadowing.
bbcd0949 18594 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 18595
7d3b3862 18596 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 18597 (BIDI_BOB): Remove unused macro.
7d3b3862 18598
6be7d3da
PE
18599 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18600 deduce are never used uninitialized.
c2ed9c8b 18601 * term.c (encode_terminal_code): Likewise.
6be7d3da 18602
75f8807f 18603 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 18604
50938595
PE
18605 * tparam.h: New file.
18606 * term.c, tparam.h: Include it.
18607 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18608 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18609 Move these decls to tparam.h, and make them agree with what
18610 is actually in tparam.c. The previous trick of using incompatible
18611 decls in different modules does not conform to the C standard.
18612 All callers of tparam changed to use tparam's actual API.
18613 * tparam.c (tparam1, tparam, tgoto):
18614 Use const pointers where appropriate.
18615
fbceeba2
PE
18616 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18617 * cm.h (struct cm): Likewise.
18618 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18619 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18620 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18621 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18622 (turn_on_face, init_tty): Likewise.
18623 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 18624
7f3f1250
PE
18625 * term.c (term_mouse_position): Rename local to avoid shadowing.
18626
e6ca6543
PE
18627 * alloc.c (mark_ttys): Move decl from here ...
18628 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18629
c40f8d15
AS
186302011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18631
18632 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18633
cfe0661d
JB
186342011-03-09 Juanma Barranquero <lekktu@gmail.com>
18635
18636 * search.c (compile_pattern_1): Remove argument regp, unused since
18637 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18638 (compile_pattern): Don't pass it.
18639
0afb4571
J
186402011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18641
18642 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18643 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18644 for ! HAVE_GTK3.
18645 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18646
18647 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18648
18649 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18650 gdk_window_get_screen, gdk_window_get_geometry,
18651 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18652 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18653 (xg_get_pixbuf_from_pixmap): New function.
18654 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18655 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18656 Call xg_get_pixbuf_from_pixmap instead of
18657 gdk_pixbuf_get_from_drawable.
18658 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18659 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18660 (xg_check_special_colors): Use GtkStyleContext and its functions
18661 for HAVE_GTK3.
18662 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18663 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18664 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18665 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18666 Call gtk_widget_get_preferred_size.
0afb4571
J
18667 (xg_frame_resized): gdk_window_get_geometry only takes 5
18668 parameters.
44f230aa
SM
18669 (xg_win_to_widget, xg_event_is_for_menubar):
18670 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18671 (xg_set_widget_bg): New function.
18672 (delete_cb): New function.
895009e1 18673 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18674 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18675 (xg_set_background_color): Call xg_set_widget_bg.
18676 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18677 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18678 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18679 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18680 if ! HAVE_GTK3.
18681 (update_frame_tool_bar): Call gtk_widget_hide.
18682 (xg_initialize): Use GDK_KEY_g.
18683
18684 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18685 if ! HAVE_GTK3
18686 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18687
18688 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18689 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18690 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18691
1c2cc4ef
JB
186922011-03-08 Juanma Barranquero <lekktu@gmail.com>
18693
18694 * w32xfns.c (select_palette): Check success of RealizePalette against
18695 GDI_ERROR, not zero.
18696
33383987 18697See ChangeLog.11 for earlier changes.
aac0c6e3
MR
18698
18699;; Local Variables:
18700;; coding: utf-8
aac0c6e3
MR
18701;; End:
18702
2f097256 18703 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
18704
18705 This file is part of GNU Emacs.
18706
18707 GNU Emacs is free software: you can redistribute it and/or modify
18708 it under the terms of the GNU General Public License as published by
18709 the Free Software Foundation, either version 3 of the License, or
18710 (at your option) any later version.
18711
18712 GNU Emacs is distributed in the hope that it will be useful,
18713 but WITHOUT ANY WARRANTY; without even the implied warranty of
18714 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18715 GNU General Public License for more details.
18716
18717 You should have received a copy of the GNU General Public License
18718 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.