1 2012-09-30 Kenichi Handa <handa@gnu.org>
3 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4 to the buffer relocation which may be caused by ccl_driver.
6 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
8 * xfns.c (Fx_file_dialog): Update comment.
10 * w32fns.c (Fx_file_dialog): Update comment.
12 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
13 Initialize panel name field if OSX >= 10.6.
15 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
17 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
19 * nsterm.m (NEW_STYLE_FS): New define.
20 (ns_fullscreen_hook, windowWillEnterFullScreen)
21 (windowDidEnterFullScreen, windowWillExitFullScreen)
22 (windowDidExitFullScreen, toggleFullScreen, handleFS)
23 (setFSValue): New functions.
24 (EmacsFSWindow): New implementation.
25 (canBecomeKeyWindow): New function for EmacsFSWindow.
26 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
27 (dealloc): Release nonfs_window if in fullscreen.
28 (updateFrameSize:): Call windowDidMove to update top/left.
29 (windowWillResize:toSize:): Check if frame is still maximized.
30 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
31 next_maximized, maximized_width, maximized_height and nonfs_window.
32 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
34 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
35 fullscreen. Set maximized_width/height. Act on next_maximized.
37 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
38 (EmacsView): Add variables for fullscreen.
39 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
40 (EmacsFSWindow): New interface for fullscreen.
42 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
44 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
46 2012-09-30 Chong Yidong <cyd@gnu.org>
48 * fns.c (Frandom): Doc fix.
50 2012-09-30 Martin Rudalics <rudalics@gmx.at>
52 * window.c (Vwindow_combination_limit): New default value.
53 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
55 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
57 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
58 Suggested by Eli Zaretskii in
59 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
61 2012-09-30 Eli Zaretskii <eliz@gnu.org>
63 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
64 HAVE_TIMER_SETTIME is defined.
66 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
68 Profiler improvements: more-accurate timers, overflow checks.
69 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
70 signal.h, setjmp.h. Include systime.h instead.
71 (saturated_add): New function.
72 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
73 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
74 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
76 (enum profiler_cpu_running): New enum.
77 (profiler_cpu_running): Now of that enum type, not bool.
78 All uses changed to store the new value.
79 (handle_profiler_signal): Rename from sigprof_handler_1,
80 for consistency with other handlers. Do not check whether
81 cpu_log is a hash-table if garbage collecting, since it
82 doesn't matter in that case.
83 (deliver_profiler_signal): Rename from sigprof_handler,
84 for consistency with other handlers.
85 (setup_cpu_timer): New function, with much of what used to be in
86 Fprofiler_cpu_start. Check for out-of-range argument.
87 Prefer timer_settime if available, and prefer
88 thread cputime clocks, then process cputime clocks, then
89 monotonic clocks, to the old realtime clock. Use make_timeval
90 to round more-correctly when falling back to setitimer.
91 (Fprofiler_cpu_start): Use it.
92 (Fprofiler_cpu_stop): Prefer timer_settime if available.
93 Don't assume that passing NULL as the 2nd argument of setitimer
94 is the same as passing a pointer to all-zero storage.
95 Ignore SIGPROF afterwards.
96 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
97 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
98 non-fatal signal handlers. Ignore SIGPROF on startup.
99 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
100 in profiler.c, since sysdep.c now uses it.
102 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
103 Suggested by Eli Zaretskii in
104 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
106 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
108 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
110 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
112 * lisp.h (struct backtrace): Remove indirection for `function' field.
113 * xdisp.c (redisplay_internal):
114 * profiler.c (record_backtrace, sigprof_handler_1):
115 * alloc.c (Fgarbage_collect):
116 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
117 (Fbacktrace_frame): Adjust accordingly.
119 2012-09-28 Glenn Morris <rgm@gnu.org>
121 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
122 (Frun_hook_with_args_until_failure): Doc fixes.
124 2012-09-28 Eli Zaretskii <eliz@gnu.org>
126 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
127 Qautomatic_redisplay and change the symbol name. All users changed.
129 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
131 * profiler.c (sigprof_handler): Fix race condition.
133 2012-09-28 Glenn Morris <rgm@gnu.org>
135 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
137 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
139 Check more robustly for timer_settime.
140 * Makefile.in (LIB_TIMER_TIME): New macro.
142 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
143 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
146 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
148 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
150 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
152 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
154 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
156 * character.h (MAYBE_UNIFY_CHAR): Remove.
157 * charset.c, charset.h (maybe_unify_char): Now static.
158 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
159 Since this stuff is now private to charset.c, there's no need for
160 a public macro and no need to inline by hand.
162 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
163 Stefan Monnier <monnier@iro.umontreal.ca>
164 Juanma Barranquero <lekktu@gmail.com>
166 * profiler.c: New file.
167 * Makefile.in (base_obj): Add profiler.o.
168 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
169 ($(BLD)/profiler.$(O)): New target.
170 * emacs.c (main): Call syms_of_profiler.
171 * alloc.c (Qautomatic_gc): New constant.
172 (MALLOC_PROBE): New macro.
173 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
174 (total_bytes_of_live_objects): New function.
175 (Fgarbage_collect): Use it. Record itself in backtrace_list.
176 Call malloc_probe for the memory profiler.
177 (syms_of_alloc): Define Qautomatic_gc.
178 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
180 (struct backtrace): Move definition...
181 * lisp.h (struct backtrace): ..here.
182 (Qautomatic_gc, profiler_memory_running): Declare vars.
183 (malloc_probe, syms_of_profiler): Declare functions.
184 * xdisp.c (Qautomatic_redisplay): New constant.
185 (redisplay_internal): Record itself in backtrace_list.
186 (syms_of_xdisp): Define Qautomatic_redisplay.
188 2012-09-25 Eli Zaretskii <eliz@gnu.org>
189 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
191 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
193 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
195 Prefer POSIX timers if available.
196 They avoid a race if the timer is too close to the current time.
197 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
198 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
199 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
201 2012-09-25 Eli Zaretskii <eliz@gnu.org>
203 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
205 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
208 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
210 Move Vlibrary_cache to emacs.c and reset before dumping.
212 * lisp.h (reset_image_types): Declare.
213 [WINDOWSNT] (Vlibrary_cache): Declare.
215 * image.c (reset_image_types): New function.
217 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
218 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
219 (Fdump_emacs): Reset Vlibrary_cache and image_types.
221 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
222 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
224 * w32.h (Vlibrary_cache): Do not declare.
226 2012-09-25 Eli Zaretskii <eliz@gnu.org>
228 * w32proc.c (sys_signal): Handle all signals defined by the
229 MS-Windows runtime, not just SIGCHLD. Actually install the signal
230 handlers for signals supported by Windows. Don't override
231 term_ntproc as the handler for SIGABRT.
232 (sigaction): Rewrite to call sys_signal instead of duplicating its
234 (sys_kill): Improve commentary.
236 * w32.c (term_ntproc): Accept (and ignore) one argument, for
237 consistency with a signature of a signal handler. All callers
239 (init_ntproc): Accept an argument DUMPING. If dumping, don't
240 install term_ntproc as a signal handler for SIGABRT, as that
241 should be done by the dumped Emacs.
243 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
245 * w32select.c (term_w32select): Protect against repeated
246 invocation by setting clipboard_owner to NULL after calling
249 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
250 and term_ntproc to their modified signatures.
252 * character.c (char_string, string_char): Remove calls to
253 MAYBE_UNIFY_CHAR. See the discussion starting at
254 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
257 2012-09-25 Chong Yidong <cyd@gnu.org>
259 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
261 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
263 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
264 when encountering an unknown bytecode.
266 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
268 image.c, indent.c: Use bool for booleans.
269 * dispextern.h (struct image_type): Members valid_p, load, init
270 now return bool, not int. All uses changed.
271 * image.c: Omit unnecessary static decls.
272 (x_create_bitmap_mask, x_build_heuristic_mask):
273 Return void, not int, since callers don't care about the return value.
274 (x_create_bitmap_mask, define_image_type, valid_image_p)
275 (struct image_keyword, parse_image_spec, image_spec_value)
276 (check_image_size, image_background)
277 (image_background_transparent, x_clear_image_1)
278 (postprocess_image, lookup_image, x_check_image_size)
279 (x_create_x_image_and_pixmap, xbm_image_p)
280 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
281 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
282 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
283 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
284 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
285 (png_image_p, init_png_functions, png_load_body, png_load)
286 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
287 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
288 (init_gif_functions, gif_load, imagemagick_image_p)
289 (imagemagick_load_image, imagemagick_load, svg_image_p)
290 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
292 * nsimage.m (ns_load_image):
293 * nsterm.m (ns_defined_color):
294 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
295 * xfns.c (x_defined_color):
296 * xterm.c (x_alloc_lighter_color_for_widget)
297 (x_alloc_nearest_color_1, x_alloc_nearest_color)
298 (x_alloc_lighter_color):
299 * indent.c (disptab_matches_widthtab, current_column)
300 (scan_for_column, string_display_width, indented_beyond_p)
301 (compute_motion, vmotion, Fvertical_motion):
302 Use bool for booleans.
304 2012-09-24 Chong Yidong <cyd@gnu.org>
306 * chartab.c (Fset_char_table_default): Obsolete function removed.
308 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
310 Move pid_t related decls out of lisp.h.
311 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
312 (interruptible_wait_for_termination):
313 Move these decls from lisp.h to syswait.h, since they use pid_t.
314 Needed on FreeBSD; see Herbert J. Skuhra in
315 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
316 * callproc.c: Include syswait.h.
318 gnutls.c, gtkutil.c: Use bool for boolean.
319 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
320 (emacs_gnutls_handle_error):
321 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
322 (xg_hide_tooltip, xg_create_frame_widgets)
323 (create_dialog, xg_uses_old_file_dialog)
324 (xg_get_file_with_chooser, xg_get_file_with_selection)
325 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
326 (xg_item_label_same_p, xg_update_menubar)
327 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
328 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
329 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
330 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
331 (update_frame_tool_bar, free_frame_tool_bar):
332 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
333 * nsmenu.m (ns_update_menubar):
334 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
335 * xfns.c (Fx_show_tip) [USE_GTK]:
336 Use bool for boolean.
337 * gtkutil.c (xg_update_frame_menubar):
338 * xmenu.c (update_frame_menubar):
339 Return void, not int, since caller ignores return value.
340 * gtkutil.c (xg_change_toolbar_position):
343 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
345 * makefile.w32-in (BLOCKINPUT_H): Remove.
346 (SYSSIGNAL_H): New macro.
347 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
348 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
349 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
350 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
351 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
352 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
353 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
354 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
355 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
356 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
357 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
358 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
359 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
360 ($(BLD)/w32xfns.$(O)): Update dependencies.
362 2012-09-23 Eli Zaretskii <eliz@gnu.org>
364 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
365 fatal_error_backtrace.
367 * w32proc.c (sys_kill): Undo last change: don't do anything when
368 invoked to deliver SIGABRT to our own process. This is now
369 handled by emacs_raise.
371 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
373 * w32term.c (w32_read_socket): Remove leftover reference to
374 interrupt_input_pending.
376 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
378 Do not use SA_NODEFER.
379 Problem reported by Dani Moncayo in
380 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
382 * sysdep.c (emacs_abort): Do not reset signal handler.
383 * emacs.c (terminate_due_to_signal): Reset signal handler here.
384 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
385 wanted even on POSIXish hosts, and it doesn't work on Windows.
387 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
389 * xterm.c (x_term_init): Call fixup_locale before and after calling
390 gtk_init (Bug#12392).
392 2012-09-23 Chong Yidong <cyd@gnu.org>
394 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
395 Vdynamic_library_alist.
397 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
398 (Fgnutls_available_p): Caller changed.
400 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
401 (Flibxml_parse_xml_region): Likewise.
403 * dispextern.h (struct image_type): Remove arg from init function.
405 * image.c (Finit_image_library, lookup_image_type)
406 (define_image_type): Remove now-unneeded second arg.
407 (init_xpm_functions, init_png_functions, init_jpeg_functions)
408 (init_tiff_functions, init_gif_functions, init_svg_functions):
409 Arglist and w32_delayed_load calling convention changed.
410 (gs_type): Remove init_gs_functions; there is no such function.
411 (valid_image_p, make_image): Fix caller to lookup_image_type.
413 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
415 Simplify and avoid signal-handling races (Bug#12471).
417 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
418 Avoid recursive loop if there's a fatal error in the function itself.
419 * atimer.c (pending_atimers):
420 * blockinput.h: Don't include "atimer.h"; no longer needed.
421 (interrupt_input_pending): Remove. All uses removed.
422 pending_signals now counts both atimers and ordinary interrupts.
423 This is less racy than having three separate pending-signal flags.
424 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
426 Rename from their upper-case counterparts BLOCK_INPUT,
427 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
428 INPUT_BLOCKED_P, and turn into functions. All uses changed.
429 This makes it easier to access volatile variables more accurately.
430 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
431 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
432 that's more reliable if the code is buggy and sets
433 interrupt_input_blocked to a negative value. All uses changed.
434 * atimer.c (deliver_alarm_signal):
435 Remove. No need to deliver this to the parent; any thread can
436 handle this signal now. All uses replaced by underlying handler.
437 * atimer.c (turn_on_atimers):
438 * dispnew.c (handle_window_change_signal):
439 * emacs.c (handle_danger_signal):
440 * keyboard.c (kbd_buffer_get_event):
441 Don't reestablish signal handler; not needed with sigaction.
442 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
444 Rework to avoid unnecessary accesses to volatile variables.
445 (UNBLOCK_INPUT_TO): Now a function.
446 (totally_unblock_input, unblock_input): New decls.
447 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
448 (init_data): Remove. Necessary stuff now done in init_signal.
449 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
450 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
451 (fatal_error_code): Remove; no longer needed.
452 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
453 it doesn't always backtrace. All uses changed. No need to reset
454 signal to default, since sigaction and/or die does that for us now.
455 Use emacs_raise (FOO), not kill (getpid (), FOO).
456 (main): Check more-accurately whether we're dumping.
457 Move fatal-error setup to sysdep.c
458 * floatfns.c: Do not include "syssignal.h"; no longer needed.
459 * gtkutil.c (xg_get_file_name, xg_get_font):
460 Remove no-longer-needed signal-mask manipulation.
461 * keyboard.c, process.c (POLL_FOR_INPUT):
462 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
463 * keyboard.c (read_avail_input): Remove.
464 All uses replaced by gobble_input.
465 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
466 (kbd_buffer_store_event_hold, gobble_input):
467 (record_asynch_buffer_change) [USABLE_SIGIO]:
468 (store_user_signal_events):
469 No need to mess with signal mask.
470 (gobble_input): If blocking input and there are terminals, simply
471 set pending_signals to 1 and return. All hooks changed to not
472 worry about whether input is blocked.
473 (process_pending_signals): Clear pending_signals before processing
474 them, in case a signal comes in while we're processing.
475 By convention callers now test pending_signals before calling us.
476 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
477 New functions, to support changes to blockinput.h.
478 (handle_input_available_signal): Now extern.
479 (reinvoke_input_signal): Remove. All uses replaced by
481 (quit_count): Now volatile, since a signal handler uses it.
482 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
483 All callers changed. Block SIGINT only if not already blocked.
484 Clear sigmask reliably, even if Fsignal returns, which it can.
485 Omit unnecessary accesses to volatile var.
486 (quit_throw_to_read_char): No need to restore sigmask.
487 * keyboard.c (gobble_input, handle_user_signal):
488 * process.c (wait_reading_process_output):
489 Call signal-handling code rather than killing ourselves.
490 * lisp.h: Include <float.h>, for...
491 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
492 (pending_signals): Now volatile.
493 (syms_of_data): Now const if IEEE floating point.
494 (handle_input_available_signal) [USABLE_SIGIO]:
495 (terminate_due_to_signal, record_child_status_change): New decls.
496 * process.c (create_process): Avoid disaster if memory is exhausted
497 while we're processing a vfork, by tightening the critical section
499 (send_process_frame, process_sent_to, handle_pipe_signal)
500 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
502 (send_process): No need for setjmp/longjmp any more, since the
503 SIGPIPE stuff is now gone. Instead, report an error if errno
505 (record_child_status_change): Now extern. PID and W are now args.
506 Return void, not bool. All callers changed.
507 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
508 Remove. All uses removed. This bug should be fixed now in a
510 (wait_for_termination_1): Use waitpid rather than sigsuspend,
511 and record the child status change directly. This avoids the
512 need to futz with the signal mask.
513 (process_fatal_action): Move here from emacs.c.
514 (emacs_sigaction_flags): New function, containing
515 much of what used to be in emacs_sigaction_init.
516 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
517 caught by emacs, to make races less likely.
518 (deliver_process_signal): Rename from handle_on_main_thread.
520 (BACKTRACE_LIMIT_MAX): Now at top level.
521 (thread_backtrace_buffer, threadback_backtrace_pointers):
523 (deliver_thread_signal, deliver_fatal_thread_signal):
524 New functions, for more-accurate delivery of thread-specific signals.
525 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
526 (deliver_arith_signal): Handle in this thread, not
527 in the main thread, since it's triggered by this thread.
528 (maybe_fatal_sig): New function.
529 (init_signals): New arg DUMPING so that we can be more accurate
530 about whether we're dumping. Caller changed.
531 Treat thread-specific signals differently from process-general signals.
532 Block all signals while handling fatal error; that's safer.
533 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
535 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
536 Ignore SIGPIPE unless batch.
537 (emacs_backtrace): Output backtrace for the appropriate thread,
538 which is not necessarily the main thread.
539 * syssignal.h: Include <stdbool.h>.
540 (emacs_raise): New macro.
541 * xterm.c (x_connection_signal): Remove; no longer needed
542 now that we use sigaction.
543 (x_connection_closed): No need to mess with sigmask now.
544 (x_initialize): No need to reset SIGPIPE handler here, since
545 init_signals does this for us now.
547 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
549 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
550 background rect may be larger (Bug#12245).
552 2012-09-23 Chong Yidong <cyd@gnu.org>
554 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
556 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
558 * .gdbinit: Just stop at fatal_error_backtrace.
559 See Stefan Monnier's request in
560 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
561 Remove no-longer-used query of system type.
563 2012-09-22 Chong Yidong <cyd@gnu.org>
565 * search.c (Freplace_match): Doc fix (Bug#12325).
567 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
569 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
570 (Fline_end_position): Doc fix.
572 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
574 2012-09-22 Chong Yidong <cyd@gnu.org>
576 * dispextern.h (struct image_type): Add new slot, storing a type
577 initialization function.
579 * image.c (define_image_type): Call the image initializer function
580 if it is defined. Arguments and return value changed.
581 (valid_image_p, make_image): Callers changed.
582 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
583 (gif_type, imagemagick_type, svg_type, gs_type):
584 Add initialization functions.
585 (Finit_image_library): Call lookup_image_type.
586 (CHECK_LIB_AVAILABLE): Macro deleted.
587 (lookup_image_type): Call define_image_type here, rather than via
588 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
589 (syms_of_image): Move define_image_type calls for xbm_type and
590 pbm_type to lookup_image_type.
592 2012-09-22 Eli Zaretskii <eliz@gnu.org>
594 * keyboard.c (timer_check_2): Move calculation of 'timers' and
595 'idle_timers' from here ...
596 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
597 lists, to avoid infloops when the timer does something stupid,
598 like reinvoke itself with the same or smaller time-out.
601 2012-09-22 Martin Rudalics <rudalics@gmx.at>
603 * window.c (Fsplit_window_internal): Handle only Qt value of
604 Vwindow_combination_limit separately.
605 (Qtemp_buffer_resize): New symbol.
606 (Vwindow_combination_limit): New default value.
609 2012-09-22 Eli Zaretskii <eliz@gnu.org>
611 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
612 the new overlay string. (Bug#10159)
614 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
616 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
617 or that fprintf is async-signal-safe. POSIX doesn't require
620 2012-09-22 Chong Yidong <cyd@gnu.org>
622 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
625 2012-09-22 Kenichi Handa <handa@gnu.org>
627 * composite.c (composition_reseat_it): Handle the case that a
628 grapheme cluster is not covered by a single font (Bug#12352).
630 2012-09-21 Chong Yidong <cyd@gnu.org>
632 * image.c (define_image_type): Avoid adding duplicate types to
633 image_types (Bug#12463). Suggested by Jörg Walter.
635 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
637 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
638 (print_load_command_name): Add case LC_DATA_IN_CODE.
639 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
641 2012-09-21 Glenn Morris <rgm@gnu.org>
643 * eval.c (Frun_hook_with_args_until_success)
644 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
646 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
648 * fileio.c (Ffile_selinux_context): Only call freecon when
649 lgetfilecon succeeded.
650 (Fset_file_selinux_context): Likewise. (Bug#12444)
652 2012-09-21 Eli Zaretskii <eliz@gnu.org>
654 * xdisp.c (try_window_reusing_current_matrix): Under bidi
655 reordering, locate the cursor by calling set_cursor_from_row; if
656 that fails, clear the desired glyph matrix before returning a
657 failure indication to the caller. Fixes leaving garbled display
658 when fast scrolling with a down-key. (Bug#12403)
659 (compute_stop_pos_backwards): Fix a typo that caused crashes while
660 scrolling through multibyte text.
662 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
664 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
665 calling mark_vectorlike since that's the one that marks the window.
666 (mark_discard_killed_buffers): Mark the final cdr.
667 * window.h (struct window): Move prev/next_buffers to the
669 * window.c (make_window): Initialize prev/next_buffers manually.
671 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
673 Omit unused arg EXPECTED from socket hooks.
674 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
675 * nsterm.m (ns_term_init):
676 * termhooks.h (struct terminal.read_socket_hook):
677 * w32inevt.c (w32_console_read_socket):
678 * w32term.c (w32_read_socket):
679 * xterm.c (XTread_socket):
680 Omit unused arg EXPECTED. All callers changed.
681 (store_user_signal_events): Return void, not int, since callers no
682 longer care about the return value. All uses changed.
684 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
686 * w32gui.h (XParseGeometry): Do not declare.
688 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
690 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
691 Ignore 'expected'. See Eli Zaretskii in
692 <http://bugs.gnu.org/12471#8> (last line).
694 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
695 (XParseGeometry): Now static. Substitute extremal values for
696 values that are out of range.
698 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
700 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
702 * nsfns.m (XParseGeometry): Remove.
703 (Fx_create_frame): Call x_set_offset to correctly interpret
706 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
707 (Fx_parse_geometry): If there is a space in string, call
708 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
710 2012-09-17 Eli Zaretskii <eliz@gnu.org>
712 * search.c (scan_buffer): Use character positions in calls to
713 region_cache_forward and region_cache_backward, not byte
714 positions. (Bug#12196)
716 * w32term.c (w32_read_socket): Set pending_signals to 1, like
717 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
719 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
720 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
721 emacs_blocked_malloc, now deleted.
723 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
725 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
726 The workaround was for improving performance on Solaris 2.4, but
727 is getting in the way now. Emacs will still work if someone is
728 still running Solaris 2.4 in a museum somewhere; Sun dropped
729 support for Solaris 2.4 in 2003.
730 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
731 * process.c (create_process) [HAVE_WORKING_VFORK]:
732 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
733 since Emacs no longer uses vfork on that platform.
735 2012-09-17 Glenn Morris <rgm@gnu.org>
737 * emacs.c: Use COPYRIGHT.
739 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
741 Remove configure's --without-sync-input option (Bug#12450).
742 When auditing signal-handling in preparation for cleaning it up,
743 I found that SYNC_INPUT has race conditions and would be a real
744 pain to fix. Since it's an undocumented and deprecated
745 configure-time option, now seems like a good time to remove it.
746 Also see <http://bugs.gnu.org/11080#16>.
747 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
748 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
749 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
751 (check_depth) [XMALLOC_OVERRUN_CHECK]:
752 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
753 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
754 (dont_register_blocks, bytes_used_when_reconsidered)
755 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
756 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
757 [!SYSTEM_MALLOC && !SYNC_INPUT]:
758 Remove. All uses removed.
759 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
760 implementation, one that depends on whether the new macro
761 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
763 * atimer.c (run_timers, handle_alarm_signal):
764 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
765 (handle_async_input, process_pending_signals)
766 (handle_input_available_signal, init_keyboard):
767 * nsterm.m (ns_read_socket):
768 * process.c (wait_reading_process_output):
769 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
770 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
772 * xterm.c (XTread_socket):
774 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
775 * eval.c (handling_signal): Remove. All uses removed.
776 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
777 All uses replaced with the SYNC_INPUT version.
778 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
780 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
783 * font.c (Ffont_shape_gstring): Remove unused local.
785 2012-09-16 Glenn Morris <rgm@gnu.org>
787 * Makefile.in (clean): No longer run nextstep's clean.
789 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
791 (ns-app): Move here from ns.mk, and simplify.
792 (clean): Simplify nextstep entry.
793 * ns.mk: Remove file.
795 2012-09-17 Kenichi Handa <handa@gnu.org>
797 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
798 not covert the last few charactes.
800 2012-09-16 Kenichi Handa <handa@gnu.org>
802 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
803 here, but just check the validity of glyphs in the glyph-string.
805 2012-09-16 Martin Rudalics <rudalics@gmx.at>
807 * window.c (Fwindow_parameter, Fset_window_parameter):
808 Accept any window as argument (Bug#12452).
810 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
812 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
813 to ns_term_init to avoid memory leak.
815 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
816 explicit retain/release.
817 (ns_term_init): Only allow one display. Initialize outerpool and
820 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
822 Port _setjmp fix to POSIXish hosts as well as Microsoft.
823 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
824 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
825 the Microsoft problem in a different way, by altering ../nt/config.nt.
827 2012-09-15 Eli Zaretskii <eliz@gnu.org>
842 * w16select.c: Remove inclusion of setjmp.h, as it is now included
843 by lisp.h. This completes removal of setjmp.h inclusion
844 erroneously announced in the previous commit. (Bug#12446)
846 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
849 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
850 not defined as a macro. The latter happens on MS-Windows.
853 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
855 Port better to POSIX hosts lacking _setjmp (Bug#12446).
856 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
857 Some instances of '#include <setjmp.h>' removed, if the
858 only reason for the instance was because "lisp.h" was included.
859 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
860 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
861 and _longjmp with the new symbols. Emacs already uses _setjmp if
862 available, so this change affects only POSIXish hosts that have
863 sigsetjmp but not _setjmp, such as some versions of Solaris and
864 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
865 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
866 (png_load_body) [HAVE_PNG]:
867 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
868 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
869 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
870 since PNG requires jmp_buf. This is the only exception to the
871 general rule that we now use sys_setjmp and sys_longjmp.
872 This exception is OK since this code does not change the signal
873 mask or longjmp out of a signal handler.
875 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
877 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
878 Include "syssignal.h", for 'main_thread'.
880 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
882 Avoid out-of-range marker position (Bug#12426).
883 * insdel.c (replace_range, replace_range_2):
884 Adjust markers before overlays, as suggested by comments.
885 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
886 Remove redundant check before calling offset_intervals.
888 2012-09-14 Martin Rudalics <rudalics@gmx.at>
890 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
891 current buffer (Bug#12387).
893 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
895 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
897 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
899 Use a more backwards-compatible timer format (Bug#12430).
900 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
901 vector element, not from the 4th, since PSECS is now at the end.
902 (Fcurrent_idle_time): Doc fix.
904 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
906 Function to mark objects and remove killed buffers at once.
907 * alloc.c (discard_killed_buffers): Rename to ...
908 (mark_discard_killed buffers) ... new name. Add marking
909 of remaining objects. Fix comment. Adjust users.
910 (mark_object): Do not touch frame buffer lists here.
911 * frame.c (delete_frame): Reset frame buffer lists here.
913 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
915 Better workaround for GNOME bug when --enable-gcc-warnings.
916 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
917 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
918 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
920 Simplify SIGIO usage (Bug#12408).
921 The code that dealt with SIGIO was crufty and confusing, e.g., it
922 played tricks like "#undef SIGIO" but these tricks were not used
923 consistently. Simplify mostly by not #undeffing standard symbols,
924 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
925 or not as we please) rather than "defined SIGIO" (standard symbol
926 that we probably shouldn't #undef).
927 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
928 Modules that need it can include it.
929 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
930 * dispextern.h (ignore_sigio): New decl.
931 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
932 unconditionally, since it's now a no-op if !USABLE_SIGIO.
933 * emacs.c (shut_down_emacs):
934 * keyboard.c (kbd_buffer_store_event_hold):
935 Use ignore_sigio rather than invoking 'signal' directly.
936 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
938 (FIONREAD, SIGIO): Do not #undef.
939 (tty_read_avail_input): Use #error rather than a syntax error.
940 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
941 for I_PIPE, used by SETUP_SLAVE_PTY.
942 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
943 * sysdep.c (croak): Remove; no longer needed. This bit of
944 temporary code, with Fred N. Fish's comment that it's temporary,
945 has been in Emacs since at least 1992!
946 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
947 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
948 * syssignal.h (croak): Remove decl.
949 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
950 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
951 now that we're termios-only.
952 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
953 * term.c (dissociate_if_controlling_tty): Use #error rather than
956 Work around GCC and GNOME bugs when --enable-gcc-warnings.
957 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
958 to work around GNOME bug 683906.
959 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
960 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
961 This works around GCC bug 54561.
963 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
965 More fixes for 'volatile' and setjmp/longjmp.
966 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
967 * image.c (struct png_load_context) [HAVE_PNG]: New type.
968 (png_load_body) [HAVE_PNG]:
969 (jpeg_load_body) [HAVE_JPEG]:
970 New function, with most of the old parent function's body.
971 (png_load) [HAVE_PNG]:
972 (jpeg_load) [HAVE_JPEG]:
973 Invoke the new function, to avoid longjmp munging our locals.
974 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
975 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
976 longjmp is passed 2, as the C standard doesn't guarantee this.
977 Instead, store the failure code into mgr->failure_code.
979 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
981 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
982 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
983 (syms_of_keyboard): Remove support for unread-command-char.
985 2012-09-12 Eli Zaretskii <eliz@gnu.org>
987 * w32proc.c (sys_kill): If PID is our process ID and the signal is
988 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
989 violation. (Bug#12426)
991 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
993 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
995 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
997 * eval.c: Add `inhibit-debugger'.
998 (Qinhibit_debugger): New symbol.
999 (call_debugger): Bind it instead of Qdebug_on_error.
1000 (maybe_call_debugger): Test Vinhibit_debugger.
1001 (syms_of_eval): Define inhibit-debugger.
1002 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1003 (syms_of_xdisp): Remove inhibit-debug-on-message.
1005 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1007 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1008 If a nonvolatile local variable is written before a _longjmp to
1009 the frame containing the variable, and is read after the _longjmp,
1010 the value read is indeterminate. Some local variables of type
1011 'struct handler' and 'struct catchtag' are used in this way, so
1012 mark each of their slots as volatile if the slot can be set before
1013 _longjmp and read afterwards.
1014 * lisp.h (struct handler): var and chosen_clause are now volatile.
1015 (struct catchtag): val, next, and pdlcount are now volatile.
1017 * bidi.c (bidi_push_it, bidi_pop_it):
1018 * fns.c (copy_hash_table):
1019 * image.c (define_image_type):
1020 * keyboard.c (kbd_buffer_store_event_hold):
1021 * process.c (Fprocess_send_eof):
1022 * xfaces.c (x_create_gc) [HAVE_NS]:
1023 * xgselect.c (xg_select):
1024 Prefer assignment to memcpy when either will do.
1026 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1027 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1028 time an item is removed. No need to mark this function 'inline';
1029 the compiler knows better than we do.
1031 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1033 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1034 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1035 to change_frame_size (Bug#12388).
1036 (windowDidResize:): Pass YES to updateFrameSize.
1038 * nsterm.h: Add delay parameter to updateFrameSize.
1040 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1042 Discard killed buffers from deleted window and frame objects.
1043 This reduces an amount of references to killed buffers and
1044 helps GC to reclaim them faster.
1045 * alloc.c (discard_killed_buffers): New function.
1046 (mark_object): Use it for deleted windows and frames.
1047 (mark_object): If symbol's value is set up for a killed buffer
1048 or deleted frame, restore it's global binding.
1049 * data.c (swap_in_global_binding): Add GC notice.
1050 (swap_in_symval_forwarding): Use convenient set_blv_where.
1051 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1052 * window.h: ... to here.
1054 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1056 Convenient macro to check whether the buffer is live.
1057 * buffer.h (BUFFER_LIVE_P): New macro.
1058 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1059 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1061 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1063 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1064 composition cases (Bug#12364).
1066 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1067 overhang of succeeding glyphs overlapping box cursor.
1069 * w32term.c (x_draw_glyph_string): Likewise.
1071 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1073 Simplify, document, and port floating-point (Bug#12381).
1074 The porting part of this patch fixes bugs on non-IEEE platforms
1075 with frexp, ldexp, logb.
1076 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1078 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1079 support, by removing commented-out code and briefly listing the
1080 C89 functions excluded. The commented-out stuff was confusing
1081 maintenance, e.g., we thought we needed cbrt but it was commented out.
1082 (logb): Remove decl; no longer needed.
1083 (isfinite): New macro, if not already supplied.
1084 (isnan): Don't replace any existing macro.
1085 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1086 are present on all C89 platforms.
1087 (Ffrexp): Do not special-case zero, as frexp does the right thing
1089 (Flogb): Do not use logb, as it doesn't have the desired meaning
1090 on hosts that use non-base-2 floating point. Instead, stick with
1091 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1092 frexp, to avoid getting an unspecified result.
1094 * xdisp.c (Qinhibit_debug_on_message): Now static.
1096 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1098 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1099 NSBezierPath (Bug#12131).
1101 2012-09-10 Chong Yidong <cyd@gnu.org>
1103 * fns.c (Fdelq, Fdelete): Doc fix.
1105 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1107 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1108 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1110 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1112 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1113 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1116 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1118 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1119 left fringe if the window has a left margin. This avoids leaving
1120 traces of the cursor because its leftmost pixel is not drawn over.
1122 * dispnew.c (update_window_line): When the left margin area of a
1123 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1124 that screen line. (Bug#12277)
1126 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1128 Assume C89 or later for math functions (Bug#12381).
1129 This simplifies the code, and makes it a bit smaller and faster,
1130 and (most important) makes it easier to clean up signal handling
1131 since we can stop worring about floating-point exceptions in
1132 library code. That was a problem before C89, but the problem
1133 went away many years ago on all practical Emacs targets.
1134 * data.c, image.c, lread.c, print.c:
1135 Don't include <math.h>; no longer needed.
1136 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1137 might be autoconfigured, as that never happens.
1139 * doprnt.c (DBL_MAX_10_EXP):
1140 * print.c (DBL_DIG):
1141 Remove. C89 or later always defines these.
1142 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1143 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1144 (arith_error, domain_error, domain_error2):
1145 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1146 no longer needed -- we simply return what C returns. All uses removed.
1147 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1149 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1150 Remove. All uses expanded, as these macros are no longer used
1151 more than once and are now more trouble than they're worth.
1152 (Ftan): Use tan, not sin / cos.
1153 (Flogb): Assume C89 frexp.
1154 (fmod_float): Assume C89 fmod.
1155 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1156 (init_floatfns): Remove. All uses removed.
1158 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1160 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1161 compositeToPoint for OSX < 10.6 (Bug#12390).
1163 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1165 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1166 This produces more-accurate results.
1168 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1170 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1171 changes (Bug#12088).
1173 2012-09-08 Chong Yidong <cyd@gnu.org>
1175 * syntax.c (Fstring_to_syntax): Doc fix.
1177 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1179 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1180 in the internal border.
1181 (x_set_window_size): Remove static variables and their usage.
1182 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1183 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1184 Remove fringe/internal border adjustment (Bug#11052).
1185 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1186 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1187 (ns_fix_rect_ibw): Remove.
1188 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1189 (ns_dumpglyphs_box_or_relief): Ditto.
1190 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1192 (ns_dumpglyphs_image): Ditto.
1193 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1195 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1196 their usage. Add fringe_extended_p and its use as in other terms.
1197 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1198 scroll bar was removed.
1199 (updateFrameSize): New function.
1200 (windowDidResize): Move code to updateFrameSize and call it.
1202 * nsterm.h (EmacsView): Add updateFrameSize.
1204 2012-09-07 Chong Yidong <cyd@gnu.org>
1206 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1208 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1210 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1212 More signal-handler cleanup (Bug#12327).
1213 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1214 Problem introduced when merging patches. Noted by Eli Zaretskii in
1215 <http://bugs.gnu.org/12327#67>.
1216 * floatfns.c: Comment fix.
1217 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1218 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1219 and anyway the declaration is harmless even if SIGDANGER is not defined.
1220 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1221 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1222 source files not surprisingly expected syssignal.h to define, or
1223 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1224 Include <sys/ioctl.h>, for FIONREAD.
1225 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1226 This eliminates a problem whereby other files mysteriously had
1227 to include "syssignal.h" before including "systty.h" if they
1228 wanted to use "#ifdef SIGIO".
1230 2012-09-07 Eli Zaretskii <eliz@gnu.org>
1232 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1234 * w32.c (sigemptyset): Empty the set.
1235 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1237 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1239 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1241 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1242 (mark_object): Likewise for frame objects.
1244 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1246 * syssignal.h (handle_on_main_thread): Always declare,
1247 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1248 This ports to platforms without HAVE_PTHREAD.
1250 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1252 Signal-handler cleanup (Bug#12327).
1253 Emacs's signal handlers were written in the old 4.2BSD style with
1254 sigblock and sigmask and so forth, and this led to some
1255 inefficiencies and confusion. Rewrite these to use
1256 pthread_sigmask etc. without copying signal sets around. Also,
1257 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1258 'signal', and instead use functions that do not attempt to take
1259 over the system name space. This patch causes Emacs's text
1260 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1261 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1262 Do not include <signal.h> or "syssignal.h", as these
1263 modules do not use signals.
1264 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1265 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1266 Do not include <signal.h>, as "syssignal.h" does that for us now.
1267 * atimer.c (sigmask_atimers): New function.
1268 (block_atimers, unblock_atimers): New functions,
1269 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1271 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1272 no longer needed here.
1273 * emacs.c (main): Inspect existing signal handler with sigaction,
1274 so that there's no need to block and unblock SIGHUP.
1275 * sysdep.c (struct save_signal): New member 'action', replacing
1276 old member 'handler'.
1277 (save_signal_handlers, restore_signal_handlers):
1278 Use sigaction instead of 'signal' to save and restore.
1279 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1280 New function. All users of 'signal' modified to use set_sighandler
1281 if they're writeonly, and to use sys_signal if they're read+write.
1282 (emacs_sigaction_init, forwarded_signal): New functions.
1283 (sys_signal): Remove. All uses replaced by calls to sigaction
1284 and emacs_sigaction_init, or by direct calls to 'signal'.
1285 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1286 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1287 all uses replaced by pthread_sigmask etc. calls.
1288 * syssignal.h: Include <signal.h>.
1289 (emacs_sigaction_init, forwarded_signal): New decls.
1290 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1291 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1292 (sigmask, sys_sigmask): Remove; no longer needed.
1293 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1294 (sigblock, sigunblock, sigfree):
1295 (sigsetmask) [!defined sigsetmask]:
1296 Remove. All uses replaced by pthread_sigmask.
1297 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1298 no longer need to be replaced, and its typical old uses
1299 are now done via emacs_sigaction_init and sigaction.
1300 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1301 (sys_sigdel): Remove; unused.
1302 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1304 2012-09-06 Eli Zaretskii <eliz@gnu.org>
1306 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1307 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1309 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1311 Explicitly mark buffer_defaults and buffer_local_symbols.
1312 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1313 mark_local_symbols here.
1314 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1315 since special buffers aren't marked here any more.
1316 (allocate_buffer): Chain new buffer with all_buffers here...
1317 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1319 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1320 (syms_of_buffer): Remove staticpro of the above.
1321 (init_buffer_once): Set names for buffer_defaults and
1322 buffer_local_symbols.
1324 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1326 Use bool for booleans in font-related modules.
1327 * font.c (font_intern_prop, font_style_to_value)
1328 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1329 (generate_otf_features, font_check_otf_features, font_check_otf)
1330 (font_match_p, font_list_entities, font_at):
1331 * fontset.c (fontset_id_valid_p, reorder_font_vector
1332 (fontset_find_font, Fset_fontset_font)
1333 (face_suitable_for_char_p) [0]:
1334 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1335 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1336 (m17n_flt_initialized, ftfont_shape_by_flt):
1337 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1338 * nsfont.m (nsfont_draw):
1339 * w32font.c (w32font_draw):
1340 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1341 Use bool for booleans.
1342 * font.h: Adjust to above API changes.
1343 (struct font, struct font_driver, struct font_driver_list):
1344 Use bool for booleans.
1345 (struct font): Remove useless member encoding_type.
1347 * fontset.c, xftfont.c: Omit unnecessary static decls.
1349 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1351 * alloc.c (mark_object): Revert window marking code
1352 since it's unsafe for the Fset_window_configuration.
1354 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1356 Fix race conditions with signal handlers and errno (Bug#12327).
1357 Be more systematic about preserving errno whenever a signal
1358 handler returns, even if it's not in the main thread. Do this by
1359 renaming signal handlers to distinguish between signal delivery
1360 and signal handling. All uses changed.
1361 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1362 * data.c (deliver_arith_signal): Rename from arith_error.
1363 * dispnew.c (deliver_window_change_signal): Rename from
1364 window_change_signal.
1365 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1366 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1367 * keyboard.c (deliver_input_available_signal): Rename from
1368 input_available_signal.
1369 (deliver_user_signal): Rename from handle_user_signal.
1370 (deliver_interrupt_signal): Rename from interrupt_signal.
1371 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1372 (deliver_child_signal): Rename from sigchld_handler.
1373 * atimer.c (handle_alarm_signal):
1374 * data.c (handle_arith_signal):
1375 * dispnew.c (handle_window_change_signal):
1376 * emacs.c (handle_fatal_signal, handle_danger_signal):
1377 * keyboard.c (handle_input_available_signal):
1378 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1379 * process.c (handle_pipe_signal, handle_child_signal):
1380 New functions, with the actual signal-handling code taken from the
1381 original respective signal handlers, sans the sporadic attempts to
1382 preserve errno, since that's now done by handle_on_main_thread.
1383 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1384 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1385 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1387 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1388 Move initialization of main_thread to sysdep.c's init_signals.
1389 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1390 our usage, and simplifies the mainline code.
1391 (record_child_status_change): New static function, as a helper
1392 for handle_child_signal, and with most of the old child handler's
1394 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1395 (handle_child_signal): Use the above.
1396 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1397 Moved here from emacs.c.
1398 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1399 code moved here from emacs.c's main function.
1400 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1401 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1402 This lets callers save and restore errno properly.
1404 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1406 Remove redundant or unused things here and there.
1407 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1408 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1409 * editfns.c (Fcompare_buffer_substrings): Likewise.
1410 * frame.h (struct terminal, struct font_driver_list):
1411 Remove redundant declarations.
1412 * window.h (Qleft, Qright): Likewise.
1414 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1416 Do not mark objects from deleted buffers, windows and frames.
1417 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1418 (mark_object): Likewise for windows and frames.
1420 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1422 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1423 buffer_defaults and buffer_local_symbols as valid objects.
1424 Return special value to denote them.
1426 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1428 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1429 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1430 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1431 (file_name_absolute_p, Fsubstitute_in_file_name):
1432 (check_executable, check_writable, Ffile_accessible_directory_p)
1433 (Fset_file_selinux_context, Fdefault_file_modes)
1434 (Finsert_file_contents, choose_write_coding_system)
1435 (Fwrite_region, build_annotations, a_write, e_write)
1437 * filelock.c (boot_time_initialized, get_boot_time)
1438 (get_boot_time_1, lock_file_1, within_one_second):
1439 * floatfns.c (in_float):
1440 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1441 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1442 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1443 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1444 * window.c (compare_window_configurations):
1445 Use bool for booleans.
1446 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1447 (Fdefault_file_modes): Now mode_t, not int, for modes.
1448 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1449 (internal_delete_file): Now returns void, not a (boolean) int,
1450 since nobody was looking at the return value.
1451 * lisp.h, window.h: Adjust to above API changes.
1453 * xdisp.c (set_message): Simplify and reindent last change.
1455 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
1457 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1459 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1461 * eval.c (call_debugger): Make the function non-static so that we
1462 can call it from set_message.
1464 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1465 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1467 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1469 Give more-useful info on a fatal error (Bug#12328).
1470 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1471 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1472 of doing the work ourselves.
1473 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1474 do most of the work.
1475 (fatal_error_backtrace): New function, taken from the guts
1476 of the old fatal_error_signal, but with a new option to output
1478 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1479 info about the signal than just its number.
1480 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1481 * sysdep.c: Include <execinfo.h>
1482 (emacs_backtrace): New function, taken partly from the previous
1483 code of the 'die' function.
1484 (emacs_abort): Call fatal_error_backtrace rather than abort.
1486 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1488 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1489 eager (load-time) macro-expansion.
1490 * lisp.mk (lisp): Add macroexp.
1492 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1494 Simplify redefinition of 'abort' (Bug#12316).
1495 Do not try to redefine the 'abort' function. Instead, redo
1496 the code so that it calls 'emacs_abort' rather than 'abort'.
1497 This removes the need for the NO_ABORT configure-time macro
1498 and makes it easier to change the abort code to do a backtrace.
1499 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1500 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1501 Remove; sysdep.c's emacs_abort now takes its place.
1502 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1503 'abort' changed to use 'emacs_abort'.
1504 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1505 (abort) [!defined abort]: Rename to ...
1506 (emacs_abort): ... new name.
1507 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1508 the place of the old 'abort' in emacs.c.
1509 * w32.c, w32fns.c (abort): Do not #undef.
1510 * w32.c (emacs_abort): Rename from w32_abort.
1512 2012-09-04 Eli Zaretskii <eliz@gnu.org>
1514 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1515 offsets[j].dv, since the y axis of the screen coordinates points
1516 down, while the y axis of the font definition coordinates points
1517 up. This fixes display of Arabic diacritics such as KASRA and
1518 KASRATAN. (Bug#11860)
1520 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1522 Be more systematic about _setjmp vs setjmp.
1523 * alloc.c (test_setjmp, mark_stack):
1524 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1525 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1526 (png_load, my_error_exit, jpeg_load):
1527 * process.c (send_process_trap, send_process):
1528 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1529 The underscored versions are up to 30x faster on some hosts.
1530 Formerly, the code used setjmp+longjmp sometimes and
1531 _setjmp+_longjmp at other times, with no particular reason to
1532 prefer setjmp+longjmp.
1534 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1536 Fix minor problem found by static checking.
1537 * buffer.c (Fdelete_all_overlays): Return nil.
1539 2012-09-03 Martin Rudalics <rudalics@gmx.at>
1541 * buffer.c (Fdelete_all_overlays): New function.
1543 2012-09-03 Chong Yidong <cyd@gnu.org>
1545 * gtkutil.c: Add extern decl for Qxft.
1547 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1549 * emacs.c, eval.c: Use bool for boolean.
1550 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1551 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1552 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1553 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1554 (main, decode_env_path, Fdaemon_initialized):
1555 * eval.c (call_debugger, Finteractive_p, interactive_p):
1556 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1557 (maybe_call_debugger, Fbacktrace):
1558 * process.c (read_process_output, exec_sentinel):
1559 Use bool for booleans.
1560 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1561 All callers changed.
1562 * eval.c (interactive_p): Omit always-true boolean argument
1563 EXCLUDE_SUBRS_P. All callers changed.
1564 * dispextern.h, lisp.h: Reflect above API changes.
1565 * firstfile.c (dummy): Use the address of 'main', whose signature
1566 won't change, instead of the address of 'initialize', whose
1567 signature just changed from int to bool.
1568 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1569 * msdos.c (fatal_error_in_progress): ... from here.
1570 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1572 (redisplay_internal, unwind_redisplay): Simply clear
1573 REDISPLAYING_P when unwinding, instead of saving its previous,
1574 always-false value and then restoring it.
1576 Clean up some extern decls.
1577 Mostly, this hoists extern decls out of .c files and into .h files.
1578 That way, we're more likely to catch errors if the interfaces change.
1579 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1580 declare xg_mark_data.
1581 * dispextern.h (x_frame_parm_handlers):
1583 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1584 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1585 (Qultra_bold, Qoblique, Qitalic):
1586 Move extern decl here from .c file.
1587 * alloc.c (xg_mark_data) [USE_GTK]:
1589 * eval.c (Qlexical_binding):
1590 * fns.c (time) [!HAVE_UNISTD_H]:
1591 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1592 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1593 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1594 * lread.c (Qinternal_interpreter_environment):
1595 * minibuf.c (Qbuffer):
1596 * process.c (QCfamily, QCfilter):
1597 * widget.c (free_frame_faces):
1598 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1599 * xfont.c (x_clear_errors):
1600 * xterm.c (x_frame_parm_handlers):
1601 Remove now-redundant extern decls.
1602 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1603 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1605 * xfaces.c: Remove unnecessary static decls.
1606 * xterm.c (updating_frame): Remove decl of nonexistent object.
1608 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1609 when building globals.h, as the objects that are not built on
1610 this host are not needed to compile C files on this host.
1612 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1614 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1616 * frame.h: Add missing prototype for x_wm_set_size_hint.
1618 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1620 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1621 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1622 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1623 (Fsubstitute_command_keys):
1624 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1625 (save_excursion_save, save_excursion_restore)
1626 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1627 (format_time_string, general_insert_function)
1628 (make_buffer_string, make_buffer_string_both)
1629 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1630 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1631 (copy_text, insert_1, insert_1_both, insert_from_string)
1632 (insert_from_string_before_markers, insert_from_string_1)
1633 (insert_from_buffer, insert_from_buffer_1, replace_range)
1634 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1635 (del_range_2, modify_region):
1636 * intervals.c (intervals_equal, balance_possible_root_interval)
1637 (adjust_intervals_for_insertion, merge_properties_sticky)
1638 (graft_intervals_into_buffer, lookup_char_property)
1639 (adjust_for_invis_intang, set_point_both)
1640 (get_property_and_range, compare_string_intervals)
1641 (set_intervals_multibyte_1, set_intervals_multibyte):
1642 * keyboard.c (decode_timer):
1643 Use bool for boolean.
1644 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1645 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1647 2012-09-02 Chong Yidong <cyd@gnu.org>
1649 * keymap.c (push_key_description): Print M-TAB as C-M-i
1652 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1654 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1655 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1656 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1657 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1658 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1659 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1660 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1662 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1664 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1665 more than one grapheme cluster passed to the shaper: compute the
1666 offset adjustment values separately for each cluster. (Bug#11860)
1668 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1669 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1670 about implicit conversions from integer to pointer.
1672 2012-09-01 Daniel Colascione <dancol@dancol.org>
1674 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1675 system used too early.
1677 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1679 Better seed support for (random).
1680 * emacs.c (main): Call init_random.
1681 * fns.c (Frandom): Set the seed from a string argument, if given.
1682 Remove long-obsolete Gentzel cruft.
1683 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1684 (init_random): New function.
1686 2012-09-01 Daniel Colascione <dancol@dancol.org>
1688 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1689 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1690 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1691 x_wm_set_size_hint, x_query_colors, x_real_positions,
1692 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1693 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1694 all of which have been moved to common code.
1696 * xfaces.c: Include TERM_HEADER instead of listing all possible
1697 window-system headers.
1699 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1702 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1703 directly accessing frame internals.
1705 * w32font.h: Include font.h. Define syms_of_w32font and
1708 * process.c: Include TERM_HEADER instead of listing all possible
1709 window-system headers.
1711 * nsterm.h: Remove declarations now in frame.h.
1712 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
1714 * menu.c: Include TERM_HEADER instead of listing all possible
1715 window-system headers.
1717 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1720 * keyboard.c: Include TERM_HEADER instead of listing all possible
1721 window-system headers.
1723 * image.c: Include TERM_HEADER instead of listing all possible
1724 window-system headers. Declare Vlibrary_cache when compiling for
1727 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1728 window system declarations.
1730 * frame.h: Move common functions here: set_frame_menubar,
1731 x_set_window_size, x_sync, x_get_focus_frame,
1732 x_set_mouse_position, x_set_mouse_pixel_position,
1733 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1734 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1735 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1736 x_activate_menubar, x_real_positions, x_bitmap_icon,
1737 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1740 * frame.c: Include TERM_HEADER instead of listing all possible
1741 window-system headers.
1743 * font.c: Include TERM_HEADER instead of listing all possible
1744 window-system headers.
1746 * emacs.c: Include TERM_HEADER.
1748 * dispnew.c: Include TERM_HEADER instead of listing all possible
1749 window-system headers.
1751 * ccl.h: Include character.h.
1753 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1754 the current window system; include in list of objects to link into
1757 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1759 Remove mark_ttys function and fix tty_display_info initialization.
1760 * lisp.h (mark_ttys): Remove prototype.
1761 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1762 to mark_ttys because all possible values of 'top_frame' slot are
1763 the frames which are reachable from Vframe_list.
1764 * term.c (mark_ttys): Remove.
1765 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1767 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1769 Change struct frame bitfields from unsigned char to unsigned.
1770 * frame.h (struct frame): Change type of 'display_preempted',
1771 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1772 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1773 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1774 bitfields from unsigned char to unsigned.
1776 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1778 Remove unused member of struct x_output and struct w32_output.
1779 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1780 * w32term.h (struct w32_output): Likewise.
1782 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1784 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1785 does not become zero (Bug#12234).
1787 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1789 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1790 for GCC 4.7.1 x86-64.
1792 2012-08-30 Glenn Morris <rgm@gnu.org>
1794 * lread.c (init_lread): For out-of-tree builds, only add the
1795 source directory's site-lisp dir to the load-path if it exists,
1796 consistent with in-tree builds. (Bug#12302)
1798 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1800 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1801 button_values to NULL. Call setStykeMask so dialogs get a close button.
1802 (windowShouldClose:): Set window_closed.
1803 (dealloc): New member, free button_values.
1804 (process_dialog:): Make member function. Remove window argument,
1805 replace window with self. Count buttons and allocate and store values
1807 (addButton:value:row:): value is int with the name tag. Call setTag
1808 with tag. Remove return self, declare return value as void.
1809 (addString:row:): Remove return self, declare return value as void.
1810 (addSplit): Remove return self, declare return value as void.
1811 (clicked:): Remove return self, declare return value as void.
1812 Set dialog_return to button_values[seltag]. Code formatting change.
1813 (initFromContents:isQuestion:): Adjust call to process_dialog.
1814 Code formatting change.
1815 (timeout_handler:): Set timer_fired to YES.
1816 (runDialogAt:): Set timer_fired to NO.
1817 Handle click on close button as quit.
1819 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1820 Add window_closed and button_values. Add void as return value for
1821 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1822 Add process_dialog as new member.
1824 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1826 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1827 is not one of the heaps we manage. (Bug#12242)
1829 2012-08-28 Glenn Morris <rgm@gnu.org>
1831 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1833 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1835 * window.c (Fset_window_configuration): Remove handling of
1836 auto-buffer-name window parameter. Install revision of reverted
1839 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1841 Do not allow to set major mode for a dead buffer.
1842 * buffer.c (Fset_buffer_major_mode): Signal an error
1843 if the buffer is dead.
1844 (Fother_buffer, other_buffer_safely): Remove redundant
1847 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1849 Always use set_buffer_if_live to restore original buffer at unwind.
1850 * buffer.h (record_unwind_current_buffer): New function.
1851 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1852 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1853 * undo.c, window.c: Adjust users.
1854 * buffer.c (set_buffer_if_live): Fix comment.
1856 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1858 Fix usage of set_buffer_internal.
1859 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1860 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1861 * coding.c (decode_coding): Omit redundant test.
1862 * fileio.c (decide_coding_unwind): Likewise.
1863 * fns.c (secure_hash): Likewise.
1864 * insdel.c (modify_region): Likewise.
1865 * keyboard.c (command_loop_1): Likewise.
1866 * print.c (PRINTFINISH): Likewise.
1867 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1869 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1871 * dispnew.c: Use bool for boolean.
1872 (frame_garbaged, display_completed, delayed_size_change)
1873 (fonts_changed_p, add_window_display_history)
1874 (add_frame_display_history, verify_row_hash)
1875 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1876 (row_equal_p, realloc_glyph_pool)
1877 (allocate_matrices_for_frame_redisplay)
1878 (showing_window_margins_p)
1879 (adjust_frame_glyphs_for_frame_redisplay)
1880 (build_frame_matrix_from_leaf_window, make_current)
1881 (mirrored_line_dance, mirror_line_dance, update_frame)
1882 (update_window_tree, update_single_window)
1883 (check_current_matrix_flags, update_window, update_text_area)
1884 (update_window_line, set_window_update_flags, scrolling_window)
1885 (update_frame_1, scrolling, buffer_posn_from_coords)
1886 (do_pending_window_change, change_frame_size)
1887 (change_frame_size_1, sit_for):
1888 Use bool for boolean.
1889 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1890 and remove last int (actually boolean) argument, which was always 0.
1891 All callers changed.
1892 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1893 * dispextern.h (struct composition_it): Use bool for boolean.
1894 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1895 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1896 * dired.c (file_name_completion):
1897 Use bool for boolean. (This was missed in an earlier change.)
1899 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1901 * window.c (Fset_window_configuration): Revert first part of
1904 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1906 * nsterm.h (NSPanel): New class variable dialog_return.
1908 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
1909 Initialize dialog_return.
1910 (windowShouldClose:): Use stop instead of stopModalWithCode.
1911 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1912 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1914 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1917 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1919 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1920 * composite.c (find_composition, composition_gstring_p)
1921 (composition_reseat_it, find_automatic_composition):
1922 * data.c (let_shadows_buffer_binding_p)
1923 (let_shadows_global_binding_p, set_internal, make_blv)
1924 (Fmake_variable_buffer_local, Fmake_local_variable)
1925 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1926 (cons_to_signed, arith_driver):
1927 * dbusbind.c (xd_in_read_queued_messages):
1928 * dired.c (directory_files_internal, file_name_completion):
1929 Use bool for booleans.
1930 * dired.c (file_name_completion):
1931 * process.h (fd_callback):
1932 Omit int (actually boolean) argument. It wasn't being used.
1934 * composite.h, lisp.h: Reflect above API changes.
1936 * cmds.c, coding.c: Use bool for booleans.
1937 * cmds.c (move_point, Fself_insert_command):
1938 * coding.h (struct composition status, struct coding_system):
1939 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1940 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1941 (emacs_mule_char, decode_coding_emacs_mule)
1942 (encode_coding_emacs_mule, detect_coding_iso_2022)
1943 (decode_coding_iso_2022, encode_invocation_designation)
1944 (encode_designation_at_bol, encode_coding_iso_2022)
1945 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1946 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1947 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1948 (encode_coding_raw_text, detect_coding_charset)
1949 (decode_coding_charset, encode_coding_charset, detect_eol)
1950 (detect_coding, get_translation_table, produce_chars)
1951 (consume_chars, reused_workbuf_in_use)
1952 (make_conversion_work_buffer, code_conversion_save)
1953 (decode_coding_object, encode_coding_object)
1954 (detect_coding_system, char_encodable_p)
1955 (Funencodable_char_position, code_convert_region)
1956 (code_convert_string, code_convert_string_norecord)
1957 (Fset_coding_system_priority):
1958 * fileio.c (Finsert_file_contents):
1959 Use bool for booleans.
1960 * coding.h, lisp.h: Reflect above API changes.
1961 * coding.c: Remove unnecessary static function decls.
1962 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1963 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1964 not a boolean 'int', since callers never look at the return value.
1965 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1966 * coding.h (decoding_buffer_size, encoding_buffer_size)
1967 (emacs_mule_string_char): Remove unused extern decls.
1968 (struct iso_2022_spec, struct coding_system):
1969 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1970 (struct emacs_mule_spec): Remove unused field 'full_support'.
1971 All initializations removed.
1972 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1974 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1976 Fix spare memory change (Bug#12286).
1977 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1978 (valid_lisp_object_p): Likewise.
1980 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1982 * window.c (Fset_window_configuration): Record any window's old
1983 buffer if it's replaced (see Bug#8789). If the new current
1984 buffer doesn't appear in the selected window, go to its old
1987 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1989 Special MEM_TYPE_SPARE to denote reserved memory.
1990 * alloc.c (enum mem_type): New memory type.
1991 (refill_memory_reserve): Use new type for spare memory.
1992 This prevents live_cons_p and live_string_p from incorrect
1993 detection of uninitialized objects from spare memory as live.
1995 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1998 * Makefile.in (.PHONY): versioclean -> versionclean.
2000 Remove unused external symbols.
2001 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2002 * window.c (Qwindow_valid_p, decode_valid_window):
2003 Now static, not extern.
2004 * data.c (Qinterval): Remove; unused.
2005 (syms_of_data): Do not define 'interval'.
2006 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2007 * window.h (decode_valid_window):
2010 * character.c, charset.c, chartab.c: Use bool for booleans.
2011 * character.c (lisp_string_width, string_count_byte8)
2012 (string_escape_byte8):
2013 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2014 (load_charset_map_from_file, map_charset_chars)
2015 (Fdefine_charset_internal, define_charset_internal)
2016 (Fdeclare_equiv_charset, find_charsets_in_text)
2017 (Ffind_charset_region, char_charset, Fiso_charset):
2018 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2019 (sub_char_table_set, sub_char_table_set_range)
2020 (char_table_set_range, optimize_sub_char_table)
2021 (map_sub_char_table):
2022 Use bool for boolean.
2023 * character.c (str_to_unibyte): Omit last boolean argument; it was
2024 always 0. All callers changed.
2025 * character.h, charset.h: Adjust to match previous changes.
2026 * character.h (char_printable_p): Remove decl of nonexistent function.
2027 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2028 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2029 are all boolean, so make them single-bit bitfields.
2031 * lisp.h (ASET): Remove attempt to detect side effects.
2032 It was meant to be temporary and it often doesn't work,
2033 because when IDX has side effects the behavior of IDX==IDX
2034 is undefined. See Stefan Monnier in
2035 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2037 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2039 * lisp.h (functionp): New function (extracted from Ffunctionp).
2040 (FUNCTIONP): Use it.
2041 * eval.c (Ffunctionp): Use it.
2043 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2045 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2046 as that's faster and simpler than static storage. Don't bother
2047 with the g_main_context_query overhead if g_main_context_pending
2048 says no events are pending.
2049 (gfds, gfds_size): Remove these static vars.
2050 (xgselect_initialize): Remove; no longer needed.
2051 All uses and decls removed.
2053 * emacs.c (fatal_error_signal_hook): Remove.
2054 All uses removed. This leftover from old code was always 0.
2056 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2057 * casefiddle.c (casify_object, casify_region):
2058 * casetab.c (set_case_table):
2059 * category.c, category.h (word_boundary_p):
2060 * category.h (CHAR_HAS_CATEGORY):
2061 Use bool for booleans, instead of int.
2063 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2065 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2067 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2069 On assertion failure, print backtrace if available.
2070 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2071 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2072 * Makefile.in (LIB_EXECINFO): New macro.
2075 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2076 * bytecode.c (exec_byte_code):
2077 * callint.c (check_mark, Fcall_interactively):
2078 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2079 (getenv_internal, sync_process_alive, call_process_exited):
2080 * lisp.h (USE_SAFE_ALLOCA):
2081 Use bool for booleans, instead of int.
2082 * lisp.h, process.h: Adjust prototypes to match above changes.
2083 * callint.c (Fcall_interactively): Don't assume the mark's
2084 offset fits in 'int'.
2086 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2088 * buffer.c, buffer.h: Use bool for boolean.
2089 * buffer.c (reset_buffer_local_variables)
2090 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2091 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2092 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2093 (overlay_touches_p, overlay_strings, Foverlay_put)
2094 (report_overlay_modification, call_overlay_mod_hooks):
2095 (mmap_enlarge, mmap_set_vars):
2096 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2097 Use bool for booleans, instead of int.
2098 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2099 since the 1-or-0 return value is always ignored anyway.
2100 (mmap_initialized_p):
2101 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2102 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2104 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2106 * bidi.c: Use bool for boolean.
2107 This is a bit more readable, and makes the text segment of bidi.o
2108 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2109 Presumably it's faster too.
2110 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2112 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2113 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2114 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2115 (bidi_explicit_dir_char, bidi_level_of_next_char)
2116 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2117 Use bool for booleans, instead of int.
2118 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2119 (bidi_unshelve_cache): Adjust decls to match code.
2121 2012-08-23 Martin Rudalics <rudalics@gmx.at>
2123 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2126 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2128 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2129 * atimer.h: Include <stdbool.h>.
2131 2012-08-22 Dan Nicolaescu <dann@gnu.org>
2133 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2134 compile time tests instead of run time tests on systems that do
2136 (FRAME_MAC_P): Remove leftover from deleted code.
2137 * frame.c (syms_of_frame): Remove leftover from deleted code.
2139 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2141 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2143 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2145 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2146 Otherwise, the compiler complains about (A?B:C) where B is void
2147 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2148 (fontset_add): Return void, for FONTSET_ADD.
2150 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2152 * alloc.c: Use bool for booleans.
2153 (gc_in_progress, abort_on_gc)
2154 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2155 (dont_register_blocks) [GC_MALLOC_CHECK]:
2156 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2157 (check_string_bytes, make_specified_string, memory_full)
2158 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2159 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2160 (mark_stack, valid_pointer_p, make_pure_string)
2161 (Fgarbage_collect, survives_gc_p, gc_sweep):
2162 Use bool for booleans, instead of int.
2163 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2164 Remove unused local.
2165 * alloc.c (PURE_POINTER_P):
2166 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2167 * editfns.c (Fformat):
2168 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2170 * fns.c (sweep_weak_table):
2171 * lisp.h (suppress_checking, push_message, survives_gc_p)
2172 (make_pure_string, gc_in_progress, abort_on_gc):
2173 * lread.c (readchar, read1):
2174 * print.c (Fprin1_to_string):
2175 * xdisp.c (push_message):
2176 Use bool for booleans affected directly or indirectly by
2179 Make recently-introduced setters macros.
2180 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2181 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2182 (set_fontset_default, set_fontset_fallback): Rename from their
2183 upper-case counterparts, and make them functions rather than macros.
2184 This is more consistent with the other recently-introduced setters.
2185 These don't need to be inline, since they're local.
2187 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2189 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2190 the loop (Bug#12247).
2192 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2194 * lisp.h (vcopy): Use memcpy rather than our own loop.
2195 This fixes a performance regression introduced by the recent
2196 addition of vcopy. This means 'vcopy' will need to be modified
2197 for a copying collector, but that's OK. Also, tighten the
2198 checking in the assertion.
2200 2012-08-21 Eli Zaretskii <eliz@gnu.org>
2202 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2203 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2204 non-base glyph for the width of the base character, according to
2205 what x_draw_composite_glyph_string_foreground expects.
2206 Generate WADJUST value according to composition_gstring_width's
2207 expectations, to produce correct width of the composed character.
2208 Reverse the sign of the DU offset produced by ScriptPlace.
2210 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2212 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2214 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2216 Avoid direct writes to contents member of struct Lisp_Vector.
2217 * lisp.h (vcopy): New function to copy data into vector.
2218 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2219 * fns.c (Ffillarray): Use ASET.
2220 * keyboard.c (timer_check_2): Use AREF and ASET.
2221 (append_tool_bar_item, Frecent_keys): Use vcopy.
2222 * lread.c (read_vector): Use ASET.
2223 * msdos.c (Frecent_doskeys): Use vcopy.
2224 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2225 (Finternal_merge_in_global_face): Use ASET and vcopy.
2226 * xfont.c (xfont_list_pattern): Likewise.
2228 2012-08-21 Martin Rudalics <rudalics@gmx.at>
2230 * window.c (Fwindow_point): For the selected window always return
2231 the position of its buffer's point.
2232 (Fset_window_point): For the selected window always go in its
2233 buffer to the specified position.
2235 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2237 Setter macros for fontsets.
2238 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2239 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2240 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2243 2012-08-20 Glenn Morris <rgm@gnu.org>
2245 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2246 Don't assume that `ln -f' works.
2248 2012-08-20 Eli Zaretskii <eliz@gnu.org>
2250 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2251 and later about non-assignments with no effect. See discussion at
2252 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2255 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2257 Inline setter functions for Lisp_Objects slots of struct specbinding.
2258 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2261 2012-08-20 Martin Rudalics <rudalics@gmx.at>
2263 * window.c (select_window): Always make selected window's buffer
2266 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2268 Use AREF and ASET for docstrings of category tables.
2269 * category.h (CATEGORY_DOCSTRING): Use AREF.
2270 (SET_CATEGORY_DOCSTRING): Use ASET.
2271 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2273 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2275 Inline setter functions for hash table members.
2276 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2277 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2278 (set_hash_key_and_value, set_hash_index, set_hash_next)
2279 (set_hash_hash): New functions.
2280 * charset.c, fns.c: Adjust users.
2282 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2284 Inline getter and setter functions for per-buffer values.
2285 * buffer.h (per_buffer_default, set_per_buffer_default)
2286 (per_buffer_value, set_per_buffer_value): New functions.
2287 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2288 * buffer.c, data.c: Adjust users.
2290 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
2292 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2294 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2296 Rely on <config.h> + <unistd.h> to declare 'environ',
2297 as gnulib does this if the system doesn't.
2298 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2299 Remove declaration. MS-Windows declares it on stdlib.h which is
2300 included by conf_post.h.
2301 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2302 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2303 * vm-limit.c: Include <unistd.h>, for 'environ'.
2305 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2306 (start_of_data): Remove decl; mem-limits.h provides it.
2308 * xdisp.c (handle_invisible_prop): Make it a bit faster
2309 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2311 2012-08-19 Chong Yidong <cyd@gnu.org>
2313 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2316 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2318 * .gdbinit: Use call instead of set when calling a function in the
2321 * data.c (set_internal): Don't use set_blv_found.
2322 (Fkill_local_variable): Likewise.
2324 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2326 * nsfont.m (ns_ascii_average_width): Ensure the string
2327 ascii_printable is initialized with a null-terminated character
2328 array. Otherwise, it can contain undesired extra characters.
2330 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2332 port new setting code to Sun C 5.8 2005/10/13
2333 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2334 Return void, not Lisp_Object. Otherwise, the compiler
2335 complains about (A?B:C) where B is void and C is Lisp_Object
2336 when compiling CHAR_TABLE_SET, due to the recent change to
2337 the API of sub_char_table_set_contents.
2339 2012-08-18 Chong Yidong <cyd@gnu.org>
2341 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2342 for the string case (Bug#3874).
2344 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2346 * buffer.h (BSET): Remove (Bug#12215).
2347 Replace all uses with calls to new setter functions.
2348 (bset_bidi_paragraph_direction, bset_case_canon_table)
2349 (bset_case_eqv_table, bset_directory, bset_display_count)
2350 (bset_display_time, bset_downcase_table)
2351 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2352 (bset_last_selected_window, bset_local_var_alist)
2353 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2354 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2356 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2357 (bset_auto_fill_function, bset_auto_save_file_format)
2358 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2359 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2360 (bset_cache_long_line_scans, bset_case_fold_search)
2361 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2362 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2363 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2364 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2365 (bset_header_line_format, bset_indicate_buffer_boundaries)
2366 (bset_indicate_empty_lines, bset_invisibility_spec)
2367 (bset_left_fringe_width, bset_major_mode, bset_mark)
2368 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2369 (bset_name, bset_overwrite_mode, bset_pt_marker)
2370 (bset_right_fringe_width, bset_save_length)
2371 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2372 (bset_scroll_up_aggressively, bset_selective_display)
2373 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2374 (bset_word_wrap, bset_zv_marker):
2375 * category.c (bset_category_table):
2376 * syntax.c (bset_syntax_table):
2377 New setter functions.
2379 * process.h (PSET): Remove (Bug#12215).
2380 Replace all uses with calls to new setter functions.
2381 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2382 (PROCESS_INLINE): New macro.
2383 (pset_childp): New setter function.
2384 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2385 * process.c (PROCESS_INLINE):
2386 Define to EXTERN_INLINE, so that the corresponding functions
2387 are compiled into code.
2388 (pset_buffer, pset_command, pset_decode_coding_system)
2389 (pset_decoding_buf, pset_encode_coding_system)
2390 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2391 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2392 (pset_type, pset_write_queue): New setter functions.
2394 * window.h (WSET): Remove (Bug#12215).
2395 Replace all uses with calls to new setter functions.
2396 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2397 (WINDOW_INLINE): New macro.
2398 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2399 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2400 (wset_total_lines, wset_vertical_scroll_bar)
2401 (wset_window_end_pos, wset_window_end_valid)
2402 (wset_window_end_vpos): New setter functions.
2403 * window.c (WINDOW_INLINE):
2404 Define to EXTERN_INLINE, so that the corresponding functions
2405 are compiled into code.
2406 (wset_combination_limit, wset_dedicated, wset_display_table)
2407 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2408 (wset_new_normal, wset_new_total, wset_next_buffers)
2409 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2410 (wset_prev_buffers, wset_right_fringe_width)
2411 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2412 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2413 (wset_window_parameters):
2414 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2415 (wset_column_number_displayed, wset_region_showing):
2416 New setter functions.
2418 * termhooks.h (TSET): Remove (Bug#12215).
2419 Replace all uses with calls to new setter functions.
2420 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2421 (TERMHOOKS_INLINE): New macro.
2422 (tset_charset_list, tset_selection_alist): New setter functions.
2423 * terminal.c (TERMHOOKS_INLINE):
2424 Define to EXTERN_INLINE, so that the corresponding functions
2425 are compiled into code.
2426 (tset_param_alist): New setter function.
2428 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2430 * keyboard.h (KSET): Remove (Bug#12215).
2431 Replace all uses with calls to new setter functions.
2432 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2433 (KEYBOARD_INLINE): New macro.
2434 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2435 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2436 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2437 New setter functions.
2438 * keyboard.c (KEYBOARD_INLINE):
2439 Define to EXTERN_INLINE, so that the corresponding functions
2440 are compiled into code.
2441 (kset_echo_string, kset_kbd_queue)
2442 (kset_keyboard_translate_table, kset_last_prefix_arg)
2443 (kset_last_repeatable_command, kset_local_function_key_map)
2444 (kset_overriding_terminal_local_map, kset_real_last_command)
2445 (kset_system_key_syms): New setter functions.
2447 * frame.h (FSET): Remove (Bug#12215).
2448 Replace all uses with calls to new setter functions.
2449 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2450 (FRAME_INLINE): New macro.
2451 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2452 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2453 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2454 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2455 (fset_param_alist, fset_root_window, fset_scroll_bars)
2456 (fset_selected_window, fset_title, fset_tool_bar_items)
2457 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2458 * frame.c (FRAME_INLINE):
2459 Define to EXTERN_INLINE, so that the corresponding functions
2460 are compiled into code.
2461 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2463 A few more naming-convention fixes for getters and setters.
2464 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2465 and rename from buffer_overlays_set_before.
2466 (set_buffer_overlays_after): Move here from buffer.h, and rename
2467 from buffer_overlays_set_after.
2468 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2470 (set_buffer_intervals): Rename from buffer_set_intervals.
2471 * intervals.c (set_interval_object): Move here from intervals.h,
2472 and rename from interval_set_object.
2473 (set_interval_left): Move here from intervals.h, and rename from
2475 (set_interval_right): Move here from intervals.h, and rename from
2477 (copy_interval_parent): Move here from intervals.h, and rename from
2478 interval_copy_parent.
2479 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2480 (set_interval_plist): Rename from interval_set_plist.
2481 Return void, not Lisp_Object, since no caller uses the result.
2482 * lisp.h (string_intervals): Rename from string_get_intervals.
2483 (set_string_intervals): Rename from string_set_intervals.
2485 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2486 (set_char_table_contents): Rename from char_table_set_contents.
2487 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2488 All uses changed. See the end of
2489 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2491 * lisp.h (CSET): Remove (Bug#12215).
2492 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2493 (set_char_table_purpose): New functions,
2494 replacing CSET. All uses changed. For example, replace
2495 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2496 "set_char_table_parent (char_table, parent);".
2497 The old version was confusing because it used the same name
2498 'parent' for two different things.
2500 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2502 Functions to get and set Lisp_Object fields of buffer-local variables.
2503 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2504 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2505 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2506 * data.c, eval.c, frame.c: Adjust users.
2508 2012-08-17 Chong Yidong <cyd@gnu.org>
2510 * xfaces.c (merge_face_vectors): If the target font specfies a
2511 font spec, make the font's attributes take precedence over
2512 directly-specified attributes.
2513 (merge_face_ref): Recognize :font.
2515 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2517 Do not use memcpy for copying intervals.
2518 * intervals.c (reproduce_interval): New function.
2519 (reproduce_tree, reproduce_tree_obj): Use it.
2520 (reproduce_tree_obj): Remove prototype.
2522 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2524 * lisp.h (duration_to_sec_usec): Remove unused decl.
2526 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2528 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2529 to an allocated instance of NSString, not to the class itself.
2531 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
2533 * makefile.w32-in (C_CTYPE_H): New macro.
2534 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2535 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2536 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2538 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2540 Use ASCII tests for character types.
2541 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2543 Don't include <ctype.h>; was not needed.
2544 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2545 * sysdep.c, xfaces.c:
2546 Include <c-ctype.h> instead of <ctype.h>.
2547 * nsterm.m: Include <c-ctype.h>.
2548 * charset.c (read_hex):
2549 * doc.c (Fsnarf_documentation):
2550 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2551 (DRIVE_LETTER) [DOS_NT]:
2552 (Ffile_name_directory, Fexpand_file_name)
2553 (Fsubstitute_in_file_name):
2554 * font.c (font_parse_xlfd, font_parse_fcname):
2555 * frame.c (x_set_font_backend):
2556 * gtkutil.c (xg_get_font):
2557 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2558 * nsimage.m (hexchar):
2559 * nsterm.m (ns_xlfd_to_fontname):
2560 * sysdep.c (system_process_attributes):
2561 * xfaces.c (hash_string_case_insensitive):
2562 Use C-locale tests instead of locale-specific tests for character
2563 types, since we want the ASCII interpretation here, not the
2564 interpretation suitable for whatever happens to be the current locale.
2566 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2568 Consistently check windows for validity/liveness
2569 (Bug#11984, Bug#12025, Bug#12026).
2570 * lisp.h (CHECK_VALID_WINDOW): New macro.
2571 * window.c (decode_window): Rename to decode_live_window.
2572 (decode_valid_window, Fwindow_valid_p): New functions.
2573 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2574 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2575 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2576 (Fwindow_prev_sibling, Fwindow_combination_limit)
2577 (Fset_window_combination_limit, Fwindow_use_time)
2578 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2579 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2580 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2581 (Fwindow_hscroll, Fset_window_hscroll)
2582 (Fwindow_redisplay_end_trigger)
2583 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2584 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2585 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2586 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2587 (Fwindow_end, Fset_window_point, Fset_window_start)
2588 (Fpos_visible_in_window_p, Fwindow_line_height)
2589 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2590 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2591 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2592 (Fset_window_parameter, Fwindow_display_table)
2593 (Fset_window_display_table, Fdelete_other_windows_internal)
2594 (Fset_window_buffer, Fset_window_new_total)
2595 (Fset_window_new_normal, Fdelete_window_internal)
2596 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2597 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2598 (Fwindow_scroll_bars): Check whether argument window is a valid or
2599 live window. Update doc-strings.
2600 (syms_of_window): New symbol Qwindow_valid_p.
2601 * keyboard.c (Fposn_at_x_y): Check whether argument
2602 frame_or_window denotes a valid window.
2604 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2606 Fix previous char table change.
2607 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2608 * chartab.c (optimize_sub_char_table): Likewise.
2610 2012-08-16 Chong Yidong <cyd@gnu.org>
2612 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2614 * xfont.c (xfont_open):
2615 * xftfont.c (xftfont_open): Set the font's max_width field.
2617 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2618 min_width to space_width and average_width to the average over
2619 printable ASCII characters.
2620 (ns_char_width): Code cleanup.
2621 (ns_ascii_average_width): New utility function.
2623 * font.h (struct font): Update comments.
2625 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2627 Simple interface to set Lisp_Object fields of character tables.
2628 * lisp.h (CSET): New macro.
2629 (char_table_set_extras, char_table_set_contents)
2630 (sub_char_table_set_contents): New function.
2631 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2632 * syntax.c: Adjust users.
2634 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2636 * eval.c (eval_sub): Bind lexical-binding.
2637 * lread.c (Qlexical_binding): Make non-static.
2639 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2641 * nsmenu.m (popupSession): Remove.
2642 (pop_down_menu): Remove endModalSession.
2643 (timeout_handler:): New method.
2644 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2645 Call runModalForWindow. Check timer_fired when it returns.
2646 If not set, cancel timer and break out of loop.
2647 Otherwise loop again, with a new timeout.
2649 * nsterm.m: Include fcntl.h if present.
2650 (fd_entry, t_readfds, inNsSelect): Remove.
2651 (select_writefds, select_valid, select_timeout, selfds)
2652 (select_mutex, apploopnr): Add.
2653 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2654 Otherwise call kbd_buffer_store_event.
2655 (ns_send_appdefined): Remove release of fd_entry.
2656 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2657 Increment and decrement apploopnr.
2658 (ns_select): If no file descriptors, just do a NSTimer.
2659 Otherwise copy read/write masks and start select thread (fd_handler).
2660 Start main loop and wait for application defined event.
2661 Inform select thread to stop selecting after main loop is exited.
2662 (ns_term_init): Create selfds pipe and set non-blocking.
2663 Initialize select_mutex. Start the select thread (fd_handler).
2664 (fd_handler:): Loop forever, wait for info from the main thread
2665 to either start or stop selecting. When select returns, send
2666 and appdefined event.
2667 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2668 If not call kbd_buffer_store_event.
2670 * nsterm.h (EmacsApp): fd_handler takes id argument.
2671 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2673 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2675 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2677 * region-cache.c (move_cache_gap): Update gap_len using the actual
2678 growth of the boundaries array. Do not change cache_len.
2681 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2683 Generalize and cleanup font subsystem checks.
2684 * font.h (FONT_DEBUG, font_assert): Remove.
2685 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2686 Change font_assert to eassert. Use eassert where appropriate.
2688 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2690 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2692 2012-08-15 Chong Yidong <cyd@gnu.org>
2694 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2695 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2696 extract the font descriptor instead of just the font name.
2697 In that case, return a font spec instead of a string.
2698 (x_last_font_name): Move to this file from xfns.c.
2700 * xfns.c (Fx_select_font): The return value can also be a font
2701 spec. Move x_last_font_name management to gtkutil.c.
2703 * xfaces.c: Make font weight and style symbols non-static.
2705 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2707 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2710 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2712 * alloc.c (Fgarbage_collect): Use plural form consistently.
2714 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2716 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2717 iteration through the command loop. Fixes a problem whereby mouse
2718 movements are ignored until the first mouse click.
2720 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2722 Use bool, not int, for Lisp booleans.
2723 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2724 makes Emacs a bit smaller and presumably a bit faster.
2725 * lisp.h: Include <stdbool.h>.
2726 (struct Lisp_Boolfwd, defvar_bool):
2727 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2728 * regex.c [!emacs]: Include <stdbool.h>.
2729 (false, true): Remove; <stdbool.h> does this for us now.
2731 2012-08-14 Chong Yidong <cyd@gnu.org>
2733 * character.c (Fcharacterp): Doc fix (Bug#12076).
2735 * data.c (Findirect_variable): Doc fix (Bug#11040).
2737 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2739 * editfns.c (Fformat): Doc fix (Bug#12059).
2740 (Fsave_current_buffer): Doc fix (Bug#11542).
2742 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2744 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2747 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2749 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2750 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2751 * minibuf.c (choose_minibuf_frame, read_minibuf):
2752 * w32fns.c (x_create_tip_frame):
2753 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2754 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2756 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2758 * intervals.c (offset_intervals): Remove obsolete comment.
2760 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2762 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2764 2012-08-14 Gergely Risko <gergely@risko.hu>
2766 * coding.c (decode_coding): Record buffer modification before
2767 disabling undo_list (Bug#11773).
2769 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2771 Revert and cleanup some recent overlay changes.
2772 * buffer.h (enum overlay_type): Remove.
2773 (buffer_get_overlays, buffer_set_overlays): Likewise.
2774 (buffer_set_overlays_before, buffer_set_overlays_after):
2775 New function. Adjust users.
2776 (unchain_both): Add eassert.
2778 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2780 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2782 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2784 * gtkutil.c (xg_mark_data): Don't assume C99.
2786 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2788 * gtkutil.c (xg_frame_tb_info): New struct.
2789 (TB_INFO_KEY): New define.
2790 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2791 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2792 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2794 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2795 is up to date. Otherwise store new data.
2796 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2798 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2800 Use KSET for write access to Lisp_Object members of struct kboard.
2801 * keyboard.h (KSET): New macro.
2802 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2803 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2804 * xterm.c: Adjust users.
2806 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2808 Use BSET for write access to Lisp_Object members of struct buffer.
2809 * buffer.h (BSET): New macro.
2810 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2811 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2812 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2813 * window.c, xdisp.c, xfns.c: Adjust users.
2815 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2817 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2819 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2821 * nsterm.m (not_in_argv): New function.
2822 (application:openFile, application:openTempFile:):
2823 (application:openFileWithoutUI:, application:openFiles:): Open file
2824 if not_in_argv returns non-zero (bug#12171).
2826 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2827 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2828 Define for Gtk+ versions less than 3.2.
2829 (xg_get_font_name): Use those functions/macros here.
2830 Reported by Frans Oilinki <moilinki@gmail.com>.
2832 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2834 * unexmacosx.c (copy_data_segment): Copy initialized data in
2835 statically linked libraries from input file rather than memory.
2837 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2838 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2839 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2841 2012-08-10 Glenn Morris <rgm@gnu.org>
2843 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2844 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2846 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2848 Fix last change to allow compilation with low optimization levels.
2849 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2850 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2852 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2854 Use common inline syntax in intervals.h.
2855 * intervals.h (INTERVALS_INLINE): New macro.
2856 Change all users from LISP_INLINE.
2858 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2860 Define Qnone once for all platforms.
2861 * frame.c (Qnone): Define here.
2862 (syms_of_frame): DEFSYM it.
2863 * lisp.h (Qnone): New declaration.
2864 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2865 * xfns.c: Remove duplication. Adjust users.
2867 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2869 Remove unused macros from intervals.h.
2870 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2871 * intervals.c: Adjust comment.
2873 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2875 * w32fns.c <w32_unicode_gui>: New static variable.
2876 (globals_of_w32fns): Initialize it according to os_subtype.
2877 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2880 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2881 Eli Zaretskii <eliz@gnu.org>
2883 Fix bug #10299 with Unicode characters sent by customized
2884 keyboards created by MSKLC.
2885 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2886 (w32_init_class): Use it to initialize the Emacs class with either
2887 ANSI or Unicode API calls.
2888 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2890 (w32_wnd_proc): If the character code sent by WM_CHAR or
2891 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2892 original message. Call DefWindowProcW on NT and later.
2894 2012-08-10 Glenn Morris <rgm@gnu.org>
2896 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2898 * lisp.h (DIRECTORY_SEP): Let configure set it.
2900 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2902 Use TSET for write access to Lisp_Object slots of struct terminal.
2903 * termhooks.h (TSET): New macro.
2904 * coding.c, terminal.c, xselect.c: Adjust users.
2906 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2908 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2909 the failing expression, include them in the error message.
2910 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2911 * lisp.h (internal_condition_case_n): Update declaration.
2913 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2915 Inline functions to examine and change buffer overlays.
2916 * buffer.c (unchain_both): New function.
2917 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2918 (buffer_has_overlays): New function.
2919 (enum overlay_type): New enum.
2920 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2921 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2923 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2925 Inline functions to examine and change buffer intervals.
2926 * alloc.c (mark_interval_tree): Remove.
2927 (MARK_INTERVAL_TREE): Simplify.
2928 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2929 * intervals.c (buffer_balance_intervals): New function.
2930 (graft_intervals_into_buffer): Adjust indentation.
2931 (set_intervals_multibyte): Simplify.
2932 * buffer.h (BUF_INTERVALS): Remove.
2933 (buffer_get_intervals, buffer_set_intervals): New function.
2934 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2935 * intervals.c, textprop.c: Adjust users.
2937 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2939 Inline functions to examine and change string intervals.
2940 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2941 (string_get_intervals, string_set_intervals): New function.
2942 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2943 * lread.c, print.c, textprop.c: Adjust users.
2945 2012-08-08 Glenn Morris <rgm@gnu.org>
2947 * lisp.mk (lisp): Remove language/persian.elc.
2949 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2952 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2953 (NULL_INTERVAL_P): Likewise. Adjust users.
2954 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2955 Adjust comment. Move under #if 0.
2956 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2957 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2959 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2961 Check total length of intervals with eassert.
2962 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2963 * intervals.c: Change all users to eassert.
2965 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2967 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2968 Rename fields to match removal of FGET and WGET and disuse of
2969 INTERNAL_FIELD in Lisp_Cons.
2971 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2973 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2974 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2975 name since all xname users are fixed long time ago. Do not
2977 (set_symbol_name, set_symbol_function, set_symbol_plist):
2978 (set_symbol_next, set_overlay_plist): New function.
2979 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2980 (struct Lisp_Overlay): Likewise.
2981 (CVAR, MVAR, SVAR): Remove.
2982 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2983 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2984 * xterm.c: Adjust users.
2985 * .gdbinit: Change to use name field of struct Lisp_Symbol
2988 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2990 Basic functions to set Lisp_Object and pointer slots of intervals.
2991 * intervals.h (interval_set_parent, interval_set_object):
2992 (interval_set_left, interval_set_right, interval_set_plist):
2993 (interval_copy_parent): New function.
2994 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2995 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2997 (INTERVAL_SIZE): Remove. Adjust users.
2998 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3000 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3002 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3003 * process.h (PGET): Remove.
3004 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3005 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3007 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3009 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3010 * window.h (WGET): Remove.
3011 (struct window): Do not use INTERNAL_FIELD.
3012 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3013 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3014 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3015 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3016 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3019 2012-08-07 Chong Yidong <cyd@gnu.org>
3021 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3022 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3023 (Fdelete_window_internal): Signal an error if the window is not on
3024 a live frame (Bug#12025).
3026 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3028 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3029 * frame.h (FGET): Remove.
3030 (struct frame): Do not use INTERNAL_FIELD.
3031 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3032 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3033 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3034 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3036 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
3038 * w32.c: Silence compiler warnings.
3039 (map_w32_filename): Remove unused variable `is_fat'.
3040 (chase_symlinks): Add parentheses around expression.
3042 2012-08-06 Glenn Morris <rgm@gnu.org>
3044 * sysdep.c: Respect BROKEN_GETWD.
3046 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3047 Let configure handle it.
3048 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3050 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3052 Use GCALIGNMENT where appropriate.
3053 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3054 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3055 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3057 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3059 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3060 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3062 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3064 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3065 that should be sufficient for everyone.
3067 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3069 * keyboard.c (timer_check_2): Add break so timer_check returns next
3072 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3074 Fix Windows build errors introduced after converting to WGET and WSET.
3075 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3076 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3078 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3080 * nsterm.m (ns_frame_rehighlight): Use FSET.
3082 * nsmenu.m (ns_update_menubar): Use FSET.
3084 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3086 Separate read and write access to Lisp_Object slots of Lisp_Process.
3087 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3088 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3090 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3092 Separate read and write access to Lisp_Object slots of struct window.
3093 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3094 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3095 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3096 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3097 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3098 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3101 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3103 Fix Windows build errors introduced after converting to FGET and FSET.
3104 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3105 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3106 (w32_judge_scroll_bars): Change to use FSET.
3107 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3109 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3111 Fix replacement typo.
3112 * window.c (replace_window): Set root_window instead of
3113 selected_window. This fixes a total window subsystem
3114 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3116 2012-08-06 Glenn Morris <rgm@gnu.org>
3118 * lisp.mk (lisp): Add language/persian.elc.
3120 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3122 Separate read and write access to Lisp_Object slots of struct frame.
3123 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3124 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3125 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3126 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3127 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3129 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3131 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3133 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3135 Generalize common compile-time constants.
3136 * lisp.h (header_size, bool_header_size, word_size): Now here.
3137 (struct Lisp_Vector): Add comment.
3138 (struct Lisp_Bool_Vector): Move up to define handy constants.
3139 (VECSIZE, PSEUDOVECSIZE): Simplify.
3140 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3141 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3142 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3143 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3144 * xfont.c, xmenu.c: Use word_size where appropriate.
3146 2012-08-05 Lawrence Mitchell <wence@gmx.li>
3148 * search.c (Freplace_match): Treat \? in the replacement text
3149 literally (Bug#8161).
3151 2012-08-05 Chong Yidong <cyd@gnu.org>
3153 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3154 * frame.c (Vdelete_frame_functions):
3155 * emacs.c (Vkill_emacs_hook): Doc fix.
3157 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3159 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3160 --with-x-toolkit=no builds.
3161 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3163 2012-08-04 Chong Yidong <cyd@gnu.org>
3165 * syntax.c (Fmodify_syntax_entry): Doc fix.
3167 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3169 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3170 * w32.c (init_environment): Change the default values of many
3171 environment variables in dflt_envvars[] to NULL, to avoid pushing
3172 them into environment when they were not already defined.
3173 Remove the code that deletes site-lisp subdirectories from the default
3174 value of EMACSLOADPATH, as it is no longer needed.
3175 (check_windows_init_file): Now external, not static.
3176 Use Vload_path as is, without adding anything, as this function is now
3177 called when Vload_path is already set up.
3179 * w32.h (check_windows_init_file): Add prototype.
3181 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3182 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3183 compatibility with Posix platforms.
3184 (main): Move the call to check_windows_init_file to here from
3186 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3187 any, in the DEFALT argument into the root of the Emacs build or
3188 installation tree, as appropriate.
3190 * callproc.c (init_callproc_1): Call decode_env_path instead of
3191 doing its equivalent by hand.
3192 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3193 the code that sets Vexec_path run on MS-Windows.
3195 * lread.c (init_lread): Add comments to #ifdef's.
3197 * msdos.c (dos_set_window_size, IT_update_begin)
3198 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3199 instead of direct references.
3201 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3203 Export DEFAULT_REHASH_* to GDB.
3204 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3205 Now constants, not macros.
3207 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3209 Remove unnecessary casts involving pointers.
3210 These casts are no longer needed now that we assume C89 or later,
3211 since they involve casting to or from void *.
3212 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3213 (make_pure_float, make_pure_vector):
3214 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3215 * macros.c (Fstart_kbd_macro):
3216 * menu.c (find_and_return_menu_selection):
3217 * minibuf.c (read_minibuf_noninteractive):
3218 * sysdep.c (closedir):
3219 * xdisp.c (x_produce_glyphs):
3220 * xfaces.c (compare_fonts_by_sort_order):
3221 * xfns.c (x_real_positions, select_visual):
3222 * xselect.c (x_stop_queuing_selection_requests)
3223 (x_get_window_property, x_get_window_property_as_lisp_data):
3224 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3225 Remove unnecessary pointer casts.
3226 * alloc.c (record_xmalloc): New function.
3227 * lisp.h (record_xmalloc): New decl.
3228 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3229 more like a function. This is because the pointer cast is not
3230 needed. All uses changed.
3231 * print.c (print_string, print_error_message): Avoid length recalc.
3233 Improve fix for macroexp crash with debugging (Bug#12118).
3234 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3235 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3236 not supposed to be invoked from the garbage collector.
3237 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3238 (gc_aset): New function, which is like ASET but can be
3239 used in the garbage collector.
3240 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3241 (set_hash_index): Use it instead of ASET.
3243 2012-08-03 Eli Zaretskii <eliz@gnu.org>
3245 Support symlinks on latest versions of MS-Windows.
3246 * w32.c: Include winioctl.h and aclapi.h.
3247 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3248 (revert_to_self): Forward declarations of static functions.
3249 <static BOOL g_b_init_get_security_info>:
3250 <g_b_init_create_symbolic_link>: New static flags.
3251 (globals_of_w32): Initialize them to zero.
3252 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3253 (map_w32_filename): Improve commentary. Simplify switch.
3254 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3255 headers (most versions of MinGW w32api don't).
3256 (get_security_info, create_symbolic_link)
3257 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3259 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3260 in the argument file name.
3261 (sys_access): Call unc_volume_file_attributes only if
3262 GetFileAttributes fails with network-related error codes.
3263 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3264 have the required privileges.
3265 (get_file_security_desc_by_name): Rename from
3266 get_file_security_desc.
3267 (stat_worker): New function, with most of the guts of 'stat', and
3268 with addition of handling of symlinks and support for 'lstat'.
3269 If possible, get file's attributes and security information by
3270 handle, not by name. Produce S_IFLNK bit for symlinks, when
3271 called from 'lstat'.
3272 (stat, lstat): New functions, call 'stat_worker'.
3273 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3274 symlinks when the underlying filesystem supports them.
3276 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3278 Fix macroexp crash on Windows with debugging (Bug#12118).
3279 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3280 checking subscripts; problem introduced with the recent
3281 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3282 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3283 since it's used in non-static inline functions now.
3285 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3286 Don't assume buffer size fits in 'int'. Remove unused local.
3288 Use C99-style 'extern inline' if available.
3289 * buffer.h (BUFFER_INLINE):
3290 * category.h (CATEGORY_INLINE):
3291 * character.h (CHARACTER_INLINE):
3292 * charset.h (CHARSET_INLINE):
3293 * composite.h (COMPOSITE_INLINE):
3294 * dispextern.h (DISPEXTERN_INLINE):
3295 * lisp.h (LISP_INLINE):
3296 * systime.h (SYSTIME_INLINE):
3297 New macro, replacing 'static inline' in this header.
3298 * buffer.h, category.h, character.h, charset.h, composite.h:
3299 * dispextern.h, lisp.h, systime.h:
3300 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3301 * alloc.c (LISP_INLINE):
3302 * buffer.c (BUFFER_INLINE):
3303 * category.c (CATEGORY_INLINE):
3304 * character.c (CHARACTER_INLINE):
3305 * charset.c (CHARSET_INLINE):
3306 * composite.c (COMPOSITE_INLINE):
3307 * dispnew.c (DISPEXTERN_INLINE):
3308 * sysdep.c (SYSTIME_INLINE):
3309 Define to EXTERN_INLINE, so that the corresponding functions
3310 are compiled into code.
3311 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3312 (INLINE_HEADER_END): New macros.
3313 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3314 since it's used in non-static inline functions now.
3315 (VALMASK) [!USE_LSB_TAG]: Likewise.
3317 2012-08-02 Glenn Morris <rgm@gnu.org>
3319 * s/: Remove empty directory.
3321 * s/ms-w32.h: Move to ../nt/inc.
3322 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3323 Update for new ms-w32.h location.
3325 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3328 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3330 2012-08-02 Glenn Morris <rgm@gnu.org>
3332 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3333 hard-coding the path separator.
3335 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3337 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3338 This how ASET and AREF are supposed to work, and makes
3339 it easier to think about future improvements. See
3340 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3341 * charset.h (set_charset_attr): New function.
3342 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3343 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3344 (aref_addr): New function. All uses of &AREF(...) changed.
3345 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3346 (set_hash_index): New functions. All lvalue-style uses of
3347 HASH_KEY etc. changed.
3348 * keyboard.c (set_prop): New function. All lvalue-style uses
3351 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3353 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3354 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3355 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3356 * nsfns.m (ns_set_name_as_filename): Likewise.
3357 * nsmenu.m (ns_update_menubar): Likewise.
3358 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3360 2012-08-01 Eli Zaretskii <eliz@gnu.org>
3362 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3363 Adapt to latest changes in field names of the corresponding Lisp
3366 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3368 2012-08-01 Glenn Morris <rgm@gnu.org>
3370 * s/msdos.h: Remove file.
3371 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3372 * Makefile.in (S_FILE): Remove.
3373 (config_h): Remove S_FILE.
3375 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3377 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3378 Remove; moved to nt/config.nt.
3380 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3382 Use INTERNAL_FIELD for conses and overlays.
3383 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3384 Remove obsolete comment.
3386 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3387 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3389 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3391 Use INTERNAL_FIELD for symbols.
3392 * lisp.h (SVAR): New macro. Adjust users.
3393 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3394 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3396 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3398 Use INTERNAL_FIELD for processes.
3399 * process.h (PVAR): New macro. Adjust style.
3400 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3401 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3403 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3405 Use INTERNAL_FIELD for windows.
3406 * window.h (WVAR): New macro.
3407 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3408 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3409 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3410 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3411 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3412 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3414 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3416 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3418 2012-08-01 Glenn Morris <rgm@gnu.org>
3420 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3421 Move to configure.ac.
3423 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3425 * makefile.w32-in (CONFIG_H): Update dependencies.
3426 (CONF_POST_H): New macro.
3428 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3430 2012-07-31 Glenn Morris <rgm@gnu.org>
3432 * Makefile.in (S_FILE): No longer set by configure.
3434 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3436 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3438 * process.h (NULL_DEVICE):
3439 * emacs.c (SEPCHAR):
3440 * editfns.c (USER_FULL_NAME): Let configure set them.
3442 * s/README, s/template.h: Remove files.
3444 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3446 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3447 Move to configure.ac.
3449 2012-07-31 Eli Zaretskii <eliz@gnu.org>
3451 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3452 resulting renaming of 'struct frame' members.
3454 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3456 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3457 after introduction of FVAR.
3459 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3461 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3463 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3464 instead of compositeToPoint.
3465 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3467 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3469 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3471 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3472 * lisp.h (INTERNAL_FIELD): New macro.
3473 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3474 (BVAR): Change to use INTERNAL_FIELD.
3475 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3476 (KVAR): Change to use INTERNAL_FIELD.
3477 * frame.h (FVAR): New macro.
3478 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3479 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3480 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3481 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3482 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3484 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3486 Miscellaneous fixes for non-default X toolkits.
3487 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3488 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3489 Move under #ifdef USE_LUCID.
3490 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3491 definition and usage to avoid warnings.
3493 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3495 * nsterm.m (openFiles): Fix previous checkin.
3497 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3499 * indent.c (compute_motion): Remove unused local.
3501 2012-07-31 Glenn Morris <rgm@gnu.org>
3503 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3505 * conf_post.h [USG5_4]:
3506 Move remaining contents of s/usg5-4-common.h here.
3507 * s/usg5-4-common.h: Remove file.
3509 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3510 * s/irix6-5.h: Remove file.
3512 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3513 * s/darwin.h: Remove file.
3515 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3516 * s/hpux10-20.h: Remove file, which is now empty.
3518 2012-07-30 Glenn Morris <rgm@gnu.org>
3520 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3521 * Makefile.in (config_h): Add conf_post.h.
3522 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3524 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3526 * nsterm.m (ns_do_open_file): New variable.
3527 (ns_term_init): Set ns_do_open_file to YES after run returns.
3528 (openFile, openTempFile, openFileWithoutUI, openFiles):
3529 Open files only if ns_do_open_file.
3531 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3533 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3534 This no-op macro hasn't been needed for many years.
3535 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3537 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3538 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3539 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3540 gdb_make_enums_visible.
3541 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3542 (DIRECTORY_SEP): Now a constant, not a macro.
3544 2012-07-30 Eli Zaretskii <eliz@gnu.org>
3546 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3547 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3549 * w32term.c <w32_keyboard_codepage>: Renamed from
3550 keyboard_codepage and now external. All users changed.
3552 * w32term.h: Add declaration of w32_keyboard_codepage.
3554 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3555 the codepage to translate keys to Unicode. If this argument is
3556 -1, use the value returned by GetConsoleCP. All callers changed.
3558 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3560 Update .PHONY listings in makefiles.
3561 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3562 bootstrap-clean, distclean, maintainer-clean, versioclean,
3565 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3566 This is a bit clearer. Fix some commentary typos.
3568 2012-07-30 Glenn Morris <rgm@gnu.org>
3570 * s/netbsd.h: Let configure include signal.h if needed.
3571 Remove file, which is now empty.
3573 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3574 Let configure set them.
3575 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3576 No more need to undefine.
3578 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3580 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3581 non-single-byte char when adding meta modifier. (Bug#12090)
3583 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3585 Convert safe_call to use variable number of arguments.
3586 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3587 (safe_call2): Fix comment.
3588 * lisp.h (safe_call): Adjust prototype.
3589 * coding.c (encode_coding_object): Change to use safe_call2.
3590 * xfaces.c (merge_face_heights): Change to use safe_call1.
3592 2012-07-30 Glenn Morris <rgm@gnu.org>
3594 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3595 does that unconditionally. Remove file, which is now empty.
3597 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3600 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3602 Export to GDB most of lisp.h's remaining object-like macros.
3603 * lisp.h (min, max): Move earlier, because they're used earlier now.
3604 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3605 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3606 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3607 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3608 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3609 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3610 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3611 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3612 Now constants, for GDB. They need not be macros.
3613 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3614 Now constants, for GDB, as well as macros, for static initializers.
3615 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3616 Move to after the definition of struct Lisp_Char_Table,
3617 since the former now needs that type defined.
3618 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3619 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3620 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3621 New enums, for gdb_make_enums_visible.
3622 (GLYPH_MODE_LINE_FACE): Remove; unused.
3623 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3624 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3625 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3626 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3627 enum maxargs, enum MAX_ALLOCA.
3628 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3629 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3630 no longer needed, now that they are done in lisp.h.
3632 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3634 Cleanup string bytes checking.
3635 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3636 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3637 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3638 (check_sblock, compact_small_strings): Simplify.
3640 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3642 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3643 These macros are confusing and no longer need to be defined, as
3644 the enum values now suffice. All uses replaced with definiens.
3645 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3647 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3649 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3650 ($(BLD)/w32console.$(O)): Update dependencies.
3652 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3654 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3655 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3657 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3659 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3661 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3662 setting sitelisp (Bug#12010).
3664 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3666 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3668 * w32heap.c (cache_system_info):
3669 * w32.c (sys_rename):
3670 * w32proc.c (find_child_console, sys_kill): All users changed.
3672 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3674 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3676 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3678 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3680 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3682 Cleanup statistics calculation in Fgarbage_collect.
3683 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3684 Fix zombies percentage calculation. Simplify elapsed time calculation.
3686 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3688 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3689 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3690 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3691 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3692 (replace_range, replace_range_2, del_range_2): Change to eassert.
3693 * marker.c (byte_char_debug_check): Adjust style.
3695 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3697 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3698 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3699 long-ago-commented-out code that talks about "WIN32".
3700 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3703 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3705 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3706 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3707 Simplify by using alignof.
3708 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3709 * lisp.h: Include <stdalign.h>.
3710 (GCALIGNMENT): New macro and constant.
3711 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3712 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3713 (stdalign): New macro, if not already defined.
3715 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3717 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3718 * w32inevt.c: Include w32inevt.h.
3719 (w32_read_console_input): New inline function, calls either
3720 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3721 w32_console_unicode_input.
3722 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3723 (w32_kbd_patch_key, key_event): Use the codepage returned by
3724 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3725 (key_event): use uChar.UnicodeChar only if
3726 w32_console_unicode_input is non-zero.
3728 * w32console.c: Include w32heap.h.
3729 <w32_console_unicode_input>: New global variable.
3730 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3731 family of Windows, zero otherwise.
3733 * w32inevt.h: Declare w32_console_unicode_input.
3735 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3736 --without-x. (Bug#11742)
3738 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3740 Adjust GDB to reflect pvec_type changes (Bug#12036).
3741 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3742 2012-07-04 changes to pseudovector representation.
3743 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3745 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3747 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3749 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3751 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3753 * alloc.c (listn): Fix the order the arguments are consed onto the
3756 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3757 enumeration constants, as PURE and HEAP are too general, and clash
3758 with other headers and sources, such as gmalloc.c and the
3759 MS-Windows system headers. All users changed.
3761 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3763 Revert last save_excursion_save and save_excursion_restore changes.
3764 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3765 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3767 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3769 Fix recently-introduced typos in Windows port.
3770 Reported by Martin Rudalics <rudalics@gmx.at>.
3771 * w32.c (init_environment): Replace comma with semicolon.
3772 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3774 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3776 Improve GDB symbol export (Bug#12036).
3777 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3778 arms of an 'if', not using conditional expressions; otherwise GDB
3779 complains about the types in the unevaluated arm when the argument
3780 is an integer literal.
3781 (xgetint): Simplify expression.
3782 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3783 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3784 Zaretskii in <http://bugs.gnu.org/12036#13>.
3785 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3786 needed now that we have gdb_make_enums_visible.
3787 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3788 (enum enum_USE_LSB_TAG):
3789 New enum types, packaging up enums that need to be exported to GDB.
3791 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3793 Utility function to make a list from specified amount of objects.
3794 * lisp.h (enum constype): New datatype.
3795 (listn): New prototype.
3796 * alloc.c (listn): New function.
3797 (Fmemory_use_count, syms_of_alloc): Use it.
3798 * buffer.c (syms_of_buffer): Likewise.
3799 * callint.c (syms_of_callint): Likewise.
3800 * charset.c (define_charset_internal): Likewise.
3801 * coding.c (syms_of_coding): Likewise.
3802 * keymap.c (syms_of_keymap): Likewise.
3803 * search.c (syms_of_search): Likewise.
3804 * syntax.c (syms_of_syntax): Likewise.
3805 * w32.c (init_environment): Likewise.
3806 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3807 * xdisp.c (syms_of_xdisp): Likewise.
3808 * xfns.c (syms_of_xfns): Likewise.
3810 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3812 Fast save_excursion_save and save_excursion_restore.
3813 * lisp.h (struct Lisp_Excursion): New data type.
3814 (PVEC_EXCURSION): New pseudovector type.
3815 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3816 to deal with it. Adjust comments.
3817 (init_marker, attach_marker): New prototype.
3818 (unchain_marker): Adjust prototype.
3819 * marker.c (attach_marker): Change to global.
3820 (init_marker): New function.
3821 * alloc.c (Fmake_marker, build_marker): Use it.
3822 (build_marker): More easserts.
3823 (mark_object): Handle struct Lisp_Excursion.
3824 * editfns.c (save_excursion_save, save_excursion_restore):
3825 Reimplement to use struct Lisp_Excursion. Add comments.
3827 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3829 Fix export of symbols to GDB (Bug#12036).
3830 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3831 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3832 emacs.c, as this is a more-suitable home. Had this been done earlier
3833 the fix for 12036 would have avoided some of the problems noted in
3834 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3835 would have been more obvious.
3836 * emacs.c: Do not include <verify.h>; no longer needed.
3837 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3838 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3839 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3840 Remove; now done in lisp.h.
3841 * lisp.h (PUBLISH_TO_GDB): New macro.
3842 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3843 (DATA_SEG_BITS): Use it.
3844 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3845 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3846 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3847 not be usable in #if. This simplifies things.
3849 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3851 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3853 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3855 Simplify export of symbols to GDB (Bug#12036).
3856 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3857 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3858 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3859 Adjust to changes in lisp.h and emacs.c, by using
3860 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3861 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3862 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3863 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3864 instead of gdb_valbits.
3865 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3866 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3867 instead of gdb_array_mark_flag.
3868 (xboolvector): Get size from $->size, not $->header.size.
3869 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3870 (xreload, hook-run, hookpost-run): Remove.
3871 * emacs.c: Include <verify.h>.
3872 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3873 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3875 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3876 (gdb_USE_LSB_TAG): New enum constants.
3877 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3878 Also define these as enum constants, so they're visible to GDB.
3879 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3880 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3881 as constants, so they're visible to GDB.
3882 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3883 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3884 Now enum constants, not macros, so they're visible to GDB.
3885 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3886 more convenient now. All uses changed.
3887 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3888 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3890 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3892 Explicitly free restriction data that are not needed anymore.
3893 * editfns.c (save_restriction_restore): Free restriction data.
3895 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3897 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3898 add argument, tune behavior, and adjust all callers.
3900 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3902 Use typedef for EMACS_INT, EMACS_UINT.
3903 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3904 than macros. This simplifies debugging in the usual case, since
3905 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3906 and it allows expressions involving EMACS_INT casts.
3907 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3909 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3911 * nsterm.m (ns_read_socket): Return early if there is a modal
3914 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3916 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3917 that FOCUS-FRAME can be omitted.
3919 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3921 Adjust buffer text indirection counters at the end of Fkill_buffer.
3922 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3923 buffer is definitely dead. This should really fix an issue reported
3924 by Christoph Scholtes again. (Bug#12007).
3925 (init_buffer_once): Initialize indirection counters of
3926 buffer_defaults and buffer_local_symbols (for sanity and safety).
3928 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3930 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3931 and continuation glyphs on tooltip frames, leave them at zero.
3932 Avoids continued lines in tooltips. (Bug#11832)
3934 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3936 Simplify copy_overlay.
3937 * buffer.c (copy_overlay): Simplify. Use build_marker.
3938 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3940 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3942 * print.c (print_object): Don't crash when a frame's name is nil
3943 or invalid. (Bug#12025)
3945 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3946 it signals an error when a tooltip frame is being created.
3948 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3950 Cleanup miscellaneous objects allocation and initialization.
3951 * alloc.c (allocate_misc): Change to static. Add argument to
3952 specify the subtype. Adjust comment and users.
3953 (build_overlay): New function.
3954 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3955 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3956 (allocate_misc): Remove prototype.
3957 (build_overlay): Add prototype.
3959 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3961 Swap buffer text indirection counters in Fbuffer_swap_text.
3962 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3963 This avoids crash reported by Christoph Scholtes at
3964 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3966 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3968 * nsmenu.m (Popdown_data): New struct.
3969 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3971 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3972 (initWithContentRect): Make imgView and contentView non-static
3973 and autorelease them. Also autorelease img and matrix (Bug#12005).
3974 (dealloc): Remove (Bug#12005).
3976 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3978 Adjust consing_since_gc when objects are explicitly freed.
3979 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3980 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3981 (free_cons, free_misc): Subtract object size from consing_since_gc.
3983 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3985 Simplify and cleanup markers positioning code.
3986 * marker.c (attach_marker): More useful eassert.
3987 (live_buffer, set_marker_internal): New function.
3988 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3989 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3991 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3993 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3994 as it's limited by the amount of memory, not by INT_MAX.
3996 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3998 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3999 in special-event-map. See the discussion at
4000 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4003 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4004 info.dwItemData. Fixes crashes on 64-bit Windows.
4005 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4007 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4009 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4010 (conversationIdentifier): Return value is NSInteger.
4011 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4013 2012-07-21 Chong Yidong <cyd@gnu.org>
4015 * window.c (decode_any_window): Signal an error if the window is
4016 on a dead frame (Bug#11984).
4018 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4020 Add indirection counting to speed up Fkill_buffer.
4021 * buffer.h (struct buffer): New member.
4022 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4023 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4024 base buffer indirection counter.
4025 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4026 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4027 through buffer list if indirection counter is 0.
4029 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4031 Extend the value returned by Fgarbage_collect with heap statistics.
4032 * alloc.c (Qheap): New symbol.
4033 (syms_of_alloc): DEFSYM it.
4034 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4035 (Fmemory_free): Remove.
4036 (syms_of_alloc): Don't defsubr it.
4037 * buffer.c (Fcompact_buffer): Remove.
4038 (syms_of_buffer): Don't defsubr it.
4040 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4042 Make maybe_gc inline.
4043 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4044 * lisp.h (consing_since_gc, gc_relative_threshold)
4045 (memory_full_cons_threshold): Revert declaration.
4046 (maybe_gc): Remove prototype, define as inline.
4047 * alloc.c: Remove old commented-out code.
4048 (consing_since_gc, gc_relative_threshold)
4049 (memory_full_cons_threshold): Revert to global.
4052 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4054 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4055 * lisp.h (build_unibyte_string): New function.
4056 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4057 * sysdep.c, w32fns.c, xfns.c: Use it.
4058 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4059 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4060 Adjust users accordingly.
4061 * font.h (font_open_by_name): Adjust prototype.
4063 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4065 Cleanup calls to Fgarbage_collect.
4066 * lisp.h (maybe_gc): New prototype.
4067 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4068 Remove declarations.
4069 * alloc.c (maybe_gc): New function.
4070 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4072 * bytecode.c (MAYBE_GC): Use maybe_gc.
4073 * eval.c (eval_sub, Ffuncall): Likewise.
4074 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4075 to avoid dependency from auto-save feature.
4077 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4079 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4080 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4081 'for_each_per_buffer_object_at'.
4082 All uses changed. It's better to use upper-case for macros that
4083 cannot be implemented as functions, to give the reader a clue
4084 that they're special.
4086 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4088 * alloc.c (Fgarbage_collect): Tweak docstring.
4090 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4092 Tweak the value returned from Fgarbage_collect again.
4093 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4094 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4095 Adjust documentation.
4096 (total_vector_bytes): Rename to total_vector_slots, adjust
4098 (total_free_vector_bytes): Rename to total_free_vector_slots,
4100 (Qstring_bytes, Qvector_slots): New symbols.
4101 (syms_of_alloc): DEFSYM them.
4103 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4105 Buffer compaction primitive which may be used from Lisp.
4106 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4107 (syms_of_buffer): Register Fcompact_buffer.
4108 * alloc.c (Fgarbage_collect): Use compact_buffer.
4109 * buffer.h (compact_buffer): New prototype.
4110 (struct buffer_text): New member.
4112 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4114 New macro to iterate over all buffers, miscellaneous cleanups.
4115 * lisp.h (all_buffers): Remove declaration.
4116 * buffer.h (all_buffers): Add declaration, with comment.
4117 (for_each_buffer): New macro.
4118 * alloc.c (Fgarbage_collect, mark_object): Use it.
4119 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4120 (init_buffer): Likewise.
4121 * data.c (Fset_default): Likewise.
4122 * coding.c (code_conversion_restore): Remove redundant check
4124 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4126 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4128 Fix bug that created negative-length intervals.
4129 * intervals.c (merge_interval_right, merge_interval_left):
4130 Do not zero out this interval if it is absorbed by its children,
4131 as this interval's total length doesn't change in that case. See
4132 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4134 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4136 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4137 when invoking (make-bool-vector N t) and N is a positive
4138 multiple of 8 -- the last 8 bits were mistakenly cleared.
4140 Remove some struct layout assumptions in bool vectors.
4141 * alloc.c (bool_header_size): New constant.
4142 (header_size, word_size): Move earlier, as they're now used earlier.
4143 Use 'word_size' in a few more places, where it's appropriate.
4144 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4145 padding before the data member of a bool vector.
4146 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4147 than doing the check by hand with an abort ().
4149 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4151 * eval.c (Fdefvar): Don't check constants since we only set the var if
4152 it's not yet defined anyway (bug#11904).
4154 * lisp.h (last_undo_boundary): Declare new var.
4155 * keyboard.c (command_loop_1): Set it.
4156 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4157 were auto-added by the command loop (bug#11774).
4159 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4161 * w32font.c (Qsymbol): Remove local definition.
4162 (syms_of_w32font): Don't DEFSYM it.
4164 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4166 Fix sweep_vectors to handle large bool vectors correctly.
4167 * alloc.c (sweep_vectors): Account total_vector_bytes for
4168 bool vectors larger than VBLOCK_BYTES_MAX.
4170 2012-07-18 Chong Yidong <cyd@gnu.org>
4172 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4173 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4175 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4177 Return more descriptive data from Fgarbage_collect.
4178 Suggested by Stefan Monnier in
4179 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4180 * alloc.c (bounded_number): New function.
4181 (total_buffers, total_vectors): New variable.
4182 (total_string_size): Rename to total_string_bytes, adjust users.
4183 (total_vector_size): Rename to total_vector_bytes, adjust users.
4184 (sweep_vectors): Account total_vectors and total_vector_bytes.
4185 (Fgarbage_collect): New return value. Adjust documentation.
4186 (gc_sweep): Account total_buffers.
4187 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4188 (VECTOR_SIZE): Remove.
4189 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4190 (Qinterval, Qmisc): New symbols.
4191 (syms_of_data): Initialize them.
4192 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4193 (Qcons, Qbuffer): New declarations.
4195 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4197 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4198 Round up, not down. Improve doc.
4200 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4202 Restore old code in allocate_string_data to avoid Faset breakage.
4203 Reported by Julien Danjou <julien@danjou.info> in
4204 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4205 * alloc.c (allocate_string_data): Restore old code with minor
4206 adjustments, fix comment to explain this subtle issue.
4208 2012-07-17 Eli Zaretskii <eliz@gnu.org>
4210 Remove FILE_SYSTEM_CASE.
4211 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4213 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4214 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4215 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4216 call-process-region passes it through expand-file-name.
4218 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4220 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4222 Fix crash when creating indirect buffer (Bug#11917)
4223 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4224 Don't handle unbound variables specially if non-zero.
4225 (Fbuffer_local_variables): Pass zero.
4226 (clone_per_buffer_values): Pass non-zero.
4228 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4230 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4231 to make the loop interruptible.
4233 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4235 * gnutls.c (emacs_gnutls_handshake): Only retry if
4236 GNUTLS_E_INTERRUPTED.
4238 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4240 Cleanup and convert miscellaneous checks to eassert.
4241 * alloc.c (mark_interval): Fix comment, partially rephrase
4242 old comment from intervals.h (see below).
4243 * intervals.c (find_interval, adjust_intervals_for_insertion)
4244 (delete_interval, adjust_intervals_for_deletion)
4245 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4247 (adjust_intervals_for_insertion, make_new_interval):
4248 Remove obsolete and unused code.
4249 * intervals.h (struct interval): Remove obsolete comment.
4250 * textprotp.c (erase_properties): Remove unused code.
4251 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4252 (Fremove_list_of_text_properties): Convert to eassert.
4254 2012-07-17 Chong Yidong <cyd@gnu.org>
4256 * editfns.c (Finsert_char): Doc fix.
4258 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4260 Fix previous change to make Fmemory_free always accurate.
4261 * alloc.c (make_interval): Update total_free_intervals.
4262 (make_float): Likewise for total_free_floats.
4263 (free_cons, Fcons): Likewise for total_free_conses.
4264 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4265 Likewise for total_free_vector_bytes.
4266 (Fmake_symbol): Likewise for total_free_symbols.
4267 (bytes_free): Remove.
4269 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4271 Simple free memory accounting feature.
4272 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4273 (sweep_vectors): Accumulate size of free vectors.
4274 (Fgarbage_collect): Setup bytes_free.
4275 (Fmemory_free): New function.
4276 (syms_of_alloc): Register it.
4278 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4280 Cleanup overlays checking.
4281 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4282 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4283 eassert and OVERLAYP.
4284 (sort_overlays): Change to use OVERLAYP.
4286 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4288 * editfns.c (Finsert_char): Make it interactive, and make the
4289 second arg optional. Copy interactive spec and docstring from
4292 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4294 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4295 Unlike the other wrapped functions, fabs has an unspecified
4298 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4300 * nsterm.m (keyDown): Interpret flags without left/right bits
4301 as the left key (Bug#11670).
4303 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4305 Remove empty and useless init functions.
4306 * lisp.h (init_character_once, init_fns, init_image)
4307 (init_filelock, init_sound): Remove prototype.
4308 * character.c (init_character_once): Remove.
4309 * filelock.c (init_filelock): Likewise.
4310 * fns.c (init_fns): Likewise.
4311 * image.c (init_image): Likewise.
4312 * sound.c (init_sound): Likewise.
4313 * emacs.c (main): Adjust accordingly.
4315 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4317 * gtkutil.h: Tiny cleanups.
4318 (use_old_gtk_file_dialog): Remove useless declaration.
4319 (xg_uses_old_file_dialog): Add suggested const attribute.
4321 2012-07-15 Eli Zaretskii <eliz@gnu.org>
4323 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4324 (bidi_paragraph_init): Use it to limit search forward for a strong
4325 directional character in abnormally large paragraphs full of
4326 neutral or weak characters. (Bug#11943)
4328 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4330 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4331 the toolbar (Bug#9451).
4332 (xg_make_tool_item): Give the widget event box a transparent
4335 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4337 Cleanup basic allocation variables and functions.
4338 * alloc.c (ignore_warnings, init_intervals, init_float)
4339 (init_cons, init_symbol, init_marker): Remove.
4340 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4341 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4342 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4343 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4344 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4345 (staticidx, init_alloc_once, init_strings, free_ablock):
4346 Remove redundant initialization.
4347 * fns.c (init_weak_hash_tables): Remove.
4348 * lisp.h (init_weak_hash_tables): Remove prototype.
4350 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4352 Use zero_vector where appropriate.
4353 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4355 * lisp.h (zero_vector): New declaration.
4356 * font.c (null_vector): Remove.
4357 (syms_of_font): Remove initialization and staticpro.
4358 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4359 * keymap.c (Faccessible_keymaps): Likewise.
4361 2012-07-15 Leo Liu <sdl.web@gmail.com>
4363 * fringe.c: Fix typo in comments.
4365 2012-07-14 Leo Liu <sdl.web@gmail.com>
4367 * fringe.c: Add a new bitmap exclamation-mark.
4369 2012-07-14 Eli Zaretskii <eliz@gnu.org>
4371 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4373 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4374 (HAVE_MENUS): Don't define, defined by editing config.in with
4376 (GMALLOC_INHIBIT_VALLOC): Don't define.
4377 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4379 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
4381 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4383 2012-07-14 Glenn Morris <rgm@gnu.org>
4385 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4386 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4387 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4389 2012-07-13 Glenn Morris <rgm@gnu.org>
4391 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4393 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4394 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4396 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4398 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4399 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4400 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4401 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4403 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4404 as boolean expression.
4405 (x_set_window_size): Remove unused variable toolbar.
4406 (ns_get_color_default, ns_mod_to_lisp): Remove.
4407 (ns_mouse_position): Remove unused variables xchar and ychar.
4408 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4409 (ns_set_vertical_scroll_bar): Remove unused variable count.
4410 (ns_delete_terminal): Remove unused variable i.
4411 (ns_term_init): Remove unused variables r, g and b.
4412 (mouseDown): Remove unused variable window.
4413 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4414 (initFrameFromEmacs): Remove unused variable vbextra.
4415 (mouseEntered): Remove unused variables p and dpyinfo.
4416 (mouseExited): Remove unused variables p and r.
4417 (ns_define_frame_cursor, ns_clear_frame_area)
4418 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4419 (menuDown): Assign [sender tag] to variable and cast the variable.
4421 * nsterm.h (menuDown): Add id as type to argument sender.
4422 (ns_display_info_for_name): Add Lisp_Object argument.
4423 (ns_term_init): Add Lisp_Object argument.
4424 (ns_map_event_to_object): Add void argument.
4425 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4426 prototype with arguments and only declare if __OBJC__.
4427 (nxatoms_of_nsselect): Add void argument.
4428 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4429 (ns_alloc_autorelease_pool): Add void argument.
4430 (ns_release_autorelease_pool): Add void* argument.
4431 (ns_get_defaults_value): Add const char* argument.
4433 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4434 (initFromContents): Use SSDATA where appropriate.
4435 (ns_update_menubar): Add braces to ambigous if-else.
4436 (initWithTitle): Put () around assignment in if statement.
4437 (ns_menu_show): Remove unused variables window and keymap.
4438 (update_frame_tool_bar): Remove unused variable selected_p.
4439 (initWithContentRect): Remove unused variable this_cmd_name.
4441 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4443 (setXBMColor): Remove unused variable len.
4444 (setPixmapData): Put () around assignment in loop statement.
4446 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4447 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4449 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4450 around assignment in loop statement.
4451 (nsfont_open): Remove unused variable i.
4452 (nsfont_open): Remove unused variable len.
4453 (nsfont_draw): Remove unused variable cs.
4455 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4456 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4457 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4458 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4459 (Fns_font_name, Fns_perform_service)
4460 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4461 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4462 (ns_set_name): Remove unused variable view.
4463 (x_set_menu_bar_lines): Remove unused variable olines.
4464 (x_set_tool_bar_lines): Remove unused variable root_window.
4465 (Fns_list_colors): Put () around assignment in while statement.
4466 (Fns_perform_service): Remove unused variable len.
4467 (Fns_display_usable_bounds): Remove unused variable top.
4468 (syms_of_nsfns): Remove unused variable i.
4470 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4473 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4475 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4476 and free it with DestroyExceptionInfo (Bug#11558).
4478 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
4480 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4481 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4482 Set here, not in nt/config.nt.
4484 2012-07-13 Eli Zaretskii <eliz@gnu.org>
4486 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4487 cursor overflow into the last glyph on display line when the right
4488 fringe is off. (Bug#11832)
4490 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4492 * xdisp.c (produce_special_glyphs): Now static.
4493 * dispextern.h (produce_special_glyphs): Remove decl.
4495 2012-07-13 Glenn Morris <rgm@gnu.org>
4497 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4498 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4500 * s/usg5-4-common.h (USG, USG5):
4501 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4502 * s/sol2-6.h (SOLARIS2):
4503 * s/irix6-5.h (IRIX6_5):
4504 * s/hpux10-20.h (USG, USG5, HPUX):
4505 * s/gnu-linux.h (USG, GNU_LINUX):
4506 * s/freebsd.h (BSD_SYSTEM):
4507 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4508 * s/cygwin.h (CYGWIN):
4509 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4510 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4512 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4514 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4516 2012-07-13 Glenn Morris <rgm@gnu.org>
4518 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4520 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4522 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4523 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4525 2012-07-12 Glenn Morris <rgm@gnu.org>
4527 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4529 * process.c (init_process_emacs): Rename from init_process.
4530 The old name is also the name of a Mach system call.
4531 * lisp.h, emacs.c: Update for this name change.
4532 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4535 2012-07-12 Eli Zaretskii <eliz@gnu.org>
4537 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4538 memmove call that removes glyphs covered by the left truncation
4539 glyph. Improve commentary.
4540 (display_line): Fix display of continuation glyphs on GUI frames
4541 when the right fringe is turned off and variable-size fonts are
4542 used in the window. Move the code that appends a stretch glyph to
4543 produce_special_glyphs, so that it could be used for truncation
4544 and continuation glyphs alike.
4545 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4546 glyph of a suitably computed width, to align the special glyphs at
4547 the window margin. Code moved from display_line. (Bug#11832)
4549 2012-07-12 Glenn Morris <rgm@gnu.org>
4551 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4553 * s/gnu-linux.h, s/hpux10-20.h:
4554 Do not unconditionally define HAVE_XRMSETDATABASE.
4556 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4558 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4560 Fix typos that broke OS X build.
4561 Reported by Randal L. Schwartz in
4562 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4563 * nsterm.m (ns_timeout): Add missing local decl.
4564 (ns_get_color): snprintf -> sprintf, to fix typo.
4566 2012-07-12 Glenn Morris <rgm@gnu.org>
4568 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4569 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4570 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4571 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4573 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4574 Move PTY_OPEN to configure.
4576 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4577 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4578 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4580 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4582 Use empty_unibyte_string where applicable.
4583 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4584 * lread.c (read1): Likewise.
4585 * xsettings.c (syms_of_xsettings): Likewise.
4587 2012-07-12 Glenn Morris <rgm@gnu.org>
4589 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4590 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4591 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4592 * s/hpux10-20.h (RUN_TIME_REMAP):
4593 * s/bsd-common.h (TABDLY): Move to configure.
4595 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4597 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4599 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4600 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4602 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4604 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4605 * s/template.h: Move NARROWPROTO to configure.
4607 2012-07-11 Glenn Morris <rgm@gnu.org>
4609 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4610 unused since 2011-01-17 change to systty.h.
4612 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4613 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4614 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4616 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4618 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4620 2012-07-11 Glenn Morris <rgm@gnu.org>
4622 * s/darwin.h, s/gnu-linux.h, s/template.h:
4623 Move INTERRUPT_INPUT to configure.
4625 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4627 Minor adjustments to interning code.
4628 * lisp.h (intern, intern_c_string): Redefine as static inline
4629 wrappers for intern_1 and intern_c_string_1, respectively.
4630 (intern_1, intern_c_string_1): Rename prototypes.
4631 * lread.c (intern_1, intern_c_string_1, oblookup):
4632 Simplify Vobarray checking.
4633 * font.c (font_intern_prop): Likewise. Adjust comment.
4634 * w32font.c (intern_font_name): Likewise.
4636 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4638 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4640 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4641 of Fcar/Fcdr if possible.
4642 * font.c (check_otf_features): Likewise.
4643 * fontset.c (Fnew_fontset): Likewise.
4644 * gnutls.c (Fgnutls_boot): Likewise.
4645 * minibuf.c (read_minibuf): Likewise.
4646 * msdos.c (IT_set_frame_parameters): Likewise.
4647 * xmenu.c (Fx_popup_dialog): Likewise.
4648 * w32menu.c (Fx_popup_dialog): Likewise.
4650 2012-07-11 Glenn Morris <rgm@gnu.org>
4652 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4653 since nothing has defined it on these platforms.
4655 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4656 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4658 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4659 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4660 Move CLASH_DETECTION to configure.
4662 * s/gnu.h: Remove file, which is now empty.
4664 * s/gnu.h, s/gnu-linux.h:
4665 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4667 2012-07-11 John Wiegley <johnw@newartisans.com>
4669 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4670 function attribute, so we only use it if it exists in the
4673 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4675 Avoid call to strlen in fast_c_string_match_ignore_case.
4676 * search.c (fast_c_string_match_ignore_case): Change to use
4677 length argument. Adjust users accordingly.
4678 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4680 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4682 Assume mkdir, rmdir.
4683 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4684 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4687 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4690 * s/hpux10-20.h (HAVE_PERROR): Remove.
4691 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4692 Remove dummy definition, as this problem was obsolete long ago.
4695 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4697 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4699 Avoid calls to strlen in font processing functions.
4700 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4701 (font_open_by_name): Change to use length argument.
4702 Adjust users accordingly.
4703 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4705 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4706 Change to return ptrdiff_t.
4707 (xfont_list_pattern, xfont_match): Use length returned by
4708 xfont_decode_coding_xlfd.
4709 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4711 2012-07-11 Glenn Morris <rgm@gnu.org>
4713 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4714 Move DONT_REOPEN_PTY to configure.
4716 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4717 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4719 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4721 Remove "#define unix" that is no longer needed (Bug#11905).
4722 * s/aix4-2.h (unix): Remove; no longer needed.
4724 EMACS_TIME simplification (Bug#11875).
4725 This replaces macros (which typically do not work in GDB)
4726 with functions, typedefs and enums, making the code easier to debug.
4727 The functional style also makes code easier to read and maintain.
4728 * systime.h: Include <sys/time.h> on all hosts, not just if
4729 WINDOWSNT, since 'struct timeval' is needed in general.
4730 (EMACS_TIME): Now a typedef, not a macro.
4731 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4733 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4734 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4735 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4736 (EMACS_TIME_LE): Now functions, not macros.
4737 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4738 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4739 which are not functions. All uses rewritten to use:
4740 (make_emacs_time): New function.
4741 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4742 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4743 not functions. All uses rewritten to use the following, respectively:
4744 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4745 (add_emacs_time, sub_emacs_time): New functions.
4746 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4747 * fileio.c (Fcopy_file):
4748 * xterm.c (XTflash): Get the current time closer to when it's used.
4749 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4751 * bytecode.c (targets): Suppress -Woverride-init warnings.
4753 Simplify by avoiding confusing use of strncpy etc.
4754 * doc.c (Fsnarf_documentation):
4755 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4756 * frame.c (Fmake_terminal_frame):
4757 * gtkutil.c (get_utf8_string):
4759 * nsmenu.m (ns_update_menubar):
4760 * regex.c (regerror):
4761 Prefer memcpy to strncpy and strncat when either will do.
4762 * fileio.c (Fsubstitute_in_file_name):
4763 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4764 (menu_separator_name_p):
4765 * nsmenu.m (ns_update_menubar):
4766 Prefer memcmp to strncmp when either will do.
4767 * nsterm.m: Include <ftoastr.h>.
4769 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4770 Prefer snprintf to strncpy.
4771 * nsterm.m (ns_term_init):
4772 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4773 * nsterm.m (ns_term_init):
4774 Avoid the need for strncpy, by using build_string or
4775 make_unibyte_string directly. Use dtoastr, not snprintf.
4776 * process.c (Fmake_network_process): Diagnose service names that
4777 are too long, rather than silently truncating them or creating
4778 non-null-terminated names.
4779 (Fnetwork_interface_info): Likewise, for interface names.
4780 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4781 Prefer sprintf to strncat.
4782 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4783 Prefer vsnprintf to vsprintf + strncpy.
4785 2012-07-10 Glenn Morris <rgm@gnu.org>
4787 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4788 Clarify fallback case.
4790 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4792 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4793 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4794 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4795 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4796 where argument type is known to be a Lisp_Cons.
4798 2012-07-10 Tom Tromey <tromey@redhat.com>
4800 * bytecode.c (BYTE_CODE_THREADED): New macro.
4801 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4802 (enum byte_code_op): New type.
4803 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4804 (exec_byte_code): Use them. Use token threading when applicable.
4806 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4808 Optimize pure C strings initialization.
4809 * lisp.h (make_pure_string): Fix prototype.
4810 (build_pure_c_string): New function, defined as static inline. This
4811 provides a better opportunity to optimize away calls to strlen when
4812 the function is called with compile-time constant argument.
4813 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4814 argument, adjust users accordingly. Use build_pure_c_string where
4816 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4817 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4818 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4820 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4822 Avoid calls to strlen in miscellaneous functions.
4823 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4824 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4825 * lread.c (openp): Likewise.
4827 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4829 Avoid calls to strlen in path processing functions.
4830 * fileio.c (file_name_as_directory): Add comment. Change to add
4831 srclen argument and return the length of result. Adjust users
4833 (directory_file_name): Fix comment. Change to add srclen argument,
4834 swap 1st and 2nd arguments to obey the common convention.
4835 Adjust users accordingly.
4836 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4838 2012-07-10 Glenn Morris <rgm@gnu.org>
4840 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4841 Move PENDING_OUTPUT_COUNT definition to configure.
4843 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4844 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4845 * s/gnu.h (DATA_START): Move definitions to configure.
4847 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4848 We include usg5-4-common.h, which defines them both.
4850 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4851 O_RDONLY already includes it).
4853 Stop ns builds setting the EMACSLOADPATH environment variable.
4854 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4855 Now it does not set EMACSLOADPATH, just returns the load-path string.
4856 * nsterm.h: Update accordingly.
4857 * lread.c [HAVE_NS]: Include nsterm.h.
4858 (init_lread) [HAVE_NS]: Use ns_load_path.
4859 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4861 2012-07-09 Glenn Morris <rgm@gnu.org>
4863 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4864 since the included bsd-common.h does so.
4866 Stop ns builds setting the EMACSPATH environment variable.
4867 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4868 (ns_init_paths): Do not set EMACSPATH.
4869 * nsterm.h (ns_exec_path): Add it.
4870 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4873 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4875 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4877 * process.c (wait_reading_process_output): 'waitchannels' was unset
4878 when read_kbd || !NILP (wait_for_cell); fix this.
4880 Add GCC-style 'const' attribute to functions that can use it.
4881 * character.h (char_resolve_modifier_mask):
4882 * keyboard.h (make_ctrl_char):
4883 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4884 (init_character_once, next_almost_prime, init_fns, init_image)
4885 (flush_pending_output, init_sound):
4886 * mem-limits.h (start_of_data):
4887 * menu.h (finish_menu_items):
4888 Add ATTRIBUTE_CONST.
4889 * emacs.c (DEFINE_DUMMY_FUNCTION):
4890 Declare the dummy function with ATTRIBUTE_CONST.
4891 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4892 Add decls with ATTRIBUTE_CONST.
4894 Minor improvements to make_formatted_string.
4895 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4896 where int is good enough, as vsprintf returns an int.
4897 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4899 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4901 Use make_formatted_string to avoid double length calculation.
4902 * lisp.h (make_formatted_string): New prototype.
4903 * alloc.c (make_formatted_string): New function.
4904 * buffer.c (Fgenerate_new_buffer_name): Use it.
4905 * dbus.c (syms_of_dbusbind): Likewise.
4906 * editfns.c (Fcurrent_time_zone): Likewise.
4907 * filelock.c (get_boot_time): Likewise.
4908 * frame.c (make_terminal_frame, set_term_frame_name)
4909 (x_report_frame_params): Likewise.
4910 * image.c (gs_load): Likewise.
4911 * minibuf.c (get_minibuffer): Likewise.
4912 * msdos.c (dos_set_window_size): Likewise.
4913 * process.c (make_process): Likewise.
4914 * xdisp.c (ensure_echo_area_buffers): Likewise.
4915 * xsettings.c (apply_xft_settings): Likewise.
4917 2012-07-09 Glenn Morris <rgm@gnu.org>
4919 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4920 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4921 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4922 * nsterm.h (ns_etc_directory): Add it.
4923 * callproc.c [HAVE_NS]: Include nsterm.h.
4924 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4926 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4928 Move marker debugging code under MARKER_DEBUG.
4929 * marker.c (MARKER_DEBUG): Move marker debugging code under
4930 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4931 for bootstrap with --enable-checking (~3x slowdown reported
4932 by Juanma Barranquero <lekktu@gmail.com>).
4933 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4935 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4937 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4938 See <http://bugs.gnu.org/11825#29>.
4940 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4942 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4943 has no font, use the frame's font. (Bug#11813)
4944 (display_line): Add commentary about displaying truncation glyphs
4946 (produce_special_glyphs): Move here from term.c.
4948 * term.c (produce_special_glyphs): Move to xdisp.c.
4950 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4953 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4955 * xdisp.c (display_line): Avoid warning about implicit declaration
4958 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4960 * lisp.h: Remove empty conditional.
4962 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4964 * lread.c (load_path_check): Now static.
4966 Fix some minor --with-ns problems found by static checking.
4967 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4968 (x_set_font) [!HAVE_X_WINDOWS]:
4969 * image.c (xpm_load_image) [HAVE_NS]:
4970 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4971 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4972 Remove unused local.
4973 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4974 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4975 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4976 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4977 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4978 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4979 Fix pointer signedness problem.
4980 * xfaces.c (FRAME_X_FONT_TABLE):
4981 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4983 2012-07-07 Glenn Morris <rgm@gnu.org>
4985 * lread.c (load_path_check): New function, split from init_lread.
4986 (init_lread): Reorganize. Motivation:
4987 If EMACSLOADPATH is set, check/warn about that rather than the
4988 defaults, which we are not going to use. Hence we can remove
4989 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4990 Don't warn if site-lisp directories are missing.
4991 If not installed, start from a blank load-path, since
4992 PATH_LOADSEARCH refers to the eventual installation directories.
4994 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4996 Support truncation and continuation glyphs on GUI frames, when
4997 fringes are disabled. (Bug#11832)
4998 * xdisp.c (init_iterator): Get dimensions of truncation and
4999 continuation glyphs even if on GUI frames.
5000 Adjust it->last_visible_x on GUI frames when the left or right fringes,
5001 or both, are absent.
5002 (start_display, move_it_in_display_line_to): Handle the case of a
5003 GUI frame without a fringe to display continuation or truncation
5005 (insert_left_trunc_glyphs): Support GUI frames: make sure
5006 truncation glyphs overwrite enough glyphs from the current line to
5007 have sufficient space in pixels.
5008 (display_line): Support truncation and continuation glyphs on GUI
5009 frames. If some spare pixels are left on the line after inserting
5010 the truncation glyphs, fill that space with a stretch glyph of a
5011 suitably computed width.
5013 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5014 produce_glyphs, to support GUI sessions.
5016 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5018 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5020 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5022 Do not require float-time's arg to fit in time_t (Bug#11825).
5023 This works better on hosts where time_t is unsigned, and where
5024 float-time is applied to the (negative) difference between two times.
5025 * editfns.c (decode_time_components): Last arg is now double *,
5026 not int *, and means to store all the result as a double, without
5027 worrying about whether the seconds part fits in time_t.
5028 All callers changed.
5029 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5030 All callers changed.
5031 (Ffloat_time): Do not fail merely because the specified time falls
5032 outside of time_t range.
5034 2012-07-07 Glenn Morris <rgm@gnu.org>
5036 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5037 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5038 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5040 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
5042 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5043 Update dependencies.
5045 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5047 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5049 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5050 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5051 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5052 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5053 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5054 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5056 * xfont.c (compare_font_names): Redo to omit the need for casts.
5058 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5060 * xfns.c (Fx_change_window_property): Doc fix.
5061 * w32fns.c (Fx_change_window_property): Doc fix.
5063 * w32fns.c (Fx_window_property): Accept the same arguments as the
5064 X Windows version. Doc fix.
5065 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5067 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5068 Eli Zaretskii <eliz@gnu.org>
5070 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5071 Windows-specific code from nt/config.nt moved here.
5072 Obsolete settings removed.
5074 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5076 * process.c: Avoid unnecessary calls to gettime.
5077 (wait_reading_process_output): Don't get the time of day
5078 when gobbling data immediately and not waiting, as there's no need
5079 for it in that case. This removes a FIXME.
5081 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5083 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5084 is defined (Bug#11768).
5086 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5088 Fix marker debugging code.
5089 * marker.c (byte_char_debug_check): Do not perform the check
5090 if buffer is not multibyte.
5091 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5092 Call byte_char_debug_check with correct arguments.
5094 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5096 Compile marker debugging code only if ENABLE_CHECKING is defined.
5097 * marker.c (byte_char_debug_check, count_markers):
5098 Use only if ENABLE_CHECKING is defined.
5099 (byte_debug_flag): Remove.
5100 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5101 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5103 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5105 Avoid code repetition in marker-related functions.
5106 * marker.c (attach_marker): New function.
5107 (Fset_marker, set_marker_restricted, set_marker_both)
5108 (set_marker_restricted_both): Use it.
5109 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5110 Consistently rename charno to charpos.
5111 (marker_position): Add eassert.
5112 (marker_byte_position): Convert to eassert.
5114 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5116 Simplify list operations in unchain_overlay and unchain_marker.
5117 * buffer.c (unchain_overlay): Simplify. Add comment.
5118 * marker.c (unchain_marker): Simplify. Fix comments.
5120 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5122 Introduce fast path for the widely used marker operation.
5123 * alloc.c (build_marker): New function.
5124 * lisp.h (build_marker): New prototype.
5125 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5126 * composite.c (autocmp_chars): Likewise.
5127 * editfns.c (buildmark): Remove.
5128 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5129 (save_restriction_save): Use build_marker.
5130 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5131 * window.c (save_window_save): Likewise.
5133 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5135 Do not use Fdelete_overlay in delete_all_overlays
5136 to avoid redundant calls to unchain_overlay.
5137 * buffer.c (drop_overlay): New function.
5138 (delete_all_overlays, Fdelete_overlay): Use it.
5139 * minibuf.c (get_minibuffer): Fix comment.
5141 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5143 Port to OpenBSD 5.1 amd64.
5144 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5145 This is needed for OpenBSD, and should be harmless on all BSD systems.
5146 Also, include <sys/sysctl.h>, as it should be available on all
5147 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5148 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5149 use p_pid member, not kp_proc.pid.
5151 2012-07-06 Glenn Morris <rgm@gnu.org>
5153 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5155 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5157 More xmalloc and related cleanup.
5158 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5159 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5160 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5161 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5162 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5163 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5164 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5165 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5166 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5168 Omit needless casts involving void * pointers and allocation.
5169 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5170 as the former is more robust if P's type is changed.
5171 Prefer xzalloc to xmalloc + memset 0.
5172 Simplify malloc-or-realloc to realloc.
5173 Don't worry about xmalloc returning a null pointer.
5174 Prefer xstrdup to xmalloc + strcpy.
5175 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5177 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5178 alloca of a constant.
5180 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5182 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5183 hscroll is larger than the line width. Fixes long and futile
5184 looping inside extend_face_to_end_of_line (on a TTY) producing
5185 glyphs that are not needed and thrown away.
5187 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5189 * marker.c (set_marker_restricted_both): Simplify by using
5192 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5194 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5196 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5198 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5199 not defined (Bug#11768).
5200 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5201 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5202 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5203 followed by gtk_box_set_homogeneous (Bug#11768).
5204 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5205 (update_theme_scrollbar_width, xg_create_scroll_bar):
5206 Use gtk_scrollbar_new (Bug#11768).
5207 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5208 (is_box_type): New function (Bug#11768).
5209 (xg_tool_item_stale_p): Call is_box_type.
5210 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5211 with default display (Bug#11768).
5213 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5215 * xdisp.c (window_hscroll_limited): New function.
5216 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5217 coordinates when window's hscroll is set to insanely large
5220 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
5222 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5223 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5225 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5228 * lisp.h (xzalloc): New prototype. Omit needless casts.
5229 * alloc.c (xzalloc): New function. Omit needless casts.
5230 * charset.c: Omit needless casts. Convert all calls to
5231 xmalloc with following memset to xzalloc.
5232 * dispnew.c: Likewise.
5233 * fringe.c: Likewise.
5234 * image.c: Likewise.
5235 * sound.c: Likewise.
5237 * w32fns.c: Likewise.
5238 * w32font.c: Likewise.
5239 * w32term.c: Likewise.
5240 * xfaces.c: Likewise.
5242 * xterm.c: Likewise.
5243 * atimer.c: Omit needless casts.
5244 * buffer.c: Likewise.
5245 * callproc.c: Likewise.
5247 * coding.c: Likewise.
5248 * composite.c: Likewise.
5250 * doprnt.c: Likewise.
5251 * editfns.c: Likewise.
5252 * emacs.c: Likewise.
5254 * filelock.c: Likewise.
5256 * gtkutil.c: Likewise.
5257 * keyboard.c: Likewise.
5259 * lread.c: Likewise.
5260 * minibuf.c: Likewise.
5261 * msdos.c: Likewise.
5262 * print.c: Likewise.
5263 * process.c: Likewise.
5264 * region-cache.c: Likewise.
5265 * search.c: Likewise.
5266 * sysdep.c: Likewise.
5267 * termcap.c: Likewise.
5268 * terminal.c: Likewise.
5269 * tparam.c: Likewise.
5270 * w16select.c: Likewise.
5272 * w32reg.c: Likewise.
5273 * w32select.c: Likewise.
5274 * w32uniscribe.c: Likewise.
5275 * widget.c: Likewise.
5276 * xdisp.c: Likewise.
5277 * xmenu.c: Likewise.
5279 * xselect.c: Likewise.
5281 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5283 * fileio.c (time_error_value): Check the right error number.
5284 Problem reported by Troels Nielsen in
5285 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5287 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5289 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5290 This should be fixed in a better way; see Eli Zaretskii in
5291 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5292 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5294 * fileio.c (time_error_value): Rename from special_mtime.
5295 The old name's problems were noted by Eli Zaretskii in
5296 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5298 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5299 This variable's comment says Emacs needs at least one GDB-visible
5300 symbol of type enum pvec_type, to work around GDB problems.
5301 The symbol's value doesn't matter.
5303 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5304 that causes compilation to fail on pre-C99 compilers.
5306 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
5308 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5309 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5311 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5313 * buffer.c (init_buffer_once): Fix initialization of
5314 headers for buffer_defaults and buffer_local_symbols.
5315 Reported by Juanma Barranquero <lekktu@gmail.com>.
5317 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5319 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5320 * lisp.h (enum pvec_type): Use fewer bits.
5321 (PSEUDOVECTOR_SIZE_BITS): New constant.
5322 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5323 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5324 change in pvec_type.
5325 (PSEUDOVECTOR_TYPEP): New macro.
5326 (TYPED_PSEUDOVECTORP): Use it.
5327 * fns.c (internal_equal): Adapt code to extract pvectype.
5328 * emacs.c (gdb_pvec_type): Update type.
5329 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5330 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5331 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5332 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5333 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5334 abusing vector->header.next.nbytes.
5335 (live_vector_p): Use PVEC_TYPE.
5336 (mark_object): Adapt code to extract pvectype. Use switch.
5338 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5340 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5341 Tighten new eassert a bit.
5343 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5345 Fix compilation with --enable-gcc-warnings and -O1
5347 * doprnt.c (doprnt): Change type of tem to int, initialize
5348 to avoid compiler warning. Add eassert.
5349 * search.c (simple_search): Initialize match_byte to avoid
5350 compiler warning. Add eassert.
5352 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5354 Avoid weird behavior with large horizontal scrolls.
5355 Without this change, for example, large hscroll values would
5356 mess up Emacs's display on Fedora 15 x86, presumably due to
5357 overflows in int calculations in the display code.
5358 Also, if buffers had long lines, Emacs would freeze.
5359 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5360 (set_window_hscroll): New function, containing the old guts of
5361 Fset_window_hscroll. Return the clipped value.
5362 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5363 This avoids the need to check against PTRDIFF_MAX.
5365 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5367 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5369 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5371 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5373 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5374 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5375 since GCC 4.4.6 issues a bogus warning for them.
5377 Fix bugs in file timestamp newness comparisons.
5378 * fileio.c (Ffile_newer_than_file_p):
5379 * lread.c (Fload): Use full timestamp resolution of files,
5380 not just the 1-second resolution, so that files that are only
5381 slightly newer still count as newer.
5382 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5383 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5385 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5387 * fileio.c: Improve handling of file time marker. (Bug#11852)
5388 (special_mtime): New function.
5389 (Finsert_file_contents, Fverify_visited_file_modtime):
5390 Use it to set special mtime values consistently.
5392 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5394 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5395 marker for non-existing file. (Bug#11852)
5397 2012-07-03 Glenn Morris <rgm@gnu.org>
5399 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5400 and did not make it into globals.h).
5402 2012-07-03 Tom Tromey <tromey@redhat.com>
5404 * window.c (Fset_window_margins, Fset_window_fringes)
5405 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5406 * textprop.c (Fprevious_property_change): No longer static.
5407 * syntax.c (Fsyntax_table_p): No longer static.
5408 * process.c (Fget_process, Fprocess_datagram_address): No longer
5410 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5411 * keyboard.c (Fcommand_execute): No longer static.
5413 * insdel.c (Fcombine_after_change_execute): No longer static.
5414 * image.c (Finit_image_library): No longer static.
5415 * fileio.c (Fmake_symbolic_link): No longer static.
5416 * eval.c (Ffetch_bytecode): No longer static.
5417 * editfns.c (Fuser_full_name): No longer static.
5418 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5420 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5422 * dired.c (Ffile_attributes): No longer static.
5423 * composite.c (Fcomposition_get_gstring): No longer static.
5424 * callproc.c (Fgetenv_internal): No longer static.
5426 * ccl.h: Remove EXFUNs.
5427 * buffer.h: Remove EXFUNs.
5428 * dispextern.h: Remove EXFUNs.
5429 * intervals.h: Remove EXFUNs.
5430 * fontset.h: Remove EXFUN.
5431 * font.h: Remove EXFUNs.
5432 * dosfns.c (system_process_attributes): Remove EXFUN.
5433 * keymap.h: Remove EXFUNs.
5434 * lisp.h: Remove EXFUNs.
5435 * w32term.h: Remove EXFUNs.
5436 * window.h: Remove EXFUNs.
5437 * xsettings.h: Remove EXFUN.
5438 * xterm.h: Remove EXFUN.
5440 2012-07-03 Glenn Morris <rgm@gnu.org>
5442 * lisp.h (Frandom): Make it visible to C.
5443 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5444 buffer for invisible buffers. (Bug#1229)
5446 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5448 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5449 values which aren't power of 2.
5450 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5451 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5454 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5456 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5458 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5460 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5462 * alloc.c (allocate_vector_block): Remove redundant
5463 calls to mallopt if DOUG_LEA_MALLOC is defined.
5464 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5465 avoid calls to mallopt if zero_vector is returned.
5467 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5469 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5470 is enabled, avoid dereferencing NULL current_sblock if
5473 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5475 Cleanup basic buffer management.
5476 * buffer.h (struct buffer): Change layout to use generic vector
5477 marking code. Fix some comments. Change type of 'clip_changed'
5478 to bitfield. Remove unused #ifndef old.
5479 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5480 (GET_OVERLAYS_AT): Fix indentation.
5481 (for_each_per_buffer_object_at): New macro.
5482 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5483 (Fbuffer_local_variables): Use it.
5484 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5485 * alloc.c (allocate_buffer): Adjust to match new layout of
5486 struct buffer. Fix comment.
5487 (mark_overlay): New function.
5488 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5489 Lisp area of struct buffer.
5490 (mark_object): Use it. Adjust marking of misc objects
5491 and related comments.
5493 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5495 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5496 wrapper that is not needed because the wrapped code is a no-op (zero
5497 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5498 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5500 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5502 * alloc.c (mark_buffer): Simplify. Remove prototype.
5503 (mark_object): Add comment. Reorganize marking of vector-like
5504 objects. Use CHECK_LIVE for all vector-like objects except buffers
5505 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5506 Avoid redundant calls to mark_vectorlike for bool vectors.
5508 2012-06-30 Glenn Morris <rgm@gnu.org>
5510 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5512 * epaths.in (PATH_SITELOADSEARCH): New.
5513 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5514 This is rather than relying on --enable-locallisppath elements
5515 having "site-lisp" in their names. (Bug#10208#25, 11658)
5517 2012-06-30 Eli Zaretskii <eliz@gnu.org>
5519 * w32proc.c (sys_select): Accept and ignore one more argument.
5521 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5523 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5524 (pselect) [!MS_DOS]: Redirect to sys_select.
5526 * sysdep.c: Don't include dos.h and dosfns.h.
5528 * process.c (sys_select):
5529 * msdos.c (sys_select): Accept one more argument and ignore it.
5531 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5532 adapt data types and code to that.
5535 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5536 which clashes with the gnulib function of the same name.
5538 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5540 * font.c (font_style_to_value, font_style_symbolic)
5541 (font_prop_validate_style): Add type checks for values in
5544 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5546 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5549 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5551 * xdisp.c (try_window_id): Undo last change.
5553 * w32.c (getwd): Adjust commentary about startup_dir.
5554 (init_environment): Always call sys_access, even in non-MSVC
5555 builds. Don't chdir to the directory of the Emacs executable.
5556 This undoes code from 1997 which was justified by the need to
5557 "avoid conflicts when removing and renaming directories". But its
5558 downside was that every relative file name was being interpreted
5559 relative to the directory of the Emacs executable, which can never
5560 be TRT. In particular, it broke sys_access when called with
5561 relative file names.
5562 (sys_access): Map GetLastError to errno.
5564 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5566 * window.h (struct window): Change type of 'fringes_outside_margins'
5567 to bitfield. Fix comment. Adjust users accordingly.
5568 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5570 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5573 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5575 * gnutls.c (emacs_gnutls_handshake):
5576 Add QUIT to make the loop interruptible.
5578 2012-06-29 Glenn Morris <rgm@gnu.org>
5580 * charset.c (init_charset): Make lack of etc/charsets fatal.
5582 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5584 * editfns.c (region_limit): Fix type mismatch.
5586 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5588 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5589 undefined. Convert from xassert to eassert.
5590 * nsmenu.m: Convert from xassert to eassert.
5591 * nsterm.m: Likewise.
5593 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5595 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5597 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5599 Avoid integer overflow on scroll-left and scroll-right.
5600 * window.c (HSCROLL_MAX): New macro.
5601 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5602 overflow when requested scroll falls outside ptrdiff_t range.
5604 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5606 * window.h (struct window): Change type of 'hscroll',
5607 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5608 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5609 Adjust users accordingly.
5610 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5611 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5612 from EMACS_INT to ptrdiff_t.
5613 (make_window): Omit redundant initialization.
5615 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5617 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5619 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5621 * window.h (struct window): Change type of 'use_time' and
5622 'sequence_number' from Lisp_Object to int.
5623 * frame.c (make_frame): Adjust users accordingly.
5624 * print.c (print_object): Likewise.
5625 * window.c (select_window, Fwindow_use_time, make_parent_window)
5626 (make_window): Likewise.
5628 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5630 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5631 enabled with --enable-checking=[all,glyphs] configure option.
5632 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5633 adjust comments accordingly.
5634 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5635 undefined, adjust comments accordingly.
5636 * image.c: Likewise.
5637 * scroll.c: Likewise.
5638 * w32fns.c: Likewise.
5639 * w32term.c: Likewise.
5640 * xdisp.c: Likewise.
5641 * xfaces.c: Likewise.
5643 * xterm.c: Likewise.
5645 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5647 Generalize run-time debugging checks.
5648 * dispextern.h (XASSERTS): Remove.
5649 * fontset.c (xassert): Remove.
5650 Convert from xassert to eassert.
5651 * alloc.c: Convert from xassert to eassert.
5653 * dispnew.c: Likewise.
5655 * fringe.c: Likewise.
5656 * ftfont.c: Likewise.
5657 * gtkutil.c: Likewise.
5658 * image.c: Likewise.
5659 * keyboard.c: Likewise.
5661 * process.c: Likewise.
5662 * scroll.c: Likewise.
5663 * sound.c: Likewise.
5665 * w32console.c: Likewise.
5666 * w32fns.c: Likewise.
5667 * w32term.c: Likewise.
5668 * window.c: Likewise.
5669 * xdisp.c: Likewise.
5670 * xfaces.c: Likewise.
5672 * xselect.c: Likewise.
5673 * xterm.c: Likewise.
5675 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5677 * fns.c (maybe_resize_hash_table): Output message when growing the
5680 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5682 * alloc.c (allocate_string_data): Remove dead code.
5683 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5684 avoid GCC warning about unused macro.
5686 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5688 * alloc.c (allocate_string): Omit intervals initialization.
5689 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5690 as in make_pure_string and make_pure_c_string.
5692 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5694 * alloc.c (allocate_string): Fix last change.
5696 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5698 * alloc.c (allocate_string): Remove two redundant calls
5699 to memset, add explicit initialization where appropriate.
5701 2012-06-27 Glenn Morris <rgm@gnu.org>
5703 * lisp.mk (lisp): Remove paths.elc.
5705 2012-06-27 Chong Yidong <cyd@gnu.org>
5707 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5709 2012-06-26 John Wiegley <johnw@newartisans.com>
5711 * unexmacosx.c (copy_data_segment): Add two section names used
5712 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5714 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5715 when building with Clang.
5717 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5719 * eval.c (Fapply): Allow calling it with a single argument.
5721 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5723 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5724 _stricmp and _strnicmp.
5725 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5727 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5729 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5731 (allocate_process): Likewise for new process.
5732 (allocate_terminal): Change to use offsetof.
5733 (allocate_frame): Likewise.
5734 * frame.c (make_frame): Omit redundant initialization.
5735 * window.c (make_parent_window): Use memset.
5736 (make_window): Omit redundant initialization.
5737 * process.c (make_process): Omit redundant initialization.
5738 * terminal.c (create_terminal): Likewise.
5740 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5742 * term.c (delete_tty): Remove redundant call to memset.
5744 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5746 * alloc.c: Remove build_string.
5747 * lisp.h: Define build_string as static inline. This provides
5748 a better opportunity to optimize away calls to strlen when the
5749 function is called with compile-time constant argument.
5750 * image.c (imagemagick_error): Convert to build_string.
5751 * w32proc.c (sys_spawnve): Likewise.
5752 * xterm.c (x_term_init): Likewise.
5754 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5756 Use sprintf return value instead of invoking strlen on result.
5757 In the old days this wasn't portable, since some sprintf
5758 implementations returned char *. But they died out years ago and
5759 Emacs already assumes sprintf returns int.
5760 Similarly for float_to_string.
5761 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5762 * ccl.c (ccl_driver):
5763 * character.c (string_escape_byte8):
5764 * data.c (Fnumber_to_string):
5765 * doprnt.c (doprnt):
5766 * print.c (print_object):
5767 * xdisp.c (message_dolog):
5768 * xfns.c (syms_of_xfns):
5769 Use sprintf or float_to_string result to avoid need to call strlen.
5770 * data.c (Fnumber_to_string):
5771 Use make_unibyte_string, since the string must be ASCII.
5772 * lisp.h, print.c (float_to_string): Now returns int length.
5773 * term.c (produce_glyphless_glyph):
5774 Use sprintf result rather than recomputing it.
5776 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5777 * Makefile.in (ALL_CFLAGS):
5778 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5779 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5781 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5783 * dispextern.h (xstrcasecmp): Define to library function
5784 strcasecmp if available.
5785 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5787 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5789 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5790 Avoid comma operator.
5791 * menu.c (push_submenu_start, push_submenu_end)
5792 (push_left_right_boundary, push_menu_pane): Likewise.
5793 * msdos.c (dos_rawgetc): Likewise.
5795 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5797 * xfns.c (xic_create_fontsetname): Remove redundant calls
5800 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5802 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5803 sprintf already null-terminates its output.
5805 * xfns.c (x_window): Remove redundant cast.
5807 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5809 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5810 `const char *' to `char *' to avoid compiler warning.
5812 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5814 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5815 instead of truncating it to 63 (admittedly a generous limit).
5817 * process.c: Fix spelling and caps in comments.
5819 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5821 * emacs.c (setpgrp): Remove definition, unused.
5822 * sysdep.c (setpgrp): Remove definition, not used in this file.
5824 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5826 * makefile.w32-in: Update dependencies.
5828 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5830 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5831 (SYSTIME_H): Add nt/inc/sys/time.h.
5833 * systime.h [WINDOWSNT]: Include sys/time.h.
5835 * s/ms-w32.h (struct timespec): Definition moved from
5836 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5838 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5840 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5841 * buffer.h (buffer_slot_type_mismatch):
5842 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5843 * eval.c (unwind_to_catch):
5844 * image.c (my_png_error, my_error_exit):
5845 * keyboard.c (quit_throw_to_read_char, user_error)
5846 (Fexit_recursive_edit, Fabort_recursive_edit):
5847 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5848 (wrong_type_argument, buffer_overflow, __executable_start)
5849 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5850 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5851 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5853 (child_setup) [!DOS_NT]:
5854 * lread.c (end_of_file_error, invalid_syntax):
5855 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5856 * puresize.h (pure_write_error):
5857 * search.c (matcher_overflow):
5858 * sound.c (sound_perror, alsa_sound_perror):
5859 * sysdep.c, syssignal.h (croak):
5860 * term.c (maybe_fatal, vfatal):
5861 * textprop.c (text_read_only):
5862 * undo.c (user_error):
5863 * unexmacosx.c (unexec_error):
5864 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5865 Use _Noreturn rather than NO_RETURN.
5866 No need for separate decl merely because of _Noreturn.
5867 * sound.c (sound_warning, parse_sound):
5868 Remove unnecessary forward decls.
5870 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5872 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5873 * lisp.h (WAIT_READING_MAX): New macro.
5874 * dispnew.c (Fsleep_for, sit_for):
5875 * keyboard.c (kbd_buffer_get_event):
5876 * process.c (Faccept_process_output):
5877 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5878 This improves on the previous patch, which introduced a bug
5879 when time_t is unsigned and as wide as intmax_t.
5880 See <http://bugs.gnu.org/9000#51>.
5882 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5884 * dispnew.c (sit_for, Fsleep_for):
5885 * keyboard.c (kbd_buffer_get_event):
5886 * process.c (Faccept_process_output): Avoid compiler warnings when
5887 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5889 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5891 * makefile.w32-in: Update dependencies.
5893 * w32.c (ltime): Add return type and declare static.
5894 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5896 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5898 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5899 Privately reported by Herbert J. Skuhra.
5900 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5902 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5903 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5905 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5907 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5908 last argument of make_unibyte_string.
5910 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5911 language ID in the event parameters.
5913 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5914 event.code, not the obscure "character set ID".
5916 2012-06-23 Chong Yidong <cyd@gnu.org>
5918 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5920 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5922 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5923 * w32.c (fdutimens): New function.
5925 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5927 * s/ms-w32.h (pselect): Redirect to sys_select.
5929 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5931 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5932 in the logic of incrementing and decrementing the value of
5933 use_relocatable_buffers.
5935 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5937 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5938 Privately reported by Herbert J. Skuhra.
5939 [__FreeBSD__]: Remove "*/" typo after "#include".
5940 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5941 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5942 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5943 Don't assume EMACS_TIME and struct timeval are the same type.
5945 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5947 Support higher-resolution time stamps (Bug#9000).
5948 The time stamps are only nanosecond-resolution at the C level,
5949 since that's the best that any real-world system supports now.
5950 But they are picosecond-resolution at the Lisp level, as that's
5951 easy, and leaves room for future OS improvements.
5953 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5956 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5957 Don't get current time unless it's needed.
5959 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5960 now provides it if it's absent.
5961 (start_atimer): Port to higher-res time stamps.
5962 Check for time stamp overflow. Don't get current time more
5963 often than is needed.
5965 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5966 Include systime.h, not time.h.
5967 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5969 * dired.c: Include stat-time.h.
5970 (Ffile-attributes): File times now have higher resolution.
5972 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5973 (struct image): Timestamp now has higher resolution.
5975 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5976 has at least microseconds now. All uses removed.
5977 (update_frame, update_single_window, update_window, update_frame_1)
5978 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5979 (duration_to_sec_usec): Remove; no longer needed.
5981 * editfns.c (time_overflow): Now extern.
5982 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5983 (float-time, Fformat_time_string, Fcurrent_time_string)
5984 (Fcurrent_time_zone): Accept and generate higher-resolution
5986 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5987 (decode_time_components, lisp_seconds_argument): New functions.
5988 (make_time): Now static.
5989 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5990 Report an error if the time is invalid, rather than having the caller
5993 * fileio.c: Include <stat-time.h>
5994 (Fcopy_file): Copy higher-resolution time stamps.
5995 Prefer to set the time stamp via a file descriptor if that works.
5996 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5997 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5998 (Fvisited_file_modtime, Fset_visited_file_modtime):
5999 Support higher-resolution time stamps.
6001 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6003 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6005 * image.c (prepare_image_for_display, clear_image_cache)
6006 (lookup_image): Port to higer-resolution time stamps.
6008 * keyboard.c (start_polling, bind_polling_period):
6009 Check for time stamp overflow.
6010 (read_char, kbd_buffer_get_event, timer_start_idle)
6011 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6012 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6013 Port to higher-resolution time stamps. Do not assume time_t is signed.
6014 (decode_timer): New function. Timers are now vectors of length 9,
6015 not 8, to accommodate the picosecond component.
6016 (timer_check_2): Use it.
6018 * nsterm.m (select_timeout, timeval_subtract): Remove.
6019 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6020 as they're a bit more accurate and handle overflow better.
6021 (ns_select): Change prototype to be compatible with pselect.
6022 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6023 * nsterm.h (ns_select): Adjust prototype.
6025 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6026 us-resolution time stamps.
6027 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6029 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6031 * lisp.h (time_overflow): New decl.
6032 (wait_reading_process_output): First arg is now intmax_t, not int,
6033 to accommodate larger waits.
6035 * process.h (struct Lisp_Process.read_output_delay):
6036 Now counts nanoseconds, not microseconds.
6037 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6039 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6040 (wait_reading_process_output):
6041 Port to ns-resolution time stamps.
6042 (Faccept_process_output, wait_reading_process_output):
6043 Check for time stamp overflow. Do not assume time_t is signed.
6044 (select_wrapper): Remove; we now use pselect.
6045 (Fprocess_attributes): Now generates ns-resolution time stamps.
6047 * sysdep.c: Include utimens.h. Don't include utime.h
6048 or worry about struct utimbuf; gnulib does that for us now.
6049 (gettimeofday): Remove; gnulib provides a substitute.
6050 (make_timeval): New function.
6051 (set_file_times): Now sets ns-resolution time stamps.
6052 New arg FD; all uses changed.
6053 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6054 (system_process_attributes):
6055 Now returns ns-resolution time stamp. All uses changed.
6056 Check for time stamp overflow.
6058 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6059 provides a substitute now.
6061 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6062 since it guarantees struct timespec.
6063 (EMACS_TIME): Now struct timespec, so that we can support
6064 ns-resolution time stamps.
6065 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6066 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6067 (EMACS_USECS): Remove.
6068 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6069 so multiply the arg by 1000 before storing it.
6070 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6072 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6073 Port to ns-resolution time stamps.
6074 (EMACS_TIME_NEG_P): Remove; replaced by....
6075 (EMACS_TIME_SIGN): New macro.
6076 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6077 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6078 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6079 (make_timeval, make_lisp_time, decode_time_components): New decls.
6080 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6081 that it mishandled time_t overflow. You can't compare by subtracting!
6082 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6083 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6085 * term.c: Include <sys/time.h>.
6086 (timeval_to_Time): New function, for proper overflow wraparound.
6087 (term_mouse_position, term_mouse_click): Use it.
6089 * undo.c (record_first_change): Support higher-resolution time stamps
6091 (Fprimitive_undo): Use them when restoring time stamps.
6093 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6094 (w32_get_internal_run_time):
6095 Port to higher-resolution Emacs time stamps.
6096 (ltime): Now accepts single 64-bit integer, as that's more convenient
6099 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6101 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6102 for compatibility with pselect. Support ns-resolution time stamps.
6104 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6106 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6107 Check for time stamp overflow, and support ns-resolution time stamps.
6109 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6110 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6111 (timeval_subtract): Remove; no longer needed.
6112 (XTflash, XTring_bell, x_wait_for_event):
6113 Port to ns-resolution time stamps. Don't assume time_t is signed.
6115 2012-06-22 Chong Yidong <cyd@gnu.org>
6117 * xdisp.c (x_consider_frame_title): Revert last change.
6119 2012-06-22 Eli Zaretskii <eliz@gnu.org>
6121 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6122 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6123 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6124 staticidx goes up to 1597 out of 1600 = 0x640.)
6126 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6128 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6129 Otherwise, the umask might be mistakenly 0 while handling input signals.
6131 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6133 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6135 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6137 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6138 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6139 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6140 access to `contents' member of Lisp_Vector objects with AREF and ASET
6143 2012-06-19 Chong Yidong <cyd@gnu.org>
6145 * frame.c (delete_frame): When selecting a frame on a different
6146 text terminal, do not alter the terminal's top-frame.
6148 * xdisp.c (format_mode_line_unwind_data): Record the target
6149 frame's selected window and its terminal's top-frame.
6150 (unwind_format_mode_line): Restore them.
6151 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6153 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6154 since tty frames can be explicitly named.
6155 (prepare_menu_bars): Likewise.
6157 * term.c (Ftty_top_frame): New function.
6159 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6161 Port byte-code-meter to modern targets.
6162 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6163 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6164 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6165 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6166 (METER_1, METER_2): Simplify.
6168 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6170 * data.c (Fdefalias): Return `symbol' (bug#11686).
6172 2012-06-18 Martin Rudalics <rudalics@gmx.at>
6174 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6175 gets killed during executing of this function (Bug#11665).
6176 Try to always return Qt when the buffer has been actually killed.
6177 (Vkill_buffer_query_functions): In doc-string say that functions
6178 run by this hook should not change the current buffer.
6180 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6182 Fix recently-introduced process.c problems found by static checking.
6183 * process.c (write_queue_push, write_queue_pop, send_process):
6184 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6185 (write_queue_pop): Fix pointer signedness problem.
6186 (send_process): Remove unused local.
6188 2012-06-17 Chong Yidong <cyd@gnu.org>
6190 * xdisp.c (redisplay_internal): No need to redisplay terminal
6191 frames that are not on top.
6193 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
6195 * process.c (make_process): Initialize write_queue.
6196 (write_queue_push, write_queue_pop): New functions.
6197 (send_process): Use them to maintain correct ordering of process
6200 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6202 * lisp.h (eassert): Assume C89 or later.
6203 This removes the need for CHECK.
6204 (CHECK): Remove. Its comments about always evaluating its
6205 argument were confusing, as 'eassert' typically does not evaluate
6208 * coding.c (produce_chars): Use ptrdiff_t, not int.
6210 * xterm.c (x_draw_underwave): Check for integer overflow.
6211 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6213 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
6215 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6216 referenced (Bug#11583).
6218 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6220 Implement wave-style variant of underlining.
6221 * dispextern.h (face_underline_type): New enum.
6222 (face): Add field for underline type.
6223 * nsterm.m (ns_draw_underwave): New function.
6224 (ns_draw_text_decoration): Use it.
6225 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6227 (x_draw_glyph_string): Use them.
6228 * xfaces.c (Qline, Qwave): New Lisp objects.
6229 (check_lface_attrs, merge_face_ref)
6230 (Finternal_set_lisp_face_attribute, realize_x_face):
6231 Handle wave-style underline face attributes.
6232 * xterm.c (x_draw_underwave): New function.
6233 (x_draw_glyph_string): Use it.
6235 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
6237 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6238 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6239 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6240 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6241 ($(BLD)/w32select.$(O)): Update dependencies.
6243 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6245 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6246 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6247 * character.c (_fetch_multibyte_char_p): Remove.
6248 * alloc.c: Include "character.h" before "buffer.h".
6250 * buffer.c: Likewise.
6251 * bytecode.c: Likewise.
6252 * callint.c: Likewise.
6253 * callproc.c: Likewise.
6254 * casefiddle.c: Likewise.
6255 * casetab.c: Likewise.
6256 * category.c: Likewise.
6258 * coding.c: Likewise.
6259 * composite.c: Likewise.
6260 * dired.c: Likewise.
6261 * dispnew.c: Likewise.
6263 * dosfns.c: Likewise.
6264 * editfns.c: Likewise.
6265 * emacs.c: Likewise.
6266 * fileio.c: Likewise.
6267 * filelock.c: Likewise.
6269 * fontset.c: Likewise.
6270 * fringe.c: Likewise.
6271 * indent.c: Likewise.
6272 * insdel.c: Likewise.
6273 * intervals.c: Likewise.
6274 * keyboard.c: Likewise.
6275 * keymap.c: Likewise.
6276 * lread.c: Likewise.
6277 * macros.c: Likewise.
6278 * marker.c: Likewise.
6279 * minibuf.c: Likewise.
6280 * nsfns.m: Likewise.
6281 * nsmenu.m: Likewise.
6282 * print.c: Likewise.
6283 * process.c: Likewise.
6284 * regex.c: Likewise.
6285 * region-cache.c: Likewise.
6286 * search.c: Likewise.
6287 * syntax.c: Likewise.
6289 * textprop.c: Likewise.
6291 * unexsol.c: Likewise.
6292 * w16select.c: Likewise.
6293 * w32fns.c: Likewise.
6294 * w32menu.c: Likewise.
6295 * window.c: Likewise.
6296 * xdisp.c: Likewise.
6298 * xmenu.c: Likewise.
6300 * xselect.c: Likewise.
6302 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6304 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6305 If all the glyphs of the glyph row came from strings, and we have no
6306 cursor positioning clues, put the cursor on the first glyph of the
6308 (handle_face_prop): Use chunk-relative overlay string index when
6309 indexing into it->string_overlays array. (Bug#11653)
6310 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6311 the rightmost. (Bug#11720)
6313 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6315 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6316 (CATEGORY_MEMBER): Enforce 1/0 value.
6317 * category.c (_temp_category_set): Remove.
6319 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6321 * window.c (Fdelete_other_windows_internal)
6322 (Fdelete_window_internal): Don't access frame's mouse highlight
6323 info of the initial frame. (Bug#11677)
6325 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6327 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6328 Assume USE_2_TAGS_FOR_INTS.
6329 (xreload): Adjust $tagmask width to match recent lisp.h change.
6331 Simplify lisp.h in minor ways that should not affect code.
6332 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6333 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6334 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6335 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6336 (INTTYPEBITS): New macro, for clarity.
6337 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6338 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6339 Simplify now that USE_LSB_TAG is always defined.
6340 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6341 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6343 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
6345 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6347 2012-06-13 Glenn Morris <rgm@gnu.org>
6349 * s/bsd-common.h (BSD4_3):
6350 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6352 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6354 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6357 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6359 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6360 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6361 * alloc.c (widen_to_Lisp_Object): Remove.
6362 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6363 * frame.c (delete_frame): Remove outdated comment.
6364 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6365 USE_LISP_UNION_TYPE.
6366 (Fw32_unregister_hot_key): Likewise.
6367 (Fw32_toggle_lock_key): Likewise.
6368 * w32menu.c (add_menu_item): Likewise.
6369 (w32_menu_display_help): Use XIL instead of checking
6370 USE_LISP_UNION_TYPE.
6371 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6372 (init_heap): Likewise.
6373 * w32term.c (w32_read_socket): Update comment.
6375 2012-06-13 Glenn Morris <rgm@gnu.org>
6377 * s/usg5-4-common.h, src/s/unixware.h:
6378 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6380 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6382 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6384 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6385 * alloc.c (make_number) [!defined make_number]:
6386 Remove, as lisp.h always defines this now.
6387 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6388 (roundup_size): Verify that it is a power of 2.
6389 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6390 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6391 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6392 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6393 USE_LSB_TAG now is always defined to be either 0 or 1.
6395 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6396 code works fine either way, and efficiency is not a concern here,
6397 as the union type is for debugging, not for production.
6398 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6399 Use an inline function on all platforms when using the union type,
6400 since this is simpler and 'static inline' can be used portably
6402 (LISP_INITIALLY_ZERO): New macro.
6403 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6404 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6406 2012-06-12 Glenn Morris <rgm@gnu.org>
6408 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6410 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6412 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6413 Move BROKEN_SIGIO to configure.
6415 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6416 Move NO_TERMIO to configure.
6418 2012-06-12 Chong Yidong <cyd@gnu.org>
6420 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6421 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6422 MagickExportImagePixels is undefined.
6424 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6426 * image.c (imagemagick_load_image): Remove unused label.
6428 2012-06-11 Glenn Morris <rgm@gnu.org>
6430 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6431 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6432 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6433 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6435 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6437 * alloc.c (make_byte_code): New function.
6438 (Fmake_byte_code): Use it. Don't purify here.
6439 * lread.c (read1): Use it as well to avoid extra allocation.
6441 2012-06-11 Chong Yidong <cyd@gnu.org>
6443 * image.c (imagemagick_load_image): Implement transparency.
6445 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6447 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6448 account for preceding backslashes. (Bug#11663)
6450 2012-06-09 Chong Yidong <cyd@gnu.org>
6452 * term.c: Support italics in capable terminals (Bug#9652).
6453 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6454 (turn_on_face): Output using TS_enter_italic_mode if available.
6455 Don't handle unused blinking and alt-charset cases.
6456 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6457 and tty_alt_charset_p cases.
6458 (tty_capable_p, init_tty): Support italics.
6460 * termchar.h (struct tty_display_info): Add field for italics.
6461 Remove unused blink field.
6463 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6466 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6467 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6468 tty_alt_charset_p. Add tty_italic_p.
6470 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
6472 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6473 dbus_type_is_basic if available.
6474 (xd_extract_signed, xd_extract_unsigned): Rename from
6475 extract_signed and extract_unsigned, respectively. Adapt callers.
6477 2012-06-09 Chong Yidong <cyd@gnu.org>
6479 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6481 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6484 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6486 * xdisp.c (vmessage): Treat frame message as multibyte.
6487 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6488 would generate the diagnostic "Making \302\247 buffer-local while
6491 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6493 * dispnew.c (showing_window_margins_p): Undo last change, which
6494 was done due to an inadvertent commit.
6495 (adjust_frame_glyphs_for_frame_redisplay): Do call
6496 showing_window_margins_p.
6498 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6500 * eval.c (Fmake_var_non_special): New primitive.
6501 (syms_of_eval): Defsubr it.
6502 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6504 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
6506 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6507 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6509 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6511 * alloc.c (allocate_vectorlike): Fix last change.
6513 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6515 Block-based vector allocation of small vectors.
6516 * lisp.h (struct vectorlike_header): New field `nbytes',
6517 adjust comment accordingly.
6518 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6519 to denote vector blocks. Adjust users (live_vector_p,
6520 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6521 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6522 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6523 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6524 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6525 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6526 (roundup_size): New constant.
6527 (struct vector_block): New data type.
6528 (vector_blocks, vector_free_lists, zero_vector): New variables.
6529 (all_vectors): Rename to `large_vectors'.
6530 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6531 (sweep_vectors): New functions.
6532 (allocate_vectorlike): Return `zero_vector' as the only vector of
6533 0 items. Allocate new vector from block if vector size is less than
6534 or equal to VBLOCK_BYTES_MAX.
6535 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6536 (init_alloc_once): Add call to init_vectors.
6538 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6540 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6542 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6544 * doprnt.c (doprnt): Truncate multibyte char correctly.
6545 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6546 would mishandle a string argument "Xc" if X was a multibyte
6547 character of length 2: it would truncate after X's first byte
6548 rather than including all of X.
6550 2012-06-06 Chong Yidong <cyd@gnu.org>
6552 * buffer.c (word_wrap): Doc fix.
6554 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6556 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6558 2012-06-03 Glenn Morris <rgm@gnu.org>
6560 * xdisp.c (tool-bar-style): Doc fix.
6562 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6564 * Makefile.in (PAXCTL): Define.
6565 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6566 binary via PaX flags if the paxctl utility is available.
6567 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6568 Restore PaX flags to their default. (Bug#11398)
6570 2012-06-03 Chong Yidong <cyd@gnu.org>
6572 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6575 2012-06-03 Chong Yidong <cyd@gnu.org>
6577 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6578 (note_mode_line_or_margin_highlight): If there is no help echo,
6579 use mode-line-default-help-echo. Handle the case where the mouse
6580 position is past the end of the mode line string.
6582 * buffer.c (buffer_local_value_1): New function, split from
6583 Fbuffer_local_value; can return Qunbound.
6584 (Fbuffer_local_value): Use it.
6585 (Vmode_line_format): Docstring tweaks.
6587 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6589 * sysdep.c (system_process_attributes): Improve comment.
6591 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6593 * keyboard.c: Export real-this-command to Elisp.
6594 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6595 and DEFVAR it. Update all users.
6597 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6599 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6601 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6602 Convert pctcpu and pctmem to Lisp float properly.
6603 Let the compiler fold better, as 100.0/0x8000 is exact.
6605 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6607 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6610 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6612 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6614 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6616 For a 'struct window', replace some Lisp_Object fields to
6617 bitfields where appropriate, remove unused fields.
6618 * window.h (struct window): Remove unused 'last_mark_x' and
6619 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6620 change it's type from Lisp_Object to bitfield.
6621 Change type of 'force_start', 'optional_new_start',
6622 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6623 fields from Lisp_Object to bitfield. Adjust users accordingly.
6625 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6627 Pacify gcc -Wdouble-precision when using Xaw.
6628 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6629 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6630 Use 'float' consistently, rather than 'float' in most places
6631 and 'double' in a couple of places.
6633 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6635 * xdisp.c (handle_stop): Detect whether we have overlay strings
6636 loaded by testing it->current.overlay_string_index to be
6637 non-negative, instead of checking whether n_overlay_strings is
6638 positive. (Bug#11587)
6640 2012-05-31 Chong Yidong <cyd@gnu.org>
6642 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6644 * doc.c (Fsubstitute_command_keys): Doc fix.
6646 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6648 * search.c (search_buffer): Remove calls to
6649 r_alloc_inhibit_buffer_relocation, as it is now called by
6650 maybe_unify_char, which was the cause of relocation of buffer text
6653 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6655 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6656 for the duration of call to load_charset, to avoid problems with
6657 callers of maybe_unify_char that access buffer text through C
6660 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6661 decrement the inhibition flag, instead of just setting or
6664 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6666 Remove obsolete '#define static' cruft.
6667 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6668 This #undef was "temporary" in 2000; it is no longer needed
6669 now that '#define static' has gone away.
6670 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6671 (gray_bitmap_bits): Remove; no longer needed.
6672 All uses replaced with definiens.
6673 * xterm.c: Include "bitmaps/gray.xbm".
6675 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6677 Clean up __executable_start, monstartup when --enable-profiling.
6678 The following changes affect the code only when profiling.
6679 * dispnew.c (__executable_start): Rename from safe_bcopy.
6680 Define only on platforms that need it.
6681 * emacs.c: Include <sys/gmon.h> when profiling.
6682 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6683 (__executable_start): Remove decl, since lisp.h does it now.
6684 (safe_bcopy): Remove decl; no longer has that name.
6685 (main): Coalesce #if into single bit of code, for simplicity.
6686 Cast pointers to uintptr_t, since standard libraries want integers
6688 * lisp.h (__executable_start): New decl.
6690 2012-05-31 Glenn Morris <rgm@gnu.org>
6692 * image.c (Fimagemagick_types): Doc fix.
6694 2012-05-30 Jim Meyering <meyering@redhat.com>
6696 * callproc.c (Fcall_process_region): Include directory component
6697 in mkstemp error message (Bug#11586).
6699 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6701 * alloc.c, lisp.h (make_pure_vector): Now static.
6703 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6705 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6706 Move to byte-run.el.
6707 (Fautoload): Do the hash-doc more carefully.
6708 * data.c (Fdefalias): Purify definition, except for keymaps.
6709 (Qdefun): Move from eval.c.
6710 * lisp.h (Qdefun): Remove.
6711 * lread.c (read1): Tiny simplification.
6713 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6715 Do not create empty overlays with the evaporate property (Bug#9642).
6716 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6717 Bug#9642, but explicitly check that the buffer the overlay would
6718 be moved to is live and rearrange lines to make sure that errors
6719 will not put the overlay in an inconsistent state.
6720 (Fdelete_overlay): Cosmetics.
6722 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6724 * w32term.c (my_bring_window_to_top): New function.
6725 (x_raise_frame): Use handle returned by DeferWindowPos, which
6726 could be different from the original one.
6727 Call my_bring_window_to_top instead of my_set_foreground_window.
6730 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6731 by calling BringWindowToTop.
6733 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6734 (WM_EMACS_END): Increase by one.
6736 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6738 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6739 This avoids undefined behavior that might cause the eassert
6740 to not catch an out-of-range value.
6742 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6744 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6745 Update dependencies.
6747 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6749 * bidi.c (bidi_mirror_char): Fix last change.
6751 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6753 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6754 when referring to sectname field in printf format.
6756 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6758 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6759 Only r_alloc_inhibit_buffer_relocation needed to be added;
6760 the others were already declared.
6762 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6763 before checking whether it's out of range. Put the check inside
6765 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6767 2012-05-27 Ken Brown <kbrown@cornell.edu>
6769 * callproc.c (Fcall_process): Restore a line that was accidentally
6770 commented out in the 2011-02-13 change (bug#11547).
6772 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6774 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6775 defined on ralloc.c.
6777 * buffer.c [REL_ALLOC]: Remove prototypes of
6778 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6779 they are now on lisp.h.
6781 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6783 * search.c (search_buffer): Use it to inhibit relocation of buffer
6784 text while re_search_2 is doing its job, because re_search_2 is
6785 passed C pointers to buffer text. (Bug#11519)
6787 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6790 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6791 state after an additional call to move_it_in_display_line_to, keep
6792 the values of it->max_ascent and it->max_descent found for the
6794 (pos_visible_p): Revert the comparison against bottom_y to what it
6795 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6798 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6800 Fix coding-related core dumps with gcc -ftrapv.
6801 The code was computing A - B, where A and B are pointers, and B is
6802 random garbage. This can lead to core dumps on platforms that
6803 have special pointer registers, and it also leads to core dumps on
6804 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6805 A - B only when B is initialized properly.
6806 * coding.c (coding_set_source, coding_set_destination): Return void.
6807 (coding_change_source, coding_change_destinations): New functions,
6808 with the old behaviors of coding_set_source and coding_set_destination.
6809 All callers that need an offset changed to use these new functions.
6811 2012-05-26 Glenn Morris <rgm@gnu.org>
6813 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6815 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6817 Extend mouse support on W32 text-mode console.
6818 * xdisp.c (draw_row_with_mouse_face):
6819 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6821 * w32console.c: Include window.h.
6822 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6824 (initialize_w32_display): Initialize mouse-highlight data.
6826 * w32inevt.c: Include termchar.h and window.h.
6827 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6828 moves, call note_mouse_highlight. If help_echo changed, call
6829 gen_help_event to produce help-echo message in the echo area.
6830 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6833 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6835 * lread.c (read1): Simplify slightly to avoid an overflow warning
6836 with GCC 4.7.0 on x86-64.
6838 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6840 * bidi.c (bidi_mirror_char): Revert last change: an int is
6841 definitely wide enough here.
6843 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6845 Fix integer width and related bugs (Bug#9874).
6846 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6847 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6848 (string_bytes, check_sblock, allocate_string_data):
6849 (compact_small_strings, Fmake_bool_vector, make_string)
6850 (make_unibyte_string, make_multibyte_string)
6851 (make_string_from_bytes, make_specified_string)
6852 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6853 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6856 (allocate_pseudovector):
6857 Use int, not EMACS_INT, where int is wide enough.
6858 (inhibit_garbage_collection, Fgarbage_collect):
6859 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6860 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6861 int might not be wide enough.
6862 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6863 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6864 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6865 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6866 (bidi_level_of_next_char, bidi_move_to_visually_next):
6867 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6868 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6869 (Fkill_buffer, Fset_buffer_major_mode)
6870 (advance_to_char_boundary, Fbuffer_swap_text)
6871 (Fset_buffer_multibyte, overlays_at, overlays_in)
6872 (overlay_touches_p, struct sortvec, record_overlay_string)
6873 (overlay_strings, recenter_overlay_lists)
6874 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6875 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6876 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6877 (Foverlay_recenter, last_overlay_modification_hooks_used)
6878 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6879 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6880 (validate_region): Omit unnecessary test for b <= e,
6881 since that's guaranteed by the previous test.
6882 (adjust_overlays_for_delete): Avoid pos + length overflow.
6883 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6884 (report_overlay_modification):
6885 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6886 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6887 Omit pointer cast, which isn't needed anyway, and doesn't work
6888 after the EMACS_INT -> ptrdiff_t change.
6889 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6890 * buffer.h: Adjust decls to match defn changes elsewhere.
6891 (struct buffer_text, struct buffer):
6892 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6893 Use EMACS_INT, not int, where int might not be wide enough.
6894 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6895 not int, to avoid needless 32-bit limit on 64-bit hosts.
6896 (exec_byte_code): Use tighter memory-full test, one that checks
6897 for alloca overflow. Don't compute the address of the object just
6898 before an array, as that's not portable. Use EMACS_INT, not
6899 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6900 * callint.c (Fcall_interactively):
6901 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6902 * callproc.c (call_process_kill, Fcall_process):
6903 Don't assume pid_t fits into an Emacs fixnum.
6904 (call_process_cleanup, Fcall_process, child_setup):
6905 Don't assume pid_t fits into int.
6906 (call_process_cleanup, Fcall_process, delete_temp_file)
6907 (Fcall_process_region):
6908 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6909 (Fcall_process): Simplify handling of volatile integers.
6910 Use int, not EMACS_INT, where int will do.
6911 * casefiddle.c (casify_object, casify_region, operate_on_word)
6912 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6913 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6914 (casify_object): Avoid integer overflow when overallocating buffer.
6915 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6916 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6917 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6918 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6919 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6920 integers are now checked earlier. All uses replaced with XINT.
6922 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6923 For CCL_MapSingle, check that content and value are in int range.
6924 (ccl_driver, Fregister_code_conversion_map):
6925 Check that Vcode_version_map_vector is a vector.
6926 (resolve_symbol_ccl_program): Check that vector header is in range.
6927 Always copy the vector, so that we can check its contents reliably
6928 now rather than having to recheck each instruction as it's being
6929 executed. Check that vector words fit in 'int'.
6930 (ccl_get_compiled_code, Fregister_ccl_program)
6931 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6932 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6933 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6934 contents are in range.
6935 (Fccl_execute_on_string): Check that status is in range.
6936 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6937 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6938 Accept and return EMACS_INT, not int, because callers can pass values
6940 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6941 (multibyte_chars_in_text, parse_str_as_multibyte)
6942 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6943 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6944 (string_escape_byte8, Fget_byte):
6945 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6946 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6947 avoid mishandling large integers.
6948 * character.h: Adjust decls to match defn changes elsewhere.
6949 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6950 (Ffind_charset_region):
6951 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6952 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6953 (load_charset_map_from_vector, Fdefine_charset_internal):
6954 Don't assume fixnum fits in int.
6955 (load_charset_map_from_vector, Fmap_charset_chars):
6956 Remove now-unnecessary CHECK_NATNUMs.
6957 (Fdefine_charset_internal): Check ranges here, more carefully.
6958 Don't rely on undefined behavior with signed left shift overflow.
6959 Don't assume unsigned int fits into fixnum, or that fixnum fits
6960 into unsigned int. Don't require max_code to be a valid fixnum;
6961 that's not true for gb10830 4-byte on a 32-bit host. Allow
6962 invalid_code to be a cons, for the same reason. Require code_offset
6963 to be a character. Avoid int overflow if max_char is close
6965 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6966 this is intended anyway and avoids some undefined behavior.
6967 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6968 INDEX_TO_CODE_POINT, as that's what it expects.
6969 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6970 * charset.h (DECODE_CHAR): Return int, not unsigned;
6971 this is what was intended anyway, and it avoids undefined behavior.
6972 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6973 integer-overflow issues.
6974 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6975 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6976 where the argument is EMACS_INT, and this behavior is not intended.
6977 * chartab.c (Fmake_char_table, Fset_char_table_range)
6978 (uniprop_get_decoder, uniprop_get_encoder):
6979 Don't assume fixnum fits in int.
6980 * cmds.c (move_point): New function, that does the gist of
6981 Fforward_char and Fbackward_char, but does so while checking
6982 for integer overflow more accurately.
6983 (Fforward_char, Fbackward_char): Use it.
6984 (Fforward_line, Fend_of_line, internal_self_insert)
6985 (internal_self_insert):
6986 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6987 Fix a FIXME, by checking for integer overflow when calculating
6988 target_clm and actual_clm.
6989 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6990 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6991 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6992 (coding_alloc_by_making_gap, alloc_destination)
6993 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6994 (encode_coding_utf_16, detect_coding_emacs_mule)
6995 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6996 (detect_coding_iso_2022, decode_coding_iso_2022)
6997 (encode_invocation_designation, encode_designation_at_bol)
6998 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6999 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7000 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7001 (encode_coding_ccl, encode_coding_raw_text)
7002 (detect_coding_charset, decode_coding_charset)
7003 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7004 (produce_composition, produce_charset, produce_annotation)
7005 (decode_coding, handle_composition_annotation)
7006 (handle_charset_annotation, consume_chars, decode_coding_gap)
7007 (decode_coding_object, encode_coding_object, detect_coding_system)
7008 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7009 (code_convert_region, code_convert_string)
7010 (Fdefine_coding_system_internal)
7011 (coding_set_source, coding_set_destination):
7012 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7013 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7014 (Fdefine_coding_system_internal):
7015 Don't assume fixnums fit in int.
7016 (decode_coding_gap, decode_coding_object, encode_coding_object)
7017 (Fread_coding_system, Fdetect_coding_region)
7018 (Funencodable_char_position, Fcheck_coding_systems_region)
7019 (get_translation, handle_composition_annotation, consume_chars):
7020 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7021 (consume_chars): Rewrite to not calculate an address outside buffer.
7022 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7023 Don't access memory outside of the args array.
7024 (Fdefine_coding_system_internal): Check for charset-id overflow.
7025 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7026 result of ENCODE_CHAR.
7027 * coding.h: Adjust decls to match defn changes elsewhere.
7028 (struct coding_system):
7029 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7030 * composite.c (get_composition_id, find_composition)
7031 (run_composition_function, update_compositions)
7032 (compose_text, composition_gstring_put_cache)
7033 (composition_gstring_p, composition_gstring_width)
7034 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7035 (composition_compute_stop_pos, composition_reseat_it)
7036 (composition_update_it, struct position_record)
7037 (find_automatic_composition, composition_adjust_point)
7038 (Fcomposition_get_gstring, Ffind_composition_internal):
7039 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7040 (update_compositions):
7041 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7042 * composite.h: Adjust decls to match defn changes elsewhere.
7043 (struct composition):
7044 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7045 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7046 Do not attempt to compute the address of the object just before a
7047 buffer; this is not portable.
7049 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7050 (Faset): Use int, not EMACS_INT, where int is wide enough.
7051 (Fstring_to_number): Don't assume fixnums fit in int.
7052 (Frem): Don't assume arg is nonnegative.
7053 * dbusbind.c (xd_append_arg): Check for integers out of range.
7054 (Fdbus_call_method): Don't overflow the timeout int.
7055 (extract_signed, extract_unsigned): New functions.
7056 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7057 (xd_get_connection_references): Return ptrdiff_t, not int.
7059 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7060 (xd_read_message_1):
7061 Use int, not unsigned, where the dbus API uses int.
7062 (Fdbus_message_internal): Don't overflow mtype.
7063 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7064 * dired.c (directory_files_internal, file_name_completion, scmp)
7065 (file_name_completion_stat):
7066 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7067 (file_name_completion): Don't overflow matchcount.
7068 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7069 * dispextern.h: Adjust decls to match defn changes elsewhere.
7070 (struct text_pos, struct glyph, struct bidi_saved_info)
7071 (struct bidi_string_data, struct bidi_it, struct composition_it)
7073 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7074 (struct display_pos, struct composition_it, struct it):
7075 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7076 * dispnew.c (increment_matrix_positions)
7077 (increment_row_positions, mode_line_string)
7078 (marginal_area_string):
7079 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7080 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7081 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7082 (duration_to_sec_usec): New function, to check for overflow better.
7083 (Fsleep_for, sit_for): Use it.
7084 * doc.c (get_doc_string, store_function_docstring):
7085 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7086 (get_doc_string, Fsnarf_documentation):
7087 Use int, not EMACS_INT, where int is wide enough.
7089 Use SAFE_ALLOCA, not alloca.
7090 Check for overflow when converting EMACS_INT to off_t.
7091 * doprnt.c (doprnt):
7092 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7093 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7094 Don't assume uid_t fits into fixnum.
7095 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7096 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7097 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7098 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7099 (general_insert_function)
7100 (Finsert_char, make_buffer_string, make_buffer_string_both)
7101 (update_buffer_properties, Fbuffer_substring)
7102 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7103 (Fsubst_char_in_region, check_translation)
7104 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7105 (transpose_markers, Ftranspose_regions):
7106 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7107 (clip_to_bounds): Move to lisp.h as an inline function).
7108 (Fconstrain_to_field): Don't assume integers are nonnegative.
7109 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7110 (Fsubst_char_in_region, Fsave_restriction):
7111 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7112 (Femacs_pid): Don't assume pid_t fits into fixnum.
7113 (lo_time): Use int, not EMACS_INT, when int suffices.
7114 (lisp_time_argument): Check for usec out of range.
7115 (Fencode_time): Don't assume fixnum fits in int.
7116 (Fuser_login_name, Fuser_full_name): Signal an error
7117 if a uid argument is out of range, rather than relying on
7119 (Fformat_time_string): Remove now-unnecessary check.
7120 lisp_time_argument checks for out-of-range usec now.
7121 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7122 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7123 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7124 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7125 (init_cmdargs, Fdump_emacs):
7126 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7127 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7128 the bottom (typically) 32 bits of the fixnum.
7129 * eval.c (specpdl_size, call_debugger):
7130 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7131 (when_entered_debugger, Fbacktrace_debug):
7132 Don't assume fixnum can fit in int.
7133 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7134 the object just before a buffer; this is not portable.
7135 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7136 (grow_specpdl, unbind_to):
7137 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7138 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7139 (grow_specpdl): Simplify allocation by using xpalloc.
7140 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7141 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7142 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7143 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7144 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7146 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7147 (Fcopy_file, non_regular_nbytes, read_non_regular)
7148 (Finsert_file_contents):
7149 Use int, not EMACS_INT, where int is wide enough.
7150 (READ_BUF_SIZE): Verify that it fits in int.
7151 (Finsert_file_contents): Check that counts are in proper range,
7152 rather than assuming fixnums fit into ptrdiff_t etc.
7153 Don't assume fixnums fit into int.
7154 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7155 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7156 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7157 (string_char_to_byte, string_byte_to_char)
7158 (string_make_multibyte, string_to_multibyte)
7159 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7160 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7161 (substring_both, Fdelete, internal_equal, Ffillarray)
7162 (Fclear_string, mapcar1)
7163 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7164 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7165 (larger_vector, make_hash_table, maybe_resize_hash_table)
7166 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7167 (Fmaphash, secure_hash):
7168 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7169 (concat): Check for string index and length overflow.
7170 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7172 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7173 (larger_vector): New API (vec, incr_min, size_max) replaces old
7174 one (vec, new_size, init). This catches size overflow.
7175 INIT was removed because it was always Qnil.
7176 All callers changed.
7177 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7178 the upper bound on a hash table index size.
7179 (make_hash_table, maybe_resize_hash_table): Use it.
7180 (secure_hash): Computer start_byte and end_byte only after
7181 they're known to be in ptrdiff_t range.
7182 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7183 (Ffont_get_glyphs, Ffont_at):
7184 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7185 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7186 (Flist_fonts, Fopen_font):
7187 Don't assume fixnum can fit in int.
7188 (check_gstring): Don't assume index can fit in int.
7189 (font_match_p): Check that fixnum is a character, not a nonnegative
7190 fixnum, since the later code needs to stuff it into an int.
7191 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7192 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7193 conversion overflow issues.
7194 (Fopen_font): Check for integer out of range.
7195 (Ffont_get_glyphs): Don't assume index can fit in int.
7196 * font.h: Adjust decls to match defn changes elsewhere.
7197 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7199 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7200 printmax_t, where ptrdiff_t is wide enough.
7201 (Finternal_char_font):
7202 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7203 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7204 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7205 (Fset_frame_position, x_set_frame_parameters)
7206 (x_set_line_spacing, x_set_border_width)
7207 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7208 Check that fixnums are in proper range for system types.
7209 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7211 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7212 Use SAFE_ALLOCA_LISP, not alloca.
7213 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7214 intptr_t is wide enough.
7215 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7216 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7217 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7218 Check for fixnum out of range.
7219 * ftfont.c (ftfont_list): Don't assume index fits in int.
7220 Check that fixnums are in proper range for system types.
7221 (ftfont_shape_by_flt):
7222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7223 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7224 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7225 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7226 Check that fixnums are in proper range for system types.
7227 * gnutls.h: Adjust decls to match defn changes elsewhere.
7228 * gtkutil.c (xg_dialog_run):
7229 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7230 (update_frame_tool_bar):
7231 Check that fixnums are in proper range for system types.
7232 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7233 (lookup_image): Check that fixnums are in range for system types.
7234 * indent.c (last_known_column, last_known_column_point):
7235 (current_column_bol_cache):
7236 (skip_invisible, current_column, check_display_width):
7237 (check_display_width, scan_for_column, current_column_1)
7238 (Findent_to, Fcurrent_indentation, position_indentation)
7239 (indented_beyond_p, Fmove_to_column, compute_motion):
7240 (Fcompute_motion, Fvertical_motion):
7241 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7242 (last_known_column_modified): Use EMACS_INT, not int.
7243 (check_display_width):
7245 Check that fixnums and floats are in proper range for system types.
7246 (compute_motion): Don't assume index or fixnum fits in int.
7247 (compute_motion, Fcompute_motion):
7248 Use int, not EMACS_INT, when it is wide enough.
7249 (vmotion): Omit local var start_hpos that is always 0; that way
7250 we don't need to worry about overflow in expressions involving it.
7251 * indent.h: Adjust decls to match defn changes elsewhere.
7253 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7254 Use int, not EMACS_INT, where int is wide enough.
7255 Remove unused members ovstring_chars_done and tab_offset;
7257 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7258 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7259 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7260 (make_gap, copy_text, insert, insert_and_inherit)
7261 (insert_before_markers, insert_before_markers_and_inherit)
7262 (insert_1, count_combining_before, count_combining_after)
7263 (insert_1_both, insert_from_string)
7264 (insert_from_string_before_markers, insert_from_string_1)
7265 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7266 (adjust_after_replace, adjust_after_insert, replace_range)
7267 (replace_range_2, del_range, del_range_1, del_range_byte)
7268 (del_range_both, del_range_2, modify_region)
7269 (prepare_to_modify_buffer, signal_before_change)
7270 (signal_after_change, Fcombine_after_change_execute):
7271 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7272 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7273 (balance_an_interval, split_interval_right, split_interval_left)
7274 (find_interval, next_interval, update_interval)
7275 (adjust_intervals_for_insertion, delete_node, delete_interval)
7276 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7277 (static_offset_intervals, offset_intervals)
7278 (merge_interval_right, merge_interval_left, make_new_interval)
7279 (graft_intervals_into_buffer, temp_set_point_both)
7280 (temp_set_point, set_point, adjust_for_invis_intang)
7281 (set_point_both, move_if_not_intangible, get_property_and_range)
7282 (get_local_map, copy_intervals, copy_intervals_to_string)
7283 (compare_string_intervals, set_intervals_multibyte_1):
7284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7285 * intervals.h: Adjust decls to match defn changes elsewhere.
7287 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7288 * keyboard.c (this_command_key_count, this_single_command_key_start)
7289 (before_command_key_count, before_command_echo_length, echo_now)
7290 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7291 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7292 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7293 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7294 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7295 (last_non_minibuf_size, last_point_position, echo_truncate)
7296 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7297 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7298 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7299 (stuff_buffered_input):
7300 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7301 (last_auto_save, command_loop_1, read_char):
7302 Use EMACS_INT, not int, to avoid integer overflow.
7303 (record_char): Avoid overflow in total_keys computation.
7304 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7305 * keyboard.h: Adjust decls to match defn changes elsewhere.
7306 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7307 (Fkey_description, Fdescribe_vector, Flookup_key):
7308 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7309 (click_position): New function, to check that positions are in range.
7310 (Fcurrent_active_maps):
7312 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7313 (Faccessible_keymaps, Fkey_description):
7314 (preferred_sequence_p):
7315 Don't assume fixnum can fit into int.
7316 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7317 Check for integer overflow in size calculations.
7318 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7319 avoid mishandling large integers.
7320 * lisp.h: Adjust decls to match defn changes elsewhere.
7321 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7322 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7323 (struct Lisp_Marker):
7324 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7325 (clip_to_bounds): Now an inline function, moved here from editfns.c.
7326 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7327 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7328 All callers changed.
7329 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7330 Assume the arg has valid form, since it always does.
7331 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7332 unsigned integer system type.
7333 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7334 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7336 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7337 (duration_to_sec_usec): New decl.
7338 * lread.c (read_from_string_index, read_from_string_index_byte)
7339 (read_from_string_limit, readchar, unreadchar, openp)
7340 (read_internal_start, read1, oblookup):
7341 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7342 (Fload, readevalloop, Feval_buffer, Feval_region):
7343 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7344 (openp): Check for out-of-range argument to 'access'.
7345 (read1): Use int, not EMACS_INT, where int is wide enough.
7346 Don't assume fixnum fits into int.
7347 Fix off-by-one error that can read outside a buffer.
7348 (read_filtered_event): Use duration_to_sec_usec
7349 to do proper overflow checking on durations.
7350 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7351 in size calculation.
7352 (Fexecute_kbd_macro):
7353 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7354 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7355 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7356 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7357 (set_marker_both, set_marker_restricted_both, marker_position)
7358 (marker_byte_position, Fbuffer_has_markers_at):
7359 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7360 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7361 * menu.c (ensure_menu_items): Rename from grow_menu_items.
7362 It now merely ensures that the menu is large enough, without
7363 necessarily growing it, as this avoids some integer overflow issues.
7364 All callers changed.
7365 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7366 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7367 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7368 Use SAFE_ALLOCA_LISP, not alloca.
7369 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7370 to EMACS_INT. Check that fixnums are in proper range for system types.
7371 * minibuf.c (minibuf_prompt_width, string_to_object)
7372 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7373 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7374 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7375 (get_minibuffer, read_minibuf_unwind):
7376 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7377 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7378 this simplifies overflow checking. All callers changed.
7379 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7381 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7382 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7383 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7384 Check that fixnums are in proper range for system types.
7385 (Fx_create_frame, Fx_show_tip):
7386 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7387 * nsfont.m (ns_findfonts, nsfont_list_family):
7388 Don't assume fixnum fits in long.
7389 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7390 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7391 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7393 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7394 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7395 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7396 (PRINTDECLARE, PRINTPREPARE):
7397 (strout, print_string):
7398 (print, print_preprocess, print_check_string_charset_prop)
7400 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7402 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7403 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7404 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7405 (printchar, strout): Use xpalloc to catch size calculation overflow.
7406 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7407 (print_error_message): Use SAFE_ALLOCA, not alloca.
7408 (print_object): Use int, not EMACS_INT, where int is wide enough.
7409 (print_depth, new_backquote_output, print_number_index):
7410 Use ptrdiff_t, not int, where int might not be wide enough.
7411 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7412 (Fset_process_window_size, Fformat_network_address)
7413 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7415 Check that fixnums are in proper range for system types.
7416 (Fsignal_process): Simplify by avoiding a goto.
7417 Check for process-ids out of pid_t range rather than relying on
7419 (process_tick, update_tick): Use EMACS_INT, not int.
7420 (Fformat_network_address, read_process_output, send_process)
7421 (Fprocess_send_region, status_notify):
7422 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7423 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7424 (wait_reading_process_output, read_process_output, exec_sentinel):
7425 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7426 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7427 (Faccept_process_output): Use duration_to_sec_usec to do proper
7428 overflow checking on durations.
7429 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7430 Don't assume pid_t fits in int.
7431 * process.h (struct Lisp_Process): Members tick and update_tick
7432 are now of type EMACS_INT, not int.
7433 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7434 configured --with-wide-int.
7435 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7436 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7437 * search.c (looking_at_1, string_match_1):
7438 (fast_string_match, fast_c_string_match_ignore_case)
7439 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7440 (scan_newline, find_before_next_newline, search_command)
7441 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7442 (set_search_regs, wordify):
7445 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7446 (string_match_1, search_buffer, set_search_regs):
7448 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7449 (wordify): Check for overflow in size calculation.
7450 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7451 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7452 Check that fixnums are in proper range for system types.
7453 * sound.c (struct sound_device)
7454 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7455 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7456 (Fplay_sound_internal):
7457 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7458 * syntax.c (struct lisp_parse_state, find_start_modiff)
7459 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7460 (Fparse_partial_sexp):
7461 Don't assume fixnums can fit in int.
7462 (struct lisp_parse_state, find_start_pos, find_start_value)
7463 (find_start_value_byte, find_start_begv)
7464 (update_syntax_table, char_quoted, dec_bytepos)
7465 (find_defun_start, prev_char_comend_first, back_comment):
7466 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7467 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7469 (Finternal_describe_syntax_value): Check that match_lisp is a
7470 character, not an integer, since the code stuffs it into int.
7471 (scan_words, scan_sexps_forward):
7472 Check that fixnums are in proper range for system types.
7474 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7475 (scan_sexps_forward):
7476 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7477 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7478 * syntax.h: Adjust decls to match defn changes elsewhere.
7479 (struct gl_state_s):
7480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7481 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7482 MOST_POSITIVE_FIXNUM.
7483 * sysdep.c (wait_for_termination_1, wait_for_termination)
7484 (interruptible_wait_for_termination, mkdir):
7485 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7486 (emacs_read, emacs_write):
7487 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7488 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7489 and double all fit in int.
7490 * term.c (set_tty_color_mode):
7491 Check that fixnums are in proper range for system types.
7492 * termhooks.h (struct input_event):
7493 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7494 * textprop.c (validate_interval_range, interval_of)
7495 (Fadd_text_properties, set_text_properties_1)
7496 (Fremove_text_properties, Fremove_list_of_text_properties)
7497 (Ftext_property_any, Ftext_property_not_all)
7498 (copy_text_properties, text_property_list, extend_property_ranges)
7499 (verify_interval_modification):
7500 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7501 (Fnext_single_char_property_change)
7502 (Fprevious_single_char_property_change):
7503 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7504 (copy_text_properties):
7505 Check for integer overflow in index calculation.
7506 * undo.c (last_boundary_position, record_point, record_insert)
7507 (record_delete, record_marker_adjustment, record_change)
7508 (record_property_change):
7509 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7510 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7511 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7512 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7513 (Fx_hide_tip, Fx_file_dialog):
7514 * w32menu.c (set_frame_menubar):
7515 Use ptrdiff_t, not int, for consistency with rest of code.
7516 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7517 (select_window, Fdelete_other_windows_internal)
7518 (window_scroll_pixel_based, window_scroll_line_based)
7519 (Frecenter, Fset_window_configuration):
7520 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7521 (Fset_window_hscroll, run_window_configuration_change_hook)
7522 (set_window_buffer, temp_output_buffer_show, scroll_command)
7523 (Fscroll_other_window, Frecenter):
7524 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7525 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7526 Don't assume fixnum fits in int.
7527 (Fset_window_scroll_bars):
7528 Check that fixnums are in proper range for system types.
7529 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7530 (string_pos, c_string_pos, number_of_chars, init_iterator)
7531 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7532 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7533 (compute_display_string_end, handle_face_prop)
7534 (face_before_or_after_it_pos, handle_invisible_prop)
7535 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7536 (display_prop_intangible_p, string_buffer_position_lim)
7537 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7538 (get_overlay_strings_1, get_overlay_strings)
7539 (iterate_out_of_display_property, forward_to_next_line_start)
7540 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7541 (get_next_display_element, set_iterator_to_next)
7542 (get_visually_first_element, compute_stop_pos_backwards)
7543 (handle_stop_backwards, next_element_from_buffer)
7544 (move_it_in_display_line_to, move_it_in_display_line)
7545 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7546 (add_to_log, message_dolog, message_log_check_duplicate)
7547 (message2, message2_nolog, message3, message3_nolog
7548 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7549 (current_message_1, truncate_echo_area, truncate_message_1)
7550 (set_message, set_message_1, store_mode_line_noprop)
7551 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7552 (text_outside_line_unchanged_p, check_point_in_composition)
7553 (reconsider_clip_changes)
7554 (redisplay_internal, set_cursor_from_row, try_scrolling)
7555 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7556 (redisplay_window, find_last_unchanged_at_beg_row)
7557 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7558 (trailing_whitespace_p, find_row_edges, display_line)
7559 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7560 (display_mode_element, store_mode_line_string)
7561 (pint2str, pint2hrstr, decode_mode_spec)
7562 (display_count_lines, display_string, draw_glyphs)
7563 (x_produce_glyphs, x_insert_glyphs)
7564 (rows_from_pos_range, mouse_face_from_buffer_pos)
7565 (fast_find_string_pos, mouse_face_from_string_pos)
7566 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7567 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7568 (safe_call, init_from_display_pos, handle_fontified_prop)
7569 (handle_single_display_spec, load_overlay_strings)
7570 (with_echo_area_buffer, setup_echo_area_for_printing)
7571 (display_echo_area, echo_area_display)
7572 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7573 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7574 (redisplay_window, dump_glyph_row, display_mode_line)
7575 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7576 (handle_display_spec, display_prop_string_p):
7577 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7578 (handle_single_display_spec, build_desired_tool_bar_string)
7579 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7580 (get_specified_cursor_type):
7581 Check that fixnums are in proper range for system types.
7582 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7583 (Flookup_image_map):
7584 Don't assume fixnums fit in int.
7585 (compare_overlay_entries):
7586 Avoid mishandling comparisons due to subtraction overflow.
7587 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7588 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7589 (handle_tool_bar_click):
7590 Use int, not unsigned, since we prefer signed and the signedness
7591 doesn't matter here.
7592 (get_next_display_element, next_element_from_display_vector):
7593 Use int, not EMACS_INT, when int is wide enough.
7594 (start_hourglass): Use duration_to_sec_usec to do proper
7595 overflow checking on durations.
7596 * xfaces.c (Fbitmap_spec_p):
7597 Check that fixnums are in proper range for system types.
7598 (compare_fonts_by_sort_order):
7599 Avoid mishandling comparisons due to subtraction overflow.
7600 (Fx_family_fonts, realize_basic_faces):
7601 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7603 Don't assume fixnum fits in int.
7604 Use SAFE_ALLOCA_LISP, not alloca.
7605 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7606 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7607 (face_at_buffer_position, face_for_overlay_string)
7608 (face_at_string_position):
7609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7610 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7611 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7613 Check that fixnums are in proper range for system types.
7614 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7615 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7616 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7617 (Fx_change_window_property): Don't assume fixnums fit in int.
7618 * xfont.c (xfont_chars_supported):
7619 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7620 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7621 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7622 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7623 * xml.c (parse_region):
7624 * xrdb.c (magic_file_p):
7625 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7626 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7627 (x_get_local_selection, x_reply_selection_request)
7628 (x_handle_selection_request, wait_for_property_change):
7629 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7630 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7631 short is wide enough.
7632 (x_send_client_event): Don't assume fixnum fits in int.
7633 * xterm.c (x_x_to_emacs_modifiers):
7634 Don't assume EMACS_INT overflows nicely into int.
7635 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7637 (handle_one_xevent): NATNUMP can eval its arg twice.
7638 (x_connection_closed):
7639 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7640 * xterm.h: Adjust decls to match defn changes elsewhere.
7641 (struct scroll_bar): Use struct vectorlike_header
7642 rather than rolling our own approximation.
7643 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7645 2012-05-25 Glenn Morris <rgm@gnu.org>
7647 * lisp.mk (lisp): Update for more files being compiled now.
7649 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7651 * lread.c: Remove `read_pure' which makes no difference.
7652 (read_pure): Remove var.
7653 (unreadpure): Remove function.
7654 (readevalloop): Don't call read_list with -1 flag.
7655 (read1, read_vector): Don't test read_pure any more.
7656 (read_list): Simplify.
7658 * fileio.c, character.h: Minor style tweaks.
7660 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7662 * window.h (clip_changed): Remove useless declaration.
7664 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7666 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7667 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7669 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7672 This directory predates autoconf and is no longer needed nowadays.
7673 Move its few remaining bits of functionality to where they're needed.
7674 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7675 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7676 * m/template.h: Remove.
7677 * Makefile.in (M_FILE): Remove. All uses removed.
7678 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7679 * lisp.h (USE_LSB_TAG):
7680 * mem-limits.h (EXCEEDS_LISP_PTR):
7681 Use VAL_MAX, not VALBITS, in #if.
7682 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7683 (EMACS_UINT): Define unconditionally now.
7684 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7685 (BITS_PER_EMACS_INT): New constants, replacing
7686 what used to be in config.h, but not useful in #if.
7687 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7688 define them any more.
7689 (VAL_MAX): New macro.
7691 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7692 BITS_PER_EMACS_INT, in #if.
7693 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7694 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7695 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7696 * s/ms-w32.h (DATA_START):
7697 Move here from removed file m/intel386.h.
7698 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7699 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7701 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7703 Assume C89 or later.
7704 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7705 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7707 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7708 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7709 * textprop.c, tparam.c (NULL): Remove.
7710 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7711 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7712 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7713 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7714 * xterm.c (input_signal_count): Assume volatile works.
7716 2012-05-21 Ken Brown <kbrown@cornell.edu>
7718 * xgselect.c (xg_select): Fix first argument in call to 'select'
7721 2012-05-20 Ken Brown <kbrown@cornell.edu>
7723 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7724 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7726 2012-05-19 Ken Brown <kbrown@cornell.edu>
7728 * xfns.c (x_in_use): Remove `static' qualifier.
7729 * xterm.h (x_in_use): Declare.
7730 * xgselect.c: Include xterm.h.
7731 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7732 and `display_arg' (bug#9754).
7734 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7736 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7738 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7739 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7741 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7743 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7745 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7746 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7748 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7749 reference to image_cache->refcount.
7750 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7752 2012-05-17 Juri Linkov <juri@jurta.org>
7754 * search.c (Fword_search_regexp, Fword_search_backward)
7755 (Fword_search_forward, Fword_search_backward_lax)
7756 (Fword_search_forward_lax): Move functions to isearch.el
7757 (bug#10145, bug#11381).
7759 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7761 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7763 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7765 * lread.c (init_obarray): Declare Qt and Qnil as special.
7767 2012-05-14 Glenn Morris <rgm@gnu.org>
7769 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7770 Put "libexec" before "bin", for the sake of init_callproc_1.
7772 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7774 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7776 * unexaix.c: Port to more-recent AIX compilers.
7777 (report_error, report_error_1, make_hdr, copy_sym)
7778 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7779 Make arguments const char *, not char *, to avoid violations of C
7780 standard and to fix some AIX warnings reported by Gilles Pion.
7782 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7784 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7785 already have overlays loaded.
7786 (handle_single_display_spec): Before returning without displaying
7787 fringe bitmap, synchronize the bidi iterator with the main display
7788 iterator, by calling iterate_out_of_display_property.
7789 (iterate_out_of_display_property): Detect buffer iteration by
7790 testing that it->string is a Lisp string.
7791 (get_next_display_element): When the current object is exhausted,
7792 and there's something on it->stack, call set_iterator_to_next to
7793 proceed with what's on the stack, instead of returning zero.
7794 (set_iterator_to_next): If called at the end of a Lisp string,
7795 proceed to consider_string_end without incrementing string
7796 position. Don't increment display vector index past the end of
7797 the display vector. (Bug#11417)
7798 (pos_visible_p): Don't report a position visible when move_it_to
7799 stopped at the last line of window, which happens to be scanned
7800 backwards by the bidi iteration. (Bug#11464)
7802 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7804 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7805 and right-margin display specs even if the spec is invalid or we
7806 are on a TTY, and thus unable to display on the fringes.
7807 That's because the text with the property will not be displayed anyway,
7808 so we need to signal to the caller that this is a "replacing"
7809 display spec. This fixes display when the spec is invalid or we
7812 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7814 * unexaix.c (make_hdr): Fix typo in prototype.
7815 This bug broke the build on AIX. Problem reported by Gilles Pion.
7817 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7819 * keyboard.c (kbd_buffer_get_event): Read special events also in
7820 batch mode. (Bug#11415)
7822 2012-05-12 Glenn Morris <rgm@gnu.org>
7824 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7826 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7828 * lisp.mk (lisp): Add newcomment.elc.
7830 2012-05-12 Glenn Morris <rgm@gnu.org>
7832 * Makefile.in (MKDIR_P): New, set by configure.
7833 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7835 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7837 Remove unused function hourglass_started.
7838 * dispextern.h (hourglass_started):
7839 * w32fns.c (hourglass_started):
7840 * xdisp.c (hourglass_started): Remove.
7842 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7844 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7845 Update dependencies.
7847 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7849 * xgselect.c (xg_select): Put maxfds+1 into a var.
7850 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7852 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7854 2012-05-10 Dave Abrahams <dave@boostpro.com>
7856 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7857 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7859 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7861 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7862 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7863 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7864 Initialize xd_registered_buses.
7866 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7868 Untag more efficiently if USE_LSB_TAG.
7869 This is based on a proposal by YAMAMOTO Mitsuharu in
7870 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7871 For an admittedly artificial (nth 8000 longlist) benchmark on
7872 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7873 Emacs's overall text size by 1%.
7874 * lisp.h (XUNTAG): New macro.
7875 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7876 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7877 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7878 * eval.c (Fautoload):
7879 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7880 * frame.h (XFRAME): Use XUNTAG.
7882 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7883 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7884 Remove unportable assumptions about print widths of types like
7886 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7887 intptr_t when converting between pointer and integer, to avoid GCC
7888 warnings about wrong width.
7890 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7892 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7893 stack for each reader_thread, instead of defaulting to 8MB
7894 determined by the linker. This avoids failures in creating
7895 subprocesses on Windows 7, see the discussion in this thread:
7896 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7898 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7900 Fix up display of the *Minibuf-0* buffer in the mini window.
7901 * keyboard.c (read_char): Don't clear the echo area if there's no
7903 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7904 contents of *Minibuf-0*) if there's no message displayed in its stead.
7906 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7908 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7911 2012-05-06 Chong Yidong <cyd@gnu.org>
7913 * lisp.mk (lisp): Update.
7915 2012-05-05 Jim Meyering <meyering@redhat.com>
7917 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7919 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7921 * data.c (PUT_ERROR): New macro.
7922 (syms_of_data): Use it. Add new error type `user-error'.
7923 * undo.c (user_error): New function.
7924 (Fprimitive_undo): Use it.
7925 * print.c (print_error_message): Adjust print style for `user-error'.
7926 * keyboard.c (user_error): New function.
7927 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7929 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7931 Do not limit current-time-string to years 1000..9999.
7932 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7933 (Fcurrent_time_string): Support any year that is supported by the
7934 underlying localtime representation. Don't use asctime, as it
7935 has undefined behavior for years outside the range -999..9999.
7937 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7939 Fix race conditions involving setenv, gmtime, localtime, asctime.
7940 Without this fix, interrupts could mess up code that uses these
7941 nonreentrant functions, since setting TZ invalidates existing
7942 tm_zone or tzname values, and since most of these functions return
7943 pointers to static storage.
7944 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7945 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7946 Grow the critical sections to include not just invoking
7947 localtime/gmtime, but also accessing these functions' results
7948 including their tm_zone values if any, and any related TZ setting.
7949 (format_time_string): Last arg is now struct tm *, not struct tm **,
7950 so that the struct tm is saved in the critical section.
7951 All callers changed. Simplify allocation of initial buffer, partly
7952 motivated by the fact that memory allocation needs to be outside
7953 the critical section.
7955 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7957 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7958 with RESET_INTERVAL.
7960 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7961 Remove duplicated buffer name initialization.
7963 2012-05-02 Jim Meyering <jim@meyering.net>
7965 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7967 * xfns.c (x_window): Use xstrdup (Bug#11375).
7969 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7971 * xdisp.c (pos_visible_p): If already at a newline from the
7972 display string before the 'while' loop, don't walk back the glyphs
7973 from it3.glyph_row. Solves assertion violation when the display
7974 string begins with a newline (egg.el). (Bug#11367)
7976 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7978 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7981 2012-05-01 Glenn Morris <rgm@gnu.org>
7983 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7984 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7985 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7986 All were removed before 23.1.
7988 * dispnew.c: Remove HAVE_LIBNCURSES test;
7989 it is always true on relevant platforms.
7991 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7992 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7994 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7996 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7998 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7999 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8002 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8004 Do not avoid creating empty evaporating overlays (Bug#9642).
8005 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8006 That is, do not delete an evaporating overlay if it becomes
8007 empty after its bounds are adjusted to fit within its buffer.
8008 This fix caused other problems, and I'm reverting it until we get
8009 to the bottom of them.
8011 2012-04-27 Chong Yidong <cyd@gnu.org>
8013 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8015 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8017 * xdisp.c (pos_visible_p): If the window start position is beyond
8018 ZV, start the display from buffer beginning. Prevents assertion
8019 violation in init_iterator when the minibuffer window is scrolled
8022 * window.c (window_scroll_pixel_based): Likewise.
8024 2012-04-27 Chong Yidong <cyd@gnu.org>
8026 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8028 2012-04-27 Glenn Morris <rgm@gnu.org>
8030 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8031 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8033 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8035 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8036 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
8038 2012-04-26 Eli Zaretskii <eliz@gnu.org>
8040 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8041 display element, check also the underlying string or buffer
8042 character. (Bug#11341)
8044 * w32menu.c: Include w32heap.h.
8045 (add_menu_item): If the call to AppendMenuW (via
8046 unicode_append_menu) fails, disable Unicode menus only if we are
8047 running on Windows 9X/Me.
8049 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8051 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8052 (xgetint): Add missing shift for LSB tags.
8054 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8056 * keyboard.c (read_char): Don't wipe echo area for select window
8057 events: These might get delayed via `mouse-autoselect-window'
8060 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8062 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8063 manipulation of :loaded-from data.
8065 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8067 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8068 now a cons (bug#11311).
8070 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8072 Do not create empty overlays with the evaporate property (Bug#9642).
8073 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8074 if it becomes empty after its bounds are adjusted to fit within
8075 its buffer. Without this fix, in a nonempty buffer (let ((o
8076 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8077 yields an empty overlay that has the evaporate property, which is
8078 not supposed to happen.
8080 Fix minor GTK3 problems found by static checking.
8081 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8082 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8083 (struct _EmacsFixedClass, emacs_fixed_get_type):
8084 Move decls here from emacsgtkfixed.h, since they needn't be public.
8085 (emacs_fixed_get_type): Now static.
8086 (emacs_fixed_class_init): Omit unused local.
8087 (emacs_fixed_child_type): Remove; unused.
8088 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8089 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8090 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8091 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8092 (EMACS_FIXED_GET_CLASS): Remove; unused.
8093 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8095 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8096 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8098 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8100 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8101 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8102 (__malloc_size_t, __malloc_ptrdiff_t):
8103 Remove. All uses removed, replaced by the definiens if needed,
8104 since we can assume C89 or better now.
8105 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8106 (protect_malloc_state, align, get_contiguous_space)
8107 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8108 (malloc_atfork_handler_child, malloc_enable_thread)
8109 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8110 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8111 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8112 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8113 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8114 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8115 Define using prototypes, not old style.
8116 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8117 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8118 (align): Don't assume that signed integer overflow wraps around.
8119 Omit unused local var.
8120 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8121 (_free_internal_nolock, memalign, mallochook, reallochook):
8122 Omit no-longer-needed casts.
8123 (valloc): Use getpagesize, not __getpagesize.
8124 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8125 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8127 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8129 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
8131 Move functions from C to Lisp. Make non-blocking method calls
8132 the default. Implement further D-Bus standard interfaces.
8134 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8135 (QCdbus_request_name_allow_replacement)
8136 (QCdbus_request_name_replace_existing)
8137 (QCdbus_request_name_do_not_queue)
8138 (QCdbus_request_name_reply_primary_owner)
8139 (QCdbus_request_name_reply_in_queue)
8140 (QCdbus_request_name_reply_exists)
8141 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8142 (QCdbus_registered_serial, QCdbus_registered_method)
8143 (QCdbus_registered_signal): New Lisp objects.
8144 (XD_DEBUG_MESSAGE): Use sizeof.
8145 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8146 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8147 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8148 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8149 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8150 (xd_signature, xd_append_arg): Allow float for integer types.
8151 (xd_get_connection_references): New function.
8152 (xd_get_connection_address): Rename from xd_initialize.
8153 Return cached address.
8154 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8155 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8157 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8158 Return number of refcounts.
8159 (Fdbus_get_unique_name): Make stronger parameter check.
8160 (Fdbus_message_internal): New defun.
8161 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8162 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8163 (Fdbus_send_signal, Fdbus_register_service)
8164 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8165 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8166 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8167 (Vdbus_compiled_version, Vdbus_runtime_version)
8168 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8169 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8170 (Vdbus_message_type_signal): New defvars.
8171 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8174 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8176 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8177 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8178 Do not assume ptrdiff_t is the same width as 'int'.
8180 * alloc.c: Handle unusual debugging option combinations.
8181 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8182 since the two debugging options are incompatible.
8183 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8185 (mem_init, mem_insert, mem_insert_fixup):
8186 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8187 (NEED_MEM_INSERT): Remove; no longer needed.
8189 2012-04-22 Leo Liu <sdl.web@gmail.com>
8191 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8193 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8195 * sysdep.c [__FreeBSD__]: Minor cleanups.
8196 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8197 Use Emacs indenting style more consistently. Avoid some casts.
8198 Use 'double' consistently rather than mixing 'float' and 'double'.
8200 2012-04-21 Eduard Wiebe <usenet@pusto.de>
8202 * sysdep.c (list_system_processes, system_process_attributes):
8203 Add implementation for FreeBSD (Bug#5243).
8205 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8207 * lisp.mk (lisp): Update.
8209 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8211 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8212 It is never used otherwise.
8214 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8216 * print.c (print_preprocess): Only check print_depth if print-circle
8218 (print_object): Check for cycles even when print-circle is nil and
8219 print-gensym is t, but only check print_depth if print-circle is nil.
8221 2012-04-20 Chong Yidong <cyd@gnu.org>
8223 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8224 set the status to "failed" and ensure that sentinel is run.
8226 2012-04-20 Glenn Morris <rgm@gnu.org>
8228 * process.c (Fset_process_inherit_coding_system_flag)
8229 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8230 (Fmake_network_process, Fmake_serial_process): Doc fix.
8232 2012-04-20 Eli Zaretskii <eliz@gnu.org>
8234 * xdisp.c (string_buffer_position_lim): Limit starting position to
8236 (set_cursor_from_row): If called for a mode-line or header-line
8237 row, return zero immediately.
8238 (try_cursor_movement): If inside continuation line, don't back up
8239 farther than the first row after the header line, if any.
8240 Don't consider the header-line row as "partially visible", even if
8241 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8243 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8245 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8248 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
8249 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
8251 configure: new option --enable-gcc-warnings (Bug#11207)
8252 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8253 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8254 (ALL_CFLAGS): Use new macros rather than old.
8255 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8256 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8257 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8258 -Wunused-result, -Wunused-variable. This should go away once
8259 the Emacs and Gnulib regex code is merged.
8260 (xmalloc, xrealloc): Now static.
8262 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8264 * dired.c (Fsystem_groups): Remove unused local.
8266 2012-04-17 Glenn Morris <rgm@gnu.org>
8268 * dired.c (Fsystem_users): Doc fix.
8270 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8272 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8273 (syms_of_dired): Add them.
8275 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8277 Fix minor alloc.c problems found by static checking.
8278 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8279 New extern decls, to avoid calling undeclared functions.
8280 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8281 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8282 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8283 (NEED_MEM_INSERT): New macro.
8284 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8285 Remove one incorrect comment and fix another.
8287 Fix minor ralloc.c problems found by static checking.
8288 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8289 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8290 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8291 (r_alloc_sbrk): Now static.
8293 Improve ralloc.c interface checking.
8294 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8295 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8296 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8297 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8298 [REL_ALLOC]: ... to here, to check interface.
8299 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8300 Remove decls. This fixes an "It stinks!".
8302 * alloc.c (which_symbols): Fix alignment issue / type clash.
8304 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8306 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8307 (struct Lisp_Misc_Any): Likewise.
8308 (struct Lisp_Free): Likewise.
8309 * alloc.c (union aligned_Lisp_Symbol): Define.
8310 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8311 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8312 (union aligned_Lisp_Misc): Define.
8313 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8314 aligned_Lisp_Misc instead of union Lisp_Misc.
8315 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8317 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8319 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8320 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8321 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8322 * s/netbsd.h, s/sol2-6.h:
8323 Remove definition of GC_MARK_STACK, since the default now works.
8324 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8325 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8326 no longer the default.
8327 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8329 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8331 * lread.c (lisp_file_lexically_bound_p):
8332 Fix hang at ";-*-\n" (bug#11238).
8334 2012-04-14 Eli Zaretskii <eliz@gnu.org>
8336 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8337 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8339 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8341 * nsterm.m (constrainFrameRect): Always constrain when there is only
8342 one screen (Bug#10962).
8344 2012-04-13 Ken Brown <kbrown@cornell.edu>
8346 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8348 2012-04-13 Reuben Thomas <rrt@sc3d.org>
8350 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8352 2012-04-11 Daniel Colascione <dancol@dancol.org>
8354 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8355 against is gone. It's better to use vfork now so that when Cygwin
8356 gains a new, working vfork, we use it automatically (bug#10398).
8358 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8360 * window.c (save_window_save): Obey window-point-insertion-type.
8362 2012-04-11 Glenn Morris <rgm@gnu.org>
8364 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8366 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8368 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8370 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
8372 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8373 (force_quit_count): New var.
8374 (handle_interrupt): Use it.
8376 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
8378 * w32.c (w32_delayed_load): Record the full path of the library
8379 being loaded (bug#10424).
8381 2012-04-09 Glenn Morris <rgm@gnu.org>
8383 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8384 not just in the obarray, before snarfing them. (Bug#11036)
8386 * Makefile.in ($(leimdir)/leim-list.el):
8387 Pass EMACS rather than BUILT_EMACS.
8389 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8391 * process.c (make_process):
8392 * process.h: Add integer `gnutls_handshakes_tried' member to
8395 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8396 Add convenience `GNUTLS_LOG2i' macro.
8398 * gnutls.c (gnutls_log_function2i): Convenience log function.
8399 (emacs_gnutls_read): Use new log functions,
8400 `gnutls_handshakes_tried' process member, and
8401 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8402 attempts per process (connection).
8404 2012-04-09 Chong Yidong <cyd@gnu.org>
8406 * eval.c (Fuser_variable_p, user_variable_p_eh)
8407 (lisp_indirect_variable): Functions deleted.
8408 (Fdefvar): Caller changed.
8410 * callint.c (Finteractive, Fcall_interactively):
8411 * minibuf.c (Fread_variable): Callers changed.
8413 2012-04-09 Eli Zaretskii <eliz@gnu.org>
8415 * xdisp.c (set_cursor_from_row): If the display string appears in
8416 the buffer at position that is closer to point than the position
8417 after the display string, display the cursor on the first glyph of
8418 the display string. Fixes cursor display when a 'display' text
8419 property immediately follows invisible text. (Bug#11094)
8421 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8423 composite.c: use 'double' consistently
8424 * composite.c (get_composition_id): Use 'double' consistently
8425 instead of converting 'float' to 'double' and vice versa; this is
8426 easier to understand and avoids a GCC warning.
8428 2012-04-09 Glenn Morris <rgm@gnu.org>
8430 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8431 preparation for dumping it with emacs. (Bug#4789)
8432 (leimdir): New variable.
8433 ($(leimdir)/leim-list.el): New rule.
8434 (emacs$(EXEEXT)): Depend on leim-list.el.
8436 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8437 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8438 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8440 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8442 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8445 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
8447 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8448 Remove unused local variable.
8450 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8452 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8453 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8454 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8455 objects, as mark_maybe_pointer will catch them otherwise.
8456 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8457 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8459 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8461 Fix typo that broke non-Windows builds.
8462 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8464 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8466 Support building on MS-Windows with libxml2.
8468 * makefile.w32-in (OBJ2): Add xml.$(O).
8469 (GLOBAL_SOURCES): Add xml.c.
8470 ($(BLD)/xml.$(O)): New dependency list.
8472 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8473 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8474 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8475 [!WINDOWSNT]: New macros.
8476 (init_libxml2_functions, libxml2_loaded_p): New functions.
8477 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8478 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8479 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8480 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8482 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8483 Call init_libxml2_functions before calling libxml2 functions.
8484 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8486 * emacs.c: Don't include libxml/parser.h.
8487 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8488 xmlCleanupParser directly.
8490 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8492 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8494 * indent.c (Fvertical_motion): If there is a display string at
8495 point, use it.vpos to compute how many lines to backtrack after
8496 move_it_to point. (Bug#11133)
8498 2012-04-06 Eli Zaretskii <eliz@gnu.org>
8500 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8501 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8502 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8503 macros related to unification of CJK characters. For the details,
8504 see the discussion following the message here:
8505 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8507 2012-04-04 Chong Yidong <cyd@gnu.org>
8509 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8511 2012-04-01 Eli Zaretskii <eliz@gnu.org>
8513 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8514 instead of alloca. (Bug#11138)
8516 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8518 * w32menu.c (is_simple_dialog): Properly check lisp types.
8521 2012-03-31 Eli Zaretskii <eliz@gnu.org>
8523 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8524 position we get to after a call to move_it_to fails the
8525 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8526 only if we wind up in a string from display property. (Bug#11063)
8528 * window.c (Fdelete_other_windows_internal): Invalidate the row
8529 and column information about mouse highlight, so that redisplay
8530 restores it after reallocating the glyph matrices. (Bug#7464)
8532 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8533 string comes from a `display' text property, use the buffer
8534 position of that property as if we actually saw that position in
8536 (move_it_by_lines): Remove the assertion that
8537 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8538 violated when there's a before-string at the beginning of a line.
8541 2012-03-30 Eli Zaretskii <eliz@gnu.org>
8543 * xdisp.c (append_space_for_newline): If the default face was
8544 remapped, use the remapped face for the appended newline.
8545 (extend_face_to_end_of_line): Use the remapped default face for
8546 extending the face to the end of the line.
8547 (display_line): Call extend_face_to_end_of_line when the default
8548 face was remapped. (Bug#11068)
8550 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8552 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8554 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8556 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8558 2012-03-27 Glenn Morris <rgm@gnu.org>
8560 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8563 2012-03-26 Kenichi Handa <handa@m17n.org>
8565 * dispextern.h (struct glyph): Fix previous change. Change the
8566 bit length of glyphless.ch to 25 (Bug#11082).
8568 2012-03-26 Chong Yidong <cyd@gnu.org>
8570 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8571 (command_loop_1): Use it; inhibit selection update for
8572 handle-select-window too (Bug#8996).
8574 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8576 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8578 2012-03-25 Kenichi Handa <handa@m17n.org>
8580 * dispextern.h (struct glyph): Change the bit length of
8581 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8583 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8585 * s/ms-w32.h (tzname): Include time.h before redirecting to
8586 _tzname. Fixes the MSVC build. (Bug#9960)
8588 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8590 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8593 * xterm.c (XTread_socket): Only modify handling_signal if
8594 !SYNC_INPUT. (Bug#11080)
8596 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8598 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8599 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8600 when fetching a multibyte character consumes more bytes than
8601 CHAR_BYTES returns, due to unification of CJK characters in
8602 string_char. (Bug#11073)
8604 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8606 * process.c (wait_reading_process_output): Handle pty disconnect
8607 by refraining from sending oneself a SIGCHLD (bug#10933).
8609 2012-03-22 Chong Yidong <cyd@gnu.org>
8611 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8613 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8614 Mark string as coming from a prefix property.
8615 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8616 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8618 2012-03-21 Chong Yidong <cyd@gnu.org>
8620 * xfaces.c (Vface_remapping_alist): Doc fix.
8622 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8624 * w32proc.c (Fw32_set_console_codepage)
8625 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8628 2012-03-20 Chong Yidong <cyd@gnu.org>
8630 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8631 to reflect default non-nil value of redisplay-dont-pause.
8633 2012-03-19 Kenichi Handa <handa@m17n.org>
8635 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8636 it fit in a valid range (Bug#11003).
8638 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8640 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8641 that is not from display property, accept the row as a "cursor
8642 row" if one of the string's character has a non-nil `cursor'
8643 property. Fixes cursor positioning when there are newlines in
8644 overlay strings, e.g. in icomplete.el. (Bug#11035)
8646 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8648 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8650 2012-03-12 Chong Yidong <cyd@gnu.org>
8652 * eval.c (inhibit_lisp_code): Rename from
8653 inhibit_window_configuration_change_hook; move from window.c.
8655 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8656 * window.c (run_window_configuration_change_hook)
8657 (syms_of_window): Callers changed.
8659 2012-03-11 Chong Yidong <cyd@gnu.org>
8661 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8663 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8665 2012-03-10 Chong Yidong <cyd@gnu.org>
8667 * frame.c (other_visible_frames): Don't assume the selected frame
8668 is visible (Bug#10955).
8670 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8672 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8674 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8676 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8677 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8680 2012-03-03 Glenn Morris <rgm@gnu.org>
8682 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8684 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8686 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8687 position past the first glyph_row that ends at ZV. (Bug#10902)
8688 (redisplay_window, next_element_from_string): Fix typos in
8690 (redisplay_window): Pass to move_it_vertically the margin in
8691 pixels, not in screen lines.
8693 2012-03-02 Glenn Morris <rgm@gnu.org>
8695 * buffer.c (buffer-list-update-hook): Doc fix.
8697 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8699 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8700 push_it before setting up the iterator for the first overlay
8701 string, even if we have an empty string loaded.
8702 (next_overlay_string): If there's an empty string on the iterator
8703 stack, pop the stack. (Bug#10903)
8705 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8707 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8708 Suggested by Stefan Monnier in
8709 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8710 * alloc.c (widen_to_Lisp_Object): New static function.
8711 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8712 and widening them to Lisp_Objects. This would work even if
8713 USE_LSB_TAG is defined and wide integers are used, which might
8714 happen in a future version of Emacs.
8716 2012-02-25 Chong Yidong <cyd@gnu.org>
8718 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8721 * xselect.c (Fx_selection_exists_p): Doc fix.
8722 (x_clipboard_manager_save_all): Print an informative message
8723 before saving to clipboard manager.
8725 2012-02-24 Chong Yidong <cyd@gnu.org>
8727 * keyboard.c (process_special_events): Handle all X selection
8728 requests in kbd_buffer, not just the next one (Bug#8869).
8730 2012-02-23 Chong Yidong <cyd@gnu.org>
8732 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8733 call when setting menu-bar-lines and tool-bar-lines parameters.
8734 (unwind_create_frame_1): New helper function.
8736 * window.c (inhibit_window_configuration_change_hook): New var.
8737 (run_window_configuration_change_hook): Obey it.
8738 (syms_of_window): Initialize it.
8740 2012-02-22 Chong Yidong <cyd@gnu.org>
8742 * xterm.c (x_draw_image_relief): Add missing type check for
8743 Vtool_bar_button_margin (Bug#10743).
8745 2012-02-21 Chong Yidong <cyd@gnu.org>
8747 * fileio.c (Vfile_name_handler_alist): Doc fix.
8749 * buffer.c (Fget_file_buffer): Protect against invalid file
8750 handler return value.
8752 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8754 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8755 when computing $valmask.
8757 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8758 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8759 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8760 It's useless in that case, and it can cause problems on hosts
8761 that allocate halves of EMACS_INT values separately.
8762 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8763 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8764 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8765 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8766 it avoids undefined behavior on hosts where shifting right by more
8767 than the word width has undefined behavior.
8769 2012-02-19 Chong Yidong <cyd@gnu.org>
8771 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8772 (Funhandled_file_name_directory, Ffile_name_as_directory)
8773 (Fdirectory_file_name, Fexpand_file_name)
8774 (Fsubstitute_in_file_name): Protect against invalid file handler
8775 return values (Bug#10845).
8777 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8779 * .gdbinit (pitx): Fix incorrect references to fields of the
8782 2012-02-17 Chong Yidong <cyd@gnu.org>
8784 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8786 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8788 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8789 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8791 2012-02-15 Chong Yidong <cyd@gnu.org>
8793 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8794 marked as special. Also, starting docstrings with * is obsolete.
8796 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8798 * gnutls.c (emacs_gnutls_write): Fix last change.
8800 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8802 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8805 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8807 * keymap.c (Fsingle_key_description): Handle char ranges.
8809 2012-02-12 Chong Yidong <cyd@gnu.org>
8811 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8812 as that creates a dangerous corner case.
8814 * window.c (Fdelete_window_internal): Invalidate the mouse
8815 highlight (Bug#9904).
8817 2012-02-12 Glenn Morris <rgm@gnu.org>
8819 * xselect.c (Fx_own_selection_internal)
8820 (Fx_get_selection_internal, Fx_disown_selection_internal)
8821 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8822 * nsselect.m (Fx_own_selection_internal)
8823 (Fx_disown_selection_internal, Fx_selection_exists_p)
8824 (Fx_selection_owner_p, Fx_get_selection_internal):
8825 Sync docs and argument specs with the xselect.c versions.
8827 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8829 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8831 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8833 * w32select.c (Fx_selection_exists_p): Sync doc string and
8834 argument list with xselect.c. (Bug#10783)
8836 * w16select.c (Fx_selection_exists_p): Sync doc string and
8837 argument list with xselect.c. (Bug#10783)
8839 2012-02-10 Glenn Morris <rgm@gnu.org>
8841 * fns.c (Fsecure_hash): Doc fix.
8843 2012-02-09 Kenichi Handa <handa@m17n.org>
8845 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8847 2012-02-07 Chong Yidong <cyd@gnu.org>
8849 * buffer.c (Fbuffer_local_variables)
8850 (buffer_lisp_local_variables): Handle unbound vars correctly;
8851 don't let Qunbound leak into Lisp.
8853 2012-02-07 Glenn Morris <rgm@gnu.org>
8855 * image.c (Fimagemagick_types): Doc fix.
8857 * image.c (imagemagick-render-type): Change it from a lisp object
8858 to an integer. Move the doc here from the lisp manual.
8859 Treat all values not equal to 0 the same.
8861 2012-02-06 Chong Yidong <cyd@gnu.org>
8863 * doc.c (store_function_docstring): Avoid applying docstring of
8864 alias to base function (Bug#2603).
8866 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8868 * .gdbinit (pp1, pv1): Remove redundant defines.
8871 2012-02-04 Chong Yidong <cyd@gnu.org>
8873 * nsterm.m: Declare a global (Bug#10694).
8875 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8877 * w32.c (get_emacs_configuration_options):
8878 Include --enable-checking, if specified, in the return value.
8880 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8882 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8883 after rounding frame sizes. (Bug#9723)
8885 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8887 * keyboard.c (adjust_point_for_property): Don't position point
8888 before BEGV. (Bug#10696)
8890 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8892 Handle overflow when computing char display width (Bug#9496).
8893 * character.c (char_width): Return EMACS_INT, not int.
8894 (char_width, c_string_width): Check for overflow when
8895 computing the width; this is possible now that individual
8896 characters can have unbounded width. Problem introduced
8897 by merge from Emacs 23 on 2012-01-19.
8899 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8901 * dbusbind.c (Fdbus_register_method): Mention the return value
8902 :ignore in the docstring.
8904 2012-02-02 Glenn Morris <rgm@gnu.org>
8906 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8908 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8909 Unconditionally set to t. (Bug#10673)
8910 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8911 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8912 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8914 2012-02-02 Kenichi Handa <handa@m17n.org>
8916 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8917 0, do not call append_composite_glyph.
8919 2012-02-02 Kenichi Handa <handa@m17n.org>
8921 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8923 (x_produce_glyphs): If the component of a composition is a null
8924 string, set it->pixel_width to 1 to avoid zero-width glyph.
8926 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8928 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8929 first 2 arguments are identical. This makes inserting large
8930 output from a subprocess an order of magnitude faster on
8931 MS-Windows, where all sbrk'ed memory is always contiguous.
8933 2012-01-31 Glenn Morris <rgm@gnu.org>
8935 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8936 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8937 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8939 2012-01-29 Glenn Morris <rgm@gnu.org>
8941 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8943 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8945 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8947 2012-01-28 Chong Yidong <cyd@gnu.org>
8949 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8951 2012-01-26 Chong Yidong <cyd@gnu.org>
8953 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8955 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8956 repeat counts (Bug#10507).
8958 2012-01-26 Glenn Morris <rgm@gnu.org>
8960 * lread.c (syms_of_lread): Doc fix.
8962 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8964 * coding.c (encode_designation_at_bol): Change return value to
8967 2012-01-25 Chong Yidong <cyd@gnu.org>
8969 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8971 2012-01-21 Chong Yidong <cyd@gnu.org>
8973 * floatfns.c (Fcopysign): Make the second argument non-optional,
8974 since nil is not allowed anyway.
8976 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8978 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8979 (send_process): Likewise.
8981 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8983 * window.c (save_window_save, Fcurrent_window_configuration)
8984 (Vwindow_persistent_parameters): Do not use Qstate.
8985 Rewrite doc-strings.
8987 2012-01-19 Kenichi Handa <handa@m17n.org>
8989 * character.c (char_width): New function.
8990 (Fchar_width, c_string_width, lisp_string_width):
8991 Use char_width (Bug#9496).
8993 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8995 * window.c (Vwindow_persistent_parameters): New variable.
8996 (Fset_window_configuration, save_window_save): Handle persistent
8999 2012-01-14 Eli Zaretskii <eliz@gnu.org>
9001 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9002 thrashing the stack of the thread. (Bug#9087)
9004 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9006 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9008 2012-01-11 Eli Zaretskii <eliz@gnu.org>
9010 * xdisp.c (rows_from_pos_range): Handle the case where the
9011 highlight ends on a newline. (Bug#10464)
9012 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9013 he end column for display of highlight that ends on a newline
9016 2012-01-11 Glenn Morris <rgm@gnu.org>
9018 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9019 from load-path also when installation-directory is nil. (Bug#10208)
9021 2012-01-10 Glenn Morris <rgm@gnu.org>
9023 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9025 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9026 Update template values to be closer to their typical values these days.
9028 2012-01-09 Eli Zaretskii <eliz@gnu.org>
9030 * xdisp.c (rows_from_pos_range): Accept additional argument
9031 DISP_STRING, and accept any glyph in a row whose object is that
9032 string as eligible for mouse highlight. Fixes mouse highlight of
9033 display strings from overlays. (Bug#10464)
9035 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
9037 emacs: fix an auto-save permissions race condition (Bug#10400)
9038 * fileio.c (auto_saving_dir_umask): New static var.
9039 (Fmake_directory_internal): Use it.
9040 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9041 creating the directory. The old code temporarily assigns
9042 too-generous permissions to the directory.
9043 (do_auto_save_eh): Clear it.
9044 (Fdo_auto_save): Catch all errors, not just file errors, so
9045 that the var is always cleared.
9047 2012-01-07 Eli Zaretskii <eliz@gnu.org>
9049 * search.c (scan_buffer): Pass character positions to
9050 know_region_cache, not byte positions. (Bug#6540)
9052 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
9054 * w32.c (sys_rename): Report EXDEV when rename of a directory
9055 fails because the target is on another logical disk. (Bug#10284)
9057 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9059 * xterm.c (x_embed_request_focus): New function.
9061 * xterm.h: Add prototype.
9063 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9065 2012-01-05 Glenn Morris <rgm@gnu.org>
9067 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9069 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9071 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9072 Load gnutls_transport_set_lowat only if GnuTLS version is below
9074 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9075 GnuTLS versions below 2.11.1.
9077 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9079 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9080 to the doc string advising against its use for altering the way
9081 windows are scrolled.
9083 2011-12-28 Kenichi Handa <handa@m17n.org>
9085 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9086 coding-system ASCII compatible only when it does not produce BOM
9087 on encoding (Bug#10383).
9089 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9091 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9093 (create_and_show_popup_menu): Always use menu_position_func for
9096 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9098 * callint.c (Fcall_interactively): Don't truncate prompt string.
9100 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9102 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9103 property that ends at ZV, so that the bidi iteration could be
9104 resumed from there (after widening). (Bug#10360)
9106 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9108 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9110 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9112 * nsterm.m (x_free_frame_resources):
9113 Release f->output_data.ns->miniimage.
9114 (ns_index_color): Fix indentation. Do not retain
9115 color_table->colors[i].
9117 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9120 * nsfns.m (x_set_background_color): Assign return value from
9121 ns_index_color to face-background instead of NSColor*.
9122 (ns_implicitly_set_icon_type): Fix indentation.
9123 Change assignment in for loop to comparison.
9125 * emacs.c (ns_pool): New variable.
9126 (main): Assign ns_pool.
9127 (Fkill_emacs): Call ns_release_autorelease_pool.
9129 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9130 autorelease fdesc, release fdAttrs and tdict.
9131 (ns_get_covering_families): Release charset.
9132 (ns_findfonts): Release NSFontDescriptor created with new.
9133 (ns_uni_to_glyphs): Fix indentation.
9134 (setString): Release attrStr before assigning new value.
9136 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9138 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9140 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9141 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9143 2011-12-18 David Reitter <reitter@cmu.edu>
9145 * nsterm.m (ns_term_init): Subscribe for notifications
9146 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9147 to method trackingNotification in EmacsMenu.
9149 * nsmenu.m (trackingMenu): New variable.
9150 (trackingNotification): New method (from Aquamacs).
9151 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9152 from Aquamacs (Bug#7030).
9154 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9156 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9157 (symbol_to_nsstring): Fix indentation.
9158 (ns_symbol_to_pb): New function.
9159 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9160 (Fns_rotate_cut_buffers_internal): Remove.
9161 (Fns_store_selection_internal): Rename from
9162 Fns_store_cut_buffer_internal.
9163 (ns_get_foreign_selection, Fx_own_selection_internal)
9164 (Fx_disown_selection_internal, Fx_selection_exists_p)
9165 (Fns_get_selection_internal, Fns_store_selection_internal):
9166 Use ns_symbol_to_pb and check if return value is nil.
9167 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9168 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9169 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9170 renamed to Sns_store_selection_internal.
9171 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9172 and remove this function.
9173 (ns_handle_selection_clear): Remove, never used.
9174 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9177 2011-12-17 Ken Brown <kbrown@cornell.edu>
9179 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9180 GID is unknown (Bug#10257).
9182 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9184 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9185 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9186 which caused a build failure on GNU/Linux IA-64. This problem was
9187 introduced by my 2011-10-07 patch.
9189 2011-12-15 Juri Linkov <juri@jurta.org>
9191 * image.c (imagemagick_error): New function. (Bug#10112)
9192 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9193 Use `imagemagick_error' where ImageMagick functions return
9195 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9198 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9200 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9201 fill background (Bug#8992).
9203 2011-12-13 Martin Rudalics <rudalics@gmx.at>
9205 * window.c (Vwindow_combination_resize)
9206 (Vwindow_combination_limit): Use t instead of non-nil in
9208 (Vrecenter_redisplay): Add first sentence of doc-string on
9210 (Frecenter): Fix doc-string typo.
9212 2011-12-11 Kenichi Handa <handa@m17n.org>
9214 * coding.c (Funencodable_char_position): Pay attention to the
9215 buffer text relocation (Bug#9389).
9217 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9219 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9220 gtk_init (Bug#10100).
9222 2011-12-10 Eli Zaretskii <eliz@gnu.org>
9224 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9225 IT->string is nil. (Bug#10263)
9227 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9229 * nsterm.h (x_free_frame_resources): Declare.
9231 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9232 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9234 * nsterm.h (ns_get_defaults_value): Declare.
9236 * nsterm.m (ns_default): Call ns_get_defaults_value.
9238 2011-12-09 Eli Zaretskii <eliz@gnu.org>
9240 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9243 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9245 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9246 that where the value of an _OBJC_* symbol points to is in the .bss
9247 section (Bug#10240).
9249 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9251 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9252 after the loop to call ccl_driver at least once (Bug#8619).
9254 2011-12-08 Kenichi Handa <handa@m17n.org>
9256 * ftfont.c (get_adstyle_property): Fix previous change
9259 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
9261 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9262 dirs from the default value of EMACSLOADPATH (bug#10208).
9264 2011-12-07 Glenn Morris <rgm@gnu.org>
9266 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9267 installation and source directories as well. (Bug#10208)
9269 2011-12-06 Chong Yidong <cyd@gnu.org>
9271 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9273 2011-12-06 Glenn Morris <rgm@gnu.org>
9275 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9276 as an error, not just -1. (Bug#10217)
9278 2011-12-05 Chong Yidong <cyd@gnu.org>
9280 * keyboard.c (process_special_events): New function.
9281 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9283 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9285 * coding.c (encode_designation_at_bol): Don't use uninitialized
9286 local variable (Bug#9318).
9288 2011-12-05 Kenichi Handa <handa@m17n.org>
9290 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9291 return Qnil (Bug#8046, Bug#10193).
9293 2011-12-05 Kenichi Handa <handa@m17n.org>
9295 * coding.c (encode_designation_at_bol): New args charbuf_end and
9296 dst. Return the number of produced bytes. Callers changed.
9297 (coding_set_source): Return how many bytes coding->source was
9299 (coding_set_destination): Return how many bytes
9300 coding->destination was relocated.
9301 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9302 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9304 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9306 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9307 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9310 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9312 The following changes are to fix Bug#9318.
9314 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9315 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9316 (encode_coding_iso_2022, encode_coding_sjis)
9317 (encode_coding_big5, encode_coding_charset): Use the above macros.
9319 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
9321 * lisp.h (process_quit_flag): Fix external declaration.
9323 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9325 Don't macro-inline non-performance-critical code.
9326 * eval.c (process_quit_flag): New function.
9327 * lisp.h (QUIT): Use it.
9329 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9331 * nsfns.m (get_geometry_from_preferences): New function.
9332 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9334 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9336 * emacs.c (Qkill_emacs): Define.
9337 (syms_of_emacs): Initialize it.
9338 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9339 Qquit_flag to `kill-emacs' instead.
9340 (quit_throw_to_read_char): Add parameter `from_signal'.
9341 All callers changed. Call Fkill_emacs if requested and safe.
9342 * lisp.h (QUIT): Call Fkill_emacs if requested.
9344 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9346 * widget.c (update_wm_hints): Return if wmshell is null.
9347 (widget_update_wm_size_hints): New function.
9349 * widget.h (widget_update_wm_size_hints): Declare.
9351 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9352 widget_update_wm_size_hints (Bug#10104).
9354 2011-12-03 Eli Zaretskii <eliz@gnu.org>
9356 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9357 before a newline, prepare the bidi iterator for consuming the
9358 newline, and keep the current paragraph direction. (Bug#10183)
9359 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9361 2011-12-02 Juri Linkov <juri@jurta.org>
9363 * search.c (Fword_search_regexp): New Lisp function created from
9364 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9365 (Fword_search_backward, Fword_search_forward)
9366 (Fword_search_backward_lax, Fword_search_forward_lax):
9367 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9368 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9370 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9372 * fileio.c (Finsert_file_contents): Move after-change-function call
9373 to before the "handled:" label, since all "goto handled" appear in
9374 cases where the *-change-functions have already been properly called
9377 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9379 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9380 waiting for input. (Bug#10169)
9382 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9384 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9385 verifies glyph row's hash code--we have just reallocated the
9386 glyphs, so their contents can be complete garbage. (Bug#10164)
9388 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
9390 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9392 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9394 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9395 attributes are tested _before_ calling verify_row_hash, to protect
9396 against GCC re-ordering of the tests. (Bug#10164)
9398 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9400 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9402 * xterm.c (handle_one_xevent): Only set async_visible and friends
9403 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9404 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9405 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9407 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9409 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9410 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9411 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9412 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9413 All uses changed to use GCPRO1 etc.
9414 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9415 Revert to old implementation (i.e., before 2011-03-11).
9417 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9419 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9420 of scroll runs so as to avoid assigning disabled bogus rows and
9421 unnecessary graphics copy operations.
9423 2011-11-27 Eli Zaretskii <eliz@gnu.org>
9425 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9426 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9427 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9428 (malloc, free, realloc, calloc): Redirect to e_* only when
9431 * lisp.h (GCTYPEBITS): Move before first use.
9432 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9433 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9434 this macro definition.
9436 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9439 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9441 * gtkutil.c (xg_create_frame_widgets):
9442 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9443 present with Gtk+ 2.0.
9445 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9447 * fileio.c (Finsert_file_contents): Undo previous change; see
9448 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9450 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9452 Rename locals to avoid shadowing.
9453 * fileio.c (Finsert_file_contents):
9454 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9455 * process.c (wait_reading_process_output):
9456 Rename inner 'proc' to 'p' to avoid shadowing.
9457 Indent for consistency with usual Emacs style.
9459 2011-11-25 Eli Zaretskii <eliz@gnu.org>
9461 * xdisp.c (redisplay_window): If cursor row is not fully visible
9462 after recentering, and scroll-conservatively is set to a large
9463 number, scroll window by a few more lines to make the cursor fully
9464 visible and out of scroll-margin. (Bug#10105)
9465 (start_display): Don't move to the next line if the display should
9466 start at a newline that is part of a display vector or an overlay
9469 2011-11-24 Juri Linkov <juri@jurta.org>
9471 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9472 after the `MagickPingImage' call. (Bug#10112)
9474 2011-11-23 Chong Yidong <cyd@gnu.org>
9476 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9478 2011-11-23 Martin Rudalics <rudalics@gmx.at>
9480 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9481 making another buffer current. (Bug#10114)
9483 2011-11-23 Glenn Morris <rgm@gnu.org>
9485 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9487 2011-11-23 Chong Yidong <cyd@gnu.org>
9489 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9490 using it (Bug#5984).
9492 2011-11-22 Eli Zaretskii <eliz@gnu.org>
9494 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9495 and header-lines, as they don't have one computed for them.
9498 * .gdbinit (prow): Make displayed values more self-explaining.
9499 Add row's hash code.
9501 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9503 * process.c (wait_reading_process_output): Fix asynchrounous
9504 GnuTLS socket handling on some versions of the GnuTLS library.
9505 (wait_reading_process_output): Add comment and URL.
9507 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9509 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9511 2011-11-21 Chong Yidong <cyd@gnu.org>
9513 * window.c (Fnext_window, Fprevious_window): Doc fix.
9515 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9517 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9519 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9521 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9523 2011-11-20 Martin Rudalics <rudalics@gmx.at>
9525 * window.c (Fset_window_combination_limit): Rename argument
9527 (Vwindow_combination_limit): Remove "status" from doc-string.
9529 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9531 * m/ibms390.h: Remove.
9532 * m/ibms390x.h: Don't include "ibms390.h".
9534 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9536 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9537 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9539 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9541 * casetab.c (Fset_case_table):
9542 * charset.c (Fcharset_after): Fix typos.
9544 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9546 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9547 Otherwise, valgrind does not work on some platforms.
9548 Problem reported by Andreas Schwab in
9549 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9550 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9551 is set, removing the need for VIRT_ADDRESS_VARIES.
9552 (PURE_P): Use a more-efficient implementation that needs just one
9553 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9554 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9555 to 4 (xorl, subq, cmpq, setbe).
9556 * alloc.c (pure): Always extern now, since that's the
9557 VIRT_ADDR_VARIES behavior.
9558 (PURE_POINTER_P): Use a single comparison, not two, for
9559 consistency with the new puresize.h.
9560 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9561 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9562 Remove VIRT_ADDR_VARIES no longer needed.
9564 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9566 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9567 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9568 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9569 behave as if the cursor position were at the window margin.
9571 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9572 and the cursor position is out of bounds, behave as if the cursor
9573 position were at the window margin. (Bug#10075)
9575 2011-11-18 Chong Yidong <cyd@gnu.org>
9577 * window.c (Fwindow_combination_limit): Make first argument
9578 non-optional, since it is meaningless for live windows like the
9581 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9583 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9585 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9587 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9588 (graft_intervals_into_buffer): Simplify.
9590 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9592 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9593 hash values of the two rows.
9594 (copy_row_except_pointers): Preserve the used[] arrays and the
9595 hash values of the two rows. (Bug#10035)
9596 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9598 * xdisp.c (row_hash): New function, body extracted from
9599 compute_line_metrics.
9600 (compute_line_metrics): Call row_hash, instead of computing the
9603 * dispnew.c (verify_row_hash): Call row_hash for computing the
9604 hash code of a row, instead of duplicating code from xdisp.c.
9606 * dispextern.h (row_hash): Add prototype.
9608 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9610 * frame.c (delete_frame): Don't delete the terminal when the last
9611 X frame is closed if emacs is built with GTK toolkit.
9613 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9615 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9617 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9619 * window.c (Vwindow_splits): Rename to
9620 Vwindow_combination_resize. Suggested by Juri Linkov.
9621 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9624 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9626 * nsfns.m (Fns_font_name):
9627 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9629 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9631 * window.h (window): Rename slot "nest" to "combination_limit".
9632 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9633 (Fset_window_nest): Rename to Fset_window_combination_limit.
9634 (Vwindow_nest): Rename to Vwindow_combination_limit.
9635 (recombine_windows, make_parent_window, make_window)
9636 (Fsplit_window_internal, saved_window)
9637 (Fset_window_configuration, save_window_save): Rename all
9638 occurrences of window_nest to window_combination_limit.
9640 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9642 * image.c (imagemagick_load_image): Fix typo.
9644 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9646 * xdisp.c (display_line): Move the call to
9647 highlight_trailing_whitespace before the call to
9648 compute_line_metrics, since the latter needs to see the final
9649 faces of all the glyphs to compute ROW's hash value.
9650 Fixes assertion violations in row_equal_p. (Bug#10035)
9652 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9654 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9655 just return (bug#10044).
9657 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9659 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9660 with user-defined heap size. Bump the default size of the temacs
9661 heap to 27MB, to avoid memory warning when running temacs.
9662 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9664 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9665 current_matrix and desired_matrix. (Bug#9990)
9666 (verify_row_hash) [XASSERTS]: New function.
9667 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9668 that the hash value of glyph rows is correct.
9670 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9672 * window.h (window): Remove splits slot.
9673 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9674 (Fdelete_other_windows_internal, make_parent_window)
9675 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9676 (Fset_window_configuration, save_window_save): Don't deal with
9677 split status of windows.
9678 (saved_window): Remove splits slot.
9679 (Vwindow_splits): Rewrite doc-string.
9681 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9683 * xfns.c (unwind_create_frame):
9684 * nsfns.m (unwind_create_frame):
9685 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9686 Vframe_list (Bug#9999).
9688 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9690 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9692 2011-11-11 Kenichi Handa <handa@m17n.org>
9694 * callproc.c (Fcall_process): Set the member dst_multibyte of
9697 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9699 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9700 avoid a crash (bug#9496).
9702 2011-11-09 Chong Yidong <cyd@gnu.org>
9704 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9705 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9707 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9709 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9711 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9713 Avoid some portability problems by eschewing 'extern inline' functions.
9714 The trivial performance wins aren't worth the portability hassles; see
9715 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9717 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9718 (window_box_width, window_box_left, window_box_left_offset)
9719 (window_box_right, window_box_right_offset): Undo previous change,
9720 by removing the "extern"s.
9721 * intervals.c (adjust_intervals_for_insertion)
9722 (adjust_intervals_for_deletion): Undo previous change,
9723 making these static again.
9724 (offset_intervals, temp_set_point_both, temp_set_point)
9725 (copy_intervals_to_string): No longer inline.
9726 * xdisp.c (window_text_bottom_y, window_box_width)
9727 (window_box_height, window_box_left_offset)
9728 (window_box_right_offset, window_box_left, window_box_right)
9729 (window_box): No longer inline.
9731 2011-11-08 Chong Yidong <cyd@gnu.org>
9733 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9734 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9735 Signal an error if not a live window.
9736 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9737 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9739 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9741 * lisp.h (syms_of_abbrev): Remove declaration.
9742 Reported by CHENG Gao <chenggao@royau.me>.
9744 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9746 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9747 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9748 of temacs in GUI mode.
9750 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9752 * window.h: Declare delete_all_child_windows instead of
9753 delete_all_subwindows.
9754 * window.c (Fwindow_nest, Fset_window_nest)
9755 (Fset_window_new_total, Fset_window_new_normal)
9756 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9757 (delete_all_subwindows): Rename to delete_all_child_windows.
9758 (Fdelete_other_windows_internal, Fset_window_configuration):
9759 Call delete_all_child_windows instead of delete_all_subwindows.
9760 * frame.c (delete_frame): Call delete_all_child_windows instead
9761 of delete_all_subwindows.
9763 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9765 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9766 This is also needed for porting to any host where GC_MARK_STACK is
9767 not GC_MAKE_GCPROS_NOOPS.
9768 (which_symbols): Use it.
9770 2011-11-07 Kenichi Handa <handa@m17n.org>
9772 * coding.c (coding_set_destination): Check coding->src_pos only
9773 when coding->src_object is a buffer (bug#9910).
9775 * process.c (send_process): Set the member src_multibyte of coding
9776 to 0 (bug#9911) when sending a unibyte text.
9778 * callproc.c (Fcall_process): Set the member src_multibyte of
9779 process_coding to 0 (bug#9912).
9781 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9783 * xmenu.c (cleanup_widget_value_tree): New function.
9784 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9785 calling free_menubar_widget_value_tree directly (Bug#9830).
9787 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9789 Fix some portability problems with 'inline'.
9790 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9791 (window_box_width, window_box_left, window_box_left_offset)
9792 (window_box_right, window_box_right_offset): Declare extern.
9793 Otherwise, these inline functions do not conform to C99 and
9794 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9795 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9796 * intervals.c (adjust_intervals_for_insertion)
9797 (adjust_intervals_for_deletion): Now extern, because otherwise the
9798 extern inline functions 'offset_intervals' couldn't refer to it.
9799 (static_offset_intervals): Remove.
9800 (offset_intervals): Rewrite using the old contents of
9801 static_offset_intervals. The old version didn't conform to C99
9802 because an extern inline function contained a reference to an
9803 identifier with static linkage.
9805 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9807 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9810 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9812 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9813 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9814 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9815 return Qleft_to_right.
9817 2011-11-06 Chong Yidong <cyd@gnu.org>
9819 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9820 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9821 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9822 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9823 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9824 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9825 (Fwindow_vscroll): Doc fix.
9826 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9827 argument, since it makes no sense to pass a live window and for
9828 consistency with window-child.
9830 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9832 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9835 2011-11-05 Jason Rumney <jasonr@gnu.org>
9837 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9838 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9840 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9841 bitwise arithmetic preventing use of unicode-sip and non-truetype
9844 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9846 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9849 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9850 initialization code to keep similarity to xfns.c after changes
9853 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9855 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9856 (unwind_create_frame): New function (Bug#9943).
9857 (Fx_create_frame): Restructure code to be more similar to the one in
9858 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9859 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9860 Move terminal->reference_count++ just before making the frame official
9863 * nsterm.m (x_free_frame_resources): New function.
9864 (x_destroy_window): Move code to x_free_frame_resources.
9866 * xfns.c (unwind_create_frame): Fix comment.
9867 (Fx_create_frame, x_create_tip_frame):
9868 Move terminal->reference_count++ just before making the frame
9869 official. Move initialization of image_cache_refcount and
9870 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9872 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9874 Support MSVC build with newer versions of Visual Studio.
9875 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9876 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9879 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9880 which are not supported by MSVC.
9881 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9882 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9884 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9886 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9888 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9890 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9892 Support MSVC build with newer versions of Visual Studio.
9893 * w32.c: Don't include w32api.h for MSVC.
9894 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9896 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9897 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9898 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9899 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9901 (alloca) [_MSC_VER]: Define to _alloca.
9903 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9905 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9907 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9909 * xdisp.c (note_mouse_highlight): If either of
9910 previous/next-single-property-change returns nil, treat that as
9911 the beginning or the end of the buffer. (Bug#9955)
9913 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9915 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9916 label is not null (Bug#9951).
9917 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9920 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9922 * window.c (Fwindow_body_size): Mention in the doc string that the
9923 return value is in frame's canonical units. (Bug#9949)
9925 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9927 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9929 * w32fns.c (unwind_create_frame): If needed, free the glyph
9930 matrices of the partially constructed frame. (Bug#9943)
9931 * xfns.c (unwind_create_frame): Likewise.
9933 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9935 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9936 Don't stop backward scan on the continuation glyph, even though
9937 its CHARPOS is positive.
9938 (mouse_face_from_buffer_pos, note_mouse_highlight):
9939 Rename cover_string to disp_string.
9941 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9943 * window.c (temp_output_buffer_show): Don't use
9944 Vtemp_buffer_show_specifiers.
9945 (Vtemp_buffer_show_specifiers): Remove unused variable.
9947 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9949 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9950 past the beginning of the current glyph matrix.
9952 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9954 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9955 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9956 HAVE_GTK3 (Bug#9869).
9958 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9959 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9961 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9963 * xterm.c: Declare x_handle_net_wm_state to return int.
9964 (handle_one_xevent): Check if we are iconified but don't have
9965 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9966 (get_current_wm_state): Return non-zero if not hidden,
9967 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9968 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9969 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9970 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9972 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9974 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9975 so that this new function doesn't get optimized away by a
9976 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9978 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9980 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9982 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9984 Fix the `xbytecode' command.
9985 * .gdbinit (xprintbytestr): New command.
9986 (xwhichsymbols): Rename from `which'; all callers changed.
9987 (xbytecode): Print the byte-code string as well.
9989 2011-10-29 Kim Storm <storm@cua.dk>
9991 * alloc.c (which_symbols): New function.
9993 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9995 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9998 2011-10-29 Glenn Morris <rgm@gnu.org>
10000 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10001 Not clear what it was for, and it causes various bugs. (Bug#9839)
10003 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10005 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10006 possible random value that matches one of those tested as
10007 condition to clear the mouse face.
10009 2011-10-28 Chong Yidong <cyd@gnu.org>
10011 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10013 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10015 * window.c (make_window): Initialize phys_cursor_on_p.
10017 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10019 * lisp.h (struct Lisp_Symbol): Update comments.
10021 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
10023 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10025 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10027 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10028 <oslsachem@gmail.com> for helping to debug this.
10030 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10031 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10032 (g_b_init_get_glyph_outline_w): New static variables.
10033 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10034 (GetGlyphOutlineW_Proc): New typedefs.
10035 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10036 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10038 (w32font_open_internal, compute_metrics):
10039 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10040 instead of calling the "wide" APIs directly.
10042 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10044 * w32.h (syms_of_w32font): Add prototype.
10046 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10048 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10049 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10050 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10051 (Fmove_to_window_line): Doc fix.
10053 2011-10-27 Chong Yidong <cyd@gnu.org>
10055 * process.c (make_process): Set gnutls_state to NULL.
10057 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10058 non-NULL, regardless of GNUTLS_INITSTAGE.
10059 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10060 an error. Set process slots as soon as we allocate them.
10062 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10064 2011-10-27 Chong Yidong <cyd@gnu.org>
10066 * gnutls.c (emacs_gnutls_deinit): New function.
10067 Deallocate credentials structures as well as calling gnutls_deinit.
10068 (Fgnutls_deinit, Fgnutls_boot): Use it.
10070 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10071 (deactivate_process): Call emacs_gnutls_deinit.
10073 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10075 * image.c (x_create_x_image_and_pixmap):
10076 * w32.c (sys_rename, w32_delayed_load):
10077 * w32font.c (fill_in_logfont):
10078 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10080 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10082 * w32fns.c (w32_default_color_map): New function,
10083 extracted from Fw32_default_color_map.
10084 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10086 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10088 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10090 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10092 * keyboard.c (test_undefined): New function (bug#9751).
10093 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10095 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10097 * sysdep.c (init_sys_modes): Fix the check for the controlling
10098 terminal (Bug#6649).
10100 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10102 * dispextern.h (struct bidi_it): New member next_en_type.
10104 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10105 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10106 current character, check also for next_en_type being WEAK_EN.
10107 (bidi_resolve_weak): Don't enter the expensive loop if the current
10108 position is before next_en_pos. Record the bidi type of the first
10109 non-ET, non-BN character we find, in addition to its position.
10110 (bidi_level_of_next_char): Invalidate next_en_type when
10111 next_en_pos is over-stepped.
10113 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10115 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10116 * editfns.c: Rewrite current-time-zone so that it invokes
10117 the equivalent of (format-time-string "%Z") to get the time zone name.
10118 This fixes a bug when the time zone name contains characters that
10119 need converting from the system time locale to Emacs internal format.
10120 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10121 that patch fixed format-time-string to do the conversion, but
10122 I forgot to fix current-time-zone.
10123 (format_time_string): New function, containing most of
10124 what Fformat_time_string used to contain.
10125 (Fformat_time_string): Rewrite in terms of format_time_string.
10126 This doesn't change this function's behavior.
10127 (current-time-zone): Rewrite to use format_time_string.
10128 This fixes the bug reported by Michael Schierl in
10129 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10130 Jason Rumney's 2007-06-07 change worked around this bug, but
10132 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10134 2011-10-19 Eli Zaretskii <eliz@gnu.org>
10136 * xdisp.c (start_display): If the character at POS is displayed
10137 via a display vector, reset IT->current.dpvec_index to zero.
10138 (try_window_reusing_current_matrix): If a line ends in a display
10139 vector or the next line starts in a display vector, continue
10140 redrawing the window even though the character position of
10141 start_row was reached.
10144 2011-10-18 Chong Yidong <cyd@gnu.org>
10146 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10147 with nobreak-char-display too.
10149 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10151 Fix part 3 of bug#9771.
10152 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10153 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10154 non-neutral characters if the current character is a paragraph
10155 separator (a.k.a. Newline). This avoids running the same
10156 expensive loop twice, once when we consume the preceding newline
10157 and the other time when the line actually needs to be displayed.
10158 Avoid the loop when we see neutrals on the base embedding level
10159 following a character whose directionality is the same as the
10160 paragraph's. This avoids running the expensive loop when a line
10161 ends in a long sequence of neutrals, like control characters.
10162 Add assertion against STRONG_AL type. Slightly rearrange code
10163 that determines the type of a neutral given the first non-neutral
10165 (bidi_level_of_next_char): Set next_en_pos to zero when
10166 invalidating its info.
10168 2011-10-17 Eli Zaretskii <eliz@gnu.org>
10170 * xdisp.c (push_display_prop): Determine whether to record string
10171 or buffer position by IT->string, not by IT->method. Allow
10172 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10173 (move_it_vertically_backward): Don't look for character position
10174 immediately after the newline when in a continuation line.
10177 2011-10-15 Martin Rudalics <rudalics@gmx.at>
10179 * window.c (coordinates_in_window): Rewrite and delabelize
10180 vertical border check. (Bug#5357) (Bug#9618)
10182 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10184 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10185 errors in XSetWindowBorder (bug#9310).
10187 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10189 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10190 avoid crash when xmalloc overrun checking is enabled.
10192 2011-10-13 Eli Zaretskii <eliz@gnu.org>
10194 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10195 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10196 cursor motion with <left> and <right> arrow keys.
10198 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10199 some callers set that themselves.
10201 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10203 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10204 display string and the previous row comes from the same string and
10205 is empty. (Bug#9739) (Bug#9738)
10207 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10209 * doc.c (get_doc_string): Encode file name (bug#9735).
10211 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10213 * bidi.c (bidi_level_of_next_char):
10214 * xdisp.c (get_visually_first_element): Remove old incorrect
10215 comments regarding the Unicode Line Separator character.
10217 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10219 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10221 * alloc.c (Fgc_status): Do not access beyond zombies array
10222 boundary if nzombies > MAX_ZOMBIES.
10223 * alloc.c (dump_zombies): Add missing format specifier.
10225 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10227 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10228 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10230 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10231 Some packages use them to denote characters with modifiers.
10233 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10235 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10236 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10237 matching a pp-number. Rename parameter var to var1.
10239 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10241 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10243 2011-10-08 Glenn Morris <rgm@gnu.org>
10245 * callint.c (Fcall_interactively): Give a more explicit error for the
10246 'c' case with a non-character input. (Bug#8479)
10248 2011-10-08 Eli Zaretskii <eliz@gnu.org>
10250 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10252 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10253 lines that are hscrolled on the left.
10255 * dispnew.c (buffer_posn_from_coords): Account for a possible
10256 presence of header-line. (Bug#4426)
10258 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10260 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10261 Don't advertise functionality which we discourage or doesn't work.
10263 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10265 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10266 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10267 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10268 this makes Emacs dump core during garbage collection on rare
10269 occasions. sizeof is obviously inferior to offsetof here, so
10270 stick with offsetof.
10271 (GC_POINTER_ALIGNMENT): New macro.
10272 (mark_memory): Omit 3rd (offset) arg; caller changed.
10273 Don't assume EMACS_INT alignment is the same as pointer alignment.
10275 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10277 * keyboard.c (read_key_sequence_remapped): New var.
10278 (read_key_sequence): Compute remapping in the right buffer.
10279 (command_loop_1): Use read_key_sequence's remapping directly.
10281 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10283 * dired.c (file_name_completion): Don't expand file name.
10284 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10285 before checking file name handler.
10287 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10288 they've been requested explicitly (bug#9591).
10290 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
10292 * keymap.c (Fsingle_key_description): Use make_specified_string
10293 instead of build_string to build string from push_key_description.
10296 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10298 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10299 This fixes a Y2038 bug on 64-bit hosts.
10300 * buffer.c (reset_buffer):
10301 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10302 (Fclear_buffer_auto_save_failure):
10303 Use 0, not -1, to represent an unset failure time, since time_t
10304 might not be signed.
10306 Remove dependency on glibc malloc internals.
10307 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10308 Move back here from lisp.h, but with their new implementations.
10309 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10310 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10311 * charset.c (charset_table_init): New static var.
10312 (syms_of_charset): Use it instead of xmalloc. This removes a
10313 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10314 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10315 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10316 Move back to alloc.c.
10317 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10318 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10320 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10322 * nsterm.m (windowDidResize): Call x_set_window_size only when
10323 ns_in_resize is true. Otherwise set pixelwidth/height and
10324 call change_frame_size (Bug#9628).
10326 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10328 Port --enable-checking=all to Fedora 14 x86-64.
10329 * charset.c (syms_of_charset): Also account for glibc malloc's
10330 internal overhead when calculating the initial malloc maximum.
10332 Port --enable-checking=all to Fedora 14 x86.
10333 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10335 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10336 (overrun_check_realloc, overrun_check_free):
10337 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10338 That way, xmalloc returns a properly-aligned pointer even if
10339 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10340 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10341 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10342 into account when calculating the initial malloc maximum.
10343 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10344 Move here from alloc.c, so that charset.c can use it too.
10345 Properly align; the old code wasn't right for common 32-bit hosts
10346 when configured with --enable-checking=all.
10347 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10348 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10350 2011-09-29 Eli Zaretskii <eliz@gnu.org>
10352 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10355 2011-09-28 Eli Zaretskii <eliz@gnu.org>
10357 * xdisp.c (compute_display_string_end): If there's no display
10358 string at CHARPOS, return -1.
10360 * bidi.c (bidi_fetch_char): When compute_display_string_end
10361 returns a negative value, treat the character as a normal
10362 character not covered by a display string. (Bug#9624)
10364 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
10366 * lread.c (Fread_from_string): Fix typo in docstring.
10368 2011-09-27 Eli Zaretskii <eliz@gnu.org>
10370 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10371 newline, reseat the iterator instead of bidi-iterating there one
10372 character at a time. (Bug#9610)
10373 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10374 TO_CHARPOS if the bidi iterator is at base embedding level.
10376 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10378 * lread.c (readevalloop): Use correct code for NBSP.
10379 (read1): Likewise. (Bug#9608)
10381 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
10383 * dbusbind.c (Fdbus_register_signal): When service is not
10384 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10386 2011-09-25 Glenn Morris <rgm@gnu.org>
10388 * buffer.c (truncate-lines): Doc fix.
10390 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
10392 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10393 (Fset_window_next_buffers): Doc fix.
10395 2011-09-24 Glenn Morris <rgm@gnu.org>
10397 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10399 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10401 Fix minor problems found by static checking.
10402 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10403 * indent.c (Fvertical_motion): Fix == vs = typo.
10405 2011-09-24 Eli Zaretskii <eliz@gnu.org>
10407 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10408 Default value is now t. Doc fix.
10410 * indent.c (Fvertical_motion): Compute and apply the overshoot
10411 logic when moving up, not only when moving down. Fix the
10412 confusing name and values of the it_overshoot_expected variable;
10413 logic changes accordingly. (Bug#9254) (Bug#9549)
10415 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10416 CHARPOS is covered by a display string which includes newlines.
10417 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10418 is covered by a display string with embedded newlines.
10420 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
10422 * dbusbind.c (Fdbus_register_signal): Add match rule to
10423 Vdbus_registered_objects_table. (Bug#9581)
10424 (Fdbus_register_method, Vdbus_registered_objects_table):
10427 2011-09-24 Jim Meyering <meyering@redhat.com>
10429 do not ignore write error for any output size
10430 The previous change was incomplete.
10431 While it makes emacs --batch detect the vast majority of stdout
10432 write failures, errors were still ignored whenever the output size is
10433 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10434 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10435 && echo FAIL: ignored write error
10436 FAIL: ignored write error
10437 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10438 && echo FAIL: ignored write error
10439 FAIL: ignored write error
10440 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10442 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10444 * emacs.c (Fkill_emacs): In noninteractive mode exit
10445 non-successfully if a write error occurred on stdout. (Bug#9574)
10447 2011-09-21 Eli Zaretskii <eliz@gnu.org>
10449 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10452 * dispextern.h (struct it): Update the comment documenting what
10455 2011-09-20 Eli Zaretskii <eliz@gnu.org>
10457 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10458 a display string, extend search for cursor position to end of row.
10459 (find_row_edges): If the row ends in a newline from a display
10460 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10461 Handle the case of a display string with multiple newlines.
10462 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10463 non-empty line. Fixes confusing cursor motion with arrow keys at
10464 the beginning of a line that starts with whitespace.
10466 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10468 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10471 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
10473 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10474 boolean (Bug#9154).
10476 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10478 * xdisp.c (display_line): Record maximum and minimum buffer
10479 positions even if no glyphs were produced (e.g., by a zero-width
10480 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10481 buffer positions that will be removed from the glyph row because
10483 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10484 column is beyond frame width: don't subtract 1 "pixel" when
10485 computing width of the stretch.
10486 (reseat_at_next_visible_line_start): Undo the change made on
10487 2011-09-17 that saved paragraph information and restored it after
10488 the call to `reseat'. (Bug#9545)
10490 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10492 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10493 and turn window cursor on if cleared (Bug#9415).
10495 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10497 * search.c (boyer_moore): Take unibyte characters from pattern
10498 literally. (Bug#9458)
10500 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10502 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10504 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10506 Fix minor problem found by static checking.
10507 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10508 initialized, to pacify gcc -Wuninitialized.
10510 * fileio.c: Report proper errno when syscall falls.
10511 (Finsert_file_contents): Save and restore errno,
10512 so that report_file_error outputs the correct diagnostic.
10513 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10515 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10517 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10519 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10521 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10522 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10524 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10526 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10527 about the current paragraph and restore it after the call to reseat.
10529 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10530 (bidi_find_paragraph_start): Search back for paragraph beginning
10531 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10532 (bidi_move_to_visually_next): Only trigger paragraph-related
10533 computations when the last character is a newline or at EOB, not
10534 just any NEUTRAL_B. (Bug#9470)
10536 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10537 truncated lines if point is covered by a display string. (Bug#9524)
10539 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10541 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10542 (cons_to_x_long): New function.
10543 (lisp_data_to_selection_data): Use it. Correct the test for
10544 short-versus-long data; it was negated. Break out of vector
10545 loop, for efficiency, when a long datum is discovered.
10547 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10549 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10551 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10553 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10554 GCC PR/17406) by declaring this function with external scope.
10556 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10558 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10559 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10561 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10563 * editfns.c (Fformat): Correctly handle text properties on "%%".
10565 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10567 * xterm.c (x_draw_composite_glyph_string_foreground):
10568 * w32term.c (x_draw_composite_glyph_string_foreground):
10569 * term.c (encode_terminal_code):
10570 * composite.c (composition_update_it, get_composition_id):
10571 * xdisp.c (get_next_display_element)
10572 (fill_composite_glyph_string): Add comments about special meaning
10573 of TAB characters in a composition.
10575 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10577 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10578 This occurs when processing a multibyte format.
10579 Problem reported by Wolfgang Jenker.
10581 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10583 * xdisp.c (try_cursor_movement): Only check for exact match if
10584 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10586 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10588 Remove unused external symbols.
10589 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10590 * xdisp.c (calc_pixel_width_or_height): Now static.
10591 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10592 * indent.c (check_display_width):
10593 * w32term.c: Fix comment to match code.
10594 * xterm.c, xterm.h (x_catching_errors): Remove.
10596 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10598 * xselect.c: Use signed conversions more consistently (Bug#9498).
10599 (selection_data_to_lisp_data): Assume incoming selection data are
10600 signed integers, not unsigned. This is to be consistent with
10601 outgoing selection data, which was modified to use signed integers
10602 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10603 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10604 expects long, not unsigned long.
10606 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10608 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10609 computation of loop end. Reported by Johan Bockgård
10612 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10614 * frame.c (Fother_visible_frames_p): Function deleted.
10616 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10618 * indent.c (compute_motion): Process display vector front to back
10619 rather than the other way around. (Bug#2496)
10621 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10623 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10625 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10627 * minibuf.c (Fread_from_minibuffer): Doc fix.
10629 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10631 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10632 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10634 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10636 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10637 value for non-existent files.
10639 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10641 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10642 set its "size" to -1. This will set the modtime_size field of
10643 the corresponding buffer to -1, which is what
10644 verify-visited-file-modtime expects for files that do not exist.
10647 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10649 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10651 * lisp.h: ... from here. push_key_description is no longer
10652 defined in keyboard.c, so its declaration should not be in
10653 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10654 logically belongs with push_key_description.
10656 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10658 * buffer.h: Include <sys/types.h> instead of <time.h>.
10659 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10660 Problem reported by Herbert J. Skuhra.
10662 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10664 * xml.c (parse_region): Make the parsing work for
10665 non-comment-starting XML files again (bug#9144).
10667 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10669 * image.c (gif_load): Fix calculation of bottom and right corner.
10672 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10674 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10675 redisplay in small windows.
10677 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10679 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10681 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10683 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10684 Operate on live windows only.
10686 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10688 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10690 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10692 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10693 only under bidi iteration.
10695 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10697 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10699 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10701 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10702 Without this fix, the command to link temacs failed due to an
10703 undefined symbol __builtin_isnan. This is because
10704 /usr/include/iso/math_c99.h #defines isnan(x) to
10705 __builtin_isnan(x), but the bundled gcc, which identifies itself
10706 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10708 * floatfns.c (isnan): #undef, and then #define to a clone of
10710 (Fisnan): Always define, since it's always available now.
10711 (syms_of_floatfns): Always define isnan at the Lisp level.
10713 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10715 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10717 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10719 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10720 The previous code assumed that file offsets (off_t values) fit in
10721 EMACS_INT variables, which is not true on typical 32-bit hosts.
10722 The code messed up by falsely reporting buffer overflow in cases
10723 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10724 when "big" contains more than 2**29 bytes, even though this
10725 inserts just one byte and does not overflow the buffer.
10726 (Finsert_file_contents): Store file offsets as off_t
10727 values, not as EMACS_INT values. Check for overflow when
10728 converting between EMACS_INT and off_t. When checking for
10729 buffer overflow or for overlap, take the offsets into account.
10730 Don't use EMACS_INT for small values where int suffices.
10731 When checking for overlap, fix a typo: ZV was used where
10732 ZV_BYTE was intended.
10733 (Fwrite_region): Don't assume off_t fits into 'long'.
10734 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10736 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10738 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10740 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10742 sprintf-related integer and memory overflow issues (Bug#9412).
10744 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10745 (esprintf, exprintf, evxprintf): New functions.
10746 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10747 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10748 (modify_event_symbol): Do not assume that the length of
10749 name_alist_or_stem is safe to alloca and fits in int.
10750 (Fexecute_extended_command): Likewise for function name and binding.
10751 (Frecursion_depth): Wrap around reliably on integer overflow.
10752 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10753 since some callers pass EMACS_INT values.
10754 (Fsingle_key_description): Don't crash if symbol name contains more
10755 than MAX_ALLOCA bytes.
10756 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10757 (get_minibuffer): Arg is now EMACS_INT, not int.
10758 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10759 (esprintf, exprintf, evxprintf): New decls.
10760 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10762 * dbusbind.c (signature_cat): New function.
10763 (xd_signature, Fdbus_register_signal):
10764 Do not overrun buffer; instead, report string overflow.
10766 * dispnew.c (add_window_display_history): Don't overrun buffer.
10767 Truncate instead; this is OK since it's just a log.
10769 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10770 even if the time zone offset is outlandishly large.
10771 Don't mishandle offset == INT_MIN.
10773 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10774 when creating daemon; the previous buffer-overflow check was incorrect.
10776 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10777 which has the guts of the old verror function.
10779 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10780 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10782 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10783 (font_unparse_xlfd): Don't blindly alloca long strings.
10784 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10785 fits in int, when using sprintf. Use single snprintf to count
10786 length of string rather than counting it via multiple sprintfs;
10787 that's simpler and more reliable.
10788 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10789 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10790 sprintf, in case result does not fit in int.
10792 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10793 (fontset_from_font): Print it.
10795 * frame.c (tty_frame_count): Now printmax_t, not int.
10796 (make_terminal_frame, set_term_frame_name): Print it.
10797 (x_report_frame_params): In X, window IDs are unsigned long,
10798 not signed long, so print them as unsigned.
10799 (validate_x_resource_name): Check for implausibly long names,
10800 and don't assume name length fits in 'int'.
10801 (x_get_resource_string): Don't blindly alloca invocation name;
10802 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10805 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10806 (xg_check_special_colors, xg_set_geometry):
10807 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10809 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10810 Use esprintf, not sprintf, in case result does not fit in int.
10812 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10813 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10814 it as a large positive number.
10815 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10816 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10818 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10819 in case result does not fit in int.
10821 * print.c (float_to_string): Detect width overflow more reliably.
10822 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10823 buffer overrun. Don't assume list length fits in 'int'. Treat
10824 print length of 0 as 0, not as infinity; to be consistent with other
10825 uses of print length in this function. Don't overflow print length
10826 index. Don't assume hash table size fits in 'long', or that
10827 vectorlike size fits in 'unsigned long'.
10829 * process.c (make_process): Use printmax_t, not int, to format
10830 process-name gensyms.
10832 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10834 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10835 to avoid potential buffer overrun.
10837 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10838 if X resource line is longer than 512 bytes.
10840 * xfns.c (x_window): Make sprintf buffer a bit bigger
10841 to avoid potential buffer overrun.
10843 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10845 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10847 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10849 Integer overflow fixes for scrolling, etc.
10850 Without these, Emacs silently mishandles large integers sometimes.
10851 For example, "C-u 4294967297 M-x recenter" was treated as if
10852 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10854 * xdisp.c (try_window_id): Check Emacs fixnum range before
10855 converting to 'int'.
10857 * window.c (window_scroll_line_based, Frecenter):
10858 Check that an Emacs fixnum is in range before assigning it to 'int'.
10859 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10860 values converted from Emacs fixnums.
10861 (Frecenter): Don't wrap around a line count if it is out of 'int'
10862 range; instead, treat it as an extreme value.
10863 (Fset_window_configuration, compare_window_configurations):
10864 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10866 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10867 that can exceed INT_MAX. Check that EMACS_INT value is in range
10868 before assigning it to the (possibly-narrower) index.
10869 (match_limit): Don't assume that a fixnum can fit in 'int'.
10871 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10874 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10875 (Fvertical_motion): Don't wrap around LINES values that don't fit
10876 in 'int'. Instead, treat them as extreme values. This is good
10877 enough for windows, which can't have more than INT_MAX lines anyway.
10879 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10881 * Require libxml/parser.h to avoid compilation warning.
10883 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10885 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10886 since this reportedly can destroy thread storage.
10888 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10890 * syntax.c (find_defun_start): Update all cache variables if
10891 exiting early (Bug#9401).
10893 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10895 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10897 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10898 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10899 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10901 * term.c (tty_append_glyph): New function.
10902 (produce_stretch_glyph): Static function and its prototype deleted.
10904 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10907 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10909 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10910 when checking :margin (Bug#9390).
10911 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10912 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10913 so that the name doesn't mislead. All uses changed.
10915 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10917 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10920 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10922 * xdisp.c (move_it_to): Don't bail out early when reaching
10923 position beyond to_charpos, if we are scanning backwards.
10924 (move_it_vertically_backward): When DY == 0, make sure we get to
10925 the first character in the line after the newline.
10927 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10929 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10930 (ccl_driver): Do not generate an out-of-range pointer.
10931 (Fccl_execute_on_string): Remove unnecessary check for
10932 integer overflow, noted by Stefan Monnier in
10933 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10934 Remove a FIXME that didn't need fixing.
10935 Simplify the newly-introduced buffer reallocation code.
10937 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10939 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10941 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10943 Integer and memory overflow issues (Bug#9196).
10945 * doc.c (get_doc_string): Rework so that
10946 get_doc_string_buffer_size is the actual buffer size, rather than
10947 being 1 less than the actual buffer size; this makes xpalloc more
10950 * image.c (x_allocate_bitmap_record, cache_image):
10951 * xselect.c (Fx_register_dnd_atom):
10952 Simplify previous changes by using xpalloc.
10954 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10955 since either will do and ptrdiff_t is convenient with xpalloc.
10957 * charset.c (charset_table_size)
10958 (struct charset_sort_data.priority): Now ptrdiff_t.
10959 (charset_compare): Don't overflow if priorities differ greatly.
10960 (Fsort_charsets): Don't assume list length fits in int.
10961 Check for size-calculation overflow when allocating sort data.
10962 (syms_of_charset): Allocate an initial charset table that is
10963 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10965 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10967 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10968 The actual value is always <= INT_MAX, and leaving it unsigned made
10969 overflow checking harder.
10971 * dispextern.h (struct glyph_matrix.rows_allocated)
10972 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10973 with xpalloc. The values are still always <= INT_MAX.
10975 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10977 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10978 (SAFE_NALLOCA): New macro.
10980 * region-cache.c (struct boundary.pos, find_cache_boundary)
10981 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10982 (set_cache_region, invalidate_region_cache)
10983 (revalidate_region_cache, know_region_cache, region_cache_forward)
10984 (region_cache_backward, pp_cache):
10985 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10986 so that ptrdiff_t * can be passed to xpalloc.
10987 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10988 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10989 (pp_cache): Don't assume cache_len fits in int.
10990 * region-cache.h: Adjust extern decls to match.
10992 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10993 EMACS_INT, since either will do, for xpalloc.
10995 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10996 (xnmalloc, xnrealloc, xpalloc): New functions.
10998 * bidi.c (bidi_shelve_header_size): New constant.
10999 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11000 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11002 * bidi.c (bidi_cache_shrink):
11003 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11005 Don't update size of array until after memory allocation succeeds,
11006 because xmalloc/xrealloc may not return.
11007 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11008 now that we have proper integer overflow checking.
11009 (record_overlay_string, overlay_strings): Catch overflows when
11010 calculating size of overlay_str_buf.
11012 * callproc.c (Fcall_process): Check for size overflow when
11013 calculating size of args2.
11014 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11015 Normally we prefer signed values, but sticking with ptrdiff_t would
11016 require adding more-complicated checks.
11018 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11019 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11020 Redo buffer-overflow calculations to avoid integer overflow.
11021 Add a FIXME comment where memory seems to be over-allocated.
11023 * character.c (Fstring): Check for size-calculation overflow.
11025 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11026 unnecessary integer overflow. Check for size overflow.
11027 (encode_coding_object): Don't update size until xmalloc succeeds.
11029 * composite.c (get_composition_id): Check for overflow in glyph
11030 length calculations.
11032 Integer and memory overflow fixes for display code.
11033 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11034 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11035 (scrolling_window): Check for overflow in size calculations.
11036 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11037 Don't assume glyph table len fits in int.
11038 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11039 (row_table_size): Now ptrdiff_t, not int.
11040 (scrolling_window): Avoid overflow in size calculations.
11041 Don't update size until allocation succeeds.
11042 * fns.c (concat): Check for overflow in size calculations.
11043 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11044 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11045 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11047 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11048 (get_doc_string): Check for size calculation overflow.
11049 Don't update size until allocation succeeds.
11050 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11051 EMACS_INT, where ptrdiff_t will do.
11052 (Fsubstitute_command_keys): Check for string overflow.
11054 * editfns.c (set_time_zone_rule): Don't assume environment length
11056 (message_length): Now ptrdiff_t, not int.
11057 (Fmessage_box): Don't update size until allocation succeeds.
11058 Don't assume message length fits in int.
11059 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11061 * emacs.c (main): Do not reallocate argv, since there is a null at
11062 the end that can be overwritten, and this way there's no need to
11063 worry about size-calculation overflow.
11064 (sort_args): Check for size-calculation overflow.
11066 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11068 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11070 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11071 (x_set_scroll_bar_width, x_figure_window_size):
11072 Check for integer overflow.
11073 (x_set_alpha): Do not assume XINT fits in int.
11075 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11076 This is for the members text_lines, text_cols, total_lines, total_cols,
11077 where the system imposes an 'int' limit.
11079 * fringe.c (Fdefine_fringe_bitmap):
11080 Don't update size until alloc works.
11082 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11083 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11085 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11086 Check for size-calculation overflow.
11087 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11088 do, as we prefer signed integers.
11089 (id_to_widget.max_size, id_to_widget.used)
11090 (xg_store_widget_in_map, xg_remove_widget_from_map)
11091 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11092 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11093 Use and return ptrdiff_t, not int.
11094 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11095 * gtkutil.h: Change prototypes to match the above.
11097 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11098 are duplicate now that they've been promoted to lisp.h.
11099 (x_allocate_bitmap_record, x_alloc_image_color)
11100 (make_image_cache, cache_image, xpm_load):
11101 Don't update size until alloc is done.
11102 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11104 Check for size calculation overflow.
11105 (ct_colors_allocated_max): New constant.
11106 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11109 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11110 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11111 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11112 Use ptrdiff_t, not int, to count maps.
11113 (read_char_minibuf_menu_prompt): Check for overflow in size
11114 calculations. Don't update size until allocation succeeds.
11115 Redo calculations to avoid overflow.
11116 * keyboard.h: Change prototypes to match the above.
11118 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11120 (current_minor_maps): Check for size calculation overflow.
11121 * keymap.h: Change prototypes to match the above.
11123 * lread.c (read1, init_obarray): Don't update size until alloc done.
11125 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11126 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11128 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11129 Now ptrdiff_t, not int.
11130 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11131 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11133 * process.c (Fnetwork_interface_list): Check for overflow
11134 in size calculation.
11136 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11138 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11139 overflow. Don't bother calling xmalloc when xrealloc will do.
11141 * search.c (Freplace_match): Check for size calculation overflow.
11142 (Fset_match_data): Don't assume list lengths fit in 'int'.
11144 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11145 for command line length. Do not attempt to address one before the
11146 beginning of an array, as that's not portable.
11148 * term.c (max_frame_lines): Remove; unused.
11149 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11151 (encode_terminal_code, calculate_costs): Check for size
11152 calculation overflow.
11153 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11154 table lengths and related sizes. Don't update size until alloc
11155 done. Redo calculations to avoid overflow.
11156 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11158 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11159 subtracting pointers.
11160 (gobble_line): Check for overflow more carefully. Don't update size
11163 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11164 Don't update size until alloc done.
11165 Redo size calculations to avoid overflow.
11166 Check for size calculation overflow.
11167 (main) [DEBUG]: Fix typo in invoking tparam1.
11169 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11170 Use ptrdiff_t, not int, for sizes.
11171 (store_mode_line_noprop_char): Don't update size until alloc done.
11173 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11174 Use ptrdiff_t, not int, for sizes.
11175 (Finternal_make_lisp_face, cache_face):
11176 Check for size calculation overflow.
11177 (cache_face): Treat size calculation overflows as if they were
11178 memory exhaustion (the usual treatment), rather than aborting.
11180 * xfns.c (x_encode_text, x_set_name_internal)
11181 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11182 sizes, since they can exceed INT_MAX in size. Check for size
11183 calculation overflow.
11185 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11186 (xg_select): Check for size calculation overflow.
11187 Don't update size until alloc done.
11189 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11190 as sprintf is limited to int lengths.
11192 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11193 (X_LONG_MIN): New macros.
11194 Use them to make the following changes clearer.
11195 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11196 This change doesn't affect the value now, but it may help remind
11197 future maintainers not to raise the value too much later.
11198 (SELECTION_QUANTUM): Remove, replacing with ...
11199 (selection_quantum): ... new function, which avoids overflow.
11201 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11202 assumption that selection length fits in 'int'.
11203 (x_reply_selection_request, x_handle_selection_request)
11204 (x_get_window_property, receive_incremental_selection)
11205 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11206 (lisp_data_to_selection_data, clean_local_selection_data):
11207 Use ptrdiff_t, not int, to record length of selection.
11208 (x_reply_selection_request, x_get_window_property)
11209 (receive_incremental_selection, x_property_data_to_lisp):
11210 Redo calculations to avoid overflow.
11211 (x_reply_selection_request): When sending hint, ceiling it at
11212 X_LONG_MAX rather than relying on wraparound overflow to send
11214 (x_get_window_property, receive_incremental_selection)
11215 (lisp_data_to_selection_data, x_property_data_to_lisp):
11216 Check for size-calculation overflow.
11217 (x_get_window_property, receive_incremental_selection)
11218 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11219 Don't store size until memory allocation succeeds.
11220 (x_get_window_property): Plug memory leak on memory exhaustion.
11221 Don't double-block input; malloc is safe here. Don't assume 2**34
11222 - 4 fits in unsigned long. Add an xassert to check
11223 XGetWindowProperty overflow. Be more careful about overflow
11224 calculations, and distinguish size from memory overflow better.
11225 (receive_incremental_selection): When tracing, don't assume
11226 unsigned int is less than INT_MAX.
11227 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11228 harmful) conversions of unsigned short to int.
11229 (lisp_data_to_selection_data): Don't assume that integers
11230 in the range -65535 through -1 fit in an X unsigned short.
11231 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11232 result parameters unless successful. Rely on cons_to_unsigned
11233 to report problems with elements; the old code wasn't right anyway.
11234 (x_check_property_data): Check for int overflow; we cannot use
11235 a wider type due to X limits.
11236 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11238 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11240 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11241 (x_term_init): Check for size calculation overflow.
11242 (x_color_cells): Don't store size until memory allocation succeeds.
11243 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11244 Don't assume alloca size is less than MAX_ALLOCA.
11245 (x_term_init): Don't assume length fits in int (sprintf is limited
11248 Use ptrdiff_t for composition IDs.
11249 * character.c (lisp_string_width):
11250 * composite.c (composition_table_size, n_compositions)
11251 (get_composition_id, composition_gstring_from_id):
11252 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11253 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11254 * window.c (Frecenter):
11255 Use ptrdiff_t, not int, for composition IDs.
11256 * composite.c (get_composition_id): Check for integer overflow.
11257 * composite.h: Adjust prototypes to match the above changes.
11259 Use ptrdiff_t for hash table indexes.
11260 * category.c (hash_get_category_set):
11261 * ccl.c (ccl_driver):
11262 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11263 * coding.c (coding_system_charset_list, detect_coding_system):
11264 * coding.h (struct coding_system.id):
11265 * composite.c (get_composition_id, gstring_lookup_cache):
11266 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11267 * image.c (xpm_get_color_table_h):
11268 * lisp.h (hash_lookup, hash_put):
11269 * minibuf.c (Ftest_completion):
11270 Use ptrdiff_t for hash table indexes, not int (which is too
11271 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11272 32-bit --with-wide-int hosts).
11274 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11275 Add a FIXME comment about memory leaks.
11276 (syms_of_charset): Don't assume xmalloc returns.
11278 Don't assume that stated character widths fit in int.
11279 * character.c (Fchar_width, c_string_width, lisp_string_width):
11280 * character.h (CHAR_WIDTH):
11281 * indent.c (MULTIBYTE_BYTES_WIDTH):
11282 Use sanitize_char_width to avoid undefined and/or bad behavior
11283 with outlandish widths.
11284 * character.h (sanitize_tab_width): Rename from sanitize_width,
11285 now that we have two such functions. All uses changed.
11286 (sanitize_char_width): New inline function.
11288 Don't assume that tab-width fits in int.
11289 * character.h (sanitize_width): New inline function.
11290 (SANE_TAB_WIDTH): New macro.
11291 (ASCII_CHAR_WIDTH): Use it.
11292 * indent.c (sane_tab_width): Remove. All uses replaced by
11293 SANE_TAB_WIDTH (current_buffer).
11294 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11296 * fileio.c: Integer overflow issues with file modes.
11297 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11299 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11300 Remove unreachable code.
11301 (read_hex, load_charset_map_from_file): Check for integer overflow.
11303 * xterm.c: Don't go over XClientMessageEvent limit.
11304 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11305 (x_send_scroll_bar_event): Likewise. Check that the size does not
11306 exceed limits imposed by XClientMessageEvent, as well as the usual
11307 ptrdiff_t and size_t limits.
11309 * keyboard.c: Overflow, signedness and related fixes.
11310 (make_lispy_movement): Use same integer type in forward decl
11311 that is used in the definition.
11312 (read_key_sequence, keyremap_step):
11313 Change bufsize argument back to int, undoing my 2011-03-30 change.
11314 We prefer signed types, and int is wide enough here.
11315 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11316 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11317 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11318 length, not size_t. Use ptrdiff_t for index, not int.
11319 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11320 possibility of integer overflow.
11322 Overflow, signedness and related fixes for images.
11324 * dispextern.h (struct it.stack[0].u.image.image_id)
11325 (struct_it.image_id, struct image.id, struct image_cache.size)
11326 (struct image_cache.used, struct image_cache.ref_count):
11327 * gtkutil.c (update_frame_tool_bar):
11328 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11329 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11330 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11331 * nsmenu.m (update_frame_tool_bar):
11332 * xdisp.c (calc_pixel_width_or_height):
11333 * xfns.c (image_cache_refcount):
11334 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11335 on typical 64-bit hosts.
11337 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11338 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11339 Omit unnecessary casts to int.
11340 (parse_image_spec): Check that integers fall into 'int' range
11341 when the callers expect that.
11342 (image_ascent): Redo ascent calculation to avoid int overflow.
11343 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11344 (lookup_image): Remove unnecessary tests.
11345 (xbm_image_p): Locals are now of int, not EMACS_INT,
11346 since parse_image_check makes sure they fit into int.
11347 (png_load, gif_load, svg_load_image):
11348 Prefer int to unsigned where either will do.
11349 (tiff_handler): New function, combining the cores of the
11350 old tiff_error_handler and tiff_warning_handler.
11351 This function is rewritten to use vsnprintf and thereby avoid
11352 stack buffer overflows. It uses only the features of vsnprintf
11353 that are common to both POSIX and native Microsoft.
11354 (tiff_error_handler, tiff_warning_handler): Use it.
11355 (tiff_load, gif_load, imagemagick_load_image):
11356 Don't assume :index value fits in 'int'.
11357 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11358 (imagemagick_load_image): Check that crop parameters fit into
11359 the integer types that MagickCropImage accepts. Don't assume
11360 Vimagemagick_render_type has a nonnegative value. Don't assume
11361 size_t fits in 'long'.
11362 (gs_load): Use printmax_t to print the widest integers possible.
11363 Check for integer overflow when computing image height and width.
11365 2011-08-26 Eli Zaretskii <eliz@gnu.org>
11367 * xdisp.c (redisplay_window): Don't force window start if point
11368 will be invisible in the resulting window. (Bug#9324)
11370 2011-08-25 Eli Zaretskii <eliz@gnu.org>
11372 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11373 the display spec is of the form `(space ...)'.
11374 (handle_display_spec): Return the value returned by
11375 handle_single_display_spec, not just 1 or zero.
11376 (handle_single_display_spec): If the display spec is of the form
11377 `(space ...)', and specifies display in the text area, return 2
11379 (try_cursor_movement): Check for the need to scroll more
11380 accurately, and prefer exact match for point under bidi.
11381 Don't advance `row' beyond the last row of the window.
11383 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11384 into disp_prop; all users changed.
11386 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11387 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11388 for the text covered by the display property.
11390 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
11392 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11393 Change return value to nil.
11394 (Frecord_buffer): Delete unused function.
11396 2011-08-24 Eli Zaretskii <eliz@gnu.org>
11398 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11399 buffers, return left-to-right.
11400 (set_cursor_from_row): Consider candidate row a win if its glyph
11401 represents a newline and point is on that newline. Fixes cursor
11402 positioning on the newline at EOL of R2L text within L2R
11403 paragraph, and vice versa.
11404 (try_cursor_movement): Check continued rows, in addition to
11405 continuation rows. Fixes unwarranted scroll when point enters a
11406 continued line of R2L text within an L2R paragraph, or vice versa.
11407 (cursor_row_p): Consider the case of point being equal to
11408 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11409 from the end of a short line to the beginning of a continued line
11410 of R2L text within L2R paragraph.
11411 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11412 composed characters.
11414 * bidi.c (bidi_check_type): Use xassert.
11415 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11418 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11420 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11423 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
11425 * nsfont.m (ns_otf_to_script): Fix typo.
11427 2011-08-22 Kenichi Handa <handa@m17n.org>
11429 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11430 extra slot even if the purpose is char-code-property-table.
11432 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11434 * xdisp.c (redisplay_window): When computing centering_position,
11435 account for the height of the header line. (Bug#8874)
11437 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11438 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11439 candidate is selected by the mouse, and that candidate has a
11440 composed character under the mouse.
11442 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11443 coordinates reported by pos-visible-in-window-p for a composed
11444 character in column zero.
11446 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11448 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11450 2011-08-22 Eli Zaretskii <eliz@gnu.org>
11452 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11453 consider it a hit if to_charpos is anywhere in the range of the
11454 composed buffer positions.
11456 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
11458 * image.c (gif_load): Don't assume that each subimage has the same
11459 dimensions as the base image. Handle disposal method that is
11460 "undefined" by the gif spec (Bug#9335).
11462 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
11464 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11465 (Fcondition_case): Document `debug' symbol in error handler.
11467 2011-08-19 Eli Zaretskii <eliz@gnu.org>
11469 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11470 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11471 from an Org mode buffer to a Speedbar frame.
11473 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11474 a composition, take its buffer position from IT->cmp_it.charpos.
11475 Fixes cursor positioning at the beginning of a line that begins
11476 with a composed character.
11478 2011-08-18 Eli Zaretskii <eliz@gnu.org>
11480 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11481 character bidirectional type, use STRONG_L instead. Fixes crashes
11482 in a buffer produced by `describe-categories'.
11484 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11485 members before the level stack, so they would be saved and
11486 restored when copying iterator state. Fixes incorrect reordering
11487 around TABs covered by display properties.
11489 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11491 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11493 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
11495 * eval.c (internal_condition_case, internal_condition_case_1)
11496 (internal_condition_case_2, internal_condition_case_n):
11497 Remove unnecessary aborts (Bug#9081).
11499 2011-08-17 Eli Zaretskii <eliz@gnu.org>
11501 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11502 has no `load' handler, try opening the file locally. (Bug#9311)
11504 2011-08-16 Ken Brown <kbrown@cornell.edu>
11506 * gmalloc.c: Expand comment.
11508 2011-08-16 Eli Zaretskii <eliz@gnu.org>
11510 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11511 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11513 2011-08-16 Ken Brown <kbrown@cornell.edu>
11515 Fix memory allocation problems in Cygwin build (Bug#9273).
11517 * unexcw.c ( __malloc_initialized): Declare external variable.
11518 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11520 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11522 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11524 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11525 in the static heap.
11526 [CYGWIN] (special_realloc): New function.
11527 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11528 requests to realloc storage in the static heap.
11530 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11532 * bidi.c (bidi_initialize): Remove unused local.
11534 2011-08-15 Eli Zaretskii <eliz@gnu.org>
11537 * biditype.h: Remove file.
11538 * makefile.w32-in ($(BLD)/bidi.$(O)):
11539 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11541 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11543 * chartab.c: Improve commentary for the uniprop_table API.
11545 * bidi.c (bidi_paragraph_init): Support zero value of
11546 bidi_ignore_explicit_marks_for_paragraph_level.
11547 (bidi_initialize): Use uniprop_table instead of including
11548 biditype.h and bidimirror.h.
11550 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11551 coordinates of the iterator when restoring from ppos_it.
11554 2011-08-14 Kenichi Handa <handa@m17n.org>
11556 * process.c (create_process): Call setup_process_coding_systems
11557 after the pid of the process is set to -1 (Bug#8162).
11559 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11561 * xdisp.c (move_it_in_display_line_to): Don't invoke
11562 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11563 ppos_it. Fixes vertical cursor motion when line beginning is
11564 covered by an image. (Bug#9296)
11566 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11568 * nsterm.h (ns_run_ascript): Declare.
11569 (NSAPP_DATA2_RUNASSCRIPT): Define.
11571 * nsfns.m (as_script, as_result, as_status): New static variables.
11572 (ns_run_ascript): New function.
11573 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11574 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11575 the event loop. Get status from as_status (Bug#7276).
11577 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11578 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11579 the event loop (Bug#7276).
11581 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11583 * gnutls.c (QCgnutls_bootprop_priority)
11584 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11585 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11586 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11587 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11588 (QCgnutls_bootprop_verify_hostname_error)
11589 (QCgnutls_bootprop_callbacks_verify): Rename from
11590 Qgnutls_bootprop_..., all uses changed.
11592 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11595 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11597 * xfaces.c (Qframe_set_background_mode): Now static.
11598 * dispextern.h (Qframe_set_background_mode): Remove decl.
11600 * process.c (Fnetwork_interface_info): Declare local only if needed.
11602 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11604 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11605 (Fnetwork_interface_list): Allocate in increments of bytes instead
11606 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11607 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11609 (struct ifflag_def): notrailers is smart on OSX.
11610 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11611 Get hardware address with getifaddrs if available.
11613 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11615 * xdisp.c (iterate_out_of_display_property): xassert that
11616 IT->position is set to within IT->object's boundaries. Break from
11617 the loop as soon as EOB is reached; avoids infloops in redisplay
11618 when IT->position is set up wrongly due to some bug.
11619 Set IT->current to match the bidi iterator unconditionally.
11620 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11621 entry. Force push_it to save on the stack the current
11622 buffer/string position, to be restored by pop_it. Fix flags in
11623 the iterator structure wrt the object coming from a display
11624 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11625 properties. (Bug#9284)
11627 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11629 * fontset.c (fontset_get_font_group): Add proper type checks.
11632 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11634 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11635 and LC_VERSION_MIN_MACOSX.
11636 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11637 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11639 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11641 * xdisp.c (forward_to_next_line_start): Allow to use the
11642 no-display-properties-and-no-overlays under bidi display.
11643 Set disp_pos in the bidi iterator to avoid searches for display
11644 properties and overlays.
11646 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11648 * editfns.c (Fset_time_zone_rule): Document relationship with the
11651 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11652 the font entity extracted from the cache (Bug#8109).
11654 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11656 * composite.c (autocmp_chars): Don't reset point. That is done by
11657 restore_point_unwind (Bug#5984).
11659 2011-08-07 Juri Linkov <juri@jurta.org>
11661 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11662 to show the arg `TIME' instead of `TIMEVAL'.
11664 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11666 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11667 display property strides EOL and includes a newline, as in
11668 longlines-mode. (Bug#9254)
11669 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11670 word-wrap under bidirectional display. (Bug#9224)
11672 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11673 is non-zero, even if the data buffer is NULL. Fixes a crash in
11674 vertical-motion with longlines-mode. (Bug#9254)
11676 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11678 * bidi.c <bidi_cache_total_alloc>: Now static.
11679 (bidi_initialize): Initialize bidi_cache_total_alloc.
11681 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11684 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11685 amount allocated this far in `bidi_cache_total_alloc'.
11686 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11687 non-zero, only free the data buffer without restoring the cache
11688 contents. All callers changed.
11690 * dispextern.h (bidi_unshelve_cache): Update prototype.
11692 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11693 (move_it_in_display_line, move_it_to)
11694 (move_it_vertically_backward, move_it_by_lines): Replace the call
11695 to xfree to an equivalent call to bidi_unshelve_cache.
11696 (move_it_in_display_line_to): Fix logic of returning
11697 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11699 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11701 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11702 came from a string character with a `cursor' property. (Bug#9229)
11704 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11706 * Makefile.in (LIB_PTHREAD): New variable.
11707 (LIBES): Add LIB_PTHREAD (Bug#9216).
11709 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11710 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11712 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11714 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11716 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11718 * xterm.c (x_find_topmost_parent): New function.
11719 (x_set_frame_alpha): Find topmost parent window with
11720 x_find_topmost_parent and set the property there also (bug#9181).
11721 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11723 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11725 * callproc.c (Fcall_process): Avoid vfork clobbering
11726 the local vars buffer, coding_systems, current_dir.
11728 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11730 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11732 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11734 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11735 so that it is not optimized away.
11737 * xdisp.c (compute_display_string_pos): Remove unused local.
11739 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11741 Fix slow cursor motion and scrolling in large buffers with
11742 selective display, like Org Mode buffers. (Bug#9218)
11744 * dispextern.h (struct bidi_it): New member disp_prop_p.
11746 * xdisp.c: Remove one-slot cache of display string positions.
11747 (compute_display_string_pos): Accept an additional argument
11748 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11749 for a display string or property. If found, set DISP_PROP_P
11752 * bidi.c (bidi_fetch_char): Accept an additional argument
11753 DISP_PROP_P, and pass it to compute_display_string_pos.
11754 Only handle text covered by a display string if DISP_PROP_P is returned
11755 non-zero. All callers of bidi_fetch_char changed.
11757 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11759 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11761 2010-12-03 Don March <don@ohspite.net>
11763 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11764 last character M-[char] is translated to ESC [char] (bug#7541).
11766 2011-08-02 Kenichi Handa <handa@m17n.org>
11768 * lisp.h (uniprop_table): Extern it.
11770 * chartab.c (uniprop_table): Make it non-static.
11772 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11774 * xdisp.c (forward_to_next_line_start): Accept additional argument
11775 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11777 (reseat_at_next_visible_line_start): Use the bidi iterator state
11778 returned by forward_to_next_line_start to restore the state of
11779 it->bidi_it after backing up to previous newline. (Bug#9212)
11781 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11783 * regex.c (re_comp): Protoize.
11784 (re_exec): Fix return type.
11785 (regexec): Fix type of `ret'. (Bug#9203)
11787 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11789 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11790 This is needed if max-image-size is a floating-point number.
11792 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11794 * print.c (print_object): Print empty symbol as ##.
11796 * lread.c (read1): Read ## as empty symbol.
11798 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11800 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11801 setting frame foreground color (Bug#9175).
11802 (x_set_background_color): Likewise.
11804 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11805 contents (Bug#9176).
11806 (EmacsTooltip -init): Remove bezels and add shadows to
11809 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11810 or scroll bar (Bug#8470).
11812 * nsfont.m (nsfont_open): Remove assignment to voffset and
11813 unnecessary vars hshink, expand, hd, full_height, min_height.
11814 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11816 * nsterm.h (nsfont_info): Remove voffset field.
11818 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11820 Implement strike-through and overline on NextStep (Bug#8863).
11822 * nsfont.m (nsfont_open): Use underline position provided by font,
11823 instead of hard-coded value of 2.
11824 (nsfont_draw): Call ns_draw_text_decoration instead.
11826 * nsterm.h: Add declaration for ns_draw_text_decoration.
11828 * nsterm.m (ns_draw_text_decoration): New function for drawing
11829 underline, overline, and strike-through.
11830 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11831 ns_draw_text_decoration. Change treatment of cursor drawing to
11832 accommodate underlining, etc.
11834 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11836 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11839 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11841 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11842 Without this fix, if a signal arrives just after memory fills up,
11843 'malloc' might be invoked reentrantly.
11845 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11846 In other words, assume that every image size is allowed, on non-X
11847 hosts. This assumption is probably wrong, but it lets Emacs compile.
11849 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11851 * regex.c (re_iswctype): Convert return values to boolean.
11853 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11855 * xdisp.c (compute_display_string_pos): Don't use cached display
11856 string position if the buffer had its restriction changed.
11859 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11861 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11863 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11865 Integer signedness and overflow and related fixes. (Bug#9079)
11867 * bidi.c: Integer size and overflow fixes.
11868 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11869 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11870 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11871 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11872 (bidi_find_other_level_edge):
11873 Use ptrdiff_t instead of EMACS_INT where either will do.
11874 This works better on 32-bit hosts configured --with-wide-int.
11875 (bidi_cache_ensure_space): Check for size-calculation overflow.
11876 Use % rather than repeated addition, for better worst-case speed.
11877 Don't set bidi_cache_size until after xrealloc returns, because it
11879 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11880 (bidi_cache_ensure_space): Also check that the bidi cache size
11881 does not exceed that of the largest Lisp string or buffer. See Eli
11882 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11884 * alloc.c (__malloc_size_t): Remove.
11885 All uses replaced by size_t. See Andreas Schwab's note
11886 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11888 * image.c: Improve checking for integer overflow.
11889 (check_image_size): Assume that f is nonnull, since
11890 it is always nonnull in practice. This is one less thing to
11891 worry about when checking for integer overflow later.
11892 (x_check_image_size): New function, which checks for integer
11893 overflow issues inside X.
11894 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11895 This removes the need for a memory_full check.
11896 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11897 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11898 (xbm_read_bitmap_data): Change locals back to 'int', since
11899 their values must fit in 'int'.
11900 (xpm_load_image, png_load, tiff_load):
11901 Invoke x_create_x_image_and_pixmap earlier,
11902 to avoid much needless work if the image is too large.
11903 (tiff_load): Treat overly large images as if
11904 x_create_x_image_and_pixmap failed, not as malloc failures.
11905 (gs_load): Use x_check_image_size.
11907 * gtkutil.c: Omit integer casts.
11908 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11909 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11911 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11913 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11914 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11915 would wrongly return t on a 64-bit host.
11917 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11918 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11919 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11920 and therefore cause GCC to emit a bogus diagnostic in some cases.
11922 * image.c: Integer signedness and overflow and related fixes.
11923 This is not an exhaustive set of fixes, but it's time to
11924 record what I've got.
11925 (lookup_pixel_color, check_image_size): Remove redundant decls.
11926 (check_image_size): Don't assume that arbitrary EMACS_INT values
11927 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11928 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11929 (tiff_load, imagemagick_load_image):
11930 Check for overflow in size calculations.
11931 (x_create_x_image_and_pixmap): Remove unnecessary test for
11932 xmalloc returning NULL; that can't happen.
11933 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11934 (xpm_color_bucket): Use better integer hashing function.
11935 (xpm_cache_color): Don't possibly over-allocate memory.
11936 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11937 (gif_memory_source):
11938 Use ptrdiff_t, not int or size_t, to record sizes.
11939 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11940 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11941 either works, as we prefer signed integers.
11942 (tiff_read_from_memory, tiff_write_from_memory):
11943 Return tsize_t, not size_t, since that's what the TIFF API wants.
11944 (tiff_read_from_memory): Don't fail simply because the read would
11945 go past EOF; instead, return a short read.
11946 (tiff_load): Omit no-longer-needed casts.
11947 (Fimagemagick_types): Don't assume size fits into 'int'.
11949 Improve hashing quality when configured --with-wide-int.
11950 * fns.c (hash_string): New function, taken from sxhash_string.
11951 Do not discard information about ASCII character case; this
11952 discarding is no longer needed.
11953 (sxhash-string): Use it. Change sig to match it. Caller changed.
11954 * lisp.h: Declare it.
11955 * lread.c (hash_string): Remove, since we now use fns.c's version.
11956 The fns.c version returns a wider integer if --with-wide-int is
11957 specified, so this should help the quality of the hashing a bit.
11959 * emacs.c: Integer overflow minor fix.
11960 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11961 Define only if GNU_LINUX.
11962 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11964 * dispnew.c: Integer signedness and overflow fixes.
11965 Remove unnecessary forward decls, that were a maintenance hassle.
11966 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11968 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11969 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11970 (prepare_desired_row, line_draw_cost):
11971 Use int, not unsigned, where either works.
11972 (save_current_matrix, restore_current_matrix):
11973 Use ptrdiff_t, not size_t, where either works.
11974 (init_display): Check for overflow more accurately, and without
11975 relying on undefined behavior.
11977 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11978 Remove, replacing with the new symbols in lisp.h. All uses changed.
11979 * fileio.c (make_temp_name):
11980 * filelock.c (lock_file_1, lock_file):
11981 * xdisp.c (message_dolog):
11982 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11983 Use pMd etc. instead.
11984 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11985 replacing the pWIDE etc. symbols removed from editfns.c.
11987 * keyboard.h (num_input_events): Now uintmax_t.
11988 This is (very slightly) less likely to mess up due to wraparound.
11991 * buffer.c: Integer signedness fixes.
11992 (alloc_buffer_text, enlarge_buffer_text):
11993 Use ptrdiff_t rather than size_t when either will do, as we prefer
11996 * alloc.c: Integer signedness and overflow fixes.
11997 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11998 (__malloc_size_t): Default to size_t, not to int.
11999 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12000 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12001 Prefer ptrdiff_t to size_t when either would do, as we prefer
12003 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12004 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12005 Now const. Initialize with values that are in range even if char
12007 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12008 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12009 These functions do the right thing with sizes > 2**32.
12010 (check_depth): Now ptrdiff_t, not int.
12011 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12012 Adjust to new way of storing sizes. Check for size overflow bugs
12014 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12015 slightly wrong anyway, as it missed one instance of
12016 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12017 (refill_memory_reserve): Omit needless cast to size_t.
12018 (mark_object_loop_halt): Mark as externally visible.
12020 * xselect.c: Integer signedness and overflow fixes.
12021 (Fx_register_dnd_atom, x_handle_dnd_message):
12022 Use ptrdiff_t, not size_t, since we prefer signed.
12023 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12024 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12025 x_dnd_atoms_size and x_dnd_atoms_length.
12027 * doprnt.c: Prefer signed to unsigned when either works.
12029 * doprnt.c (doprnt):
12031 * xdisp.c (vmessage):
12032 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12033 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12034 prefer signed arithmetic to avoid comparison confusion.
12035 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12036 but is a bit tricky.
12038 Assume freestanding C89 headers, string.h, stdlib.h.
12039 * data.c, doprnt.c, floatfns.c, print.c:
12040 Include float.h unconditionally.
12041 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12042 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12043 * regex.c: Likewise for stddef.h, string.h.
12044 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12045 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12046 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12047 (STDC_HEADERS): Remove obsolete defines.
12048 * sysdep.c: Include limits.h unconditionally.
12050 Assume support for memcmp, memcpy, memmove, memset.
12051 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12052 * regex.c (memcmp, memcpy):
12053 Remove; we assume C89 now.
12055 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12056 (__malloc_safe_bcopy): Remove; no longer needed.
12058 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12059 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12060 well either way, and we prefer signed to unsigned.
12062 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12064 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12065 closes the connection while we're reading (bug#9182).
12067 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12069 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12070 are specified (Bug#9168).
12072 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12074 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12075 Found by GCC static checking and --with-wide-int on a 32-bit host.
12077 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12079 * xdisp.c (compute_display_string_pos): Fix logic of caching
12080 previous display string position. Initialize cached_prev_pos to
12081 -1. Fixes slow-down at the beginning of a buffer.
12083 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12085 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12086 for attrs[LFACE_FONTSET_INDEX].
12088 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12090 * xml.c (parse_region): Remove unused local
12091 that was recently introduced.
12093 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12095 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12096 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12098 * xdisp.c (move_it_in_display_line_to): Record the best matching
12099 position for TO_CHARPOS while scanning the line, and restore it on
12100 exit if none of the characters scanned was an exact match.
12101 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12102 when exact match is impossible due to invisible text, and the
12103 lines are truncated.
12105 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12107 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12110 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12112 Fix a significant slow-down of cursor motion with C-n, C-p,
12113 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12114 auto-repeat under bidi redisplay in fontified buffers.
12115 * xdisp.c (compute_stop_pos_backwards): New function.
12116 (next_element_from_buffer): Call compute_stop_pos_backwards to
12117 find a suitable prev_stop when we find ourselves before
12119 (reseat): Don't look for prev_stop, as that could mean a very long
12121 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12122 <cached_disp_overlay_modiff>: Cache for last found display string
12124 (compute_display_string_pos): Return the cached position if asked
12125 about the same buffer in the same area of character positions, and
12126 the buffer wasn't changed since the time the display string
12127 position was cached.
12129 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12131 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12132 is an integer, which is important for empty lines. (Bug#9149)
12134 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
12136 * frame.c (Fmodify_frame_parameters): In tty case, update the
12137 default face if necessary (Bug#4238).
12139 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
12141 * editfns.c (Fstring_to_char): No need to explain what a character
12142 is in the docstring (Bug#6576).
12144 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12146 * xml.c (parse_region): Make sure we always return a tree.
12148 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12150 * xml.c (parse_region): If a document contains only comments,
12153 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12155 * xml.c (make_dom): Return comments, too.
12157 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12160 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12161 and the surrounding thread.
12162 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12163 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12164 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12166 * s/openbsd.h (BROKEN_SIGIO): Define.
12167 * unexelf.c (unexec) [__OpenBSD__]:
12168 Don't update the .mdebug section of the Alpha COFF symbol table.
12170 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12172 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12175 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12177 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12178 This fixes some race conditions on the permissions of any newly
12181 * alloc.c (valid_pointer_p): Use pipe, not open.
12182 This fixes some permissions issues when debugging.
12184 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12185 If fchown fails to set both uid and gid, try to set just gid,
12186 as that is sometimes allowed. Adjust the file's mode to eliminate
12187 setuid or setgid bits that are inappropriate if fchown fails.
12189 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12191 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12192 to compare Lisp_Objects.
12193 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12194 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12195 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12197 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12199 * lread.c (read_integer): Unread even EOF character.
12200 (read1): Likewise. Properly record start position of symbol.
12202 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12203 symbol character follows.
12205 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12207 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12208 This works around a problem with the previous change to Fcopy_file.
12209 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12210 and without this change, GCC might complain about discarding
12211 fchown's return value.
12213 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
12215 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12217 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12219 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12221 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12223 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12224 it's used from the C level.
12226 * process.c: Use the same condition for POLL_FOR_INPUT in both
12227 keyboard.c and process.c (bug#1858).
12229 2011-07-09 Lawrence Mitchell <wence@gmx.li>
12231 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12232 (Fgnutls_boot): Use it.
12234 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12236 * doc.c (Fsubstitute_command_keys): Revert last change.
12238 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12240 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12241 quotes the next character, and doesn't affect other longer
12242 sequences (bug#8935).
12244 * lread.c (syms_of_lread): Clarify that is isn't only
12245 `eval-buffer' and `eval-defun' that's affected by
12246 `lexical-binding' (bug#8460).
12248 2011-07-15 Eli Zaretskii <eliz@gnu.org>
12250 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12251 bidi redisplay when a line includes both an image and is truncated.
12253 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12255 Fix minor problems found by static checking.
12256 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12257 (elsz): Now a signed constant, not a size_t var. We prefer signed
12258 types to unsigned, to avoid integer comparison confusion. Without
12259 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12260 "cannot optimize loop, the loop counter may overflow", a symptom
12262 * indent.c (Fvertical_motion): Mark locals as initialized.
12263 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12265 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12267 * search.c (Fre_search_backward): Mention `case-fold-search' in
12268 all the re_search_* functions (bug#8138).
12270 * keyboard.c (Fopen_dribble_file): Document when the file is
12273 2011-07-14 Eli Zaretskii <eliz@gnu.org>
12275 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12278 Support bidi reordering of display and overlay strings.
12279 * xdisp.c (compute_display_string_pos)
12280 (compute_display_string_end): Accept additional argument STRING.
12281 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12282 (reseat_to_string): Initialize bidi_it->string.s and
12283 bidi_it->string.schars.
12284 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12285 NULL (avoids a crash in bidi_paragraph_init).
12286 Initialize itb.string.lstring.
12287 (init_iterator): Call bidi_init_it only of a valid
12288 buffer position was specified. Initialize paragraph_embedding to
12290 (reseat_to_string): Initialize the bidi iterator.
12291 (display_string): If we need to ignore text properties of
12292 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12293 original value of -1 will not work with bidi.)
12294 (compute_display_string_pos): First arg is now struct
12295 `text_pos *'; all callers changed. Support display properties on
12297 (compute_display_string_end): Support display properties on Lisp
12299 (init_iterator, reseat_1, reseat_to_string): Initialize the
12300 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12301 when iterating on a string not from display properties).
12302 (compute_display_string_pos, compute_display_string_end):
12303 Fix calculation of the object to scan. Fixes an error when using
12305 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12306 base_level_stop; instead, set base_level_stop to BEGV.
12307 Fixes crashes in vertical-motion.
12308 (next_element_from_buffer): Improve commentary for when
12309 the iterator is before prev_stop.
12310 (init_iterator): Initialize bidi_p from the default value of
12311 bidi-display-reordering, not from buffer-local value. Use the
12312 buffer-local value only if initializing for buffer iteration.
12313 (handle_invisible_prop): Support invisible properties on strings
12314 that are being bidi-reordered.
12315 (set_iterator_to_next): Support bidi reordering of C strings and
12317 (next_element_from_string): Support bidi reordering of Lisp
12319 (handle_stop_backwards): Support Lisp strings as well.
12320 (display_string): Support display of R2L glyph rows.
12321 Use IT_STRING_CHARPOS when displaying from a Lisp string.
12322 (init_iterator): Don't initialize it->bidi_p for strings
12324 (reseat_to_string): Initialize it->bidi_p for strings here.
12325 (next_element_from_string, next_element_from_c_string)
12326 (next_element_from_buffer): Add xassert's for correspondence
12327 between IT's object being iterated and it->bidi_it.string
12329 (face_before_or_after_it_pos): Support bidi iteration.
12330 (next_element_from_c_string): Handle the case of the first string
12331 character that is not the first one in the visual order.
12332 (get_visually_first_element): New function, refactored from common
12333 parts of next_element_from_buffer, next_element_from_string, and
12334 next_element_from_c_string.
12335 (tool_bar_lines_needed, redisplay_tool_bar)
12336 (display_menu_bar): Force left-to-right direction. Add a FIXME
12337 comment for making that be controlled by a user option.
12338 (push_it, pop_it): Save and restore the state of the
12339 bidi iterator. Save and restore the bidi_p flag.
12340 (pop_it): Iterate out of display property for string iteration as
12342 (iterate_out_of_display_property): Support iteration over strings.
12343 (handle_single_display_spec): Set up it->bidi_it for iteration
12344 over a display string, and call bidi_init_it.
12345 (handle_single_display_spec, next_overlay_string)
12346 (get_overlay_strings_1, push_display_prop): Set up the bidi
12347 iterator for displaying display or overlay strings.
12348 (forward_to_next_line_start): Don't use the shortcut if
12350 (back_to_previous_visible_line_start): If handle_display_prop
12351 pushed the iterator stack, restore the internal state of the bidi
12352 iterator by calling bidi_pop_it same number of times.
12353 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12354 and we are bidi-iterating, don't decrement the iterator position;
12355 instead, set the first_elt flag in the bidi iterator, to produce
12357 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12358 (push_display_prop): xassert that we are iterating a buffer.
12359 (push_it, pop_it): Save and restore paragraph_embedding member.
12360 (handle_single_display_spec, next_overlay_string)
12361 (get_overlay_strings_1, reseat_1, reseat_to_string)
12362 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12363 correctly. Don't assume unibyte strings are not bidi-reordered.
12364 (compute_display_string_pos)
12365 (compute_display_string_end): Fix handling the case of C string.
12366 (push_it, pop_it): Save and restore from_disp_prop_p.
12367 (handle_single_display_spec, push_display_prop): Set the
12368 from_disp_prop_p flag.
12369 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12370 (pop_it): Call iterate_out_of_display_property only if we are
12371 popping after iteration over a string that came from a display
12372 property. Fix a typo in popping stretch info. Add an assertion
12373 for verifying that the iterator position is in sync with the bidi
12375 (handle_single_display_spec, get_overlay_strings_1)
12376 (push_display_prop): Fix initialization of paragraph direction for
12377 string when that of the parent object is not yet determined.
12378 (reseat_1): Call bidi_init_it to resync the bidi
12379 iterator with IT's position. (Bug#7616)
12380 (find_row_edges): If ROW->start.pos gives position
12381 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12382 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12383 Reset the from_disp_prop_p flag.
12384 (SAVE_IT, RESTORE_IT): New macros.
12385 (pos_visible_p, face_before_or_after_it_pos)
12386 (back_to_previous_visible_line_start)
12387 (move_it_in_display_line_to, move_it_in_display_line)
12388 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12389 (try_scrolling, redisplay_window, display_line): Use them when
12390 saving a temporary copy of the iterator and restoring it back.
12391 (back_to_previous_visible_line_start, reseat_1)
12392 (init_iterator): Empty the bidi cache "stack".
12393 (move_it_in_display_line_to): If iterator ended up at
12394 EOL, but we never saw any buffer positions smaller than
12395 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12396 motion in bidi-reordered lines.
12397 (move_it_in_display_line_to): Record prev_method and prev_pos
12398 immediately before the call to set_iterator_to_next. Fixes cursor
12399 motion in bidi-reordered lines with stretch glyphs and strings
12400 displayed in margins. (Bug#8133) (Bug#8867)
12401 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12403 (pos_visible_p): Support positions in bidi-reordered lines.
12404 Save and restore bidi cache.
12406 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12407 (bidi_paragraph_info): Delete unused struct.
12408 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12409 (bidi_cache_start): New variable.
12410 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12412 (bidi_cache_fetch_state, bidi_cache_search)
12413 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12414 (bidi_cache_find, bidi_peek_at_next_level)
12415 (bidi_level_of_next_char, bidi_find_other_level_edge)
12416 (bidi_move_to_visually_next): Compare cache index with
12417 bidi_cache_start rather than with zero.
12418 (bidi_fetch_char): Accept new argument STRING; all callers
12419 changed. Support iteration over a string. Support strings with
12420 display properties. Support unibyte strings. Fix the type of
12421 `len' according to what STRING_CHAR_AND_LENGTH expects.
12422 (bidi_paragraph_init, bidi_resolve_explicit_1)
12423 (bidi_resolve_explicit, bidi_resolve_weak)
12424 (bidi_level_of_next_char, bidi_move_to_visually_next):
12425 Support iteration over a string.
12426 (bidi_set_sor_type, bidi_resolve_explicit_1)
12427 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12428 can now be zero (for strings); special values 0 and -1 were
12429 changed to -1 and -2, respectively.
12430 (bidi_char_at_pos): New function.
12431 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12432 Call it instead of FETCH_MULTIBYTE_CHAR.
12433 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12434 initialized to valid values.
12435 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12437 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12438 the test for valid cached positions. Fix the logic for looking up
12439 the sentinel state in the cache. GCPRO the Lisp string we are
12441 (bidi_push_it, bidi_pop_it): New functions.
12442 (bidi_initialize): Initialize the bidi cache start stack pointer.
12443 (bidi_cache_ensure_space): New function, refactored from part of
12444 bidi_cache_iterator_state. Don't assume the required size is just
12445 one BIDI_CACHE_CHUNK away.
12446 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12447 (bidi_count_bytes, bidi_char_at_pos): New functions.
12448 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12449 always valid if bidi_cache_idx is valid.
12450 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12451 is valid if it's going to be used.
12452 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12453 (bidi_cache_fetch_state, bidi_cache_search)
12454 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12455 (bidi_cache_iterator_state, bidi_cache_find)
12456 (bidi_find_other_level_edge, bidi_cache_start_stack):
12457 All variables related to cache indices are now EMACS_INT.
12459 * dispextern.h (struct bidi_string_data): New structure.
12460 (struct bidi_it): New member `string'. Make flag members be 1-bit
12461 fields, and put them last in the struct.
12462 (compute_display_string_pos, compute_display_string_end):
12464 (bidi_push_it, bidi_pop_it): Add prototypes.
12465 (struct iterator_stack_entry): New members bidi_p,
12466 paragraph_embedding, and from_disp_prop_p.
12467 (struct it): Member bidi_p is now a bit field 1 bit wide.
12468 (bidi_shelve_cache, bidi_unshelve_cache):
12469 Declare prototypes.
12471 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12472 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12473 and vector-like objects.
12475 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12476 cache around display iteration.
12478 * window.c (Fwindow_end, window_scroll_pixel_based)
12479 (displayed_window_lines, Frecenter): Save and restore the bidi
12480 cache around display iteration.
12482 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12484 * editfns.c (Fdelete_region): Clarify the use of the named
12485 parameters (bug#6788).
12487 2011-07-14 Martin Rudalics <rudalics@gmx.at>
12489 * indent.c (Fvertical_motion): Set and restore w->pointm when
12490 saving and restoring the window's buffer (Bug#9006).
12492 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12494 * editfns.c (Fstring_to_char): Clarify just what is returned
12495 (bug#6576). Text by Eli Zaretskii.
12497 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
12499 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12501 2011-07-13 Eli Zaretskii <eliz@gnu.org>
12503 * buffer.c (mmap_find): Fix a typo.
12505 2011-07-13 Johan Bockgård <bojohan@gnu.org>
12507 Fix execution of x selection hooks.
12508 * xselect.c (Qx_lost_selection_functions)
12509 (Qx_sent_selection_functions): New vars.
12510 (syms_of_xselect): DEFSYM them.
12511 (x_handle_selection_request): Pass Qx_sent_selection_functions
12512 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12513 (x_handle_selection_clear,x_clear_frame_selections):
12514 Pass Qx_lost_selection_functions rather than
12515 Vx_lost_selection_functions to Frun_hook_with_args.
12517 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12519 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12520 The old code sometimes used this field without initializing it.
12522 * alloc.c (gc_sweep): Don't read past end of array.
12523 In theory, the old code could also have corrupted Emacs internals,
12524 though it'd be very unlikely.
12526 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12528 * character.c (Fcharacterp): Don't advertise optional ignored
12529 argument. (Bug#4026)
12531 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12533 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12536 * window.c (Fset_window_start): Doc fix (bug#4199).
12537 (Fset_window_hscroll): Ditto.
12539 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12541 Fix minor new problems caught by GCC 4.6.1.
12542 * term.c (init_tty): Remove unused local.
12543 * xsettings.c (store_monospaced_changed): Define this function only
12544 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12545 not used otherwise.
12547 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
12549 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12551 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12553 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12554 are the mini-buffer and the echo area (bug#3320).
12556 * term.c (init_tty): Remove support for supdup, c10 and perq
12557 terminals, which are no longer supported (bug#1482).
12559 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12561 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12563 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12565 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12566 for non-popups (Bug#3642).
12568 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12570 * alloc.c (reset_malloc_hooks): Protoize.
12571 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12572 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12573 * cm.c (losecursor): Likewise.
12574 * data.c (fmod): Likewise.
12575 * dispnew.c (swap_glyphs_in_rows): Likewise.
12576 * emacs.c (memory_warning_signal): Likewise.
12577 * floatfns.c (float_error): Likewise.
12578 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12579 (otf_open, font_otf_capability, generate_otf_features)
12580 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12582 * image.c (pbm_read_file): Likewise.
12583 * indent.c (string_display_width): Likewise.
12584 * intervals.c (check_for_interval, search_for_interval)
12585 (inc_interval_count, count_intervals, root_interval)
12586 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12587 * lread.c (defalias): Likewise.
12588 * ralloc.c (r_alloc_check): Likewise.
12589 * regex.c (set_image_of_range_1, set_image_of_range)
12590 (regex_grow_registers): Likewise.
12591 * sysdep.c (strerror): Likewise.
12592 * termcap.c (valid_filename_p, tprint, main): Likewise.
12593 * tparam.c (main): Likewise.
12594 * unexhp9k800.c (run_time_remap, save_data_space)
12595 (update_file_ptrs, read_header, write_header, calculate_checksum)
12596 (copy_file, copy_rest, display_header): Likewise.
12597 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12599 * xdisp.c (check_it): Likewise.
12600 * xfaces.c (register_color, unregister_color, unregister_colors):
12602 * xfns.c (print_fontset_result): Likewise.
12603 * xrdb.c (member, fatal, main): Likewise.
12605 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12607 Fix minor problems found by static checking (Bug#9031).
12608 * chartab.c (char_table_set_range, map_sub_char_table):
12609 Remove unused locals.
12610 (uniprop_table): Now static.
12611 * composite.c (_work_char): Remove unused static var.
12613 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12615 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12617 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12619 * gtkutil.c (qttip_cb): Remove code without function.
12621 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12623 * w32.c (pthread_sigmask): New stub.
12625 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12627 Use pthread_sigmask, not sigprocmask (Bug#9010).
12628 sigprocmask is portable only for single-threaded applications, and
12629 Emacs can be multi-threaded when it uses GTK.
12630 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12632 * callproc.c (Fcall_process):
12633 * process.c (create_process):
12634 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12635 Use pthread_sigmask, not sigprocmask.
12637 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12639 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12640 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12643 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12645 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12646 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12647 (xg_hide_tooltip): Fix comment.
12649 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12650 in registerServicesMenuSendTypes.
12651 (validRequestorForSendType): Don't check ns_return_types.
12653 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12656 2011-07-08 Jason Rumney <jasonr@gnu.org>
12658 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12659 SH_SHOW for hidden windows (Bug#5482).
12661 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12662 frame struct members of non-existent frames (Bug#6284).
12664 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12666 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12667 variable firstTime not needed on OSX >= 10.6.
12668 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12669 >= 10.5. Use setKnobProportion, setDoubleValue.
12671 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12672 (MAC_OS_X_VERSION_10_5): Define if not defined.
12673 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12674 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12675 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12677 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12678 cString and lossyCString on OSX >= 10.4.
12680 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12681 sizeToFit on OSX >= 10.2.
12683 * nsimage.m (allocInitFromFile): Don't use deprecated method
12684 bestRepresentationForDevice on OSX >= 10.6.
12686 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12689 * emacs.c: Declare unexec_init_emacs_zone.
12691 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12693 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12695 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12696 on svcsMenu (Bug#8842).
12698 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12700 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12702 * nsterm.m (QUTF8_STRING): Declare.
12703 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12704 (validRequestorForSendType): Return type is (id).
12705 Change indexOfObjectIdenticalTo to indexOfObject.
12706 Check if we have local selection before returning self (Bug#8842).
12707 (writeSelectionToPasteboard): Put local selection into paste board
12708 if we have a local selection (Bug#8842).
12709 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12711 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12712 (ns_get_local_selection): Declare.
12714 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12716 * keymap.c (describe_map_tree): Don't insert a double newline at
12717 the end of the buffer (bug#1169) and return whether we inserted
12720 * callint.c (Fcall_interactively): Change "reading args" to
12721 "providing args" to try to clarify what it does (bug#1010).
12723 2011-07-07 Kenichi Handa <handa@m17n.org>
12725 * composite.c (composition_compute_stop_pos): Ignore a static
12726 composition starting before CHARPOS (Bug#8915).
12728 * xdisp.c (handle_composition_prop): Likewise.
12730 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12732 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12735 2011-07-07 Kenichi Handa <handa@m17n.org>
12737 * character.h (unicode_category_t): New enum type.
12739 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12740 (Qchar_code_property_table): New variable.
12741 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12742 (UNIPROP_COMPRESSED_FORM_P): New macros.
12743 (char_table_ascii): Uncompress the compressed values.
12744 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12745 Uncompress the compressed values.
12746 (sub_char_table_ref_and_range): Likewise.
12747 (char_table_ref_and_range): Uncompress the compressed values.
12748 (sub_char_table_set): New arg is_uniprop. Callers changed.
12749 Uncompress the compressed values.
12750 (sub_char_table_set_range): Args changed. Callers changed.
12751 (char_table_set_range): Adjuted for the above change.
12752 (map_sub_char_table): Delete args default_val and parent. Add arg
12753 top. Give decoded values to a Lisp function.
12754 (map_char_table): Adjust for the above change. Give decoded
12755 values to a Lisp function. Gcpro more variables.
12756 (uniprop_table_uncompress)
12757 (uniprop_decode_value_run_length): New functions.
12758 (uniprop_decoder, uniprop_decoder_count): New variables.
12759 (uniprop_get_decoder, uniprop_encode_value_character)
12760 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12762 (uniprop_encoder, uniprop_encoder_count): New variables.
12763 (uniprop_get_encoder, uniprop_table)
12764 (Funicode_property_table_internal, Fget_unicode_property_internal)
12765 (Fput_unicode_property_internal): New functions.
12766 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12767 Sunicode_property_table_internal, Sget_unicode_property_internal,
12768 and Sput_unicode_property_internal. Defvar_lisp
12769 char-code-property-alist.
12771 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12772 Vunicode_category_table.
12774 * font.c (font_range): Adjust for the change of
12775 Vunicode_category_table.
12777 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12779 * m/iris4d.h: Remove file, move contents ...
12780 * s/irix6-5.h: ... here.
12782 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12784 Remove unportable assumption about struct layout (Bug#8884).
12785 * alloc.c (mark_buffer):
12786 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12787 (clone_per_buffer_values): Don't assume that
12788 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12789 This isn't true in general, and it's particularly not true
12790 if Emacs is configured with --with-wide-int.
12791 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12792 New macros, used in the buffer.c change.
12794 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12796 * xsettings.c: Use both GConf and GSettings if both are available.
12797 (store_config_changed_event): Add comment.
12798 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12799 (store_tool_bar_style_changed): New functions.
12800 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12801 (struct xsettings): Move font inside HAVE_XFT.
12802 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12803 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12804 Move inside HAVE_XFT.
12805 (something_changed_gsettingsCB): Rename from something_changedCB.
12806 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12808 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12809 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12810 (something_changed_gconfCB): Rename from something_changedCB.
12811 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12812 (parse_settings): Move check for font inside HAVE_XFT.
12813 (read_settings, apply_xft_settings): Add comment.
12814 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12815 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12816 call store_font_name_changed.
12817 (xft_settings_event): Add comment.
12818 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12819 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12820 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12821 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12822 (xsettings_initialize): Call init_gsettings last.
12823 (xsettings_get_system_font, xsettings_get_system_normal_font):
12826 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12828 Random fixes. E.g., (random) never returned negative values.
12829 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12830 subseconds part to the entropy, as that's a bit more random.
12831 Prefer signed to unsigned, since the signedness doesn't matter and
12832 in general we prefer signed. When given a limit, use a
12833 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12834 latter isn't right if USE_2_TAGS_FOR_INTS.
12835 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12836 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12838 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12840 * textprop.c (text_property_stickiness):
12841 Obey Vtext_property_default_nonsticky.
12842 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12843 * w32fns.c (syms_of_w32fns):
12844 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12846 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12848 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12849 This is more efficient than Ffile_directory_p and avoids a minor race.
12851 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12853 * buffer.c (Foverlay_put): Say what the return value is
12856 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12857 is a directory before asking whether to use the file name
12859 (barf_or_query_if_file_exists): Make the "File is a directory"
12860 error be more correct.
12862 * fns.c (Frequire): Remove the mention of the .gz files, since
12863 that's installation-specific, but keep the mention of
12864 `get-load-suffixes'.
12866 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12868 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12869 Report string overflow if the output is too long.
12871 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12873 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12874 (syms_of_gnutls): Remove duplicate DEFSYM for
12875 Qgnutls_bootprop_verify_hostname_error, an error for
12876 Qgnutls_bootprop_verify_error (which is no longer used).
12878 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12879 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12880 Also (re)move comments that are misplaced or no longer relevant.
12882 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12884 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12886 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12888 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12889 and background color parameters if they have been changed.
12891 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12893 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12895 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12897 * xsettings.c (SYSTEM_FONT): Define only when used.
12898 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12900 * keymap.c (access_keymap_1): Now static.
12902 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12904 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12905 leave any prefix arg for the up event (Bug#1586).
12907 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12909 * lread.c (syms_of_lread): Mention single symbols defined by
12910 `defvar' or `defconst' (bug#7154).
12912 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12913 (Frequire): Mention get-load-suffixes.
12915 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12917 * window.h (window): Remove clone_number slot.
12918 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12920 (make_parent_window, make_window, saved_window)
12921 (Fset_window_configuration, save_window_save): Don't deal with
12923 * buffer.c (Qclone_number): Remove declaration.
12924 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12926 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12928 Add multiple inheritance to keymaps.
12929 * keymap.c (Fmake_composed_keymap): New function.
12930 (Fset_keymap_parent): Simplify.
12931 (fix_submap_inheritance): Remove.
12932 (access_keymap_1): New function extracted from access_keymap to handle
12933 embedded parents and handle lists of maps.
12934 (access_keymap): Use it.
12935 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12936 (Fcopy_keymap): Handle embedded parents.
12937 (Fcommand_remapping, define_as_prefix): Simplify.
12938 (Fkey_binding): Simplify.
12939 (syms_of_keymap): Move minibuffer-local-completion-map,
12940 minibuffer-local-filename-completion-map,
12941 minibuffer-local-must-match-map, and
12942 minibuffer-local-filename-must-match-map to Elisp.
12943 (syms_of_keymap): Defsubr make-composed-keymap.
12944 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12945 (parse_menu_item): Trivial simplification.
12947 2011-07-01 Glenn Morris <rgm@gnu.org>
12949 * Makefile.in (SETTINGS_LIBS): Fix typo.
12951 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12953 * coding.c (Fencode_coding_string): Record the last coding system
12954 used, as the function doc string says (bug#8738).
12956 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12958 * xsettings.c (store_monospaced_changed): Take new font as arg and
12959 check for change against current_mono_font.
12960 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12961 (emacs_settings_constructor, emacs_settings_get_property)
12962 (emacs_settings_set_property, emacs_settings_class_init)
12963 (emacs_settings_init, gsettings_obj): Remove.
12964 (something_changedCB): New function for HAVE_GSETTINGS.
12965 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12966 with value as argument.
12967 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12968 g_settings_new (Bug#8967). Do not create gsettings_obj.
12969 Remove calls to g_settings_bind. Connect something_changedCB to
12972 * xgselect.c: Add defined (HAVE_GSETTINGS).
12973 (xgselect_initialize): Ditto.
12975 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12976 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12979 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12981 * eval.c (struct backtrace): Simplify and port the data structure.
12982 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12983 signed bit field, as this assumption is not portable and it makes
12984 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12985 "char debug_on_exit : 1" as this is not portable either; instead,
12986 use the portable "unsigned int debug_on_exit : 1". Remove unused
12987 member evalargs. Remove obsolete comments about cc bombing out.
12989 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12991 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12992 Let HAVE_GSETTINGS override HAVE_GCONF.
12993 (store_monospaced_changed): New function.
12994 (EMACS_SETTINGS): A new type derived from GObject to handle
12995 GSettings notifications.
12996 (emacs_settings_constructor, emacs_settings_get_property)
12997 (emacs_settings_set_property, emacs_settings_class_init):
12999 (gsettings_client, gsettings_obj): New variables.
13000 (GSETTINGS_SCHEMA): New define.
13001 (something_changedCB): Call store_monospaced_changed.
13002 (init_gsettings): New function.
13003 (xsettings_initialize): Call init_gsettings.
13004 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13007 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13010 2011-06-29 Martin Rudalics <rudalics@gmx.at>
13012 * window.c (resize_root_window, grow_mini_window)
13013 (shrink_mini_window): Rename Qresize_root_window to
13014 Qwindow_resize_root_window and Qresize_root_window_vertically to
13015 Qwindow_resize_root_window_vertically.
13017 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13019 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13021 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
13023 * makefile.w32-in: Redesign dependencies so they reflect more
13024 clearly which files are directly included by each source file,
13025 and not through other includes.
13027 2011-06-27 Martin Rudalics <rudalics@gmx.at>
13029 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13030 (sort_overlays, overlay_strings): When an overlay's clone number
13031 matches the window's clone number process the overlay even if
13032 the overlay's window property doesn't match the current window.
13034 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13035 (Fwindow_hchild): Rename to Fwindow_left_child.
13036 (Fwindow_next): Rename to Fwindow_next_sibling.
13037 (Fwindow_prev): Rename to Fwindow_prev_sibling.
13038 (resize_window_check): Rename to window_resize_check.
13039 (resize_window_apply): Rename to window_resize_apply.
13040 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13041 (Fdelete_other_windows_internal, resize_frame_windows)
13042 (Fsplit_window_internal, Fdelete_window_internal)
13043 (grow_mini_window, shrink_mini_window)
13044 (Fresize_mini_window_internal): Fix callers accordingly.
13046 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13048 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13049 (emacs_fixed_set_min_size): Remove.
13050 (emacs_fixed_new): Take frame as argument.
13052 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13053 (_EmacsFixedPrivate): Remove minwidth/height.
13054 Add struct frame *f.
13055 (emacs_fixed_init): Initialize priv->f.
13056 (get_parent_class, emacs_fixed_set_min_size): Remove.
13057 (emacs_fixed_new): Set priv->f to argument.
13058 (emacs_fixed_get_preferred_width)
13059 (emacs_fixed_get_preferred_height): Use min_width/height from
13060 frames size_hint to set minimum and natural (Bug#8919).
13061 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13062 and use min_width/height from frames size_hint to set
13063 min_width/height (Bug#8919).
13065 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13066 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13069 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13071 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13072 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13075 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13077 * process.c (wait_reading_process_output): Bypass select if
13078 waiting for a cell while ignoring keyboard input, and input is
13079 pending. Suggested by Jan Djärv (Bug#8869).
13081 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13083 Use gnulib's dup2 module instead of rolling our own.
13084 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13086 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13088 * dispnew.c (scrolling_window): Before scrolling, turn off a
13089 mouse-highlight in the window being scrolled.
13091 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13093 Move DEFSYM to lisp.h and use everywhere.
13095 * character.h (DEFSYM): Move declaration...
13096 * lisp.h (DEFSYM): ...here.
13102 * w32select.c: Don't include character.h.
13104 * alloc.c (syms_of_alloc):
13105 * buffer.c (syms_of_buffer):
13106 * bytecode.c (syms_of_bytecode):
13107 * callint.c (syms_of_callint):
13108 * casefiddle.c (syms_of_casefiddle):
13109 * casetab.c (init_casetab_once):
13110 * category.c (init_category_once, syms_of_category):
13111 * ccl.c (syms_of_ccl):
13112 * cmds.c (syms_of_cmds):
13113 * composite.c (syms_of_composite):
13114 * dbusbind.c (syms_of_dbusbind):
13115 * dired.c (syms_of_dired):
13116 * dispnew.c (syms_of_display):
13117 * doc.c (syms_of_doc):
13118 * editfns.c (syms_of_editfns):
13119 * emacs.c (syms_of_emacs):
13120 * eval.c (syms_of_eval):
13121 * fileio.c (syms_of_fileio):
13122 * fns.c (syms_of_fns):
13123 * frame.c (syms_of_frame):
13124 * fringe.c (syms_of_fringe):
13125 * insdel.c (syms_of_insdel):
13126 * keymap.c (syms_of_keymap):
13127 * lread.c (init_obarray, syms_of_lread):
13128 * macros.c (syms_of_macros):
13129 * msdos.c (syms_of_msdos):
13130 * print.c (syms_of_print):
13131 * process.c (syms_of_process):
13132 * search.c (syms_of_search):
13133 * sound.c (syms_of_sound):
13134 * syntax.c (init_syntax_once, syms_of_syntax):
13135 * terminal.c (syms_of_terminal):
13136 * textprop.c (syms_of_textprop):
13137 * undo.c (syms_of_undo):
13138 * w32.c (globals_of_w32):
13139 * window.c (syms_of_window):
13140 * xdisp.c (syms_of_xdisp):
13141 * xfaces.c (syms_of_xfaces):
13142 * xfns.c (syms_of_xfns):
13143 * xmenu.c (syms_of_xmenu):
13144 * xsettings.c (syms_of_xsettings):
13145 * xterm.c (syms_of_xterm): Use DEFSYM.
13147 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13149 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13151 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13153 Integer and buffer overflow fixes (Bug#8873).
13155 * print.c (printchar, strout): Check for string overflow.
13156 (PRINTPREPARE, printchar, strout):
13157 Don't set size unless allocation succeeds.
13159 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13160 for sizes. Check for string overflow more accurately.
13161 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13163 * macros.c: Integer and buffer overflow fixes.
13164 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13165 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13166 Use ptrdiff_t, not int, for sizes.
13167 Don't increment bufsize until after realloc succeeds.
13168 Check for size-calculation overflow.
13169 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13171 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13173 * lread.c: Integer overflow fixes.
13174 (read_integer): Radix is now EMACS_INT, not int,
13175 to improve quality of diagnostics for out-of-range radices.
13176 Calculate buffer size correctly for out-of-range radices.
13177 (read1): Check for integer overflow in radices, and in
13178 read-circle numbers.
13179 (read_escape): Avoid int overflow.
13180 (Fload, openp, read_buffer_size, read1)
13181 (substitute_object_recurse, read_vector, read_list, map_obarray):
13182 Use ptrdiff_t, not int, for sizes.
13183 (read1): Use EMACS_INT, not int, for sizes.
13184 Check for size overflow.
13186 * image.c (cache_image): Check for size arithmetic overflow.
13188 * lread.c: Integer overflow issues.
13189 (saved_doc_string_size, saved_doc_string_length)
13190 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13191 Now ptrdiff_t, not int.
13192 (read1): Don't assume doc string length fits in int. Check for
13193 out-of-range doc string lengths.
13194 (read_list): Don't assume file position fits in int.
13195 (read_escape): Check for hex character overflow.
13197 2011-06-22 Leo Liu <sdl.web@gmail.com>
13199 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13200 Move to minibuffer.el.
13202 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13204 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13205 The following patches are for when GLYPH_DEBUG && !XASSERT.
13206 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13207 * dispnew.c (flush_stdout):
13208 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13209 Mark as externally visible.
13210 * dispnew.c (check_window_matrix_pointers): Now static.
13211 * dispnew.c (window_to_frame_vpos):
13212 * xfns.c (unwind_create_frame):
13213 * xterm.c (x_check_font): Remove unused local.
13214 * scroll.c (CHECK_BOUNDS):
13215 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13216 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13217 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13218 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13219 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13221 (debug_method_add): Use va_list and vsprintf rather than relying
13222 on undefined behavior with wrong number of arguments.
13223 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13224 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13225 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13226 since we're not interested in debugging glyphs with old libraries.
13227 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13228 GCC 4.6.0's static checking.
13230 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13232 Integer overflow and signedness fixes (Bug#8873).
13233 A few related buffer overrun fixes, too.
13235 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13237 * dispextern.h (struct face.stipple):
13238 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13239 (x_bitmap_mask, x_allocate_bitmap_record)
13240 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13241 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13242 (x_create_bitmap_from_xpm_data):
13243 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13244 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13246 * xfaces.c (load_pixmap):
13247 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13248 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13249 (.bitmaps_last, struct x_output.icon_bitmap):
13250 Use ptrdiff_t, not int, for bitmap indexes.
13251 (x_allocate_bitmap_record): Check for size overflow.
13252 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13254 Use ptrdiff_t, not int, for overlay counts.
13255 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13256 * editfns.c (overlays_around, get_pos_property):
13257 * textprop.c (get_char_property_and_overlay):
13258 * xdisp.c (next_overlay_change, note_mouse_highlight):
13259 * xfaces.c (face_at_buffer_position):
13260 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13261 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13262 (Fnext_overlay_change, Fprevious_overlay_change)
13263 (mouse_face_overlay_overlaps, Foverlays_in):
13264 Use ptrdiff_t, not int, for sizes.
13265 (overlays_at, overlays_in): Check for size-calculation overflow.
13267 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13269 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13270 (x_session_initialize): Do not assume string length fits in int.
13272 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13273 This is unlikely, but can occur if DPI is outlandish.
13275 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13276 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13278 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13279 * xrdb.c (magic_file_p, search_magic_path):
13280 Omit last arg SUFFIX; it was always 0. All callers changed.
13281 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13283 * xfont.c (xfont_match): Avoid need for strlen.
13285 * xfns.c: Don't assume strlen fits in int.
13286 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13288 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13289 not unsigned long, as we prefer signed integers. All callers changed.
13290 Detect integer overflow in repeat count.
13291 (message_dolog): Don't assume print length fits in 39 bytes.
13292 (display_mode_element): Don't assume strlen fits in int.
13294 * termcap.c: Don't assume sizes fit in int and never overflow.
13295 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13296 (gobble_line): Check for size-calculation overflow.
13298 * minibuf.c (Fread_buffer):
13299 * lread.c (intern, intern_c_string):
13300 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13301 Don't assume string length fits in int.
13303 * keyboard.c (parse_tool_bar_item):
13304 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13306 * font.c: Don't assume string length fits in int.
13307 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13308 Use ptrdiff_t, not int.
13309 (font_intern_prop): Don't assume string length fits in int.
13310 Don't assume integer property fits in fixnum.
13311 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13313 * filelock.c: Fix some buffer overrun and integer overflow issues.
13314 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13315 Reformulate so as not to need the command string.
13316 Invoke gzip -cd rather than gunzip, as it's more portable.
13317 (lock_info_type, lock_file_1, lock_file):
13318 Don't assume pid_t and time_t fit in unsigned long.
13319 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13320 (current_lock_owner): Prefer signed type for sizes.
13321 Use memcpy, not strncpy, where memcpy is what is really wanted.
13322 Don't assume (via atoi) that time_t and pid_t fit in int.
13323 Check for time_t and/or pid_t out of range, e.g., via a network share.
13324 Don't alloca where an auto var works fine.
13326 * fileio.c: Fix some integer overflow issues.
13327 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13328 Don't assume string length fits in int.
13329 (directory_file_name): Don't assume string length fits in long.
13330 (make_temp_name): Don't assume pid fits in int, or that its print
13331 length is less than 20.
13333 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13335 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13337 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13339 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13340 We prefer signed integers, even for size calculations.
13342 * emacs.c: Don't assume string length fits in 'int'.
13343 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13344 (main): Don't invoke strlen when not needed.
13346 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13347 (XD_DEBUG_MESSAGE): Don't waste a byte.
13349 * callproc.c (getenv_internal_1, getenv_internal)
13350 (Fgetenv_internal):
13351 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13353 * lread.c (invalid_syntax): Omit length argument.
13354 All uses changed. This doesn't fix a bug, but it simplifies the
13355 code away from its former Hollerith-constant appearance, and it's
13356 one less 'int' to worry about when looking at integer-overflow issues.
13357 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13359 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13360 This didn't break anything, but it didn't help either.
13361 It's confusing to put a bogus integer in a place where the actual
13362 value does not matter.
13363 (LIST_END_P): Remove unused macro and its bogus comment.
13364 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13366 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13367 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13369 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13370 We prefer signed types, and the value cannot exceed the EMACS_INT
13371 range anyway (because otherwise the length would not be representable).
13372 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13373 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13374 This avoids a GCC warning when WIDE_EMACS_INT.
13376 * indent.c (sane_tab_width): New function.
13377 (current_column, scan_for_column, Findent_to, position_indentation)
13378 (compute_motion): Use it. This is just for clarity.
13379 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13381 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13383 * lisp.h (lint_assume): New macro.
13384 * composite.c (composition_gstring_put_cache):
13385 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13387 * editfns.c, insdel.c:
13388 Omit unnecessary forward decls, to simplify future changes.
13390 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13392 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13394 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13395 Use much-faster test for byte-length change.
13396 Don't assume string byte-length fits in 'int'.
13397 Check that character arg fits in 'int'.
13398 (mapcar1): Declare byte as byte, for clarity.
13400 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13402 * fns.c (concat): Catch string overflow earlier.
13403 Do not rely on integer wraparound.
13405 * dispextern.h (struct it.overlay_strings_charpos)
13406 (struct it.selective): Now EMACS_INT, not int.
13407 * xdisp.c (forward_to_next_line_start)
13408 (back_to_previous_visible_line_start)
13409 (reseat_at_next_visible_line_start, next_element_from_buffer):
13410 Don't arbitrarily truncate the value of 'selective' to int.
13412 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13414 * composite.c: Don't truncate sizes to 'int'.
13415 (composition_gstring_p, composition_reseat_it)
13416 (composition_adjust_point): Use EMACS_INT, not int.
13417 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13418 not EMACS_UINT, for indexes.
13420 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13422 * buffer.c: Include <verify.h>.
13423 (struct sortvec.priority, struct sortstr.priority):
13424 Now EMACS_INT, not int.
13425 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13426 (struct sortstr.size, record_overlay_string)
13427 (struct sortstrlist.size, struct sortlist.used):
13428 Don't truncate size to int.
13429 (record_overlay_string): Check for size-calculation overflow.
13430 (init_buffer_once): Check at compile-time, not run-time.
13432 2011-06-22 Jim Meyering <meyering@redhat.com>
13434 Don't leak an XBM-image-sized buffer
13435 * image.c (xbm_load): Free the image buffer after using it.
13437 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13440 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13441 that Sun C diagnosed.
13442 * fns.c (secure_hash): Fix pointer signedness issue.
13443 * intervals.c (static_offset_intervals): New function.
13444 (offset_intervals): Use it.
13446 2011-06-21 Leo Liu <sdl.web@gmail.com>
13449 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13452 * fns.c (secure_hash): Rename from crypto_hash_function and change
13453 the first arg to accept symbols.
13454 (Fsecure_hash): New primitive.
13455 (syms_of_fns): New symbols.
13457 2011-06-20 Deniz Dogan <deniz@dogan.se>
13459 * process.c (Fset_process_buffer): Clarify return value in
13462 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
13464 * dispnew.c (add_window_display_history): Use BVAR.
13466 * xdisp.c (debug_method_add): Use BVAR.
13467 (check_window_end, dump_glyph_matrix, dump_glyph)
13468 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13470 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13473 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13474 check till after the cache is created in init_frame_faces.
13476 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13478 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13480 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13482 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13483 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13484 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13486 Improve buffer-overflow checking (Bug#8873).
13487 * fileio.c (Finsert_file_contents):
13488 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13489 Remove the old (too-loose) buffer overflow checks.
13490 They weren't needed, since make_gap checks for buffer overflow.
13491 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13492 The old code merely checked for Emacs fixnum overflow, and relied
13493 on undefined (wraparound) behavior. The new code avoids undefined
13494 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13496 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13497 Tune. Don't use wider integers than needed. Don't use alloca.
13498 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13500 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13502 * insdel.c, lisp.h (buffer_overflow): New function.
13503 (insert_from_buffer_1, replace_range, replace_range_2):
13504 * insdel.c (make_gap_larger):
13505 * editfns.c (Finsert_char):
13506 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13508 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13510 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13512 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13514 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13515 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13517 * fileio.c: Don't assume EMACS_INT fits in off_t.
13518 (emacs_lseek): New static function.
13519 (Finsert_file_contents, Fwrite_region): Use it.
13520 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13522 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13524 * fns.c: Don't overflow int when computing a list length.
13525 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13526 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13527 truncation on 64-bit hosts. Check for QUIT every
13528 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13529 faster and is responsive enough.
13530 (Flength): Report an error instead of overflowing an integer.
13531 (Fsafe_length): Return a float if the value is not representable
13532 as a fixnum. This shouldn't happen except in contrived situations.
13533 (Fnthcdr, Fsort): Don't assume list length fits in int.
13534 (Fcopy_sequence): Don't assume vector length fits in int.
13536 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13537 (header_size, word_size): New constants.
13538 (allocate_vectorlike): Don't check size overflow here.
13539 (allocate_vector): Check it here instead, since this is the only
13540 caller of allocate_vectorlike that could cause overflow.
13541 Check that the new vector's length is representable as a fixnum.
13543 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13544 The previous code was bogus. For example, next_almost_prime (32)
13545 returned 39, which is undesirable as it is a multiple of 3; and
13546 next_almost_prime (24) returned 25, which is a multiple of 5 so
13547 why was the code bothering to check for multiples of 7?
13549 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13551 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13553 Variadic C functions now count arguments with ptrdiff_t.
13554 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13555 Back then I didn't know that the Emacs coding style prefers signed int.
13556 Also, in the meantime I found a few more instances where arguments
13557 were being counted with int, which may truncate counts on 64-bit
13558 machines, or EMACS_INT, which may be unnecessarily wide.
13559 * lisp.h (struct Lisp_Subr.function.aMANY)
13560 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13561 Arg counts are now ptrdiff_t, not size_t.
13562 All variadic functions and their callers changed accordingly.
13563 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13564 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13565 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13566 * callint.c (Fcall_interactively): Check arg count for overflow,
13567 to avoid potential buffer overrun. Use signed char, not 'int',
13568 for 'varies' array, so that we needn't bother to check its size
13569 calculation for overflow.
13570 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13571 * eval.c (apply_lambda):
13572 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13573 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13574 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13576 * callint.c (Fcall_interactively): Don't use index var as event count.
13578 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13579 * mem-limits.h (SIZE): Remove; no longer used.
13581 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13583 Remove unnecessary casts.
13584 * xterm.c (x_term_init):
13585 * xfns.c (x_set_border_pixel):
13586 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13587 These aren't needed now that we assume ANSI C.
13589 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13590 It's more likely to cause problems (due to unsigned overflow)
13593 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13595 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13597 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13599 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13601 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13603 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13605 GLYPH_CODE_FACE returns EMACS_INT, not int.
13606 * dispextern.h (merge_faces):
13607 * xfaces.c (merge_faces):
13608 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13609 Don't assume EMACS_INT fits in int.
13611 * character.h (CHAR_VALID_P): Remove unused parameter.
13612 * fontset.c, lisp.h, xdisp.c: All uses changed.
13614 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13616 * fns.c (concat): Minor tuning based on overflow analysis.
13617 This doesn't fix any bugs. Use int to hold character, instead
13618 of constantly refetching from Emacs object. Use XFASTINT, not
13619 XINT, for value known to be a character. Don't bother comparing
13620 a single byte to 0400, as it's always less.
13622 * floatfns.c (Fexpt):
13623 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13625 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13628 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13630 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13631 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13632 incorrectly succeed when S was a string, because 4294967386 was
13633 truncated before it was used.
13635 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13636 Otherwise, an out-of-range integer could cause undefined behavior
13639 * composite.c: Use int, not EMACS_INT, for characters.
13640 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13641 EMACS_INT, for values that are known to be in character range.
13642 This doesn't fix any bugs but is the usual style inside Emacs and
13643 may generate better code on 32-bit machines.
13645 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13646 This is for reasons similar to the recent CHAR_STRING fix.
13647 * charset.c (Fencode_char): Check that character arg is actually
13648 a character. Pass an int to ENCODE_CHAR.
13649 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13650 wider than 'int', as a compile-time check to prevent future regressions
13653 * character.c (char_string): Remove unnecessary casts.
13655 Make sure a 64-bit char is never passed to CHAR_STRING.
13656 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13657 by silently ignoring the top 32 bits, allowing some values
13658 that were far too large to be valid characters.
13659 * character.h: Include <verify.h>.
13660 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13661 arguments are no wider than unsigned, as a compile-time check
13662 to prevent future regressions in this area.
13664 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13665 (Fsubst_char_in_region):
13667 * xdisp.c (decode_mode_spec_coding):
13668 Adjust to CHAR_STRING's new requirement.
13669 * editfns.c (Finsert_char, Fsubst_char_in_region):
13670 * fns.c (concat): Check that character args are actually
13671 characters. Without this test, these functions did the wrong
13672 thing with wildly out-of-range values on 64-bit hosts.
13674 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13675 These casts should not be needed on 32-bit hosts, either.
13676 * keyboard.c (read_char):
13677 * lread.c (Fload): Remove casts to unsigned.
13679 * lisp.h (UNSIGNED_CMP): New macro.
13680 This fixes comparison bugs on 64-bit hosts.
13681 (ASCII_CHAR_P): Use it.
13682 * casefiddle.c (casify_object):
13683 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13684 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13685 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13686 * dispextern.h (FACE_FROM_ID):
13687 * keyboard.c (read_char): Use UNSIGNED_CMP.
13689 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13690 not to EMACS_INT, to avoid GCC warning.
13692 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13694 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13695 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13696 isn't needed on 32-bit machines.
13698 * buffer.c (Fgenerate_new_buffer_name):
13699 Use EMACS_INT for count, not int.
13700 (advance_to_char_boundary): Return EMACS_INT, not int.
13702 * data.c (Qcompiled_function): Now static.
13704 * window.c (window_body_lines): Now static.
13706 * image.c (gif_load): Rename local to avoid shadowing.
13708 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13709 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13710 * alloc.c (make_save_value): Integer argument is now of type
13711 ptrdiff_t, not int.
13712 (mark_object): Use ptrdiff_t, not int.
13713 * lisp.h (pD): New macro.
13714 * print.c (print_object): Use it.
13716 * alloc.c: Use EMACS_INT, not int, to count objects.
13717 (total_conses, total_markers, total_symbols, total_vector_size)
13718 (total_free_conses, total_free_markers, total_free_symbols)
13719 (total_free_floats, total_floats, total_free_intervals)
13720 (total_intervals, total_strings, total_free_strings):
13721 Now EMACS_INT, not int. All uses changed.
13722 (Fgarbage_collect): Compute overall total using a double, so that
13723 integer overflow is less likely to be a problem. Check for overflow
13724 when converting back to an integer.
13725 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13726 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13727 These were 'int' variables that could overflow on 64-bit hosts;
13728 they were never used, so remove them instead of repairing them.
13729 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13730 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13731 Previously, this ceilinged at INT_MAX, but that doesn't work on
13733 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13735 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13736 (allocate_vectorlike): Check for ptrdiff_t overflow.
13737 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13738 when a (possibly-narrower) signed value would do just as well.
13739 We prefer using signed arithmetic, to avoid comparison confusion.
13741 * alloc.c: Catch some string size overflows that we were missing.
13742 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13743 for convenience in STRING_BYTES_MAX.
13744 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13745 The definition here is exact; the one in lisp.h was approximate.
13746 (allocate_string_data): Check for string overflow. This catches
13747 some instances we weren't catching before. Also, it catches
13748 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13749 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13750 and ptrdiff_t and EMACS_INT are both 64 bits.
13752 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13753 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13754 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13756 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13758 * alloc.c (Fmake_string): Check for out-of-range init.
13760 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13762 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13764 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13766 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13767 xg_get_default_scrollbar_width.
13769 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13770 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13771 (style_changed_cb): Call update_theme_scrollbar_width and call
13772 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13773 all frames (Bug#8505).
13774 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13775 Call gtk_window_set_resizable if HAVE_GTK3.
13776 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13777 and height if HAVE_GTK3 (Bug#8505).
13778 (scroll_bar_width_for_theme): New variable.
13779 (update_theme_scrollbar_width): New function.
13780 (xg_get_default_scrollbar_width): Move code to
13781 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13782 (xg_initialize): Call update_theme_scrollbar_width.
13784 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13786 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13788 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13790 * frame.c (make_frame): Call other_buffer_safely instead of
13793 * window.c (temp_output_buffer_show): Call display_buffer with
13794 second argument Vtemp_buffer_show_specifiers and reset latter
13795 immediately after the call.
13796 (Vtemp_buffer_show_specifiers): New variable.
13797 (auto_window_vscroll_p, next_screen_context_lines)
13798 (Vscroll_preserve_screen_position): Remove leading asterisks from
13801 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13803 Fix minor problems found by GCC 4.6.0 static checking.
13804 * buffer.c (Qclone_number): Remove for now, as it's unused.
13805 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13806 (record_buffer): Remove unused local.
13807 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13808 (set_frame_buffer_list): Remove; unused.
13809 * frame.h (other_visible_frames): Remove decl.
13810 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13811 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13812 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13814 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13815 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13816 Define only if HAVE_GPM.
13817 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13818 (update_hints_inhibit): Remove; never set. All uses removed.
13819 * widgetprv.h (emacsFrameClassRec): Remove decl.
13820 * window.c (delete_deletable_window): Now returns void, since it
13821 wasn't returning anything.
13822 (compare_window_configurations): Remove unused locals.
13823 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13824 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13825 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13826 the same widths as pointers. This follows up on the 2011-05-06 patch.
13827 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13828 * xterm.h: Likewise.
13829 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13831 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13833 * makefile.w32-in: Update dependencies.
13834 (LISP_H): Add lib/intprops.h.
13836 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13838 * image.c (gif_load): Add animation frame delay to the metadata.
13839 (syms_of_image): Use DEFSYM. New symbol `delay'.
13841 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13843 * window.c (delete_deletable_window): Re-add.
13844 (Fset_window_configuration): Rewrite to handle dead buffers and
13845 consequently deletable windows.
13846 (window_tree, Fwindow_tree): Remove. Supply functionality in
13848 (compare_window_configurations): Simplify code.
13850 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13852 * image.c (imagemagick_load_image): Fix type mismatch.
13853 (Fimagemagick_types): Likewise.
13855 * window.h (replace_buffer_in_windows): Declare.
13857 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13859 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13860 Qclone_number. Remove external declaration of Qdelete_window.
13861 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13863 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13864 Run Qbuffer_list_update_hook if allowed.
13865 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13866 buffer list implementation.
13867 (other_buffer_safely): New function.
13868 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13869 calls to replace_buffer_in_windows and
13870 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13872 (record_buffer): Inhibit quitting and rewrite using quittable
13873 functions. Run Qbuffer_list_update_hook if allowed.
13874 (Frecord_buffer, Funrecord_buffer): New functions.
13875 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13876 Move switch-to-buffer to window.el.
13877 (bury-buffer): Move to window.el.
13878 (Vbuffer_list_update_hook): New variable.
13880 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13883 * window.h (resize_frame_windows): Move up in code.
13884 (Fwindow_frame): Remove EXFUN.
13885 (replace_buffer_in_all_windows): Remove prototype.
13886 (replace_buffer_in_windows_safely): Add prototype.
13888 * window.c: Declare Qdelete_window static again. Move down
13889 declaration of select_count.
13890 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13891 (Fother_window): Move to window.el.
13892 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13893 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13894 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13896 (replace_buffer_in_windows): Implement by calling
13897 Qreplace_buffer_in_windows.
13898 (replace_buffer_in_all_windows): Remove with some functionality
13899 moved into replace_buffer_in_windows_safely.
13900 (replace_buffer_in_windows_safely): New function.
13901 (select_window_norecord, select_frame_norecord): Move in front
13902 of run_window_configuration_change_hook. Remove now obsolete
13904 (Fset_window_buffer): Rewrite doc-string.
13905 Call Qrecord_window_buffer.
13906 (keys_of_window): Move binding for other-window to window.el.
13908 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13910 * dispextern.h (struct image): Replace data member, whose int_val
13911 and ptr_val fields were not used by anything, with a single
13914 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13915 (gif_clear_image, gif_load, imagemagick_load_image)
13916 (gs_clear_image, gs_load): Callers changed.
13918 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13920 * buffer.h: Include <time.h>, for time_t.
13921 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13923 Fix minor problems found by static checking.
13925 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13927 Make identifiers static if they are not used in other modules.
13928 * data.c (Qcompiled_function, Qframe, Qvector):
13929 * image.c (QimageMagick, Qsvg):
13930 * minibuf.c (Qmetadata):
13931 * window.c (resize_window_check, resize_root_window): Now static.
13932 * window.h (resize_window_check, resize_root_window): Remove decls.
13934 * window.c (window_deletion_count, delete_deletable_window):
13936 (window_body_lines): Now static.
13937 (Fdelete_other_windows_internal): Mark vars as initialized.
13938 Make sure 'resize_failed' is initialized.
13939 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13940 (resize_window_apply): Remove unused local.
13941 * window.h (delete_deletable_window): Remove decl.
13943 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13944 (imagemagick_load_image): Fix pointer signedness problem by changing
13945 last arg from unsigned char * to char *. All uses changed.
13946 Also, fix a local for similar reasons.
13947 Remove unused locals. Remove locals to avoid shadowing.
13948 (fn_rsvg_handle_free): Remove; unused.
13949 (svg_load, svg_load_image): Fix pointer signedness problem.
13950 (imagemagick_load_image): Don't use garbage pointer image_wand.
13952 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13954 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13956 * image.c (gif_load): Fix omitted cast error introduced by
13959 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13961 * window.h (resize_proportionally, orig_total_lines)
13962 (orig_top_line): Remove from window structure.
13963 (set_window_height, set_window_width, change_window_heights)
13964 (Fdelete_window): Remove prototypes.
13965 (resize_frame_windows): Remove duplicate declaration.
13967 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13969 * window.h (resize_frame_windows, resize_window_check)
13970 (delete_deletable_window, resize_root_window)
13971 (resize_frame_windows): Declare prototypes.
13973 * window.c (resize_window_apply): Make definition be "static" to
13974 match the prototype.
13976 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13978 * window.c: Remove declarations of Qwindow_size_fixed,
13979 window_min_size_1, window_min_size_2, window_min_size,
13980 size_window, window_fixed_size_p, enlarge_window, delete_window.
13981 Remove static from declaration of Qdelete_window, it's
13982 temporarily needed by Fbury_buffer.
13983 (replace_window): Don't assign orig_top_line and
13985 (Fdelete_window, delete_window): Remove. Window deletion is
13986 handled by window.el.
13987 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13988 Replace Fdelete_window calls with calls to Qdelete_window.
13989 (Fdelete_other_windows): Remove. Deleting other windows is
13990 handled by window.el.
13991 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13992 handled in window.el.
13993 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13994 Window minimum sizes are handled in window.el.
13995 (shrink_windows, size_window, set_window_height)
13996 (set_window_width, change_window_heights, window_height)
13997 (window_width, CURBEG, CURSIZE, enlarge_window)
13998 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13999 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14000 handled in window.el.
14001 (make_dummy_parent): Rename to make_parent_window and give it a
14002 second argument horflag.
14003 (make_window): Don't set resize_proportionally any more.
14004 (Fsplit_window): Remove. Windows are split in window.el.
14005 (save_restore_action, save_restore_orig_size)
14006 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14007 Resize mini windows in window.el.
14008 (grow_mini_window, shrink_mini_window): Implement by calling
14009 Qresize_root_window_vertically, resize_window_check and
14010 resize_window_apply.
14011 (saved_window, Fset_window_configuration, save_window_save):
14012 Do not handle orig_top_line, orig_total_lines, and
14013 resize_proportionally.
14014 (window_min_height, window_min_width): Move to window.el.
14015 (keys_of_window): Move bindings for delete-other-windows,
14016 split-window, delete-window and enlarge-window to window.el.
14018 * buffer.c: Temporarily extern Qdelete_window.
14019 (Fbury_buffer): Temporarily call Qdelete_window instead of
14020 Fdelete_window (Fbury_buffer will move to window.el soon).
14022 * frame.c (set_menu_bar_lines_1): Remove code handling
14023 orig_top_line and orig_total_lines.
14025 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14026 set_window_height but set heights directly.
14027 (change_frame_size_1): Use resize_frame_windows.
14029 * xdisp.c (init_xdisp): Don't use set_window_height but set
14032 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14033 Use resize_frame_windows instead of change_window_heights and run
14034 run_window_configuration_change_hook.
14036 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14037 instead of change_window_heights and run
14038 run_window_configuration_change_hook.
14040 2011-06-09 Martin Rudalics <rudalics@gmx.at>
14042 * window.c (replace_window): Rename second argument REPLACEMENT to
14043 NEW. New third argument SETFLAG. Rewrite.
14044 (delete_window, make_dummy_parent): Call replace_window with
14046 (window_list_1): Move down in code.
14047 (run_window_configuration_change_hook): Move set_buffer part
14048 before select_frame_norecord part in order to unwind correctly.
14049 Rename count1 to count.
14050 (recombine_windows, delete_deletable_window, resize_root_window)
14051 (Fdelete_other_windows_internal)
14052 (Frun_window_configuration_change_hook, make_parent_window)
14053 (resize_window_check, resize_window_apply, Fresize_window_apply)
14054 (resize_frame_windows, Fsplit_window_internal)
14055 (Fdelete_window_internal, Fresize_mini_window_internal):
14057 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14059 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14061 * window.h (window): Add some new members to window structure -
14062 normal_lines, normal_cols, new_total, new_normal, clone_number,
14063 splits, nest, prev_buffers, next_buffers.
14064 (WINDOW_TOTAL_SIZE): Move here from window.c.
14065 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14067 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14069 (make_dummy_parent): Set new members of windows structure.
14070 (make_window): Move down in code. Handle new members of window
14072 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14073 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14074 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14075 (Fset_window_prev_buffers, Fwindow_next_buffers)
14076 (Fset_window_next_buffers, Fset_window_clone_number):
14078 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14079 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14081 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14082 Argument WINDOW can be now internal window too.
14083 (Fwindow_use_time): Move up in code.
14084 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14085 Rewrite doc-string.
14086 (Fset_window_configuration, saved_window)
14087 (Fcurrent_window_configuration, save_window_save): Handle new
14088 members of window structure.
14089 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14090 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14091 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14092 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14093 Qget_mru_window, Qresize_root_window,
14094 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14095 Qauto_buffer_name; staticpro them.
14097 2011-06-07 Martin Rudalics <rudalics@gmx.at>
14099 * window.c (Fwindow_total_size, Fwindow_left_column)
14100 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14101 (Fwindow_list_1): New functions.
14102 (window_box_text_cols): Replace with window_body_cols.
14103 (Fwindow_width, Fscroll_left, Fscroll_right):
14104 Use window_body_cols instead of window_box_text_cols.
14105 (delete_window, Fset_window_configuration):
14106 Call delete_all_subwindows with window as argument.
14107 (delete_all_subwindows): Take a window as argument and not a
14108 structure. Rewrite.
14109 (window_loop): Remove handling of GET_LRU_WINDOW and
14110 GET_LARGEST_WINDOW.
14111 (Fget_lru_window, Fget_largest_window): Move to window.el.
14113 * window.h: Extern window_body_cols instead of
14114 window_box_text_cols. delete_all_subwindows now takes a
14115 Lisp_Object as argument.
14117 * indent.c (compute_motion, Fcompute_motion):
14118 Use window_body_cols instead of window_box_text_cols.
14120 * frame.c (delete_frame): Call delete_all_subwindows with root
14121 window as argument.
14123 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14125 * fns.c (Fputhash): Document return value.
14127 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
14129 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14131 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14133 Cons<->int and similar integer overflow fixes (Bug#8794).
14135 Check for overflow when converting integer to cons and back.
14136 * charset.c (Fdefine_charset_internal, Fdecode_char):
14137 Use cons_to_unsigned to catch overflow.
14138 (Fencode_char): Use INTEGER_TO_CONS.
14139 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14140 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14141 * data.c (long_to_cons, cons_to_long): Remove.
14142 (cons_to_unsigned, cons_to_signed): New functions.
14143 These signal an error for invalid or out-of-range values.
14144 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14145 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14146 * font.c (Ffont_variation_glyphs):
14147 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14148 * lisp.h: Include <intprops.h>.
14149 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14150 (cons_to_signed, cons_to_unsigned): New decls.
14151 (long_to_cons, cons_to_long): Remove decls.
14152 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14153 (Fprimitive_undo): Use CONS_TO_INTEGER.
14154 * xfns.c (Fx_window_property): Likewise.
14155 * xselect.c: Include <limits.h>.
14156 (x_own_selection, selection_data_to_lisp_data):
14157 Use INTEGER_TO_CONS.
14158 (x_handle_selection_request, x_handle_selection_clear)
14159 (x_get_foreign_selection, Fx_disown_selection_internal)
14160 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14161 (lisp_data_to_selection_data): Use cons_to_unsigned.
14162 (x_fill_property_data): Use cons_to_signed.
14163 Report values out of range.
14165 Check for buffer and string overflow more precisely.
14166 * buffer.h (BUF_BYTES_MAX): New macro.
14167 * lisp.h (STRING_BYTES_MAX): New macro.
14168 * alloc.c (Fmake_string):
14169 * character.c (string_escape_byte8):
14170 * coding.c (coding_alloc_by_realloc):
14171 * doprnt.c (doprnt):
14172 * editfns.c (Fformat):
14174 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14175 since they may not be the same number.
14176 * editfns.c (Finsert_char):
14177 * fileio.c (Finsert_file_contents):
14178 Likewise for BUF_BYTES_MAX.
14180 * image.c: Use ptrdiff_t, not int, for sizes.
14181 (slurp_file): Switch from int to ptrdiff_t.
14183 (slurp_file): Check that file size fits in both size_t (for
14184 malloc) and ptrdiff_t (for sanity and safety).
14186 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14187 if b->modtime has its maximal value.
14189 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14191 Don't assume time_t can fit into int.
14192 * buffer.h (struct buffer.modtime): Now time_t, not int.
14193 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14194 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14196 Minor fixes for signed vs unsigned integers.
14197 * character.h (MAYBE_UNIFY_CHAR):
14198 * charset.c (maybe_unify_char):
14199 * keyboard.c (read_char, reorder_modifiers):
14200 XINT -> XFASTINT, since the integer must be nonnegative.
14201 * ftfont.c (ftfont_spec_pattern):
14202 * keymap.c (access_keymap, silly_event_symbol_error):
14203 XUINT -> XFASTINT, since the integer must be nonnegative.
14204 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14205 since it makes no difference and we prefer signed.
14206 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14207 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14210 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14212 * window.h (Fwindow_frame): Declare.
14214 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14216 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14217 (SPARE_MEMORY): Always define.
14218 (LARGE_REQUEST): Remove.
14219 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14221 2011-06-06 Martin Rudalics <rudalics@gmx.at>
14223 * lisp.h: Move EXFUNS for Fframe_root_window,
14224 Fframe_first_window and Fset_frame_selected_window to window.h.
14226 * window.h: Move EXFUNS for Fframe_root_window,
14227 Fframe_first_window and Fset_frame_selected_window here from
14230 * frame.c (Fwindow_frame, Fframe_first_window)
14231 (Fframe_root_window, Fframe_selected_window)
14232 (Fset_frame_selected_window): Move to window.c.
14233 (Factive_minibuffer_window): Move to minibuf.c.
14234 (Fother_visible_frames_p): New function.
14236 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14238 * window.c (decode_window, decode_any_window): Move up in code.
14239 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14240 (inhibit_frame_unsplittable): Remove unused variable.
14241 (Fwindow_buffer): Move up and rewrite doc-string.
14242 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14243 (Fwindow_prev): New functions.
14244 (Fwindow_frame): Move here from frame.c. Accept any window as
14246 (Fframe_root_window, Fframe_first_window)
14247 (Fframe_selected_window): Move here from frame.c. Accept frame
14248 or arbitrary window as argument. Update doc-strings.
14249 (Fminibuffer_window): Move up in code.
14250 (Fwindow_minibuffer_p): Move up in code and simplify.
14251 (Fset_frame_selected_window): Move here from frame.c.
14253 (Fselected_window, select_window, Fselect_window): Move up in
14254 code. Minor doc-string fixes.
14256 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14258 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14259 Do not assume that spare memory exists; that assumption is valid
14260 only if SYSTEM_MALLOC.
14261 (LARGE_REQUEST): New macro, so that the issue of large requests
14262 is separated from the issue of spare memory.
14264 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14266 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14269 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14271 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14274 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14276 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14278 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14280 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14281 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14283 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
14285 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14287 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
14289 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14290 (x_clipboard_manager_save): Add return value.
14291 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14292 New error handlers.
14293 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14294 Obey Vx_select_enable_clipboard_manager. Catch errors in
14295 x_clipboard_manager_save (Bug#8779).
14296 (Vx_select_enable_clipboard_manager): New variable.
14297 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14299 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
14301 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14303 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14305 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14306 in the current matrix if keep_current_p is non-zero.
14308 2011-06-04 Eli Zaretskii <eliz@gnu.org>
14310 * bidi.c (bidi_level_of_next_char): Fix last change.
14312 2011-06-03 Eli Zaretskii <eliz@gnu.org>
14314 Support bidi reordering of text covered by display properties.
14316 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14317 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14318 (bidi_cache_search, bidi_cache_iterator_state)
14319 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14320 (bidi_level_of_next_char, bidi_move_to_visually_next):
14321 Support character positions inside a run of characters covered by a
14323 (bidi_paragraph_init, bidi_resolve_explicit_1)
14324 (bidi_level_of_next_char): Call bidi_fetch_char and
14325 bidi_fetch_char_advance instead of FETCH_CHAR and
14326 FETCH_CHAR_ADVANCE.
14327 (bidi_init_it): Initialize new members.
14328 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14330 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14331 instead of using explicit *_CHAR codes.
14332 (bidi_resolve_explicit, bidi_resolve_weak):
14333 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14334 bidirectional text is supported only in multibyte buffers.
14335 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14336 it to initialize the frame_window_p member of struct bidi_it.
14337 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14338 (bidi_resolve_explicit, bidi_resolve_weak)
14339 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14340 bidi_it->nchars is non-positive.
14341 (bidi_level_of_next_char): Don't try to lookup the cache for the
14342 next/previous character if nothing is cached there yet, or if we
14343 were just reseat()'ed to a new position.
14345 * xdisp.c (set_cursor_from_row): Set start and stop points
14346 according to the row's direction when priming the loop that looks
14347 for the glyph on which to display cursor.
14348 (single_display_spec_intangible_p): Function deleted.
14349 (display_prop_intangible_p): Reimplement to call
14350 handle_display_spec instead of single_display_spec_intangible_p.
14351 Accept 3 additional arguments needed by handle_display_spec.
14352 This fixes incorrect cursor motion across display property with complex
14353 values: lists, `(when COND...)' forms, etc.
14354 (single_display_spec_string_p): Support property values that are
14355 lists with the argument STRING its top-level element.
14356 (display_prop_string_p): Fix the condition for processing a
14357 property that is a list to be consistent with handle_display_spec.
14358 (handle_display_spec): New function, refactored from the
14359 last portion of handle_display_prop.
14360 (compute_display_string_pos): Accept additional argument
14361 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14362 value of a `display' property is a "replacing spec".
14363 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14364 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14365 the display property, but just return a value indicating whether
14366 the display property will replace the characters it covers.
14367 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14368 frame_window_p members of struct bidi_it.
14369 (compute_display_string_pos, compute_display_string_end):
14371 (push_it): Accept second argument POSITION, where pop_it should
14372 jump to continue iteration.
14373 (reseat_1): Initialize bidi_it.disp_pos.
14375 * keyboard.c (adjust_point_for_property): Adjust the call to
14376 display_prop_intangible_p to its new signature.
14378 * dispextern.h (struct bidi_it): New member frame_window_p.
14379 (bidi_init_it): Update prototypes.
14380 (display_prop_intangible_p): Update prototype.
14381 (compute_display_string_pos, compute_display_string_end):
14382 Declare prototypes.
14383 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14386 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14388 Malloc failure behavior now depends on size of allocation.
14389 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14390 * lisp.h: Change signatures accordingly.
14391 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14392 All callers changed. (Bug#8762)
14394 * gnutls.c: Use Emacs's memory allocators.
14395 Without this change, the gnutls library would invoke malloc etc.
14396 directly, which causes problems on non-SYNC_INPUT hosts, and which
14397 runs afoul of improving memory_full behavior. (Bug#8761)
14398 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14399 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14400 xfree instead of the default malloc, realloc, free.
14401 (Fgnutls_boot): No need to check for memory allocation failure,
14402 since xmalloc does that for us.
14404 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14405 * category.c (hash_get_category_set):
14406 * ccl.c (ccl_driver):
14407 * charset.c (Fdefine_charset_internal):
14408 * charset.h (struct charset.hash_index):
14409 * composite.c (get_composition_id, gstring_lookup_cache)
14410 (composition_gstring_put_cache):
14411 * composite.h (struct composition.hash_index):
14412 * dispextern.h (struct image.hash):
14413 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14414 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14415 (hashfn_equal, hashfn_user_defined, make_hash_table)
14416 (maybe_resize_hash_table, hash_lookup, hash_put)
14417 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14418 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14419 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14420 * image.c (make_image, search_image_cache, lookup_image)
14421 (xpm_put_color_table_h):
14422 * lisp.h (struct Lisp_Hash_Table):
14423 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14424 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14425 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14426 * alloc.c (allocate_vectorlike):
14427 Check for overflow in vector size calculations.
14428 * ccl.c (ccl_driver):
14429 Check for overflow when converting EMACS_INT to int.
14430 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14431 need to be updated by these changes.
14432 * fns.c (make_hash_table, maybe_resize_hash_table):
14433 Check for integer overflow with large hash tables.
14434 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14435 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14436 (SXHASH_REDUCE): New macro.
14437 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14438 Use it instead of discarding useful hash info with large hash values.
14439 (sxhash_float): New function.
14440 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14441 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14442 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14443 Rewrite to use FIXNUM_BITS, as this simplifies things.
14444 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14445 Adjust signatures to match updated version of code.
14446 (consing_since_gc): Now EMACS_INT, since a single hash table can
14447 use more than INT_MAX bytes.
14449 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14451 Make it possible to build with GCC-4.6+ -O2 -flto.
14453 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14455 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14457 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14458 Call minibuffer-inactive-mode.
14460 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
14462 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14463 Update dependencies.
14465 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14467 * data.c (init_data): Remove code for UTS, this system is not
14470 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14472 Don't force ./temacs to start in terminal mode.
14474 * frame.c (make_initial_frame): Initialize faces in all cases, not
14475 only when CANNOT_DUMP is defined.
14476 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14478 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14480 * dispnew.c (add_window_display_history): Use const for the string
14481 pointer. Remove declaration, not needed.
14483 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14485 Use 'inline', not 'INLINE'.
14486 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14487 * alloc.c, fontset.c (INLINE): Remove.
14488 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14489 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14490 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14491 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14492 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14494 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14496 Make it possible to run ./temacs.
14498 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14499 syms_of_callproc does the same thing. Remove test for
14500 "initialized", do it in the caller.
14501 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14503 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14505 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14506 (read_minibuf): Use get_minibuffer.
14507 (syms_of_minibuf): Use DEFSYM.
14508 (Qmetadata): New var.
14509 * data.c (Qbuffer): Don't make it static.
14510 (syms_of_data): Use DEFSYM.
14512 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14514 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14515 (CCL_CODE_MIN): New macro.
14517 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14519 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14521 * eval.c (Qdebug): Now static.
14522 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14523 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14524 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14526 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14528 * image.c: Various fixes to ImageMagick code comments.
14529 (Fimagemagick_types): Doc fix.
14531 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14533 Minor fixes prompted by GCC 4.6.0 warnings.
14535 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14537 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14538 (x_clipboard_manager_save_all): Move extern decl to ...
14539 * xterm.h: ... here, so that it can be checked for consistency.
14541 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14543 * xselect.c (x_clipboard_manager_save_frame)
14544 (x_clipboard_manager_save_all): New functions.
14545 (Fx_clipboard_manager_save): Lisp function deleted.
14547 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14548 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14550 * xterm.h: Update prototype.
14552 2011-05-28 William Xu <william.xwl@gmail.com>
14554 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14555 exiting (Bug#8239).
14557 2011-05-28 Jim Meyering <meyering@redhat.com>
14559 Avoid a sign-extension bug in crypto_hash_function.
14560 * fns.c (to_uchar): Define.
14561 (crypto_hash_function): Use it to convert some newly-signed
14562 variables to unsigned, to avoid sign-extension bugs. For example,
14563 without this change, (md5 "truc") would evaluate to
14564 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14565 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14566 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14568 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14570 Integer overflow fixes.
14572 * dbusbind.c: Serial number integer overflow fixes.
14573 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14574 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14575 to hold a serial number that is too large for a fixnum.
14576 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14577 Check for serial numbers out of range. Decode any serial number
14578 that was so large that it became a float. (Bug#8722)
14580 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14581 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14582 Use XFASTINT rather than XUINT when numbers are nonnegative.
14583 (xd_append_arg, Fdbus_method_return_internal):
14584 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14585 arguments, check that Lisp number is nonnegative, rather than
14586 silently wrapping negative numbers around. (Bug#8722)
14587 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14590 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14592 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14594 ccl: Add integer overflow checks.
14595 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14596 (IN_INT_RANGE): New macros.
14597 (ccl_driver): Use them to check for integer overflow when
14598 decoding a CCL program. Many of the new checks are whether XINT (x)
14599 fits in int; it doesn't always, on 64-bit hosts. The new version
14600 doesn't catch all possible integer overflows, but it's an
14601 improvement. (Bug#8719)
14603 * alloc.c (make_event_array): Use XINT, not XUINT.
14604 There's no need for unsigned here.
14606 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14607 This follows up to the 2011-05-06 change that substituted uintptr_t
14608 for EMACS_INT. This case wasn't caught back then.
14610 Rework Fformat to avoid integer overflow issues.
14611 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14612 now (part of C89). Include <verify.h>.
14613 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14614 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14615 (Fformat): Avoid the prepass trying to compute sizes; it was only
14616 approximate and thus did not catch overflow reliably. Instead, walk
14617 through the format just once, formatting and computing sizes as we go,
14618 checking for integer overflow at every step, and allocating a larger
14619 buffer as needed. Keep track separately whether the format is
14620 multibyte. Keep only the most-recently calculated precision, rather
14621 than them all. Record whether each argument has been converted to
14622 string. Use EMACS_INT, not int, for byte and char and arg counts.
14623 Support field widths and precisions larger than INT_MAX. Avoid
14624 sprintf's undefined behavior with conversion specifications such as %#d
14625 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14626 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14627 formatting out-of-range floating point numbers with int
14628 formats. (Bug#8668)
14630 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14632 * data.c: Avoid integer truncation in expressions involving floats.
14633 * data.c: Include <intprops.h>.
14634 (arith_driver): When there's an integer overflow in an expression
14635 involving floating point, convert the integers to floating point
14636 so that the resulting value does not suffer from catastrophic
14637 integer truncation. For example, on a 64-bit host (* 4
14638 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14639 Do not rely on undefined behavior after integer overflow.
14641 merge count_size_as_multibyte, parse_str_to_multibyte
14642 * character.c, character.h (count_size_as_multibyte):
14643 Rename from parse_str_to_multibyte; all uses changed.
14644 Check for integer overflow.
14645 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14646 since it's now a duplicate of the other. This is more of
14647 a character than a buffer op, so better that it's in character.c.
14648 * fns.c, print.c: Adjust to above changes.
14650 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14652 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14654 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14656 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14657 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14658 (x_clipboard_manager_save): Now static.
14659 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14661 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14662 (crypto_hash_function): Now static.
14663 Fix pointer signedness problems. Avoid unnecessary initializations.
14665 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14667 * termhooks.h (Vselection_alist): Make it terminal-local.
14669 * terminal.c (create_terminal): Initialize it.
14671 * xselect.c: Support for clipboard managers.
14672 (Vselection_alist): Move to termhooks.h as terminal-local var.
14673 (LOCAL_SELECTION): New macro.
14674 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14675 (symbol_to_x_atom): Remove gratuitous arg.
14676 (x_handle_selection_request, lisp_data_to_selection_data)
14677 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14678 (x_own_selection, x_get_local_selection, x_convert_selection):
14679 New arg, specifying work frame. Use terminal-local Vselection_alist.
14680 (some_frame_on_display): Delete unused function.
14681 (Fx_own_selection_internal, Fx_get_selection_internal)
14682 (Fx_disown_selection_internal, Fx_selection_owner_p)
14683 (Fx_selection_exists_p): New optional frame arg.
14684 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14685 (x_handle_selection_clear): Don't treat other terminals with the
14686 same keyboard specially. Use the terminal-local Vselection_alist.
14687 (x_clear_frame_selections): Use Frun_hook_with_args.
14689 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14691 * xterm.h: Add support for those atoms.
14693 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14695 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14696 (converted_selections, conversion_fail_tag): New global variables.
14697 (x_selection_request_lisp_error): Free the above.
14698 (x_get_local_selection): Remove unnecessary code.
14699 (x_reply_selection_request): Args changed; handle arbitrary array
14700 of converted selections stored in converted_selections.
14701 Separate the XChangeProperty and SelectionNotify steps.
14702 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14703 (x_convert_selection): New function.
14704 (x_handle_selection_event): Simplify.
14705 (x_get_foreign_selection): Don't ignore incoming requests while
14706 waiting for an answer; this will fail when we implement
14707 SAVE_TARGETS, and seems unnecessary anyway.
14708 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14709 (Vx_sent_selection_functions): Doc fix.
14711 2011-05-26 Leo Liu <sdl.web@gmail.com>
14713 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14715 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14717 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14719 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14720 for fringe update if it has periodic bitmap.
14721 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14722 and fringe_bitmap_periodic_p.
14724 * fringe.c (get_fringe_bitmap_data): New function.
14725 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14726 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14727 row. Mark glyph row for fringe update if periodicity changed.
14729 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14730 for fringe update unless it has periodic bitmap.
14732 2011-05-25 Kenichi Handa <handa@m17n.org>
14734 * xdisp.c (get_next_display_element): Set correct it->face_id for
14735 a static composition.
14737 2011-05-24 Leo Liu <sdl.web@gmail.com>
14740 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14742 * fns.c (crypto_hash_function, Fsha1): New function.
14743 (Fmd5): Use crypto_hash_function.
14744 (syms_of_fns): Add Ssha1.
14746 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14748 * gnutls.c: Remove unused macros.
14749 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14750 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14751 Remove macros that are defined and never used.
14752 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14754 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14756 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14757 (Fx_get_selection_internal): Minor cleanup.
14758 (Fx_own_selection_internal): Rename arguments for consistency with
14761 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14763 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14765 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14767 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14769 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14771 * dispnew.c (scrolling_window): Don't exclude the case that the
14772 last enabled row in the desired matrix touches the bottom boundary.
14774 2011-05-21 Glenn Morris <rgm@gnu.org>
14776 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14777 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14778 and add some more files.
14780 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14782 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14783 report_file_error introduced by the change from 2011-05-07.
14785 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14787 * systime.h (Time): Define only if emacs is defined.
14788 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14789 where the include path doesn't have X11/X.h by default. See
14790 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14792 2011-05-20 Kenichi Handa <handa@m17n.org>
14794 * composite.c (find_automatic_composition): Fix previous change.
14796 2011-05-20 Glenn Morris <rgm@gnu.org>
14798 * lisp.mk: New file, split from Makefile.in.
14799 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14800 (shortlisp): Remove.
14801 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14803 2011-05-19 Glenn Morris <rgm@gnu.org>
14805 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14806 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14807 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14808 (lisp): Set the order to that of loadup.el.
14809 (shortlisp): Make it a copy of $lisp.
14810 (SOME_MACHINE_LISP): Remove.
14811 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14812 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14814 2011-05-18 Kenichi Handa <handa@m17n.org>
14816 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14817 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14818 (find_automatic_composition): Mostly rewrite for efficiency.
14820 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14822 * makefile.w32-in: Update dependencies.
14824 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14826 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14827 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14829 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14831 Fix some integer overflow issues, such as string length overflow.
14833 * insdel.c (count_size_as_multibyte): Check for string overflow.
14835 * character.c (lisp_string_width): Check for string overflow.
14836 Use EMACS_INT, not int, for string indexes and lengths; in
14837 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14838 the resulting string length overflows an EMACS_INT; instead,
14839 report a string overflow if no precision given. When checking for
14840 precision exhaustion, use a check that cannot possibly have
14841 integer overflow. (Bug#8675)
14842 * character.h (lisp_string_width): Adjust to new signature.
14844 * alloc.c (string_overflow): New function.
14845 (Fmake_string): Use it. This doesn't change behavior, but saves
14846 a few bytes and will simplify future changes.
14847 * character.c (string_escape_byte8): Likewise.
14848 * lisp.h (string_overflow): New decl.
14850 Fixups, following up to the user-interface timestamp change.
14851 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14852 for UI timestamps, instead of unsigned long.
14853 * msdos.c (mouse_get_pos): Likewise.
14854 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14855 * w32gui.h (Time): Define by including "systime.h" rather than by
14856 declaring it ourselves. (Bug#8664)
14858 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14859 * image.c (clear_image_cache): Likewise.
14861 * term.c (term_mouse_position): Don't assume time_t wraparound.
14863 Be more systematic about user-interface timestamps.
14864 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14865 and sometimes 'EMACS_UINT', to represent these timestamps.
14866 This change causes it to use 'Time' uniformly, as that's what X uses.
14867 This makes the code easier to follow, and makes it easier to catch
14868 integer overflow bugs such as Bug#8664.
14869 * frame.c (Fmouse_position, Fmouse_pixel_position):
14870 Use Time, not unsigned long, for user-interface timestamps.
14871 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14872 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14873 * keyboard.h (last_event_timestamp): Likewise.
14874 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14875 * menu.h (xmenu_show): Likewise.
14876 * term.c (term_mouse_position): Likewise.
14877 * termhooks.h (struct input_event.timestamp): Likewise.
14878 (struct terminal.mouse_position_hook): Likewise.
14879 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14880 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14881 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14882 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14883 what it was before.
14884 * menu.h, termhooks.h: Include "systime.h", for Time.
14886 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14887 Don't assume that the difference between two unsigned long values
14888 can fit into an integer. At this point, we know button_down_time
14889 <= event->timestamp, so the difference must be nonnegative, so
14890 there's no need to cast the result if double-click-time is
14891 nonnegative, as it should be; check that it's nonnegative, just in
14892 case. This bug is triggered when events are more than 2**31 ms
14893 apart (about 25 days). (Bug#8664)
14895 * xselect.c (last_event_timestamp): Remove duplicate decl.
14896 (x_own_selection): Remove needless cast to unsigned long.
14898 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14899 that always fit in int. Use a sentinel instead of a counter, to
14900 avoid a temp and to allay GCC's concerns about possible int overflow.
14901 * frame.h (struct frame): Use int for menu_bar_items_used
14902 instead of EMACS_INT, since it always fits in int.
14904 * menu.c (grow_menu_items): Check for int overflow.
14906 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14908 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14909 Before, the code was not consistent. These values cannot exceed
14910 2**31 - 1 so there's no need to make them unsigned.
14911 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14912 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14913 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14915 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14917 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14918 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14919 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14920 presumably because the widths might not match.
14922 * window.c (size_window): Avoid needless test at loop start.
14924 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14926 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14928 2011-05-12 Drew Adams <drew.adams@oracle.com>
14930 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14932 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14934 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14935 `width' to `bar_area_x' and `bar_area_width', respectively.
14936 (x_scroll_run): Take account of fringe background extension.
14938 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14939 Rename local vars `left' and `width' to `bar_area_x' and
14940 `bar_area_width', respectively.
14941 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14942 background extension.
14944 2011-05-10 Jim Meyering <meyering@redhat.com>
14946 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14948 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14950 * image.c (Finit_image_library): Return t for built-in image types,
14951 like pbm and xbm. (Bug#8640)
14953 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14955 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14957 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14959 * w32console.c (Fset_screen_color): Doc fix.
14960 (Fget_screen_color): New function.
14961 (syms_of_ntterm): Defsubr it.
14963 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14964 unlink the temporary file if Fcall_process didn't create it in the
14966 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14967 child process will be redirected to a file specified with `:file'.
14968 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14969 cue to call_process_cleanup not to close that handle.
14971 2011-05-07 Ben Key <bkey76@gmail.com>
14973 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14974 one of two shell specific rules, either bootstrap-temacs-CMD or
14975 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14976 to the previous implementation of the bootstrap-temacs rule.
14977 The bootstrap-temacs-CMD rule is similar to the previous
14978 implementation of the bootstrap-temacs rule except that it
14979 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14982 These changes, along with some changes to nt/configure.bat,
14983 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14984 earlier fix to add support for --cflags and --ldflags options
14985 that include quotes so that it works whether make uses cmd or
14988 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14990 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14991 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14993 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14994 a string. Handle both cases.
14995 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14996 (Fdbus_register_method): Use Qinvalid_function.
14998 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15000 * makefile.w32-in: Update dependencies.
15001 (LISP_H): Add inttypes.h and stdin.h.
15002 (PROCESS_H): Add unistd.h.
15004 2011-05-06 Eli Zaretskii <eliz@gnu.org>
15006 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15007 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15009 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
15011 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15013 * term.c (vfatal): Remove stray call to va_end.
15014 It's not needed and the C Standard doesn't allow it here anyway.
15016 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15017 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15019 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15022 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15024 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15026 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15028 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15030 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15032 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15033 * charset.c (Fdefine_charset_internal): Don't initialize
15034 charset.code_space[15]. The value was garbage, on hosts with
15035 32-bit int (Bug#8600).
15037 * lread.c (read_integer): Be more consistent with string-to-number.
15038 Use string_to_number to do the actual conversion; this avoids
15039 rounding errors and fixes some other screwups. Without this fix,
15040 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15041 (digit_to_number): Move earlier, for benefit of read_integer.
15042 Return -1 if the digit is out of range for the base, -2 if it is
15043 not a digit in any supported base. (Bug#8602)
15045 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15047 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15048 to match comment at start of function. This also removes a
15049 GCC warning about overflow in a 32+64-bit port.
15051 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15053 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15054 Reported by Stefan Monnier in
15055 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15056 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15057 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15059 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15060 (EMACS_UINTPTR): Likewise, with uintptr_t.
15062 * lisp.h: Prefer 64-bit EMACS_INT if available.
15063 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15064 on 32-bit hosts that have 64-bit int, so that they can access
15066 However, temporarily disable this change unless the temporary
15067 symbol WIDE_EMACS_INT is defined.
15069 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15071 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15072 This removes an assumption that EMACS_INT and long are the same
15073 width as pointers. The assumption is true for Emacs porting targets
15074 now, but we want to make other targets possible.
15075 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15076 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15077 In the rest of the code, change types of integers that hold casted
15078 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15079 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15080 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15081 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15082 No need to cast type when ORing.
15083 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15084 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15085 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15086 assume EMACS_INT is the same width as char *.
15087 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15088 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15089 Remove no-longer-needed casts.
15090 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15091 (xg_tool_bar_help_callback, xg_make_tool_item):
15092 Use EMACS_INTPTR to hold an integer
15093 that will be cast to void *; this can avoid a GCC warning
15094 if EMACS_INT is not the same width as void *.
15095 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15096 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15097 (current_message_1, set_message_1):
15098 Use a local to convert to proper width without a cast.
15099 * xmenu.c (dialog_selection_callback): Likewise.
15101 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15102 Also, don't assume VALBITS / RAND_BITS is less than 5,
15103 and don't rely on undefined behavior when shifting a 1 left into
15105 * lisp.h (get_random): Change signature to match.
15107 * lread.c (hash_string): Use size_t, not int, for hash computation.
15108 Normally we prefer signed values; but hashing is special, because
15109 it's better to use unsigned division on hash table sizes so that
15110 the remainder is nonnegative. Also, size_t is the natural width
15111 for hashing into memory. The previous code used 'int', which doesn't
15112 retain enough info to hash well into very large tables.
15113 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15115 * dbusbind.c: Don't possibly lose pointer info when converting.
15116 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15117 Use XPNTR rather than XHASH, so that the high-order bits of
15118 the pointer aren't lost when converting through void *.
15120 * eval.c (Fautoload): Don't double-shift a pointer.
15122 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15124 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15126 * gnutls.c (DEF_GNUTLS_FN):
15127 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15129 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15131 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15134 2011-05-05 Eli Zaretskii <eliz@gnu.org>
15136 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15137 New version that can reserve upto 2GB of heap space.
15139 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
15141 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15143 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15145 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15146 `gnutls_certificate_set_x509_key_file'.
15148 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
15150 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15151 Update dependencies.
15153 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15155 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15156 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15157 Remove unused parameter `fildes'.
15158 * process.c (read_process_output, send_process): Don't pass it.
15160 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15162 Fix previous change: the library cache is defined in w32.c.
15163 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15164 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15166 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15168 Implement dynamic loading of GnuTLS on Windows.
15170 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15171 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15172 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15175 * gnutls.c (Qgnutls_dll): Define.
15176 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15177 (gnutls_*): Declare function pointers.
15178 (init_gnutls_functions): New function to initialize function pointers.
15179 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15180 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15181 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15182 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15183 (emacs_gnutls_write, emacs_gnutls_read)
15184 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15185 (Fgnutls_available_p): New function.
15186 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15187 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15188 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15190 * image.c: Include w32.h.
15191 (Vimage_type_cache): Delete.
15192 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15193 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15194 (w32_delayed_load): Move to w32.c.
15196 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15198 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15199 (w32_delayed_load): Move from image.c. When loading a library, record
15200 its filename in the :loaded-from property of the library id.
15201 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15202 Initialize and staticpro them.
15203 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15205 * process.c: Include lisp.h before w32.h, not after.
15206 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15207 instead of gnutls_record_check_pending.
15209 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15211 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15213 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15214 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15217 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15219 * xterm.c (x_set_frame_alpha): Do not set property on anything
15220 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15222 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15224 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15226 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15228 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15229 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15230 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15231 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15232 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15233 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15234 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15235 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15236 (Qgnutls_bootprop_callbacks_verify): Make static.
15238 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15240 * callproc.c: Indentation fixup.
15242 * sysdep.c (wait_for_termination_1): Make static.
15243 (wait_for_termination, interruptible_wait_for_termination):
15244 Move after wait_for_termination_1.
15246 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15248 * sysdep.c (interruptible_wait_for_termination): New function
15249 which is like wait_for_termination, but allows keyboard
15252 * callproc.c (Fcall_process): Add (:file "file") as an option for
15254 (Fcall_process_region): Ditto.
15256 2011-04-30 Eli Zaretskii <eliz@gnu.org>
15258 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15259 rather than `XVECTOR (FOO)->size'.
15261 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15262 inttypes.h, as a gnulib replacement is used if it not available in
15265 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15267 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15268 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15269 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15271 * coding.c (coding_alloc_by_realloc): Error out if destination
15272 will grow beyond MOST_POSITIVE_FIXNUM.
15273 (decode_coding_emacs_mule): Abort if there isn't enough place in
15274 charbuf for the composition carryover bytes. Reserve an extra
15275 space for up to 2 characters produced in a loop.
15276 (decode_coding_iso_2022): Abort if there isn't enough place in
15277 charbuf for the composition carryover bytes.
15279 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15281 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15282 aborting when %lld or %lll format is passed.
15283 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15284 %llo or %llx format is passed. (Bug#8545)
15286 * window.c (window_scroll_line_based): Use a marker instead of
15287 simple variables to record original value of point. (Bug#7952)
15289 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15290 produced by %s or %c overflows available buffer space. (Bug#8545)
15292 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15294 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15295 (SIZE_MAX): Move defn after all includes, as they might #define it.
15297 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15299 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15301 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15303 * keyboard.c (Qdelayed_warnings_hook): Define.
15304 (command_loop_1): Run `delayed-warnings-hook'
15305 if Vdelayed_warnings_list is non-nil.
15306 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15307 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15309 2011-04-28 Eli Zaretskii <eliz@gnu.org>
15311 * doprnt.c (doprnt): Don't return value smaller than the buffer
15312 size if the message was truncated. (Bug#8545).
15314 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15316 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15317 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15319 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15321 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15323 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
15325 * makefile.w32-in: Update dependencies.
15327 2011-04-27 Eli Zaretskii <eliz@gnu.org>
15329 Improve `doprnt' and its usage. (Bug#8545)
15330 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15331 `format_end'. Remove support for %l as a conversion specifier.
15332 Don't use xrealloc. Improve diagnostics when the %l size modifier
15333 is used. Update the commentary.
15335 * eval.c (verror): Simplify calculation of size_t.
15337 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15340 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15342 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15345 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15347 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15348 This makes this file independent of the recent pseudovector change.
15350 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
15352 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15354 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15355 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15356 Remove unused local.
15357 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15359 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
15360 GCC 4.6.0 optimizes based on type-based alias analysis.
15361 For example, if b is of type struct buffer * and v of type struct
15362 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15363 != &v->size, and therefore "v->size = 1; b->size = 2; return
15364 v->size;" must therefore return 1. This assumption is incorrect
15365 for Emacs, since it type-puns struct Lisp_Vector * with many other
15366 types. To fix this problem, this patch adds a new type struct
15367 vectorlike_header that documents the constraints on layout of vectors
15368 and pseudovectors, and helps optimizing compilers not get fooled
15369 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15370 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15371 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15373 (XSETPVECTYPE): Rewrite in terms of new macro.
15374 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15375 This is a bit clearer, and further avoids the possibility of
15376 undesirable aliasing.
15377 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15378 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15379 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15380 since Lisp_Subr is a special case (no "next" field).
15381 (ASIZE): Now uses header.size rather than size.
15382 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15383 to avoid the hassle of writing XVECTOR (foo)->header.size.
15384 (struct vectorlike_header): New type.
15385 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15386 object, to help avoid aliasing.
15387 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15388 (SUBRP): Likewise, since Lisp_Subr is a special case.
15389 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15390 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15391 (struct Lisp_Hash_Table): Combine first two members into a single
15392 struct vectorlike_header member. All uses of "size" and "next" members
15393 changed to be "header.size" and "header.next".
15394 * buffer.h (struct buffer): Likewise.
15395 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15396 * frame.h (struct frame): Likewise.
15397 * process.h (struct Lisp_Process): Likewise.
15398 * termhooks.h (struct terminal): Likewise.
15399 * window.c (struct save_window_data, struct saved_window): Likewise.
15400 * window.h (struct window): Likewise.
15401 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15402 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15403 * buffer.c (init_buffer_once): Likewise.
15404 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15406 * process.c (Fformat_network_address): Use local var for size,
15409 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15411 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15412 * data.c (atof): Remove decl; no longer used or needed.
15413 (digit_to_number): Move to lread.c.
15414 (Fstring_to_number): Use new string_to_number function, to be
15415 consistent with how the Lisp reader treats infinities and NaNs.
15416 Do not assume that floating-point numbers represent EMACS_INT
15417 without losing information; this is not true on most 64-bit hosts.
15418 Avoid double-rounding errors, by insisting on integers when
15419 parsing non-base-10 numbers, as the documentation specifies.
15420 * lisp.h (string_to_number): New decl, replacing ...
15421 (isfloat_string): Remove.
15422 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15423 (read1): Do not accept +. and -. as integers; this
15424 appears to have been a coding error. Similarly, do not accept
15425 strings like +-1e0 as floating point numbers. Do not report
15426 overflow for integer overflows unless the base is not 10 which
15427 means we have no simple and reliable way to continue.
15428 Break out the floating-point parsing into a new
15429 function string_to_number, so that Fstring_to_number parses
15430 floating point numbers consistently with the Lisp reader.
15431 (digit_to_number): Move here from data.c. Make it static inline.
15432 (E_CHAR, EXP_INT): Remove, replacing with ...
15433 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15434 (string_to_number): New function, replacing isfloat_string.
15435 This function checks for valid syntax and produces the resulting
15436 Lisp float number too. Rework it so that string-to-number
15437 no longer mishandles examples like "1.0e+". Use strtoumax,
15438 so that overflow for non-base-10 numbers is reported only when
15439 there's no portable and simple way to convert to floating point.
15441 * textprop.c (set_text_properties_1): Rewrite for clarity,
15442 and to avoid GCC warning about integer overflow.
15444 * intervals.h (struct interval): Use EMACS_INT for members
15445 where EMACS_UINT might cause problems. See
15446 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15447 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15448 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15450 (offset_intervals): Tell GCC not to worry about length overflow
15451 when negating a negative length.
15453 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15454 (overrun_check_free): Likewise.
15456 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15457 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15460 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15461 (gnutls_make_error): Rename local to avoid shadowing.
15462 (gnutls_emacs_global_deinit): ifdef out; not used.
15463 (Fgnutls_boot): Use const for pointer to readonly storage.
15464 Comment out unused local. Fix pointer signedness problems.
15466 * lread.c (openp): Don't stuff size_t into an 'int'.
15467 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15468 about possible signed overflow.
15470 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15471 (GDK_KEY_g): Don't define if already defined.
15472 (xg_prepare_tooltip): Avoid pointer signedness problem.
15473 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15475 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15476 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15478 * xfns.c (Fx_window_property): Simplify a bit,
15479 to make a bit faster and to avoid GCC 4.6.0 warning.
15480 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15482 * fns.c (internal_equal): Don't assume size_t fits in int.
15484 * alloc.c (compact_small_strings): Tighten assertion a little.
15486 Replace pEd with more-general pI, and fix some printf arg casts.
15487 * lisp.h (pI): New macro, generalizing old pEd macro to other
15488 conversion specifiers. For example, use "...%"pI"d..." rather
15489 than "...%"pEd"...".
15490 (pEd): Remove. All uses replaced with similar uses of pI.
15491 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15492 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15493 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15494 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15495 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15496 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15497 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15499 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15500 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15501 * print.c (safe_debug_print, print_object): Likewise.
15502 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15504 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15505 avoiding the 0 flag, which is not portable.
15506 * process.c (Fmake_network_process): Use pI to avoid cast.
15507 * region-cache.c (pp_cache): Likewise.
15508 * xdisp.c (decode_mode_spec): Likewise.
15509 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15510 behavior on 64-bit hosts with printf arg.
15511 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15512 (x_stop_queuing_selection_requests): Likewise.
15513 (x_get_window_property): Don't truncate byte count to an 'int'
15516 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15517 here, since it parses constructs like leading '-' and spaces,
15518 which are not wanted; and it overflows with large numbers.
15519 Instead, simply match F[0-9]+, which is what is wanted anyway.
15521 * alloc.c: Remove unportable assumptions about struct layout.
15522 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15523 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15524 (allocate_vectorlike, make_pure_vector): Use the new macros,
15525 plus offsetof, to remove unportable assumptions about struct layout.
15526 These assumptions hold on all porting targets that I know of, but
15527 they are not guaranteed, they're easy to remove, and removing them
15528 makes further changes easier.
15530 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15531 This doesn't fix a bug but makes the code clearer.
15532 (string_overrun_cookie): Now const. Use initializers that
15533 don't formally overflow signed char, to avoid warnings.
15534 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15535 can cause Emacs to crash when string overrun checking is enabled.
15536 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15537 multiple of sizeof (EMACS_INT); it need not be, if
15538 alignof(EMACS_INT) < sizeof (EMACS_INT).
15539 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15541 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
15543 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15545 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15547 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15548 supposed to be handshaking. (Bug#8556)
15549 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15551 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15553 * lisp.h (Qdebug): List symbol.
15554 * eval.c (Qdebug): Restore global linkage.
15555 * keyboard.c (debug-on-event): New variable.
15556 (handle_user_signal): Break into debugger when debug-on-event
15557 matches the current signal symbol.
15559 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15561 * alloc.c (check_sblock, check_string_bytes)
15562 (check_string_free_list): Convert to standard C.
15564 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15566 * w32.c (emacs_gnutls_push): Fix typo.
15568 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15570 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15571 "cast to pointer from integer of different size".
15573 Improve doprnt and its use in verror. (Bug#8545)
15574 * doprnt.c (doprnt): Document the set of format control sequences
15575 supported by the function. Use SAFE_ALLOCA instead of always
15578 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15579 is one byte too soon. Don't use xrealloc; instead xfree and
15582 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15584 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15587 * gnutls.c: Renamed global_initialized to
15588 gnutls_global_initialized. Added internals for the
15589 :verify-hostname-error, :verify-error, and :verify-flags
15590 parameters of `gnutls-boot' and documented those parameters in the
15591 docstring. Start callback support.
15592 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15593 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15594 on error. Return error code.
15595 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15596 (emacs_gnutls_read): Likewise.
15597 (Fgnutls_boot): Return handshake error code.
15598 (emacs_gnutls_handle_error): New function.
15599 (wsaerror_to_errno): Likewise.
15601 * w32.h (emacs_gnutls_pull): Add prototype.
15602 (emacs_gnutls_push): Likewise.
15604 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15605 (emacs_gnutls_push): Likewise.
15607 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15609 * process.c (wait_reading_process_output): Check if GnuTLS
15610 buffered some data internally if no FDs are set for TLS
15613 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15614 (LIBS): Link to USER_LIBS.
15615 ($(BLD)/gnutls.$(0)): New target.
15617 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15619 * xdisp.c (handle_single_display_spec): Rename the
15620 display_replaced_before_p argument into display_replaced_p, to
15621 make it consistent with the commentary. Fix typos in the
15624 * textprop.c (syms_of_textprop): Remove dead code.
15625 (copy_text_properties): Delete obsolete commentary about an
15626 interface that was deleted long ago. Fix typos in the description
15629 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15630 to changes in oldXMenu/XMenu.h from 2011-04-16.
15631 <menu_help_message, prev_menu_help_message>: Constify.
15632 (IT_menu_make_room): menu->help_text is now `const char **';
15635 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15636 to changes in oldXMenu/XMenu.h from 2011-04-16.
15637 (struct XMenu): Declare `help_text' `const char **'.
15639 * xfaces.c <Qunspecified>: Make extern again.
15641 * syntax.c: Include sys/types.h before including regex.h, as
15644 * doc.c (get_doc_string): Improve the format passed to `error'.
15646 * doprnt.c (doprnt): Improve commentary.
15648 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15650 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15653 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15654 changes in globals.h immediately force recompilation.
15655 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15656 $(CURDIR)/s/ms-w32.h.
15657 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15659 * character.c (Fchar_direction): Function deleted.
15660 (syms_of_character): Don't defsubr it.
15661 <char-direction-table>: Deleted.
15663 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15665 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15666 * doprnt.c: Include limits.h.
15667 (SIZE_MAX): New macro.
15668 (doprnt): Return a size_t value. 2nd arg is now size_t.
15669 Many local variables are now size_t instead of int or unsigned.
15670 Improve overflow protection. Support `l' modifier for integer
15671 conversions. Support %l conversion. Don't assume an EMACS_INT
15672 argument for integer conversions and for %c.
15674 * lisp.h (doprnt): Restore prototype.
15676 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15677 $(SRC)/character.h.
15679 * Makefile.in (base_obj): Add back doprnt.o.
15681 * deps.mk (doprnt.o): Add back prerequisites.
15682 (callint.o): Depend on character.h.
15684 * eval.c (internal_lisp_condition_case): Include the handler
15685 representation in the error message.
15686 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15687 when breaking from the loop.
15689 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15691 * callint.c (Fcall_interactively): When displaying error message
15692 about invalid control letter, pass the character's codepoint, not
15693 a pointer to its multibyte form. Improve display of the character
15694 in octal and display also its hex code.
15696 * character.c (char_string): Use %x to display the (unsigned)
15697 codepoint of an invalid character, to avoid displaying a bogus
15700 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15701 `error', not SYMBOL_NAME itself.
15703 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15704 character arguments to `error'.
15706 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15707 to `error' in error message about FINAL_CHAR argument. Make sure
15708 FINAL_CHAR is a character, and use %c when it is passed as
15709 argument to `error'.
15711 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15713 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15715 * w32.c: Include <time.h>.
15716 (sys_localtime): New function.
15718 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15720 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15722 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15724 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15726 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15727 zombies (Bug#8467).
15729 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15731 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15732 gl_state.e_property when gl_state.object is Qt.
15734 * insdel.c (make_gap_larger): Remove limitation of buffer size
15737 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15739 * xdisp.c (lookup_glyphless_char_display)
15740 (produce_glyphless_glyph): Handle cons cell entry in
15741 glyphless-char-display.
15742 (Vglyphless_char_display): Document it.
15744 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15745 glyphless-char-display.
15747 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15749 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15751 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15753 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15754 definition for no-X builds.
15756 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15758 Static checks with GCC 4.6.0 and non-default toolkits.
15760 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15762 * process.c (keyboard_bit_set): Define only if SIGIO.
15763 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15764 (send_process): Repair possible setjmp clobbering.
15766 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15768 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15770 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15772 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15773 Define only if needed.
15775 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15776 by pacifying GCC about it. Maybe it's time to retire it?
15777 * xfaces.c (USG, __TIMEVAL__): Likewise.
15779 * dispextern.h (struct redisplay_interface): Rename param
15780 to avoid shadowing.
15781 * termhooks.h (struct terminal): Likewise.
15782 * xterm.c (xembed_send_message): Likewise.
15784 * insdel.c (make_gap_smaller): Define only if
15785 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15787 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15790 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15791 so that we aren't warned about unused symbols.
15793 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15795 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15797 * xfns.c (x_real_positions): Mark locals as initialized.
15799 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15801 * xterm.c: Fix problems found by static analysis with other toolkits.
15802 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15803 (x_dispatch_event): Declare static if USE_GTK, and
15804 define if USE_GTK || USE_X_TOOLKIT.
15805 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15806 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15807 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15808 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15810 * xmenu.c (menu_help_callback): Pointer type fixes.
15811 Use const pointers when pointing at readonly data. Avoid pointer
15812 signedness clashes.
15813 (FALSE): Remove unused macro.
15814 (update_frame_menubar): Remove unused decl.
15816 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15818 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15819 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15820 (single_menu_item): Rename local to avoid shadowing.
15822 * keyboard.c (make_lispy_event): Remove unused local var.
15824 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15825 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15827 * bitmaps: Change bitmaps from unsigned char back to the X11
15828 compatible char. Avoid the old compiler warnings about
15829 out-of-range initializers by using, for example, '\xab' rather
15832 * xgselect.c (xgselect_initialize): Check vs interface
15833 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15835 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15837 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15838 to read-only memory.
15840 * fns.c (vector): Remove; this old hack is no longer needed.
15842 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15844 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15846 * xrdb.c (x_load_resources): Omit unused local.
15848 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15849 (x_window): Rename locals to avoid shadowing.
15850 (USG): Use the kludged USG macro, to pacify gcc.
15852 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15853 (x_term_init): Remove local to avoid shadowing.
15855 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15857 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15858 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15860 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15862 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15864 Fix regex.c, syntax.c and friends for buffers > 2GB.
15865 * syntax.h (struct gl_state_s): Declare character position members
15868 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15870 * textprop.c (verify_interval_modification, interval_of):
15871 Declare arguments EMACS_INT.
15873 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15876 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15878 * indent.c (Fvertical_motion): Local variable it_start is now
15881 * regex.c (re_match, re_match_2, re_match_2_internal)
15882 (bcmp_translate, regcomp, regexec, print_double_string)
15883 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15884 (re_compile_pattern, re_exec): Declare arguments and local
15885 variables `size_t' and `ssize_t' and return values `regoff_t', as
15887 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15888 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15889 <compile_stack_type>: `size' and `avail' are now `size_t'.
15891 * regex.h <regoff_t>: Use ssize_t, not int.
15892 (re_search, re_search_2, re_match, re_match_2): Arguments that
15893 specify buffer/string position and length are now ssize_t and
15894 size_t. Return type is regoff_t.
15896 2011-04-16 Ben Key <bkey76@gmail.com>
15898 * nsfont.m: Fixed bugs in ns_get_family and
15899 ns_descriptor_to_entity that were caused by using free to
15900 deallocate memory blocks that were allocated by xmalloc (via
15901 xstrdup). This caused Emacs to crash when compiled with
15902 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15903 --enable-checking=xmallocoverrun). xfree is now used to
15904 deallocate these memory blocks.
15906 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15908 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15910 emacs_write: Accept and return EMACS_INT for sizes.
15911 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15913 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15914 Accept and return EMACS_INT.
15915 (emacs_gnutls_write): Return the number of bytes written on
15917 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15918 (emacs_read, emacs_write): Remove check for negative size, as the
15919 Emacs source code has been audited now.
15920 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15921 (emacs_read, emacs_write): Use it.
15922 * process.c (send_process): Adjust to the new signatures of
15923 emacs_write and emacs_gnutls_write. Do not attempt to store
15924 a byte offset into an 'int'; it might overflow.
15925 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15927 * sound.c: Don't assume sizes fit in 'int'.
15928 (struct sound_device.period_size, alsa_period_size):
15929 Return EMACS_INT, not int.
15930 (struct sound_device.write, vox_write, alsa_write):
15931 Accept EMACS_INT, not int.
15932 (wav_play, au_play): Use EMACS_INT to store sizes and to
15933 record read return values.
15935 2011-04-15 Ben Key <bkey76@gmail.com>
15937 * keyboard.c (Qundefined): Don't declare static since it is used
15939 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15940 static since they are used in nsfont.m.
15942 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15944 * process.c (Qprocessp): Don't declare static.
15945 * lisp.h (Qprocessp): Declare again.
15947 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15949 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15951 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15953 Improve C-level modularity by making more things 'static'.
15955 Don't publish debugger-only interfaces to other modules.
15956 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15957 (verify_bytepos, count_markers): Move decls to the only modules
15959 * region-cache.h (pp_cache): Likewise.
15960 * window.h (check_all_windows): Likewise.
15961 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15963 * sysdep.c (croak): Now static, if
15964 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15965 * syssignal.h (croak): Declare only if not static.
15967 * alloc.c (refill_memory_reserve): Now static if
15968 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15969 * lisp.h (refill_memory_reserve): Declare only if not static.
15971 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15972 Define only if USE_LUCID.
15974 * xrdb.c (x_customization_string, x_rm_string): Now static.
15976 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15977 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15979 * xdisp.c (draw_row_with_mouse_face): Now static.
15980 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15982 * window.h (check_all_windows): Mark externally visible.
15984 * window.c (window_deletion_count): Now static.
15986 * undo.c: Make symbols static if they're not exported.
15987 (last_undo_buffer, last_boundary_position, pending_boundary):
15990 * textprop.c (interval_insert_behind_hooks): Now static.
15991 (interval_insert_in_front_hooks): Likewise.
15993 * term.c: Make symbols static if they're not exported.
15994 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15995 (max_frame_lines, tty_set_terminal_modes):
15996 (tty_reset_terminal_modes, tty_turn_off_highlight):
15997 (get_tty_terminal): Now static.
15998 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15999 * termhooks.h (term_mouse_moveto): Do not declare if
16000 HAVE_WINDOW_SYSTEM.
16001 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16002 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16004 * sysdep.c: Make symbols static if they're not exported.
16005 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16007 (sigprocmask_set, full_mask): Remove; unused.
16008 (wait_debugging): Mark as visible.
16009 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16010 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16012 * syntax.c (syntax_temp): Define only if !__GNUC__.
16014 * sound.c (current_sound_device, current_sound): Now static.
16016 * search.c (searchbufs, searchbuf_head): Now static.
16018 * scroll.c (scroll_cost): Remove; unused.
16019 * dispextern.h (scroll_cost): Remove decl.
16021 * region-cache.h (pp_cache): Mark as externally visible.
16023 * process.c: Make symbols static if they're not exported.
16024 (process_tick, update_tick, create_process, chan_process):
16025 (Vprocess_alist, proc_buffered_char, datagram_access):
16026 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16027 (deactivate_process): Mark defn as static, as well as decl.
16028 * lisp.h (create_process): Remove decl.
16029 * process.h (chan_process, Vprocess_alist): Remove decls.
16031 * print.c: Make symbols static if they're not exported.
16032 (print_depth, new_backquote_output, being_printed, print_buffer):
16033 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16034 (print_interval, print_number_index, initial_stderr_stream):
16036 * lisp.h (Fprinc): Remove decl.
16037 (debug_output_compilation_hack): Mark as externally visible.
16039 * sysdep.c (croak): Move decl from here to syssignal.h.
16040 * syssignal.h (croak): Put it here, so the API can be checked when
16041 'croak' is called from dissociate_if_controlling_tty.
16043 * minibuf.c: Make symbols static if they're not exported.
16044 (minibuf_save_list, choose_minibuf_frame): Now static.
16045 * lisp.h (choose_minibuf_frame): Remove decl.
16047 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16049 * lread.c: Make symbols static if they're not exported.
16050 (read_objects, initial_obarray, oblookup_last_bucket_number):
16052 (make_symbol): Remove; unused.
16053 * lisp.h (initial_obarray, make_symbol): Remove decls.
16055 * keyboard.c: Make symbols static if they're not exported.
16056 (single_kboard, recent_keys_index, total_keys, recent_keys):
16057 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16058 (this_single_command_key_start, echoing, last_auto_save):
16059 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16060 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16061 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16062 (Vlispy_mouse_stem, double_click_count):
16064 (force_auto_save_soon): Define only if SIGDANGER.
16065 (ignore_mouse_drag_p): Now static if
16066 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16067 (print_help): Remove; unused.
16068 (stop_character, last_timer_event): Mark as externally visible.
16069 * keyboard.h (ignore_mouse_drag_p): Declare only if
16070 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16071 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16072 * lisp.h (echoing): Remove decl.
16073 (force_auto_save_soon): Declare only if SIGDANGER.
16074 * xdisp.c (redisplay_window): Simplify code, to make it more
16075 obvious that ignore_mouse_drag_p is not accessed if !defined
16076 USE_GTK && !defined HAVE_NS.
16078 * intervals.c: Make symbols static if they're not exported.
16079 (merge_properties_sticky, merge_interval_right, delete_interval):
16081 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16083 * insdel.c: Make symbols static if they're not exported.
16084 However, leave prepare_to_modify_buffer alone. It's never
16085 called from outside this function, but that appears to be a bug.
16086 (combine_after_change_list, combine_after_change_buffer):
16087 (adjust_after_replace, signal_before_change): Now static.
16088 (adjust_after_replace_noundo): Remove; unused.
16089 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16090 (signal_before_change): Remove decls.
16092 * indent.c (val_compute_motion, val_vmotion): Now static.
16094 * image.c: Make symbols static if they're not exported.
16095 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16097 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16098 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16100 * fringe.c (standard_bitmaps): Now static.
16101 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16103 * frame.c: Make symbols static if they're not exported.
16104 (x_report_frame_params, make_terminal_frame): Now static.
16105 (get_frame_param): Now static, unless HAVE_NS.
16106 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16107 (x_get_resource_string): Remove; not used.
16108 * frame.h (make_terminal_frame, x_report_frame_params):
16109 (x_get_resource_string); Remove decls.
16110 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16111 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16113 * font.c, fontset.c: Make symbols static if they're not exported.
16114 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16115 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16116 * font.c (font_close_object): Now static.
16117 * font.h (font_close_object): Remove.
16118 * fontset.c (FONTSET_OBJLIST): Remove.
16119 (free_realized_fontset) #if-0 the body, which does nothing.
16120 (face_suitable_for_char_p): #if-0, as it's never called.
16121 * fontset.h (face_suitable_for_char_p): Remove decl.
16122 * xfaces.c (face_at_string_position):
16123 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16124 since 0 is always ASCII.
16126 * fns.c (weak_hash_tables): Now static.
16128 * fileio.c: Make symbols static if they're not exported.
16129 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16130 (Vwrite_region_annotation_buffers): Now static.
16132 * eval.c: Make symbols static if they're not exported.
16133 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16134 * lisp.h (backtrace_list): Remove decl.
16136 * emacs.c: Make symbols static if they're not exported.
16137 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16138 (fatal_error_code, fatal_error_signal_hook, standard_args):
16140 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16141 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16142 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16143 * lisp.h (fatal_error_signal_hook): Remove decl.
16144 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16146 * editfns.c: Move a (normally-unused) function to its only use.
16147 * editfns.c, lisp.h (get_operating_system_release): Remove.
16148 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16149 worth the hassle of breaking this out.
16151 * xterm.c: Make symbols static if they're not exported.
16152 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16153 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16154 (x_destroy_window, x_delete_display):
16156 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16157 (x_mouse_leave): Remove; unused.
16158 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16159 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16160 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16162 (x_mouse_leave): Declare only if WINDOWSNT.
16163 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16164 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16167 * ftxfont.c: Make symbols static if they're not exported.
16168 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16170 * font.h (ftxfont_driver): Likewise.
16172 * xfns.c: Make symbols static if they're not exported.
16173 (x_last_font_name, x_display_info_for_name):
16174 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16175 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16176 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16177 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16178 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16179 (last_show_tip_args): Now static.
16180 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16181 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16182 (x_screen_planes): Remove; unused.
16183 * dispextern.h (x_screen_planes): Remove decl.
16185 * dispnew.c: Make symbols static if they're not exported.
16186 * dispextern.h (redraw_garbaged_frames, scrolling):
16187 (increment_row_positions): Remove.
16188 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16189 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16191 (redraw_garbaged_frames): Remove; unused.
16193 * xfaces.c: Make symbols static if they're not exported.
16194 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16196 * xterm.h (defined_color): Remove decls.
16197 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16198 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16199 (menu_face_changed_default, defined_color, free_realized_face):
16200 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16201 (ascii_face_of_lisp_face): Remove; unused.
16203 * xdisp.c: Make symbols static if they're not exported.
16204 * dispextern.h (scratch_glyph_row, window_box_edges):
16205 (glyph_to_pixel_coords, set_cursor_from_row):
16206 (get_next_display_element, set_iterator_to_next):
16207 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16208 (show_mouse_face): Remove decls
16209 * frame.h (message_buf_print): Likewise.
16210 * lisp.h (pop_message, set_message, check_point_in_composition):
16212 * xterm.h (set_vertical_scroll_bar): Likewise.
16213 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16214 (message_buf_print, scratch_glyph_row, displayed_buffer):
16215 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16216 (get_next_display_element, show_mouse_face, window_box_edges):
16217 (frame_to_window_pixel_xy, check_point_in_composition):
16218 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16219 (glyph_to_pixel_coords): Remove; unused.
16221 * dired.c (file_name_completion): Now static.
16223 * dbusbind.c (xd_in_read_queued_messages): Now static.
16225 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16226 * data.c (circular_list_error): Remove.
16228 * commands.h (last_point_position, last_point_position_buffer):
16229 (last_point_position_window): Remove decls.
16230 * keyboard.c: Make these variables static.
16232 * coding.h (coding, code_convert_region, encode_coding_gap):
16234 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16235 (iso_code_class, detect_coding, code_convert_region): Now static.
16236 (encode_coding_gap): Remove; unused.
16238 * chartab.c (chartab_chars, chartab_bits): Now static.
16240 * charset.h (charset_iso_8859_1): Remove decl.
16241 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16244 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16245 * ccl.c (Vccl_program_table): Now static.
16246 (check_ccl_update): Remove; unused.
16248 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16249 * category.h: ... from here.
16250 * category.c (check_category_table, set_category_set): Now static.
16252 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16253 * lisp.h: Remove these decls.
16255 * buffer.c (buffer_count): Remove unused var.
16257 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16258 so that it's not optimized away.
16259 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16260 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16261 exported only to the debugger.
16263 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16264 * atimer.h (run_all_atimers): Remove; not exported.
16266 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16267 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16268 was inaccessible from Lisp.
16269 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16270 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16272 alloc.c: Import and export fewer symbols, and remove unused items.
16273 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16275 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16276 it's not optimized away by whole-program optimization.
16277 (message_enable_multibyte, free_misc): Remove.
16278 (catchlist, handlerlist, mark_backtrace):
16279 Declare only if BYTE_MARK_STACK.
16280 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16281 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16282 (message_enable_multibyte): Remove decl.
16283 (free_misc, interval_free_list, float_block, float_block_index):
16284 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16285 (cons_free_list, last_marked_index):
16287 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16288 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16289 (mark_backtrace): Define only if BYTE_MARK_STACK.
16290 * xdisp.c (message_enable_multibyte): Now static.
16292 Declare Lisp_Object Q* variables to be 'static' if not exported.
16293 This makes it easier for human readers (and static analyzers)
16294 to see whether these variables are used from other modules.
16295 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16296 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16297 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16298 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16299 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16300 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16301 * xmenu.c, xselect.c:
16302 Declare Q* vars static if they are not used in other modules.
16303 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16304 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16305 Remove decls of unexported vars.
16306 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16308 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16310 Make Emacs functions such as Fatom 'static' by default.
16311 This makes it easier for human readers (and static analyzers)
16312 to see whether these functions can be called from other modules.
16313 DEFUN now defines a static function. To make the function external
16314 so that it can be used in other C modules, use the new macro DEFUE.
16315 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16316 (Finit_image_library):
16317 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16318 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16319 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16320 Remove decls, since these functions are now static.
16321 (Funintern, Fget_internal_run_time): New decls, since these functions
16322 were already external.
16324 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16325 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16326 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16327 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16328 * keyboard.c, keymap.c, lread.c:
16329 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16330 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16331 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16332 Mark functions with DEFUE instead of DEFUN,
16333 if they are used in other modules.
16334 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16335 decls for now-static functions.
16336 * buffer.h (Fdelete_overlay): Remove decl.
16337 * callproc.c (Fgetenv_internal): Mark as internal.
16338 * composite.c (Fremove_list_of_text_properties): Remove decl.
16339 (Fcomposition_get_gstring): New forward static decl.
16340 * composite.h (Fcomposite_get_gstring): Remove decl.
16341 * dired.c (Ffile_attributes): New forward static decl.
16342 * doc.c (Fdocumntation_property): New forward static decl.
16343 * eval.c (Ffetch_bytecode): New forward static decl.
16344 (Funintern): Remove extern decl; now in .h file where it belongs.
16345 * fileio.c (Fmake_symbolic_link): New forward static decl.
16346 * image.c (Finit_image_library): New forward static decl.
16347 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16348 * intervals.h (Fprevious_property_change):
16349 (Fremove_list_of_text_properties): Remove decls.
16350 * keyboard.c (Fthis_command_keys): Remove decl.
16351 (Fcommand_execute): New forward static decl.
16352 * keymap.c (Flookup_key): New forward static decl.
16353 (Fcopy_keymap): Now static.
16354 * keymap.h (Flookup_key): Remove decl.
16355 * process.c (Fget_process): New forward static decl.
16356 (Fprocess_datagram_address): Mark as internal.
16357 * syntax.c (Fsyntax_table_p): New forward static decl.
16358 (skip_chars): Remove duplicate decl.
16359 * textprop.c (Fprevious_property_change): New forward static decl.
16360 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16362 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16363 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16365 * editfns.c (Fformat): Remove unreachable code.
16367 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16369 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16372 2011-04-13 Eli Zaretskii <eliz@gnu.org>
16374 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16375 when at ZV. (Bug#8487)
16377 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16379 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16381 * keyboard.c (parse_tool_bar_item): Likewise.
16382 * sound.c (sound_cleanup, alsa_close): Likewise.
16383 * termcap.c (tgetent): Likewise.
16384 * xfns.c (x_default_font_parameter): Likewise.
16385 * xsettings.c (read_and_apply_settings): Likewise.
16387 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16388 (overrun_check_free): Protoize.
16390 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16392 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16393 since callers should never pass a negative size.
16394 Change the signature to match that of plain 'read' and 'write'; see
16395 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16396 * lisp.h: Update prototypes of emacs_write and emacs_read.
16398 2011-04-11 Eli Zaretskii <eliz@gnu.org>
16400 * xdisp.c (redisplay_window): Don't try to determine the character
16401 position of the scroll margin if the window start point w->startp
16402 is outside the buffer's accessible region. (Bug#8468)
16404 2011-04-10 Eli Zaretskii <eliz@gnu.org>
16406 Fix write-region and its subroutines for buffers > 2GB.
16407 * fileio.c (a_write, e_write): Modify declaration of arguments and
16408 local variables to support buffers larger than 2GB.
16409 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16411 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16412 argument, local variables, and return value.
16414 * lisp.h: Update prototypes of emacs_write and emacs_read.
16416 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16418 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16420 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16422 Fix more problems found by GCC 4.6.0's static checks.
16424 * xdisp.c (vmessage): Use a better test for character truncation.
16426 * charset.c (load_charset_map): <, not <=, for optimization,
16427 and to avoid potential problems with integer overflow.
16428 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16429 * casetab.c (set_identity, shuffle): Likewise.
16430 * editfns.c (Fformat): Likewise.
16431 * syntax.c (skip_chars): Likewise.
16433 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16434 This also lets GCC 4.6.0 generate slightly better loop code.
16436 * callint.c (Fcall_interactively): <, not <=, for optimization.
16437 (Fcall_interactively): Count the number of arguments produced,
16438 not the number of arguments given. This is simpler and lets GCC
16439 4.6.0 generate slightly better code.
16441 * ftfont.c: Distingish more carefully between FcChar8 and char.
16442 The previous code passed unsigned char * to a functions like
16443 strlen and xstrcasecmp that expect char *, which does not
16444 conform to the C standard.
16445 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16446 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16447 char * when the C standard requires it.
16449 * keyboard.c (read_char): Remove unused var.
16451 * eval.c: Port to Windows vsnprintf (Bug#8435).
16452 Include <limits.h>.
16453 (SIZE_MAX): Define if the headers do not.
16454 (verror): Do not give up if vsnprintf returns a negative count.
16455 Instead, grow the buffer. This ports to Windows vsnprintf, which
16456 does not conform to C99. Problem reported by Eli Zaretskii.
16457 Also, simplify the allocation scheme, by avoiding the need for
16458 calling realloc, and removing the ALLOCATED variable.
16460 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16462 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16463 But keep the doprint source code for now, as we might revamp it
16464 and use it again (Bug#8435).
16465 * lisp.h (doprnt): Remove.
16466 * Makefile.in (base_obj): Remove doprnt.o.
16467 * deps.mk (doprnt.o): Remove.
16469 error: Print 32- and 64-bit integers portably (Bug#8435).
16470 Without this change, on typical 64-bit hosts error ("...%d...", N)
16471 was used to print both 32- and 64-bit integers N, which relied on
16472 undefined behavior.
16473 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16474 * lisp.h (error, verror): Mark as printf-like functions.
16475 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16476 Report overflow in size calculations when allocating printf buffer.
16477 Do not truncate output string at its first null byte.
16478 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16479 Truncate the output at a character boundary, since vsnprintf does not
16481 * charset.c (check_iso_charset_parameter): Convert internal
16482 character to string before calling 'error', since %c now has the
16484 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16485 overflow when computing char to be passed to 'error'. Do not
16486 pass Lisp_Object to 'error'; pass the integer instead.
16487 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16488 formatted with plain %d.
16490 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16492 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16494 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16496 * xterm.c (x_catch_errors): Remove duplicate declaration.
16498 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16500 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16502 2011-04-10 Jim Meyering <meyering@redhat.com>
16504 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16505 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16506 return ssize_t not "int", and use size_t as the buffer length.
16507 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16508 * gnutls.h: Update declarations.
16509 * process.c (read_process_output): Use ssize_t, to match.
16510 (send_process): Likewise.
16512 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16514 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16516 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16518 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16519 Use unsigned char, to match FcChar8 type definition.
16521 * xterm.c (handle_one_xevent):
16522 * xmenu.c (create_and_show_popup_menu):
16523 * xselect.c (x_decline_selection_request)
16524 (x_reply_selection_request): Avoid type-punned deref of X events.
16526 2011-04-09 Eli Zaretskii <eliz@gnu.org>
16528 Fix some uses of `int' instead of EMACS_INT.
16529 * search.c (string_match_1, fast_string_match)
16530 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16531 (scan_buffer, find_next_newline_no_quit)
16532 (find_before_next_newline, search_command, Freplace_match)
16533 (Fmatch_data): Make some `int' variables be EMACS_INT.
16535 * xdisp.c (display_count_lines): 3rd argument and return value now
16536 EMACS_INT. All callers changed.
16537 (pint2hrstr): Last argument is now EMACS_INT.
16539 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16540 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16541 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16542 (decode_coding_utf_16, decode_coding_emacs_mule)
16543 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16544 (decode_coding_ccl, decode_coding_charset)
16545 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16546 (decode_coding_iso_2022, decode_coding_emacs_mule)
16547 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16548 <char_offset, last_offset>: Declare EMACS_INT.
16549 (encode_coding_utf_8, encode_coding_utf_16)
16550 (encode_coding_emacs_mule, encode_invocation_designation)
16551 (encode_designation_at_bol, encode_coding_iso_2022)
16552 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16553 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16555 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16556 (encode_invocation_designation): Last argument P_NCHARS is now
16558 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16559 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16561 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16564 * ccl.c (Fccl_execute_on_string): Declare some variables
16567 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16569 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16571 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16573 * process.c (Fformat_network_address): Doc fix.
16575 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16577 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16579 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16581 * keyboard.c (read_char): Call Lisp function help-form-show,
16582 instead of using internal_with_output_to_temp_buffer.
16583 (Qhelp_form_show): New var.
16584 (syms_of_keyboard): Use DEFSYM macro.
16586 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16588 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16590 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16592 * process.c (Flist_processes): Remove to Lisp.
16593 (list_processes_1): Delete.
16595 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16597 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16599 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16601 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16603 Fix more problems found by GCC 4.6.0's static checks.
16605 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16607 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16609 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16611 * xdisp.c (vmessage): Mark as a printf-like function.
16613 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16615 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16617 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16618 printf-like functions.
16619 (tiff_load): Add casts to remove these marks before passing them
16620 to system-supplied API.
16622 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16624 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16625 This avoids several warnings with gcc -Wstrict-overflow.
16626 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16627 directly, rather than having caller test rule sign. This avoids
16628 some unnecessary tests.
16629 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16630 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16631 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16633 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16634 (xfont_open): Avoid unnecessary tests.
16636 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16638 * composite.h, composite.c (composition_gstring_put_cache):
16639 Use EMACS_INT, not int, for length.
16641 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16642 breaking out part of COMPOSITION_DECODE_RULE.
16643 (COMPOSITION_DECODE_RULE): Use it.
16644 * composite.c (get_composition_id): Remove unused local vars,
16645 by using the new macro.
16647 * textprop.c (set_text_properties_1): Change while to do-while,
16648 since the condition is always true at first.
16650 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16651 (interval_deletion_adjustment): Return unsigned value.
16654 * process.c (list_processes_1, create_pty, read_process_output):
16655 (exec_sentinel): Remove vars that were set but not used.
16656 (create_pty): Remove unnecessary "volatile"s.
16657 (Fnetwork_interface_info): Avoid possibility of int overflow.
16658 (read_process_output): Do adaptive read buffering even if carryover.
16659 (read_process_output): Simplify nbytes computation if buffered.
16661 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16663 * syntax.c (scan_words): Remove var that was set but not used.
16664 (update_syntax_table): Use unsigned instead of int.
16666 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16667 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16668 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16670 * print.c (print_error_message): Avoid int overflow.
16672 * font.c (font_list_entities): Redo for clarity,
16673 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16675 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16676 (font_score): Avoid potential overflow in diff calculation.
16678 * fns.c (substring_both): Remove var that is set but not used.
16679 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16681 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16683 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16684 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16685 can always succeed if overflow has undefined behavior.
16687 * search.c (boyer_moore, wordify): Remove vars set but not used.
16688 (wordify): Omit three unnecessary tests.
16690 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16691 All callers changed. This avoids the need for an unused var.
16693 * casefiddle.c (casify_region): Remove var that is set but not used.
16695 * dired.c (file_name_completion): Remove var that is set but not used.
16697 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16699 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16700 (Finsert_file_contents): Remove unnecessary code checking fd.
16702 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16703 Check for integer overflow on size calculations.
16705 * buffer.c (Fprevious_overlay_change): Remove var that is set
16708 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16709 Remove vars that are set but not used.
16710 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16711 (timer_check_2): Mark vars as initialized.
16713 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16715 * image.c (lookup_image): Remove var that is set but not used.
16716 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16718 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16719 that are set but not used.
16721 * xfns.c (make_invisible_cursor): Don't return garbage
16722 if XCreateBitmapFromData fails (Bug#8410).
16724 * xselect.c (x_get_local_selection, x_handle_property_notify):
16725 Remove vars that are set but not used.
16727 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16728 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16730 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16731 Remove var that is set but not used.
16732 (scroll_bar_windows_size): Now size_t, not int.
16733 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16734 Check for overflow.
16736 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16737 (map_tty_color) [!defined MSDOS]: Likewise.
16739 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16741 * coding.c: Remove vars that are set but not used.
16742 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16743 All callers changed.
16744 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16745 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16746 (decode_coding_charset): Remove vars that are set but not used.
16748 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16749 that is set but not used.
16751 * print.c (print_object): Remove var that is set but not used.
16753 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16754 The gnulib version avoids calling malloc in the usual case,
16755 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16756 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16757 * filelock.c (current_lock_owner): Likewise.
16758 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16759 * sysdep.c: Include allocator.h, careadlinkat.h.
16760 (emacs_no_realloc_allocator): New static constant.
16761 (emacs_readlink): New function.
16762 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16763 ../lib/careadlinkat.h.
16765 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16767 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16768 first non-nil return value).
16770 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16772 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16773 if not defined (Bug#8403).
16775 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16777 * xdisp.c (display_count_lines): Remove parameter `start',
16778 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16779 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16780 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16781 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16782 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16783 and thereabouts. All callers changed.
16784 (get_per_char_metric): Remove parameter `f', unused since
16785 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16787 2011-04-02 Jim Meyering <meyering@redhat.com>
16789 do not dereference NULL upon failed strdup
16790 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16791 (ns_get_family): Likewise.
16793 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16795 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16797 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16799 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16802 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16804 Add lexical binding.
16806 * window.c (Ftemp_output_buffer_show): New fun.
16807 (Fsave_window_excursion):
16808 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16810 * lread.c (lisp_file_lexically_bound_p): New function.
16811 (Fload): Bind Qlexical_binding.
16812 (readevalloop): Remove `evalfun' arg.
16813 Bind Qinternal_interpreter_environment.
16814 (Feval_buffer): Bind Qlexical_binding.
16815 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16817 (syms_of_lread): Declare `lexical-binding'.
16819 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16821 * keyboard.c (eval_dyn): New fun.
16822 (menu_item_eval_property): Use it.
16824 * image.c (parse_image_spec): Use Ffunctionp.
16826 * fns.c (concat, mapcar1): Accept byte-code-functions.
16828 * eval.c (Fsetq): Handle lexical vars.
16829 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16830 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16831 (FletX, Flet): Obey lexical binding.
16832 (Fcommandp): Handle closures.
16833 (Feval): New `lexical' arg.
16834 (eval_sub): New function extracted from Feval. Use it almost
16835 everywhere where Feval was used. Look up vars in lexical env.
16837 (Ffunctionp): Move from subr.el.
16838 (Ffuncall): Handle closures.
16839 (apply_lambda): Remove `eval_flags'.
16840 (funcall_lambda): Handle closures and new byte-code-functions.
16841 (Fspecial_variable_p): New function.
16842 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16843 but without exporting it to Lisp.
16845 * doc.c (Fdocumentation, store_function_docstring):
16846 * data.c (Finteractive_form): Handle closures.
16848 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16851 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16853 (exec_byte_code): New function extracted from Fbyte_code to handle new
16854 calling convention for byte-code-functions. Add new byte-codes.
16856 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16858 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16860 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16862 * xdisp.c (redisplay_internal): Fix prototype.
16864 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16866 * xdisp.c (SCROLL_LIMIT): New macro.
16867 (try_scrolling): Use it when setting scroll_limit.
16868 Limit scrolling to 100 screen lines.
16869 (redisplay_window): Even when falling back on "recentering",
16870 position point in the window according to scroll-conservatively,
16871 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16873 (try_scrolling): When point is above the window, allow searching
16874 as far as scroll_max, or one screenful, to compute vertical
16875 distance from PT to the scroll margin position. This prevents
16876 try_scrolling from unnecessarily failing when
16877 scroll-conservatively is set to a value slightly larger than the
16878 window height. Clean up the case of PT below the margin at bottom
16879 of window: scroll_max can no longer be INT_MAX. When aggressive
16880 scrolling is in use, don't let point enter the opposite scroll
16881 margin as result of the scroll.
16882 (syms_of_xdisp) <scroll-conservatively>: Document the
16883 threshold of 100 lines for never-recentering scrolling.
16885 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16887 * dispextern.h (move_it_by_lines):
16888 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16889 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16890 (message_log_check_duplicate): Remove parameters `prev_bol' and
16891 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16892 (redisplay_internal): Remove parameter `preserve_echo_area',
16893 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16895 * indent.c (Fvertical_motion):
16896 * window.c (window_scroll_pixel_based, Frecenter):
16897 Don't pass `need_y_p' to `move_it_by_lines'.
16899 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16901 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16902 steal a few bits to be more compact.
16903 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16904 Remove unneeded casts.
16906 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16908 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16910 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16911 binding" message (bug#7967).
16913 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16915 Fix more problems found by GCC 4.6.0's static checks.
16917 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16918 Remove unused local var.
16920 * editfns.c (Fmessage_box): Remove unused local var.
16922 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16923 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16924 Omit unused local vars.
16925 * window.c (shrink_windows): Omit unused local var.
16926 * menu.c (digest_single_submenu): Omit unused local var.
16927 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16928 Omit unused local var.
16930 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16931 Don't assume string length fits in int.
16932 (keyremap_step, read_key_sequence): Use size_t for sizes.
16933 (read_key_sequence): Don't check last_real_key_start redundantly.
16935 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16936 instead of alloca (Bug#8344).
16938 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16939 (Fbacktrace_frame): Don't assume nframes fits in int.
16941 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16943 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16946 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16948 * cm.c (calccost): Turn while-do into do-while, for clarity.
16950 * keyboard.c (syms_of_keyboard): Use the same style as later
16951 in this function when indexing through an array. This also
16952 works around GCC bug 48267.
16954 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16956 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16958 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16959 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16961 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16962 This avoids undefined behavior on integer overflow, and is a bit
16963 more convenient anyway since it is compared to a size_t variable.
16965 Variadic C functions now count arguments with size_t, not int.
16966 This avoids an unnecessary limitation on 64-bit machines, which
16967 caused (substring ...) to crash on large vectors (Bug#8344).
16968 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16969 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16970 All variadic functions and their callers changed accordingly.
16971 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16972 * data.c (arith_driver, float_arith_driver): Likewise.
16973 * editfns.c (general_insert_function): Likewise.
16974 * eval.c (struct backtrace.nargs, interactive_p)
16975 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16976 (funcall_lambda, mark_backtrace): Likewise.
16977 * fns.c (concat): Likewise.
16978 * frame.c (x_set_frame_parameters): Likewise.
16979 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16980 0 if not found, not -1. All callers changed.
16982 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16983 (stack_copy_size): Now size_t, not int.
16984 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16986 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16988 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16989 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16990 All callers changed.
16992 * lisp.h (multibyte_char_to_unibyte):
16993 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16994 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16995 * character.h (CHAR_TO_BYTE8):
16996 * cmds.c (internal_self_insert):
16997 * editfns.c (general_insert_function):
16998 * keymap.c (push_key_description):
16999 * search.c (Freplace_match):
17000 * xdisp.c (message_dolog, set_message_1): All callers changed.
17002 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17004 * keyboard.c (safe_run_hook_funcall): New function.
17005 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17006 don't set the hook to nil, but remove the offending function instead.
17007 (Qcommand_hook_internal): Remove, unused.
17008 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17009 Vcommand_hook_internal.
17011 * eval.c (enum run_hooks_condition): Remove.
17012 (funcall_nil, funcall_not): New functions.
17013 (run_hook_with_args): Call each function through a `funcall' argument.
17014 Remove `cond' argument, now redundant.
17015 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17016 (Frun_hook_with_args_until_failure): Adjust accordingly.
17017 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17019 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17021 * dispextern.h (string_buffer_position): Remove declaration.
17023 * print.c (strout): Remove parameter `multibyte', unused since
17024 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17026 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17027 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17028 All callers changed.
17030 * w32.c (_wsa_errlist): Use braces for struct initializers.
17032 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17033 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17034 All callers changed.
17035 (string_buffer_position): Likewise. Also, make static (it's never
17036 used outside xdisp.c).
17037 (cursor_row_p): Remove parameter `w', unused since
17038 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17039 (decode_mode_spec): Remove parameter `precision', introduced during
17040 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17041 All callers changed.
17043 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17045 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17047 2011-03-27 Anders Lindgren <andlind@gmail.com>
17049 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17050 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17051 (ns_update_auto_hide_menu_bar): New functions.
17052 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17053 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17054 ns_constrain_all_frames.
17055 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17056 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17058 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17060 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17062 2011-03-27 Glenn Morris <rgm@gnu.org>
17064 * syssignal.h: Replace RETSIGTYPE with void.
17065 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17066 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17067 Replace SIGTYPE with void everywhere.
17068 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17069 * s/template.h (SIGTYPE): Remove commented out definition.
17071 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17073 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17074 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17076 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17078 * w32.c (read_unc_volume): Use parameter `henum', instead of
17079 global variable `wget_enum_handle'.
17081 * keymap.c (describe_vector): Remove parameters `indices' and
17082 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17083 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17085 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17087 * keyboard.c (timer_check): Remove parameter `do_it_now',
17088 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17089 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17090 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17092 * keyboard.c (read_char):
17093 * w32menu.c (w32_menu_display_help):
17094 * xmenu.c (show_help_event, menu_help_callback):
17095 Adjust calls to `show_help_echo'.
17097 * gtkutil.c (xg_maybe_add_timer):
17098 * keyboard.c (readable_events):
17099 * process.c (wait_reading_process_output):
17100 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17102 * insdel.c (adjust_markers_gap_motion):
17103 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17104 (gap_left, gap_right): Don't call it.
17106 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17108 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17109 incurred during fontification.
17111 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17113 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17114 (DEFVAR_PER_BUFFER): Don't pass it.
17116 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17117 (scrolling_window): Don't pass it.
17119 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17121 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17123 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17125 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17126 of variables specific to SELinux and computation of `encoded_absname'.
17128 * image.c (XPutPixel): Remove unused variable `height'.
17130 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17132 * unexw32.c (get_section_info): Remove unused variable `section'.
17134 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17135 (system_process_attributes): Remove unused variable `sess'.
17136 (sys_read): Remove unused variable `err'.
17138 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17139 (w32_wnd_proc): Remove unused variable `isdead'.
17140 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17141 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17142 (x_create_tip_frame): Remove unused variable `tem'.
17144 * w32inevt.c (w32_console_read_socket):
17145 Remove unused variable `no_events'.
17147 * w32term.c (x_draw_composite_glyph_string_foreground):
17148 Remove unused variable `width'.
17150 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17152 * w32term.c (x_set_glyph_string_clipping):
17153 Don't pass uninitialized region to CombineRgn.
17155 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17157 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17158 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17159 (Fx_close_connection): Remove unused variable `i'.
17161 * w32font.c (w32font_draw): Return number of glyphs.
17162 (w32font_open_internal): Remove unused variable `i'.
17163 (w32font_driver): Add missing initializer.
17165 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17166 (fill_in_menu): Remove unused variable `items_added'.
17168 * w32term.c (last_mouse_press_frame): Remove static global variable.
17169 (w32_clip_to_row): Remove unused variable `f'.
17170 (x_delete_terminal): Remove unused variable `i'.
17172 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17173 (NOTHING): Remove unused static global variable.
17174 (uniscribe_check_otf): Remove unused variable `table'.
17175 (uniscribe_font_driver): Add missing initializers.
17177 2011-03-23 Julien Danjou <julien@danjou.info>
17179 * term.c (Fsuspend_tty, Fresume_tty):
17180 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17181 * window.c (temp_output_buffer_show):
17182 * insdel.c (signal_before_change):
17183 * frame.c (Fhandle_switch_frame):
17184 * fileio.c (Fdo_auto_save):
17185 * emacs.c (Fkill_emacs):
17186 * editfns.c (save_excursion_restore):
17187 * cmds.c (internal_self_insert):
17188 * callint.c (Fcall_interactively):
17189 * buffer.c (Fkill_all_local_variables):
17190 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17192 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17193 unconditionally since it does the check itself.
17195 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17197 Fix more problems found by GCC 4.5.2's static checks.
17199 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17200 the first time through the loop, since we know p0 < p1 then.
17201 This also avoids a gcc -Wstrict-overflow warning.
17203 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17204 leading to a memory leak, possible in functions like
17205 load_charset_map_from_file that can allocate an unbounded number
17206 of objects (Bug#8318).
17208 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17209 that could (at least in theory) be that large.
17211 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17212 This is less likely to overflow, and avoids undefined behavior if
17213 overflow does occur. All callers changed. Use strtoul to scan
17214 for the unsigned long integer.
17215 (pint2hrstr): Simplify and tune code slightly.
17216 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17218 * scroll.c (do_scrolling): Work around GCC bug 48228.
17219 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17221 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17222 This also avoids a warning with gcc -Wstrict-overflow.
17223 (validate_x_resource_name): Simplify count usage.
17224 This also avoids a warning with gcc -Wstrict-overflow.
17226 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17229 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17231 * process.c (Fmake_network_process): Use socklen_t, not int,
17232 where POSIX says socklen_t is required in portable programs.
17233 This fixes a porting bug on hosts like 64-bit HP-UX, where
17234 socklen_t is wider than int (Bug#8277).
17235 (Fmake_network_process, server_accept_connection):
17236 (wait_reading_process_output, read_process_output):
17239 * process.c: Rename or move locals to avoid shadowing.
17240 (list_processes_1, Fmake_network_process):
17241 (read_process_output_error_handler, exec_sentinel_error_handler):
17242 Rename or move locals.
17243 (Fmake_network_process): Define label "retry_connect" only if needed.
17244 (Fnetwork_interface_info): Fix pointer signedness.
17245 (process_send_signal): Add cast to avoid pointer signedness problem.
17246 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17247 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17249 Make tparam.h and terminfo.c consistent.
17250 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17251 Include tparam.h instead, since it declares them.
17252 * cm.h (PC): Remove extern decl; tparam.h now does this.
17253 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17254 * terminfo.c: Include tparam.h, to check interfaces.
17255 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17256 (tparam): Adjust signature to match interface in tparam.h;
17257 this removes some undefined behavior. Check that outstring and len
17258 are zero, which they always are with Emacs.
17259 * tparam.h (PC, BC, UP): New extern decls.
17261 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17262 (xftfont_open): Rename locals to avoid shadowing.
17264 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17265 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17266 (OTF_TAG_SYM): Omit macro if not needed.
17267 (ftfont_list): Remove unused local.
17268 (get_adstyle_property, ftfont_pattern_entity):
17269 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17270 Rename locals to avoid shadowing.
17272 * xfont.c (xfont_list_family): Mark var as initialized.
17274 * xml.c (make_dom): Now static.
17276 * composite.c (composition_compute_stop_pos): Rename local to
17278 (composition_reseat_it): Remove unused locals.
17279 (find_automatic_composition, composition_adjust_point): Likewise.
17280 (composition_update_it): Mark var as initialized.
17281 (find_automatic_composition): Mark vars as initialized,
17282 with a FIXME (Bug#8290).
17284 character.h: Rename locals to avoid shadowing.
17285 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17286 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17287 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17288 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17289 to avoid shadowing.
17291 * textprop.c (property_change_between_p): Remove; unused.
17293 * intervals.c (interval_start_pos): Now static.
17295 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17297 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17298 Rename locals to avoid shadowing.
17300 * sound.c (wav_play, au_play, Fplay_sound_internal):
17301 Fix pointer signedness.
17302 (alsa_choose_format): Remove unused local var.
17303 (wav_play): Initialize a variable to 0, to prevent undefined
17304 behavior (Bug#8278).
17306 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17308 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17310 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17311 clobbering (Bug#8298).
17312 * sysdep.c (sys_subshell): Likewise.
17313 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17315 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17316 This should get cleaned up, so that child_setup has the
17317 same signature on all platforms.
17319 * callproc.c (call_process_cleanup): Now static.
17320 (relocate_fd): Rename locals to avoid shadowing.
17322 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
17324 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17325 not to be necessary, and produces flickering.
17327 2011-03-20 Glenn Morris <rgm@gnu.org>
17329 * config.in: Remove file.
17331 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
17333 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17334 are now in src/globals.h.
17335 (syms_of_minibuf): Remove spurious & from previous change.
17337 2011-03-20 Leo Liu <sdl.web@gmail.com>
17339 * minibuf.c (completing-read-function): New variable.
17340 (completing-read-default): Rename from completing-read.
17341 (completing-read): Call completing-read-function.
17343 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17345 * xfaces.c (Fx_load_color_file):
17346 Read color file from absolute filename (bug#8250).
17348 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17350 * makefile.w32-in: Update dependencies.
17352 2011-03-17 Eli Zaretskii <eliz@gnu.org>
17354 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17356 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17358 Fix more problems found by GCC 4.5.2's static checks.
17360 * process.c (make_serial_process_unwind, send_process_trap):
17361 (sigchld_handler): Now static.
17363 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17364 That way, the code declares only the vars that it needs.
17365 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17366 * s/cygwin.h (PTY_ITERATION): Likewise.
17367 * s/darwin.h (PTY_ITERATION): Likewise.
17368 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17370 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17371 * process.c (allocate_pty): Don't declare stb unless it's needed.
17373 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17374 (CONSTANTLIM): Remove; unused.
17375 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17376 Define only if needed.
17378 * unexelf.c (unexec): Name an expression,
17379 to avoid gcc -Wbad-function-cast warning.
17380 Use a different way to cause a compilation error if anyone uses
17381 n rather than nn, a way that does not involve shadowing.
17382 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17384 * deps.mk (unexalpha.o): Remove; unused.
17386 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17387 * unexec.h: New file.
17388 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17389 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17390 Depend on unexec.h.
17391 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17392 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17393 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17394 Change as necessary to match prototype in unexec.h.
17396 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17398 (back_comment, skip_chars): Mark vars as initialized.
17400 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17401 Rename locals to avoid shadowing.
17403 * lread.c (read1): Rewrite so as not to use empty "else".
17404 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17406 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17408 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17409 warning when compiling print.c.
17411 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17412 instead of using an uninitialized var.
17413 (font_sort_entities): Mark var as initialized.
17415 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17417 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17418 pointers to constants.
17419 (font_parse_fcname): Remove unused vars.
17420 (font_delete_unmatched): Now static.
17421 (font_get_spec): Remove; unused.
17422 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17423 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17424 Rename or move locals to avoid shadowing.
17426 * fns.c (require_nesting_list, require_unwind): Now static.
17427 (Ffillarray): Rename locals to avoid shadowing.
17429 * floatfns.c (domain_error2): Define only if needed.
17430 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17432 * alloc.c (mark_backtrace): Move decl from here ...
17433 * lisp.h: ... to here, so that it can be checked.
17435 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17436 (Fdefvar): Rewrite so as not to use empty "else".
17437 (lisp_indirect_variable): Name an expression,
17438 to avoid gcc -Wbad-function-cast warning.
17439 (Fdefvar): Rename locals to avoid shadowing.
17441 * callint.c (quotify_arg, quotify_args): Now static.
17442 (Fcall_interactively): Rename locals to avoid shadowing.
17443 Use const pointer when appropriate.
17445 * lisp.h (get_system_name, get_operating_system_release):
17446 Move decls here, to check interfaces.
17447 * process.c (get_operating_system_release): Move decl to lisp.h.
17448 * xrdb.c (get_system_name): Likewise.
17449 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17450 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17451 some of which prompt warnings from gcc -Wbad-function-cast.
17452 (Fformat_time_string, Fencode_time, Finsert_char):
17453 (Ftranslate_region_internal, Fformat):
17454 Rename or remove local vars to avoid shadowing.
17455 (Ftranslate_region_internal): Mark var as initialized.
17457 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17460 * lisp.h (eassert): Check that the argument compiles, even if
17461 ENABLE_CHECKING is not defined.
17463 * data.c (Findirect_variable): Name an expression, to avoid
17464 gcc -Wbad-function-cast warning.
17465 (default_value, arithcompare, arith_driver, arith_error): Now static.
17466 (store_symval_forwarding): Rename local to avoid shadowing.
17467 (Fmake_variable_buffer_local, Fmake_local_variable):
17468 Mark variables as initialized.
17469 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17471 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17472 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17473 Rename locals to avoid shadowing.
17474 (mark_stack): Move local variables into the #ifdef region where
17476 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17477 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17479 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17480 (GC_STRING_CHARS): Remove; not used.
17481 (Fmemory_limit): Cast sbrk's returned value to char *.
17483 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17484 avoids undefined behavior in theory.
17486 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17488 Use functions, not macros, for up- and down-casing (Bug#8254).
17489 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17490 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17491 to use the following functions instead of these macros.
17492 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17493 EMACS_INT, since callers assume the returned value fits in int.
17494 (upcase1): Likewise, for UPCASE_TABLE.
17495 (uppercasep, lowercasep, upcase): New static inline functions.
17496 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17497 the race-condition problem in the old DOWNCASE.
17499 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17500 Rename locals to avoid shadowing.
17501 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17502 (regex_compile, re_search_2, re_match_2_internal):
17503 Remove unused local vars.
17504 (FREE_VAR): Rewrite so as not to use empty "else",
17505 which gcc can warn about.
17506 (regex_compile, re_match_2_internal): Mark locals as initialized.
17507 (RETALLOC_IF): Define only if needed.
17508 (WORDCHAR_P): Likewise. This one is never needed, but is used
17509 only in a comment talking about a compiler bug, so put inside
17510 the #if 0 of that comment.
17511 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17512 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17515 * search.c (boyer_moore): Rename locals to avoid shadowing.
17516 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17517 (PREV_CHAR_BOUNDARY): Likewise.
17519 * search.c (simple_search): Remove unused var.
17521 * dired.c (compile_pattern): Move decl from here ...
17522 * lisp.h: ... to here, so that it can be checked.
17523 (struct re_registers): New forward decl.
17525 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17527 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17529 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17530 Rename locals to avoid shadowing.
17531 (Fvertical_motion): Mark locals as initialized.
17533 * casefiddle.c (casify_object, casify_region): Now static.
17534 (casify_region): Mark local as initialized.
17536 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17538 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17539 New macros, so that the caller can use some names other than
17540 gcpro1, gcpro2, etc.
17541 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17543 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17544 argument, for consistency with GCPRO2_VAR, etc: it is now the
17545 prefix of the variable, not the variable itself. All uses
17547 * dired.c (directory_files_internal, file_name_completion):
17548 Rename locals to avoid shadowing.
17550 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17551 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17552 dired.c's scmp function, had undefined behavior.
17553 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17554 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17555 * buffer.h: ... to here, because these macros use current_buffer,
17556 and the new implementation with inline functions needs to have
17557 current_buffer in scope now, rather than later when the macros
17559 (downcase, upcase1): New static inline functions.
17560 (DOWNCASE, UPCASE1): Reimplement using these functions.
17561 This avoids undefined behavior in expressions like
17562 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17563 from race conditions in accessing the global variables
17564 case_temp1 and case_temp2.
17565 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17566 * lisp.h (case_temp1, case_temp2): Remove their decls.
17567 * character.h (ASCII_CHAR_P): Move from here ...
17568 * lisp.h: ... to here, so that the inline functions mentioned
17569 above can use them.
17571 * dired.c (directory_files_internal_unwind): Now static.
17573 * fileio.c (file_name_as_directory, directory_file_name):
17574 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17576 (file_name_as_directory): Use const pointers when appropriate.
17577 (Fexpand_file_name): Likewise. In particular, newdir might
17578 point at constant storage, so make it a const pointer.
17579 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17580 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17582 (Fset_file_times, Finsert_file_contents, auto_save_error):
17583 Rename locals to avoid shadowing.
17585 * minibuf.c (choose_minibuf_frame_1): Now static.
17586 (Ftry_completion, Fall_completions): Rename or remove locals
17587 to avoid shadowing.
17589 * marker.c (bytepos_to_charpos): Remove; unused.
17591 * lisp.h (verify_bytepos, count_markers): New decls,
17592 so that gcc does not warn that these functions aren't declared.
17594 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17595 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17596 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17597 (copy_text): Remove unused local var.
17599 * filelock.c (within_one_second): Now static.
17600 (lock_file_1): Rename local to avoid shadowing.
17602 * buffer.c (fix_overlays_before): Mark locals as initialized.
17603 (fix_start_end_in_overlays): Likewise. This function should be
17604 simplified by using pointers-to-pointers, but that's a different
17606 (switch_to_buffer_1): Now static.
17607 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17608 (report_overlay_modification): Rename locals to avoid shadowing.
17610 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17611 Fix pointer signedness issue.
17612 (sys_subshell): Mark local as volatile if checking for lint,
17613 to suppress a gcc -Wclobbered warning that does not seem to be right.
17614 (MAXPATHLEN): Define only if needed.
17616 * process.c (serial_open, serial_configure): Move decls from here ...
17617 * systty.h: ... to here, so that they can be checked.
17619 * fns.c (get_random, seed_random): Move extern decls from here ...
17620 * lisp.h: ... to here, so that they can be checked.
17622 * sysdep.c (reset_io): Now static.
17623 (wait_for_termination_signal): Remove; unused.
17625 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17626 (copy_keymap_item, append_key, push_text_char_description):
17628 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17629 (DENSE_TABLE_SIZE): Remove; unused.
17630 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17631 (describe_map_tree):
17632 Rename locals to avoid shadowing.
17634 * keyboard.c: Declare functions static if they are not used elsewhere.
17635 (echo_char, echo_dash, cmd_error, top_level_2):
17636 (poll_for_input, handle_async_input): Now static.
17637 (read_char, kbd_buffer_get_event, make_lispy_position):
17638 (make_lispy_event, make_lispy_movement, apply_modifiers):
17639 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17640 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17641 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17642 (read_key_sequence, read_char): Mark locals as initialized.
17643 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17645 * keyboard.h (make_ctrl_char): New decl.
17646 (mark_kboards): Move decl here ...
17647 * alloc.c (mark_kboards): ... from here.
17649 * lisp.h (force_auto_save_soon): New decl.
17651 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17652 (DEFINE_DUMMY_FUNCTION): New macro.
17653 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17655 (main): Add casts to avoid warnings
17656 if GCC considers string literals to be constants.
17658 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17660 * dbusbind.c: Pointer signedness fixes.
17661 (xd_signature, xd_append_arg, xd_initialize):
17662 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17663 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17664 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17665 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17667 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17668 if GCC considers string literals to be constants.
17669 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17671 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17673 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17674 (print_preprocess, print_object): New macro to fix last change.
17676 * print.c (print_preprocess): Don't forget font objects.
17678 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17680 * emacs.c (USAGE3): Doc fixes.
17682 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17684 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17687 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17689 * lisp.h (VWindow_system, Qfile_name_history):
17690 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17691 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17692 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17694 * w32select.c: Don't #include "keyboard.h".
17695 (run_protected): Add extern declaration for waiting_for_input.
17697 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17698 * w32console.c (detect_input_pending, read_input_pending)
17699 (encode_terminal_code):
17700 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17701 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17702 (w32_system_caret_y, Qfile_name_history):
17703 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17704 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17705 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17706 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17707 * w32proc.c (Qlocal, report_file_error):
17708 * w32term.c (Vwindow_system, updating_frame):
17709 * w32uniscribe.c (initialized, uniscribe_font_driver):
17710 Remove unneeded extern declarations.
17712 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17714 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17716 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17718 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17719 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17720 These macros can no longer be used for assignment.
17722 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17723 Assign struct members directly, instead of using BUF_BEGV etc.
17724 (record_buffer_markers, fetch_buffer_markers): New functions for
17725 recording and fetching special buffer markers.
17726 (set_buffer_internal_1, set_buffer_temp): Use them.
17728 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17730 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17732 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17733 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17735 * xdisp.c (hscroll_window_tree):
17736 (reconsider_clip_changes): Use PT instead of BUF_PT.
17738 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17740 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17741 $(EMACS_ROOT)/lib/intprops.h.
17743 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17745 Fix more problems found by GCC 4.5.2's static checks.
17747 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17748 to unsigned char * to avoid compiler diagnostic.
17749 (xg_free_frame_widgets): Make it clear that a local variable is
17750 needed only if USE_GTK_TOOLTIP.
17751 (gdk_window_get_screen): Make it clear that this macro is needed
17752 only if USE_GTK_TOOLTIP.
17753 (int_gtk_range_get_value): New function, which avoids a diagnostic
17754 from gcc -Wbad-function-cast.
17755 (xg_set_toolkit_scroll_bar_thumb): Use it.
17756 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17757 diagnostic from gcc -Wbad-function-cast.
17758 (get_utf8_string, xg_get_file_with_chooser):
17759 Rename locals to avoid shadowing.
17760 (create_dialog): Move locals to avoid shadowing.
17762 * xgselect.c (xg_select): Remove unused var.
17764 * image.c (four_corners_best): Mark locals as initialized.
17765 (gif_load): Initialize transparent_p to zero (Bug#8238).
17766 Mark another local as initialized.
17767 (my_png_error, my_error_exit): Mark with NO_RETURN.
17769 * image.c (clear_image_cache): Now static.
17770 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17771 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17772 (x_edge_detection): Remove unnecessary cast that
17773 gcc -Wbad-function-cast diagnoses.
17774 (gif_load): Fix pointer signedness.
17775 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17776 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17778 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17780 Improve quality of tests for time stamp overflow.
17781 For example, without this patch (encode-time 0 0 0 1 1
17782 1152921504606846976) returns the obviously-bogus value (-948597
17783 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17784 reports time overflow. See
17785 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17786 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17787 * editfns.c: Include limits.h and intprops.h.
17788 (TIME_T_MIN, TIME_T_MAX): New macros.
17789 (time_overflow): Move earlier, to before first use.
17790 (hi_time, lo_time): New functions, for an accurate test for
17791 out-of-range times.
17792 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17793 (Fget_internal_run_time): Don't assume time_t fits in int.
17794 (make_time): Use list2 instead of Fcons twice.
17795 (Fdecode_time): More accurate test for out-of-range times.
17796 (check_tm_member): New function.
17797 (Fencode_time): Use it, to test for out-of-range times.
17798 (lisp_time_argument): Don't rely on undefined left-shift and
17799 right-shift behavior when checking for time stamp overflow.
17801 * editfns.c (time_overflow): New function, refactoring common code.
17802 (Fformat_time_string, Fdecode_time, Fencode_time):
17803 (Fcurrent_time_string): Use it.
17805 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17806 * dired.c (make_time): Move to ...
17807 * editfns.c (make_time): ... here.
17808 * systime.h: Note the move.
17810 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17812 * fringe.c (update_window_fringes): Remove unused variables.
17814 * unexmacosx.c (copy_data_segment): Also copy __got section.
17817 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17819 * termcap.c [MSDOS]: Include "msdos.h".
17820 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17821 Constify `char *' arguments and their references according to
17822 prototypes in tparam.h.
17824 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17826 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17827 Adapt all references accordingly.
17829 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17831 2011-03-11 Tom Tromey <tromey@redhat.com>
17833 * buffer.c (syms_of_buffer): Remove obsolete comment.
17835 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17837 * termhooks.h (encode_terminal_code): Declare prototype.
17839 * msdos.c (encode_terminal_code): Don't declare prototype.
17841 * term.c (encode_terminal_code): Now external again, used by
17842 w32console.c and msdos.c.
17844 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17845 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17847 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17849 Fix some minor problems found by GCC 4.5.2's static checks.
17851 * fringe.c (update_window_fringes): Mark locals as initialized
17853 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17855 * alloc.c (mark_fringe_data): Move decl from here ...
17856 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17857 to check its interface.
17858 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17860 * fontset.c (free_realized_fontset): Now static.
17861 (Fset_fontset_font): Rename local to avoid shadowing.
17862 (fontset_font): Mark local as initialized.
17863 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17865 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17867 * xselect.c (x_disown_buffer_selections): Remove; not used.
17868 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17869 (x_own_selection, Fx_disown_selection_internal): Rename locals
17870 to avoid shadowing.
17871 (x_handle_dnd_message): Remove local to avoid shadowing.
17873 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17874 so that the caller can use some name other than gcpro1.
17875 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17876 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17877 (Fx_backspace_delete_keys_p):
17878 Use them to avoid shadowing, and rename vars to avoid shadowing.
17879 (x_decode_color, x_set_name, x_window): Now static.
17880 (Fx_create_frame): Add braces to silence GCC warning.
17881 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17882 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17883 Remove unused locals.
17884 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17885 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17886 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17889 * xterm.h (x_mouse_leave): New decl.
17891 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17892 Remove unused functions.
17893 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17894 (x_calc_absolute_position): Now static.
17895 (XTread_socket): Don't define label "out" unless it's used.
17896 Don't declare local "event" unless it's used.
17897 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17898 unless they are used.
17899 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17900 (x_fatal_error_signal): Remove; not used.
17901 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17902 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17903 (x_error_catcher, x_connection_closed, x_error_handler):
17904 (x_error_quitter, xembed_send_message, x_iconify_frame):
17905 (my_log_handler): Rename locals to avoid shadowing.
17906 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17907 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17909 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17910 Rename or move locals to avoid shadowing.
17911 (tty_defined_color, merge_face_heights): Now static.
17912 (free_realized_faces_for_fontset): Remove; not used.
17913 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17914 does not deduce is never used uninitialized.
17915 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17916 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17918 * terminal.c (store_terminal_param): Now static.
17920 * xmenu.c (menu_highlight_callback): Now static.
17921 (set_frame_menubar): Remove unused local.
17922 (xmenu_show): Rename parameter to avoid shadowing.
17923 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17924 since they might point to immutable storage.
17925 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17926 since it's unused otherwise.
17928 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17929 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17930 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17931 avoids a gcc -Wuninitialized diagnostic.
17932 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17933 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17934 does not deduce are never used uninitialized.
17936 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17938 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17939 * window.c (window_loop, size_window):
17940 (run_window_configuration_change_hook, enlarge_window): Likewise.
17942 * window.c (display_buffer): Now static.
17943 (size_window): Mark variables that gcc -Wuninitialized
17944 does not deduce are never used uninitialized.
17945 * window.h (check_all_windows): New decl, to forestall
17946 gcc -Wmissing-prototypes diagnostic.
17947 * dispextern.h (bidi_dump_cached_states): Likewise.
17949 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17951 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17952 Include <limits.h>.
17953 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17954 and to avoid gcc -Wuninitialized warning.
17955 (load_charset_map): Mark variables that gcc -Wuninitialized
17956 does not deduce are never used uninitialized.
17957 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17959 * coding.c (coding_set_source, coding_set_destination):
17960 Use "else { /* comment */ }" rather than "else /* comment */;"
17961 for clarity, and to avoid gcc -Wempty-body warning.
17962 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17963 a block, when the outer 'i' will do.
17964 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17965 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17966 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17967 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17968 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17969 Rename locals to avoid shadowing.
17970 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17971 * coding.c (emacs_mule_char, encode_invocation_designation):
17972 Now static, since they're not used elsewhere.
17973 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17974 (decode_coding_object, encode_coding_object, detect_coding_system):
17975 (decode_coding_emacs_mule): Mark variables that gcc
17976 -Wuninitialized does not deduce are never used uninitialized.
17977 (detect_coding_iso_2022): Initialize a local variable that might
17978 be used uninitialized. Leave a FIXME because it's not clear that
17979 this initialization is needed. (Bug#8211)
17980 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17981 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17982 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17983 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17984 Remove unused macros.
17986 * category.c (hash_get_category_set): Remove unused local var.
17987 (copy_category_table): Now static, since it's not used elsewhere.
17988 * character.c (string_count_byte8): Likewise.
17990 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17991 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17993 * chartab.c (copy_sub_char_table): Now static, since it's not used
17995 (sub_char_table_ref_and_range, char_table_ref_and_range):
17996 Rename locals to avoid shadowing.
17997 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17999 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18000 (BIDI_BOB): Remove unused macro.
18002 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18003 deduce are never used uninitialized.
18004 * term.c (encode_terminal_code): Likewise.
18006 * term.c (encode_terminal_code): Now static. Remove unused local.
18008 * tparam.h: New file.
18009 * term.c, tparam.h: Include it.
18010 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18011 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18012 Move these decls to tparam.h, and make them agree with what
18013 is actually in tparam.c. The previous trick of using incompatible
18014 decls in different modules does not conform to the C standard.
18015 All callers of tparam changed to use tparam's actual API.
18016 * tparam.c (tparam1, tparam, tgoto):
18017 Use const pointers where appropriate.
18019 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18020 * cm.h (struct cm): Likewise.
18021 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18022 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18023 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18024 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18025 (turn_on_face, init_tty): Likewise.
18026 * termchar.h (struct tty_display_info): Likewise.
18028 * term.c (term_mouse_position): Rename local to avoid shadowing.
18030 * alloc.c (mark_ttys): Move decl from here ...
18031 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18033 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18035 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18037 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
18039 * search.c (compile_pattern_1): Remove argument regp, unused since
18040 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18041 (compile_pattern): Don't pass it.
18043 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18045 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18046 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18048 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18050 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18052 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18053 gdk_window_get_screen, gdk_window_get_geometry,
18054 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18055 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18056 (xg_get_pixbuf_from_pixmap): New function.
18057 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18058 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18059 Call xg_get_pixbuf_from_pixmap instead of
18060 gdk_pixbuf_get_from_drawable.
18061 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18062 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18063 (xg_check_special_colors): Use GtkStyleContext and its functions
18065 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18066 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18067 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18068 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18069 Call gtk_widget_get_preferred_size.
18070 (xg_frame_resized): gdk_window_get_geometry only takes 5
18072 (xg_win_to_widget, xg_event_is_for_menubar):
18073 Call gdk_x11_window_lookup_for_display.
18074 (xg_set_widget_bg): New function.
18075 (delete_cb): New function.
18076 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18077 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18078 (xg_set_background_color): Call xg_set_widget_bg.
18079 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18080 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18081 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18082 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18084 (update_frame_tool_bar): Call gtk_widget_hide.
18085 (xg_initialize): Use GDK_KEY_g.
18087 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18089 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18091 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18092 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18093 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18095 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18097 * w32xfns.c (select_palette): Check success of RealizePalette against
18098 GDI_ERROR, not zero.
18100 See ChangeLog.11 for earlier changes.
18102 ;; Local Variables:
18106 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18108 This file is part of GNU Emacs.
18110 GNU Emacs is free software: you can redistribute it and/or modify
18111 it under the terms of the GNU General Public License as published by
18112 the Free Software Foundation, either version 3 of the License, or
18113 (at your option) any later version.
18115 GNU Emacs is distributed in the hope that it will be useful,
18116 but WITHOUT ANY WARRANTY; without even the implied warranty of
18117 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18118 GNU General Public License for more details.
18120 You should have received a copy of the GNU General Public License
18121 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.