1 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
3 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5 2012-09-30 Chong Yidong <cyd@gnu.org>
7 * fns.c (Frandom): Doc fix.
9 2012-09-30 Martin Rudalics <rudalics@gmx.at>
11 * window.c (Vwindow_combination_limit): New default value.
12 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
14 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
16 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
17 Suggested by Eli Zaretskii in
18 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
20 2012-09-30 Eli Zaretskii <eliz@gnu.org>
22 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
23 HAVE_TIMER_SETTIME is defined.
25 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
27 Profiler improvements: more-accurate timers, overflow checks.
28 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
29 signal.h, setjmp.h. Include systime.h instead.
30 (saturated_add): New function.
31 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
32 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
33 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
35 (enum profiler_cpu_running): New enum.
36 (profiler_cpu_running): Now of that enum type, not bool.
37 All uses changed to store the new value.
38 (handle_profiler_signal): Rename from sigprof_handler_1,
39 for consistency with other handlers. Do not check whether
40 cpu_log is a hash-table if garbage collecting, since it
41 doesn't matter in that case.
42 (deliver_profiler_signal): Rename from sigprof_handler,
43 for consistency with other handlers.
44 (setup_cpu_timer): New function, with much of what used to be in
45 Fprofiler_cpu_start. Check for out-of-range argument.
46 Prefer timer_settime if available, and prefer
47 thread cputime clocks, then process cputime clocks, then
48 monotonic clocks, to the old realtime clock. Use make_timeval
49 to round more-correctly when falling back to setitimer.
50 (Fprofiler_cpu_start): Use it.
51 (Fprofiler_cpu_stop): Prefer timer_settime if available.
52 Don't assume that passing NULL as the 2nd argument of setitimer
53 is the same as passing a pointer to all-zero storage.
54 Ignore SIGPROF afterwards.
55 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
56 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
57 non-fatal signal handlers. Ignore SIGPROF on startup.
58 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
59 in profiler.c, since sysdep.c now uses it.
61 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
62 Suggested by Eli Zaretskii in
63 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
65 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
67 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
69 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
71 * lisp.h (struct backtrace): Remove indirection for `function' field.
72 * xdisp.c (redisplay_internal):
73 * profiler.c (record_backtrace, sigprof_handler_1):
74 * alloc.c (Fgarbage_collect):
75 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
76 (Fbacktrace_frame): Adjust accordingly.
78 2012-09-28 Glenn Morris <rgm@gnu.org>
80 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
81 (Frun_hook_with_args_until_failure): Doc fixes.
83 2012-09-28 Eli Zaretskii <eliz@gnu.org>
85 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
86 Qautomatic_redisplay and change the symbol name. All users changed.
88 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
90 * profiler.c (sigprof_handler): Fix race condition.
92 2012-09-28 Glenn Morris <rgm@gnu.org>
94 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
96 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
98 Check more robustly for timer_settime.
99 * Makefile.in (LIB_TIMER_TIME): New macro.
101 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
102 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
105 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
107 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
109 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
111 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
113 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
115 * character.h (MAYBE_UNIFY_CHAR): Remove.
116 * charset.c, charset.h (maybe_unify_char): Now static.
117 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
118 Since this stuff is now private to charset.c, there's no need for
119 a public macro and no need to inline by hand.
121 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
122 Stefan Monnier <monnier@iro.umontreal.ca>
123 Juanma Barranquero <lekktu@gmail.com>
125 * profiler.c: New file.
126 * Makefile.in (base_obj): Add profiler.o.
127 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
128 ($(BLD)/profiler.$(O)): New target.
129 * emacs.c (main): Call syms_of_profiler.
130 * alloc.c (Qautomatic_gc): New constant.
131 (MALLOC_PROBE): New macro.
132 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
133 (total_bytes_of_live_objects): New function.
134 (Fgarbage_collect): Use it. Record itself in backtrace_list.
135 Call malloc_probe for the memory profiler.
136 (syms_of_alloc): Define Qautomatic_gc.
137 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
139 (struct backtrace): Move definition...
140 * lisp.h (struct backtrace): ..here.
141 (Qautomatic_gc, profiler_memory_running): Declare vars.
142 (malloc_probe, syms_of_profiler): Declare functions.
143 * xdisp.c (Qautomatic_redisplay): New constant.
144 (redisplay_internal): Record itself in backtrace_list.
145 (syms_of_xdisp): Define Qautomatic_redisplay.
147 2012-09-25 Eli Zaretskii <eliz@gnu.org>
148 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
150 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
152 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
154 Prefer POSIX timers if available.
155 They avoid a race if the timer is too close to the current time.
156 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
157 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
158 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
160 2012-09-25 Eli Zaretskii <eliz@gnu.org>
162 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
164 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
167 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
169 Move Vlibrary_cache to emacs.c and reset before dumping.
171 * lisp.h (reset_image_types): Declare.
172 [WINDOWSNT] (Vlibrary_cache): Declare.
174 * image.c (reset_image_types): New function.
176 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
177 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
178 (Fdump_emacs): Reset Vlibrary_cache and image_types.
180 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
181 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
183 * w32.h (Vlibrary_cache): Do not declare.
185 2012-09-25 Eli Zaretskii <eliz@gnu.org>
187 * w32proc.c (sys_signal): Handle all signals defined by the
188 MS-Windows runtime, not just SIGCHLD. Actually install the signal
189 handlers for signals supported by Windows. Don't override
190 term_ntproc as the handler for SIGABRT.
191 (sigaction): Rewrite to call sys_signal instead of duplicating its
193 (sys_kill): Improve commentary.
195 * w32.c (term_ntproc): Accept (and ignore) one argument, for
196 consistency with a signature of a signal handler. All callers
198 (init_ntproc): Accept an argument DUMPING. If dumping, don't
199 install term_ntproc as a signal handler for SIGABRT, as that
200 should be done by the dumped Emacs.
202 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
204 * w32select.c (term_w32select): Protect against repeated
205 invocation by setting clipboard_owner to NULL after calling
208 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
209 and term_ntproc to their modified signatures.
211 * character.c (char_string, string_char): Remove calls to
212 MAYBE_UNIFY_CHAR. See the discussion starting at
213 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
216 2012-09-25 Chong Yidong <cyd@gnu.org>
218 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
220 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
222 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
223 when encountering an unknown bytecode.
225 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
227 image.c, indent.c: Use bool for booleans.
228 * dispextern.h (struct image_type): Members valid_p, load, init
229 now return bool, not int. All uses changed.
230 * image.c: Omit unnecessary static decls.
231 (x_create_bitmap_mask, x_build_heuristic_mask):
232 Return void, not int, since callers don't care about the return value.
233 (x_create_bitmap_mask, define_image_type, valid_image_p)
234 (struct image_keyword, parse_image_spec, image_spec_value)
235 (check_image_size, image_background)
236 (image_background_transparent, x_clear_image_1)
237 (postprocess_image, lookup_image, x_check_image_size)
238 (x_create_x_image_and_pixmap, xbm_image_p)
239 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
240 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
241 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
242 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
243 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
244 (png_image_p, init_png_functions, png_load_body, png_load)
245 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
246 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
247 (init_gif_functions, gif_load, imagemagick_image_p)
248 (imagemagick_load_image, imagemagick_load, svg_image_p)
249 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
251 * nsimage.m (ns_load_image):
252 * nsterm.m (ns_defined_color):
253 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
254 * xfns.c (x_defined_color):
255 * xterm.c (x_alloc_lighter_color_for_widget)
256 (x_alloc_nearest_color_1, x_alloc_nearest_color)
257 (x_alloc_lighter_color):
258 * indent.c (disptab_matches_widthtab, current_column)
259 (scan_for_column, string_display_width, indented_beyond_p)
260 (compute_motion, vmotion, Fvertical_motion):
261 Use bool for booleans.
263 2012-09-24 Chong Yidong <cyd@gnu.org>
265 * chartab.c (Fset_char_table_default): Obsolete function removed.
267 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
269 Move pid_t related decls out of lisp.h.
270 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
271 (interruptible_wait_for_termination):
272 Move these decls from lisp.h to syswait.h, since they use pid_t.
273 Needed on FreeBSD; see Herbert J. Skuhra in
274 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
275 * callproc.c: Include syswait.h.
277 gnutls.c, gtkutil.c: Use bool for boolean.
278 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
279 (emacs_gnutls_handle_error):
280 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
281 (xg_hide_tooltip, xg_create_frame_widgets)
282 (create_dialog, xg_uses_old_file_dialog)
283 (xg_get_file_with_chooser, xg_get_file_with_selection)
284 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
285 (xg_item_label_same_p, xg_update_menubar)
286 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
287 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
288 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
289 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
290 (update_frame_tool_bar, free_frame_tool_bar):
291 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
292 * nsmenu.m (ns_update_menubar):
293 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
294 * xfns.c (Fx_show_tip) [USE_GTK]:
295 Use bool for boolean.
296 * gtkutil.c (xg_update_frame_menubar):
297 * xmenu.c (update_frame_menubar):
298 Return void, not int, since caller ignores return value.
299 * gtkutil.c (xg_change_toolbar_position):
302 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
304 * makefile.w32-in (BLOCKINPUT_H): Remove.
305 (SYSSIGNAL_H): New macro.
306 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
307 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
308 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
309 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
310 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
311 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
312 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
313 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
314 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
315 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
316 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
317 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
318 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
319 ($(BLD)/w32xfns.$(O)): Update dependencies.
321 2012-09-23 Eli Zaretskii <eliz@gnu.org>
323 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
324 fatal_error_backtrace.
326 * w32proc.c (sys_kill): Undo last change: don't do anything when
327 invoked to deliver SIGABRT to our own process. This is now
328 handled by emacs_raise.
330 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
332 * w32term.c (w32_read_socket): Remove leftover reference to
333 interrupt_input_pending.
335 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
337 Do not use SA_NODEFER.
338 Problem reported by Dani Moncayo in
339 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
341 * sysdep.c (emacs_abort): Do not reset signal handler.
342 * emacs.c (terminate_due_to_signal): Reset signal handler here.
343 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
344 wanted even on POSIXish hosts, and it doesn't work on Windows.
346 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
348 * xterm.c (x_term_init): Call fixup_locale before and after calling
349 gtk_init (Bug#12392).
351 2012-09-23 Chong Yidong <cyd@gnu.org>
353 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
354 Vdynamic_library_alist.
356 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
357 (Fgnutls_available_p): Caller changed.
359 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
360 (Flibxml_parse_xml_region): Likewise.
362 * dispextern.h (struct image_type): Remove arg from init function.
364 * image.c (Finit_image_library, lookup_image_type)
365 (define_image_type): Remove now-unneeded second arg.
366 (init_xpm_functions, init_png_functions, init_jpeg_functions)
367 (init_tiff_functions, init_gif_functions, init_svg_functions):
368 Arglist and w32_delayed_load calling convention changed.
369 (gs_type): Remove init_gs_functions; there is no such function.
370 (valid_image_p, make_image): Fix caller to lookup_image_type.
372 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
374 Simplify and avoid signal-handling races (Bug#12471).
376 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
377 Avoid recursive loop if there's a fatal error in the function itself.
378 * atimer.c (pending_atimers):
379 * blockinput.h: Don't include "atimer.h"; no longer needed.
380 (interrupt_input_pending): Remove. All uses removed.
381 pending_signals now counts both atimers and ordinary interrupts.
382 This is less racy than having three separate pending-signal flags.
383 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
385 Rename from their upper-case counterparts BLOCK_INPUT,
386 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
387 INPUT_BLOCKED_P, and turn into functions. All uses changed.
388 This makes it easier to access volatile variables more accurately.
389 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
390 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
391 that's more reliable if the code is buggy and sets
392 interrupt_input_blocked to a negative value. All uses changed.
393 * atimer.c (deliver_alarm_signal):
394 Remove. No need to deliver this to the parent; any thread can
395 handle this signal now. All uses replaced by underlying handler.
396 * atimer.c (turn_on_atimers):
397 * dispnew.c (handle_window_change_signal):
398 * emacs.c (handle_danger_signal):
399 * keyboard.c (kbd_buffer_get_event):
400 Don't reestablish signal handler; not needed with sigaction.
401 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
403 Rework to avoid unnecessary accesses to volatile variables.
404 (UNBLOCK_INPUT_TO): Now a function.
405 (totally_unblock_input, unblock_input): New decls.
406 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
407 (init_data): Remove. Necessary stuff now done in init_signal.
408 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
409 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
410 (fatal_error_code): Remove; no longer needed.
411 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
412 it doesn't always backtrace. All uses changed. No need to reset
413 signal to default, since sigaction and/or die does that for us now.
414 Use emacs_raise (FOO), not kill (getpid (), FOO).
415 (main): Check more-accurately whether we're dumping.
416 Move fatal-error setup to sysdep.c
417 * floatfns.c: Do not include "syssignal.h"; no longer needed.
418 * gtkutil.c (xg_get_file_name, xg_get_font):
419 Remove no-longer-needed signal-mask manipulation.
420 * keyboard.c, process.c (POLL_FOR_INPUT):
421 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
422 * keyboard.c (read_avail_input): Remove.
423 All uses replaced by gobble_input.
424 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
425 (kbd_buffer_store_event_hold, gobble_input):
426 (record_asynch_buffer_change) [USABLE_SIGIO]:
427 (store_user_signal_events):
428 No need to mess with signal mask.
429 (gobble_input): If blocking input and there are terminals, simply
430 set pending_signals to 1 and return. All hooks changed to not
431 worry about whether input is blocked.
432 (process_pending_signals): Clear pending_signals before processing
433 them, in case a signal comes in while we're processing.
434 By convention callers now test pending_signals before calling us.
435 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
436 New functions, to support changes to blockinput.h.
437 (handle_input_available_signal): Now extern.
438 (reinvoke_input_signal): Remove. All uses replaced by
440 (quit_count): Now volatile, since a signal handler uses it.
441 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
442 All callers changed. Block SIGINT only if not already blocked.
443 Clear sigmask reliably, even if Fsignal returns, which it can.
444 Omit unnecessary accesses to volatile var.
445 (quit_throw_to_read_char): No need to restore sigmask.
446 * keyboard.c (gobble_input, handle_user_signal):
447 * process.c (wait_reading_process_output):
448 Call signal-handling code rather than killing ourselves.
449 * lisp.h: Include <float.h>, for...
450 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
451 (pending_signals): Now volatile.
452 (syms_of_data): Now const if IEEE floating point.
453 (handle_input_available_signal) [USABLE_SIGIO]:
454 (terminate_due_to_signal, record_child_status_change): New decls.
455 * process.c (create_process): Avoid disaster if memory is exhausted
456 while we're processing a vfork, by tightening the critical section
458 (send_process_frame, process_sent_to, handle_pipe_signal)
459 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
461 (send_process): No need for setjmp/longjmp any more, since the
462 SIGPIPE stuff is now gone. Instead, report an error if errno
464 (record_child_status_change): Now extern. PID and W are now args.
465 Return void, not bool. All callers changed.
466 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
467 Remove. All uses removed. This bug should be fixed now in a
469 (wait_for_termination_1): Use waitpid rather than sigsuspend,
470 and record the child status change directly. This avoids the
471 need to futz with the signal mask.
472 (process_fatal_action): Move here from emacs.c.
473 (emacs_sigaction_flags): New function, containing
474 much of what used to be in emacs_sigaction_init.
475 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
476 caught by emacs, to make races less likely.
477 (deliver_process_signal): Rename from handle_on_main_thread.
479 (BACKTRACE_LIMIT_MAX): Now at top level.
480 (thread_backtrace_buffer, threadback_backtrace_pointers):
482 (deliver_thread_signal, deliver_fatal_thread_signal):
483 New functions, for more-accurate delivery of thread-specific signals.
484 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
485 (deliver_arith_signal): Handle in this thread, not
486 in the main thread, since it's triggered by this thread.
487 (maybe_fatal_sig): New function.
488 (init_signals): New arg DUMPING so that we can be more accurate
489 about whether we're dumping. Caller changed.
490 Treat thread-specific signals differently from process-general signals.
491 Block all signals while handling fatal error; that's safer.
492 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
494 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
495 Ignore SIGPIPE unless batch.
496 (emacs_backtrace): Output backtrace for the appropriate thread,
497 which is not necessarily the main thread.
498 * syssignal.h: Include <stdbool.h>.
499 (emacs_raise): New macro.
500 * xterm.c (x_connection_signal): Remove; no longer needed
501 now that we use sigaction.
502 (x_connection_closed): No need to mess with sigmask now.
503 (x_initialize): No need to reset SIGPIPE handler here, since
504 init_signals does this for us now.
506 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
508 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
509 background rect may be larger (Bug#12245).
511 2012-09-23 Chong Yidong <cyd@gnu.org>
513 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
515 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
517 * .gdbinit: Just stop at fatal_error_backtrace.
518 See Stefan Monnier's request in
519 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
520 Remove no-longer-used query of system type.
522 2012-09-22 Chong Yidong <cyd@gnu.org>
524 * search.c (Freplace_match): Doc fix (Bug#12325).
526 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
528 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
529 (Fline_end_position): Doc fix.
531 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
533 2012-09-22 Chong Yidong <cyd@gnu.org>
535 * dispextern.h (struct image_type): Add new slot, storing a type
536 initialization function.
538 * image.c (define_image_type): Call the image initializer function
539 if it is defined. Arguments and return value changed.
540 (valid_image_p, make_image): Callers changed.
541 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
542 (gif_type, imagemagick_type, svg_type, gs_type):
543 Add initialization functions.
544 (Finit_image_library): Call lookup_image_type.
545 (CHECK_LIB_AVAILABLE): Macro deleted.
546 (lookup_image_type): Call define_image_type here, rather than via
547 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
548 (syms_of_image): Move define_image_type calls for xbm_type and
549 pbm_type to lookup_image_type.
551 2012-09-22 Eli Zaretskii <eliz@gnu.org>
553 * keyboard.c (timer_check_2): Move calculation of 'timers' and
554 'idle_timers' from here ...
555 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
556 lists, to avoid infloops when the timer does something stupid,
557 like reinvoke itself with the same or smaller time-out.
560 2012-09-22 Martin Rudalics <rudalics@gmx.at>
562 * window.c (Fsplit_window_internal): Handle only Qt value of
563 Vwindow_combination_limit separately.
564 (Qtemp_buffer_resize): New symbol.
565 (Vwindow_combination_limit): New default value.
568 2012-09-22 Eli Zaretskii <eliz@gnu.org>
570 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
571 the new overlay string. (Bug#10159)
573 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
575 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
576 or that fprintf is async-signal-safe. POSIX doesn't require
579 2012-09-22 Chong Yidong <cyd@gnu.org>
581 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
584 2012-09-22 Kenichi Handa <handa@gnu.org>
586 * composite.c (composition_reseat_it): Handle the case that a
587 grapheme cluster is not covered by a single font (Bug#12352).
589 2012-09-21 Chong Yidong <cyd@gnu.org>
591 * image.c (define_image_type): Avoid adding duplicate types to
592 image_types (Bug#12463). Suggested by Jörg Walter.
594 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
596 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
597 (print_load_command_name): Add case LC_DATA_IN_CODE.
598 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
600 2012-09-21 Glenn Morris <rgm@gnu.org>
602 * eval.c (Frun_hook_with_args_until_success)
603 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
605 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
607 * fileio.c (Ffile_selinux_context): Only call freecon when
608 lgetfilecon succeeded.
609 (Fset_file_selinux_context): Likewise. (Bug#12444)
611 2012-09-21 Eli Zaretskii <eliz@gnu.org>
613 * xdisp.c (try_window_reusing_current_matrix): Under bidi
614 reordering, locate the cursor by calling set_cursor_from_row; if
615 that fails, clear the desired glyph matrix before returning a
616 failure indication to the caller. Fixes leaving garbled display
617 when fast scrolling with a down-key. (Bug#12403)
618 (compute_stop_pos_backwards): Fix a typo that caused crashes while
619 scrolling through multibyte text.
621 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
623 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
624 calling mark_vectorlike since that's the one that marks the window.
625 (mark_discard_killed_buffers): Mark the final cdr.
626 * window.h (struct window): Move prev/next_buffers to the
628 * window.c (make_window): Initialize prev/next_buffers manually.
630 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
632 Omit unused arg EXPECTED from socket hooks.
633 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
634 * nsterm.m (ns_term_init):
635 * termhooks.h (struct terminal.read_socket_hook):
636 * w32inevt.c (w32_console_read_socket):
637 * w32term.c (w32_read_socket):
638 * xterm.c (XTread_socket):
639 Omit unused arg EXPECTED. All callers changed.
640 (store_user_signal_events): Return void, not int, since callers no
641 longer care about the return value. All uses changed.
643 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
645 * w32gui.h (XParseGeometry): Do not declare.
647 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
649 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
650 Ignore 'expected'. See Eli Zaretskii in
651 <http://bugs.gnu.org/12471#8> (last line).
653 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
654 (XParseGeometry): Now static. Substitute extremal values for
655 values that are out of range.
657 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
659 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
661 * nsfns.m (XParseGeometry): Remove.
662 (Fx_create_frame): Call x_set_offset to correctly interpret
665 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
666 (Fx_parse_geometry): If there is a space in string, call
667 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
669 2012-09-17 Eli Zaretskii <eliz@gnu.org>
671 * search.c (scan_buffer): Use character positions in calls to
672 region_cache_forward and region_cache_backward, not byte
673 positions. (Bug#12196)
675 * w32term.c (w32_read_socket): Set pending_signals to 1, like
676 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
678 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
679 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
680 emacs_blocked_malloc, now deleted.
682 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
684 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
685 The workaround was for improving performance on Solaris 2.4, but
686 is getting in the way now. Emacs will still work if someone is
687 still running Solaris 2.4 in a museum somewhere; Sun dropped
688 support for Solaris 2.4 in 2003.
689 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
690 * process.c (create_process) [HAVE_WORKING_VFORK]:
691 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
692 since Emacs no longer uses vfork on that platform.
694 2012-09-17 Glenn Morris <rgm@gnu.org>
696 * emacs.c: Use COPYRIGHT.
698 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
700 Remove configure's --without-sync-input option (Bug#12450).
701 When auditing signal-handling in preparation for cleaning it up,
702 I found that SYNC_INPUT has race conditions and would be a real
703 pain to fix. Since it's an undocumented and deprecated
704 configure-time option, now seems like a good time to remove it.
705 Also see <http://bugs.gnu.org/11080#16>.
706 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
707 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
708 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
710 (check_depth) [XMALLOC_OVERRUN_CHECK]:
711 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
712 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
713 (dont_register_blocks, bytes_used_when_reconsidered)
714 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
715 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
716 [!SYSTEM_MALLOC && !SYNC_INPUT]:
717 Remove. All uses removed.
718 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
719 implementation, one that depends on whether the new macro
720 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
722 * atimer.c (run_timers, handle_alarm_signal):
723 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
724 (handle_async_input, process_pending_signals)
725 (handle_input_available_signal, init_keyboard):
726 * nsterm.m (ns_read_socket):
727 * process.c (wait_reading_process_output):
728 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
729 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
731 * xterm.c (XTread_socket):
733 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
734 * eval.c (handling_signal): Remove. All uses removed.
735 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
736 All uses replaced with the SYNC_INPUT version.
737 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
739 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
742 * font.c (Ffont_shape_gstring): Remove unused local.
744 2012-09-16 Glenn Morris <rgm@gnu.org>
746 * Makefile.in (clean): No longer run nextstep's clean.
748 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
750 (ns-app): Move here from ns.mk, and simplify.
751 (clean): Simplify nextstep entry.
752 * ns.mk: Remove file.
754 2012-09-17 Kenichi Handa <handa@gnu.org>
756 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
757 not covert the last few charactes.
759 2012-09-16 Kenichi Handa <handa@gnu.org>
761 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
762 here, but just check the validity of glyphs in the glyph-string.
764 2012-09-16 Martin Rudalics <rudalics@gmx.at>
766 * window.c (Fwindow_parameter, Fset_window_parameter):
767 Accept any window as argument (Bug#12452).
769 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
771 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
772 to ns_term_init to avoid memory leak.
774 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
775 explicit retain/release.
776 (ns_term_init): Only allow one display. Initialize outerpool and
779 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
781 Port _setjmp fix to POSIXish hosts as well as Microsoft.
782 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
783 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
784 the Microsoft problem in a different way, by altering ../nt/config.nt.
786 2012-09-15 Eli Zaretskii <eliz@gnu.org>
801 * w16select.c: Remove inclusion of setjmp.h, as it is now included
802 by lisp.h. This completes removal of setjmp.h inclusion
803 erroneously announced in the previous commit. (Bug#12446)
805 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
808 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
809 not defined as a macro. The latter happens on MS-Windows.
812 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
814 Port better to POSIX hosts lacking _setjmp (Bug#12446).
815 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
816 Some instances of '#include <setjmp.h>' removed, if the
817 only reason for the instance was because "lisp.h" was included.
818 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
819 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
820 and _longjmp with the new symbols. Emacs already uses _setjmp if
821 available, so this change affects only POSIXish hosts that have
822 sigsetjmp but not _setjmp, such as some versions of Solaris and
823 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
824 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
825 (png_load_body) [HAVE_PNG]:
826 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
827 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
828 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
829 since PNG requires jmp_buf. This is the only exception to the
830 general rule that we now use sys_setjmp and sys_longjmp.
831 This exception is OK since this code does not change the signal
832 mask or longjmp out of a signal handler.
834 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
836 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
837 Include "syssignal.h", for 'main_thread'.
839 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
841 Avoid out-of-range marker position (Bug#12426).
842 * insdel.c (replace_range, replace_range_2):
843 Adjust markers before overlays, as suggested by comments.
844 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
845 Remove redundant check before calling offset_intervals.
847 2012-09-14 Martin Rudalics <rudalics@gmx.at>
849 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
850 current buffer (Bug#12387).
852 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
854 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
856 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
858 Use a more backwards-compatible timer format (Bug#12430).
859 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
860 vector element, not from the 4th, since PSECS is now at the end.
861 (Fcurrent_idle_time): Doc fix.
863 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
865 Function to mark objects and remove killed buffers at once.
866 * alloc.c (discard_killed_buffers): Rename to ...
867 (mark_discard_killed buffers) ... new name. Add marking
868 of remaining objects. Fix comment. Adjust users.
869 (mark_object): Do not touch frame buffer lists here.
870 * frame.c (delete_frame): Reset frame buffer lists here.
872 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
874 Better workaround for GNOME bug when --enable-gcc-warnings.
875 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
876 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
877 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
879 Simplify SIGIO usage (Bug#12408).
880 The code that dealt with SIGIO was crufty and confusing, e.g., it
881 played tricks like "#undef SIGIO" but these tricks were not used
882 consistently. Simplify mostly by not #undeffing standard symbols,
883 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
884 or not as we please) rather than "defined SIGIO" (standard symbol
885 that we probably shouldn't #undef).
886 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
887 Modules that need it can include it.
888 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
889 * dispextern.h (ignore_sigio): New decl.
890 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
891 unconditionally, since it's now a no-op if !USABLE_SIGIO.
892 * emacs.c (shut_down_emacs):
893 * keyboard.c (kbd_buffer_store_event_hold):
894 Use ignore_sigio rather than invoking 'signal' directly.
895 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
897 (FIONREAD, SIGIO): Do not #undef.
898 (tty_read_avail_input): Use #error rather than a syntax error.
899 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
900 for I_PIPE, used by SETUP_SLAVE_PTY.
901 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
902 * sysdep.c (croak): Remove; no longer needed. This bit of
903 temporary code, with Fred N. Fish's comment that it's temporary,
904 has been in Emacs since at least 1992!
905 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
906 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
907 * syssignal.h (croak): Remove decl.
908 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
909 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
910 now that we're termios-only.
911 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
912 * term.c (dissociate_if_controlling_tty): Use #error rather than
915 Work around GCC and GNOME bugs when --enable-gcc-warnings.
916 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
917 to work around GNOME bug 683906.
918 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
919 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
920 This works around GCC bug 54561.
922 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
924 More fixes for 'volatile' and setjmp/longjmp.
925 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
926 * image.c (struct png_load_context) [HAVE_PNG]: New type.
927 (png_load_body) [HAVE_PNG]:
928 (jpeg_load_body) [HAVE_JPEG]:
929 New function, with most of the old parent function's body.
930 (png_load) [HAVE_PNG]:
931 (jpeg_load) [HAVE_JPEG]:
932 Invoke the new function, to avoid longjmp munging our locals.
933 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
934 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
935 longjmp is passed 2, as the C standard doesn't guarantee this.
936 Instead, store the failure code into mgr->failure_code.
938 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
940 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
941 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
942 (syms_of_keyboard): Remove support for unread-command-char.
944 2012-09-12 Eli Zaretskii <eliz@gnu.org>
946 * w32proc.c (sys_kill): If PID is our process ID and the signal is
947 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
948 violation. (Bug#12426)
950 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
952 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
954 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
956 * eval.c: Add `inhibit-debugger'.
957 (Qinhibit_debugger): New symbol.
958 (call_debugger): Bind it instead of Qdebug_on_error.
959 (maybe_call_debugger): Test Vinhibit_debugger.
960 (syms_of_eval): Define inhibit-debugger.
961 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
962 (syms_of_xdisp): Remove inhibit-debug-on-message.
964 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
966 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
967 If a nonvolatile local variable is written before a _longjmp to
968 the frame containing the variable, and is read after the _longjmp,
969 the value read is indeterminate. Some local variables of type
970 'struct handler' and 'struct catchtag' are used in this way, so
971 mark each of their slots as volatile if the slot can be set before
972 _longjmp and read afterwards.
973 * lisp.h (struct handler): var and chosen_clause are now volatile.
974 (struct catchtag): val, next, and pdlcount are now volatile.
976 * bidi.c (bidi_push_it, bidi_pop_it):
977 * fns.c (copy_hash_table):
978 * image.c (define_image_type):
979 * keyboard.c (kbd_buffer_store_event_hold):
980 * process.c (Fprocess_send_eof):
981 * xfaces.c (x_create_gc) [HAVE_NS]:
982 * xgselect.c (xg_select):
983 Prefer assignment to memcpy when either will do.
985 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
986 Use pointer-to-a-pointer to simplify and avoid a NILP check each
987 time an item is removed. No need to mark this function 'inline';
988 the compiler knows better than we do.
990 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
992 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
993 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
994 to change_frame_size (Bug#12388).
995 (windowDidResize:): Pass YES to updateFrameSize.
997 * nsterm.h: Add delay parameter to updateFrameSize.
999 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1001 Discard killed buffers from deleted window and frame objects.
1002 This reduces an amount of references to killed buffers and
1003 helps GC to reclaim them faster.
1004 * alloc.c (discard_killed_buffers): New function.
1005 (mark_object): Use it for deleted windows and frames.
1006 (mark_object): If symbol's value is set up for a killed buffer
1007 or deleted frame, restore it's global binding.
1008 * data.c (swap_in_global_binding): Add GC notice.
1009 (swap_in_symval_forwarding): Use convenient set_blv_where.
1010 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1011 * window.h: ... to here.
1013 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1015 Convenient macro to check whether the buffer is live.
1016 * buffer.h (BUFFER_LIVE_P): New macro.
1017 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1018 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1020 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1022 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1023 composition cases (Bug#12364).
1025 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1026 overhang of succeeding glyphs overlapping box cursor.
1028 * w32term.c (x_draw_glyph_string): Likewise.
1030 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1032 Simplify, document, and port floating-point (Bug#12381).
1033 The porting part of this patch fixes bugs on non-IEEE platforms
1034 with frexp, ldexp, logb.
1035 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1037 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1038 support, by removing commented-out code and briefly listing the
1039 C89 functions excluded. The commented-out stuff was confusing
1040 maintenance, e.g., we thought we needed cbrt but it was commented out.
1041 (logb): Remove decl; no longer needed.
1042 (isfinite): New macro, if not already supplied.
1043 (isnan): Don't replace any existing macro.
1044 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1045 are present on all C89 platforms.
1046 (Ffrexp): Do not special-case zero, as frexp does the right thing
1048 (Flogb): Do not use logb, as it doesn't have the desired meaning
1049 on hosts that use non-base-2 floating point. Instead, stick with
1050 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1051 frexp, to avoid getting an unspecified result.
1053 * xdisp.c (Qinhibit_debug_on_message): Now static.
1055 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1057 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1058 NSBezierPath (Bug#12131).
1060 2012-09-10 Chong Yidong <cyd@gnu.org>
1062 * fns.c (Fdelq, Fdelete): Doc fix.
1064 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1066 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1067 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1069 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1071 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1072 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1075 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1077 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1078 left fringe if the window has a left margin. This avoids leaving
1079 traces of the cursor because its leftmost pixel is not drawn over.
1081 * dispnew.c (update_window_line): When the left margin area of a
1082 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1083 that screen line. (Bug#12277)
1085 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1087 Assume C89 or later for math functions (Bug#12381).
1088 This simplifies the code, and makes it a bit smaller and faster,
1089 and (most important) makes it easier to clean up signal handling
1090 since we can stop worring about floating-point exceptions in
1091 library code. That was a problem before C89, but the problem
1092 went away many years ago on all practical Emacs targets.
1093 * data.c, image.c, lread.c, print.c:
1094 Don't include <math.h>; no longer needed.
1095 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1096 might be autoconfigured, as that never happens.
1098 * doprnt.c (DBL_MAX_10_EXP):
1099 * print.c (DBL_DIG):
1100 Remove. C89 or later always defines these.
1101 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1102 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1103 (arith_error, domain_error, domain_error2):
1104 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1105 no longer needed -- we simply return what C returns. All uses removed.
1106 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1108 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1109 Remove. All uses expanded, as these macros are no longer used
1110 more than once and are now more trouble than they're worth.
1111 (Ftan): Use tan, not sin / cos.
1112 (Flogb): Assume C89 frexp.
1113 (fmod_float): Assume C89 fmod.
1114 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1115 (init_floatfns): Remove. All uses removed.
1117 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1119 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1120 compositeToPoint for OSX < 10.6 (Bug#12390).
1122 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1124 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1125 This produces more-accurate results.
1127 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1129 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1130 changes (Bug#12088).
1132 2012-09-08 Chong Yidong <cyd@gnu.org>
1134 * syntax.c (Fstring_to_syntax): Doc fix.
1136 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1138 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1139 in the internal border.
1140 (x_set_window_size): Remove static variables and their usage.
1141 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1142 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1143 Remove fringe/internal border adjustment (Bug#11052).
1144 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1145 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1146 (ns_fix_rect_ibw): Remove.
1147 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1148 (ns_dumpglyphs_box_or_relief): Ditto.
1149 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1151 (ns_dumpglyphs_image): Ditto.
1152 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1154 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1155 their usage. Add fringe_extended_p and its use as in other terms.
1156 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1157 scroll bar was removed.
1158 (updateFrameSize): New function.
1159 (windowDidResize): Move code to updateFrameSize and call it.
1161 * nsterm.h (EmacsView): Add updateFrameSize.
1163 2012-09-07 Chong Yidong <cyd@gnu.org>
1165 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1167 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1169 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1171 More signal-handler cleanup (Bug#12327).
1172 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1173 Problem introduced when merging patches. Noted by Eli Zaretskii in
1174 <http://bugs.gnu.org/12327#67>.
1175 * floatfns.c: Comment fix.
1176 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1177 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1178 and anyway the declaration is harmless even if SIGDANGER is not defined.
1179 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1180 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1181 source files not surprisingly expected syssignal.h to define, or
1182 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1183 Include <sys/ioctl.h>, for FIONREAD.
1184 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1185 This eliminates a problem whereby other files mysteriously had
1186 to include "syssignal.h" before including "systty.h" if they
1187 wanted to use "#ifdef SIGIO".
1189 2012-09-07 Eli Zaretskii <eliz@gnu.org>
1191 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1193 * w32.c (sigemptyset): Empty the set.
1194 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1196 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1198 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1200 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1201 (mark_object): Likewise for frame objects.
1203 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1205 * syssignal.h (handle_on_main_thread): Always declare,
1206 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1207 This ports to platforms without HAVE_PTHREAD.
1209 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1211 Signal-handler cleanup (Bug#12327).
1212 Emacs's signal handlers were written in the old 4.2BSD style with
1213 sigblock and sigmask and so forth, and this led to some
1214 inefficiencies and confusion. Rewrite these to use
1215 pthread_sigmask etc. without copying signal sets around. Also,
1216 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1217 'signal', and instead use functions that do not attempt to take
1218 over the system name space. This patch causes Emacs's text
1219 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1220 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1221 Do not include <signal.h> or "syssignal.h", as these
1222 modules do not use signals.
1223 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1224 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1225 Do not include <signal.h>, as "syssignal.h" does that for us now.
1226 * atimer.c (sigmask_atimers): New function.
1227 (block_atimers, unblock_atimers): New functions,
1228 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1230 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1231 no longer needed here.
1232 * emacs.c (main): Inspect existing signal handler with sigaction,
1233 so that there's no need to block and unblock SIGHUP.
1234 * sysdep.c (struct save_signal): New member 'action', replacing
1235 old member 'handler'.
1236 (save_signal_handlers, restore_signal_handlers):
1237 Use sigaction instead of 'signal' to save and restore.
1238 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1239 New function. All users of 'signal' modified to use set_sighandler
1240 if they're writeonly, and to use sys_signal if they're read+write.
1241 (emacs_sigaction_init, forwarded_signal): New functions.
1242 (sys_signal): Remove. All uses replaced by calls to sigaction
1243 and emacs_sigaction_init, or by direct calls to 'signal'.
1244 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1245 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1246 all uses replaced by pthread_sigmask etc. calls.
1247 * syssignal.h: Include <signal.h>.
1248 (emacs_sigaction_init, forwarded_signal): New decls.
1249 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1250 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1251 (sigmask, sys_sigmask): Remove; no longer needed.
1252 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1253 (sigblock, sigunblock, sigfree):
1254 (sigsetmask) [!defined sigsetmask]:
1255 Remove. All uses replaced by pthread_sigmask.
1256 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1257 no longer need to be replaced, and its typical old uses
1258 are now done via emacs_sigaction_init and sigaction.
1259 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1260 (sys_sigdel): Remove; unused.
1261 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1263 2012-09-06 Eli Zaretskii <eliz@gnu.org>
1265 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1266 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1268 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1270 Explicitly mark buffer_defaults and buffer_local_symbols.
1271 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1272 mark_local_symbols here.
1273 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1274 since special buffers aren't marked here any more.
1275 (allocate_buffer): Chain new buffer with all_buffers here...
1276 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1278 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1279 (syms_of_buffer): Remove staticpro of the above.
1280 (init_buffer_once): Set names for buffer_defaults and
1281 buffer_local_symbols.
1283 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1285 Use bool for booleans in font-related modules.
1286 * font.c (font_intern_prop, font_style_to_value)
1287 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1288 (generate_otf_features, font_check_otf_features, font_check_otf)
1289 (font_match_p, font_list_entities, font_at):
1290 * fontset.c (fontset_id_valid_p, reorder_font_vector
1291 (fontset_find_font, Fset_fontset_font)
1292 (face_suitable_for_char_p) [0]:
1293 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1294 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1295 (m17n_flt_initialized, ftfont_shape_by_flt):
1296 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1297 * nsfont.m (nsfont_draw):
1298 * w32font.c (w32font_draw):
1299 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1300 Use bool for booleans.
1301 * font.h: Adjust to above API changes.
1302 (struct font, struct font_driver, struct font_driver_list):
1303 Use bool for booleans.
1304 (struct font): Remove useless member encoding_type.
1306 * fontset.c, xftfont.c: Omit unnecessary static decls.
1308 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1310 * alloc.c (mark_object): Revert window marking code
1311 since it's unsafe for the Fset_window_configuration.
1313 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1315 Fix race conditions with signal handlers and errno (Bug#12327).
1316 Be more systematic about preserving errno whenever a signal
1317 handler returns, even if it's not in the main thread. Do this by
1318 renaming signal handlers to distinguish between signal delivery
1319 and signal handling. All uses changed.
1320 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1321 * data.c (deliver_arith_signal): Rename from arith_error.
1322 * dispnew.c (deliver_window_change_signal): Rename from
1323 window_change_signal.
1324 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1325 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1326 * keyboard.c (deliver_input_available_signal): Rename from
1327 input_available_signal.
1328 (deliver_user_signal): Rename from handle_user_signal.
1329 (deliver_interrupt_signal): Rename from interrupt_signal.
1330 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1331 (deliver_child_signal): Rename from sigchld_handler.
1332 * atimer.c (handle_alarm_signal):
1333 * data.c (handle_arith_signal):
1334 * dispnew.c (handle_window_change_signal):
1335 * emacs.c (handle_fatal_signal, handle_danger_signal):
1336 * keyboard.c (handle_input_available_signal):
1337 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1338 * process.c (handle_pipe_signal, handle_child_signal):
1339 New functions, with the actual signal-handling code taken from the
1340 original respective signal handlers, sans the sporadic attempts to
1341 preserve errno, since that's now done by handle_on_main_thread.
1342 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1343 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1344 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1346 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1347 Move initialization of main_thread to sysdep.c's init_signals.
1348 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1349 our usage, and simplifies the mainline code.
1350 (record_child_status_change): New static function, as a helper
1351 for handle_child_signal, and with most of the old child handler's
1353 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1354 (handle_child_signal): Use the above.
1355 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1356 Moved here from emacs.c.
1357 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1358 code moved here from emacs.c's main function.
1359 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1360 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1361 This lets callers save and restore errno properly.
1363 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1365 Remove redundant or unused things here and there.
1366 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1367 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1368 * editfns.c (Fcompare_buffer_substrings): Likewise.
1369 * frame.h (struct terminal, struct font_driver_list):
1370 Remove redundant declarations.
1371 * window.h (Qleft, Qright): Likewise.
1373 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1375 Do not mark objects from deleted buffers, windows and frames.
1376 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1377 (mark_object): Likewise for windows and frames.
1379 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1381 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1382 buffer_defaults and buffer_local_symbols as valid objects.
1383 Return special value to denote them.
1385 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1387 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1388 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1389 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1390 (file_name_absolute_p, Fsubstitute_in_file_name):
1391 (check_executable, check_writable, Ffile_accessible_directory_p)
1392 (Fset_file_selinux_context, Fdefault_file_modes)
1393 (Finsert_file_contents, choose_write_coding_system)
1394 (Fwrite_region, build_annotations, a_write, e_write)
1396 * filelock.c (boot_time_initialized, get_boot_time)
1397 (get_boot_time_1, lock_file_1, within_one_second):
1398 * floatfns.c (in_float):
1399 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1400 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1401 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1402 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1403 * window.c (compare_window_configurations):
1404 Use bool for booleans.
1405 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1406 (Fdefault_file_modes): Now mode_t, not int, for modes.
1407 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1408 (internal_delete_file): Now returns void, not a (boolean) int,
1409 since nobody was looking at the return value.
1410 * lisp.h, window.h: Adjust to above API changes.
1412 * xdisp.c (set_message): Simplify and reindent last change.
1414 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
1416 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1418 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1420 * eval.c (call_debugger): Make the function non-static so that we
1421 can call it from set_message.
1423 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1424 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1426 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1428 Give more-useful info on a fatal error (Bug#12328).
1429 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1430 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1431 of doing the work ourselves.
1432 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1433 do most of the work.
1434 (fatal_error_backtrace): New function, taken from the guts
1435 of the old fatal_error_signal, but with a new option to output
1437 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1438 info about the signal than just its number.
1439 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1440 * sysdep.c: Include <execinfo.h>
1441 (emacs_backtrace): New function, taken partly from the previous
1442 code of the 'die' function.
1443 (emacs_abort): Call fatal_error_backtrace rather than abort.
1445 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1447 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1448 eager (load-time) macro-expansion.
1449 * lisp.mk (lisp): Add macroexp.
1451 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1453 Simplify redefinition of 'abort' (Bug#12316).
1454 Do not try to redefine the 'abort' function. Instead, redo
1455 the code so that it calls 'emacs_abort' rather than 'abort'.
1456 This removes the need for the NO_ABORT configure-time macro
1457 and makes it easier to change the abort code to do a backtrace.
1458 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1459 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1460 Remove; sysdep.c's emacs_abort now takes its place.
1461 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1462 'abort' changed to use 'emacs_abort'.
1463 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1464 (abort) [!defined abort]: Rename to ...
1465 (emacs_abort): ... new name.
1466 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1467 the place of the old 'abort' in emacs.c.
1468 * w32.c, w32fns.c (abort): Do not #undef.
1469 * w32.c (emacs_abort): Rename from w32_abort.
1471 2012-09-04 Eli Zaretskii <eliz@gnu.org>
1473 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1474 offsets[j].dv, since the y axis of the screen coordinates points
1475 down, while the y axis of the font definition coordinates points
1476 up. This fixes display of Arabic diacritics such as KASRA and
1477 KASRATAN. (Bug#11860)
1479 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1481 Be more systematic about _setjmp vs setjmp.
1482 * alloc.c (test_setjmp, mark_stack):
1483 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1484 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1485 (png_load, my_error_exit, jpeg_load):
1486 * process.c (send_process_trap, send_process):
1487 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1488 The underscored versions are up to 30x faster on some hosts.
1489 Formerly, the code used setjmp+longjmp sometimes and
1490 _setjmp+_longjmp at other times, with no particular reason to
1491 prefer setjmp+longjmp.
1493 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1495 Fix minor problem found by static checking.
1496 * buffer.c (Fdelete_all_overlays): Return nil.
1498 2012-09-03 Martin Rudalics <rudalics@gmx.at>
1500 * buffer.c (Fdelete_all_overlays): New function.
1502 2012-09-03 Chong Yidong <cyd@gnu.org>
1504 * gtkutil.c: Add extern decl for Qxft.
1506 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1508 * emacs.c, eval.c: Use bool for boolean.
1509 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1510 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1511 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1512 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1513 (main, decode_env_path, Fdaemon_initialized):
1514 * eval.c (call_debugger, Finteractive_p, interactive_p):
1515 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1516 (maybe_call_debugger, Fbacktrace):
1517 * process.c (read_process_output, exec_sentinel):
1518 Use bool for booleans.
1519 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1520 All callers changed.
1521 * eval.c (interactive_p): Omit always-true boolean argument
1522 EXCLUDE_SUBRS_P. All callers changed.
1523 * dispextern.h, lisp.h: Reflect above API changes.
1524 * firstfile.c (dummy): Use the address of 'main', whose signature
1525 won't change, instead of the address of 'initialize', whose
1526 signature just changed from int to bool.
1527 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1528 * msdos.c (fatal_error_in_progress): ... from here.
1529 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1531 (redisplay_internal, unwind_redisplay): Simply clear
1532 REDISPLAYING_P when unwinding, instead of saving its previous,
1533 always-false value and then restoring it.
1535 Clean up some extern decls.
1536 Mostly, this hoists extern decls out of .c files and into .h files.
1537 That way, we're more likely to catch errors if the interfaces change.
1538 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1539 declare xg_mark_data.
1540 * dispextern.h (x_frame_parm_handlers):
1542 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1543 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1544 (Qultra_bold, Qoblique, Qitalic):
1545 Move extern decl here from .c file.
1546 * alloc.c (xg_mark_data) [USE_GTK]:
1548 * eval.c (Qlexical_binding):
1549 * fns.c (time) [!HAVE_UNISTD_H]:
1550 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1551 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1552 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1553 * lread.c (Qinternal_interpreter_environment):
1554 * minibuf.c (Qbuffer):
1555 * process.c (QCfamily, QCfilter):
1556 * widget.c (free_frame_faces):
1557 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1558 * xfont.c (x_clear_errors):
1559 * xterm.c (x_frame_parm_handlers):
1560 Remove now-redundant extern decls.
1561 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1562 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1564 * xfaces.c: Remove unnecessary static decls.
1565 * xterm.c (updating_frame): Remove decl of nonexistent object.
1567 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1568 when building globals.h, as the objects that are not built on
1569 this host are not needed to compile C files on this host.
1571 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1573 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1575 * frame.h: Add missing prototype for x_wm_set_size_hint.
1577 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1579 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1580 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1581 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1582 (Fsubstitute_command_keys):
1583 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1584 (save_excursion_save, save_excursion_restore)
1585 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1586 (format_time_string, general_insert_function)
1587 (make_buffer_string, make_buffer_string_both)
1588 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1589 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1590 (copy_text, insert_1, insert_1_both, insert_from_string)
1591 (insert_from_string_before_markers, insert_from_string_1)
1592 (insert_from_buffer, insert_from_buffer_1, replace_range)
1593 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1594 (del_range_2, modify_region):
1595 * intervals.c (intervals_equal, balance_possible_root_interval)
1596 (adjust_intervals_for_insertion, merge_properties_sticky)
1597 (graft_intervals_into_buffer, lookup_char_property)
1598 (adjust_for_invis_intang, set_point_both)
1599 (get_property_and_range, compare_string_intervals)
1600 (set_intervals_multibyte_1, set_intervals_multibyte):
1601 * keyboard.c (decode_timer):
1602 Use bool for boolean.
1603 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1604 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1606 2012-09-02 Chong Yidong <cyd@gnu.org>
1608 * keymap.c (push_key_description): Print M-TAB as C-M-i
1611 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1613 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1614 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1615 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1616 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1617 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1618 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1619 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1621 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1623 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1624 more than one grapheme cluster passed to the shaper: compute the
1625 offset adjustment values separately for each cluster. (Bug#11860)
1627 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1628 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1629 about implicit conversions from integer to pointer.
1631 2012-09-01 Daniel Colascione <dancol@dancol.org>
1633 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1634 system used too early.
1636 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1638 Better seed support for (random).
1639 * emacs.c (main): Call init_random.
1640 * fns.c (Frandom): Set the seed from a string argument, if given.
1641 Remove long-obsolete Gentzel cruft.
1642 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1643 (init_random): New function.
1645 2012-09-01 Daniel Colascione <dancol@dancol.org>
1647 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1648 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1649 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1650 x_wm_set_size_hint, x_query_colors, x_real_positions,
1651 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1652 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1653 all of which have been moved to common code.
1655 * xfaces.c: Include TERM_HEADER instead of listing all possible
1656 window-system headers.
1658 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1661 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1662 directly accessing frame internals.
1664 * w32font.h: Include font.h. Define syms_of_w32font and
1667 * process.c: Include TERM_HEADER instead of listing all possible
1668 window-system headers.
1670 * nsterm.h: Remove declarations now in frame.h.
1671 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
1673 * menu.c: Include TERM_HEADER instead of listing all possible
1674 window-system headers.
1676 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1679 * keyboard.c: Include TERM_HEADER instead of listing all possible
1680 window-system headers.
1682 * image.c: Include TERM_HEADER instead of listing all possible
1683 window-system headers. Declare Vlibrary_cache when compiling for
1686 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1687 window system declarations.
1689 * frame.h: Move common functions here: set_frame_menubar,
1690 x_set_window_size, x_sync, x_get_focus_frame,
1691 x_set_mouse_position, x_set_mouse_pixel_position,
1692 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1693 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1694 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1695 x_activate_menubar, x_real_positions, x_bitmap_icon,
1696 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1699 * frame.c: Include TERM_HEADER instead of listing all possible
1700 window-system headers.
1702 * font.c: Include TERM_HEADER instead of listing all possible
1703 window-system headers.
1705 * emacs.c: Include TERM_HEADER.
1707 * dispnew.c: Include TERM_HEADER instead of listing all possible
1708 window-system headers.
1710 * ccl.h: Include character.h.
1712 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1713 the current window system; include in list of objects to link into
1716 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1718 Remove mark_ttys function and fix tty_display_info initialization.
1719 * lisp.h (mark_ttys): Remove prototype.
1720 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1721 to mark_ttys because all possible values of 'top_frame' slot are
1722 the frames which are reachable from Vframe_list.
1723 * term.c (mark_ttys): Remove.
1724 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1726 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1728 Change struct frame bitfields from unsigned char to unsigned.
1729 * frame.h (struct frame): Change type of 'display_preempted',
1730 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1731 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1732 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1733 bitfields from unsigned char to unsigned.
1735 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1737 Remove unused member of struct x_output and struct w32_output.
1738 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1739 * w32term.h (struct w32_output): Likewise.
1741 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1743 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1744 does not become zero (Bug#12234).
1746 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1748 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1749 for GCC 4.7.1 x86-64.
1751 2012-08-30 Glenn Morris <rgm@gnu.org>
1753 * lread.c (init_lread): For out-of-tree builds, only add the
1754 source directory's site-lisp dir to the load-path if it exists,
1755 consistent with in-tree builds. (Bug#12302)
1757 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1759 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1760 button_values to NULL. Call setStykeMask so dialogs get a close button.
1761 (windowShouldClose:): Set window_closed.
1762 (dealloc): New member, free button_values.
1763 (process_dialog:): Make member function. Remove window argument,
1764 replace window with self. Count buttons and allocate and store values
1766 (addButton:value:row:): value is int with the name tag. Call setTag
1767 with tag. Remove return self, declare return value as void.
1768 (addString:row:): Remove return self, declare return value as void.
1769 (addSplit): Remove return self, declare return value as void.
1770 (clicked:): Remove return self, declare return value as void.
1771 Set dialog_return to button_values[seltag]. Code formatting change.
1772 (initFromContents:isQuestion:): Adjust call to process_dialog.
1773 Code formatting change.
1774 (timeout_handler:): Set timer_fired to YES.
1775 (runDialogAt:): Set timer_fired to NO.
1776 Handle click on close button as quit.
1778 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1779 Add window_closed and button_values. Add void as return value for
1780 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1781 Add process_dialog as new member.
1783 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1785 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1786 is not one of the heaps we manage. (Bug#12242)
1788 2012-08-28 Glenn Morris <rgm@gnu.org>
1790 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1792 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1794 * window.c (Fset_window_configuration): Remove handling of
1795 auto-buffer-name window parameter. Install revision of reverted
1798 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1800 Do not allow to set major mode for a dead buffer.
1801 * buffer.c (Fset_buffer_major_mode): Signal an error
1802 if the buffer is dead.
1803 (Fother_buffer, other_buffer_safely): Remove redundant
1806 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1808 Always use set_buffer_if_live to restore original buffer at unwind.
1809 * buffer.h (record_unwind_current_buffer): New function.
1810 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1811 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1812 * undo.c, window.c: Adjust users.
1813 * buffer.c (set_buffer_if_live): Fix comment.
1815 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1817 Fix usage of set_buffer_internal.
1818 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1819 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1820 * coding.c (decode_coding): Omit redundant test.
1821 * fileio.c (decide_coding_unwind): Likewise.
1822 * fns.c (secure_hash): Likewise.
1823 * insdel.c (modify_region): Likewise.
1824 * keyboard.c (command_loop_1): Likewise.
1825 * print.c (PRINTFINISH): Likewise.
1826 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1828 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1830 * dispnew.c: Use bool for boolean.
1831 (frame_garbaged, display_completed, delayed_size_change)
1832 (fonts_changed_p, add_window_display_history)
1833 (add_frame_display_history, verify_row_hash)
1834 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1835 (row_equal_p, realloc_glyph_pool)
1836 (allocate_matrices_for_frame_redisplay)
1837 (showing_window_margins_p)
1838 (adjust_frame_glyphs_for_frame_redisplay)
1839 (build_frame_matrix_from_leaf_window, make_current)
1840 (mirrored_line_dance, mirror_line_dance, update_frame)
1841 (update_window_tree, update_single_window)
1842 (check_current_matrix_flags, update_window, update_text_area)
1843 (update_window_line, set_window_update_flags, scrolling_window)
1844 (update_frame_1, scrolling, buffer_posn_from_coords)
1845 (do_pending_window_change, change_frame_size)
1846 (change_frame_size_1, sit_for):
1847 Use bool for boolean.
1848 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1849 and remove last int (actually boolean) argument, which was always 0.
1850 All callers changed.
1851 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1852 * dispextern.h (struct composition_it): Use bool for boolean.
1853 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1854 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1855 * dired.c (file_name_completion):
1856 Use bool for boolean. (This was missed in an earlier change.)
1858 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1860 * window.c (Fset_window_configuration): Revert first part of
1863 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1865 * nsterm.h (NSPanel): New class variable dialog_return.
1867 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
1868 Initialize dialog_return.
1869 (windowShouldClose:): Use stop instead of stopModalWithCode.
1870 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1871 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1873 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1876 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1878 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1879 * composite.c (find_composition, composition_gstring_p)
1880 (composition_reseat_it, find_automatic_composition):
1881 * data.c (let_shadows_buffer_binding_p)
1882 (let_shadows_global_binding_p, set_internal, make_blv)
1883 (Fmake_variable_buffer_local, Fmake_local_variable)
1884 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1885 (cons_to_signed, arith_driver):
1886 * dbusbind.c (xd_in_read_queued_messages):
1887 * dired.c (directory_files_internal, file_name_completion):
1888 Use bool for booleans.
1889 * dired.c (file_name_completion):
1890 * process.h (fd_callback):
1891 Omit int (actually boolean) argument. It wasn't being used.
1893 * composite.h, lisp.h: Reflect above API changes.
1895 * cmds.c, coding.c: Use bool for booleans.
1896 * cmds.c (move_point, Fself_insert_command):
1897 * coding.h (struct composition status, struct coding_system):
1898 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1899 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1900 (emacs_mule_char, decode_coding_emacs_mule)
1901 (encode_coding_emacs_mule, detect_coding_iso_2022)
1902 (decode_coding_iso_2022, encode_invocation_designation)
1903 (encode_designation_at_bol, encode_coding_iso_2022)
1904 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1905 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1906 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1907 (encode_coding_raw_text, detect_coding_charset)
1908 (decode_coding_charset, encode_coding_charset, detect_eol)
1909 (detect_coding, get_translation_table, produce_chars)
1910 (consume_chars, reused_workbuf_in_use)
1911 (make_conversion_work_buffer, code_conversion_save)
1912 (decode_coding_object, encode_coding_object)
1913 (detect_coding_system, char_encodable_p)
1914 (Funencodable_char_position, code_convert_region)
1915 (code_convert_string, code_convert_string_norecord)
1916 (Fset_coding_system_priority):
1917 * fileio.c (Finsert_file_contents):
1918 Use bool for booleans.
1919 * coding.h, lisp.h: Reflect above API changes.
1920 * coding.c: Remove unnecessary static function decls.
1921 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1922 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1923 not a boolean 'int', since callers never look at the return value.
1924 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1925 * coding.h (decoding_buffer_size, encoding_buffer_size)
1926 (emacs_mule_string_char): Remove unused extern decls.
1927 (struct iso_2022_spec, struct coding_system):
1928 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1929 (struct emacs_mule_spec): Remove unused field 'full_support'.
1930 All initializations removed.
1931 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1933 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1935 Fix spare memory change (Bug#12286).
1936 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1937 (valid_lisp_object_p): Likewise.
1939 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1941 * window.c (Fset_window_configuration): Record any window's old
1942 buffer if it's replaced (see Bug#8789). If the new current
1943 buffer doesn't appear in the selected window, go to its old
1946 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1948 Special MEM_TYPE_SPARE to denote reserved memory.
1949 * alloc.c (enum mem_type): New memory type.
1950 (refill_memory_reserve): Use new type for spare memory.
1951 This prevents live_cons_p and live_string_p from incorrect
1952 detection of uninitialized objects from spare memory as live.
1954 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1957 * Makefile.in (.PHONY): versioclean -> versionclean.
1959 Remove unused external symbols.
1960 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1961 * window.c (Qwindow_valid_p, decode_valid_window):
1962 Now static, not extern.
1963 * data.c (Qinterval): Remove; unused.
1964 (syms_of_data): Do not define 'interval'.
1965 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1966 * window.h (decode_valid_window):
1969 * character.c, charset.c, chartab.c: Use bool for booleans.
1970 * character.c (lisp_string_width, string_count_byte8)
1971 (string_escape_byte8):
1972 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1973 (load_charset_map_from_file, map_charset_chars)
1974 (Fdefine_charset_internal, define_charset_internal)
1975 (Fdeclare_equiv_charset, find_charsets_in_text)
1976 (Ffind_charset_region, char_charset, Fiso_charset):
1977 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1978 (sub_char_table_set, sub_char_table_set_range)
1979 (char_table_set_range, optimize_sub_char_table)
1980 (map_sub_char_table):
1981 Use bool for boolean.
1982 * character.c (str_to_unibyte): Omit last boolean argument; it was
1983 always 0. All callers changed.
1984 * character.h, charset.h: Adjust to match previous changes.
1985 * character.h (char_printable_p): Remove decl of nonexistent function.
1986 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1987 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1988 are all boolean, so make them single-bit bitfields.
1990 * lisp.h (ASET): Remove attempt to detect side effects.
1991 It was meant to be temporary and it often doesn't work,
1992 because when IDX has side effects the behavior of IDX==IDX
1993 is undefined. See Stefan Monnier in
1994 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1996 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1998 * lisp.h (functionp): New function (extracted from Ffunctionp).
1999 (FUNCTIONP): Use it.
2000 * eval.c (Ffunctionp): Use it.
2002 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2004 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2005 as that's faster and simpler than static storage. Don't bother
2006 with the g_main_context_query overhead if g_main_context_pending
2007 says no events are pending.
2008 (gfds, gfds_size): Remove these static vars.
2009 (xgselect_initialize): Remove; no longer needed.
2010 All uses and decls removed.
2012 * emacs.c (fatal_error_signal_hook): Remove.
2013 All uses removed. This leftover from old code was always 0.
2015 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2016 * casefiddle.c (casify_object, casify_region):
2017 * casetab.c (set_case_table):
2018 * category.c, category.h (word_boundary_p):
2019 * category.h (CHAR_HAS_CATEGORY):
2020 Use bool for booleans, instead of int.
2022 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2024 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2026 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2028 On assertion failure, print backtrace if available.
2029 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2030 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2031 * Makefile.in (LIB_EXECINFO): New macro.
2034 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2035 * bytecode.c (exec_byte_code):
2036 * callint.c (check_mark, Fcall_interactively):
2037 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2038 (getenv_internal, sync_process_alive, call_process_exited):
2039 * lisp.h (USE_SAFE_ALLOCA):
2040 Use bool for booleans, instead of int.
2041 * lisp.h, process.h: Adjust prototypes to match above changes.
2042 * callint.c (Fcall_interactively): Don't assume the mark's
2043 offset fits in 'int'.
2045 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2047 * buffer.c, buffer.h: Use bool for boolean.
2048 * buffer.c (reset_buffer_local_variables)
2049 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2050 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2051 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2052 (overlay_touches_p, overlay_strings, Foverlay_put)
2053 (report_overlay_modification, call_overlay_mod_hooks):
2054 (mmap_enlarge, mmap_set_vars):
2055 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2056 Use bool for booleans, instead of int.
2057 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2058 since the 1-or-0 return value is always ignored anyway.
2059 (mmap_initialized_p):
2060 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2061 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2063 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2065 * bidi.c: Use bool for boolean.
2066 This is a bit more readable, and makes the text segment of bidi.o
2067 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2068 Presumably it's faster too.
2069 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2071 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2072 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2073 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2074 (bidi_explicit_dir_char, bidi_level_of_next_char)
2075 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2076 Use bool for booleans, instead of int.
2077 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2078 (bidi_unshelve_cache): Adjust decls to match code.
2080 2012-08-23 Martin Rudalics <rudalics@gmx.at>
2082 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2085 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2087 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2088 * atimer.h: Include <stdbool.h>.
2090 2012-08-22 Dan Nicolaescu <dann@gnu.org>
2092 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2093 compile time tests instead of run time tests on systems that do
2095 (FRAME_MAC_P): Remove leftover from deleted code.
2096 * frame.c (syms_of_frame): Remove leftover from deleted code.
2098 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2100 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2102 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2104 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2105 Otherwise, the compiler complains about (A?B:C) where B is void
2106 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2107 (fontset_add): Return void, for FONTSET_ADD.
2109 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2111 * alloc.c: Use bool for booleans.
2112 (gc_in_progress, abort_on_gc)
2113 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2114 (dont_register_blocks) [GC_MALLOC_CHECK]:
2115 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2116 (check_string_bytes, make_specified_string, memory_full)
2117 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2118 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2119 (mark_stack, valid_pointer_p, make_pure_string)
2120 (Fgarbage_collect, survives_gc_p, gc_sweep):
2121 Use bool for booleans, instead of int.
2122 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2123 Remove unused local.
2124 * alloc.c (PURE_POINTER_P):
2125 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2126 * editfns.c (Fformat):
2127 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2129 * fns.c (sweep_weak_table):
2130 * lisp.h (suppress_checking, push_message, survives_gc_p)
2131 (make_pure_string, gc_in_progress, abort_on_gc):
2132 * lread.c (readchar, read1):
2133 * print.c (Fprin1_to_string):
2134 * xdisp.c (push_message):
2135 Use bool for booleans affected directly or indirectly by
2138 Make recently-introduced setters macros.
2139 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2140 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2141 (set_fontset_default, set_fontset_fallback): Rename from their
2142 upper-case counterparts, and make them functions rather than macros.
2143 This is more consistent with the other recently-introduced setters.
2144 These don't need to be inline, since they're local.
2146 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2148 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2149 the loop (Bug#12247).
2151 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2153 * lisp.h (vcopy): Use memcpy rather than our own loop.
2154 This fixes a performance regression introduced by the recent
2155 addition of vcopy. This means 'vcopy' will need to be modified
2156 for a copying collector, but that's OK. Also, tighten the
2157 checking in the assertion.
2159 2012-08-21 Eli Zaretskii <eliz@gnu.org>
2161 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2162 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2163 non-base glyph for the width of the base character, according to
2164 what x_draw_composite_glyph_string_foreground expects.
2165 Generate WADJUST value according to composition_gstring_width's
2166 expectations, to produce correct width of the composed character.
2167 Reverse the sign of the DU offset produced by ScriptPlace.
2169 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2171 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2173 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2175 Avoid direct writes to contents member of struct Lisp_Vector.
2176 * lisp.h (vcopy): New function to copy data into vector.
2177 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2178 * fns.c (Ffillarray): Use ASET.
2179 * keyboard.c (timer_check_2): Use AREF and ASET.
2180 (append_tool_bar_item, Frecent_keys): Use vcopy.
2181 * lread.c (read_vector): Use ASET.
2182 * msdos.c (Frecent_doskeys): Use vcopy.
2183 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2184 (Finternal_merge_in_global_face): Use ASET and vcopy.
2185 * xfont.c (xfont_list_pattern): Likewise.
2187 2012-08-21 Martin Rudalics <rudalics@gmx.at>
2189 * window.c (Fwindow_point): For the selected window always return
2190 the position of its buffer's point.
2191 (Fset_window_point): For the selected window always go in its
2192 buffer to the specified position.
2194 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2196 Setter macros for fontsets.
2197 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2198 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2199 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2202 2012-08-20 Glenn Morris <rgm@gnu.org>
2204 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2205 Don't assume that `ln -f' works.
2207 2012-08-20 Eli Zaretskii <eliz@gnu.org>
2209 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2210 and later about non-assignments with no effect. See discussion at
2211 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2214 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2216 Inline setter functions for Lisp_Objects slots of struct specbinding.
2217 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2220 2012-08-20 Martin Rudalics <rudalics@gmx.at>
2222 * window.c (select_window): Always make selected window's buffer
2225 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2227 Use AREF and ASET for docstrings of category tables.
2228 * category.h (CATEGORY_DOCSTRING): Use AREF.
2229 (SET_CATEGORY_DOCSTRING): Use ASET.
2230 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2232 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2234 Inline setter functions for hash table members.
2235 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2236 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2237 (set_hash_key_and_value, set_hash_index, set_hash_next)
2238 (set_hash_hash): New functions.
2239 * charset.c, fns.c: Adjust users.
2241 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2243 Inline getter and setter functions for per-buffer values.
2244 * buffer.h (per_buffer_default, set_per_buffer_default)
2245 (per_buffer_value, set_per_buffer_value): New functions.
2246 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2247 * buffer.c, data.c: Adjust users.
2249 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
2251 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2253 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2255 Rely on <config.h> + <unistd.h> to declare 'environ',
2256 as gnulib does this if the system doesn't.
2257 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2258 Remove declaration. MS-Windows declares it on stdlib.h which is
2259 included by conf_post.h.
2260 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2261 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2262 * vm-limit.c: Include <unistd.h>, for 'environ'.
2264 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2265 (start_of_data): Remove decl; mem-limits.h provides it.
2267 * xdisp.c (handle_invisible_prop): Make it a bit faster
2268 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2270 2012-08-19 Chong Yidong <cyd@gnu.org>
2272 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2275 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2277 * .gdbinit: Use call instead of set when calling a function in the
2280 * data.c (set_internal): Don't use set_blv_found.
2281 (Fkill_local_variable): Likewise.
2283 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2285 * nsfont.m (ns_ascii_average_width): Ensure the string
2286 ascii_printable is initialized with a null-terminated character
2287 array. Otherwise, it can contain undesired extra characters.
2289 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2291 port new setting code to Sun C 5.8 2005/10/13
2292 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2293 Return void, not Lisp_Object. Otherwise, the compiler
2294 complains about (A?B:C) where B is void and C is Lisp_Object
2295 when compiling CHAR_TABLE_SET, due to the recent change to
2296 the API of sub_char_table_set_contents.
2298 2012-08-18 Chong Yidong <cyd@gnu.org>
2300 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2301 for the string case (Bug#3874).
2303 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2305 * buffer.h (BSET): Remove (Bug#12215).
2306 Replace all uses with calls to new setter functions.
2307 (bset_bidi_paragraph_direction, bset_case_canon_table)
2308 (bset_case_eqv_table, bset_directory, bset_display_count)
2309 (bset_display_time, bset_downcase_table)
2310 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2311 (bset_last_selected_window, bset_local_var_alist)
2312 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2313 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2315 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2316 (bset_auto_fill_function, bset_auto_save_file_format)
2317 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2318 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2319 (bset_cache_long_line_scans, bset_case_fold_search)
2320 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2321 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2322 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2323 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2324 (bset_header_line_format, bset_indicate_buffer_boundaries)
2325 (bset_indicate_empty_lines, bset_invisibility_spec)
2326 (bset_left_fringe_width, bset_major_mode, bset_mark)
2327 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2328 (bset_name, bset_overwrite_mode, bset_pt_marker)
2329 (bset_right_fringe_width, bset_save_length)
2330 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2331 (bset_scroll_up_aggressively, bset_selective_display)
2332 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2333 (bset_word_wrap, bset_zv_marker):
2334 * category.c (bset_category_table):
2335 * syntax.c (bset_syntax_table):
2336 New setter functions.
2338 * process.h (PSET): Remove (Bug#12215).
2339 Replace all uses with calls to new setter functions.
2340 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2341 (PROCESS_INLINE): New macro.
2342 (pset_childp): New setter function.
2343 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2344 * process.c (PROCESS_INLINE):
2345 Define to EXTERN_INLINE, so that the corresponding functions
2346 are compiled into code.
2347 (pset_buffer, pset_command, pset_decode_coding_system)
2348 (pset_decoding_buf, pset_encode_coding_system)
2349 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2350 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2351 (pset_type, pset_write_queue): New setter functions.
2353 * window.h (WSET): Remove (Bug#12215).
2354 Replace all uses with calls to new setter functions.
2355 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2356 (WINDOW_INLINE): New macro.
2357 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2358 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2359 (wset_total_lines, wset_vertical_scroll_bar)
2360 (wset_window_end_pos, wset_window_end_valid)
2361 (wset_window_end_vpos): New setter functions.
2362 * window.c (WINDOW_INLINE):
2363 Define to EXTERN_INLINE, so that the corresponding functions
2364 are compiled into code.
2365 (wset_combination_limit, wset_dedicated, wset_display_table)
2366 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2367 (wset_new_normal, wset_new_total, wset_next_buffers)
2368 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2369 (wset_prev_buffers, wset_right_fringe_width)
2370 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2371 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2372 (wset_window_parameters):
2373 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2374 (wset_column_number_displayed, wset_region_showing):
2375 New setter functions.
2377 * termhooks.h (TSET): Remove (Bug#12215).
2378 Replace all uses with calls to new setter functions.
2379 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2380 (TERMHOOKS_INLINE): New macro.
2381 (tset_charset_list, tset_selection_alist): New setter functions.
2382 * terminal.c (TERMHOOKS_INLINE):
2383 Define to EXTERN_INLINE, so that the corresponding functions
2384 are compiled into code.
2385 (tset_param_alist): New setter function.
2387 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2389 * keyboard.h (KSET): Remove (Bug#12215).
2390 Replace all uses with calls to new setter functions.
2391 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2392 (KEYBOARD_INLINE): New macro.
2393 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2394 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2395 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2396 New setter functions.
2397 * keyboard.c (KEYBOARD_INLINE):
2398 Define to EXTERN_INLINE, so that the corresponding functions
2399 are compiled into code.
2400 (kset_echo_string, kset_kbd_queue)
2401 (kset_keyboard_translate_table, kset_last_prefix_arg)
2402 (kset_last_repeatable_command, kset_local_function_key_map)
2403 (kset_overriding_terminal_local_map, kset_real_last_command)
2404 (kset_system_key_syms): New setter functions.
2406 * frame.h (FSET): Remove (Bug#12215).
2407 Replace all uses with calls to new setter functions.
2408 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2409 (FRAME_INLINE): New macro.
2410 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2411 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2412 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2413 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2414 (fset_param_alist, fset_root_window, fset_scroll_bars)
2415 (fset_selected_window, fset_title, fset_tool_bar_items)
2416 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2417 * frame.c (FRAME_INLINE):
2418 Define to EXTERN_INLINE, so that the corresponding functions
2419 are compiled into code.
2420 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2422 A few more naming-convention fixes for getters and setters.
2423 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2424 and rename from buffer_overlays_set_before.
2425 (set_buffer_overlays_after): Move here from buffer.h, and rename
2426 from buffer_overlays_set_after.
2427 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2429 (set_buffer_intervals): Rename from buffer_set_intervals.
2430 * intervals.c (set_interval_object): Move here from intervals.h,
2431 and rename from interval_set_object.
2432 (set_interval_left): Move here from intervals.h, and rename from
2434 (set_interval_right): Move here from intervals.h, and rename from
2436 (copy_interval_parent): Move here from intervals.h, and rename from
2437 interval_copy_parent.
2438 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2439 (set_interval_plist): Rename from interval_set_plist.
2440 Return void, not Lisp_Object, since no caller uses the result.
2441 * lisp.h (string_intervals): Rename from string_get_intervals.
2442 (set_string_intervals): Rename from string_set_intervals.
2444 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2445 (set_char_table_contents): Rename from char_table_set_contents.
2446 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2447 All uses changed. See the end of
2448 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2450 * lisp.h (CSET): Remove (Bug#12215).
2451 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2452 (set_char_table_purpose): New functions,
2453 replacing CSET. All uses changed. For example, replace
2454 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2455 "set_char_table_parent (char_table, parent);".
2456 The old version was confusing because it used the same name
2457 'parent' for two different things.
2459 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2461 Functions to get and set Lisp_Object fields of buffer-local variables.
2462 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2463 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2464 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2465 * data.c, eval.c, frame.c: Adjust users.
2467 2012-08-17 Chong Yidong <cyd@gnu.org>
2469 * xfaces.c (merge_face_vectors): If the target font specfies a
2470 font spec, make the font's attributes take precedence over
2471 directly-specified attributes.
2472 (merge_face_ref): Recognize :font.
2474 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2476 Do not use memcpy for copying intervals.
2477 * intervals.c (reproduce_interval): New function.
2478 (reproduce_tree, reproduce_tree_obj): Use it.
2479 (reproduce_tree_obj): Remove prototype.
2481 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2483 * lisp.h (duration_to_sec_usec): Remove unused decl.
2485 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2487 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2488 to an allocated instance of NSString, not to the class itself.
2490 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
2492 * makefile.w32-in (C_CTYPE_H): New macro.
2493 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2494 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2495 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2497 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2499 Use ASCII tests for character types.
2500 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2502 Don't include <ctype.h>; was not needed.
2503 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2504 * sysdep.c, xfaces.c:
2505 Include <c-ctype.h> instead of <ctype.h>.
2506 * nsterm.m: Include <c-ctype.h>.
2507 * charset.c (read_hex):
2508 * doc.c (Fsnarf_documentation):
2509 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2510 (DRIVE_LETTER) [DOS_NT]:
2511 (Ffile_name_directory, Fexpand_file_name)
2512 (Fsubstitute_in_file_name):
2513 * font.c (font_parse_xlfd, font_parse_fcname):
2514 * frame.c (x_set_font_backend):
2515 * gtkutil.c (xg_get_font):
2516 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2517 * nsimage.m (hexchar):
2518 * nsterm.m (ns_xlfd_to_fontname):
2519 * sysdep.c (system_process_attributes):
2520 * xfaces.c (hash_string_case_insensitive):
2521 Use C-locale tests instead of locale-specific tests for character
2522 types, since we want the ASCII interpretation here, not the
2523 interpretation suitable for whatever happens to be the current locale.
2525 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2527 Consistently check windows for validity/liveness
2528 (Bug#11984, Bug#12025, Bug#12026).
2529 * lisp.h (CHECK_VALID_WINDOW): New macro.
2530 * window.c (decode_window): Rename to decode_live_window.
2531 (decode_valid_window, Fwindow_valid_p): New functions.
2532 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2533 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2534 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2535 (Fwindow_prev_sibling, Fwindow_combination_limit)
2536 (Fset_window_combination_limit, Fwindow_use_time)
2537 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2538 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2539 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2540 (Fwindow_hscroll, Fset_window_hscroll)
2541 (Fwindow_redisplay_end_trigger)
2542 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2543 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2544 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2545 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2546 (Fwindow_end, Fset_window_point, Fset_window_start)
2547 (Fpos_visible_in_window_p, Fwindow_line_height)
2548 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2549 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2550 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2551 (Fset_window_parameter, Fwindow_display_table)
2552 (Fset_window_display_table, Fdelete_other_windows_internal)
2553 (Fset_window_buffer, Fset_window_new_total)
2554 (Fset_window_new_normal, Fdelete_window_internal)
2555 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2556 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2557 (Fwindow_scroll_bars): Check whether argument window is a valid or
2558 live window. Update doc-strings.
2559 (syms_of_window): New symbol Qwindow_valid_p.
2560 * keyboard.c (Fposn_at_x_y): Check whether argument
2561 frame_or_window denotes a valid window.
2563 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2565 Fix previous char table change.
2566 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2567 * chartab.c (optimize_sub_char_table): Likewise.
2569 2012-08-16 Chong Yidong <cyd@gnu.org>
2571 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2573 * xfont.c (xfont_open):
2574 * xftfont.c (xftfont_open): Set the font's max_width field.
2576 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2577 min_width to space_width and average_width to the average over
2578 printable ASCII characters.
2579 (ns_char_width): Code cleanup.
2580 (ns_ascii_average_width): New utility function.
2582 * font.h (struct font): Update comments.
2584 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2586 Simple interface to set Lisp_Object fields of character tables.
2587 * lisp.h (CSET): New macro.
2588 (char_table_set_extras, char_table_set_contents)
2589 (sub_char_table_set_contents): New function.
2590 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2591 * syntax.c: Adjust users.
2593 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2595 * eval.c (eval_sub): Bind lexical-binding.
2596 * lread.c (Qlexical_binding): Make non-static.
2598 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2600 * nsmenu.m (popupSession): Remove.
2601 (pop_down_menu): Remove endModalSession.
2602 (timeout_handler:): New method.
2603 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2604 Call runModalForWindow. Check timer_fired when it returns.
2605 If not set, cancel timer and break out of loop.
2606 Otherwise loop again, with a new timeout.
2608 * nsterm.m: Include fcntl.h if present.
2609 (fd_entry, t_readfds, inNsSelect): Remove.
2610 (select_writefds, select_valid, select_timeout, selfds)
2611 (select_mutex, apploopnr): Add.
2612 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2613 Otherwise call kbd_buffer_store_event.
2614 (ns_send_appdefined): Remove release of fd_entry.
2615 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2616 Increment and decrement apploopnr.
2617 (ns_select): If no file descriptors, just do a NSTimer.
2618 Otherwise copy read/write masks and start select thread (fd_handler).
2619 Start main loop and wait for application defined event.
2620 Inform select thread to stop selecting after main loop is exited.
2621 (ns_term_init): Create selfds pipe and set non-blocking.
2622 Initialize select_mutex. Start the select thread (fd_handler).
2623 (fd_handler:): Loop forever, wait for info from the main thread
2624 to either start or stop selecting. When select returns, send
2625 and appdefined event.
2626 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2627 If not call kbd_buffer_store_event.
2629 * nsterm.h (EmacsApp): fd_handler takes id argument.
2630 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2632 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2634 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2636 * region-cache.c (move_cache_gap): Update gap_len using the actual
2637 growth of the boundaries array. Do not change cache_len.
2640 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2642 Generalize and cleanup font subsystem checks.
2643 * font.h (FONT_DEBUG, font_assert): Remove.
2644 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2645 Change font_assert to eassert. Use eassert where appropriate.
2647 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2649 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2651 2012-08-15 Chong Yidong <cyd@gnu.org>
2653 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2654 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2655 extract the font descriptor instead of just the font name.
2656 In that case, return a font spec instead of a string.
2657 (x_last_font_name): Move to this file from xfns.c.
2659 * xfns.c (Fx_select_font): The return value can also be a font
2660 spec. Move x_last_font_name management to gtkutil.c.
2662 * xfaces.c: Make font weight and style symbols non-static.
2664 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2666 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2669 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2671 * alloc.c (Fgarbage_collect): Use plural form consistently.
2673 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2675 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2676 iteration through the command loop. Fixes a problem whereby mouse
2677 movements are ignored until the first mouse click.
2679 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2681 Use bool, not int, for Lisp booleans.
2682 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2683 makes Emacs a bit smaller and presumably a bit faster.
2684 * lisp.h: Include <stdbool.h>.
2685 (struct Lisp_Boolfwd, defvar_bool):
2686 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2687 * regex.c [!emacs]: Include <stdbool.h>.
2688 (false, true): Remove; <stdbool.h> does this for us now.
2690 2012-08-14 Chong Yidong <cyd@gnu.org>
2692 * character.c (Fcharacterp): Doc fix (Bug#12076).
2694 * data.c (Findirect_variable): Doc fix (Bug#11040).
2696 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2698 * editfns.c (Fformat): Doc fix (Bug#12059).
2699 (Fsave_current_buffer): Doc fix (Bug#11542).
2701 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2703 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2706 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2708 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2709 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2710 * minibuf.c (choose_minibuf_frame, read_minibuf):
2711 * w32fns.c (x_create_tip_frame):
2712 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2713 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2715 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2717 * intervals.c (offset_intervals): Remove obsolete comment.
2719 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2721 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2723 2012-08-14 Gergely Risko <gergely@risko.hu>
2725 * coding.c (decode_coding): Record buffer modification before
2726 disabling undo_list (Bug#11773).
2728 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2730 Revert and cleanup some recent overlay changes.
2731 * buffer.h (enum overlay_type): Remove.
2732 (buffer_get_overlays, buffer_set_overlays): Likewise.
2733 (buffer_set_overlays_before, buffer_set_overlays_after):
2734 New function. Adjust users.
2735 (unchain_both): Add eassert.
2737 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2739 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2741 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2743 * gtkutil.c (xg_mark_data): Don't assume C99.
2745 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2747 * gtkutil.c (xg_frame_tb_info): New struct.
2748 (TB_INFO_KEY): New define.
2749 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2750 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2751 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2753 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2754 is up to date. Otherwise store new data.
2755 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2757 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2759 Use KSET for write access to Lisp_Object members of struct kboard.
2760 * keyboard.h (KSET): New macro.
2761 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2762 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2763 * xterm.c: Adjust users.
2765 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2767 Use BSET for write access to Lisp_Object members of struct buffer.
2768 * buffer.h (BSET): New macro.
2769 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2770 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2771 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2772 * window.c, xdisp.c, xfns.c: Adjust users.
2774 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2776 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2778 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2780 * nsterm.m (not_in_argv): New function.
2781 (application:openFile, application:openTempFile:):
2782 (application:openFileWithoutUI:, application:openFiles:): Open file
2783 if not_in_argv returns non-zero (bug#12171).
2785 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2786 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2787 Define for Gtk+ versions less than 3.2.
2788 (xg_get_font_name): Use those functions/macros here.
2789 Reported by Frans Oilinki <moilinki@gmail.com>.
2791 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2793 * unexmacosx.c (copy_data_segment): Copy initialized data in
2794 statically linked libraries from input file rather than memory.
2796 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2797 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2798 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2800 2012-08-10 Glenn Morris <rgm@gnu.org>
2802 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2803 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2805 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2807 Fix last change to allow compilation with low optimization levels.
2808 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2809 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2811 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2813 Use common inline syntax in intervals.h.
2814 * intervals.h (INTERVALS_INLINE): New macro.
2815 Change all users from LISP_INLINE.
2817 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2819 Define Qnone once for all platforms.
2820 * frame.c (Qnone): Define here.
2821 (syms_of_frame): DEFSYM it.
2822 * lisp.h (Qnone): New declaration.
2823 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2824 * xfns.c: Remove duplication. Adjust users.
2826 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2828 Remove unused macros from intervals.h.
2829 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2830 * intervals.c: Adjust comment.
2832 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2834 * w32fns.c <w32_unicode_gui>: New static variable.
2835 (globals_of_w32fns): Initialize it according to os_subtype.
2836 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2839 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2840 Eli Zaretskii <eliz@gnu.org>
2842 Fix bug #10299 with Unicode characters sent by customized
2843 keyboards created by MSKLC.
2844 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2845 (w32_init_class): Use it to initialize the Emacs class with either
2846 ANSI or Unicode API calls.
2847 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2849 (w32_wnd_proc): If the character code sent by WM_CHAR or
2850 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2851 original message. Call DefWindowProcW on NT and later.
2853 2012-08-10 Glenn Morris <rgm@gnu.org>
2855 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2857 * lisp.h (DIRECTORY_SEP): Let configure set it.
2859 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2861 Use TSET for write access to Lisp_Object slots of struct terminal.
2862 * termhooks.h (TSET): New macro.
2863 * coding.c, terminal.c, xselect.c: Adjust users.
2865 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2867 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2868 the failing expression, include them in the error message.
2869 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2870 * lisp.h (internal_condition_case_n): Update declaration.
2872 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2874 Inline functions to examine and change buffer overlays.
2875 * buffer.c (unchain_both): New function.
2876 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2877 (buffer_has_overlays): New function.
2878 (enum overlay_type): New enum.
2879 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2880 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2882 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2884 Inline functions to examine and change buffer intervals.
2885 * alloc.c (mark_interval_tree): Remove.
2886 (MARK_INTERVAL_TREE): Simplify.
2887 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2888 * intervals.c (buffer_balance_intervals): New function.
2889 (graft_intervals_into_buffer): Adjust indentation.
2890 (set_intervals_multibyte): Simplify.
2891 * buffer.h (BUF_INTERVALS): Remove.
2892 (buffer_get_intervals, buffer_set_intervals): New function.
2893 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2894 * intervals.c, textprop.c: Adjust users.
2896 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2898 Inline functions to examine and change string intervals.
2899 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2900 (string_get_intervals, string_set_intervals): New function.
2901 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2902 * lread.c, print.c, textprop.c: Adjust users.
2904 2012-08-08 Glenn Morris <rgm@gnu.org>
2906 * lisp.mk (lisp): Remove language/persian.elc.
2908 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2911 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2912 (NULL_INTERVAL_P): Likewise. Adjust users.
2913 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2914 Adjust comment. Move under #if 0.
2915 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2916 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2918 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2920 Check total length of intervals with eassert.
2921 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2922 * intervals.c: Change all users to eassert.
2924 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2926 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2927 Rename fields to match removal of FGET and WGET and disuse of
2928 INTERNAL_FIELD in Lisp_Cons.
2930 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2932 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2933 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2934 name since all xname users are fixed long time ago. Do not
2936 (set_symbol_name, set_symbol_function, set_symbol_plist):
2937 (set_symbol_next, set_overlay_plist): New function.
2938 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2939 (struct Lisp_Overlay): Likewise.
2940 (CVAR, MVAR, SVAR): Remove.
2941 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2942 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2943 * xterm.c: Adjust users.
2944 * .gdbinit: Change to use name field of struct Lisp_Symbol
2947 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2949 Basic functions to set Lisp_Object and pointer slots of intervals.
2950 * intervals.h (interval_set_parent, interval_set_object):
2951 (interval_set_left, interval_set_right, interval_set_plist):
2952 (interval_copy_parent): New function.
2953 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2954 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2956 (INTERVAL_SIZE): Remove. Adjust users.
2957 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2959 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2961 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2962 * process.h (PGET): Remove.
2963 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2964 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2966 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2968 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2969 * window.h (WGET): Remove.
2970 (struct window): Do not use INTERNAL_FIELD.
2971 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2972 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2973 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2974 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2975 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2978 2012-08-07 Chong Yidong <cyd@gnu.org>
2980 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2981 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2982 (Fdelete_window_internal): Signal an error if the window is not on
2983 a live frame (Bug#12025).
2985 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2987 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2988 * frame.h (FGET): Remove.
2989 (struct frame): Do not use INTERNAL_FIELD.
2990 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2991 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2992 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2993 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2995 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2997 * w32.c: Silence compiler warnings.
2998 (map_w32_filename): Remove unused variable `is_fat'.
2999 (chase_symlinks): Add parentheses around expression.
3001 2012-08-06 Glenn Morris <rgm@gnu.org>
3003 * sysdep.c: Respect BROKEN_GETWD.
3005 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3006 Let configure handle it.
3007 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3009 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3011 Use GCALIGNMENT where appropriate.
3012 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3013 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3014 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3016 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3018 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3019 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3021 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3023 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3024 that should be sufficient for everyone.
3026 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3028 * keyboard.c (timer_check_2): Add break so timer_check returns next
3031 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3033 Fix Windows build errors introduced after converting to WGET and WSET.
3034 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3035 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3037 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3039 * nsterm.m (ns_frame_rehighlight): Use FSET.
3041 * nsmenu.m (ns_update_menubar): Use FSET.
3043 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3045 Separate read and write access to Lisp_Object slots of Lisp_Process.
3046 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3047 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3049 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3051 Separate read and write access to Lisp_Object slots of struct window.
3052 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3053 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3054 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3055 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3056 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3057 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3060 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3062 Fix Windows build errors introduced after converting to FGET and FSET.
3063 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3064 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3065 (w32_judge_scroll_bars): Change to use FSET.
3066 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3068 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3070 Fix replacement typo.
3071 * window.c (replace_window): Set root_window instead of
3072 selected_window. This fixes a total window subsystem
3073 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3075 2012-08-06 Glenn Morris <rgm@gnu.org>
3077 * lisp.mk (lisp): Add language/persian.elc.
3079 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3081 Separate read and write access to Lisp_Object slots of struct frame.
3082 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3083 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3084 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3085 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3086 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3088 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3090 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3092 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3094 Generalize common compile-time constants.
3095 * lisp.h (header_size, bool_header_size, word_size): Now here.
3096 (struct Lisp_Vector): Add comment.
3097 (struct Lisp_Bool_Vector): Move up to define handy constants.
3098 (VECSIZE, PSEUDOVECSIZE): Simplify.
3099 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3100 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3101 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3102 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3103 * xfont.c, xmenu.c: Use word_size where appropriate.
3105 2012-08-05 Lawrence Mitchell <wence@gmx.li>
3107 * search.c (Freplace_match): Treat \? in the replacement text
3108 literally (Bug#8161).
3110 2012-08-05 Chong Yidong <cyd@gnu.org>
3112 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3113 * frame.c (Vdelete_frame_functions):
3114 * emacs.c (Vkill_emacs_hook): Doc fix.
3116 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3118 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3119 --with-x-toolkit=no builds.
3120 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3122 2012-08-04 Chong Yidong <cyd@gnu.org>
3124 * syntax.c (Fmodify_syntax_entry): Doc fix.
3126 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3128 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3129 * w32.c (init_environment): Change the default values of many
3130 environment variables in dflt_envvars[] to NULL, to avoid pushing
3131 them into environment when they were not already defined.
3132 Remove the code that deletes site-lisp subdirectories from the default
3133 value of EMACSLOADPATH, as it is no longer needed.
3134 (check_windows_init_file): Now external, not static.
3135 Use Vload_path as is, without adding anything, as this function is now
3136 called when Vload_path is already set up.
3138 * w32.h (check_windows_init_file): Add prototype.
3140 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3141 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3142 compatibility with Posix platforms.
3143 (main): Move the call to check_windows_init_file to here from
3145 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3146 any, in the DEFALT argument into the root of the Emacs build or
3147 installation tree, as appropriate.
3149 * callproc.c (init_callproc_1): Call decode_env_path instead of
3150 doing its equivalent by hand.
3151 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3152 the code that sets Vexec_path run on MS-Windows.
3154 * lread.c (init_lread): Add comments to #ifdef's.
3156 * msdos.c (dos_set_window_size, IT_update_begin)
3157 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3158 instead of direct references.
3160 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3162 Export DEFAULT_REHASH_* to GDB.
3163 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3164 Now constants, not macros.
3166 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3168 Remove unnecessary casts involving pointers.
3169 These casts are no longer needed now that we assume C89 or later,
3170 since they involve casting to or from void *.
3171 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3172 (make_pure_float, make_pure_vector):
3173 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3174 * macros.c (Fstart_kbd_macro):
3175 * menu.c (find_and_return_menu_selection):
3176 * minibuf.c (read_minibuf_noninteractive):
3177 * sysdep.c (closedir):
3178 * xdisp.c (x_produce_glyphs):
3179 * xfaces.c (compare_fonts_by_sort_order):
3180 * xfns.c (x_real_positions, select_visual):
3181 * xselect.c (x_stop_queuing_selection_requests)
3182 (x_get_window_property, x_get_window_property_as_lisp_data):
3183 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3184 Remove unnecessary pointer casts.
3185 * alloc.c (record_xmalloc): New function.
3186 * lisp.h (record_xmalloc): New decl.
3187 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3188 more like a function. This is because the pointer cast is not
3189 needed. All uses changed.
3190 * print.c (print_string, print_error_message): Avoid length recalc.
3192 Improve fix for macroexp crash with debugging (Bug#12118).
3193 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3194 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3195 not supposed to be invoked from the garbage collector.
3196 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3197 (gc_aset): New function, which is like ASET but can be
3198 used in the garbage collector.
3199 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3200 (set_hash_index): Use it instead of ASET.
3202 2012-08-03 Eli Zaretskii <eliz@gnu.org>
3204 Support symlinks on latest versions of MS-Windows.
3205 * w32.c: Include winioctl.h and aclapi.h.
3206 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3207 (revert_to_self): Forward declarations of static functions.
3208 <static BOOL g_b_init_get_security_info>:
3209 <g_b_init_create_symbolic_link>: New static flags.
3210 (globals_of_w32): Initialize them to zero.
3211 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3212 (map_w32_filename): Improve commentary. Simplify switch.
3213 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3214 headers (most versions of MinGW w32api don't).
3215 (get_security_info, create_symbolic_link)
3216 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3218 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3219 in the argument file name.
3220 (sys_access): Call unc_volume_file_attributes only if
3221 GetFileAttributes fails with network-related error codes.
3222 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3223 have the required privileges.
3224 (get_file_security_desc_by_name): Rename from
3225 get_file_security_desc.
3226 (stat_worker): New function, with most of the guts of 'stat', and
3227 with addition of handling of symlinks and support for 'lstat'.
3228 If possible, get file's attributes and security information by
3229 handle, not by name. Produce S_IFLNK bit for symlinks, when
3230 called from 'lstat'.
3231 (stat, lstat): New functions, call 'stat_worker'.
3232 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3233 symlinks when the underlying filesystem supports them.
3235 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3237 Fix macroexp crash on Windows with debugging (Bug#12118).
3238 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3239 checking subscripts; problem introduced with the recent
3240 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3241 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3242 since it's used in non-static inline functions now.
3244 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3245 Don't assume buffer size fits in 'int'. Remove unused local.
3247 Use C99-style 'extern inline' if available.
3248 * buffer.h (BUFFER_INLINE):
3249 * category.h (CATEGORY_INLINE):
3250 * character.h (CHARACTER_INLINE):
3251 * charset.h (CHARSET_INLINE):
3252 * composite.h (COMPOSITE_INLINE):
3253 * dispextern.h (DISPEXTERN_INLINE):
3254 * lisp.h (LISP_INLINE):
3255 * systime.h (SYSTIME_INLINE):
3256 New macro, replacing 'static inline' in this header.
3257 * buffer.h, category.h, character.h, charset.h, composite.h:
3258 * dispextern.h, lisp.h, systime.h:
3259 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3260 * alloc.c (LISP_INLINE):
3261 * buffer.c (BUFFER_INLINE):
3262 * category.c (CATEGORY_INLINE):
3263 * character.c (CHARACTER_INLINE):
3264 * charset.c (CHARSET_INLINE):
3265 * composite.c (COMPOSITE_INLINE):
3266 * dispnew.c (DISPEXTERN_INLINE):
3267 * sysdep.c (SYSTIME_INLINE):
3268 Define to EXTERN_INLINE, so that the corresponding functions
3269 are compiled into code.
3270 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3271 (INLINE_HEADER_END): New macros.
3272 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3273 since it's used in non-static inline functions now.
3274 (VALMASK) [!USE_LSB_TAG]: Likewise.
3276 2012-08-02 Glenn Morris <rgm@gnu.org>
3278 * s/: Remove empty directory.
3280 * s/ms-w32.h: Move to ../nt/inc.
3281 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3282 Update for new ms-w32.h location.
3284 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3287 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3289 2012-08-02 Glenn Morris <rgm@gnu.org>
3291 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3292 hard-coding the path separator.
3294 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3296 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3297 This how ASET and AREF are supposed to work, and makes
3298 it easier to think about future improvements. See
3299 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3300 * charset.h (set_charset_attr): New function.
3301 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3302 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3303 (aref_addr): New function. All uses of &AREF(...) changed.
3304 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3305 (set_hash_index): New functions. All lvalue-style uses of
3306 HASH_KEY etc. changed.
3307 * keyboard.c (set_prop): New function. All lvalue-style uses
3310 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3312 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3313 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3314 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3315 * nsfns.m (ns_set_name_as_filename): Likewise.
3316 * nsmenu.m (ns_update_menubar): Likewise.
3317 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3319 2012-08-01 Eli Zaretskii <eliz@gnu.org>
3321 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3322 Adapt to latest changes in field names of the corresponding Lisp
3325 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3327 2012-08-01 Glenn Morris <rgm@gnu.org>
3329 * s/msdos.h: Remove file.
3330 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3331 * Makefile.in (S_FILE): Remove.
3332 (config_h): Remove S_FILE.
3334 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3336 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3337 Remove; moved to nt/config.nt.
3339 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3341 Use INTERNAL_FIELD for conses and overlays.
3342 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3343 Remove obsolete comment.
3345 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3346 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3348 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3350 Use INTERNAL_FIELD for symbols.
3351 * lisp.h (SVAR): New macro. Adjust users.
3352 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3353 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3355 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3357 Use INTERNAL_FIELD for processes.
3358 * process.h (PVAR): New macro. Adjust style.
3359 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3360 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3362 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3364 Use INTERNAL_FIELD for windows.
3365 * window.h (WVAR): New macro.
3366 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3367 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3368 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3369 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3370 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3371 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3373 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3375 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3377 2012-08-01 Glenn Morris <rgm@gnu.org>
3379 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3380 Move to configure.ac.
3382 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3384 * makefile.w32-in (CONFIG_H): Update dependencies.
3385 (CONF_POST_H): New macro.
3387 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3389 2012-07-31 Glenn Morris <rgm@gnu.org>
3391 * Makefile.in (S_FILE): No longer set by configure.
3393 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3395 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3397 * process.h (NULL_DEVICE):
3398 * emacs.c (SEPCHAR):
3399 * editfns.c (USER_FULL_NAME): Let configure set them.
3401 * s/README, s/template.h: Remove files.
3403 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3405 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3406 Move to configure.ac.
3408 2012-07-31 Eli Zaretskii <eliz@gnu.org>
3410 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3411 resulting renaming of 'struct frame' members.
3413 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3415 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3416 after introduction of FVAR.
3418 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3420 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3422 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3423 instead of compositeToPoint.
3424 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3426 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3428 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3430 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3431 * lisp.h (INTERNAL_FIELD): New macro.
3432 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3433 (BVAR): Change to use INTERNAL_FIELD.
3434 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3435 (KVAR): Change to use INTERNAL_FIELD.
3436 * frame.h (FVAR): New macro.
3437 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3438 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3439 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3440 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3441 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3443 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3445 Miscellaneous fixes for non-default X toolkits.
3446 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3447 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3448 Move under #ifdef USE_LUCID.
3449 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3450 definition and usage to avoid warnings.
3452 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3454 * nsterm.m (openFiles): Fix previous checkin.
3456 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3458 * indent.c (compute_motion): Remove unused local.
3460 2012-07-31 Glenn Morris <rgm@gnu.org>
3462 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3464 * conf_post.h [USG5_4]:
3465 Move remaining contents of s/usg5-4-common.h here.
3466 * s/usg5-4-common.h: Remove file.
3468 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3469 * s/irix6-5.h: Remove file.
3471 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3472 * s/darwin.h: Remove file.
3474 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3475 * s/hpux10-20.h: Remove file, which is now empty.
3477 2012-07-30 Glenn Morris <rgm@gnu.org>
3479 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3480 * Makefile.in (config_h): Add conf_post.h.
3481 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3483 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3485 * nsterm.m (ns_do_open_file): New variable.
3486 (ns_term_init): Set ns_do_open_file to YES after run returns.
3487 (openFile, openTempFile, openFileWithoutUI, openFiles):
3488 Open files only if ns_do_open_file.
3490 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3492 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3493 This no-op macro hasn't been needed for many years.
3494 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3496 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3497 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3498 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3499 gdb_make_enums_visible.
3500 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3501 (DIRECTORY_SEP): Now a constant, not a macro.
3503 2012-07-30 Eli Zaretskii <eliz@gnu.org>
3505 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3506 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3508 * w32term.c <w32_keyboard_codepage>: Renamed from
3509 keyboard_codepage and now external. All users changed.
3511 * w32term.h: Add declaration of w32_keyboard_codepage.
3513 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3514 the codepage to translate keys to Unicode. If this argument is
3515 -1, use the value returned by GetConsoleCP. All callers changed.
3517 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3519 Update .PHONY listings in makefiles.
3520 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3521 bootstrap-clean, distclean, maintainer-clean, versioclean,
3524 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3525 This is a bit clearer. Fix some commentary typos.
3527 2012-07-30 Glenn Morris <rgm@gnu.org>
3529 * s/netbsd.h: Let configure include signal.h if needed.
3530 Remove file, which is now empty.
3532 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3533 Let configure set them.
3534 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3535 No more need to undefine.
3537 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3539 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3540 non-single-byte char when adding meta modifier. (Bug#12090)
3542 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3544 Convert safe_call to use variable number of arguments.
3545 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3546 (safe_call2): Fix comment.
3547 * lisp.h (safe_call): Adjust prototype.
3548 * coding.c (encode_coding_object): Change to use safe_call2.
3549 * xfaces.c (merge_face_heights): Change to use safe_call1.
3551 2012-07-30 Glenn Morris <rgm@gnu.org>
3553 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3554 does that unconditionally. Remove file, which is now empty.
3556 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3559 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3561 Export to GDB most of lisp.h's remaining object-like macros.
3562 * lisp.h (min, max): Move earlier, because they're used earlier now.
3563 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3564 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3565 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3566 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3567 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3568 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3569 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3570 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3571 Now constants, for GDB. They need not be macros.
3572 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3573 Now constants, for GDB, as well as macros, for static initializers.
3574 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3575 Move to after the definition of struct Lisp_Char_Table,
3576 since the former now needs that type defined.
3577 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3578 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3579 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3580 New enums, for gdb_make_enums_visible.
3581 (GLYPH_MODE_LINE_FACE): Remove; unused.
3582 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3583 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3584 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3585 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3586 enum maxargs, enum MAX_ALLOCA.
3587 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3588 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3589 no longer needed, now that they are done in lisp.h.
3591 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3593 Cleanup string bytes checking.
3594 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3595 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3596 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3597 (check_sblock, compact_small_strings): Simplify.
3599 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3601 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3602 These macros are confusing and no longer need to be defined, as
3603 the enum values now suffice. All uses replaced with definiens.
3604 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3606 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3608 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3609 ($(BLD)/w32console.$(O)): Update dependencies.
3611 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3613 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3614 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3616 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3618 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3620 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3621 setting sitelisp (Bug#12010).
3623 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3625 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3627 * w32heap.c (cache_system_info):
3628 * w32.c (sys_rename):
3629 * w32proc.c (find_child_console, sys_kill): All users changed.
3631 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3633 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3635 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3637 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3639 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3641 Cleanup statistics calculation in Fgarbage_collect.
3642 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3643 Fix zombies percentage calculation. Simplify elapsed time calculation.
3645 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3647 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3648 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3649 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3650 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3651 (replace_range, replace_range_2, del_range_2): Change to eassert.
3652 * marker.c (byte_char_debug_check): Adjust style.
3654 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3656 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3657 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3658 long-ago-commented-out code that talks about "WIN32".
3659 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3662 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3664 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3665 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3666 Simplify by using alignof.
3667 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3668 * lisp.h: Include <stdalign.h>.
3669 (GCALIGNMENT): New macro and constant.
3670 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3671 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3672 (stdalign): New macro, if not already defined.
3674 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3676 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3677 * w32inevt.c: Include w32inevt.h.
3678 (w32_read_console_input): New inline function, calls either
3679 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3680 w32_console_unicode_input.
3681 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3682 (w32_kbd_patch_key, key_event): Use the codepage returned by
3683 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3684 (key_event): use uChar.UnicodeChar only if
3685 w32_console_unicode_input is non-zero.
3687 * w32console.c: Include w32heap.h.
3688 <w32_console_unicode_input>: New global variable.
3689 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3690 family of Windows, zero otherwise.
3692 * w32inevt.h: Declare w32_console_unicode_input.
3694 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3695 --without-x. (Bug#11742)
3697 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3699 Adjust GDB to reflect pvec_type changes (Bug#12036).
3700 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3701 2012-07-04 changes to pseudovector representation.
3702 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3704 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3706 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3708 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3710 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3712 * alloc.c (listn): Fix the order the arguments are consed onto the
3715 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3716 enumeration constants, as PURE and HEAP are too general, and clash
3717 with other headers and sources, such as gmalloc.c and the
3718 MS-Windows system headers. All users changed.
3720 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3722 Revert last save_excursion_save and save_excursion_restore changes.
3723 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3724 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3726 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3728 Fix recently-introduced typos in Windows port.
3729 Reported by Martin Rudalics <rudalics@gmx.at>.
3730 * w32.c (init_environment): Replace comma with semicolon.
3731 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3733 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3735 Improve GDB symbol export (Bug#12036).
3736 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3737 arms of an 'if', not using conditional expressions; otherwise GDB
3738 complains about the types in the unevaluated arm when the argument
3739 is an integer literal.
3740 (xgetint): Simplify expression.
3741 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3742 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3743 Zaretskii in <http://bugs.gnu.org/12036#13>.
3744 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3745 needed now that we have gdb_make_enums_visible.
3746 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3747 (enum enum_USE_LSB_TAG):
3748 New enum types, packaging up enums that need to be exported to GDB.
3750 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3752 Utility function to make a list from specified amount of objects.
3753 * lisp.h (enum constype): New datatype.
3754 (listn): New prototype.
3755 * alloc.c (listn): New function.
3756 (Fmemory_use_count, syms_of_alloc): Use it.
3757 * buffer.c (syms_of_buffer): Likewise.
3758 * callint.c (syms_of_callint): Likewise.
3759 * charset.c (define_charset_internal): Likewise.
3760 * coding.c (syms_of_coding): Likewise.
3761 * keymap.c (syms_of_keymap): Likewise.
3762 * search.c (syms_of_search): Likewise.
3763 * syntax.c (syms_of_syntax): Likewise.
3764 * w32.c (init_environment): Likewise.
3765 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3766 * xdisp.c (syms_of_xdisp): Likewise.
3767 * xfns.c (syms_of_xfns): Likewise.
3769 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3771 Fast save_excursion_save and save_excursion_restore.
3772 * lisp.h (struct Lisp_Excursion): New data type.
3773 (PVEC_EXCURSION): New pseudovector type.
3774 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3775 to deal with it. Adjust comments.
3776 (init_marker, attach_marker): New prototype.
3777 (unchain_marker): Adjust prototype.
3778 * marker.c (attach_marker): Change to global.
3779 (init_marker): New function.
3780 * alloc.c (Fmake_marker, build_marker): Use it.
3781 (build_marker): More easserts.
3782 (mark_object): Handle struct Lisp_Excursion.
3783 * editfns.c (save_excursion_save, save_excursion_restore):
3784 Reimplement to use struct Lisp_Excursion. Add comments.
3786 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3788 Fix export of symbols to GDB (Bug#12036).
3789 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3790 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3791 emacs.c, as this is a more-suitable home. Had this been done earlier
3792 the fix for 12036 would have avoided some of the problems noted in
3793 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3794 would have been more obvious.
3795 * emacs.c: Do not include <verify.h>; no longer needed.
3796 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3797 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3798 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3799 Remove; now done in lisp.h.
3800 * lisp.h (PUBLISH_TO_GDB): New macro.
3801 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3802 (DATA_SEG_BITS): Use it.
3803 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3804 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3805 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3806 not be usable in #if. This simplifies things.
3808 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3810 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3812 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3814 Simplify export of symbols to GDB (Bug#12036).
3815 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3816 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3817 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3818 Adjust to changes in lisp.h and emacs.c, by using
3819 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3820 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3821 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3822 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3823 instead of gdb_valbits.
3824 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3825 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3826 instead of gdb_array_mark_flag.
3827 (xboolvector): Get size from $->size, not $->header.size.
3828 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3829 (xreload, hook-run, hookpost-run): Remove.
3830 * emacs.c: Include <verify.h>.
3831 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3832 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3834 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3835 (gdb_USE_LSB_TAG): New enum constants.
3836 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3837 Also define these as enum constants, so they're visible to GDB.
3838 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3839 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3840 as constants, so they're visible to GDB.
3841 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3842 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3843 Now enum constants, not macros, so they're visible to GDB.
3844 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3845 more convenient now. All uses changed.
3846 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3847 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3849 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3851 Explicitly free restriction data that are not needed anymore.
3852 * editfns.c (save_restriction_restore): Free restriction data.
3854 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3856 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3857 add argument, tune behavior, and adjust all callers.
3859 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3861 Use typedef for EMACS_INT, EMACS_UINT.
3862 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3863 than macros. This simplifies debugging in the usual case, since
3864 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3865 and it allows expressions involving EMACS_INT casts.
3866 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3868 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3870 * nsterm.m (ns_read_socket): Return early if there is a modal
3873 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3875 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3876 that FOCUS-FRAME can be omitted.
3878 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3880 Adjust buffer text indirection counters at the end of Fkill_buffer.
3881 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3882 buffer is definitely dead. This should really fix an issue reported
3883 by Christoph Scholtes again. (Bug#12007).
3884 (init_buffer_once): Initialize indirection counters of
3885 buffer_defaults and buffer_local_symbols (for sanity and safety).
3887 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3889 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3890 and continuation glyphs on tooltip frames, leave them at zero.
3891 Avoids continued lines in tooltips. (Bug#11832)
3893 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3895 Simplify copy_overlay.
3896 * buffer.c (copy_overlay): Simplify. Use build_marker.
3897 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3899 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3901 * print.c (print_object): Don't crash when a frame's name is nil
3902 or invalid. (Bug#12025)
3904 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3905 it signals an error when a tooltip frame is being created.
3907 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3909 Cleanup miscellaneous objects allocation and initialization.
3910 * alloc.c (allocate_misc): Change to static. Add argument to
3911 specify the subtype. Adjust comment and users.
3912 (build_overlay): New function.
3913 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3914 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3915 (allocate_misc): Remove prototype.
3916 (build_overlay): Add prototype.
3918 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3920 Swap buffer text indirection counters in Fbuffer_swap_text.
3921 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3922 This avoids crash reported by Christoph Scholtes at
3923 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3925 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3927 * nsmenu.m (Popdown_data): New struct.
3928 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3930 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3931 (initWithContentRect): Make imgView and contentView non-static
3932 and autorelease them. Also autorelease img and matrix (Bug#12005).
3933 (dealloc): Remove (Bug#12005).
3935 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3937 Adjust consing_since_gc when objects are explicitly freed.
3938 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3939 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3940 (free_cons, free_misc): Subtract object size from consing_since_gc.
3942 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3944 Simplify and cleanup markers positioning code.
3945 * marker.c (attach_marker): More useful eassert.
3946 (live_buffer, set_marker_internal): New function.
3947 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3948 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3950 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3952 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3953 as it's limited by the amount of memory, not by INT_MAX.
3955 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3957 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3958 in special-event-map. See the discussion at
3959 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3962 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3963 info.dwItemData. Fixes crashes on 64-bit Windows.
3964 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3966 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3968 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3969 (conversationIdentifier): Return value is NSInteger.
3970 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3972 2012-07-21 Chong Yidong <cyd@gnu.org>
3974 * window.c (decode_any_window): Signal an error if the window is
3975 on a dead frame (Bug#11984).
3977 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3979 Add indirection counting to speed up Fkill_buffer.
3980 * buffer.h (struct buffer): New member.
3981 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3982 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3983 base buffer indirection counter.
3984 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3985 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3986 through buffer list if indirection counter is 0.
3988 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3990 Extend the value returned by Fgarbage_collect with heap statistics.
3991 * alloc.c (Qheap): New symbol.
3992 (syms_of_alloc): DEFSYM it.
3993 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3994 (Fmemory_free): Remove.
3995 (syms_of_alloc): Don't defsubr it.
3996 * buffer.c (Fcompact_buffer): Remove.
3997 (syms_of_buffer): Don't defsubr it.
3999 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4001 Make maybe_gc inline.
4002 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4003 * lisp.h (consing_since_gc, gc_relative_threshold)
4004 (memory_full_cons_threshold): Revert declaration.
4005 (maybe_gc): Remove prototype, define as inline.
4006 * alloc.c: Remove old commented-out code.
4007 (consing_since_gc, gc_relative_threshold)
4008 (memory_full_cons_threshold): Revert to global.
4011 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4013 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4014 * lisp.h (build_unibyte_string): New function.
4015 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4016 * sysdep.c, w32fns.c, xfns.c: Use it.
4017 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4018 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4019 Adjust users accordingly.
4020 * font.h (font_open_by_name): Adjust prototype.
4022 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4024 Cleanup calls to Fgarbage_collect.
4025 * lisp.h (maybe_gc): New prototype.
4026 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4027 Remove declarations.
4028 * alloc.c (maybe_gc): New function.
4029 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4031 * bytecode.c (MAYBE_GC): Use maybe_gc.
4032 * eval.c (eval_sub, Ffuncall): Likewise.
4033 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4034 to avoid dependency from auto-save feature.
4036 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4038 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4039 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4040 'for_each_per_buffer_object_at'.
4041 All uses changed. It's better to use upper-case for macros that
4042 cannot be implemented as functions, to give the reader a clue
4043 that they're special.
4045 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4047 * alloc.c (Fgarbage_collect): Tweak docstring.
4049 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4051 Tweak the value returned from Fgarbage_collect again.
4052 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4053 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4054 Adjust documentation.
4055 (total_vector_bytes): Rename to total_vector_slots, adjust
4057 (total_free_vector_bytes): Rename to total_free_vector_slots,
4059 (Qstring_bytes, Qvector_slots): New symbols.
4060 (syms_of_alloc): DEFSYM them.
4062 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4064 Buffer compaction primitive which may be used from Lisp.
4065 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4066 (syms_of_buffer): Register Fcompact_buffer.
4067 * alloc.c (Fgarbage_collect): Use compact_buffer.
4068 * buffer.h (compact_buffer): New prototype.
4069 (struct buffer_text): New member.
4071 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4073 New macro to iterate over all buffers, miscellaneous cleanups.
4074 * lisp.h (all_buffers): Remove declaration.
4075 * buffer.h (all_buffers): Add declaration, with comment.
4076 (for_each_buffer): New macro.
4077 * alloc.c (Fgarbage_collect, mark_object): Use it.
4078 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4079 (init_buffer): Likewise.
4080 * data.c (Fset_default): Likewise.
4081 * coding.c (code_conversion_restore): Remove redundant check
4083 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4085 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4087 Fix bug that created negative-length intervals.
4088 * intervals.c (merge_interval_right, merge_interval_left):
4089 Do not zero out this interval if it is absorbed by its children,
4090 as this interval's total length doesn't change in that case. See
4091 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4093 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4095 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4096 when invoking (make-bool-vector N t) and N is a positive
4097 multiple of 8 -- the last 8 bits were mistakenly cleared.
4099 Remove some struct layout assumptions in bool vectors.
4100 * alloc.c (bool_header_size): New constant.
4101 (header_size, word_size): Move earlier, as they're now used earlier.
4102 Use 'word_size' in a few more places, where it's appropriate.
4103 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4104 padding before the data member of a bool vector.
4105 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4106 than doing the check by hand with an abort ().
4108 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4110 * eval.c (Fdefvar): Don't check constants since we only set the var if
4111 it's not yet defined anyway (bug#11904).
4113 * lisp.h (last_undo_boundary): Declare new var.
4114 * keyboard.c (command_loop_1): Set it.
4115 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4116 were auto-added by the command loop (bug#11774).
4118 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4120 * w32font.c (Qsymbol): Remove local definition.
4121 (syms_of_w32font): Don't DEFSYM it.
4123 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4125 Fix sweep_vectors to handle large bool vectors correctly.
4126 * alloc.c (sweep_vectors): Account total_vector_bytes for
4127 bool vectors larger than VBLOCK_BYTES_MAX.
4129 2012-07-18 Chong Yidong <cyd@gnu.org>
4131 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4132 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4134 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4136 Return more descriptive data from Fgarbage_collect.
4137 Suggested by Stefan Monnier in
4138 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4139 * alloc.c (bounded_number): New function.
4140 (total_buffers, total_vectors): New variable.
4141 (total_string_size): Rename to total_string_bytes, adjust users.
4142 (total_vector_size): Rename to total_vector_bytes, adjust users.
4143 (sweep_vectors): Account total_vectors and total_vector_bytes.
4144 (Fgarbage_collect): New return value. Adjust documentation.
4145 (gc_sweep): Account total_buffers.
4146 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4147 (VECTOR_SIZE): Remove.
4148 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4149 (Qinterval, Qmisc): New symbols.
4150 (syms_of_data): Initialize them.
4151 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4152 (Qcons, Qbuffer): New declarations.
4154 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4156 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4157 Round up, not down. Improve doc.
4159 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4161 Restore old code in allocate_string_data to avoid Faset breakage.
4162 Reported by Julien Danjou <julien@danjou.info> in
4163 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4164 * alloc.c (allocate_string_data): Restore old code with minor
4165 adjustments, fix comment to explain this subtle issue.
4167 2012-07-17 Eli Zaretskii <eliz@gnu.org>
4169 Remove FILE_SYSTEM_CASE.
4170 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4172 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4173 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4174 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4175 call-process-region passes it through expand-file-name.
4177 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4179 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4181 Fix crash when creating indirect buffer (Bug#11917)
4182 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4183 Don't handle unbound variables specially if non-zero.
4184 (Fbuffer_local_variables): Pass zero.
4185 (clone_per_buffer_values): Pass non-zero.
4187 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4189 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4190 to make the loop interruptible.
4192 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4194 * gnutls.c (emacs_gnutls_handshake): Only retry if
4195 GNUTLS_E_INTERRUPTED.
4197 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4199 Cleanup and convert miscellaneous checks to eassert.
4200 * alloc.c (mark_interval): Fix comment, partially rephrase
4201 old comment from intervals.h (see below).
4202 * intervals.c (find_interval, adjust_intervals_for_insertion)
4203 (delete_interval, adjust_intervals_for_deletion)
4204 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4206 (adjust_intervals_for_insertion, make_new_interval):
4207 Remove obsolete and unused code.
4208 * intervals.h (struct interval): Remove obsolete comment.
4209 * textprotp.c (erase_properties): Remove unused code.
4210 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4211 (Fremove_list_of_text_properties): Convert to eassert.
4213 2012-07-17 Chong Yidong <cyd@gnu.org>
4215 * editfns.c (Finsert_char): Doc fix.
4217 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4219 Fix previous change to make Fmemory_free always accurate.
4220 * alloc.c (make_interval): Update total_free_intervals.
4221 (make_float): Likewise for total_free_floats.
4222 (free_cons, Fcons): Likewise for total_free_conses.
4223 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4224 Likewise for total_free_vector_bytes.
4225 (Fmake_symbol): Likewise for total_free_symbols.
4226 (bytes_free): Remove.
4228 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4230 Simple free memory accounting feature.
4231 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4232 (sweep_vectors): Accumulate size of free vectors.
4233 (Fgarbage_collect): Setup bytes_free.
4234 (Fmemory_free): New function.
4235 (syms_of_alloc): Register it.
4237 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4239 Cleanup overlays checking.
4240 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4241 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4242 eassert and OVERLAYP.
4243 (sort_overlays): Change to use OVERLAYP.
4245 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4247 * editfns.c (Finsert_char): Make it interactive, and make the
4248 second arg optional. Copy interactive spec and docstring from
4251 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4253 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4254 Unlike the other wrapped functions, fabs has an unspecified
4257 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4259 * nsterm.m (keyDown): Interpret flags without left/right bits
4260 as the left key (Bug#11670).
4262 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4264 Remove empty and useless init functions.
4265 * lisp.h (init_character_once, init_fns, init_image)
4266 (init_filelock, init_sound): Remove prototype.
4267 * character.c (init_character_once): Remove.
4268 * filelock.c (init_filelock): Likewise.
4269 * fns.c (init_fns): Likewise.
4270 * image.c (init_image): Likewise.
4271 * sound.c (init_sound): Likewise.
4272 * emacs.c (main): Adjust accordingly.
4274 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4276 * gtkutil.h: Tiny cleanups.
4277 (use_old_gtk_file_dialog): Remove useless declaration.
4278 (xg_uses_old_file_dialog): Add suggested const attribute.
4280 2012-07-15 Eli Zaretskii <eliz@gnu.org>
4282 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4283 (bidi_paragraph_init): Use it to limit search forward for a strong
4284 directional character in abnormally large paragraphs full of
4285 neutral or weak characters. (Bug#11943)
4287 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4289 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4290 the toolbar (Bug#9451).
4291 (xg_make_tool_item): Give the widget event box a transparent
4294 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4296 Cleanup basic allocation variables and functions.
4297 * alloc.c (ignore_warnings, init_intervals, init_float)
4298 (init_cons, init_symbol, init_marker): Remove.
4299 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4300 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4301 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4302 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4303 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4304 (staticidx, init_alloc_once, init_strings, free_ablock):
4305 Remove redundant initialization.
4306 * fns.c (init_weak_hash_tables): Remove.
4307 * lisp.h (init_weak_hash_tables): Remove prototype.
4309 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4311 Use zero_vector where appropriate.
4312 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4314 * lisp.h (zero_vector): New declaration.
4315 * font.c (null_vector): Remove.
4316 (syms_of_font): Remove initialization and staticpro.
4317 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4318 * keymap.c (Faccessible_keymaps): Likewise.
4320 2012-07-15 Leo Liu <sdl.web@gmail.com>
4322 * fringe.c: Fix typo in comments.
4324 2012-07-14 Leo Liu <sdl.web@gmail.com>
4326 * fringe.c: Add a new bitmap exclamation-mark.
4328 2012-07-14 Eli Zaretskii <eliz@gnu.org>
4330 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4332 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4333 (HAVE_MENUS): Don't define, defined by editing config.in with
4335 (GMALLOC_INHIBIT_VALLOC): Don't define.
4336 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4338 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
4340 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4342 2012-07-14 Glenn Morris <rgm@gnu.org>
4344 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4345 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4346 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4348 2012-07-13 Glenn Morris <rgm@gnu.org>
4350 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4352 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4353 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4355 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4357 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4358 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4359 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4360 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4362 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4363 as boolean expression.
4364 (x_set_window_size): Remove unused variable toolbar.
4365 (ns_get_color_default, ns_mod_to_lisp): Remove.
4366 (ns_mouse_position): Remove unused variables xchar and ychar.
4367 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4368 (ns_set_vertical_scroll_bar): Remove unused variable count.
4369 (ns_delete_terminal): Remove unused variable i.
4370 (ns_term_init): Remove unused variables r, g and b.
4371 (mouseDown): Remove unused variable window.
4372 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4373 (initFrameFromEmacs): Remove unused variable vbextra.
4374 (mouseEntered): Remove unused variables p and dpyinfo.
4375 (mouseExited): Remove unused variables p and r.
4376 (ns_define_frame_cursor, ns_clear_frame_area)
4377 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4378 (menuDown): Assign [sender tag] to variable and cast the variable.
4380 * nsterm.h (menuDown): Add id as type to argument sender.
4381 (ns_display_info_for_name): Add Lisp_Object argument.
4382 (ns_term_init): Add Lisp_Object argument.
4383 (ns_map_event_to_object): Add void argument.
4384 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4385 prototype with arguments and only declare if __OBJC__.
4386 (nxatoms_of_nsselect): Add void argument.
4387 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4388 (ns_alloc_autorelease_pool): Add void argument.
4389 (ns_release_autorelease_pool): Add void* argument.
4390 (ns_get_defaults_value): Add const char* argument.
4392 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4393 (initFromContents): Use SSDATA where appropriate.
4394 (ns_update_menubar): Add braces to ambigous if-else.
4395 (initWithTitle): Put () around assignment in if statement.
4396 (ns_menu_show): Remove unused variables window and keymap.
4397 (update_frame_tool_bar): Remove unused variable selected_p.
4398 (initWithContentRect): Remove unused variable this_cmd_name.
4400 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4402 (setXBMColor): Remove unused variable len.
4403 (setPixmapData): Put () around assignment in loop statement.
4405 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4406 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4408 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4409 around assignment in loop statement.
4410 (nsfont_open): Remove unused variable i.
4411 (nsfont_open): Remove unused variable len.
4412 (nsfont_draw): Remove unused variable cs.
4414 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4415 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4416 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4417 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4418 (Fns_font_name, Fns_perform_service)
4419 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4420 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4421 (ns_set_name): Remove unused variable view.
4422 (x_set_menu_bar_lines): Remove unused variable olines.
4423 (x_set_tool_bar_lines): Remove unused variable root_window.
4424 (Fns_list_colors): Put () around assignment in while statement.
4425 (Fns_perform_service): Remove unused variable len.
4426 (Fns_display_usable_bounds): Remove unused variable top.
4427 (syms_of_nsfns): Remove unused variable i.
4429 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4432 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4434 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4435 and free it with DestroyExceptionInfo (Bug#11558).
4437 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
4439 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4440 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4441 Set here, not in nt/config.nt.
4443 2012-07-13 Eli Zaretskii <eliz@gnu.org>
4445 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4446 cursor overflow into the last glyph on display line when the right
4447 fringe is off. (Bug#11832)
4449 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4451 * xdisp.c (produce_special_glyphs): Now static.
4452 * dispextern.h (produce_special_glyphs): Remove decl.
4454 2012-07-13 Glenn Morris <rgm@gnu.org>
4456 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4457 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4459 * s/usg5-4-common.h (USG, USG5):
4460 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4461 * s/sol2-6.h (SOLARIS2):
4462 * s/irix6-5.h (IRIX6_5):
4463 * s/hpux10-20.h (USG, USG5, HPUX):
4464 * s/gnu-linux.h (USG, GNU_LINUX):
4465 * s/freebsd.h (BSD_SYSTEM):
4466 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4467 * s/cygwin.h (CYGWIN):
4468 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4469 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4471 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4473 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4475 2012-07-13 Glenn Morris <rgm@gnu.org>
4477 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4479 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4481 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4482 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4484 2012-07-12 Glenn Morris <rgm@gnu.org>
4486 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4488 * process.c (init_process_emacs): Rename from init_process.
4489 The old name is also the name of a Mach system call.
4490 * lisp.h, emacs.c: Update for this name change.
4491 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4494 2012-07-12 Eli Zaretskii <eliz@gnu.org>
4496 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4497 memmove call that removes glyphs covered by the left truncation
4498 glyph. Improve commentary.
4499 (display_line): Fix display of continuation glyphs on GUI frames
4500 when the right fringe is turned off and variable-size fonts are
4501 used in the window. Move the code that appends a stretch glyph to
4502 produce_special_glyphs, so that it could be used for truncation
4503 and continuation glyphs alike.
4504 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4505 glyph of a suitably computed width, to align the special glyphs at
4506 the window margin. Code moved from display_line. (Bug#11832)
4508 2012-07-12 Glenn Morris <rgm@gnu.org>
4510 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4512 * s/gnu-linux.h, s/hpux10-20.h:
4513 Do not unconditionally define HAVE_XRMSETDATABASE.
4515 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4517 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4519 Fix typos that broke OS X build.
4520 Reported by Randal L. Schwartz in
4521 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4522 * nsterm.m (ns_timeout): Add missing local decl.
4523 (ns_get_color): snprintf -> sprintf, to fix typo.
4525 2012-07-12 Glenn Morris <rgm@gnu.org>
4527 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4528 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4529 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4530 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4532 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4533 Move PTY_OPEN to configure.
4535 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4536 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4537 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4539 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4541 Use empty_unibyte_string where applicable.
4542 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4543 * lread.c (read1): Likewise.
4544 * xsettings.c (syms_of_xsettings): Likewise.
4546 2012-07-12 Glenn Morris <rgm@gnu.org>
4548 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4549 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4550 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4551 * s/hpux10-20.h (RUN_TIME_REMAP):
4552 * s/bsd-common.h (TABDLY): Move to configure.
4554 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4556 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4558 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4559 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4561 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4563 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4564 * s/template.h: Move NARROWPROTO to configure.
4566 2012-07-11 Glenn Morris <rgm@gnu.org>
4568 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4569 unused since 2011-01-17 change to systty.h.
4571 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4572 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4573 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4575 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4577 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4579 2012-07-11 Glenn Morris <rgm@gnu.org>
4581 * s/darwin.h, s/gnu-linux.h, s/template.h:
4582 Move INTERRUPT_INPUT to configure.
4584 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4586 Minor adjustments to interning code.
4587 * lisp.h (intern, intern_c_string): Redefine as static inline
4588 wrappers for intern_1 and intern_c_string_1, respectively.
4589 (intern_1, intern_c_string_1): Rename prototypes.
4590 * lread.c (intern_1, intern_c_string_1, oblookup):
4591 Simplify Vobarray checking.
4592 * font.c (font_intern_prop): Likewise. Adjust comment.
4593 * w32font.c (intern_font_name): Likewise.
4595 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4597 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4599 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4600 of Fcar/Fcdr if possible.
4601 * font.c (check_otf_features): Likewise.
4602 * fontset.c (Fnew_fontset): Likewise.
4603 * gnutls.c (Fgnutls_boot): Likewise.
4604 * minibuf.c (read_minibuf): Likewise.
4605 * msdos.c (IT_set_frame_parameters): Likewise.
4606 * xmenu.c (Fx_popup_dialog): Likewise.
4607 * w32menu.c (Fx_popup_dialog): Likewise.
4609 2012-07-11 Glenn Morris <rgm@gnu.org>
4611 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4612 since nothing has defined it on these platforms.
4614 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4615 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4617 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4618 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4619 Move CLASH_DETECTION to configure.
4621 * s/gnu.h: Remove file, which is now empty.
4623 * s/gnu.h, s/gnu-linux.h:
4624 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4626 2012-07-11 John Wiegley <johnw@newartisans.com>
4628 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4629 function attribute, so we only use it if it exists in the
4632 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4634 Avoid call to strlen in fast_c_string_match_ignore_case.
4635 * search.c (fast_c_string_match_ignore_case): Change to use
4636 length argument. Adjust users accordingly.
4637 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4639 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4641 Assume mkdir, rmdir.
4642 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4643 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4646 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4649 * s/hpux10-20.h (HAVE_PERROR): Remove.
4650 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4651 Remove dummy definition, as this problem was obsolete long ago.
4654 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4656 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4658 Avoid calls to strlen in font processing functions.
4659 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4660 (font_open_by_name): Change to use length argument.
4661 Adjust users accordingly.
4662 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4664 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4665 Change to return ptrdiff_t.
4666 (xfont_list_pattern, xfont_match): Use length returned by
4667 xfont_decode_coding_xlfd.
4668 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4670 2012-07-11 Glenn Morris <rgm@gnu.org>
4672 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4673 Move DONT_REOPEN_PTY to configure.
4675 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4676 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4678 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4680 Remove "#define unix" that is no longer needed (Bug#11905).
4681 * s/aix4-2.h (unix): Remove; no longer needed.
4683 EMACS_TIME simplification (Bug#11875).
4684 This replaces macros (which typically do not work in GDB)
4685 with functions, typedefs and enums, making the code easier to debug.
4686 The functional style also makes code easier to read and maintain.
4687 * systime.h: Include <sys/time.h> on all hosts, not just if
4688 WINDOWSNT, since 'struct timeval' is needed in general.
4689 (EMACS_TIME): Now a typedef, not a macro.
4690 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4692 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4693 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4694 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4695 (EMACS_TIME_LE): Now functions, not macros.
4696 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4697 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4698 which are not functions. All uses rewritten to use:
4699 (make_emacs_time): New function.
4700 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4701 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4702 not functions. All uses rewritten to use the following, respectively:
4703 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4704 (add_emacs_time, sub_emacs_time): New functions.
4705 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4706 * fileio.c (Fcopy_file):
4707 * xterm.c (XTflash): Get the current time closer to when it's used.
4708 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4710 * bytecode.c (targets): Suppress -Woverride-init warnings.
4712 Simplify by avoiding confusing use of strncpy etc.
4713 * doc.c (Fsnarf_documentation):
4714 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4715 * frame.c (Fmake_terminal_frame):
4716 * gtkutil.c (get_utf8_string):
4718 * nsmenu.m (ns_update_menubar):
4719 * regex.c (regerror):
4720 Prefer memcpy to strncpy and strncat when either will do.
4721 * fileio.c (Fsubstitute_in_file_name):
4722 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4723 (menu_separator_name_p):
4724 * nsmenu.m (ns_update_menubar):
4725 Prefer memcmp to strncmp when either will do.
4726 * nsterm.m: Include <ftoastr.h>.
4728 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4729 Prefer snprintf to strncpy.
4730 * nsterm.m (ns_term_init):
4731 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4732 * nsterm.m (ns_term_init):
4733 Avoid the need for strncpy, by using build_string or
4734 make_unibyte_string directly. Use dtoastr, not snprintf.
4735 * process.c (Fmake_network_process): Diagnose service names that
4736 are too long, rather than silently truncating them or creating
4737 non-null-terminated names.
4738 (Fnetwork_interface_info): Likewise, for interface names.
4739 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4740 Prefer sprintf to strncat.
4741 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4742 Prefer vsnprintf to vsprintf + strncpy.
4744 2012-07-10 Glenn Morris <rgm@gnu.org>
4746 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4747 Clarify fallback case.
4749 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4751 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4752 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4753 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4754 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4755 where argument type is known to be a Lisp_Cons.
4757 2012-07-10 Tom Tromey <tromey@redhat.com>
4759 * bytecode.c (BYTE_CODE_THREADED): New macro.
4760 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4761 (enum byte_code_op): New type.
4762 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4763 (exec_byte_code): Use them. Use token threading when applicable.
4765 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4767 Optimize pure C strings initialization.
4768 * lisp.h (make_pure_string): Fix prototype.
4769 (build_pure_c_string): New function, defined as static inline. This
4770 provides a better opportunity to optimize away calls to strlen when
4771 the function is called with compile-time constant argument.
4772 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4773 argument, adjust users accordingly. Use build_pure_c_string where
4775 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4776 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4777 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4779 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4781 Avoid calls to strlen in miscellaneous functions.
4782 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4783 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4784 * lread.c (openp): Likewise.
4786 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4788 Avoid calls to strlen in path processing functions.
4789 * fileio.c (file_name_as_directory): Add comment. Change to add
4790 srclen argument and return the length of result. Adjust users
4792 (directory_file_name): Fix comment. Change to add srclen argument,
4793 swap 1st and 2nd arguments to obey the common convention.
4794 Adjust users accordingly.
4795 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4797 2012-07-10 Glenn Morris <rgm@gnu.org>
4799 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4800 Move PENDING_OUTPUT_COUNT definition to configure.
4802 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4803 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4804 * s/gnu.h (DATA_START): Move definitions to configure.
4806 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4807 We include usg5-4-common.h, which defines them both.
4809 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4810 O_RDONLY already includes it).
4812 Stop ns builds setting the EMACSLOADPATH environment variable.
4813 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4814 Now it does not set EMACSLOADPATH, just returns the load-path string.
4815 * nsterm.h: Update accordingly.
4816 * lread.c [HAVE_NS]: Include nsterm.h.
4817 (init_lread) [HAVE_NS]: Use ns_load_path.
4818 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4820 2012-07-09 Glenn Morris <rgm@gnu.org>
4822 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4823 since the included bsd-common.h does so.
4825 Stop ns builds setting the EMACSPATH environment variable.
4826 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4827 (ns_init_paths): Do not set EMACSPATH.
4828 * nsterm.h (ns_exec_path): Add it.
4829 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4832 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4834 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4836 * process.c (wait_reading_process_output): 'waitchannels' was unset
4837 when read_kbd || !NILP (wait_for_cell); fix this.
4839 Add GCC-style 'const' attribute to functions that can use it.
4840 * character.h (char_resolve_modifier_mask):
4841 * keyboard.h (make_ctrl_char):
4842 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4843 (init_character_once, next_almost_prime, init_fns, init_image)
4844 (flush_pending_output, init_sound):
4845 * mem-limits.h (start_of_data):
4846 * menu.h (finish_menu_items):
4847 Add ATTRIBUTE_CONST.
4848 * emacs.c (DEFINE_DUMMY_FUNCTION):
4849 Declare the dummy function with ATTRIBUTE_CONST.
4850 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4851 Add decls with ATTRIBUTE_CONST.
4853 Minor improvements to make_formatted_string.
4854 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4855 where int is good enough, as vsprintf returns an int.
4856 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4858 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4860 Use make_formatted_string to avoid double length calculation.
4861 * lisp.h (make_formatted_string): New prototype.
4862 * alloc.c (make_formatted_string): New function.
4863 * buffer.c (Fgenerate_new_buffer_name): Use it.
4864 * dbus.c (syms_of_dbusbind): Likewise.
4865 * editfns.c (Fcurrent_time_zone): Likewise.
4866 * filelock.c (get_boot_time): Likewise.
4867 * frame.c (make_terminal_frame, set_term_frame_name)
4868 (x_report_frame_params): Likewise.
4869 * image.c (gs_load): Likewise.
4870 * minibuf.c (get_minibuffer): Likewise.
4871 * msdos.c (dos_set_window_size): Likewise.
4872 * process.c (make_process): Likewise.
4873 * xdisp.c (ensure_echo_area_buffers): Likewise.
4874 * xsettings.c (apply_xft_settings): Likewise.
4876 2012-07-09 Glenn Morris <rgm@gnu.org>
4878 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4879 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4880 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4881 * nsterm.h (ns_etc_directory): Add it.
4882 * callproc.c [HAVE_NS]: Include nsterm.h.
4883 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4885 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4887 Move marker debugging code under MARKER_DEBUG.
4888 * marker.c (MARKER_DEBUG): Move marker debugging code under
4889 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4890 for bootstrap with --enable-checking (~3x slowdown reported
4891 by Juanma Barranquero <lekktu@gmail.com>).
4892 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4894 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4896 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4897 See <http://bugs.gnu.org/11825#29>.
4899 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4901 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4902 has no font, use the frame's font. (Bug#11813)
4903 (display_line): Add commentary about displaying truncation glyphs
4905 (produce_special_glyphs): Move here from term.c.
4907 * term.c (produce_special_glyphs): Move to xdisp.c.
4909 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4912 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4914 * xdisp.c (display_line): Avoid warning about implicit declaration
4917 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4919 * lisp.h: Remove empty conditional.
4921 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4923 * lread.c (load_path_check): Now static.
4925 Fix some minor --with-ns problems found by static checking.
4926 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4927 (x_set_font) [!HAVE_X_WINDOWS]:
4928 * image.c (xpm_load_image) [HAVE_NS]:
4929 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4930 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4931 Remove unused local.
4932 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4933 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4934 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4935 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4936 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4937 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4938 Fix pointer signedness problem.
4939 * xfaces.c (FRAME_X_FONT_TABLE):
4940 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4942 2012-07-07 Glenn Morris <rgm@gnu.org>
4944 * lread.c (load_path_check): New function, split from init_lread.
4945 (init_lread): Reorganize. Motivation:
4946 If EMACSLOADPATH is set, check/warn about that rather than the
4947 defaults, which we are not going to use. Hence we can remove
4948 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4949 Don't warn if site-lisp directories are missing.
4950 If not installed, start from a blank load-path, since
4951 PATH_LOADSEARCH refers to the eventual installation directories.
4953 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4955 Support truncation and continuation glyphs on GUI frames, when
4956 fringes are disabled. (Bug#11832)
4957 * xdisp.c (init_iterator): Get dimensions of truncation and
4958 continuation glyphs even if on GUI frames.
4959 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4960 or both, are absent.
4961 (start_display, move_it_in_display_line_to): Handle the case of a
4962 GUI frame without a fringe to display continuation or truncation
4964 (insert_left_trunc_glyphs): Support GUI frames: make sure
4965 truncation glyphs overwrite enough glyphs from the current line to
4966 have sufficient space in pixels.
4967 (display_line): Support truncation and continuation glyphs on GUI
4968 frames. If some spare pixels are left on the line after inserting
4969 the truncation glyphs, fill that space with a stretch glyph of a
4970 suitably computed width.
4972 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4973 produce_glyphs, to support GUI sessions.
4975 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4977 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4979 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4981 Do not require float-time's arg to fit in time_t (Bug#11825).
4982 This works better on hosts where time_t is unsigned, and where
4983 float-time is applied to the (negative) difference between two times.
4984 * editfns.c (decode_time_components): Last arg is now double *,
4985 not int *, and means to store all the result as a double, without
4986 worrying about whether the seconds part fits in time_t.
4987 All callers changed.
4988 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4989 All callers changed.
4990 (Ffloat_time): Do not fail merely because the specified time falls
4991 outside of time_t range.
4993 2012-07-07 Glenn Morris <rgm@gnu.org>
4995 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4996 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4997 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4999 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
5001 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5002 Update dependencies.
5004 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5006 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5008 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5009 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5010 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5011 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5012 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5013 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5015 * xfont.c (compare_font_names): Redo to omit the need for casts.
5017 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5019 * xfns.c (Fx_change_window_property): Doc fix.
5020 * w32fns.c (Fx_change_window_property): Doc fix.
5022 * w32fns.c (Fx_window_property): Accept the same arguments as the
5023 X Windows version. Doc fix.
5024 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5026 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5027 Eli Zaretskii <eliz@gnu.org>
5029 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5030 Windows-specific code from nt/config.nt moved here.
5031 Obsolete settings removed.
5033 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5035 * process.c: Avoid unnecessary calls to gettime.
5036 (wait_reading_process_output): Don't get the time of day
5037 when gobbling data immediately and not waiting, as there's no need
5038 for it in that case. This removes a FIXME.
5040 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5042 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5043 is defined (Bug#11768).
5045 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5047 Fix marker debugging code.
5048 * marker.c (byte_char_debug_check): Do not perform the check
5049 if buffer is not multibyte.
5050 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5051 Call byte_char_debug_check with correct arguments.
5053 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5055 Compile marker debugging code only if ENABLE_CHECKING is defined.
5056 * marker.c (byte_char_debug_check, count_markers):
5057 Use only if ENABLE_CHECKING is defined.
5058 (byte_debug_flag): Remove.
5059 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5060 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5062 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5064 Avoid code repetition in marker-related functions.
5065 * marker.c (attach_marker): New function.
5066 (Fset_marker, set_marker_restricted, set_marker_both)
5067 (set_marker_restricted_both): Use it.
5068 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5069 Consistently rename charno to charpos.
5070 (marker_position): Add eassert.
5071 (marker_byte_position): Convert to eassert.
5073 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5075 Simplify list operations in unchain_overlay and unchain_marker.
5076 * buffer.c (unchain_overlay): Simplify. Add comment.
5077 * marker.c (unchain_marker): Simplify. Fix comments.
5079 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5081 Introduce fast path for the widely used marker operation.
5082 * alloc.c (build_marker): New function.
5083 * lisp.h (build_marker): New prototype.
5084 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5085 * composite.c (autocmp_chars): Likewise.
5086 * editfns.c (buildmark): Remove.
5087 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5088 (save_restriction_save): Use build_marker.
5089 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5090 * window.c (save_window_save): Likewise.
5092 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5094 Do not use Fdelete_overlay in delete_all_overlays
5095 to avoid redundant calls to unchain_overlay.
5096 * buffer.c (drop_overlay): New function.
5097 (delete_all_overlays, Fdelete_overlay): Use it.
5098 * minibuf.c (get_minibuffer): Fix comment.
5100 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5102 Port to OpenBSD 5.1 amd64.
5103 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5104 This is needed for OpenBSD, and should be harmless on all BSD systems.
5105 Also, include <sys/sysctl.h>, as it should be available on all
5106 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5107 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5108 use p_pid member, not kp_proc.pid.
5110 2012-07-06 Glenn Morris <rgm@gnu.org>
5112 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5114 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5116 More xmalloc and related cleanup.
5117 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5118 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5119 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5120 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5121 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5122 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5123 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5124 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5125 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5127 Omit needless casts involving void * pointers and allocation.
5128 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5129 as the former is more robust if P's type is changed.
5130 Prefer xzalloc to xmalloc + memset 0.
5131 Simplify malloc-or-realloc to realloc.
5132 Don't worry about xmalloc returning a null pointer.
5133 Prefer xstrdup to xmalloc + strcpy.
5134 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5136 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5137 alloca of a constant.
5139 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5141 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5142 hscroll is larger than the line width. Fixes long and futile
5143 looping inside extend_face_to_end_of_line (on a TTY) producing
5144 glyphs that are not needed and thrown away.
5146 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5148 * marker.c (set_marker_restricted_both): Simplify by using
5151 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5153 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5155 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5157 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5158 not defined (Bug#11768).
5159 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5160 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5161 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5162 followed by gtk_box_set_homogeneous (Bug#11768).
5163 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5164 (update_theme_scrollbar_width, xg_create_scroll_bar):
5165 Use gtk_scrollbar_new (Bug#11768).
5166 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5167 (is_box_type): New function (Bug#11768).
5168 (xg_tool_item_stale_p): Call is_box_type.
5169 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5170 with default display (Bug#11768).
5172 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5174 * xdisp.c (window_hscroll_limited): New function.
5175 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5176 coordinates when window's hscroll is set to insanely large
5179 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
5181 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5182 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5184 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5187 * lisp.h (xzalloc): New prototype. Omit needless casts.
5188 * alloc.c (xzalloc): New function. Omit needless casts.
5189 * charset.c: Omit needless casts. Convert all calls to
5190 xmalloc with following memset to xzalloc.
5191 * dispnew.c: Likewise.
5192 * fringe.c: Likewise.
5193 * image.c: Likewise.
5194 * sound.c: Likewise.
5196 * w32fns.c: Likewise.
5197 * w32font.c: Likewise.
5198 * w32term.c: Likewise.
5199 * xfaces.c: Likewise.
5201 * xterm.c: Likewise.
5202 * atimer.c: Omit needless casts.
5203 * buffer.c: Likewise.
5204 * callproc.c: Likewise.
5206 * coding.c: Likewise.
5207 * composite.c: Likewise.
5209 * doprnt.c: Likewise.
5210 * editfns.c: Likewise.
5211 * emacs.c: Likewise.
5213 * filelock.c: Likewise.
5215 * gtkutil.c: Likewise.
5216 * keyboard.c: Likewise.
5218 * lread.c: Likewise.
5219 * minibuf.c: Likewise.
5220 * msdos.c: Likewise.
5221 * print.c: Likewise.
5222 * process.c: Likewise.
5223 * region-cache.c: Likewise.
5224 * search.c: Likewise.
5225 * sysdep.c: Likewise.
5226 * termcap.c: Likewise.
5227 * terminal.c: Likewise.
5228 * tparam.c: Likewise.
5229 * w16select.c: Likewise.
5231 * w32reg.c: Likewise.
5232 * w32select.c: Likewise.
5233 * w32uniscribe.c: Likewise.
5234 * widget.c: Likewise.
5235 * xdisp.c: Likewise.
5236 * xmenu.c: Likewise.
5238 * xselect.c: Likewise.
5240 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5242 * fileio.c (time_error_value): Check the right error number.
5243 Problem reported by Troels Nielsen in
5244 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5246 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5248 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5249 This should be fixed in a better way; see Eli Zaretskii in
5250 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5251 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5253 * fileio.c (time_error_value): Rename from special_mtime.
5254 The old name's problems were noted by Eli Zaretskii in
5255 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5257 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5258 This variable's comment says Emacs needs at least one GDB-visible
5259 symbol of type enum pvec_type, to work around GDB problems.
5260 The symbol's value doesn't matter.
5262 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5263 that causes compilation to fail on pre-C99 compilers.
5265 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
5267 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5268 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5270 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5272 * buffer.c (init_buffer_once): Fix initialization of
5273 headers for buffer_defaults and buffer_local_symbols.
5274 Reported by Juanma Barranquero <lekktu@gmail.com>.
5276 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5278 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5279 * lisp.h (enum pvec_type): Use fewer bits.
5280 (PSEUDOVECTOR_SIZE_BITS): New constant.
5281 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5282 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5283 change in pvec_type.
5284 (PSEUDOVECTOR_TYPEP): New macro.
5285 (TYPED_PSEUDOVECTORP): Use it.
5286 * fns.c (internal_equal): Adapt code to extract pvectype.
5287 * emacs.c (gdb_pvec_type): Update type.
5288 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5289 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5290 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5291 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5292 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5293 abusing vector->header.next.nbytes.
5294 (live_vector_p): Use PVEC_TYPE.
5295 (mark_object): Adapt code to extract pvectype. Use switch.
5297 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5299 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5300 Tighten new eassert a bit.
5302 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5304 Fix compilation with --enable-gcc-warnings and -O1
5306 * doprnt.c (doprnt): Change type of tem to int, initialize
5307 to avoid compiler warning. Add eassert.
5308 * search.c (simple_search): Initialize match_byte to avoid
5309 compiler warning. Add eassert.
5311 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5313 Avoid weird behavior with large horizontal scrolls.
5314 Without this change, for example, large hscroll values would
5315 mess up Emacs's display on Fedora 15 x86, presumably due to
5316 overflows in int calculations in the display code.
5317 Also, if buffers had long lines, Emacs would freeze.
5318 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5319 (set_window_hscroll): New function, containing the old guts of
5320 Fset_window_hscroll. Return the clipped value.
5321 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5322 This avoids the need to check against PTRDIFF_MAX.
5324 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5326 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5328 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5330 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5332 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5333 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5334 since GCC 4.4.6 issues a bogus warning for them.
5336 Fix bugs in file timestamp newness comparisons.
5337 * fileio.c (Ffile_newer_than_file_p):
5338 * lread.c (Fload): Use full timestamp resolution of files,
5339 not just the 1-second resolution, so that files that are only
5340 slightly newer still count as newer.
5341 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5342 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5344 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5346 * fileio.c: Improve handling of file time marker. (Bug#11852)
5347 (special_mtime): New function.
5348 (Finsert_file_contents, Fverify_visited_file_modtime):
5349 Use it to set special mtime values consistently.
5351 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5353 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5354 marker for non-existing file. (Bug#11852)
5356 2012-07-03 Glenn Morris <rgm@gnu.org>
5358 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5359 and did not make it into globals.h).
5361 2012-07-03 Tom Tromey <tromey@redhat.com>
5363 * window.c (Fset_window_margins, Fset_window_fringes)
5364 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5365 * textprop.c (Fprevious_property_change): No longer static.
5366 * syntax.c (Fsyntax_table_p): No longer static.
5367 * process.c (Fget_process, Fprocess_datagram_address): No longer
5369 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5370 * keyboard.c (Fcommand_execute): No longer static.
5372 * insdel.c (Fcombine_after_change_execute): No longer static.
5373 * image.c (Finit_image_library): No longer static.
5374 * fileio.c (Fmake_symbolic_link): No longer static.
5375 * eval.c (Ffetch_bytecode): No longer static.
5376 * editfns.c (Fuser_full_name): No longer static.
5377 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5379 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5381 * dired.c (Ffile_attributes): No longer static.
5382 * composite.c (Fcomposition_get_gstring): No longer static.
5383 * callproc.c (Fgetenv_internal): No longer static.
5385 * ccl.h: Remove EXFUNs.
5386 * buffer.h: Remove EXFUNs.
5387 * dispextern.h: Remove EXFUNs.
5388 * intervals.h: Remove EXFUNs.
5389 * fontset.h: Remove EXFUN.
5390 * font.h: Remove EXFUNs.
5391 * dosfns.c (system_process_attributes): Remove EXFUN.
5392 * keymap.h: Remove EXFUNs.
5393 * lisp.h: Remove EXFUNs.
5394 * w32term.h: Remove EXFUNs.
5395 * window.h: Remove EXFUNs.
5396 * xsettings.h: Remove EXFUN.
5397 * xterm.h: Remove EXFUN.
5399 2012-07-03 Glenn Morris <rgm@gnu.org>
5401 * lisp.h (Frandom): Make it visible to C.
5402 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5403 buffer for invisible buffers. (Bug#1229)
5405 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5407 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5408 values which aren't power of 2.
5409 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5410 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5413 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5415 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5417 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5419 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5421 * alloc.c (allocate_vector_block): Remove redundant
5422 calls to mallopt if DOUG_LEA_MALLOC is defined.
5423 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5424 avoid calls to mallopt if zero_vector is returned.
5426 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5428 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5429 is enabled, avoid dereferencing NULL current_sblock if
5432 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5434 Cleanup basic buffer management.
5435 * buffer.h (struct buffer): Change layout to use generic vector
5436 marking code. Fix some comments. Change type of 'clip_changed'
5437 to bitfield. Remove unused #ifndef old.
5438 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5439 (GET_OVERLAYS_AT): Fix indentation.
5440 (for_each_per_buffer_object_at): New macro.
5441 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5442 (Fbuffer_local_variables): Use it.
5443 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5444 * alloc.c (allocate_buffer): Adjust to match new layout of
5445 struct buffer. Fix comment.
5446 (mark_overlay): New function.
5447 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5448 Lisp area of struct buffer.
5449 (mark_object): Use it. Adjust marking of misc objects
5450 and related comments.
5452 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5454 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5455 wrapper that is not needed because the wrapped code is a no-op (zero
5456 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5457 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5459 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5461 * alloc.c (mark_buffer): Simplify. Remove prototype.
5462 (mark_object): Add comment. Reorganize marking of vector-like
5463 objects. Use CHECK_LIVE for all vector-like objects except buffers
5464 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5465 Avoid redundant calls to mark_vectorlike for bool vectors.
5467 2012-06-30 Glenn Morris <rgm@gnu.org>
5469 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5471 * epaths.in (PATH_SITELOADSEARCH): New.
5472 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5473 This is rather than relying on --enable-locallisppath elements
5474 having "site-lisp" in their names. (Bug#10208#25, 11658)
5476 2012-06-30 Eli Zaretskii <eliz@gnu.org>
5478 * w32proc.c (sys_select): Accept and ignore one more argument.
5480 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5482 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5483 (pselect) [!MS_DOS]: Redirect to sys_select.
5485 * sysdep.c: Don't include dos.h and dosfns.h.
5487 * process.c (sys_select):
5488 * msdos.c (sys_select): Accept one more argument and ignore it.
5490 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5491 adapt data types and code to that.
5494 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5495 which clashes with the gnulib function of the same name.
5497 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5499 * font.c (font_style_to_value, font_style_symbolic)
5500 (font_prop_validate_style): Add type checks for values in
5503 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5505 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5508 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5510 * xdisp.c (try_window_id): Undo last change.
5512 * w32.c (getwd): Adjust commentary about startup_dir.
5513 (init_environment): Always call sys_access, even in non-MSVC
5514 builds. Don't chdir to the directory of the Emacs executable.
5515 This undoes code from 1997 which was justified by the need to
5516 "avoid conflicts when removing and renaming directories". But its
5517 downside was that every relative file name was being interpreted
5518 relative to the directory of the Emacs executable, which can never
5519 be TRT. In particular, it broke sys_access when called with
5520 relative file names.
5521 (sys_access): Map GetLastError to errno.
5523 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5525 * window.h (struct window): Change type of 'fringes_outside_margins'
5526 to bitfield. Fix comment. Adjust users accordingly.
5527 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5529 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5532 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5534 * gnutls.c (emacs_gnutls_handshake):
5535 Add QUIT to make the loop interruptible.
5537 2012-06-29 Glenn Morris <rgm@gnu.org>
5539 * charset.c (init_charset): Make lack of etc/charsets fatal.
5541 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5543 * editfns.c (region_limit): Fix type mismatch.
5545 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5547 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5548 undefined. Convert from xassert to eassert.
5549 * nsmenu.m: Convert from xassert to eassert.
5550 * nsterm.m: Likewise.
5552 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5554 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5556 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5558 Avoid integer overflow on scroll-left and scroll-right.
5559 * window.c (HSCROLL_MAX): New macro.
5560 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5561 overflow when requested scroll falls outside ptrdiff_t range.
5563 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5565 * window.h (struct window): Change type of 'hscroll',
5566 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5567 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5568 Adjust users accordingly.
5569 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5570 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5571 from EMACS_INT to ptrdiff_t.
5572 (make_window): Omit redundant initialization.
5574 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5576 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5578 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5580 * window.h (struct window): Change type of 'use_time' and
5581 'sequence_number' from Lisp_Object to int.
5582 * frame.c (make_frame): Adjust users accordingly.
5583 * print.c (print_object): Likewise.
5584 * window.c (select_window, Fwindow_use_time, make_parent_window)
5585 (make_window): Likewise.
5587 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5589 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5590 enabled with --enable-checking=[all,glyphs] configure option.
5591 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5592 adjust comments accordingly.
5593 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5594 undefined, adjust comments accordingly.
5595 * image.c: Likewise.
5596 * scroll.c: Likewise.
5597 * w32fns.c: Likewise.
5598 * w32term.c: Likewise.
5599 * xdisp.c: Likewise.
5600 * xfaces.c: Likewise.
5602 * xterm.c: Likewise.
5604 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5606 Generalize run-time debugging checks.
5607 * dispextern.h (XASSERTS): Remove.
5608 * fontset.c (xassert): Remove.
5609 Convert from xassert to eassert.
5610 * alloc.c: Convert from xassert to eassert.
5612 * dispnew.c: Likewise.
5614 * fringe.c: Likewise.
5615 * ftfont.c: Likewise.
5616 * gtkutil.c: Likewise.
5617 * image.c: Likewise.
5618 * keyboard.c: Likewise.
5620 * process.c: Likewise.
5621 * scroll.c: Likewise.
5622 * sound.c: Likewise.
5624 * w32console.c: Likewise.
5625 * w32fns.c: Likewise.
5626 * w32term.c: Likewise.
5627 * window.c: Likewise.
5628 * xdisp.c: Likewise.
5629 * xfaces.c: Likewise.
5631 * xselect.c: Likewise.
5632 * xterm.c: Likewise.
5634 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5636 * fns.c (maybe_resize_hash_table): Output message when growing the
5639 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5641 * alloc.c (allocate_string_data): Remove dead code.
5642 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5643 avoid GCC warning about unused macro.
5645 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5647 * alloc.c (allocate_string): Omit intervals initialization.
5648 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5649 as in make_pure_string and make_pure_c_string.
5651 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5653 * alloc.c (allocate_string): Fix last change.
5655 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5657 * alloc.c (allocate_string): Remove two redundant calls
5658 to memset, add explicit initialization where appropriate.
5660 2012-06-27 Glenn Morris <rgm@gnu.org>
5662 * lisp.mk (lisp): Remove paths.elc.
5664 2012-06-27 Chong Yidong <cyd@gnu.org>
5666 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5668 2012-06-26 John Wiegley <johnw@newartisans.com>
5670 * unexmacosx.c (copy_data_segment): Add two section names used
5671 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5673 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5674 when building with Clang.
5676 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5678 * eval.c (Fapply): Allow calling it with a single argument.
5680 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5682 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5683 _stricmp and _strnicmp.
5684 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5686 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5688 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5690 (allocate_process): Likewise for new process.
5691 (allocate_terminal): Change to use offsetof.
5692 (allocate_frame): Likewise.
5693 * frame.c (make_frame): Omit redundant initialization.
5694 * window.c (make_parent_window): Use memset.
5695 (make_window): Omit redundant initialization.
5696 * process.c (make_process): Omit redundant initialization.
5697 * terminal.c (create_terminal): Likewise.
5699 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5701 * term.c (delete_tty): Remove redundant call to memset.
5703 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5705 * alloc.c: Remove build_string.
5706 * lisp.h: Define build_string as static inline. This provides
5707 a better opportunity to optimize away calls to strlen when the
5708 function is called with compile-time constant argument.
5709 * image.c (imagemagick_error): Convert to build_string.
5710 * w32proc.c (sys_spawnve): Likewise.
5711 * xterm.c (x_term_init): Likewise.
5713 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5715 Use sprintf return value instead of invoking strlen on result.
5716 In the old days this wasn't portable, since some sprintf
5717 implementations returned char *. But they died out years ago and
5718 Emacs already assumes sprintf returns int.
5719 Similarly for float_to_string.
5720 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5721 * ccl.c (ccl_driver):
5722 * character.c (string_escape_byte8):
5723 * data.c (Fnumber_to_string):
5724 * doprnt.c (doprnt):
5725 * print.c (print_object):
5726 * xdisp.c (message_dolog):
5727 * xfns.c (syms_of_xfns):
5728 Use sprintf or float_to_string result to avoid need to call strlen.
5729 * data.c (Fnumber_to_string):
5730 Use make_unibyte_string, since the string must be ASCII.
5731 * lisp.h, print.c (float_to_string): Now returns int length.
5732 * term.c (produce_glyphless_glyph):
5733 Use sprintf result rather than recomputing it.
5735 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5736 * Makefile.in (ALL_CFLAGS):
5737 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5738 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5740 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5742 * dispextern.h (xstrcasecmp): Define to library function
5743 strcasecmp if available.
5744 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5746 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5748 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5749 Avoid comma operator.
5750 * menu.c (push_submenu_start, push_submenu_end)
5751 (push_left_right_boundary, push_menu_pane): Likewise.
5752 * msdos.c (dos_rawgetc): Likewise.
5754 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5756 * xfns.c (xic_create_fontsetname): Remove redundant calls
5759 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5761 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5762 sprintf already null-terminates its output.
5764 * xfns.c (x_window): Remove redundant cast.
5766 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5768 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5769 `const char *' to `char *' to avoid compiler warning.
5771 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5773 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5774 instead of truncating it to 63 (admittedly a generous limit).
5776 * process.c: Fix spelling and caps in comments.
5778 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5780 * emacs.c (setpgrp): Remove definition, unused.
5781 * sysdep.c (setpgrp): Remove definition, not used in this file.
5783 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5785 * makefile.w32-in: Update dependencies.
5787 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5789 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5790 (SYSTIME_H): Add nt/inc/sys/time.h.
5792 * systime.h [WINDOWSNT]: Include sys/time.h.
5794 * s/ms-w32.h (struct timespec): Definition moved from
5795 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5797 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5799 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5800 * buffer.h (buffer_slot_type_mismatch):
5801 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5802 * eval.c (unwind_to_catch):
5803 * image.c (my_png_error, my_error_exit):
5804 * keyboard.c (quit_throw_to_read_char, user_error)
5805 (Fexit_recursive_edit, Fabort_recursive_edit):
5806 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5807 (wrong_type_argument, buffer_overflow, __executable_start)
5808 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5809 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5810 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5812 (child_setup) [!DOS_NT]:
5813 * lread.c (end_of_file_error, invalid_syntax):
5814 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5815 * puresize.h (pure_write_error):
5816 * search.c (matcher_overflow):
5817 * sound.c (sound_perror, alsa_sound_perror):
5818 * sysdep.c, syssignal.h (croak):
5819 * term.c (maybe_fatal, vfatal):
5820 * textprop.c (text_read_only):
5821 * undo.c (user_error):
5822 * unexmacosx.c (unexec_error):
5823 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5824 Use _Noreturn rather than NO_RETURN.
5825 No need for separate decl merely because of _Noreturn.
5826 * sound.c (sound_warning, parse_sound):
5827 Remove unnecessary forward decls.
5829 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5831 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5832 * lisp.h (WAIT_READING_MAX): New macro.
5833 * dispnew.c (Fsleep_for, sit_for):
5834 * keyboard.c (kbd_buffer_get_event):
5835 * process.c (Faccept_process_output):
5836 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5837 This improves on the previous patch, which introduced a bug
5838 when time_t is unsigned and as wide as intmax_t.
5839 See <http://bugs.gnu.org/9000#51>.
5841 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5843 * dispnew.c (sit_for, Fsleep_for):
5844 * keyboard.c (kbd_buffer_get_event):
5845 * process.c (Faccept_process_output): Avoid compiler warnings when
5846 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5848 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5850 * makefile.w32-in: Update dependencies.
5852 * w32.c (ltime): Add return type and declare static.
5853 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5855 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5857 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5858 Privately reported by Herbert J. Skuhra.
5859 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5861 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5862 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5864 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5866 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5867 last argument of make_unibyte_string.
5869 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5870 language ID in the event parameters.
5872 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5873 event.code, not the obscure "character set ID".
5875 2012-06-23 Chong Yidong <cyd@gnu.org>
5877 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5879 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5881 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5882 * w32.c (fdutimens): New function.
5884 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5886 * s/ms-w32.h (pselect): Redirect to sys_select.
5888 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5890 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5891 in the logic of incrementing and decrementing the value of
5892 use_relocatable_buffers.
5894 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5896 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5897 Privately reported by Herbert J. Skuhra.
5898 [__FreeBSD__]: Remove "*/" typo after "#include".
5899 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5900 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5901 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5902 Don't assume EMACS_TIME and struct timeval are the same type.
5904 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5906 Support higher-resolution time stamps (Bug#9000).
5907 The time stamps are only nanosecond-resolution at the C level,
5908 since that's the best that any real-world system supports now.
5909 But they are picosecond-resolution at the Lisp level, as that's
5910 easy, and leaves room for future OS improvements.
5912 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5915 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5916 Don't get current time unless it's needed.
5918 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5919 now provides it if it's absent.
5920 (start_atimer): Port to higher-res time stamps.
5921 Check for time stamp overflow. Don't get current time more
5922 often than is needed.
5924 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5925 Include systime.h, not time.h.
5926 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5928 * dired.c: Include stat-time.h.
5929 (Ffile-attributes): File times now have higher resolution.
5931 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5932 (struct image): Timestamp now has higher resolution.
5934 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5935 has at least microseconds now. All uses removed.
5936 (update_frame, update_single_window, update_window, update_frame_1)
5937 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5938 (duration_to_sec_usec): Remove; no longer needed.
5940 * editfns.c (time_overflow): Now extern.
5941 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5942 (float-time, Fformat_time_string, Fcurrent_time_string)
5943 (Fcurrent_time_zone): Accept and generate higher-resolution
5945 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5946 (decode_time_components, lisp_seconds_argument): New functions.
5947 (make_time): Now static.
5948 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5949 Report an error if the time is invalid, rather than having the caller
5952 * fileio.c: Include <stat-time.h>
5953 (Fcopy_file): Copy higher-resolution time stamps.
5954 Prefer to set the time stamp via a file descriptor if that works.
5955 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5956 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5957 (Fvisited_file_modtime, Fset_visited_file_modtime):
5958 Support higher-resolution time stamps.
5960 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5962 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5964 * image.c (prepare_image_for_display, clear_image_cache)
5965 (lookup_image): Port to higer-resolution time stamps.
5967 * keyboard.c (start_polling, bind_polling_period):
5968 Check for time stamp overflow.
5969 (read_char, kbd_buffer_get_event, timer_start_idle)
5970 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5971 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5972 Port to higher-resolution time stamps. Do not assume time_t is signed.
5973 (decode_timer): New function. Timers are now vectors of length 9,
5974 not 8, to accommodate the picosecond component.
5975 (timer_check_2): Use it.
5977 * nsterm.m (select_timeout, timeval_subtract): Remove.
5978 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5979 as they're a bit more accurate and handle overflow better.
5980 (ns_select): Change prototype to be compatible with pselect.
5981 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5982 * nsterm.h (ns_select): Adjust prototype.
5984 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5985 us-resolution time stamps.
5986 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5988 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5990 * lisp.h (time_overflow): New decl.
5991 (wait_reading_process_output): First arg is now intmax_t, not int,
5992 to accommodate larger waits.
5994 * process.h (struct Lisp_Process.read_output_delay):
5995 Now counts nanoseconds, not microseconds.
5996 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5998 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5999 (wait_reading_process_output):
6000 Port to ns-resolution time stamps.
6001 (Faccept_process_output, wait_reading_process_output):
6002 Check for time stamp overflow. Do not assume time_t is signed.
6003 (select_wrapper): Remove; we now use pselect.
6004 (Fprocess_attributes): Now generates ns-resolution time stamps.
6006 * sysdep.c: Include utimens.h. Don't include utime.h
6007 or worry about struct utimbuf; gnulib does that for us now.
6008 (gettimeofday): Remove; gnulib provides a substitute.
6009 (make_timeval): New function.
6010 (set_file_times): Now sets ns-resolution time stamps.
6011 New arg FD; all uses changed.
6012 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6013 (system_process_attributes):
6014 Now returns ns-resolution time stamp. All uses changed.
6015 Check for time stamp overflow.
6017 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6018 provides a substitute now.
6020 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6021 since it guarantees struct timespec.
6022 (EMACS_TIME): Now struct timespec, so that we can support
6023 ns-resolution time stamps.
6024 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6025 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6026 (EMACS_USECS): Remove.
6027 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6028 so multiply the arg by 1000 before storing it.
6029 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6031 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6032 Port to ns-resolution time stamps.
6033 (EMACS_TIME_NEG_P): Remove; replaced by....
6034 (EMACS_TIME_SIGN): New macro.
6035 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6036 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6037 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6038 (make_timeval, make_lisp_time, decode_time_components): New decls.
6039 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6040 that it mishandled time_t overflow. You can't compare by subtracting!
6041 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6042 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6044 * term.c: Include <sys/time.h>.
6045 (timeval_to_Time): New function, for proper overflow wraparound.
6046 (term_mouse_position, term_mouse_click): Use it.
6048 * undo.c (record_first_change): Support higher-resolution time stamps
6050 (Fprimitive_undo): Use them when restoring time stamps.
6052 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6053 (w32_get_internal_run_time):
6054 Port to higher-resolution Emacs time stamps.
6055 (ltime): Now accepts single 64-bit integer, as that's more convenient
6058 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6060 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6061 for compatibility with pselect. Support ns-resolution time stamps.
6063 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6065 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6066 Check for time stamp overflow, and support ns-resolution time stamps.
6068 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6069 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6070 (timeval_subtract): Remove; no longer needed.
6071 (XTflash, XTring_bell, x_wait_for_event):
6072 Port to ns-resolution time stamps. Don't assume time_t is signed.
6074 2012-06-22 Chong Yidong <cyd@gnu.org>
6076 * xdisp.c (x_consider_frame_title): Revert last change.
6078 2012-06-22 Eli Zaretskii <eliz@gnu.org>
6080 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6081 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6082 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6083 staticidx goes up to 1597 out of 1600 = 0x640.)
6085 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6087 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6088 Otherwise, the umask might be mistakenly 0 while handling input signals.
6090 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6092 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6094 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6096 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6097 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6098 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6099 access to `contents' member of Lisp_Vector objects with AREF and ASET
6102 2012-06-19 Chong Yidong <cyd@gnu.org>
6104 * frame.c (delete_frame): When selecting a frame on a different
6105 text terminal, do not alter the terminal's top-frame.
6107 * xdisp.c (format_mode_line_unwind_data): Record the target
6108 frame's selected window and its terminal's top-frame.
6109 (unwind_format_mode_line): Restore them.
6110 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6112 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6113 since tty frames can be explicitly named.
6114 (prepare_menu_bars): Likewise.
6116 * term.c (Ftty_top_frame): New function.
6118 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6120 Port byte-code-meter to modern targets.
6121 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6122 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6123 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6124 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6125 (METER_1, METER_2): Simplify.
6127 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6129 * data.c (Fdefalias): Return `symbol' (bug#11686).
6131 2012-06-18 Martin Rudalics <rudalics@gmx.at>
6133 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6134 gets killed during executing of this function (Bug#11665).
6135 Try to always return Qt when the buffer has been actually killed.
6136 (Vkill_buffer_query_functions): In doc-string say that functions
6137 run by this hook should not change the current buffer.
6139 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6141 Fix recently-introduced process.c problems found by static checking.
6142 * process.c (write_queue_push, write_queue_pop, send_process):
6143 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6144 (write_queue_pop): Fix pointer signedness problem.
6145 (send_process): Remove unused local.
6147 2012-06-17 Chong Yidong <cyd@gnu.org>
6149 * xdisp.c (redisplay_internal): No need to redisplay terminal
6150 frames that are not on top.
6152 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
6154 * process.c (make_process): Initialize write_queue.
6155 (write_queue_push, write_queue_pop): New functions.
6156 (send_process): Use them to maintain correct ordering of process
6159 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6161 * lisp.h (eassert): Assume C89 or later.
6162 This removes the need for CHECK.
6163 (CHECK): Remove. Its comments about always evaluating its
6164 argument were confusing, as 'eassert' typically does not evaluate
6167 * coding.c (produce_chars): Use ptrdiff_t, not int.
6169 * xterm.c (x_draw_underwave): Check for integer overflow.
6170 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6172 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
6174 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6175 referenced (Bug#11583).
6177 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6179 Implement wave-style variant of underlining.
6180 * dispextern.h (face_underline_type): New enum.
6181 (face): Add field for underline type.
6182 * nsterm.m (ns_draw_underwave): New function.
6183 (ns_draw_text_decoration): Use it.
6184 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6186 (x_draw_glyph_string): Use them.
6187 * xfaces.c (Qline, Qwave): New Lisp objects.
6188 (check_lface_attrs, merge_face_ref)
6189 (Finternal_set_lisp_face_attribute, realize_x_face):
6190 Handle wave-style underline face attributes.
6191 * xterm.c (x_draw_underwave): New function.
6192 (x_draw_glyph_string): Use it.
6194 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
6196 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6197 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6198 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6199 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6200 ($(BLD)/w32select.$(O)): Update dependencies.
6202 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6204 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6205 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6206 * character.c (_fetch_multibyte_char_p): Remove.
6207 * alloc.c: Include "character.h" before "buffer.h".
6209 * buffer.c: Likewise.
6210 * bytecode.c: Likewise.
6211 * callint.c: Likewise.
6212 * callproc.c: Likewise.
6213 * casefiddle.c: Likewise.
6214 * casetab.c: Likewise.
6215 * category.c: Likewise.
6217 * coding.c: Likewise.
6218 * composite.c: Likewise.
6219 * dired.c: Likewise.
6220 * dispnew.c: Likewise.
6222 * dosfns.c: Likewise.
6223 * editfns.c: Likewise.
6224 * emacs.c: Likewise.
6225 * fileio.c: Likewise.
6226 * filelock.c: Likewise.
6228 * fontset.c: Likewise.
6229 * fringe.c: Likewise.
6230 * indent.c: Likewise.
6231 * insdel.c: Likewise.
6232 * intervals.c: Likewise.
6233 * keyboard.c: Likewise.
6234 * keymap.c: Likewise.
6235 * lread.c: Likewise.
6236 * macros.c: Likewise.
6237 * marker.c: Likewise.
6238 * minibuf.c: Likewise.
6239 * nsfns.m: Likewise.
6240 * nsmenu.m: Likewise.
6241 * print.c: Likewise.
6242 * process.c: Likewise.
6243 * regex.c: Likewise.
6244 * region-cache.c: Likewise.
6245 * search.c: Likewise.
6246 * syntax.c: Likewise.
6248 * textprop.c: Likewise.
6250 * unexsol.c: Likewise.
6251 * w16select.c: Likewise.
6252 * w32fns.c: Likewise.
6253 * w32menu.c: Likewise.
6254 * window.c: Likewise.
6255 * xdisp.c: Likewise.
6257 * xmenu.c: Likewise.
6259 * xselect.c: Likewise.
6261 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6263 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6264 If all the glyphs of the glyph row came from strings, and we have no
6265 cursor positioning clues, put the cursor on the first glyph of the
6267 (handle_face_prop): Use chunk-relative overlay string index when
6268 indexing into it->string_overlays array. (Bug#11653)
6269 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6270 the rightmost. (Bug#11720)
6272 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6274 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6275 (CATEGORY_MEMBER): Enforce 1/0 value.
6276 * category.c (_temp_category_set): Remove.
6278 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6280 * window.c (Fdelete_other_windows_internal)
6281 (Fdelete_window_internal): Don't access frame's mouse highlight
6282 info of the initial frame. (Bug#11677)
6284 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6286 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6287 Assume USE_2_TAGS_FOR_INTS.
6288 (xreload): Adjust $tagmask width to match recent lisp.h change.
6290 Simplify lisp.h in minor ways that should not affect code.
6291 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6292 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6293 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6294 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6295 (INTTYPEBITS): New macro, for clarity.
6296 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6297 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6298 Simplify now that USE_LSB_TAG is always defined.
6299 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6300 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6302 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
6304 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6306 2012-06-13 Glenn Morris <rgm@gnu.org>
6308 * s/bsd-common.h (BSD4_3):
6309 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6311 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6313 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6316 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6318 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6319 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6320 * alloc.c (widen_to_Lisp_Object): Remove.
6321 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6322 * frame.c (delete_frame): Remove outdated comment.
6323 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6324 USE_LISP_UNION_TYPE.
6325 (Fw32_unregister_hot_key): Likewise.
6326 (Fw32_toggle_lock_key): Likewise.
6327 * w32menu.c (add_menu_item): Likewise.
6328 (w32_menu_display_help): Use XIL instead of checking
6329 USE_LISP_UNION_TYPE.
6330 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6331 (init_heap): Likewise.
6332 * w32term.c (w32_read_socket): Update comment.
6334 2012-06-13 Glenn Morris <rgm@gnu.org>
6336 * s/usg5-4-common.h, src/s/unixware.h:
6337 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6339 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6341 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6343 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6344 * alloc.c (make_number) [!defined make_number]:
6345 Remove, as lisp.h always defines this now.
6346 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6347 (roundup_size): Verify that it is a power of 2.
6348 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6349 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6350 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6351 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6352 USE_LSB_TAG now is always defined to be either 0 or 1.
6354 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6355 code works fine either way, and efficiency is not a concern here,
6356 as the union type is for debugging, not for production.
6357 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6358 Use an inline function on all platforms when using the union type,
6359 since this is simpler and 'static inline' can be used portably
6361 (LISP_INITIALLY_ZERO): New macro.
6362 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6363 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6365 2012-06-12 Glenn Morris <rgm@gnu.org>
6367 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6369 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6371 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6372 Move BROKEN_SIGIO to configure.
6374 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6375 Move NO_TERMIO to configure.
6377 2012-06-12 Chong Yidong <cyd@gnu.org>
6379 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6380 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6381 MagickExportImagePixels is undefined.
6383 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6385 * image.c (imagemagick_load_image): Remove unused label.
6387 2012-06-11 Glenn Morris <rgm@gnu.org>
6389 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6390 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6391 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6392 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6394 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6396 * alloc.c (make_byte_code): New function.
6397 (Fmake_byte_code): Use it. Don't purify here.
6398 * lread.c (read1): Use it as well to avoid extra allocation.
6400 2012-06-11 Chong Yidong <cyd@gnu.org>
6402 * image.c (imagemagick_load_image): Implement transparency.
6404 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6406 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6407 account for preceding backslashes. (Bug#11663)
6409 2012-06-09 Chong Yidong <cyd@gnu.org>
6411 * term.c: Support italics in capable terminals (Bug#9652).
6412 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6413 (turn_on_face): Output using TS_enter_italic_mode if available.
6414 Don't handle unused blinking and alt-charset cases.
6415 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6416 and tty_alt_charset_p cases.
6417 (tty_capable_p, init_tty): Support italics.
6419 * termchar.h (struct tty_display_info): Add field for italics.
6420 Remove unused blink field.
6422 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6425 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6426 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6427 tty_alt_charset_p. Add tty_italic_p.
6429 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
6431 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6432 dbus_type_is_basic if available.
6433 (xd_extract_signed, xd_extract_unsigned): Rename from
6434 extract_signed and extract_unsigned, respectively. Adapt callers.
6436 2012-06-09 Chong Yidong <cyd@gnu.org>
6438 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6440 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6443 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6445 * xdisp.c (vmessage): Treat frame message as multibyte.
6446 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6447 would generate the diagnostic "Making \302\247 buffer-local while
6450 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6452 * dispnew.c (showing_window_margins_p): Undo last change, which
6453 was done due to an inadvertent commit.
6454 (adjust_frame_glyphs_for_frame_redisplay): Do call
6455 showing_window_margins_p.
6457 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6459 * eval.c (Fmake_var_non_special): New primitive.
6460 (syms_of_eval): Defsubr it.
6461 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6463 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
6465 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6466 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6468 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6470 * alloc.c (allocate_vectorlike): Fix last change.
6472 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6474 Block-based vector allocation of small vectors.
6475 * lisp.h (struct vectorlike_header): New field `nbytes',
6476 adjust comment accordingly.
6477 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6478 to denote vector blocks. Adjust users (live_vector_p,
6479 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6480 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6481 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6482 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6483 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6484 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6485 (roundup_size): New constant.
6486 (struct vector_block): New data type.
6487 (vector_blocks, vector_free_lists, zero_vector): New variables.
6488 (all_vectors): Rename to `large_vectors'.
6489 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6490 (sweep_vectors): New functions.
6491 (allocate_vectorlike): Return `zero_vector' as the only vector of
6492 0 items. Allocate new vector from block if vector size is less than
6493 or equal to VBLOCK_BYTES_MAX.
6494 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6495 (init_alloc_once): Add call to init_vectors.
6497 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6499 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6501 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6503 * doprnt.c (doprnt): Truncate multibyte char correctly.
6504 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6505 would mishandle a string argument "Xc" if X was a multibyte
6506 character of length 2: it would truncate after X's first byte
6507 rather than including all of X.
6509 2012-06-06 Chong Yidong <cyd@gnu.org>
6511 * buffer.c (word_wrap): Doc fix.
6513 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6515 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6517 2012-06-03 Glenn Morris <rgm@gnu.org>
6519 * xdisp.c (tool-bar-style): Doc fix.
6521 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6523 * Makefile.in (PAXCTL): Define.
6524 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6525 binary via PaX flags if the paxctl utility is available.
6526 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6527 Restore PaX flags to their default. (Bug#11398)
6529 2012-06-03 Chong Yidong <cyd@gnu.org>
6531 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6534 2012-06-03 Chong Yidong <cyd@gnu.org>
6536 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6537 (note_mode_line_or_margin_highlight): If there is no help echo,
6538 use mode-line-default-help-echo. Handle the case where the mouse
6539 position is past the end of the mode line string.
6541 * buffer.c (buffer_local_value_1): New function, split from
6542 Fbuffer_local_value; can return Qunbound.
6543 (Fbuffer_local_value): Use it.
6544 (Vmode_line_format): Docstring tweaks.
6546 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6548 * sysdep.c (system_process_attributes): Improve comment.
6550 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6552 * keyboard.c: Export real-this-command to Elisp.
6553 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6554 and DEFVAR it. Update all users.
6556 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6558 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6560 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6561 Convert pctcpu and pctmem to Lisp float properly.
6562 Let the compiler fold better, as 100.0/0x8000 is exact.
6564 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6566 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6569 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6571 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6573 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6575 For a 'struct window', replace some Lisp_Object fields to
6576 bitfields where appropriate, remove unused fields.
6577 * window.h (struct window): Remove unused 'last_mark_x' and
6578 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6579 change it's type from Lisp_Object to bitfield.
6580 Change type of 'force_start', 'optional_new_start',
6581 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6582 fields from Lisp_Object to bitfield. Adjust users accordingly.
6584 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6586 Pacify gcc -Wdouble-precision when using Xaw.
6587 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6588 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6589 Use 'float' consistently, rather than 'float' in most places
6590 and 'double' in a couple of places.
6592 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6594 * xdisp.c (handle_stop): Detect whether we have overlay strings
6595 loaded by testing it->current.overlay_string_index to be
6596 non-negative, instead of checking whether n_overlay_strings is
6597 positive. (Bug#11587)
6599 2012-05-31 Chong Yidong <cyd@gnu.org>
6601 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6603 * doc.c (Fsubstitute_command_keys): Doc fix.
6605 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6607 * search.c (search_buffer): Remove calls to
6608 r_alloc_inhibit_buffer_relocation, as it is now called by
6609 maybe_unify_char, which was the cause of relocation of buffer text
6612 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6614 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6615 for the duration of call to load_charset, to avoid problems with
6616 callers of maybe_unify_char that access buffer text through C
6619 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6620 decrement the inhibition flag, instead of just setting or
6623 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6625 Remove obsolete '#define static' cruft.
6626 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6627 This #undef was "temporary" in 2000; it is no longer needed
6628 now that '#define static' has gone away.
6629 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6630 (gray_bitmap_bits): Remove; no longer needed.
6631 All uses replaced with definiens.
6632 * xterm.c: Include "bitmaps/gray.xbm".
6634 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6636 Clean up __executable_start, monstartup when --enable-profiling.
6637 The following changes affect the code only when profiling.
6638 * dispnew.c (__executable_start): Rename from safe_bcopy.
6639 Define only on platforms that need it.
6640 * emacs.c: Include <sys/gmon.h> when profiling.
6641 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6642 (__executable_start): Remove decl, since lisp.h does it now.
6643 (safe_bcopy): Remove decl; no longer has that name.
6644 (main): Coalesce #if into single bit of code, for simplicity.
6645 Cast pointers to uintptr_t, since standard libraries want integers
6647 * lisp.h (__executable_start): New decl.
6649 2012-05-31 Glenn Morris <rgm@gnu.org>
6651 * image.c (Fimagemagick_types): Doc fix.
6653 2012-05-30 Jim Meyering <meyering@redhat.com>
6655 * callproc.c (Fcall_process_region): Include directory component
6656 in mkstemp error message (Bug#11586).
6658 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6660 * alloc.c, lisp.h (make_pure_vector): Now static.
6662 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6664 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6665 Move to byte-run.el.
6666 (Fautoload): Do the hash-doc more carefully.
6667 * data.c (Fdefalias): Purify definition, except for keymaps.
6668 (Qdefun): Move from eval.c.
6669 * lisp.h (Qdefun): Remove.
6670 * lread.c (read1): Tiny simplification.
6672 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6674 Do not create empty overlays with the evaporate property (Bug#9642).
6675 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6676 Bug#9642, but explicitly check that the buffer the overlay would
6677 be moved to is live and rearrange lines to make sure that errors
6678 will not put the overlay in an inconsistent state.
6679 (Fdelete_overlay): Cosmetics.
6681 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6683 * w32term.c (my_bring_window_to_top): New function.
6684 (x_raise_frame): Use handle returned by DeferWindowPos, which
6685 could be different from the original one.
6686 Call my_bring_window_to_top instead of my_set_foreground_window.
6689 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6690 by calling BringWindowToTop.
6692 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6693 (WM_EMACS_END): Increase by one.
6695 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6697 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6698 This avoids undefined behavior that might cause the eassert
6699 to not catch an out-of-range value.
6701 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6703 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6704 Update dependencies.
6706 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6708 * bidi.c (bidi_mirror_char): Fix last change.
6710 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6712 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6713 when referring to sectname field in printf format.
6715 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6717 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6718 Only r_alloc_inhibit_buffer_relocation needed to be added;
6719 the others were already declared.
6721 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6722 before checking whether it's out of range. Put the check inside
6724 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6726 2012-05-27 Ken Brown <kbrown@cornell.edu>
6728 * callproc.c (Fcall_process): Restore a line that was accidentally
6729 commented out in the 2011-02-13 change (bug#11547).
6731 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6733 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6734 defined on ralloc.c.
6736 * buffer.c [REL_ALLOC]: Remove prototypes of
6737 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6738 they are now on lisp.h.
6740 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6742 * search.c (search_buffer): Use it to inhibit relocation of buffer
6743 text while re_search_2 is doing its job, because re_search_2 is
6744 passed C pointers to buffer text. (Bug#11519)
6746 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6749 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6750 state after an additional call to move_it_in_display_line_to, keep
6751 the values of it->max_ascent and it->max_descent found for the
6753 (pos_visible_p): Revert the comparison against bottom_y to what it
6754 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6757 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6759 Fix coding-related core dumps with gcc -ftrapv.
6760 The code was computing A - B, where A and B are pointers, and B is
6761 random garbage. This can lead to core dumps on platforms that
6762 have special pointer registers, and it also leads to core dumps on
6763 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6764 A - B only when B is initialized properly.
6765 * coding.c (coding_set_source, coding_set_destination): Return void.
6766 (coding_change_source, coding_change_destinations): New functions,
6767 with the old behaviors of coding_set_source and coding_set_destination.
6768 All callers that need an offset changed to use these new functions.
6770 2012-05-26 Glenn Morris <rgm@gnu.org>
6772 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6774 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6776 Extend mouse support on W32 text-mode console.
6777 * xdisp.c (draw_row_with_mouse_face):
6778 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6780 * w32console.c: Include window.h.
6781 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6783 (initialize_w32_display): Initialize mouse-highlight data.
6785 * w32inevt.c: Include termchar.h and window.h.
6786 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6787 moves, call note_mouse_highlight. If help_echo changed, call
6788 gen_help_event to produce help-echo message in the echo area.
6789 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6792 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6794 * lread.c (read1): Simplify slightly to avoid an overflow warning
6795 with GCC 4.7.0 on x86-64.
6797 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6799 * bidi.c (bidi_mirror_char): Revert last change: an int is
6800 definitely wide enough here.
6802 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6804 Fix integer width and related bugs (Bug#9874).
6805 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6806 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6807 (string_bytes, check_sblock, allocate_string_data):
6808 (compact_small_strings, Fmake_bool_vector, make_string)
6809 (make_unibyte_string, make_multibyte_string)
6810 (make_string_from_bytes, make_specified_string)
6811 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6812 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6815 (allocate_pseudovector):
6816 Use int, not EMACS_INT, where int is wide enough.
6817 (inhibit_garbage_collection, Fgarbage_collect):
6818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6819 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6820 int might not be wide enough.
6821 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6822 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6823 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6824 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6825 (bidi_level_of_next_char, bidi_move_to_visually_next):
6826 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6827 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6828 (Fkill_buffer, Fset_buffer_major_mode)
6829 (advance_to_char_boundary, Fbuffer_swap_text)
6830 (Fset_buffer_multibyte, overlays_at, overlays_in)
6831 (overlay_touches_p, struct sortvec, record_overlay_string)
6832 (overlay_strings, recenter_overlay_lists)
6833 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6834 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6835 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6836 (Foverlay_recenter, last_overlay_modification_hooks_used)
6837 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6838 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6839 (validate_region): Omit unnecessary test for b <= e,
6840 since that's guaranteed by the previous test.
6841 (adjust_overlays_for_delete): Avoid pos + length overflow.
6842 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6843 (report_overlay_modification):
6844 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6845 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6846 Omit pointer cast, which isn't needed anyway, and doesn't work
6847 after the EMACS_INT -> ptrdiff_t change.
6848 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6849 * buffer.h: Adjust decls to match defn changes elsewhere.
6850 (struct buffer_text, struct buffer):
6851 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6852 Use EMACS_INT, not int, where int might not be wide enough.
6853 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6854 not int, to avoid needless 32-bit limit on 64-bit hosts.
6855 (exec_byte_code): Use tighter memory-full test, one that checks
6856 for alloca overflow. Don't compute the address of the object just
6857 before an array, as that's not portable. Use EMACS_INT, not
6858 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6859 * callint.c (Fcall_interactively):
6860 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6861 * callproc.c (call_process_kill, Fcall_process):
6862 Don't assume pid_t fits into an Emacs fixnum.
6863 (call_process_cleanup, Fcall_process, child_setup):
6864 Don't assume pid_t fits into int.
6865 (call_process_cleanup, Fcall_process, delete_temp_file)
6866 (Fcall_process_region):
6867 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6868 (Fcall_process): Simplify handling of volatile integers.
6869 Use int, not EMACS_INT, where int will do.
6870 * casefiddle.c (casify_object, casify_region, operate_on_word)
6871 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6872 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6873 (casify_object): Avoid integer overflow when overallocating buffer.
6874 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6875 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6876 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6877 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6878 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6879 integers are now checked earlier. All uses replaced with XINT.
6881 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6882 For CCL_MapSingle, check that content and value are in int range.
6883 (ccl_driver, Fregister_code_conversion_map):
6884 Check that Vcode_version_map_vector is a vector.
6885 (resolve_symbol_ccl_program): Check that vector header is in range.
6886 Always copy the vector, so that we can check its contents reliably
6887 now rather than having to recheck each instruction as it's being
6888 executed. Check that vector words fit in 'int'.
6889 (ccl_get_compiled_code, Fregister_ccl_program)
6890 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6891 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6892 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6893 contents are in range.
6894 (Fccl_execute_on_string): Check that status is in range.
6895 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6896 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6897 Accept and return EMACS_INT, not int, because callers can pass values
6899 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6900 (multibyte_chars_in_text, parse_str_as_multibyte)
6901 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6902 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6903 (string_escape_byte8, Fget_byte):
6904 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6905 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6906 avoid mishandling large integers.
6907 * character.h: Adjust decls to match defn changes elsewhere.
6908 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6909 (Ffind_charset_region):
6910 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6911 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6912 (load_charset_map_from_vector, Fdefine_charset_internal):
6913 Don't assume fixnum fits in int.
6914 (load_charset_map_from_vector, Fmap_charset_chars):
6915 Remove now-unnecessary CHECK_NATNUMs.
6916 (Fdefine_charset_internal): Check ranges here, more carefully.
6917 Don't rely on undefined behavior with signed left shift overflow.
6918 Don't assume unsigned int fits into fixnum, or that fixnum fits
6919 into unsigned int. Don't require max_code to be a valid fixnum;
6920 that's not true for gb10830 4-byte on a 32-bit host. Allow
6921 invalid_code to be a cons, for the same reason. Require code_offset
6922 to be a character. Avoid int overflow if max_char is close
6924 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6925 this is intended anyway and avoids some undefined behavior.
6926 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6927 INDEX_TO_CODE_POINT, as that's what it expects.
6928 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6929 * charset.h (DECODE_CHAR): Return int, not unsigned;
6930 this is what was intended anyway, and it avoids undefined behavior.
6931 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6932 integer-overflow issues.
6933 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6934 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6935 where the argument is EMACS_INT, and this behavior is not intended.
6936 * chartab.c (Fmake_char_table, Fset_char_table_range)
6937 (uniprop_get_decoder, uniprop_get_encoder):
6938 Don't assume fixnum fits in int.
6939 * cmds.c (move_point): New function, that does the gist of
6940 Fforward_char and Fbackward_char, but does so while checking
6941 for integer overflow more accurately.
6942 (Fforward_char, Fbackward_char): Use it.
6943 (Fforward_line, Fend_of_line, internal_self_insert)
6944 (internal_self_insert):
6945 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6946 Fix a FIXME, by checking for integer overflow when calculating
6947 target_clm and actual_clm.
6948 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6949 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6950 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6951 (coding_alloc_by_making_gap, alloc_destination)
6952 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6953 (encode_coding_utf_16, detect_coding_emacs_mule)
6954 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6955 (detect_coding_iso_2022, decode_coding_iso_2022)
6956 (encode_invocation_designation, encode_designation_at_bol)
6957 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6958 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6959 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6960 (encode_coding_ccl, encode_coding_raw_text)
6961 (detect_coding_charset, decode_coding_charset)
6962 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6963 (produce_composition, produce_charset, produce_annotation)
6964 (decode_coding, handle_composition_annotation)
6965 (handle_charset_annotation, consume_chars, decode_coding_gap)
6966 (decode_coding_object, encode_coding_object, detect_coding_system)
6967 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6968 (code_convert_region, code_convert_string)
6969 (Fdefine_coding_system_internal)
6970 (coding_set_source, coding_set_destination):
6971 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6972 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6973 (Fdefine_coding_system_internal):
6974 Don't assume fixnums fit in int.
6975 (decode_coding_gap, decode_coding_object, encode_coding_object)
6976 (Fread_coding_system, Fdetect_coding_region)
6977 (Funencodable_char_position, Fcheck_coding_systems_region)
6978 (get_translation, handle_composition_annotation, consume_chars):
6979 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6980 (consume_chars): Rewrite to not calculate an address outside buffer.
6981 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6982 Don't access memory outside of the args array.
6983 (Fdefine_coding_system_internal): Check for charset-id overflow.
6984 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6985 result of ENCODE_CHAR.
6986 * coding.h: Adjust decls to match defn changes elsewhere.
6987 (struct coding_system):
6988 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6989 * composite.c (get_composition_id, find_composition)
6990 (run_composition_function, update_compositions)
6991 (compose_text, composition_gstring_put_cache)
6992 (composition_gstring_p, composition_gstring_width)
6993 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6994 (composition_compute_stop_pos, composition_reseat_it)
6995 (composition_update_it, struct position_record)
6996 (find_automatic_composition, composition_adjust_point)
6997 (Fcomposition_get_gstring, Ffind_composition_internal):
6998 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6999 (update_compositions):
7000 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7001 * composite.h: Adjust decls to match defn changes elsewhere.
7002 (struct composition):
7003 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7004 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7005 Do not attempt to compute the address of the object just before a
7006 buffer; this is not portable.
7008 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7009 (Faset): Use int, not EMACS_INT, where int is wide enough.
7010 (Fstring_to_number): Don't assume fixnums fit in int.
7011 (Frem): Don't assume arg is nonnegative.
7012 * dbusbind.c (xd_append_arg): Check for integers out of range.
7013 (Fdbus_call_method): Don't overflow the timeout int.
7014 (extract_signed, extract_unsigned): New functions.
7015 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7016 (xd_get_connection_references): Return ptrdiff_t, not int.
7018 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7019 (xd_read_message_1):
7020 Use int, not unsigned, where the dbus API uses int.
7021 (Fdbus_message_internal): Don't overflow mtype.
7022 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7023 * dired.c (directory_files_internal, file_name_completion, scmp)
7024 (file_name_completion_stat):
7025 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7026 (file_name_completion): Don't overflow matchcount.
7027 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7028 * dispextern.h: Adjust decls to match defn changes elsewhere.
7029 (struct text_pos, struct glyph, struct bidi_saved_info)
7030 (struct bidi_string_data, struct bidi_it, struct composition_it)
7032 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7033 (struct display_pos, struct composition_it, struct it):
7034 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7035 * dispnew.c (increment_matrix_positions)
7036 (increment_row_positions, mode_line_string)
7037 (marginal_area_string):
7038 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7039 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7040 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7041 (duration_to_sec_usec): New function, to check for overflow better.
7042 (Fsleep_for, sit_for): Use it.
7043 * doc.c (get_doc_string, store_function_docstring):
7044 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7045 (get_doc_string, Fsnarf_documentation):
7046 Use int, not EMACS_INT, where int is wide enough.
7048 Use SAFE_ALLOCA, not alloca.
7049 Check for overflow when converting EMACS_INT to off_t.
7050 * doprnt.c (doprnt):
7051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7052 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7053 Don't assume uid_t fits into fixnum.
7054 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7055 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7056 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7057 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7058 (general_insert_function)
7059 (Finsert_char, make_buffer_string, make_buffer_string_both)
7060 (update_buffer_properties, Fbuffer_substring)
7061 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7062 (Fsubst_char_in_region, check_translation)
7063 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7064 (transpose_markers, Ftranspose_regions):
7065 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7066 (clip_to_bounds): Move to lisp.h as an inline function).
7067 (Fconstrain_to_field): Don't assume integers are nonnegative.
7068 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7069 (Fsubst_char_in_region, Fsave_restriction):
7070 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7071 (Femacs_pid): Don't assume pid_t fits into fixnum.
7072 (lo_time): Use int, not EMACS_INT, when int suffices.
7073 (lisp_time_argument): Check for usec out of range.
7074 (Fencode_time): Don't assume fixnum fits in int.
7075 (Fuser_login_name, Fuser_full_name): Signal an error
7076 if a uid argument is out of range, rather than relying on
7078 (Fformat_time_string): Remove now-unnecessary check.
7079 lisp_time_argument checks for out-of-range usec now.
7080 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7081 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7082 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7083 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7084 (init_cmdargs, Fdump_emacs):
7085 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7086 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7087 the bottom (typically) 32 bits of the fixnum.
7088 * eval.c (specpdl_size, call_debugger):
7089 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7090 (when_entered_debugger, Fbacktrace_debug):
7091 Don't assume fixnum can fit in int.
7092 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7093 the object just before a buffer; this is not portable.
7094 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7095 (grow_specpdl, unbind_to):
7096 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7097 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7098 (grow_specpdl): Simplify allocation by using xpalloc.
7099 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7100 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7101 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7102 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7103 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7105 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7106 (Fcopy_file, non_regular_nbytes, read_non_regular)
7107 (Finsert_file_contents):
7108 Use int, not EMACS_INT, where int is wide enough.
7109 (READ_BUF_SIZE): Verify that it fits in int.
7110 (Finsert_file_contents): Check that counts are in proper range,
7111 rather than assuming fixnums fit into ptrdiff_t etc.
7112 Don't assume fixnums fit into int.
7113 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7114 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7115 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7116 (string_char_to_byte, string_byte_to_char)
7117 (string_make_multibyte, string_to_multibyte)
7118 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7119 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7120 (substring_both, Fdelete, internal_equal, Ffillarray)
7121 (Fclear_string, mapcar1)
7122 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7123 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7124 (larger_vector, make_hash_table, maybe_resize_hash_table)
7125 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7126 (Fmaphash, secure_hash):
7127 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7128 (concat): Check for string index and length overflow.
7129 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7131 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7132 (larger_vector): New API (vec, incr_min, size_max) replaces old
7133 one (vec, new_size, init). This catches size overflow.
7134 INIT was removed because it was always Qnil.
7135 All callers changed.
7136 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7137 the upper bound on a hash table index size.
7138 (make_hash_table, maybe_resize_hash_table): Use it.
7139 (secure_hash): Computer start_byte and end_byte only after
7140 they're known to be in ptrdiff_t range.
7141 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7142 (Ffont_get_glyphs, Ffont_at):
7143 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7144 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7145 (Flist_fonts, Fopen_font):
7146 Don't assume fixnum can fit in int.
7147 (check_gstring): Don't assume index can fit in int.
7148 (font_match_p): Check that fixnum is a character, not a nonnegative
7149 fixnum, since the later code needs to stuff it into an int.
7150 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7151 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7152 conversion overflow issues.
7153 (Fopen_font): Check for integer out of range.
7154 (Ffont_get_glyphs): Don't assume index can fit in int.
7155 * font.h: Adjust decls to match defn changes elsewhere.
7156 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7158 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7159 printmax_t, where ptrdiff_t is wide enough.
7160 (Finternal_char_font):
7161 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7162 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7163 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7164 (Fset_frame_position, x_set_frame_parameters)
7165 (x_set_line_spacing, x_set_border_width)
7166 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7167 Check that fixnums are in proper range for system types.
7168 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7169 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7170 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7171 Use SAFE_ALLOCA_LISP, not alloca.
7172 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7173 intptr_t is wide enough.
7174 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7175 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7176 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7177 Check for fixnum out of range.
7178 * ftfont.c (ftfont_list): Don't assume index fits in int.
7179 Check that fixnums are in proper range for system types.
7180 (ftfont_shape_by_flt):
7181 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7182 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7183 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7184 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7185 Check that fixnums are in proper range for system types.
7186 * gnutls.h: Adjust decls to match defn changes elsewhere.
7187 * gtkutil.c (xg_dialog_run):
7188 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7189 (update_frame_tool_bar):
7190 Check that fixnums are in proper range for system types.
7191 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7192 (lookup_image): Check that fixnums are in range for system types.
7193 * indent.c (last_known_column, last_known_column_point):
7194 (current_column_bol_cache):
7195 (skip_invisible, current_column, check_display_width):
7196 (check_display_width, scan_for_column, current_column_1)
7197 (Findent_to, Fcurrent_indentation, position_indentation)
7198 (indented_beyond_p, Fmove_to_column, compute_motion):
7199 (Fcompute_motion, Fvertical_motion):
7200 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7201 (last_known_column_modified): Use EMACS_INT, not int.
7202 (check_display_width):
7204 Check that fixnums and floats are in proper range for system types.
7205 (compute_motion): Don't assume index or fixnum fits in int.
7206 (compute_motion, Fcompute_motion):
7207 Use int, not EMACS_INT, when it is wide enough.
7208 (vmotion): Omit local var start_hpos that is always 0; that way
7209 we don't need to worry about overflow in expressions involving it.
7210 * indent.h: Adjust decls to match defn changes elsewhere.
7212 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7213 Use int, not EMACS_INT, where int is wide enough.
7214 Remove unused members ovstring_chars_done and tab_offset;
7216 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7217 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7218 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7219 (make_gap, copy_text, insert, insert_and_inherit)
7220 (insert_before_markers, insert_before_markers_and_inherit)
7221 (insert_1, count_combining_before, count_combining_after)
7222 (insert_1_both, insert_from_string)
7223 (insert_from_string_before_markers, insert_from_string_1)
7224 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7225 (adjust_after_replace, adjust_after_insert, replace_range)
7226 (replace_range_2, del_range, del_range_1, del_range_byte)
7227 (del_range_both, del_range_2, modify_region)
7228 (prepare_to_modify_buffer, signal_before_change)
7229 (signal_after_change, Fcombine_after_change_execute):
7230 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7231 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7232 (balance_an_interval, split_interval_right, split_interval_left)
7233 (find_interval, next_interval, update_interval)
7234 (adjust_intervals_for_insertion, delete_node, delete_interval)
7235 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7236 (static_offset_intervals, offset_intervals)
7237 (merge_interval_right, merge_interval_left, make_new_interval)
7238 (graft_intervals_into_buffer, temp_set_point_both)
7239 (temp_set_point, set_point, adjust_for_invis_intang)
7240 (set_point_both, move_if_not_intangible, get_property_and_range)
7241 (get_local_map, copy_intervals, copy_intervals_to_string)
7242 (compare_string_intervals, set_intervals_multibyte_1):
7243 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7244 * intervals.h: Adjust decls to match defn changes elsewhere.
7246 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7247 * keyboard.c (this_command_key_count, this_single_command_key_start)
7248 (before_command_key_count, before_command_echo_length, echo_now)
7249 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7250 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7251 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7252 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7254 (last_non_minibuf_size, last_point_position, echo_truncate)
7255 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7256 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7257 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7258 (stuff_buffered_input):
7259 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7260 (last_auto_save, command_loop_1, read_char):
7261 Use EMACS_INT, not int, to avoid integer overflow.
7262 (record_char): Avoid overflow in total_keys computation.
7263 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7264 * keyboard.h: Adjust decls to match defn changes elsewhere.
7265 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7266 (Fkey_description, Fdescribe_vector, Flookup_key):
7267 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7268 (click_position): New function, to check that positions are in range.
7269 (Fcurrent_active_maps):
7271 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7272 (Faccessible_keymaps, Fkey_description):
7273 (preferred_sequence_p):
7274 Don't assume fixnum can fit into int.
7275 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7276 Check for integer overflow in size calculations.
7277 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7278 avoid mishandling large integers.
7279 * lisp.h: Adjust decls to match defn changes elsewhere.
7280 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7281 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7282 (struct Lisp_Marker):
7283 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7284 (clip_to_bounds): Now an inline function, moved here from editfns.c.
7285 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7286 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7287 All callers changed.
7288 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7289 Assume the arg has valid form, since it always does.
7290 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7291 unsigned integer system type.
7292 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7293 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7294 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7295 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7296 (duration_to_sec_usec): New decl.
7297 * lread.c (read_from_string_index, read_from_string_index_byte)
7298 (read_from_string_limit, readchar, unreadchar, openp)
7299 (read_internal_start, read1, oblookup):
7300 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7301 (Fload, readevalloop, Feval_buffer, Feval_region):
7302 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7303 (openp): Check for out-of-range argument to 'access'.
7304 (read1): Use int, not EMACS_INT, where int is wide enough.
7305 Don't assume fixnum fits into int.
7306 Fix off-by-one error that can read outside a buffer.
7307 (read_filtered_event): Use duration_to_sec_usec
7308 to do proper overflow checking on durations.
7309 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7310 in size calculation.
7311 (Fexecute_kbd_macro):
7312 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7313 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7314 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7315 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7316 (set_marker_both, set_marker_restricted_both, marker_position)
7317 (marker_byte_position, Fbuffer_has_markers_at):
7318 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7319 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7320 * menu.c (ensure_menu_items): Rename from grow_menu_items.
7321 It now merely ensures that the menu is large enough, without
7322 necessarily growing it, as this avoids some integer overflow issues.
7323 All callers changed.
7324 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7325 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7326 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7327 Use SAFE_ALLOCA_LISP, not alloca.
7328 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7329 to EMACS_INT. Check that fixnums are in proper range for system types.
7330 * minibuf.c (minibuf_prompt_width, string_to_object)
7331 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7332 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7333 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7334 (get_minibuffer, read_minibuf_unwind):
7335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7336 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7337 this simplifies overflow checking. All callers changed.
7338 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7340 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7341 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7342 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7343 Check that fixnums are in proper range for system types.
7344 (Fx_create_frame, Fx_show_tip):
7345 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7346 * nsfont.m (ns_findfonts, nsfont_list_family):
7347 Don't assume fixnum fits in long.
7348 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7349 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7350 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7352 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7353 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7354 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7355 (PRINTDECLARE, PRINTPREPARE):
7356 (strout, print_string):
7357 (print, print_preprocess, print_check_string_charset_prop)
7359 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7361 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7362 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7363 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7364 (printchar, strout): Use xpalloc to catch size calculation overflow.
7365 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7366 (print_error_message): Use SAFE_ALLOCA, not alloca.
7367 (print_object): Use int, not EMACS_INT, where int is wide enough.
7368 (print_depth, new_backquote_output, print_number_index):
7369 Use ptrdiff_t, not int, where int might not be wide enough.
7370 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7371 (Fset_process_window_size, Fformat_network_address)
7372 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7374 Check that fixnums are in proper range for system types.
7375 (Fsignal_process): Simplify by avoiding a goto.
7376 Check for process-ids out of pid_t range rather than relying on
7378 (process_tick, update_tick): Use EMACS_INT, not int.
7379 (Fformat_network_address, read_process_output, send_process)
7380 (Fprocess_send_region, status_notify):
7381 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7382 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7383 (wait_reading_process_output, read_process_output, exec_sentinel):
7384 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7385 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7386 (Faccept_process_output): Use duration_to_sec_usec to do proper
7387 overflow checking on durations.
7388 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7389 Don't assume pid_t fits in int.
7390 * process.h (struct Lisp_Process): Members tick and update_tick
7391 are now of type EMACS_INT, not int.
7392 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7393 configured --with-wide-int.
7394 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7395 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7396 * search.c (looking_at_1, string_match_1):
7397 (fast_string_match, fast_c_string_match_ignore_case)
7398 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7399 (scan_newline, find_before_next_newline, search_command)
7400 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7401 (set_search_regs, wordify):
7404 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7405 (string_match_1, search_buffer, set_search_regs):
7407 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7408 (wordify): Check for overflow in size calculation.
7409 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7410 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7411 Check that fixnums are in proper range for system types.
7412 * sound.c (struct sound_device)
7413 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7414 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7415 (Fplay_sound_internal):
7416 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7417 * syntax.c (struct lisp_parse_state, find_start_modiff)
7418 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7419 (Fparse_partial_sexp):
7420 Don't assume fixnums can fit in int.
7421 (struct lisp_parse_state, find_start_pos, find_start_value)
7422 (find_start_value_byte, find_start_begv)
7423 (update_syntax_table, char_quoted, dec_bytepos)
7424 (find_defun_start, prev_char_comend_first, back_comment):
7425 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7426 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7427 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7428 (Finternal_describe_syntax_value): Check that match_lisp is a
7429 character, not an integer, since the code stuffs it into int.
7430 (scan_words, scan_sexps_forward):
7431 Check that fixnums are in proper range for system types.
7433 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7434 (scan_sexps_forward):
7435 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7436 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7437 * syntax.h: Adjust decls to match defn changes elsewhere.
7438 (struct gl_state_s):
7439 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7440 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7441 MOST_POSITIVE_FIXNUM.
7442 * sysdep.c (wait_for_termination_1, wait_for_termination)
7443 (interruptible_wait_for_termination, mkdir):
7444 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7445 (emacs_read, emacs_write):
7446 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7447 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7448 and double all fit in int.
7449 * term.c (set_tty_color_mode):
7450 Check that fixnums are in proper range for system types.
7451 * termhooks.h (struct input_event):
7452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7453 * textprop.c (validate_interval_range, interval_of)
7454 (Fadd_text_properties, set_text_properties_1)
7455 (Fremove_text_properties, Fremove_list_of_text_properties)
7456 (Ftext_property_any, Ftext_property_not_all)
7457 (copy_text_properties, text_property_list, extend_property_ranges)
7458 (verify_interval_modification):
7459 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7460 (Fnext_single_char_property_change)
7461 (Fprevious_single_char_property_change):
7462 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7463 (copy_text_properties):
7464 Check for integer overflow in index calculation.
7465 * undo.c (last_boundary_position, record_point, record_insert)
7466 (record_delete, record_marker_adjustment, record_change)
7467 (record_property_change):
7468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7469 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7470 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7471 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7472 (Fx_hide_tip, Fx_file_dialog):
7473 * w32menu.c (set_frame_menubar):
7474 Use ptrdiff_t, not int, for consistency with rest of code.
7475 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7476 (select_window, Fdelete_other_windows_internal)
7477 (window_scroll_pixel_based, window_scroll_line_based)
7478 (Frecenter, Fset_window_configuration):
7479 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7480 (Fset_window_hscroll, run_window_configuration_change_hook)
7481 (set_window_buffer, temp_output_buffer_show, scroll_command)
7482 (Fscroll_other_window, Frecenter):
7483 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7484 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7485 Don't assume fixnum fits in int.
7486 (Fset_window_scroll_bars):
7487 Check that fixnums are in proper range for system types.
7488 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7489 (string_pos, c_string_pos, number_of_chars, init_iterator)
7490 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7491 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7492 (compute_display_string_end, handle_face_prop)
7493 (face_before_or_after_it_pos, handle_invisible_prop)
7494 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7495 (display_prop_intangible_p, string_buffer_position_lim)
7496 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7497 (get_overlay_strings_1, get_overlay_strings)
7498 (iterate_out_of_display_property, forward_to_next_line_start)
7499 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7500 (get_next_display_element, set_iterator_to_next)
7501 (get_visually_first_element, compute_stop_pos_backwards)
7502 (handle_stop_backwards, next_element_from_buffer)
7503 (move_it_in_display_line_to, move_it_in_display_line)
7504 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7505 (add_to_log, message_dolog, message_log_check_duplicate)
7506 (message2, message2_nolog, message3, message3_nolog
7507 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7508 (current_message_1, truncate_echo_area, truncate_message_1)
7509 (set_message, set_message_1, store_mode_line_noprop)
7510 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7511 (text_outside_line_unchanged_p, check_point_in_composition)
7512 (reconsider_clip_changes)
7513 (redisplay_internal, set_cursor_from_row, try_scrolling)
7514 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7515 (redisplay_window, find_last_unchanged_at_beg_row)
7516 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7517 (trailing_whitespace_p, find_row_edges, display_line)
7518 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7519 (display_mode_element, store_mode_line_string)
7520 (pint2str, pint2hrstr, decode_mode_spec)
7521 (display_count_lines, display_string, draw_glyphs)
7522 (x_produce_glyphs, x_insert_glyphs)
7523 (rows_from_pos_range, mouse_face_from_buffer_pos)
7524 (fast_find_string_pos, mouse_face_from_string_pos)
7525 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7526 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7527 (safe_call, init_from_display_pos, handle_fontified_prop)
7528 (handle_single_display_spec, load_overlay_strings)
7529 (with_echo_area_buffer, setup_echo_area_for_printing)
7530 (display_echo_area, echo_area_display)
7531 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7532 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7533 (redisplay_window, dump_glyph_row, display_mode_line)
7534 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7535 (handle_display_spec, display_prop_string_p):
7536 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7537 (handle_single_display_spec, build_desired_tool_bar_string)
7538 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7539 (get_specified_cursor_type):
7540 Check that fixnums are in proper range for system types.
7541 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7542 (Flookup_image_map):
7543 Don't assume fixnums fit in int.
7544 (compare_overlay_entries):
7545 Avoid mishandling comparisons due to subtraction overflow.
7546 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7547 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7548 (handle_tool_bar_click):
7549 Use int, not unsigned, since we prefer signed and the signedness
7550 doesn't matter here.
7551 (get_next_display_element, next_element_from_display_vector):
7552 Use int, not EMACS_INT, when int is wide enough.
7553 (start_hourglass): Use duration_to_sec_usec to do proper
7554 overflow checking on durations.
7555 * xfaces.c (Fbitmap_spec_p):
7556 Check that fixnums are in proper range for system types.
7557 (compare_fonts_by_sort_order):
7558 Avoid mishandling comparisons due to subtraction overflow.
7559 (Fx_family_fonts, realize_basic_faces):
7560 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7562 Don't assume fixnum fits in int.
7563 Use SAFE_ALLOCA_LISP, not alloca.
7564 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7565 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7566 (face_at_buffer_position, face_for_overlay_string)
7567 (face_at_string_position):
7568 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7569 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7570 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7572 Check that fixnums are in proper range for system types.
7573 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7574 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7575 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7576 (Fx_change_window_property): Don't assume fixnums fit in int.
7577 * xfont.c (xfont_chars_supported):
7578 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7579 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7580 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7581 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7582 * xml.c (parse_region):
7583 * xrdb.c (magic_file_p):
7584 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7585 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7586 (x_get_local_selection, x_reply_selection_request)
7587 (x_handle_selection_request, wait_for_property_change):
7588 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7589 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7590 short is wide enough.
7591 (x_send_client_event): Don't assume fixnum fits in int.
7592 * xterm.c (x_x_to_emacs_modifiers):
7593 Don't assume EMACS_INT overflows nicely into int.
7594 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7596 (handle_one_xevent): NATNUMP can eval its arg twice.
7597 (x_connection_closed):
7598 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7599 * xterm.h: Adjust decls to match defn changes elsewhere.
7600 (struct scroll_bar): Use struct vectorlike_header
7601 rather than rolling our own approximation.
7602 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7604 2012-05-25 Glenn Morris <rgm@gnu.org>
7606 * lisp.mk (lisp): Update for more files being compiled now.
7608 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7610 * lread.c: Remove `read_pure' which makes no difference.
7611 (read_pure): Remove var.
7612 (unreadpure): Remove function.
7613 (readevalloop): Don't call read_list with -1 flag.
7614 (read1, read_vector): Don't test read_pure any more.
7615 (read_list): Simplify.
7617 * fileio.c, character.h: Minor style tweaks.
7619 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7621 * window.h (clip_changed): Remove useless declaration.
7623 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7625 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7626 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7628 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7631 This directory predates autoconf and is no longer needed nowadays.
7632 Move its few remaining bits of functionality to where they're needed.
7633 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7634 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7635 * m/template.h: Remove.
7636 * Makefile.in (M_FILE): Remove. All uses removed.
7637 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7638 * lisp.h (USE_LSB_TAG):
7639 * mem-limits.h (EXCEEDS_LISP_PTR):
7640 Use VAL_MAX, not VALBITS, in #if.
7641 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7642 (EMACS_UINT): Define unconditionally now.
7643 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7644 (BITS_PER_EMACS_INT): New constants, replacing
7645 what used to be in config.h, but not useful in #if.
7646 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7647 define them any more.
7648 (VAL_MAX): New macro.
7650 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7651 BITS_PER_EMACS_INT, in #if.
7652 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7653 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7654 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7655 * s/ms-w32.h (DATA_START):
7656 Move here from removed file m/intel386.h.
7657 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7658 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7660 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7662 Assume C89 or later.
7663 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7664 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7666 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7667 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7668 * textprop.c, tparam.c (NULL): Remove.
7669 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7670 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7671 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7672 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7673 * xterm.c (input_signal_count): Assume volatile works.
7675 2012-05-21 Ken Brown <kbrown@cornell.edu>
7677 * xgselect.c (xg_select): Fix first argument in call to 'select'
7680 2012-05-20 Ken Brown <kbrown@cornell.edu>
7682 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7683 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7685 2012-05-19 Ken Brown <kbrown@cornell.edu>
7687 * xfns.c (x_in_use): Remove `static' qualifier.
7688 * xterm.h (x_in_use): Declare.
7689 * xgselect.c: Include xterm.h.
7690 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7691 and `display_arg' (bug#9754).
7693 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7695 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7697 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7698 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7700 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7702 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7704 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7705 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7707 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7708 reference to image_cache->refcount.
7709 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7711 2012-05-17 Juri Linkov <juri@jurta.org>
7713 * search.c (Fword_search_regexp, Fword_search_backward)
7714 (Fword_search_forward, Fword_search_backward_lax)
7715 (Fword_search_forward_lax): Move functions to isearch.el
7716 (bug#10145, bug#11381).
7718 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7720 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7722 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7724 * lread.c (init_obarray): Declare Qt and Qnil as special.
7726 2012-05-14 Glenn Morris <rgm@gnu.org>
7728 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7729 Put "libexec" before "bin", for the sake of init_callproc_1.
7731 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7733 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7735 * unexaix.c: Port to more-recent AIX compilers.
7736 (report_error, report_error_1, make_hdr, copy_sym)
7737 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7738 Make arguments const char *, not char *, to avoid violations of C
7739 standard and to fix some AIX warnings reported by Gilles Pion.
7741 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7743 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7744 already have overlays loaded.
7745 (handle_single_display_spec): Before returning without displaying
7746 fringe bitmap, synchronize the bidi iterator with the main display
7747 iterator, by calling iterate_out_of_display_property.
7748 (iterate_out_of_display_property): Detect buffer iteration by
7749 testing that it->string is a Lisp string.
7750 (get_next_display_element): When the current object is exhausted,
7751 and there's something on it->stack, call set_iterator_to_next to
7752 proceed with what's on the stack, instead of returning zero.
7753 (set_iterator_to_next): If called at the end of a Lisp string,
7754 proceed to consider_string_end without incrementing string
7755 position. Don't increment display vector index past the end of
7756 the display vector. (Bug#11417)
7757 (pos_visible_p): Don't report a position visible when move_it_to
7758 stopped at the last line of window, which happens to be scanned
7759 backwards by the bidi iteration. (Bug#11464)
7761 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7763 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7764 and right-margin display specs even if the spec is invalid or we
7765 are on a TTY, and thus unable to display on the fringes.
7766 That's because the text with the property will not be displayed anyway,
7767 so we need to signal to the caller that this is a "replacing"
7768 display spec. This fixes display when the spec is invalid or we
7771 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7773 * unexaix.c (make_hdr): Fix typo in prototype.
7774 This bug broke the build on AIX. Problem reported by Gilles Pion.
7776 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7778 * keyboard.c (kbd_buffer_get_event): Read special events also in
7779 batch mode. (Bug#11415)
7781 2012-05-12 Glenn Morris <rgm@gnu.org>
7783 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7785 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7787 * lisp.mk (lisp): Add newcomment.elc.
7789 2012-05-12 Glenn Morris <rgm@gnu.org>
7791 * Makefile.in (MKDIR_P): New, set by configure.
7792 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7794 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7796 Remove unused function hourglass_started.
7797 * dispextern.h (hourglass_started):
7798 * w32fns.c (hourglass_started):
7799 * xdisp.c (hourglass_started): Remove.
7801 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7803 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7804 Update dependencies.
7806 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7808 * xgselect.c (xg_select): Put maxfds+1 into a var.
7809 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7811 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7813 2012-05-10 Dave Abrahams <dave@boostpro.com>
7815 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7816 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7818 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7820 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7821 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7822 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7823 Initialize xd_registered_buses.
7825 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7827 Untag more efficiently if USE_LSB_TAG.
7828 This is based on a proposal by YAMAMOTO Mitsuharu in
7829 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7830 For an admittedly artificial (nth 8000 longlist) benchmark on
7831 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7832 Emacs's overall text size by 1%.
7833 * lisp.h (XUNTAG): New macro.
7834 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7835 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7836 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7837 * eval.c (Fautoload):
7838 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7839 * frame.h (XFRAME): Use XUNTAG.
7841 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7842 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7843 Remove unportable assumptions about print widths of types like
7845 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7846 intptr_t when converting between pointer and integer, to avoid GCC
7847 warnings about wrong width.
7849 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7851 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7852 stack for each reader_thread, instead of defaulting to 8MB
7853 determined by the linker. This avoids failures in creating
7854 subprocesses on Windows 7, see the discussion in this thread:
7855 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7857 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7859 Fix up display of the *Minibuf-0* buffer in the mini window.
7860 * keyboard.c (read_char): Don't clear the echo area if there's no
7862 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7863 contents of *Minibuf-0*) if there's no message displayed in its stead.
7865 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7867 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7870 2012-05-06 Chong Yidong <cyd@gnu.org>
7872 * lisp.mk (lisp): Update.
7874 2012-05-05 Jim Meyering <meyering@redhat.com>
7876 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7878 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7880 * data.c (PUT_ERROR): New macro.
7881 (syms_of_data): Use it. Add new error type `user-error'.
7882 * undo.c (user_error): New function.
7883 (Fprimitive_undo): Use it.
7884 * print.c (print_error_message): Adjust print style for `user-error'.
7885 * keyboard.c (user_error): New function.
7886 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7888 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7890 Do not limit current-time-string to years 1000..9999.
7891 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7892 (Fcurrent_time_string): Support any year that is supported by the
7893 underlying localtime representation. Don't use asctime, as it
7894 has undefined behavior for years outside the range -999..9999.
7896 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7898 Fix race conditions involving setenv, gmtime, localtime, asctime.
7899 Without this fix, interrupts could mess up code that uses these
7900 nonreentrant functions, since setting TZ invalidates existing
7901 tm_zone or tzname values, and since most of these functions return
7902 pointers to static storage.
7903 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7904 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7905 Grow the critical sections to include not just invoking
7906 localtime/gmtime, but also accessing these functions' results
7907 including their tm_zone values if any, and any related TZ setting.
7908 (format_time_string): Last arg is now struct tm *, not struct tm **,
7909 so that the struct tm is saved in the critical section.
7910 All callers changed. Simplify allocation of initial buffer, partly
7911 motivated by the fact that memory allocation needs to be outside
7912 the critical section.
7914 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7916 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7917 with RESET_INTERVAL.
7919 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7920 Remove duplicated buffer name initialization.
7922 2012-05-02 Jim Meyering <jim@meyering.net>
7924 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7926 * xfns.c (x_window): Use xstrdup (Bug#11375).
7928 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7930 * xdisp.c (pos_visible_p): If already at a newline from the
7931 display string before the 'while' loop, don't walk back the glyphs
7932 from it3.glyph_row. Solves assertion violation when the display
7933 string begins with a newline (egg.el). (Bug#11367)
7935 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7937 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7940 2012-05-01 Glenn Morris <rgm@gnu.org>
7942 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7943 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7944 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7945 All were removed before 23.1.
7947 * dispnew.c: Remove HAVE_LIBNCURSES test;
7948 it is always true on relevant platforms.
7950 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7951 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7953 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7955 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7957 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7958 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7961 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7963 Do not avoid creating empty evaporating overlays (Bug#9642).
7964 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7965 That is, do not delete an evaporating overlay if it becomes
7966 empty after its bounds are adjusted to fit within its buffer.
7967 This fix caused other problems, and I'm reverting it until we get
7968 to the bottom of them.
7970 2012-04-27 Chong Yidong <cyd@gnu.org>
7972 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7974 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7976 * xdisp.c (pos_visible_p): If the window start position is beyond
7977 ZV, start the display from buffer beginning. Prevents assertion
7978 violation in init_iterator when the minibuffer window is scrolled
7981 * window.c (window_scroll_pixel_based): Likewise.
7983 2012-04-27 Chong Yidong <cyd@gnu.org>
7985 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7987 2012-04-27 Glenn Morris <rgm@gnu.org>
7989 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7990 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7992 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7994 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7995 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7997 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7999 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8000 display element, check also the underlying string or buffer
8001 character. (Bug#11341)
8003 * w32menu.c: Include w32heap.h.
8004 (add_menu_item): If the call to AppendMenuW (via
8005 unicode_append_menu) fails, disable Unicode menus only if we are
8006 running on Windows 9X/Me.
8008 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8010 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8011 (xgetint): Add missing shift for LSB tags.
8013 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8015 * keyboard.c (read_char): Don't wipe echo area for select window
8016 events: These might get delayed via `mouse-autoselect-window'
8019 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8021 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8022 manipulation of :loaded-from data.
8024 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8026 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8027 now a cons (bug#11311).
8029 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8031 Do not create empty overlays with the evaporate property (Bug#9642).
8032 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8033 if it becomes empty after its bounds are adjusted to fit within
8034 its buffer. Without this fix, in a nonempty buffer (let ((o
8035 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8036 yields an empty overlay that has the evaporate property, which is
8037 not supposed to happen.
8039 Fix minor GTK3 problems found by static checking.
8040 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8041 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8042 (struct _EmacsFixedClass, emacs_fixed_get_type):
8043 Move decls here from emacsgtkfixed.h, since they needn't be public.
8044 (emacs_fixed_get_type): Now static.
8045 (emacs_fixed_class_init): Omit unused local.
8046 (emacs_fixed_child_type): Remove; unused.
8047 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8048 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8049 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8050 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8051 (EMACS_FIXED_GET_CLASS): Remove; unused.
8052 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8054 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8055 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8057 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8059 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8060 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8061 (__malloc_size_t, __malloc_ptrdiff_t):
8062 Remove. All uses removed, replaced by the definiens if needed,
8063 since we can assume C89 or better now.
8064 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8065 (protect_malloc_state, align, get_contiguous_space)
8066 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8067 (malloc_atfork_handler_child, malloc_enable_thread)
8068 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8069 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8070 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8071 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8072 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8073 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8074 Define using prototypes, not old style.
8075 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8076 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8077 (align): Don't assume that signed integer overflow wraps around.
8078 Omit unused local var.
8079 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8080 (_free_internal_nolock, memalign, mallochook, reallochook):
8081 Omit no-longer-needed casts.
8082 (valloc): Use getpagesize, not __getpagesize.
8083 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8084 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8086 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8088 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
8090 Move functions from C to Lisp. Make non-blocking method calls
8091 the default. Implement further D-Bus standard interfaces.
8093 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8094 (QCdbus_request_name_allow_replacement)
8095 (QCdbus_request_name_replace_existing)
8096 (QCdbus_request_name_do_not_queue)
8097 (QCdbus_request_name_reply_primary_owner)
8098 (QCdbus_request_name_reply_in_queue)
8099 (QCdbus_request_name_reply_exists)
8100 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8101 (QCdbus_registered_serial, QCdbus_registered_method)
8102 (QCdbus_registered_signal): New Lisp objects.
8103 (XD_DEBUG_MESSAGE): Use sizeof.
8104 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8105 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8106 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8107 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8108 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8109 (xd_signature, xd_append_arg): Allow float for integer types.
8110 (xd_get_connection_references): New function.
8111 (xd_get_connection_address): Rename from xd_initialize.
8112 Return cached address.
8113 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8114 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8116 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8117 Return number of refcounts.
8118 (Fdbus_get_unique_name): Make stronger parameter check.
8119 (Fdbus_message_internal): New defun.
8120 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8121 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8122 (Fdbus_send_signal, Fdbus_register_service)
8123 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8124 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8125 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8126 (Vdbus_compiled_version, Vdbus_runtime_version)
8127 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8128 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8129 (Vdbus_message_type_signal): New defvars.
8130 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8133 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8135 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8136 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8137 Do not assume ptrdiff_t is the same width as 'int'.
8139 * alloc.c: Handle unusual debugging option combinations.
8140 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8141 since the two debugging options are incompatible.
8142 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8144 (mem_init, mem_insert, mem_insert_fixup):
8145 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8146 (NEED_MEM_INSERT): Remove; no longer needed.
8148 2012-04-22 Leo Liu <sdl.web@gmail.com>
8150 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8152 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8154 * sysdep.c [__FreeBSD__]: Minor cleanups.
8155 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8156 Use Emacs indenting style more consistently. Avoid some casts.
8157 Use 'double' consistently rather than mixing 'float' and 'double'.
8159 2012-04-21 Eduard Wiebe <usenet@pusto.de>
8161 * sysdep.c (list_system_processes, system_process_attributes):
8162 Add implementation for FreeBSD (Bug#5243).
8164 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8166 * lisp.mk (lisp): Update.
8168 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8170 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8171 It is never used otherwise.
8173 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8175 * print.c (print_preprocess): Only check print_depth if print-circle
8177 (print_object): Check for cycles even when print-circle is nil and
8178 print-gensym is t, but only check print_depth if print-circle is nil.
8180 2012-04-20 Chong Yidong <cyd@gnu.org>
8182 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8183 set the status to "failed" and ensure that sentinel is run.
8185 2012-04-20 Glenn Morris <rgm@gnu.org>
8187 * process.c (Fset_process_inherit_coding_system_flag)
8188 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8189 (Fmake_network_process, Fmake_serial_process): Doc fix.
8191 2012-04-20 Eli Zaretskii <eliz@gnu.org>
8193 * xdisp.c (string_buffer_position_lim): Limit starting position to
8195 (set_cursor_from_row): If called for a mode-line or header-line
8196 row, return zero immediately.
8197 (try_cursor_movement): If inside continuation line, don't back up
8198 farther than the first row after the header line, if any.
8199 Don't consider the header-line row as "partially visible", even if
8200 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8202 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8204 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8207 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
8208 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
8210 configure: new option --enable-gcc-warnings (Bug#11207)
8211 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8212 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8213 (ALL_CFLAGS): Use new macros rather than old.
8214 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8215 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8216 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8217 -Wunused-result, -Wunused-variable. This should go away once
8218 the Emacs and Gnulib regex code is merged.
8219 (xmalloc, xrealloc): Now static.
8221 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8223 * dired.c (Fsystem_groups): Remove unused local.
8225 2012-04-17 Glenn Morris <rgm@gnu.org>
8227 * dired.c (Fsystem_users): Doc fix.
8229 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8231 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8232 (syms_of_dired): Add them.
8234 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8236 Fix minor alloc.c problems found by static checking.
8237 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8238 New extern decls, to avoid calling undeclared functions.
8239 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8240 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8241 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8242 (NEED_MEM_INSERT): New macro.
8243 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8244 Remove one incorrect comment and fix another.
8246 Fix minor ralloc.c problems found by static checking.
8247 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8248 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8249 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8250 (r_alloc_sbrk): Now static.
8252 Improve ralloc.c interface checking.
8253 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8254 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8255 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8256 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8257 [REL_ALLOC]: ... to here, to check interface.
8258 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8259 Remove decls. This fixes an "It stinks!".
8261 * alloc.c (which_symbols): Fix alignment issue / type clash.
8263 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8265 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8266 (struct Lisp_Misc_Any): Likewise.
8267 (struct Lisp_Free): Likewise.
8268 * alloc.c (union aligned_Lisp_Symbol): Define.
8269 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8270 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8271 (union aligned_Lisp_Misc): Define.
8272 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8273 aligned_Lisp_Misc instead of union Lisp_Misc.
8274 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8276 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8278 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8279 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8280 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8281 * s/netbsd.h, s/sol2-6.h:
8282 Remove definition of GC_MARK_STACK, since the default now works.
8283 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8284 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8285 no longer the default.
8286 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8288 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8290 * lread.c (lisp_file_lexically_bound_p):
8291 Fix hang at ";-*-\n" (bug#11238).
8293 2012-04-14 Eli Zaretskii <eliz@gnu.org>
8295 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8296 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8298 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8300 * nsterm.m (constrainFrameRect): Always constrain when there is only
8301 one screen (Bug#10962).
8303 2012-04-13 Ken Brown <kbrown@cornell.edu>
8305 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8307 2012-04-13 Reuben Thomas <rrt@sc3d.org>
8309 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8311 2012-04-11 Daniel Colascione <dancol@dancol.org>
8313 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8314 against is gone. It's better to use vfork now so that when Cygwin
8315 gains a new, working vfork, we use it automatically (bug#10398).
8317 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8319 * window.c (save_window_save): Obey window-point-insertion-type.
8321 2012-04-11 Glenn Morris <rgm@gnu.org>
8323 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8325 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8327 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8329 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
8331 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8332 (force_quit_count): New var.
8333 (handle_interrupt): Use it.
8335 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
8337 * w32.c (w32_delayed_load): Record the full path of the library
8338 being loaded (bug#10424).
8340 2012-04-09 Glenn Morris <rgm@gnu.org>
8342 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8343 not just in the obarray, before snarfing them. (Bug#11036)
8345 * Makefile.in ($(leimdir)/leim-list.el):
8346 Pass EMACS rather than BUILT_EMACS.
8348 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8350 * process.c (make_process):
8351 * process.h: Add integer `gnutls_handshakes_tried' member to
8354 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8355 Add convenience `GNUTLS_LOG2i' macro.
8357 * gnutls.c (gnutls_log_function2i): Convenience log function.
8358 (emacs_gnutls_read): Use new log functions,
8359 `gnutls_handshakes_tried' process member, and
8360 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8361 attempts per process (connection).
8363 2012-04-09 Chong Yidong <cyd@gnu.org>
8365 * eval.c (Fuser_variable_p, user_variable_p_eh)
8366 (lisp_indirect_variable): Functions deleted.
8367 (Fdefvar): Caller changed.
8369 * callint.c (Finteractive, Fcall_interactively):
8370 * minibuf.c (Fread_variable): Callers changed.
8372 2012-04-09 Eli Zaretskii <eliz@gnu.org>
8374 * xdisp.c (set_cursor_from_row): If the display string appears in
8375 the buffer at position that is closer to point than the position
8376 after the display string, display the cursor on the first glyph of
8377 the display string. Fixes cursor display when a 'display' text
8378 property immediately follows invisible text. (Bug#11094)
8380 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8382 composite.c: use 'double' consistently
8383 * composite.c (get_composition_id): Use 'double' consistently
8384 instead of converting 'float' to 'double' and vice versa; this is
8385 easier to understand and avoids a GCC warning.
8387 2012-04-09 Glenn Morris <rgm@gnu.org>
8389 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8390 preparation for dumping it with emacs. (Bug#4789)
8391 (leimdir): New variable.
8392 ($(leimdir)/leim-list.el): New rule.
8393 (emacs$(EXEEXT)): Depend on leim-list.el.
8395 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8396 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8397 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8399 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8401 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8404 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
8406 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8407 Remove unused local variable.
8409 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8411 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8412 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8413 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8414 objects, as mark_maybe_pointer will catch them otherwise.
8415 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8416 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8418 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8420 Fix typo that broke non-Windows builds.
8421 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8423 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8425 Support building on MS-Windows with libxml2.
8427 * makefile.w32-in (OBJ2): Add xml.$(O).
8428 (GLOBAL_SOURCES): Add xml.c.
8429 ($(BLD)/xml.$(O)): New dependency list.
8431 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8432 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8433 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8434 [!WINDOWSNT]: New macros.
8435 (init_libxml2_functions, libxml2_loaded_p): New functions.
8436 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8437 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8438 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8439 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8441 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8442 Call init_libxml2_functions before calling libxml2 functions.
8443 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8445 * emacs.c: Don't include libxml/parser.h.
8446 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8447 xmlCleanupParser directly.
8449 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8451 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8453 * indent.c (Fvertical_motion): If there is a display string at
8454 point, use it.vpos to compute how many lines to backtrack after
8455 move_it_to point. (Bug#11133)
8457 2012-04-06 Eli Zaretskii <eliz@gnu.org>
8459 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8460 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8461 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8462 macros related to unification of CJK characters. For the details,
8463 see the discussion following the message here:
8464 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8466 2012-04-04 Chong Yidong <cyd@gnu.org>
8468 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8470 2012-04-01 Eli Zaretskii <eliz@gnu.org>
8472 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8473 instead of alloca. (Bug#11138)
8475 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8477 * w32menu.c (is_simple_dialog): Properly check lisp types.
8480 2012-03-31 Eli Zaretskii <eliz@gnu.org>
8482 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8483 position we get to after a call to move_it_to fails the
8484 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8485 only if we wind up in a string from display property. (Bug#11063)
8487 * window.c (Fdelete_other_windows_internal): Invalidate the row
8488 and column information about mouse highlight, so that redisplay
8489 restores it after reallocating the glyph matrices. (Bug#7464)
8491 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8492 string comes from a `display' text property, use the buffer
8493 position of that property as if we actually saw that position in
8495 (move_it_by_lines): Remove the assertion that
8496 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8497 violated when there's a before-string at the beginning of a line.
8500 2012-03-30 Eli Zaretskii <eliz@gnu.org>
8502 * xdisp.c (append_space_for_newline): If the default face was
8503 remapped, use the remapped face for the appended newline.
8504 (extend_face_to_end_of_line): Use the remapped default face for
8505 extending the face to the end of the line.
8506 (display_line): Call extend_face_to_end_of_line when the default
8507 face was remapped. (Bug#11068)
8509 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8511 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8513 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8515 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8517 2012-03-27 Glenn Morris <rgm@gnu.org>
8519 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8522 2012-03-26 Kenichi Handa <handa@m17n.org>
8524 * dispextern.h (struct glyph): Fix previous change. Change the
8525 bit length of glyphless.ch to 25 (Bug#11082).
8527 2012-03-26 Chong Yidong <cyd@gnu.org>
8529 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8530 (command_loop_1): Use it; inhibit selection update for
8531 handle-select-window too (Bug#8996).
8533 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8535 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8537 2012-03-25 Kenichi Handa <handa@m17n.org>
8539 * dispextern.h (struct glyph): Change the bit length of
8540 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8542 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8544 * s/ms-w32.h (tzname): Include time.h before redirecting to
8545 _tzname. Fixes the MSVC build. (Bug#9960)
8547 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8549 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8552 * xterm.c (XTread_socket): Only modify handling_signal if
8553 !SYNC_INPUT. (Bug#11080)
8555 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8557 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8558 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8559 when fetching a multibyte character consumes more bytes than
8560 CHAR_BYTES returns, due to unification of CJK characters in
8561 string_char. (Bug#11073)
8563 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8565 * process.c (wait_reading_process_output): Handle pty disconnect
8566 by refraining from sending oneself a SIGCHLD (bug#10933).
8568 2012-03-22 Chong Yidong <cyd@gnu.org>
8570 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8572 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8573 Mark string as coming from a prefix property.
8574 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8575 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8577 2012-03-21 Chong Yidong <cyd@gnu.org>
8579 * xfaces.c (Vface_remapping_alist): Doc fix.
8581 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8583 * w32proc.c (Fw32_set_console_codepage)
8584 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8587 2012-03-20 Chong Yidong <cyd@gnu.org>
8589 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8590 to reflect default non-nil value of redisplay-dont-pause.
8592 2012-03-19 Kenichi Handa <handa@m17n.org>
8594 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8595 it fit in a valid range (Bug#11003).
8597 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8599 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8600 that is not from display property, accept the row as a "cursor
8601 row" if one of the string's character has a non-nil `cursor'
8602 property. Fixes cursor positioning when there are newlines in
8603 overlay strings, e.g. in icomplete.el. (Bug#11035)
8605 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8607 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8609 2012-03-12 Chong Yidong <cyd@gnu.org>
8611 * eval.c (inhibit_lisp_code): Rename from
8612 inhibit_window_configuration_change_hook; move from window.c.
8614 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8615 * window.c (run_window_configuration_change_hook)
8616 (syms_of_window): Callers changed.
8618 2012-03-11 Chong Yidong <cyd@gnu.org>
8620 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8622 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8624 2012-03-10 Chong Yidong <cyd@gnu.org>
8626 * frame.c (other_visible_frames): Don't assume the selected frame
8627 is visible (Bug#10955).
8629 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8631 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8633 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8635 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8636 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8639 2012-03-03 Glenn Morris <rgm@gnu.org>
8641 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8643 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8645 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8646 position past the first glyph_row that ends at ZV. (Bug#10902)
8647 (redisplay_window, next_element_from_string): Fix typos in
8649 (redisplay_window): Pass to move_it_vertically the margin in
8650 pixels, not in screen lines.
8652 2012-03-02 Glenn Morris <rgm@gnu.org>
8654 * buffer.c (buffer-list-update-hook): Doc fix.
8656 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8658 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8659 push_it before setting up the iterator for the first overlay
8660 string, even if we have an empty string loaded.
8661 (next_overlay_string): If there's an empty string on the iterator
8662 stack, pop the stack. (Bug#10903)
8664 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8666 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8667 Suggested by Stefan Monnier in
8668 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8669 * alloc.c (widen_to_Lisp_Object): New static function.
8670 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8671 and widening them to Lisp_Objects. This would work even if
8672 USE_LSB_TAG is defined and wide integers are used, which might
8673 happen in a future version of Emacs.
8675 2012-02-25 Chong Yidong <cyd@gnu.org>
8677 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8680 * xselect.c (Fx_selection_exists_p): Doc fix.
8681 (x_clipboard_manager_save_all): Print an informative message
8682 before saving to clipboard manager.
8684 2012-02-24 Chong Yidong <cyd@gnu.org>
8686 * keyboard.c (process_special_events): Handle all X selection
8687 requests in kbd_buffer, not just the next one (Bug#8869).
8689 2012-02-23 Chong Yidong <cyd@gnu.org>
8691 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8692 call when setting menu-bar-lines and tool-bar-lines parameters.
8693 (unwind_create_frame_1): New helper function.
8695 * window.c (inhibit_window_configuration_change_hook): New var.
8696 (run_window_configuration_change_hook): Obey it.
8697 (syms_of_window): Initialize it.
8699 2012-02-22 Chong Yidong <cyd@gnu.org>
8701 * xterm.c (x_draw_image_relief): Add missing type check for
8702 Vtool_bar_button_margin (Bug#10743).
8704 2012-02-21 Chong Yidong <cyd@gnu.org>
8706 * fileio.c (Vfile_name_handler_alist): Doc fix.
8708 * buffer.c (Fget_file_buffer): Protect against invalid file
8709 handler return value.
8711 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8713 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8714 when computing $valmask.
8716 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8717 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8718 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8719 It's useless in that case, and it can cause problems on hosts
8720 that allocate halves of EMACS_INT values separately.
8721 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8722 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8723 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8724 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8725 it avoids undefined behavior on hosts where shifting right by more
8726 than the word width has undefined behavior.
8728 2012-02-19 Chong Yidong <cyd@gnu.org>
8730 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8731 (Funhandled_file_name_directory, Ffile_name_as_directory)
8732 (Fdirectory_file_name, Fexpand_file_name)
8733 (Fsubstitute_in_file_name): Protect against invalid file handler
8734 return values (Bug#10845).
8736 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8738 * .gdbinit (pitx): Fix incorrect references to fields of the
8741 2012-02-17 Chong Yidong <cyd@gnu.org>
8743 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8745 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8747 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8748 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8750 2012-02-15 Chong Yidong <cyd@gnu.org>
8752 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8753 marked as special. Also, starting docstrings with * is obsolete.
8755 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8757 * gnutls.c (emacs_gnutls_write): Fix last change.
8759 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8761 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8764 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8766 * keymap.c (Fsingle_key_description): Handle char ranges.
8768 2012-02-12 Chong Yidong <cyd@gnu.org>
8770 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8771 as that creates a dangerous corner case.
8773 * window.c (Fdelete_window_internal): Invalidate the mouse
8774 highlight (Bug#9904).
8776 2012-02-12 Glenn Morris <rgm@gnu.org>
8778 * xselect.c (Fx_own_selection_internal)
8779 (Fx_get_selection_internal, Fx_disown_selection_internal)
8780 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8781 * nsselect.m (Fx_own_selection_internal)
8782 (Fx_disown_selection_internal, Fx_selection_exists_p)
8783 (Fx_selection_owner_p, Fx_get_selection_internal):
8784 Sync docs and argument specs with the xselect.c versions.
8786 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8788 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8790 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8792 * w32select.c (Fx_selection_exists_p): Sync doc string and
8793 argument list with xselect.c. (Bug#10783)
8795 * w16select.c (Fx_selection_exists_p): Sync doc string and
8796 argument list with xselect.c. (Bug#10783)
8798 2012-02-10 Glenn Morris <rgm@gnu.org>
8800 * fns.c (Fsecure_hash): Doc fix.
8802 2012-02-09 Kenichi Handa <handa@m17n.org>
8804 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8806 2012-02-07 Chong Yidong <cyd@gnu.org>
8808 * buffer.c (Fbuffer_local_variables)
8809 (buffer_lisp_local_variables): Handle unbound vars correctly;
8810 don't let Qunbound leak into Lisp.
8812 2012-02-07 Glenn Morris <rgm@gnu.org>
8814 * image.c (Fimagemagick_types): Doc fix.
8816 * image.c (imagemagick-render-type): Change it from a lisp object
8817 to an integer. Move the doc here from the lisp manual.
8818 Treat all values not equal to 0 the same.
8820 2012-02-06 Chong Yidong <cyd@gnu.org>
8822 * doc.c (store_function_docstring): Avoid applying docstring of
8823 alias to base function (Bug#2603).
8825 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8827 * .gdbinit (pp1, pv1): Remove redundant defines.
8830 2012-02-04 Chong Yidong <cyd@gnu.org>
8832 * nsterm.m: Declare a global (Bug#10694).
8834 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8836 * w32.c (get_emacs_configuration_options):
8837 Include --enable-checking, if specified, in the return value.
8839 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8841 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8842 after rounding frame sizes. (Bug#9723)
8844 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8846 * keyboard.c (adjust_point_for_property): Don't position point
8847 before BEGV. (Bug#10696)
8849 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8851 Handle overflow when computing char display width (Bug#9496).
8852 * character.c (char_width): Return EMACS_INT, not int.
8853 (char_width, c_string_width): Check for overflow when
8854 computing the width; this is possible now that individual
8855 characters can have unbounded width. Problem introduced
8856 by merge from Emacs 23 on 2012-01-19.
8858 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8860 * dbusbind.c (Fdbus_register_method): Mention the return value
8861 :ignore in the docstring.
8863 2012-02-02 Glenn Morris <rgm@gnu.org>
8865 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8867 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8868 Unconditionally set to t. (Bug#10673)
8869 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8870 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8871 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8873 2012-02-02 Kenichi Handa <handa@m17n.org>
8875 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8876 0, do not call append_composite_glyph.
8878 2012-02-02 Kenichi Handa <handa@m17n.org>
8880 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8882 (x_produce_glyphs): If the component of a composition is a null
8883 string, set it->pixel_width to 1 to avoid zero-width glyph.
8885 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8887 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8888 first 2 arguments are identical. This makes inserting large
8889 output from a subprocess an order of magnitude faster on
8890 MS-Windows, where all sbrk'ed memory is always contiguous.
8892 2012-01-31 Glenn Morris <rgm@gnu.org>
8894 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8895 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8896 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8898 2012-01-29 Glenn Morris <rgm@gnu.org>
8900 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8902 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8904 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8906 2012-01-28 Chong Yidong <cyd@gnu.org>
8908 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8910 2012-01-26 Chong Yidong <cyd@gnu.org>
8912 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8914 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8915 repeat counts (Bug#10507).
8917 2012-01-26 Glenn Morris <rgm@gnu.org>
8919 * lread.c (syms_of_lread): Doc fix.
8921 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8923 * coding.c (encode_designation_at_bol): Change return value to
8926 2012-01-25 Chong Yidong <cyd@gnu.org>
8928 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8930 2012-01-21 Chong Yidong <cyd@gnu.org>
8932 * floatfns.c (Fcopysign): Make the second argument non-optional,
8933 since nil is not allowed anyway.
8935 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8937 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8938 (send_process): Likewise.
8940 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8942 * window.c (save_window_save, Fcurrent_window_configuration)
8943 (Vwindow_persistent_parameters): Do not use Qstate.
8944 Rewrite doc-strings.
8946 2012-01-19 Kenichi Handa <handa@m17n.org>
8948 * character.c (char_width): New function.
8949 (Fchar_width, c_string_width, lisp_string_width):
8950 Use char_width (Bug#9496).
8952 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8954 * window.c (Vwindow_persistent_parameters): New variable.
8955 (Fset_window_configuration, save_window_save): Handle persistent
8958 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8960 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8961 thrashing the stack of the thread. (Bug#9087)
8963 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8965 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8967 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8969 * xdisp.c (rows_from_pos_range): Handle the case where the
8970 highlight ends on a newline. (Bug#10464)
8971 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8972 he end column for display of highlight that ends on a newline
8975 2012-01-11 Glenn Morris <rgm@gnu.org>
8977 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8978 from load-path also when installation-directory is nil. (Bug#10208)
8980 2012-01-10 Glenn Morris <rgm@gnu.org>
8982 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8984 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8985 Update template values to be closer to their typical values these days.
8987 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8989 * xdisp.c (rows_from_pos_range): Accept additional argument
8990 DISP_STRING, and accept any glyph in a row whose object is that
8991 string as eligible for mouse highlight. Fixes mouse highlight of
8992 display strings from overlays. (Bug#10464)
8994 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8996 emacs: fix an auto-save permissions race condition (Bug#10400)
8997 * fileio.c (auto_saving_dir_umask): New static var.
8998 (Fmake_directory_internal): Use it.
8999 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9000 creating the directory. The old code temporarily assigns
9001 too-generous permissions to the directory.
9002 (do_auto_save_eh): Clear it.
9003 (Fdo_auto_save): Catch all errors, not just file errors, so
9004 that the var is always cleared.
9006 2012-01-07 Eli Zaretskii <eliz@gnu.org>
9008 * search.c (scan_buffer): Pass character positions to
9009 know_region_cache, not byte positions. (Bug#6540)
9011 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
9013 * w32.c (sys_rename): Report EXDEV when rename of a directory
9014 fails because the target is on another logical disk. (Bug#10284)
9016 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9018 * xterm.c (x_embed_request_focus): New function.
9020 * xterm.h: Add prototype.
9022 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9024 2012-01-05 Glenn Morris <rgm@gnu.org>
9026 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9028 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9030 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9031 Load gnutls_transport_set_lowat only if GnuTLS version is below
9033 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9034 GnuTLS versions below 2.11.1.
9036 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9038 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9039 to the doc string advising against its use for altering the way
9040 windows are scrolled.
9042 2011-12-28 Kenichi Handa <handa@m17n.org>
9044 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9045 coding-system ASCII compatible only when it does not produce BOM
9046 on encoding (Bug#10383).
9048 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9050 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9052 (create_and_show_popup_menu): Always use menu_position_func for
9055 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9057 * callint.c (Fcall_interactively): Don't truncate prompt string.
9059 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9061 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9062 property that ends at ZV, so that the bidi iteration could be
9063 resumed from there (after widening). (Bug#10360)
9065 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9067 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9069 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9071 * nsterm.m (x_free_frame_resources):
9072 Release f->output_data.ns->miniimage.
9073 (ns_index_color): Fix indentation. Do not retain
9074 color_table->colors[i].
9076 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9079 * nsfns.m (x_set_background_color): Assign return value from
9080 ns_index_color to face-background instead of NSColor*.
9081 (ns_implicitly_set_icon_type): Fix indentation.
9082 Change assignment in for loop to comparison.
9084 * emacs.c (ns_pool): New variable.
9085 (main): Assign ns_pool.
9086 (Fkill_emacs): Call ns_release_autorelease_pool.
9088 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9089 autorelease fdesc, release fdAttrs and tdict.
9090 (ns_get_covering_families): Release charset.
9091 (ns_findfonts): Release NSFontDescriptor created with new.
9092 (ns_uni_to_glyphs): Fix indentation.
9093 (setString): Release attrStr before assigning new value.
9095 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9097 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9099 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9100 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9102 2011-12-18 David Reitter <reitter@cmu.edu>
9104 * nsterm.m (ns_term_init): Subscribe for notifications
9105 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9106 to method trackingNotification in EmacsMenu.
9108 * nsmenu.m (trackingMenu): New variable.
9109 (trackingNotification): New method (from Aquamacs).
9110 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9111 from Aquamacs (Bug#7030).
9113 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9115 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9116 (symbol_to_nsstring): Fix indentation.
9117 (ns_symbol_to_pb): New function.
9118 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9119 (Fns_rotate_cut_buffers_internal): Remove.
9120 (Fns_store_selection_internal): Rename from
9121 Fns_store_cut_buffer_internal.
9122 (ns_get_foreign_selection, Fx_own_selection_internal)
9123 (Fx_disown_selection_internal, Fx_selection_exists_p)
9124 (Fns_get_selection_internal, Fns_store_selection_internal):
9125 Use ns_symbol_to_pb and check if return value is nil.
9126 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9127 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9128 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9129 renamed to Sns_store_selection_internal.
9130 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9131 and remove this function.
9132 (ns_handle_selection_clear): Remove, never used.
9133 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9136 2011-12-17 Ken Brown <kbrown@cornell.edu>
9138 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9139 GID is unknown (Bug#10257).
9141 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9143 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9144 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9145 which caused a build failure on GNU/Linux IA-64. This problem was
9146 introduced by my 2011-10-07 patch.
9148 2011-12-15 Juri Linkov <juri@jurta.org>
9150 * image.c (imagemagick_error): New function. (Bug#10112)
9151 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9152 Use `imagemagick_error' where ImageMagick functions return
9154 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9157 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9159 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9160 fill background (Bug#8992).
9162 2011-12-13 Martin Rudalics <rudalics@gmx.at>
9164 * window.c (Vwindow_combination_resize)
9165 (Vwindow_combination_limit): Use t instead of non-nil in
9167 (Vrecenter_redisplay): Add first sentence of doc-string on
9169 (Frecenter): Fix doc-string typo.
9171 2011-12-11 Kenichi Handa <handa@m17n.org>
9173 * coding.c (Funencodable_char_position): Pay attention to the
9174 buffer text relocation (Bug#9389).
9176 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9178 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9179 gtk_init (Bug#10100).
9181 2011-12-10 Eli Zaretskii <eliz@gnu.org>
9183 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9184 IT->string is nil. (Bug#10263)
9186 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9188 * nsterm.h (x_free_frame_resources): Declare.
9190 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9191 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9193 * nsterm.h (ns_get_defaults_value): Declare.
9195 * nsterm.m (ns_default): Call ns_get_defaults_value.
9197 2011-12-09 Eli Zaretskii <eliz@gnu.org>
9199 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9202 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9204 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9205 that where the value of an _OBJC_* symbol points to is in the .bss
9206 section (Bug#10240).
9208 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9210 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9211 after the loop to call ccl_driver at least once (Bug#8619).
9213 2011-12-08 Kenichi Handa <handa@m17n.org>
9215 * ftfont.c (get_adstyle_property): Fix previous change
9218 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
9220 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9221 dirs from the default value of EMACSLOADPATH (bug#10208).
9223 2011-12-07 Glenn Morris <rgm@gnu.org>
9225 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9226 installation and source directories as well. (Bug#10208)
9228 2011-12-06 Chong Yidong <cyd@gnu.org>
9230 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9232 2011-12-06 Glenn Morris <rgm@gnu.org>
9234 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9235 as an error, not just -1. (Bug#10217)
9237 2011-12-05 Chong Yidong <cyd@gnu.org>
9239 * keyboard.c (process_special_events): New function.
9240 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9242 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9244 * coding.c (encode_designation_at_bol): Don't use uninitialized
9245 local variable (Bug#9318).
9247 2011-12-05 Kenichi Handa <handa@m17n.org>
9249 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9250 return Qnil (Bug#8046, Bug#10193).
9252 2011-12-05 Kenichi Handa <handa@m17n.org>
9254 * coding.c (encode_designation_at_bol): New args charbuf_end and
9255 dst. Return the number of produced bytes. Callers changed.
9256 (coding_set_source): Return how many bytes coding->source was
9258 (coding_set_destination): Return how many bytes
9259 coding->destination was relocated.
9260 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9261 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9263 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9265 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9266 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9269 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9271 The following changes are to fix Bug#9318.
9273 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9274 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9275 (encode_coding_iso_2022, encode_coding_sjis)
9276 (encode_coding_big5, encode_coding_charset): Use the above macros.
9278 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
9280 * lisp.h (process_quit_flag): Fix external declaration.
9282 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9284 Don't macro-inline non-performance-critical code.
9285 * eval.c (process_quit_flag): New function.
9286 * lisp.h (QUIT): Use it.
9288 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9290 * nsfns.m (get_geometry_from_preferences): New function.
9291 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9293 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9295 * emacs.c (Qkill_emacs): Define.
9296 (syms_of_emacs): Initialize it.
9297 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9298 Qquit_flag to `kill-emacs' instead.
9299 (quit_throw_to_read_char): Add parameter `from_signal'.
9300 All callers changed. Call Fkill_emacs if requested and safe.
9301 * lisp.h (QUIT): Call Fkill_emacs if requested.
9303 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9305 * widget.c (update_wm_hints): Return if wmshell is null.
9306 (widget_update_wm_size_hints): New function.
9308 * widget.h (widget_update_wm_size_hints): Declare.
9310 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9311 widget_update_wm_size_hints (Bug#10104).
9313 2011-12-03 Eli Zaretskii <eliz@gnu.org>
9315 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9316 before a newline, prepare the bidi iterator for consuming the
9317 newline, and keep the current paragraph direction. (Bug#10183)
9318 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9320 2011-12-02 Juri Linkov <juri@jurta.org>
9322 * search.c (Fword_search_regexp): New Lisp function created from
9323 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9324 (Fword_search_backward, Fword_search_forward)
9325 (Fword_search_backward_lax, Fword_search_forward_lax):
9326 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9327 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9329 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9331 * fileio.c (Finsert_file_contents): Move after-change-function call
9332 to before the "handled:" label, since all "goto handled" appear in
9333 cases where the *-change-functions have already been properly called
9336 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9338 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9339 waiting for input. (Bug#10169)
9341 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9343 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9344 verifies glyph row's hash code--we have just reallocated the
9345 glyphs, so their contents can be complete garbage. (Bug#10164)
9347 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
9349 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9351 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9353 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9354 attributes are tested _before_ calling verify_row_hash, to protect
9355 against GCC re-ordering of the tests. (Bug#10164)
9357 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9359 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9361 * xterm.c (handle_one_xevent): Only set async_visible and friends
9362 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9363 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9364 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9366 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9368 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9369 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9370 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9371 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9372 All uses changed to use GCPRO1 etc.
9373 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9374 Revert to old implementation (i.e., before 2011-03-11).
9376 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9378 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9379 of scroll runs so as to avoid assigning disabled bogus rows and
9380 unnecessary graphics copy operations.
9382 2011-11-27 Eli Zaretskii <eliz@gnu.org>
9384 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9385 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9386 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9387 (malloc, free, realloc, calloc): Redirect to e_* only when
9390 * lisp.h (GCTYPEBITS): Move before first use.
9391 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9392 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9393 this macro definition.
9395 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9398 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9400 * gtkutil.c (xg_create_frame_widgets):
9401 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9402 present with Gtk+ 2.0.
9404 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9406 * fileio.c (Finsert_file_contents): Undo previous change; see
9407 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9409 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9411 Rename locals to avoid shadowing.
9412 * fileio.c (Finsert_file_contents):
9413 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9414 * process.c (wait_reading_process_output):
9415 Rename inner 'proc' to 'p' to avoid shadowing.
9416 Indent for consistency with usual Emacs style.
9418 2011-11-25 Eli Zaretskii <eliz@gnu.org>
9420 * xdisp.c (redisplay_window): If cursor row is not fully visible
9421 after recentering, and scroll-conservatively is set to a large
9422 number, scroll window by a few more lines to make the cursor fully
9423 visible and out of scroll-margin. (Bug#10105)
9424 (start_display): Don't move to the next line if the display should
9425 start at a newline that is part of a display vector or an overlay
9428 2011-11-24 Juri Linkov <juri@jurta.org>
9430 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9431 after the `MagickPingImage' call. (Bug#10112)
9433 2011-11-23 Chong Yidong <cyd@gnu.org>
9435 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9437 2011-11-23 Martin Rudalics <rudalics@gmx.at>
9439 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9440 making another buffer current. (Bug#10114)
9442 2011-11-23 Glenn Morris <rgm@gnu.org>
9444 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9446 2011-11-23 Chong Yidong <cyd@gnu.org>
9448 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9449 using it (Bug#5984).
9451 2011-11-22 Eli Zaretskii <eliz@gnu.org>
9453 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9454 and header-lines, as they don't have one computed for them.
9457 * .gdbinit (prow): Make displayed values more self-explaining.
9458 Add row's hash code.
9460 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9462 * process.c (wait_reading_process_output): Fix asynchrounous
9463 GnuTLS socket handling on some versions of the GnuTLS library.
9464 (wait_reading_process_output): Add comment and URL.
9466 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9468 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9470 2011-11-21 Chong Yidong <cyd@gnu.org>
9472 * window.c (Fnext_window, Fprevious_window): Doc fix.
9474 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9476 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9478 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9480 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9482 2011-11-20 Martin Rudalics <rudalics@gmx.at>
9484 * window.c (Fset_window_combination_limit): Rename argument
9486 (Vwindow_combination_limit): Remove "status" from doc-string.
9488 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9490 * m/ibms390.h: Remove.
9491 * m/ibms390x.h: Don't include "ibms390.h".
9493 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9495 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9496 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9498 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9500 * casetab.c (Fset_case_table):
9501 * charset.c (Fcharset_after): Fix typos.
9503 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9505 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9506 Otherwise, valgrind does not work on some platforms.
9507 Problem reported by Andreas Schwab in
9508 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9509 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9510 is set, removing the need for VIRT_ADDRESS_VARIES.
9511 (PURE_P): Use a more-efficient implementation that needs just one
9512 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9513 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9514 to 4 (xorl, subq, cmpq, setbe).
9515 * alloc.c (pure): Always extern now, since that's the
9516 VIRT_ADDR_VARIES behavior.
9517 (PURE_POINTER_P): Use a single comparison, not two, for
9518 consistency with the new puresize.h.
9519 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9520 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9521 Remove VIRT_ADDR_VARIES no longer needed.
9523 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9525 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9526 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9527 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9528 behave as if the cursor position were at the window margin.
9530 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9531 and the cursor position is out of bounds, behave as if the cursor
9532 position were at the window margin. (Bug#10075)
9534 2011-11-18 Chong Yidong <cyd@gnu.org>
9536 * window.c (Fwindow_combination_limit): Make first argument
9537 non-optional, since it is meaningless for live windows like the
9540 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9542 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9544 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9546 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9547 (graft_intervals_into_buffer): Simplify.
9549 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9551 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9552 hash values of the two rows.
9553 (copy_row_except_pointers): Preserve the used[] arrays and the
9554 hash values of the two rows. (Bug#10035)
9555 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9557 * xdisp.c (row_hash): New function, body extracted from
9558 compute_line_metrics.
9559 (compute_line_metrics): Call row_hash, instead of computing the
9562 * dispnew.c (verify_row_hash): Call row_hash for computing the
9563 hash code of a row, instead of duplicating code from xdisp.c.
9565 * dispextern.h (row_hash): Add prototype.
9567 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9569 * frame.c (delete_frame): Don't delete the terminal when the last
9570 X frame is closed if emacs is built with GTK toolkit.
9572 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9574 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9576 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9578 * window.c (Vwindow_splits): Rename to
9579 Vwindow_combination_resize. Suggested by Juri Linkov.
9580 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9583 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9585 * nsfns.m (Fns_font_name):
9586 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9588 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9590 * window.h (window): Rename slot "nest" to "combination_limit".
9591 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9592 (Fset_window_nest): Rename to Fset_window_combination_limit.
9593 (Vwindow_nest): Rename to Vwindow_combination_limit.
9594 (recombine_windows, make_parent_window, make_window)
9595 (Fsplit_window_internal, saved_window)
9596 (Fset_window_configuration, save_window_save): Rename all
9597 occurrences of window_nest to window_combination_limit.
9599 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9601 * image.c (imagemagick_load_image): Fix typo.
9603 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9605 * xdisp.c (display_line): Move the call to
9606 highlight_trailing_whitespace before the call to
9607 compute_line_metrics, since the latter needs to see the final
9608 faces of all the glyphs to compute ROW's hash value.
9609 Fixes assertion violations in row_equal_p. (Bug#10035)
9611 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9613 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9614 just return (bug#10044).
9616 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9618 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9619 with user-defined heap size. Bump the default size of the temacs
9620 heap to 27MB, to avoid memory warning when running temacs.
9621 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9623 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9624 current_matrix and desired_matrix. (Bug#9990)
9625 (verify_row_hash) [XASSERTS]: New function.
9626 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9627 that the hash value of glyph rows is correct.
9629 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9631 * window.h (window): Remove splits slot.
9632 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9633 (Fdelete_other_windows_internal, make_parent_window)
9634 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9635 (Fset_window_configuration, save_window_save): Don't deal with
9636 split status of windows.
9637 (saved_window): Remove splits slot.
9638 (Vwindow_splits): Rewrite doc-string.
9640 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9642 * xfns.c (unwind_create_frame):
9643 * nsfns.m (unwind_create_frame):
9644 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9645 Vframe_list (Bug#9999).
9647 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9649 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9651 2011-11-11 Kenichi Handa <handa@m17n.org>
9653 * callproc.c (Fcall_process): Set the member dst_multibyte of
9656 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9658 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9659 avoid a crash (bug#9496).
9661 2011-11-09 Chong Yidong <cyd@gnu.org>
9663 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9664 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9666 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9668 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9670 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9672 Avoid some portability problems by eschewing 'extern inline' functions.
9673 The trivial performance wins aren't worth the portability hassles; see
9674 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9676 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9677 (window_box_width, window_box_left, window_box_left_offset)
9678 (window_box_right, window_box_right_offset): Undo previous change,
9679 by removing the "extern"s.
9680 * intervals.c (adjust_intervals_for_insertion)
9681 (adjust_intervals_for_deletion): Undo previous change,
9682 making these static again.
9683 (offset_intervals, temp_set_point_both, temp_set_point)
9684 (copy_intervals_to_string): No longer inline.
9685 * xdisp.c (window_text_bottom_y, window_box_width)
9686 (window_box_height, window_box_left_offset)
9687 (window_box_right_offset, window_box_left, window_box_right)
9688 (window_box): No longer inline.
9690 2011-11-08 Chong Yidong <cyd@gnu.org>
9692 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9693 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9694 Signal an error if not a live window.
9695 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9696 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9698 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9700 * lisp.h (syms_of_abbrev): Remove declaration.
9701 Reported by CHENG Gao <chenggao@royau.me>.
9703 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9705 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9706 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9707 of temacs in GUI mode.
9709 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9711 * window.h: Declare delete_all_child_windows instead of
9712 delete_all_subwindows.
9713 * window.c (Fwindow_nest, Fset_window_nest)
9714 (Fset_window_new_total, Fset_window_new_normal)
9715 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9716 (delete_all_subwindows): Rename to delete_all_child_windows.
9717 (Fdelete_other_windows_internal, Fset_window_configuration):
9718 Call delete_all_child_windows instead of delete_all_subwindows.
9719 * frame.c (delete_frame): Call delete_all_child_windows instead
9720 of delete_all_subwindows.
9722 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9724 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9725 This is also needed for porting to any host where GC_MARK_STACK is
9726 not GC_MAKE_GCPROS_NOOPS.
9727 (which_symbols): Use it.
9729 2011-11-07 Kenichi Handa <handa@m17n.org>
9731 * coding.c (coding_set_destination): Check coding->src_pos only
9732 when coding->src_object is a buffer (bug#9910).
9734 * process.c (send_process): Set the member src_multibyte of coding
9735 to 0 (bug#9911) when sending a unibyte text.
9737 * callproc.c (Fcall_process): Set the member src_multibyte of
9738 process_coding to 0 (bug#9912).
9740 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9742 * xmenu.c (cleanup_widget_value_tree): New function.
9743 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9744 calling free_menubar_widget_value_tree directly (Bug#9830).
9746 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9748 Fix some portability problems with 'inline'.
9749 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9750 (window_box_width, window_box_left, window_box_left_offset)
9751 (window_box_right, window_box_right_offset): Declare extern.
9752 Otherwise, these inline functions do not conform to C99 and
9753 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9754 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9755 * intervals.c (adjust_intervals_for_insertion)
9756 (adjust_intervals_for_deletion): Now extern, because otherwise the
9757 extern inline functions 'offset_intervals' couldn't refer to it.
9758 (static_offset_intervals): Remove.
9759 (offset_intervals): Rewrite using the old contents of
9760 static_offset_intervals. The old version didn't conform to C99
9761 because an extern inline function contained a reference to an
9762 identifier with static linkage.
9764 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9766 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9769 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9771 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9772 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9773 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9774 return Qleft_to_right.
9776 2011-11-06 Chong Yidong <cyd@gnu.org>
9778 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9779 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9780 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9781 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9782 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9783 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9784 (Fwindow_vscroll): Doc fix.
9785 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9786 argument, since it makes no sense to pass a live window and for
9787 consistency with window-child.
9789 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9791 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9794 2011-11-05 Jason Rumney <jasonr@gnu.org>
9796 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9797 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9799 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9800 bitwise arithmetic preventing use of unicode-sip and non-truetype
9803 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9805 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9808 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9809 initialization code to keep similarity to xfns.c after changes
9812 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9814 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9815 (unwind_create_frame): New function (Bug#9943).
9816 (Fx_create_frame): Restructure code to be more similar to the one in
9817 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9818 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9819 Move terminal->reference_count++ just before making the frame official
9822 * nsterm.m (x_free_frame_resources): New function.
9823 (x_destroy_window): Move code to x_free_frame_resources.
9825 * xfns.c (unwind_create_frame): Fix comment.
9826 (Fx_create_frame, x_create_tip_frame):
9827 Move terminal->reference_count++ just before making the frame
9828 official. Move initialization of image_cache_refcount and
9829 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9831 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9833 Support MSVC build with newer versions of Visual Studio.
9834 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9835 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9838 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9839 which are not supported by MSVC.
9840 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9841 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9843 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9845 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9847 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9849 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9851 Support MSVC build with newer versions of Visual Studio.
9852 * w32.c: Don't include w32api.h for MSVC.
9853 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9855 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9856 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9857 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9858 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9860 (alloca) [_MSC_VER]: Define to _alloca.
9862 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9864 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9866 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9868 * xdisp.c (note_mouse_highlight): If either of
9869 previous/next-single-property-change returns nil, treat that as
9870 the beginning or the end of the buffer. (Bug#9955)
9872 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9874 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9875 label is not null (Bug#9951).
9876 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9879 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9881 * window.c (Fwindow_body_size): Mention in the doc string that the
9882 return value is in frame's canonical units. (Bug#9949)
9884 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9886 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9888 * w32fns.c (unwind_create_frame): If needed, free the glyph
9889 matrices of the partially constructed frame. (Bug#9943)
9890 * xfns.c (unwind_create_frame): Likewise.
9892 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9894 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9895 Don't stop backward scan on the continuation glyph, even though
9896 its CHARPOS is positive.
9897 (mouse_face_from_buffer_pos, note_mouse_highlight):
9898 Rename cover_string to disp_string.
9900 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9902 * window.c (temp_output_buffer_show): Don't use
9903 Vtemp_buffer_show_specifiers.
9904 (Vtemp_buffer_show_specifiers): Remove unused variable.
9906 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9908 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9909 past the beginning of the current glyph matrix.
9911 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9913 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9914 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9915 HAVE_GTK3 (Bug#9869).
9917 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9918 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9920 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9922 * xterm.c: Declare x_handle_net_wm_state to return int.
9923 (handle_one_xevent): Check if we are iconified but don't have
9924 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9925 (get_current_wm_state): Return non-zero if not hidden,
9926 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9927 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9928 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9929 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9931 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9933 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9934 so that this new function doesn't get optimized away by a
9935 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9937 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9939 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9941 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9943 Fix the `xbytecode' command.
9944 * .gdbinit (xprintbytestr): New command.
9945 (xwhichsymbols): Rename from `which'; all callers changed.
9946 (xbytecode): Print the byte-code string as well.
9948 2011-10-29 Kim Storm <storm@cua.dk>
9950 * alloc.c (which_symbols): New function.
9952 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9954 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9957 2011-10-29 Glenn Morris <rgm@gnu.org>
9959 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9960 Not clear what it was for, and it causes various bugs. (Bug#9839)
9962 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9964 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9965 possible random value that matches one of those tested as
9966 condition to clear the mouse face.
9968 2011-10-28 Chong Yidong <cyd@gnu.org>
9970 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9972 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9974 * window.c (make_window): Initialize phys_cursor_on_p.
9976 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9978 * lisp.h (struct Lisp_Symbol): Update comments.
9980 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9982 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9984 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9986 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9987 <oslsachem@gmail.com> for helping to debug this.
9989 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9990 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9991 (g_b_init_get_glyph_outline_w): New static variables.
9992 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9993 (GetGlyphOutlineW_Proc): New typedefs.
9994 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9995 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9997 (w32font_open_internal, compute_metrics):
9998 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9999 instead of calling the "wide" APIs directly.
10001 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10003 * w32.h (syms_of_w32font): Add prototype.
10005 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10007 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10008 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10009 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10010 (Fmove_to_window_line): Doc fix.
10012 2011-10-27 Chong Yidong <cyd@gnu.org>
10014 * process.c (make_process): Set gnutls_state to NULL.
10016 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10017 non-NULL, regardless of GNUTLS_INITSTAGE.
10018 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10019 an error. Set process slots as soon as we allocate them.
10021 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10023 2011-10-27 Chong Yidong <cyd@gnu.org>
10025 * gnutls.c (emacs_gnutls_deinit): New function.
10026 Deallocate credentials structures as well as calling gnutls_deinit.
10027 (Fgnutls_deinit, Fgnutls_boot): Use it.
10029 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10030 (deactivate_process): Call emacs_gnutls_deinit.
10032 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10034 * image.c (x_create_x_image_and_pixmap):
10035 * w32.c (sys_rename, w32_delayed_load):
10036 * w32font.c (fill_in_logfont):
10037 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10039 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10041 * w32fns.c (w32_default_color_map): New function,
10042 extracted from Fw32_default_color_map.
10043 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10045 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10047 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10049 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10051 * keyboard.c (test_undefined): New function (bug#9751).
10052 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10054 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10056 * sysdep.c (init_sys_modes): Fix the check for the controlling
10057 terminal (Bug#6649).
10059 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10061 * dispextern.h (struct bidi_it): New member next_en_type.
10063 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10064 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10065 current character, check also for next_en_type being WEAK_EN.
10066 (bidi_resolve_weak): Don't enter the expensive loop if the current
10067 position is before next_en_pos. Record the bidi type of the first
10068 non-ET, non-BN character we find, in addition to its position.
10069 (bidi_level_of_next_char): Invalidate next_en_type when
10070 next_en_pos is over-stepped.
10072 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10074 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10075 * editfns.c: Rewrite current-time-zone so that it invokes
10076 the equivalent of (format-time-string "%Z") to get the time zone name.
10077 This fixes a bug when the time zone name contains characters that
10078 need converting from the system time locale to Emacs internal format.
10079 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10080 that patch fixed format-time-string to do the conversion, but
10081 I forgot to fix current-time-zone.
10082 (format_time_string): New function, containing most of
10083 what Fformat_time_string used to contain.
10084 (Fformat_time_string): Rewrite in terms of format_time_string.
10085 This doesn't change this function's behavior.
10086 (current-time-zone): Rewrite to use format_time_string.
10087 This fixes the bug reported by Michael Schierl in
10088 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10089 Jason Rumney's 2007-06-07 change worked around this bug, but
10091 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10093 2011-10-19 Eli Zaretskii <eliz@gnu.org>
10095 * xdisp.c (start_display): If the character at POS is displayed
10096 via a display vector, reset IT->current.dpvec_index to zero.
10097 (try_window_reusing_current_matrix): If a line ends in a display
10098 vector or the next line starts in a display vector, continue
10099 redrawing the window even though the character position of
10100 start_row was reached.
10103 2011-10-18 Chong Yidong <cyd@gnu.org>
10105 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10106 with nobreak-char-display too.
10108 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10110 Fix part 3 of bug#9771.
10111 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10112 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10113 non-neutral characters if the current character is a paragraph
10114 separator (a.k.a. Newline). This avoids running the same
10115 expensive loop twice, once when we consume the preceding newline
10116 and the other time when the line actually needs to be displayed.
10117 Avoid the loop when we see neutrals on the base embedding level
10118 following a character whose directionality is the same as the
10119 paragraph's. This avoids running the expensive loop when a line
10120 ends in a long sequence of neutrals, like control characters.
10121 Add assertion against STRONG_AL type. Slightly rearrange code
10122 that determines the type of a neutral given the first non-neutral
10124 (bidi_level_of_next_char): Set next_en_pos to zero when
10125 invalidating its info.
10127 2011-10-17 Eli Zaretskii <eliz@gnu.org>
10129 * xdisp.c (push_display_prop): Determine whether to record string
10130 or buffer position by IT->string, not by IT->method. Allow
10131 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10132 (move_it_vertically_backward): Don't look for character position
10133 immediately after the newline when in a continuation line.
10136 2011-10-15 Martin Rudalics <rudalics@gmx.at>
10138 * window.c (coordinates_in_window): Rewrite and delabelize
10139 vertical border check. (Bug#5357) (Bug#9618)
10141 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10143 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10144 errors in XSetWindowBorder (bug#9310).
10146 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10148 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10149 avoid crash when xmalloc overrun checking is enabled.
10151 2011-10-13 Eli Zaretskii <eliz@gnu.org>
10153 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10154 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10155 cursor motion with <left> and <right> arrow keys.
10157 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10158 some callers set that themselves.
10160 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10162 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10163 display string and the previous row comes from the same string and
10164 is empty. (Bug#9739) (Bug#9738)
10166 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10168 * doc.c (get_doc_string): Encode file name (bug#9735).
10170 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10172 * bidi.c (bidi_level_of_next_char):
10173 * xdisp.c (get_visually_first_element): Remove old incorrect
10174 comments regarding the Unicode Line Separator character.
10176 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10178 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10180 * alloc.c (Fgc_status): Do not access beyond zombies array
10181 boundary if nzombies > MAX_ZOMBIES.
10182 * alloc.c (dump_zombies): Add missing format specifier.
10184 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10186 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10187 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10189 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10190 Some packages use them to denote characters with modifiers.
10192 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10194 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10195 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10196 matching a pp-number. Rename parameter var to var1.
10198 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10200 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10202 2011-10-08 Glenn Morris <rgm@gnu.org>
10204 * callint.c (Fcall_interactively): Give a more explicit error for the
10205 'c' case with a non-character input. (Bug#8479)
10207 2011-10-08 Eli Zaretskii <eliz@gnu.org>
10209 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10211 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10212 lines that are hscrolled on the left.
10214 * dispnew.c (buffer_posn_from_coords): Account for a possible
10215 presence of header-line. (Bug#4426)
10217 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10219 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10220 Don't advertise functionality which we discourage or doesn't work.
10222 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10224 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10225 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10226 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10227 this makes Emacs dump core during garbage collection on rare
10228 occasions. sizeof is obviously inferior to offsetof here, so
10229 stick with offsetof.
10230 (GC_POINTER_ALIGNMENT): New macro.
10231 (mark_memory): Omit 3rd (offset) arg; caller changed.
10232 Don't assume EMACS_INT alignment is the same as pointer alignment.
10234 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10236 * keyboard.c (read_key_sequence_remapped): New var.
10237 (read_key_sequence): Compute remapping in the right buffer.
10238 (command_loop_1): Use read_key_sequence's remapping directly.
10240 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10242 * dired.c (file_name_completion): Don't expand file name.
10243 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10244 before checking file name handler.
10246 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10247 they've been requested explicitly (bug#9591).
10249 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
10251 * keymap.c (Fsingle_key_description): Use make_specified_string
10252 instead of build_string to build string from push_key_description.
10255 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10257 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10258 This fixes a Y2038 bug on 64-bit hosts.
10259 * buffer.c (reset_buffer):
10260 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10261 (Fclear_buffer_auto_save_failure):
10262 Use 0, not -1, to represent an unset failure time, since time_t
10263 might not be signed.
10265 Remove dependency on glibc malloc internals.
10266 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10267 Move back here from lisp.h, but with their new implementations.
10268 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10269 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10270 * charset.c (charset_table_init): New static var.
10271 (syms_of_charset): Use it instead of xmalloc. This removes a
10272 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10273 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10274 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10275 Move back to alloc.c.
10276 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10277 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10279 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10281 * nsterm.m (windowDidResize): Call x_set_window_size only when
10282 ns_in_resize is true. Otherwise set pixelwidth/height and
10283 call change_frame_size (Bug#9628).
10285 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10287 Port --enable-checking=all to Fedora 14 x86-64.
10288 * charset.c (syms_of_charset): Also account for glibc malloc's
10289 internal overhead when calculating the initial malloc maximum.
10291 Port --enable-checking=all to Fedora 14 x86.
10292 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10294 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10295 (overrun_check_realloc, overrun_check_free):
10296 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10297 That way, xmalloc returns a properly-aligned pointer even if
10298 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10299 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10300 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10301 into account when calculating the initial malloc maximum.
10302 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10303 Move here from alloc.c, so that charset.c can use it too.
10304 Properly align; the old code wasn't right for common 32-bit hosts
10305 when configured with --enable-checking=all.
10306 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10307 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10309 2011-09-29 Eli Zaretskii <eliz@gnu.org>
10311 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10314 2011-09-28 Eli Zaretskii <eliz@gnu.org>
10316 * xdisp.c (compute_display_string_end): If there's no display
10317 string at CHARPOS, return -1.
10319 * bidi.c (bidi_fetch_char): When compute_display_string_end
10320 returns a negative value, treat the character as a normal
10321 character not covered by a display string. (Bug#9624)
10323 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
10325 * lread.c (Fread_from_string): Fix typo in docstring.
10327 2011-09-27 Eli Zaretskii <eliz@gnu.org>
10329 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10330 newline, reseat the iterator instead of bidi-iterating there one
10331 character at a time. (Bug#9610)
10332 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10333 TO_CHARPOS if the bidi iterator is at base embedding level.
10335 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10337 * lread.c (readevalloop): Use correct code for NBSP.
10338 (read1): Likewise. (Bug#9608)
10340 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
10342 * dbusbind.c (Fdbus_register_signal): When service is not
10343 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10345 2011-09-25 Glenn Morris <rgm@gnu.org>
10347 * buffer.c (truncate-lines): Doc fix.
10349 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
10351 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10352 (Fset_window_next_buffers): Doc fix.
10354 2011-09-24 Glenn Morris <rgm@gnu.org>
10356 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10358 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10360 Fix minor problems found by static checking.
10361 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10362 * indent.c (Fvertical_motion): Fix == vs = typo.
10364 2011-09-24 Eli Zaretskii <eliz@gnu.org>
10366 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10367 Default value is now t. Doc fix.
10369 * indent.c (Fvertical_motion): Compute and apply the overshoot
10370 logic when moving up, not only when moving down. Fix the
10371 confusing name and values of the it_overshoot_expected variable;
10372 logic changes accordingly. (Bug#9254) (Bug#9549)
10374 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10375 CHARPOS is covered by a display string which includes newlines.
10376 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10377 is covered by a display string with embedded newlines.
10379 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
10381 * dbusbind.c (Fdbus_register_signal): Add match rule to
10382 Vdbus_registered_objects_table. (Bug#9581)
10383 (Fdbus_register_method, Vdbus_registered_objects_table):
10386 2011-09-24 Jim Meyering <meyering@redhat.com>
10388 do not ignore write error for any output size
10389 The previous change was incomplete.
10390 While it makes emacs --batch detect the vast majority of stdout
10391 write failures, errors were still ignored whenever the output size is
10392 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10393 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10394 && echo FAIL: ignored write error
10395 FAIL: ignored write error
10396 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10397 && echo FAIL: ignored write error
10398 FAIL: ignored write error
10399 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10401 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10403 * emacs.c (Fkill_emacs): In noninteractive mode exit
10404 non-successfully if a write error occurred on stdout. (Bug#9574)
10406 2011-09-21 Eli Zaretskii <eliz@gnu.org>
10408 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10411 * dispextern.h (struct it): Update the comment documenting what
10414 2011-09-20 Eli Zaretskii <eliz@gnu.org>
10416 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10417 a display string, extend search for cursor position to end of row.
10418 (find_row_edges): If the row ends in a newline from a display
10419 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10420 Handle the case of a display string with multiple newlines.
10421 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10422 non-empty line. Fixes confusing cursor motion with arrow keys at
10423 the beginning of a line that starts with whitespace.
10425 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10427 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10430 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
10432 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10433 boolean (Bug#9154).
10435 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10437 * xdisp.c (display_line): Record maximum and minimum buffer
10438 positions even if no glyphs were produced (e.g., by a zero-width
10439 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10440 buffer positions that will be removed from the glyph row because
10442 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10443 column is beyond frame width: don't subtract 1 "pixel" when
10444 computing width of the stretch.
10445 (reseat_at_next_visible_line_start): Undo the change made on
10446 2011-09-17 that saved paragraph information and restored it after
10447 the call to `reseat'. (Bug#9545)
10449 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10451 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10452 and turn window cursor on if cleared (Bug#9415).
10454 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10456 * search.c (boyer_moore): Take unibyte characters from pattern
10457 literally. (Bug#9458)
10459 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10461 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10463 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10465 Fix minor problem found by static checking.
10466 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10467 initialized, to pacify gcc -Wuninitialized.
10469 * fileio.c: Report proper errno when syscall falls.
10470 (Finsert_file_contents): Save and restore errno,
10471 so that report_file_error outputs the correct diagnostic.
10472 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10474 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10476 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10478 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10480 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10481 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10483 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10485 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10486 about the current paragraph and restore it after the call to reseat.
10488 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10489 (bidi_find_paragraph_start): Search back for paragraph beginning
10490 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10491 (bidi_move_to_visually_next): Only trigger paragraph-related
10492 computations when the last character is a newline or at EOB, not
10493 just any NEUTRAL_B. (Bug#9470)
10495 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10496 truncated lines if point is covered by a display string. (Bug#9524)
10498 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10500 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10501 (cons_to_x_long): New function.
10502 (lisp_data_to_selection_data): Use it. Correct the test for
10503 short-versus-long data; it was negated. Break out of vector
10504 loop, for efficiency, when a long datum is discovered.
10506 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10508 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10510 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10512 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10513 GCC PR/17406) by declaring this function with external scope.
10515 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10517 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10518 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10520 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10522 * editfns.c (Fformat): Correctly handle text properties on "%%".
10524 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10526 * xterm.c (x_draw_composite_glyph_string_foreground):
10527 * w32term.c (x_draw_composite_glyph_string_foreground):
10528 * term.c (encode_terminal_code):
10529 * composite.c (composition_update_it, get_composition_id):
10530 * xdisp.c (get_next_display_element)
10531 (fill_composite_glyph_string): Add comments about special meaning
10532 of TAB characters in a composition.
10534 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10536 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10537 This occurs when processing a multibyte format.
10538 Problem reported by Wolfgang Jenker.
10540 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10542 * xdisp.c (try_cursor_movement): Only check for exact match if
10543 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10545 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10547 Remove unused external symbols.
10548 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10549 * xdisp.c (calc_pixel_width_or_height): Now static.
10550 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10551 * indent.c (check_display_width):
10552 * w32term.c: Fix comment to match code.
10553 * xterm.c, xterm.h (x_catching_errors): Remove.
10555 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10557 * xselect.c: Use signed conversions more consistently (Bug#9498).
10558 (selection_data_to_lisp_data): Assume incoming selection data are
10559 signed integers, not unsigned. This is to be consistent with
10560 outgoing selection data, which was modified to use signed integers
10561 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10562 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10563 expects long, not unsigned long.
10565 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10567 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10568 computation of loop end. Reported by Johan Bockgård
10571 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10573 * frame.c (Fother_visible_frames_p): Function deleted.
10575 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10577 * indent.c (compute_motion): Process display vector front to back
10578 rather than the other way around. (Bug#2496)
10580 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10582 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10584 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10586 * minibuf.c (Fread_from_minibuffer): Doc fix.
10588 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10590 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10591 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10593 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10595 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10596 value for non-existent files.
10598 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10600 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10601 set its "size" to -1. This will set the modtime_size field of
10602 the corresponding buffer to -1, which is what
10603 verify-visited-file-modtime expects for files that do not exist.
10606 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10608 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10610 * lisp.h: ... from here. push_key_description is no longer
10611 defined in keyboard.c, so its declaration should not be in
10612 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10613 logically belongs with push_key_description.
10615 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10617 * buffer.h: Include <sys/types.h> instead of <time.h>.
10618 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10619 Problem reported by Herbert J. Skuhra.
10621 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10623 * xml.c (parse_region): Make the parsing work for
10624 non-comment-starting XML files again (bug#9144).
10626 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10628 * image.c (gif_load): Fix calculation of bottom and right corner.
10631 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10633 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10634 redisplay in small windows.
10636 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10638 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10640 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10642 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10643 Operate on live windows only.
10645 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10647 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10649 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10651 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10652 only under bidi iteration.
10654 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10656 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10658 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10660 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10661 Without this fix, the command to link temacs failed due to an
10662 undefined symbol __builtin_isnan. This is because
10663 /usr/include/iso/math_c99.h #defines isnan(x) to
10664 __builtin_isnan(x), but the bundled gcc, which identifies itself
10665 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10667 * floatfns.c (isnan): #undef, and then #define to a clone of
10669 (Fisnan): Always define, since it's always available now.
10670 (syms_of_floatfns): Always define isnan at the Lisp level.
10672 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10674 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10676 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10678 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10679 The previous code assumed that file offsets (off_t values) fit in
10680 EMACS_INT variables, which is not true on typical 32-bit hosts.
10681 The code messed up by falsely reporting buffer overflow in cases
10682 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10683 when "big" contains more than 2**29 bytes, even though this
10684 inserts just one byte and does not overflow the buffer.
10685 (Finsert_file_contents): Store file offsets as off_t
10686 values, not as EMACS_INT values. Check for overflow when
10687 converting between EMACS_INT and off_t. When checking for
10688 buffer overflow or for overlap, take the offsets into account.
10689 Don't use EMACS_INT for small values where int suffices.
10690 When checking for overlap, fix a typo: ZV was used where
10691 ZV_BYTE was intended.
10692 (Fwrite_region): Don't assume off_t fits into 'long'.
10693 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10695 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10697 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10699 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10701 sprintf-related integer and memory overflow issues (Bug#9412).
10703 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10704 (esprintf, exprintf, evxprintf): New functions.
10705 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10706 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10707 (modify_event_symbol): Do not assume that the length of
10708 name_alist_or_stem is safe to alloca and fits in int.
10709 (Fexecute_extended_command): Likewise for function name and binding.
10710 (Frecursion_depth): Wrap around reliably on integer overflow.
10711 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10712 since some callers pass EMACS_INT values.
10713 (Fsingle_key_description): Don't crash if symbol name contains more
10714 than MAX_ALLOCA bytes.
10715 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10716 (get_minibuffer): Arg is now EMACS_INT, not int.
10717 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10718 (esprintf, exprintf, evxprintf): New decls.
10719 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10721 * dbusbind.c (signature_cat): New function.
10722 (xd_signature, Fdbus_register_signal):
10723 Do not overrun buffer; instead, report string overflow.
10725 * dispnew.c (add_window_display_history): Don't overrun buffer.
10726 Truncate instead; this is OK since it's just a log.
10728 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10729 even if the time zone offset is outlandishly large.
10730 Don't mishandle offset == INT_MIN.
10732 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10733 when creating daemon; the previous buffer-overflow check was incorrect.
10735 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10736 which has the guts of the old verror function.
10738 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10739 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10741 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10742 (font_unparse_xlfd): Don't blindly alloca long strings.
10743 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10744 fits in int, when using sprintf. Use single snprintf to count
10745 length of string rather than counting it via multiple sprintfs;
10746 that's simpler and more reliable.
10747 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10748 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10749 sprintf, in case result does not fit in int.
10751 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10752 (fontset_from_font): Print it.
10754 * frame.c (tty_frame_count): Now printmax_t, not int.
10755 (make_terminal_frame, set_term_frame_name): Print it.
10756 (x_report_frame_params): In X, window IDs are unsigned long,
10757 not signed long, so print them as unsigned.
10758 (validate_x_resource_name): Check for implausibly long names,
10759 and don't assume name length fits in 'int'.
10760 (x_get_resource_string): Don't blindly alloca invocation name;
10761 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10764 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10765 (xg_check_special_colors, xg_set_geometry):
10766 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10768 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10769 Use esprintf, not sprintf, in case result does not fit in int.
10771 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10772 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10773 it as a large positive number.
10774 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10775 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10777 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10778 in case result does not fit in int.
10780 * print.c (float_to_string): Detect width overflow more reliably.
10781 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10782 buffer overrun. Don't assume list length fits in 'int'. Treat
10783 print length of 0 as 0, not as infinity; to be consistent with other
10784 uses of print length in this function. Don't overflow print length
10785 index. Don't assume hash table size fits in 'long', or that
10786 vectorlike size fits in 'unsigned long'.
10788 * process.c (make_process): Use printmax_t, not int, to format
10789 process-name gensyms.
10791 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10793 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10794 to avoid potential buffer overrun.
10796 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10797 if X resource line is longer than 512 bytes.
10799 * xfns.c (x_window): Make sprintf buffer a bit bigger
10800 to avoid potential buffer overrun.
10802 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10804 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10806 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10808 Integer overflow fixes for scrolling, etc.
10809 Without these, Emacs silently mishandles large integers sometimes.
10810 For example, "C-u 4294967297 M-x recenter" was treated as if
10811 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10813 * xdisp.c (try_window_id): Check Emacs fixnum range before
10814 converting to 'int'.
10816 * window.c (window_scroll_line_based, Frecenter):
10817 Check that an Emacs fixnum is in range before assigning it to 'int'.
10818 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10819 values converted from Emacs fixnums.
10820 (Frecenter): Don't wrap around a line count if it is out of 'int'
10821 range; instead, treat it as an extreme value.
10822 (Fset_window_configuration, compare_window_configurations):
10823 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10825 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10826 that can exceed INT_MAX. Check that EMACS_INT value is in range
10827 before assigning it to the (possibly-narrower) index.
10828 (match_limit): Don't assume that a fixnum can fit in 'int'.
10830 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10833 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10834 (Fvertical_motion): Don't wrap around LINES values that don't fit
10835 in 'int'. Instead, treat them as extreme values. This is good
10836 enough for windows, which can't have more than INT_MAX lines anyway.
10838 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10840 * Require libxml/parser.h to avoid compilation warning.
10842 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10844 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10845 since this reportedly can destroy thread storage.
10847 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10849 * syntax.c (find_defun_start): Update all cache variables if
10850 exiting early (Bug#9401).
10852 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10854 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10856 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10857 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10858 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10860 * term.c (tty_append_glyph): New function.
10861 (produce_stretch_glyph): Static function and its prototype deleted.
10863 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10866 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10868 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10869 when checking :margin (Bug#9390).
10870 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10871 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10872 so that the name doesn't mislead. All uses changed.
10874 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10876 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10879 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10881 * xdisp.c (move_it_to): Don't bail out early when reaching
10882 position beyond to_charpos, if we are scanning backwards.
10883 (move_it_vertically_backward): When DY == 0, make sure we get to
10884 the first character in the line after the newline.
10886 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10888 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10889 (ccl_driver): Do not generate an out-of-range pointer.
10890 (Fccl_execute_on_string): Remove unnecessary check for
10891 integer overflow, noted by Stefan Monnier in
10892 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10893 Remove a FIXME that didn't need fixing.
10894 Simplify the newly-introduced buffer reallocation code.
10896 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10898 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10900 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10902 Integer and memory overflow issues (Bug#9196).
10904 * doc.c (get_doc_string): Rework so that
10905 get_doc_string_buffer_size is the actual buffer size, rather than
10906 being 1 less than the actual buffer size; this makes xpalloc more
10909 * image.c (x_allocate_bitmap_record, cache_image):
10910 * xselect.c (Fx_register_dnd_atom):
10911 Simplify previous changes by using xpalloc.
10913 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10914 since either will do and ptrdiff_t is convenient with xpalloc.
10916 * charset.c (charset_table_size)
10917 (struct charset_sort_data.priority): Now ptrdiff_t.
10918 (charset_compare): Don't overflow if priorities differ greatly.
10919 (Fsort_charsets): Don't assume list length fits in int.
10920 Check for size-calculation overflow when allocating sort data.
10921 (syms_of_charset): Allocate an initial charset table that is
10922 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10924 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10926 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10927 The actual value is always <= INT_MAX, and leaving it unsigned made
10928 overflow checking harder.
10930 * dispextern.h (struct glyph_matrix.rows_allocated)
10931 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10932 with xpalloc. The values are still always <= INT_MAX.
10934 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10936 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10937 (SAFE_NALLOCA): New macro.
10939 * region-cache.c (struct boundary.pos, find_cache_boundary)
10940 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10941 (set_cache_region, invalidate_region_cache)
10942 (revalidate_region_cache, know_region_cache, region_cache_forward)
10943 (region_cache_backward, pp_cache):
10944 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10945 so that ptrdiff_t * can be passed to xpalloc.
10946 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10947 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10948 (pp_cache): Don't assume cache_len fits in int.
10949 * region-cache.h: Adjust extern decls to match.
10951 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10952 EMACS_INT, since either will do, for xpalloc.
10954 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10955 (xnmalloc, xnrealloc, xpalloc): New functions.
10957 * bidi.c (bidi_shelve_header_size): New constant.
10958 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10959 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10961 * bidi.c (bidi_cache_shrink):
10962 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10964 Don't update size of array until after memory allocation succeeds,
10965 because xmalloc/xrealloc may not return.
10966 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10967 now that we have proper integer overflow checking.
10968 (record_overlay_string, overlay_strings): Catch overflows when
10969 calculating size of overlay_str_buf.
10971 * callproc.c (Fcall_process): Check for size overflow when
10972 calculating size of args2.
10973 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10974 Normally we prefer signed values, but sticking with ptrdiff_t would
10975 require adding more-complicated checks.
10977 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10978 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10979 Redo buffer-overflow calculations to avoid integer overflow.
10980 Add a FIXME comment where memory seems to be over-allocated.
10982 * character.c (Fstring): Check for size-calculation overflow.
10984 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10985 unnecessary integer overflow. Check for size overflow.
10986 (encode_coding_object): Don't update size until xmalloc succeeds.
10988 * composite.c (get_composition_id): Check for overflow in glyph
10989 length calculations.
10991 Integer and memory overflow fixes for display code.
10992 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10993 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10994 (scrolling_window): Check for overflow in size calculations.
10995 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10996 Don't assume glyph table len fits in int.
10997 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10998 (row_table_size): Now ptrdiff_t, not int.
10999 (scrolling_window): Avoid overflow in size calculations.
11000 Don't update size until allocation succeeds.
11001 * fns.c (concat): Check for overflow in size calculations.
11002 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11003 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11004 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11006 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11007 (get_doc_string): Check for size calculation overflow.
11008 Don't update size until allocation succeeds.
11009 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11010 EMACS_INT, where ptrdiff_t will do.
11011 (Fsubstitute_command_keys): Check for string overflow.
11013 * editfns.c (set_time_zone_rule): Don't assume environment length
11015 (message_length): Now ptrdiff_t, not int.
11016 (Fmessage_box): Don't update size until allocation succeeds.
11017 Don't assume message length fits in int.
11018 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11020 * emacs.c (main): Do not reallocate argv, since there is a null at
11021 the end that can be overwritten, and this way there's no need to
11022 worry about size-calculation overflow.
11023 (sort_args): Check for size-calculation overflow.
11025 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11027 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11029 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11030 (x_set_scroll_bar_width, x_figure_window_size):
11031 Check for integer overflow.
11032 (x_set_alpha): Do not assume XINT fits in int.
11034 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11035 This is for the members text_lines, text_cols, total_lines, total_cols,
11036 where the system imposes an 'int' limit.
11038 * fringe.c (Fdefine_fringe_bitmap):
11039 Don't update size until alloc works.
11041 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11042 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11044 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11045 Check for size-calculation overflow.
11046 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11047 do, as we prefer signed integers.
11048 (id_to_widget.max_size, id_to_widget.used)
11049 (xg_store_widget_in_map, xg_remove_widget_from_map)
11050 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11051 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11052 Use and return ptrdiff_t, not int.
11053 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11054 * gtkutil.h: Change prototypes to match the above.
11056 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11057 are duplicate now that they've been promoted to lisp.h.
11058 (x_allocate_bitmap_record, x_alloc_image_color)
11059 (make_image_cache, cache_image, xpm_load):
11060 Don't update size until alloc is done.
11061 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11063 Check for size calculation overflow.
11064 (ct_colors_allocated_max): New constant.
11065 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11068 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11069 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11070 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11071 Use ptrdiff_t, not int, to count maps.
11072 (read_char_minibuf_menu_prompt): Check for overflow in size
11073 calculations. Don't update size until allocation succeeds.
11074 Redo calculations to avoid overflow.
11075 * keyboard.h: Change prototypes to match the above.
11077 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11079 (current_minor_maps): Check for size calculation overflow.
11080 * keymap.h: Change prototypes to match the above.
11082 * lread.c (read1, init_obarray): Don't update size until alloc done.
11084 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11085 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11087 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11088 Now ptrdiff_t, not int.
11089 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11090 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11092 * process.c (Fnetwork_interface_list): Check for overflow
11093 in size calculation.
11095 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11097 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11098 overflow. Don't bother calling xmalloc when xrealloc will do.
11100 * search.c (Freplace_match): Check for size calculation overflow.
11101 (Fset_match_data): Don't assume list lengths fit in 'int'.
11103 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11104 for command line length. Do not attempt to address one before the
11105 beginning of an array, as that's not portable.
11107 * term.c (max_frame_lines): Remove; unused.
11108 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11110 (encode_terminal_code, calculate_costs): Check for size
11111 calculation overflow.
11112 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11113 table lengths and related sizes. Don't update size until alloc
11114 done. Redo calculations to avoid overflow.
11115 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11117 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11118 subtracting pointers.
11119 (gobble_line): Check for overflow more carefully. Don't update size
11122 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11123 Don't update size until alloc done.
11124 Redo size calculations to avoid overflow.
11125 Check for size calculation overflow.
11126 (main) [DEBUG]: Fix typo in invoking tparam1.
11128 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11129 Use ptrdiff_t, not int, for sizes.
11130 (store_mode_line_noprop_char): Don't update size until alloc done.
11132 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11133 Use ptrdiff_t, not int, for sizes.
11134 (Finternal_make_lisp_face, cache_face):
11135 Check for size calculation overflow.
11136 (cache_face): Treat size calculation overflows as if they were
11137 memory exhaustion (the usual treatment), rather than aborting.
11139 * xfns.c (x_encode_text, x_set_name_internal)
11140 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11141 sizes, since they can exceed INT_MAX in size. Check for size
11142 calculation overflow.
11144 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11145 (xg_select): Check for size calculation overflow.
11146 Don't update size until alloc done.
11148 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11149 as sprintf is limited to int lengths.
11151 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11152 (X_LONG_MIN): New macros.
11153 Use them to make the following changes clearer.
11154 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11155 This change doesn't affect the value now, but it may help remind
11156 future maintainers not to raise the value too much later.
11157 (SELECTION_QUANTUM): Remove, replacing with ...
11158 (selection_quantum): ... new function, which avoids overflow.
11160 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11161 assumption that selection length fits in 'int'.
11162 (x_reply_selection_request, x_handle_selection_request)
11163 (x_get_window_property, receive_incremental_selection)
11164 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11165 (lisp_data_to_selection_data, clean_local_selection_data):
11166 Use ptrdiff_t, not int, to record length of selection.
11167 (x_reply_selection_request, x_get_window_property)
11168 (receive_incremental_selection, x_property_data_to_lisp):
11169 Redo calculations to avoid overflow.
11170 (x_reply_selection_request): When sending hint, ceiling it at
11171 X_LONG_MAX rather than relying on wraparound overflow to send
11173 (x_get_window_property, receive_incremental_selection)
11174 (lisp_data_to_selection_data, x_property_data_to_lisp):
11175 Check for size-calculation overflow.
11176 (x_get_window_property, receive_incremental_selection)
11177 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11178 Don't store size until memory allocation succeeds.
11179 (x_get_window_property): Plug memory leak on memory exhaustion.
11180 Don't double-block input; malloc is safe here. Don't assume 2**34
11181 - 4 fits in unsigned long. Add an xassert to check
11182 XGetWindowProperty overflow. Be more careful about overflow
11183 calculations, and distinguish size from memory overflow better.
11184 (receive_incremental_selection): When tracing, don't assume
11185 unsigned int is less than INT_MAX.
11186 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11187 harmful) conversions of unsigned short to int.
11188 (lisp_data_to_selection_data): Don't assume that integers
11189 in the range -65535 through -1 fit in an X unsigned short.
11190 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11191 result parameters unless successful. Rely on cons_to_unsigned
11192 to report problems with elements; the old code wasn't right anyway.
11193 (x_check_property_data): Check for int overflow; we cannot use
11194 a wider type due to X limits.
11195 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11197 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11199 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11200 (x_term_init): Check for size calculation overflow.
11201 (x_color_cells): Don't store size until memory allocation succeeds.
11202 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11203 Don't assume alloca size is less than MAX_ALLOCA.
11204 (x_term_init): Don't assume length fits in int (sprintf is limited
11207 Use ptrdiff_t for composition IDs.
11208 * character.c (lisp_string_width):
11209 * composite.c (composition_table_size, n_compositions)
11210 (get_composition_id, composition_gstring_from_id):
11211 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11212 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11213 * window.c (Frecenter):
11214 Use ptrdiff_t, not int, for composition IDs.
11215 * composite.c (get_composition_id): Check for integer overflow.
11216 * composite.h: Adjust prototypes to match the above changes.
11218 Use ptrdiff_t for hash table indexes.
11219 * category.c (hash_get_category_set):
11220 * ccl.c (ccl_driver):
11221 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11222 * coding.c (coding_system_charset_list, detect_coding_system):
11223 * coding.h (struct coding_system.id):
11224 * composite.c (get_composition_id, gstring_lookup_cache):
11225 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11226 * image.c (xpm_get_color_table_h):
11227 * lisp.h (hash_lookup, hash_put):
11228 * minibuf.c (Ftest_completion):
11229 Use ptrdiff_t for hash table indexes, not int (which is too
11230 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11231 32-bit --with-wide-int hosts).
11233 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11234 Add a FIXME comment about memory leaks.
11235 (syms_of_charset): Don't assume xmalloc returns.
11237 Don't assume that stated character widths fit in int.
11238 * character.c (Fchar_width, c_string_width, lisp_string_width):
11239 * character.h (CHAR_WIDTH):
11240 * indent.c (MULTIBYTE_BYTES_WIDTH):
11241 Use sanitize_char_width to avoid undefined and/or bad behavior
11242 with outlandish widths.
11243 * character.h (sanitize_tab_width): Rename from sanitize_width,
11244 now that we have two such functions. All uses changed.
11245 (sanitize_char_width): New inline function.
11247 Don't assume that tab-width fits in int.
11248 * character.h (sanitize_width): New inline function.
11249 (SANE_TAB_WIDTH): New macro.
11250 (ASCII_CHAR_WIDTH): Use it.
11251 * indent.c (sane_tab_width): Remove. All uses replaced by
11252 SANE_TAB_WIDTH (current_buffer).
11253 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11255 * fileio.c: Integer overflow issues with file modes.
11256 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11258 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11259 Remove unreachable code.
11260 (read_hex, load_charset_map_from_file): Check for integer overflow.
11262 * xterm.c: Don't go over XClientMessageEvent limit.
11263 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11264 (x_send_scroll_bar_event): Likewise. Check that the size does not
11265 exceed limits imposed by XClientMessageEvent, as well as the usual
11266 ptrdiff_t and size_t limits.
11268 * keyboard.c: Overflow, signedness and related fixes.
11269 (make_lispy_movement): Use same integer type in forward decl
11270 that is used in the definition.
11271 (read_key_sequence, keyremap_step):
11272 Change bufsize argument back to int, undoing my 2011-03-30 change.
11273 We prefer signed types, and int is wide enough here.
11274 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11275 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11276 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11277 length, not size_t. Use ptrdiff_t for index, not int.
11278 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11279 possibility of integer overflow.
11281 Overflow, signedness and related fixes for images.
11283 * dispextern.h (struct it.stack[0].u.image.image_id)
11284 (struct_it.image_id, struct image.id, struct image_cache.size)
11285 (struct image_cache.used, struct image_cache.ref_count):
11286 * gtkutil.c (update_frame_tool_bar):
11287 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11288 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11289 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11290 * nsmenu.m (update_frame_tool_bar):
11291 * xdisp.c (calc_pixel_width_or_height):
11292 * xfns.c (image_cache_refcount):
11293 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11294 on typical 64-bit hosts.
11296 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11297 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11298 Omit unnecessary casts to int.
11299 (parse_image_spec): Check that integers fall into 'int' range
11300 when the callers expect that.
11301 (image_ascent): Redo ascent calculation to avoid int overflow.
11302 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11303 (lookup_image): Remove unnecessary tests.
11304 (xbm_image_p): Locals are now of int, not EMACS_INT,
11305 since parse_image_check makes sure they fit into int.
11306 (png_load, gif_load, svg_load_image):
11307 Prefer int to unsigned where either will do.
11308 (tiff_handler): New function, combining the cores of the
11309 old tiff_error_handler and tiff_warning_handler.
11310 This function is rewritten to use vsnprintf and thereby avoid
11311 stack buffer overflows. It uses only the features of vsnprintf
11312 that are common to both POSIX and native Microsoft.
11313 (tiff_error_handler, tiff_warning_handler): Use it.
11314 (tiff_load, gif_load, imagemagick_load_image):
11315 Don't assume :index value fits in 'int'.
11316 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11317 (imagemagick_load_image): Check that crop parameters fit into
11318 the integer types that MagickCropImage accepts. Don't assume
11319 Vimagemagick_render_type has a nonnegative value. Don't assume
11320 size_t fits in 'long'.
11321 (gs_load): Use printmax_t to print the widest integers possible.
11322 Check for integer overflow when computing image height and width.
11324 2011-08-26 Eli Zaretskii <eliz@gnu.org>
11326 * xdisp.c (redisplay_window): Don't force window start if point
11327 will be invisible in the resulting window. (Bug#9324)
11329 2011-08-25 Eli Zaretskii <eliz@gnu.org>
11331 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11332 the display spec is of the form `(space ...)'.
11333 (handle_display_spec): Return the value returned by
11334 handle_single_display_spec, not just 1 or zero.
11335 (handle_single_display_spec): If the display spec is of the form
11336 `(space ...)', and specifies display in the text area, return 2
11338 (try_cursor_movement): Check for the need to scroll more
11339 accurately, and prefer exact match for point under bidi.
11340 Don't advance `row' beyond the last row of the window.
11342 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11343 into disp_prop; all users changed.
11345 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11346 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11347 for the text covered by the display property.
11349 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
11351 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11352 Change return value to nil.
11353 (Frecord_buffer): Delete unused function.
11355 2011-08-24 Eli Zaretskii <eliz@gnu.org>
11357 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11358 buffers, return left-to-right.
11359 (set_cursor_from_row): Consider candidate row a win if its glyph
11360 represents a newline and point is on that newline. Fixes cursor
11361 positioning on the newline at EOL of R2L text within L2R
11362 paragraph, and vice versa.
11363 (try_cursor_movement): Check continued rows, in addition to
11364 continuation rows. Fixes unwarranted scroll when point enters a
11365 continued line of R2L text within an L2R paragraph, or vice versa.
11366 (cursor_row_p): Consider the case of point being equal to
11367 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11368 from the end of a short line to the beginning of a continued line
11369 of R2L text within L2R paragraph.
11370 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11371 composed characters.
11373 * bidi.c (bidi_check_type): Use xassert.
11374 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11377 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11379 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11382 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
11384 * nsfont.m (ns_otf_to_script): Fix typo.
11386 2011-08-22 Kenichi Handa <handa@m17n.org>
11388 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11389 extra slot even if the purpose is char-code-property-table.
11391 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11393 * xdisp.c (redisplay_window): When computing centering_position,
11394 account for the height of the header line. (Bug#8874)
11396 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11397 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11398 candidate is selected by the mouse, and that candidate has a
11399 composed character under the mouse.
11401 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11402 coordinates reported by pos-visible-in-window-p for a composed
11403 character in column zero.
11405 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11407 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11409 2011-08-22 Eli Zaretskii <eliz@gnu.org>
11411 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11412 consider it a hit if to_charpos is anywhere in the range of the
11413 composed buffer positions.
11415 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
11417 * image.c (gif_load): Don't assume that each subimage has the same
11418 dimensions as the base image. Handle disposal method that is
11419 "undefined" by the gif spec (Bug#9335).
11421 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
11423 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11424 (Fcondition_case): Document `debug' symbol in error handler.
11426 2011-08-19 Eli Zaretskii <eliz@gnu.org>
11428 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11429 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11430 from an Org mode buffer to a Speedbar frame.
11432 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11433 a composition, take its buffer position from IT->cmp_it.charpos.
11434 Fixes cursor positioning at the beginning of a line that begins
11435 with a composed character.
11437 2011-08-18 Eli Zaretskii <eliz@gnu.org>
11439 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11440 character bidirectional type, use STRONG_L instead. Fixes crashes
11441 in a buffer produced by `describe-categories'.
11443 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11444 members before the level stack, so they would be saved and
11445 restored when copying iterator state. Fixes incorrect reordering
11446 around TABs covered by display properties.
11448 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11450 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11452 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
11454 * eval.c (internal_condition_case, internal_condition_case_1)
11455 (internal_condition_case_2, internal_condition_case_n):
11456 Remove unnecessary aborts (Bug#9081).
11458 2011-08-17 Eli Zaretskii <eliz@gnu.org>
11460 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11461 has no `load' handler, try opening the file locally. (Bug#9311)
11463 2011-08-16 Ken Brown <kbrown@cornell.edu>
11465 * gmalloc.c: Expand comment.
11467 2011-08-16 Eli Zaretskii <eliz@gnu.org>
11469 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11470 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11472 2011-08-16 Ken Brown <kbrown@cornell.edu>
11474 Fix memory allocation problems in Cygwin build (Bug#9273).
11476 * unexcw.c ( __malloc_initialized): Declare external variable.
11477 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11479 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11481 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11483 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11484 in the static heap.
11485 [CYGWIN] (special_realloc): New function.
11486 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11487 requests to realloc storage in the static heap.
11489 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11491 * bidi.c (bidi_initialize): Remove unused local.
11493 2011-08-15 Eli Zaretskii <eliz@gnu.org>
11496 * biditype.h: Remove file.
11497 * makefile.w32-in ($(BLD)/bidi.$(O)):
11498 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11500 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11502 * chartab.c: Improve commentary for the uniprop_table API.
11504 * bidi.c (bidi_paragraph_init): Support zero value of
11505 bidi_ignore_explicit_marks_for_paragraph_level.
11506 (bidi_initialize): Use uniprop_table instead of including
11507 biditype.h and bidimirror.h.
11509 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11510 coordinates of the iterator when restoring from ppos_it.
11513 2011-08-14 Kenichi Handa <handa@m17n.org>
11515 * process.c (create_process): Call setup_process_coding_systems
11516 after the pid of the process is set to -1 (Bug#8162).
11518 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11520 * xdisp.c (move_it_in_display_line_to): Don't invoke
11521 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11522 ppos_it. Fixes vertical cursor motion when line beginning is
11523 covered by an image. (Bug#9296)
11525 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11527 * nsterm.h (ns_run_ascript): Declare.
11528 (NSAPP_DATA2_RUNASSCRIPT): Define.
11530 * nsfns.m (as_script, as_result, as_status): New static variables.
11531 (ns_run_ascript): New function.
11532 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11533 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11534 the event loop. Get status from as_status (Bug#7276).
11536 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11537 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11538 the event loop (Bug#7276).
11540 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11542 * gnutls.c (QCgnutls_bootprop_priority)
11543 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11544 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11545 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11546 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11547 (QCgnutls_bootprop_verify_hostname_error)
11548 (QCgnutls_bootprop_callbacks_verify): Rename from
11549 Qgnutls_bootprop_..., all uses changed.
11551 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11554 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11556 * xfaces.c (Qframe_set_background_mode): Now static.
11557 * dispextern.h (Qframe_set_background_mode): Remove decl.
11559 * process.c (Fnetwork_interface_info): Declare local only if needed.
11561 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11563 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11564 (Fnetwork_interface_list): Allocate in increments of bytes instead
11565 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11566 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11568 (struct ifflag_def): notrailers is smart on OSX.
11569 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11570 Get hardware address with getifaddrs if available.
11572 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11574 * xdisp.c (iterate_out_of_display_property): xassert that
11575 IT->position is set to within IT->object's boundaries. Break from
11576 the loop as soon as EOB is reached; avoids infloops in redisplay
11577 when IT->position is set up wrongly due to some bug.
11578 Set IT->current to match the bidi iterator unconditionally.
11579 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11580 entry. Force push_it to save on the stack the current
11581 buffer/string position, to be restored by pop_it. Fix flags in
11582 the iterator structure wrt the object coming from a display
11583 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11584 properties. (Bug#9284)
11586 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11588 * fontset.c (fontset_get_font_group): Add proper type checks.
11591 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11593 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11594 and LC_VERSION_MIN_MACOSX.
11595 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11596 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11598 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11600 * xdisp.c (forward_to_next_line_start): Allow to use the
11601 no-display-properties-and-no-overlays under bidi display.
11602 Set disp_pos in the bidi iterator to avoid searches for display
11603 properties and overlays.
11605 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11607 * editfns.c (Fset_time_zone_rule): Document relationship with the
11610 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11611 the font entity extracted from the cache (Bug#8109).
11613 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11615 * composite.c (autocmp_chars): Don't reset point. That is done by
11616 restore_point_unwind (Bug#5984).
11618 2011-08-07 Juri Linkov <juri@jurta.org>
11620 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11621 to show the arg `TIME' instead of `TIMEVAL'.
11623 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11625 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11626 display property strides EOL and includes a newline, as in
11627 longlines-mode. (Bug#9254)
11628 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11629 word-wrap under bidirectional display. (Bug#9224)
11631 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11632 is non-zero, even if the data buffer is NULL. Fixes a crash in
11633 vertical-motion with longlines-mode. (Bug#9254)
11635 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11637 * bidi.c <bidi_cache_total_alloc>: Now static.
11638 (bidi_initialize): Initialize bidi_cache_total_alloc.
11640 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11643 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11644 amount allocated this far in `bidi_cache_total_alloc'.
11645 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11646 non-zero, only free the data buffer without restoring the cache
11647 contents. All callers changed.
11649 * dispextern.h (bidi_unshelve_cache): Update prototype.
11651 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11652 (move_it_in_display_line, move_it_to)
11653 (move_it_vertically_backward, move_it_by_lines): Replace the call
11654 to xfree to an equivalent call to bidi_unshelve_cache.
11655 (move_it_in_display_line_to): Fix logic of returning
11656 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11658 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11660 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11661 came from a string character with a `cursor' property. (Bug#9229)
11663 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11665 * Makefile.in (LIB_PTHREAD): New variable.
11666 (LIBES): Add LIB_PTHREAD (Bug#9216).
11668 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11669 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11671 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11673 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11675 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11677 * xterm.c (x_find_topmost_parent): New function.
11678 (x_set_frame_alpha): Find topmost parent window with
11679 x_find_topmost_parent and set the property there also (bug#9181).
11680 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11682 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11684 * callproc.c (Fcall_process): Avoid vfork clobbering
11685 the local vars buffer, coding_systems, current_dir.
11687 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11689 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11691 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11693 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11694 so that it is not optimized away.
11696 * xdisp.c (compute_display_string_pos): Remove unused local.
11698 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11700 Fix slow cursor motion and scrolling in large buffers with
11701 selective display, like Org Mode buffers. (Bug#9218)
11703 * dispextern.h (struct bidi_it): New member disp_prop_p.
11705 * xdisp.c: Remove one-slot cache of display string positions.
11706 (compute_display_string_pos): Accept an additional argument
11707 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11708 for a display string or property. If found, set DISP_PROP_P
11711 * bidi.c (bidi_fetch_char): Accept an additional argument
11712 DISP_PROP_P, and pass it to compute_display_string_pos.
11713 Only handle text covered by a display string if DISP_PROP_P is returned
11714 non-zero. All callers of bidi_fetch_char changed.
11716 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11718 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11720 2010-12-03 Don March <don@ohspite.net>
11722 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11723 last character M-[char] is translated to ESC [char] (bug#7541).
11725 2011-08-02 Kenichi Handa <handa@m17n.org>
11727 * lisp.h (uniprop_table): Extern it.
11729 * chartab.c (uniprop_table): Make it non-static.
11731 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11733 * xdisp.c (forward_to_next_line_start): Accept additional argument
11734 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11736 (reseat_at_next_visible_line_start): Use the bidi iterator state
11737 returned by forward_to_next_line_start to restore the state of
11738 it->bidi_it after backing up to previous newline. (Bug#9212)
11740 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11742 * regex.c (re_comp): Protoize.
11743 (re_exec): Fix return type.
11744 (regexec): Fix type of `ret'. (Bug#9203)
11746 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11748 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11749 This is needed if max-image-size is a floating-point number.
11751 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11753 * print.c (print_object): Print empty symbol as ##.
11755 * lread.c (read1): Read ## as empty symbol.
11757 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11759 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11760 setting frame foreground color (Bug#9175).
11761 (x_set_background_color): Likewise.
11763 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11764 contents (Bug#9176).
11765 (EmacsTooltip -init): Remove bezels and add shadows to
11768 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11769 or scroll bar (Bug#8470).
11771 * nsfont.m (nsfont_open): Remove assignment to voffset and
11772 unnecessary vars hshink, expand, hd, full_height, min_height.
11773 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11775 * nsterm.h (nsfont_info): Remove voffset field.
11777 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11779 Implement strike-through and overline on NextStep (Bug#8863).
11781 * nsfont.m (nsfont_open): Use underline position provided by font,
11782 instead of hard-coded value of 2.
11783 (nsfont_draw): Call ns_draw_text_decoration instead.
11785 * nsterm.h: Add declaration for ns_draw_text_decoration.
11787 * nsterm.m (ns_draw_text_decoration): New function for drawing
11788 underline, overline, and strike-through.
11789 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11790 ns_draw_text_decoration. Change treatment of cursor drawing to
11791 accommodate underlining, etc.
11793 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11795 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11798 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11800 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11801 Without this fix, if a signal arrives just after memory fills up,
11802 'malloc' might be invoked reentrantly.
11804 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11805 In other words, assume that every image size is allowed, on non-X
11806 hosts. This assumption is probably wrong, but it lets Emacs compile.
11808 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11810 * regex.c (re_iswctype): Convert return values to boolean.
11812 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11814 * xdisp.c (compute_display_string_pos): Don't use cached display
11815 string position if the buffer had its restriction changed.
11818 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11820 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11822 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11824 Integer signedness and overflow and related fixes. (Bug#9079)
11826 * bidi.c: Integer size and overflow fixes.
11827 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11828 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11829 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11830 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11831 (bidi_find_other_level_edge):
11832 Use ptrdiff_t instead of EMACS_INT where either will do.
11833 This works better on 32-bit hosts configured --with-wide-int.
11834 (bidi_cache_ensure_space): Check for size-calculation overflow.
11835 Use % rather than repeated addition, for better worst-case speed.
11836 Don't set bidi_cache_size until after xrealloc returns, because it
11838 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11839 (bidi_cache_ensure_space): Also check that the bidi cache size
11840 does not exceed that of the largest Lisp string or buffer. See Eli
11841 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11843 * alloc.c (__malloc_size_t): Remove.
11844 All uses replaced by size_t. See Andreas Schwab's note
11845 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11847 * image.c: Improve checking for integer overflow.
11848 (check_image_size): Assume that f is nonnull, since
11849 it is always nonnull in practice. This is one less thing to
11850 worry about when checking for integer overflow later.
11851 (x_check_image_size): New function, which checks for integer
11852 overflow issues inside X.
11853 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11854 This removes the need for a memory_full check.
11855 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11856 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11857 (xbm_read_bitmap_data): Change locals back to 'int', since
11858 their values must fit in 'int'.
11859 (xpm_load_image, png_load, tiff_load):
11860 Invoke x_create_x_image_and_pixmap earlier,
11861 to avoid much needless work if the image is too large.
11862 (tiff_load): Treat overly large images as if
11863 x_create_x_image_and_pixmap failed, not as malloc failures.
11864 (gs_load): Use x_check_image_size.
11866 * gtkutil.c: Omit integer casts.
11867 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11868 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11870 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11872 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11873 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11874 would wrongly return t on a 64-bit host.
11876 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11877 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11878 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11879 and therefore cause GCC to emit a bogus diagnostic in some cases.
11881 * image.c: Integer signedness and overflow and related fixes.
11882 This is not an exhaustive set of fixes, but it's time to
11883 record what I've got.
11884 (lookup_pixel_color, check_image_size): Remove redundant decls.
11885 (check_image_size): Don't assume that arbitrary EMACS_INT values
11886 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11887 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11888 (tiff_load, imagemagick_load_image):
11889 Check for overflow in size calculations.
11890 (x_create_x_image_and_pixmap): Remove unnecessary test for
11891 xmalloc returning NULL; that can't happen.
11892 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11893 (xpm_color_bucket): Use better integer hashing function.
11894 (xpm_cache_color): Don't possibly over-allocate memory.
11895 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11896 (gif_memory_source):
11897 Use ptrdiff_t, not int or size_t, to record sizes.
11898 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11899 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11900 either works, as we prefer signed integers.
11901 (tiff_read_from_memory, tiff_write_from_memory):
11902 Return tsize_t, not size_t, since that's what the TIFF API wants.
11903 (tiff_read_from_memory): Don't fail simply because the read would
11904 go past EOF; instead, return a short read.
11905 (tiff_load): Omit no-longer-needed casts.
11906 (Fimagemagick_types): Don't assume size fits into 'int'.
11908 Improve hashing quality when configured --with-wide-int.
11909 * fns.c (hash_string): New function, taken from sxhash_string.
11910 Do not discard information about ASCII character case; this
11911 discarding is no longer needed.
11912 (sxhash-string): Use it. Change sig to match it. Caller changed.
11913 * lisp.h: Declare it.
11914 * lread.c (hash_string): Remove, since we now use fns.c's version.
11915 The fns.c version returns a wider integer if --with-wide-int is
11916 specified, so this should help the quality of the hashing a bit.
11918 * emacs.c: Integer overflow minor fix.
11919 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11920 Define only if GNU_LINUX.
11921 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11923 * dispnew.c: Integer signedness and overflow fixes.
11924 Remove unnecessary forward decls, that were a maintenance hassle.
11925 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11927 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11928 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11929 (prepare_desired_row, line_draw_cost):
11930 Use int, not unsigned, where either works.
11931 (save_current_matrix, restore_current_matrix):
11932 Use ptrdiff_t, not size_t, where either works.
11933 (init_display): Check for overflow more accurately, and without
11934 relying on undefined behavior.
11936 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11937 Remove, replacing with the new symbols in lisp.h. All uses changed.
11938 * fileio.c (make_temp_name):
11939 * filelock.c (lock_file_1, lock_file):
11940 * xdisp.c (message_dolog):
11941 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11942 Use pMd etc. instead.
11943 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11944 replacing the pWIDE etc. symbols removed from editfns.c.
11946 * keyboard.h (num_input_events): Now uintmax_t.
11947 This is (very slightly) less likely to mess up due to wraparound.
11950 * buffer.c: Integer signedness fixes.
11951 (alloc_buffer_text, enlarge_buffer_text):
11952 Use ptrdiff_t rather than size_t when either will do, as we prefer
11955 * alloc.c: Integer signedness and overflow fixes.
11956 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11957 (__malloc_size_t): Default to size_t, not to int.
11958 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11959 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11960 Prefer ptrdiff_t to size_t when either would do, as we prefer
11962 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11963 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11964 Now const. Initialize with values that are in range even if char
11966 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11967 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11968 These functions do the right thing with sizes > 2**32.
11969 (check_depth): Now ptrdiff_t, not int.
11970 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11971 Adjust to new way of storing sizes. Check for size overflow bugs
11973 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11974 slightly wrong anyway, as it missed one instance of
11975 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11976 (refill_memory_reserve): Omit needless cast to size_t.
11977 (mark_object_loop_halt): Mark as externally visible.
11979 * xselect.c: Integer signedness and overflow fixes.
11980 (Fx_register_dnd_atom, x_handle_dnd_message):
11981 Use ptrdiff_t, not size_t, since we prefer signed.
11982 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11983 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11984 x_dnd_atoms_size and x_dnd_atoms_length.
11986 * doprnt.c: Prefer signed to unsigned when either works.
11988 * doprnt.c (doprnt):
11990 * xdisp.c (vmessage):
11991 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11992 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11993 prefer signed arithmetic to avoid comparison confusion.
11994 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11995 but is a bit tricky.
11997 Assume freestanding C89 headers, string.h, stdlib.h.
11998 * data.c, doprnt.c, floatfns.c, print.c:
11999 Include float.h unconditionally.
12000 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12001 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12002 * regex.c: Likewise for stddef.h, string.h.
12003 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12004 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12005 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12006 (STDC_HEADERS): Remove obsolete defines.
12007 * sysdep.c: Include limits.h unconditionally.
12009 Assume support for memcmp, memcpy, memmove, memset.
12010 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12011 * regex.c (memcmp, memcpy):
12012 Remove; we assume C89 now.
12014 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12015 (__malloc_safe_bcopy): Remove; no longer needed.
12017 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12018 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12019 well either way, and we prefer signed to unsigned.
12021 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12023 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12024 closes the connection while we're reading (bug#9182).
12026 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12028 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12029 are specified (Bug#9168).
12031 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12033 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12034 Found by GCC static checking and --with-wide-int on a 32-bit host.
12036 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12038 * xdisp.c (compute_display_string_pos): Fix logic of caching
12039 previous display string position. Initialize cached_prev_pos to
12040 -1. Fixes slow-down at the beginning of a buffer.
12042 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12044 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12045 for attrs[LFACE_FONTSET_INDEX].
12047 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12049 * xml.c (parse_region): Remove unused local
12050 that was recently introduced.
12052 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12054 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12055 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12057 * xdisp.c (move_it_in_display_line_to): Record the best matching
12058 position for TO_CHARPOS while scanning the line, and restore it on
12059 exit if none of the characters scanned was an exact match.
12060 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12061 when exact match is impossible due to invisible text, and the
12062 lines are truncated.
12064 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12066 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12069 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12071 Fix a significant slow-down of cursor motion with C-n, C-p,
12072 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12073 auto-repeat under bidi redisplay in fontified buffers.
12074 * xdisp.c (compute_stop_pos_backwards): New function.
12075 (next_element_from_buffer): Call compute_stop_pos_backwards to
12076 find a suitable prev_stop when we find ourselves before
12078 (reseat): Don't look for prev_stop, as that could mean a very long
12080 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12081 <cached_disp_overlay_modiff>: Cache for last found display string
12083 (compute_display_string_pos): Return the cached position if asked
12084 about the same buffer in the same area of character positions, and
12085 the buffer wasn't changed since the time the display string
12086 position was cached.
12088 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12090 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12091 is an integer, which is important for empty lines. (Bug#9149)
12093 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
12095 * frame.c (Fmodify_frame_parameters): In tty case, update the
12096 default face if necessary (Bug#4238).
12098 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
12100 * editfns.c (Fstring_to_char): No need to explain what a character
12101 is in the docstring (Bug#6576).
12103 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12105 * xml.c (parse_region): Make sure we always return a tree.
12107 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12109 * xml.c (parse_region): If a document contains only comments,
12112 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12114 * xml.c (make_dom): Return comments, too.
12116 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12119 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12120 and the surrounding thread.
12121 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12122 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12123 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12125 * s/openbsd.h (BROKEN_SIGIO): Define.
12126 * unexelf.c (unexec) [__OpenBSD__]:
12127 Don't update the .mdebug section of the Alpha COFF symbol table.
12129 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12131 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12134 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12136 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12137 This fixes some race conditions on the permissions of any newly
12140 * alloc.c (valid_pointer_p): Use pipe, not open.
12141 This fixes some permissions issues when debugging.
12143 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12144 If fchown fails to set both uid and gid, try to set just gid,
12145 as that is sometimes allowed. Adjust the file's mode to eliminate
12146 setuid or setgid bits that are inappropriate if fchown fails.
12148 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12150 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12151 to compare Lisp_Objects.
12152 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12153 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12154 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12156 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12158 * lread.c (read_integer): Unread even EOF character.
12159 (read1): Likewise. Properly record start position of symbol.
12161 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12162 symbol character follows.
12164 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12166 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12167 This works around a problem with the previous change to Fcopy_file.
12168 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12169 and without this change, GCC might complain about discarding
12170 fchown's return value.
12172 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
12174 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12176 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12178 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12180 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12182 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12183 it's used from the C level.
12185 * process.c: Use the same condition for POLL_FOR_INPUT in both
12186 keyboard.c and process.c (bug#1858).
12188 2011-07-09 Lawrence Mitchell <wence@gmx.li>
12190 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12191 (Fgnutls_boot): Use it.
12193 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12195 * doc.c (Fsubstitute_command_keys): Revert last change.
12197 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12199 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12200 quotes the next character, and doesn't affect other longer
12201 sequences (bug#8935).
12203 * lread.c (syms_of_lread): Clarify that is isn't only
12204 `eval-buffer' and `eval-defun' that's affected by
12205 `lexical-binding' (bug#8460).
12207 2011-07-15 Eli Zaretskii <eliz@gnu.org>
12209 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12210 bidi redisplay when a line includes both an image and is truncated.
12212 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12214 Fix minor problems found by static checking.
12215 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12216 (elsz): Now a signed constant, not a size_t var. We prefer signed
12217 types to unsigned, to avoid integer comparison confusion. Without
12218 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12219 "cannot optimize loop, the loop counter may overflow", a symptom
12221 * indent.c (Fvertical_motion): Mark locals as initialized.
12222 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12224 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12226 * search.c (Fre_search_backward): Mention `case-fold-search' in
12227 all the re_search_* functions (bug#8138).
12229 * keyboard.c (Fopen_dribble_file): Document when the file is
12232 2011-07-14 Eli Zaretskii <eliz@gnu.org>
12234 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12237 Support bidi reordering of display and overlay strings.
12238 * xdisp.c (compute_display_string_pos)
12239 (compute_display_string_end): Accept additional argument STRING.
12240 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12241 (reseat_to_string): Initialize bidi_it->string.s and
12242 bidi_it->string.schars.
12243 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12244 NULL (avoids a crash in bidi_paragraph_init).
12245 Initialize itb.string.lstring.
12246 (init_iterator): Call bidi_init_it only of a valid
12247 buffer position was specified. Initialize paragraph_embedding to
12249 (reseat_to_string): Initialize the bidi iterator.
12250 (display_string): If we need to ignore text properties of
12251 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12252 original value of -1 will not work with bidi.)
12253 (compute_display_string_pos): First arg is now struct
12254 `text_pos *'; all callers changed. Support display properties on
12256 (compute_display_string_end): Support display properties on Lisp
12258 (init_iterator, reseat_1, reseat_to_string): Initialize the
12259 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12260 when iterating on a string not from display properties).
12261 (compute_display_string_pos, compute_display_string_end):
12262 Fix calculation of the object to scan. Fixes an error when using
12264 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12265 base_level_stop; instead, set base_level_stop to BEGV.
12266 Fixes crashes in vertical-motion.
12267 (next_element_from_buffer): Improve commentary for when
12268 the iterator is before prev_stop.
12269 (init_iterator): Initialize bidi_p from the default value of
12270 bidi-display-reordering, not from buffer-local value. Use the
12271 buffer-local value only if initializing for buffer iteration.
12272 (handle_invisible_prop): Support invisible properties on strings
12273 that are being bidi-reordered.
12274 (set_iterator_to_next): Support bidi reordering of C strings and
12276 (next_element_from_string): Support bidi reordering of Lisp
12278 (handle_stop_backwards): Support Lisp strings as well.
12279 (display_string): Support display of R2L glyph rows.
12280 Use IT_STRING_CHARPOS when displaying from a Lisp string.
12281 (init_iterator): Don't initialize it->bidi_p for strings
12283 (reseat_to_string): Initialize it->bidi_p for strings here.
12284 (next_element_from_string, next_element_from_c_string)
12285 (next_element_from_buffer): Add xassert's for correspondence
12286 between IT's object being iterated and it->bidi_it.string
12288 (face_before_or_after_it_pos): Support bidi iteration.
12289 (next_element_from_c_string): Handle the case of the first string
12290 character that is not the first one in the visual order.
12291 (get_visually_first_element): New function, refactored from common
12292 parts of next_element_from_buffer, next_element_from_string, and
12293 next_element_from_c_string.
12294 (tool_bar_lines_needed, redisplay_tool_bar)
12295 (display_menu_bar): Force left-to-right direction. Add a FIXME
12296 comment for making that be controlled by a user option.
12297 (push_it, pop_it): Save and restore the state of the
12298 bidi iterator. Save and restore the bidi_p flag.
12299 (pop_it): Iterate out of display property for string iteration as
12301 (iterate_out_of_display_property): Support iteration over strings.
12302 (handle_single_display_spec): Set up it->bidi_it for iteration
12303 over a display string, and call bidi_init_it.
12304 (handle_single_display_spec, next_overlay_string)
12305 (get_overlay_strings_1, push_display_prop): Set up the bidi
12306 iterator for displaying display or overlay strings.
12307 (forward_to_next_line_start): Don't use the shortcut if
12309 (back_to_previous_visible_line_start): If handle_display_prop
12310 pushed the iterator stack, restore the internal state of the bidi
12311 iterator by calling bidi_pop_it same number of times.
12312 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12313 and we are bidi-iterating, don't decrement the iterator position;
12314 instead, set the first_elt flag in the bidi iterator, to produce
12316 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12317 (push_display_prop): xassert that we are iterating a buffer.
12318 (push_it, pop_it): Save and restore paragraph_embedding member.
12319 (handle_single_display_spec, next_overlay_string)
12320 (get_overlay_strings_1, reseat_1, reseat_to_string)
12321 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12322 correctly. Don't assume unibyte strings are not bidi-reordered.
12323 (compute_display_string_pos)
12324 (compute_display_string_end): Fix handling the case of C string.
12325 (push_it, pop_it): Save and restore from_disp_prop_p.
12326 (handle_single_display_spec, push_display_prop): Set the
12327 from_disp_prop_p flag.
12328 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12329 (pop_it): Call iterate_out_of_display_property only if we are
12330 popping after iteration over a string that came from a display
12331 property. Fix a typo in popping stretch info. Add an assertion
12332 for verifying that the iterator position is in sync with the bidi
12334 (handle_single_display_spec, get_overlay_strings_1)
12335 (push_display_prop): Fix initialization of paragraph direction for
12336 string when that of the parent object is not yet determined.
12337 (reseat_1): Call bidi_init_it to resync the bidi
12338 iterator with IT's position. (Bug#7616)
12339 (find_row_edges): If ROW->start.pos gives position
12340 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12341 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12342 Reset the from_disp_prop_p flag.
12343 (SAVE_IT, RESTORE_IT): New macros.
12344 (pos_visible_p, face_before_or_after_it_pos)
12345 (back_to_previous_visible_line_start)
12346 (move_it_in_display_line_to, move_it_in_display_line)
12347 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12348 (try_scrolling, redisplay_window, display_line): Use them when
12349 saving a temporary copy of the iterator and restoring it back.
12350 (back_to_previous_visible_line_start, reseat_1)
12351 (init_iterator): Empty the bidi cache "stack".
12352 (move_it_in_display_line_to): If iterator ended up at
12353 EOL, but we never saw any buffer positions smaller than
12354 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12355 motion in bidi-reordered lines.
12356 (move_it_in_display_line_to): Record prev_method and prev_pos
12357 immediately before the call to set_iterator_to_next. Fixes cursor
12358 motion in bidi-reordered lines with stretch glyphs and strings
12359 displayed in margins. (Bug#8133) (Bug#8867)
12360 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12362 (pos_visible_p): Support positions in bidi-reordered lines.
12363 Save and restore bidi cache.
12365 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12366 (bidi_paragraph_info): Delete unused struct.
12367 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12368 (bidi_cache_start): New variable.
12369 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12371 (bidi_cache_fetch_state, bidi_cache_search)
12372 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12373 (bidi_cache_find, bidi_peek_at_next_level)
12374 (bidi_level_of_next_char, bidi_find_other_level_edge)
12375 (bidi_move_to_visually_next): Compare cache index with
12376 bidi_cache_start rather than with zero.
12377 (bidi_fetch_char): Accept new argument STRING; all callers
12378 changed. Support iteration over a string. Support strings with
12379 display properties. Support unibyte strings. Fix the type of
12380 `len' according to what STRING_CHAR_AND_LENGTH expects.
12381 (bidi_paragraph_init, bidi_resolve_explicit_1)
12382 (bidi_resolve_explicit, bidi_resolve_weak)
12383 (bidi_level_of_next_char, bidi_move_to_visually_next):
12384 Support iteration over a string.
12385 (bidi_set_sor_type, bidi_resolve_explicit_1)
12386 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12387 can now be zero (for strings); special values 0 and -1 were
12388 changed to -1 and -2, respectively.
12389 (bidi_char_at_pos): New function.
12390 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12391 Call it instead of FETCH_MULTIBYTE_CHAR.
12392 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12393 initialized to valid values.
12394 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12396 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12397 the test for valid cached positions. Fix the logic for looking up
12398 the sentinel state in the cache. GCPRO the Lisp string we are
12400 (bidi_push_it, bidi_pop_it): New functions.
12401 (bidi_initialize): Initialize the bidi cache start stack pointer.
12402 (bidi_cache_ensure_space): New function, refactored from part of
12403 bidi_cache_iterator_state. Don't assume the required size is just
12404 one BIDI_CACHE_CHUNK away.
12405 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12406 (bidi_count_bytes, bidi_char_at_pos): New functions.
12407 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12408 always valid if bidi_cache_idx is valid.
12409 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12410 is valid if it's going to be used.
12411 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12412 (bidi_cache_fetch_state, bidi_cache_search)
12413 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12414 (bidi_cache_iterator_state, bidi_cache_find)
12415 (bidi_find_other_level_edge, bidi_cache_start_stack):
12416 All variables related to cache indices are now EMACS_INT.
12418 * dispextern.h (struct bidi_string_data): New structure.
12419 (struct bidi_it): New member `string'. Make flag members be 1-bit
12420 fields, and put them last in the struct.
12421 (compute_display_string_pos, compute_display_string_end):
12423 (bidi_push_it, bidi_pop_it): Add prototypes.
12424 (struct iterator_stack_entry): New members bidi_p,
12425 paragraph_embedding, and from_disp_prop_p.
12426 (struct it): Member bidi_p is now a bit field 1 bit wide.
12427 (bidi_shelve_cache, bidi_unshelve_cache):
12428 Declare prototypes.
12430 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12431 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12432 and vector-like objects.
12434 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12435 cache around display iteration.
12437 * window.c (Fwindow_end, window_scroll_pixel_based)
12438 (displayed_window_lines, Frecenter): Save and restore the bidi
12439 cache around display iteration.
12441 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12443 * editfns.c (Fdelete_region): Clarify the use of the named
12444 parameters (bug#6788).
12446 2011-07-14 Martin Rudalics <rudalics@gmx.at>
12448 * indent.c (Fvertical_motion): Set and restore w->pointm when
12449 saving and restoring the window's buffer (Bug#9006).
12451 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12453 * editfns.c (Fstring_to_char): Clarify just what is returned
12454 (bug#6576). Text by Eli Zaretskii.
12456 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
12458 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12460 2011-07-13 Eli Zaretskii <eliz@gnu.org>
12462 * buffer.c (mmap_find): Fix a typo.
12464 2011-07-13 Johan Bockgård <bojohan@gnu.org>
12466 Fix execution of x selection hooks.
12467 * xselect.c (Qx_lost_selection_functions)
12468 (Qx_sent_selection_functions): New vars.
12469 (syms_of_xselect): DEFSYM them.
12470 (x_handle_selection_request): Pass Qx_sent_selection_functions
12471 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12472 (x_handle_selection_clear,x_clear_frame_selections):
12473 Pass Qx_lost_selection_functions rather than
12474 Vx_lost_selection_functions to Frun_hook_with_args.
12476 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12478 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12479 The old code sometimes used this field without initializing it.
12481 * alloc.c (gc_sweep): Don't read past end of array.
12482 In theory, the old code could also have corrupted Emacs internals,
12483 though it'd be very unlikely.
12485 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12487 * character.c (Fcharacterp): Don't advertise optional ignored
12488 argument. (Bug#4026)
12490 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12492 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12495 * window.c (Fset_window_start): Doc fix (bug#4199).
12496 (Fset_window_hscroll): Ditto.
12498 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12500 Fix minor new problems caught by GCC 4.6.1.
12501 * term.c (init_tty): Remove unused local.
12502 * xsettings.c (store_monospaced_changed): Define this function only
12503 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12504 not used otherwise.
12506 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
12508 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12510 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12512 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12513 are the mini-buffer and the echo area (bug#3320).
12515 * term.c (init_tty): Remove support for supdup, c10 and perq
12516 terminals, which are no longer supported (bug#1482).
12518 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12520 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12522 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12524 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12525 for non-popups (Bug#3642).
12527 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12529 * alloc.c (reset_malloc_hooks): Protoize.
12530 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12531 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12532 * cm.c (losecursor): Likewise.
12533 * data.c (fmod): Likewise.
12534 * dispnew.c (swap_glyphs_in_rows): Likewise.
12535 * emacs.c (memory_warning_signal): Likewise.
12536 * floatfns.c (float_error): Likewise.
12537 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12538 (otf_open, font_otf_capability, generate_otf_features)
12539 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12541 * image.c (pbm_read_file): Likewise.
12542 * indent.c (string_display_width): Likewise.
12543 * intervals.c (check_for_interval, search_for_interval)
12544 (inc_interval_count, count_intervals, root_interval)
12545 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12546 * lread.c (defalias): Likewise.
12547 * ralloc.c (r_alloc_check): Likewise.
12548 * regex.c (set_image_of_range_1, set_image_of_range)
12549 (regex_grow_registers): Likewise.
12550 * sysdep.c (strerror): Likewise.
12551 * termcap.c (valid_filename_p, tprint, main): Likewise.
12552 * tparam.c (main): Likewise.
12553 * unexhp9k800.c (run_time_remap, save_data_space)
12554 (update_file_ptrs, read_header, write_header, calculate_checksum)
12555 (copy_file, copy_rest, display_header): Likewise.
12556 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12558 * xdisp.c (check_it): Likewise.
12559 * xfaces.c (register_color, unregister_color, unregister_colors):
12561 * xfns.c (print_fontset_result): Likewise.
12562 * xrdb.c (member, fatal, main): Likewise.
12564 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12566 Fix minor problems found by static checking (Bug#9031).
12567 * chartab.c (char_table_set_range, map_sub_char_table):
12568 Remove unused locals.
12569 (uniprop_table): Now static.
12570 * composite.c (_work_char): Remove unused static var.
12572 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12574 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12576 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12578 * gtkutil.c (qttip_cb): Remove code without function.
12580 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12582 * w32.c (pthread_sigmask): New stub.
12584 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12586 Use pthread_sigmask, not sigprocmask (Bug#9010).
12587 sigprocmask is portable only for single-threaded applications, and
12588 Emacs can be multi-threaded when it uses GTK.
12589 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12591 * callproc.c (Fcall_process):
12592 * process.c (create_process):
12593 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12594 Use pthread_sigmask, not sigprocmask.
12596 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12598 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12599 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12602 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12604 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12605 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12606 (xg_hide_tooltip): Fix comment.
12608 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12609 in registerServicesMenuSendTypes.
12610 (validRequestorForSendType): Don't check ns_return_types.
12612 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12615 2011-07-08 Jason Rumney <jasonr@gnu.org>
12617 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12618 SH_SHOW for hidden windows (Bug#5482).
12620 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12621 frame struct members of non-existent frames (Bug#6284).
12623 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12625 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12626 variable firstTime not needed on OSX >= 10.6.
12627 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12628 >= 10.5. Use setKnobProportion, setDoubleValue.
12630 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12631 (MAC_OS_X_VERSION_10_5): Define if not defined.
12632 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12633 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12634 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12636 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12637 cString and lossyCString on OSX >= 10.4.
12639 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12640 sizeToFit on OSX >= 10.2.
12642 * nsimage.m (allocInitFromFile): Don't use deprecated method
12643 bestRepresentationForDevice on OSX >= 10.6.
12645 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12648 * emacs.c: Declare unexec_init_emacs_zone.
12650 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12652 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12654 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12655 on svcsMenu (Bug#8842).
12657 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12659 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12661 * nsterm.m (QUTF8_STRING): Declare.
12662 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12663 (validRequestorForSendType): Return type is (id).
12664 Change indexOfObjectIdenticalTo to indexOfObject.
12665 Check if we have local selection before returning self (Bug#8842).
12666 (writeSelectionToPasteboard): Put local selection into paste board
12667 if we have a local selection (Bug#8842).
12668 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12670 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12671 (ns_get_local_selection): Declare.
12673 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12675 * keymap.c (describe_map_tree): Don't insert a double newline at
12676 the end of the buffer (bug#1169) and return whether we inserted
12679 * callint.c (Fcall_interactively): Change "reading args" to
12680 "providing args" to try to clarify what it does (bug#1010).
12682 2011-07-07 Kenichi Handa <handa@m17n.org>
12684 * composite.c (composition_compute_stop_pos): Ignore a static
12685 composition starting before CHARPOS (Bug#8915).
12687 * xdisp.c (handle_composition_prop): Likewise.
12689 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12691 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12694 2011-07-07 Kenichi Handa <handa@m17n.org>
12696 * character.h (unicode_category_t): New enum type.
12698 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12699 (Qchar_code_property_table): New variable.
12700 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12701 (UNIPROP_COMPRESSED_FORM_P): New macros.
12702 (char_table_ascii): Uncompress the compressed values.
12703 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12704 Uncompress the compressed values.
12705 (sub_char_table_ref_and_range): Likewise.
12706 (char_table_ref_and_range): Uncompress the compressed values.
12707 (sub_char_table_set): New arg is_uniprop. Callers changed.
12708 Uncompress the compressed values.
12709 (sub_char_table_set_range): Args changed. Callers changed.
12710 (char_table_set_range): Adjuted for the above change.
12711 (map_sub_char_table): Delete args default_val and parent. Add arg
12712 top. Give decoded values to a Lisp function.
12713 (map_char_table): Adjust for the above change. Give decoded
12714 values to a Lisp function. Gcpro more variables.
12715 (uniprop_table_uncompress)
12716 (uniprop_decode_value_run_length): New functions.
12717 (uniprop_decoder, uniprop_decoder_count): New variables.
12718 (uniprop_get_decoder, uniprop_encode_value_character)
12719 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12721 (uniprop_encoder, uniprop_encoder_count): New variables.
12722 (uniprop_get_encoder, uniprop_table)
12723 (Funicode_property_table_internal, Fget_unicode_property_internal)
12724 (Fput_unicode_property_internal): New functions.
12725 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12726 Sunicode_property_table_internal, Sget_unicode_property_internal,
12727 and Sput_unicode_property_internal. Defvar_lisp
12728 char-code-property-alist.
12730 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12731 Vunicode_category_table.
12733 * font.c (font_range): Adjust for the change of
12734 Vunicode_category_table.
12736 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12738 * m/iris4d.h: Remove file, move contents ...
12739 * s/irix6-5.h: ... here.
12741 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12743 Remove unportable assumption about struct layout (Bug#8884).
12744 * alloc.c (mark_buffer):
12745 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12746 (clone_per_buffer_values): Don't assume that
12747 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12748 This isn't true in general, and it's particularly not true
12749 if Emacs is configured with --with-wide-int.
12750 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12751 New macros, used in the buffer.c change.
12753 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12755 * xsettings.c: Use both GConf and GSettings if both are available.
12756 (store_config_changed_event): Add comment.
12757 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12758 (store_tool_bar_style_changed): New functions.
12759 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12760 (struct xsettings): Move font inside HAVE_XFT.
12761 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12762 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12763 Move inside HAVE_XFT.
12764 (something_changed_gsettingsCB): Rename from something_changedCB.
12765 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12767 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12768 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12769 (something_changed_gconfCB): Rename from something_changedCB.
12770 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12771 (parse_settings): Move check for font inside HAVE_XFT.
12772 (read_settings, apply_xft_settings): Add comment.
12773 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12774 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12775 call store_font_name_changed.
12776 (xft_settings_event): Add comment.
12777 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12778 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12779 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12780 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12781 (xsettings_initialize): Call init_gsettings last.
12782 (xsettings_get_system_font, xsettings_get_system_normal_font):
12785 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12787 Random fixes. E.g., (random) never returned negative values.
12788 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12789 subseconds part to the entropy, as that's a bit more random.
12790 Prefer signed to unsigned, since the signedness doesn't matter and
12791 in general we prefer signed. When given a limit, use a
12792 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12793 latter isn't right if USE_2_TAGS_FOR_INTS.
12794 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12795 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12797 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12799 * textprop.c (text_property_stickiness):
12800 Obey Vtext_property_default_nonsticky.
12801 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12802 * w32fns.c (syms_of_w32fns):
12803 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12805 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12807 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12808 This is more efficient than Ffile_directory_p and avoids a minor race.
12810 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12812 * buffer.c (Foverlay_put): Say what the return value is
12815 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12816 is a directory before asking whether to use the file name
12818 (barf_or_query_if_file_exists): Make the "File is a directory"
12819 error be more correct.
12821 * fns.c (Frequire): Remove the mention of the .gz files, since
12822 that's installation-specific, but keep the mention of
12823 `get-load-suffixes'.
12825 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12827 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12828 Report string overflow if the output is too long.
12830 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12832 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12833 (syms_of_gnutls): Remove duplicate DEFSYM for
12834 Qgnutls_bootprop_verify_hostname_error, an error for
12835 Qgnutls_bootprop_verify_error (which is no longer used).
12837 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12838 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12839 Also (re)move comments that are misplaced or no longer relevant.
12841 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12843 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12845 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12847 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12848 and background color parameters if they have been changed.
12850 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12852 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12854 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12856 * xsettings.c (SYSTEM_FONT): Define only when used.
12857 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12859 * keymap.c (access_keymap_1): Now static.
12861 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12863 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12864 leave any prefix arg for the up event (Bug#1586).
12866 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12868 * lread.c (syms_of_lread): Mention single symbols defined by
12869 `defvar' or `defconst' (bug#7154).
12871 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12872 (Frequire): Mention get-load-suffixes.
12874 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12876 * window.h (window): Remove clone_number slot.
12877 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12879 (make_parent_window, make_window, saved_window)
12880 (Fset_window_configuration, save_window_save): Don't deal with
12882 * buffer.c (Qclone_number): Remove declaration.
12883 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12885 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12887 Add multiple inheritance to keymaps.
12888 * keymap.c (Fmake_composed_keymap): New function.
12889 (Fset_keymap_parent): Simplify.
12890 (fix_submap_inheritance): Remove.
12891 (access_keymap_1): New function extracted from access_keymap to handle
12892 embedded parents and handle lists of maps.
12893 (access_keymap): Use it.
12894 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12895 (Fcopy_keymap): Handle embedded parents.
12896 (Fcommand_remapping, define_as_prefix): Simplify.
12897 (Fkey_binding): Simplify.
12898 (syms_of_keymap): Move minibuffer-local-completion-map,
12899 minibuffer-local-filename-completion-map,
12900 minibuffer-local-must-match-map, and
12901 minibuffer-local-filename-must-match-map to Elisp.
12902 (syms_of_keymap): Defsubr make-composed-keymap.
12903 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12904 (parse_menu_item): Trivial simplification.
12906 2011-07-01 Glenn Morris <rgm@gnu.org>
12908 * Makefile.in (SETTINGS_LIBS): Fix typo.
12910 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12912 * coding.c (Fencode_coding_string): Record the last coding system
12913 used, as the function doc string says (bug#8738).
12915 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12917 * xsettings.c (store_monospaced_changed): Take new font as arg and
12918 check for change against current_mono_font.
12919 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12920 (emacs_settings_constructor, emacs_settings_get_property)
12921 (emacs_settings_set_property, emacs_settings_class_init)
12922 (emacs_settings_init, gsettings_obj): Remove.
12923 (something_changedCB): New function for HAVE_GSETTINGS.
12924 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12925 with value as argument.
12926 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12927 g_settings_new (Bug#8967). Do not create gsettings_obj.
12928 Remove calls to g_settings_bind. Connect something_changedCB to
12931 * xgselect.c: Add defined (HAVE_GSETTINGS).
12932 (xgselect_initialize): Ditto.
12934 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12935 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12938 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12940 * eval.c (struct backtrace): Simplify and port the data structure.
12941 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12942 signed bit field, as this assumption is not portable and it makes
12943 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12944 "char debug_on_exit : 1" as this is not portable either; instead,
12945 use the portable "unsigned int debug_on_exit : 1". Remove unused
12946 member evalargs. Remove obsolete comments about cc bombing out.
12948 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12950 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12951 Let HAVE_GSETTINGS override HAVE_GCONF.
12952 (store_monospaced_changed): New function.
12953 (EMACS_SETTINGS): A new type derived from GObject to handle
12954 GSettings notifications.
12955 (emacs_settings_constructor, emacs_settings_get_property)
12956 (emacs_settings_set_property, emacs_settings_class_init):
12958 (gsettings_client, gsettings_obj): New variables.
12959 (GSETTINGS_SCHEMA): New define.
12960 (something_changedCB): Call store_monospaced_changed.
12961 (init_gsettings): New function.
12962 (xsettings_initialize): Call init_gsettings.
12963 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12966 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12969 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12971 * window.c (resize_root_window, grow_mini_window)
12972 (shrink_mini_window): Rename Qresize_root_window to
12973 Qwindow_resize_root_window and Qresize_root_window_vertically to
12974 Qwindow_resize_root_window_vertically.
12976 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12978 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12980 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12982 * makefile.w32-in: Redesign dependencies so they reflect more
12983 clearly which files are directly included by each source file,
12984 and not through other includes.
12986 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12988 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12989 (sort_overlays, overlay_strings): When an overlay's clone number
12990 matches the window's clone number process the overlay even if
12991 the overlay's window property doesn't match the current window.
12993 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12994 (Fwindow_hchild): Rename to Fwindow_left_child.
12995 (Fwindow_next): Rename to Fwindow_next_sibling.
12996 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12997 (resize_window_check): Rename to window_resize_check.
12998 (resize_window_apply): Rename to window_resize_apply.
12999 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13000 (Fdelete_other_windows_internal, resize_frame_windows)
13001 (Fsplit_window_internal, Fdelete_window_internal)
13002 (grow_mini_window, shrink_mini_window)
13003 (Fresize_mini_window_internal): Fix callers accordingly.
13005 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13007 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13008 (emacs_fixed_set_min_size): Remove.
13009 (emacs_fixed_new): Take frame as argument.
13011 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13012 (_EmacsFixedPrivate): Remove minwidth/height.
13013 Add struct frame *f.
13014 (emacs_fixed_init): Initialize priv->f.
13015 (get_parent_class, emacs_fixed_set_min_size): Remove.
13016 (emacs_fixed_new): Set priv->f to argument.
13017 (emacs_fixed_get_preferred_width)
13018 (emacs_fixed_get_preferred_height): Use min_width/height from
13019 frames size_hint to set minimum and natural (Bug#8919).
13020 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13021 and use min_width/height from frames size_hint to set
13022 min_width/height (Bug#8919).
13024 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13025 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13028 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13030 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13031 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13034 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13036 * process.c (wait_reading_process_output): Bypass select if
13037 waiting for a cell while ignoring keyboard input, and input is
13038 pending. Suggested by Jan Djärv (Bug#8869).
13040 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13042 Use gnulib's dup2 module instead of rolling our own.
13043 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13045 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13047 * dispnew.c (scrolling_window): Before scrolling, turn off a
13048 mouse-highlight in the window being scrolled.
13050 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13052 Move DEFSYM to lisp.h and use everywhere.
13054 * character.h (DEFSYM): Move declaration...
13055 * lisp.h (DEFSYM): ...here.
13061 * w32select.c: Don't include character.h.
13063 * alloc.c (syms_of_alloc):
13064 * buffer.c (syms_of_buffer):
13065 * bytecode.c (syms_of_bytecode):
13066 * callint.c (syms_of_callint):
13067 * casefiddle.c (syms_of_casefiddle):
13068 * casetab.c (init_casetab_once):
13069 * category.c (init_category_once, syms_of_category):
13070 * ccl.c (syms_of_ccl):
13071 * cmds.c (syms_of_cmds):
13072 * composite.c (syms_of_composite):
13073 * dbusbind.c (syms_of_dbusbind):
13074 * dired.c (syms_of_dired):
13075 * dispnew.c (syms_of_display):
13076 * doc.c (syms_of_doc):
13077 * editfns.c (syms_of_editfns):
13078 * emacs.c (syms_of_emacs):
13079 * eval.c (syms_of_eval):
13080 * fileio.c (syms_of_fileio):
13081 * fns.c (syms_of_fns):
13082 * frame.c (syms_of_frame):
13083 * fringe.c (syms_of_fringe):
13084 * insdel.c (syms_of_insdel):
13085 * keymap.c (syms_of_keymap):
13086 * lread.c (init_obarray, syms_of_lread):
13087 * macros.c (syms_of_macros):
13088 * msdos.c (syms_of_msdos):
13089 * print.c (syms_of_print):
13090 * process.c (syms_of_process):
13091 * search.c (syms_of_search):
13092 * sound.c (syms_of_sound):
13093 * syntax.c (init_syntax_once, syms_of_syntax):
13094 * terminal.c (syms_of_terminal):
13095 * textprop.c (syms_of_textprop):
13096 * undo.c (syms_of_undo):
13097 * w32.c (globals_of_w32):
13098 * window.c (syms_of_window):
13099 * xdisp.c (syms_of_xdisp):
13100 * xfaces.c (syms_of_xfaces):
13101 * xfns.c (syms_of_xfns):
13102 * xmenu.c (syms_of_xmenu):
13103 * xsettings.c (syms_of_xsettings):
13104 * xterm.c (syms_of_xterm): Use DEFSYM.
13106 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13108 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13110 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13112 Integer and buffer overflow fixes (Bug#8873).
13114 * print.c (printchar, strout): Check for string overflow.
13115 (PRINTPREPARE, printchar, strout):
13116 Don't set size unless allocation succeeds.
13118 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13119 for sizes. Check for string overflow more accurately.
13120 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13122 * macros.c: Integer and buffer overflow fixes.
13123 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13124 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13125 Use ptrdiff_t, not int, for sizes.
13126 Don't increment bufsize until after realloc succeeds.
13127 Check for size-calculation overflow.
13128 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13130 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13132 * lread.c: Integer overflow fixes.
13133 (read_integer): Radix is now EMACS_INT, not int,
13134 to improve quality of diagnostics for out-of-range radices.
13135 Calculate buffer size correctly for out-of-range radices.
13136 (read1): Check for integer overflow in radices, and in
13137 read-circle numbers.
13138 (read_escape): Avoid int overflow.
13139 (Fload, openp, read_buffer_size, read1)
13140 (substitute_object_recurse, read_vector, read_list, map_obarray):
13141 Use ptrdiff_t, not int, for sizes.
13142 (read1): Use EMACS_INT, not int, for sizes.
13143 Check for size overflow.
13145 * image.c (cache_image): Check for size arithmetic overflow.
13147 * lread.c: Integer overflow issues.
13148 (saved_doc_string_size, saved_doc_string_length)
13149 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13150 Now ptrdiff_t, not int.
13151 (read1): Don't assume doc string length fits in int. Check for
13152 out-of-range doc string lengths.
13153 (read_list): Don't assume file position fits in int.
13154 (read_escape): Check for hex character overflow.
13156 2011-06-22 Leo Liu <sdl.web@gmail.com>
13158 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13159 Move to minibuffer.el.
13161 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13163 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13164 The following patches are for when GLYPH_DEBUG && !XASSERT.
13165 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13166 * dispnew.c (flush_stdout):
13167 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13168 Mark as externally visible.
13169 * dispnew.c (check_window_matrix_pointers): Now static.
13170 * dispnew.c (window_to_frame_vpos):
13171 * xfns.c (unwind_create_frame):
13172 * xterm.c (x_check_font): Remove unused local.
13173 * scroll.c (CHECK_BOUNDS):
13174 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13175 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13176 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13177 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13178 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13180 (debug_method_add): Use va_list and vsprintf rather than relying
13181 on undefined behavior with wrong number of arguments.
13182 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13183 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13184 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13185 since we're not interested in debugging glyphs with old libraries.
13186 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13187 GCC 4.6.0's static checking.
13189 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13191 Integer overflow and signedness fixes (Bug#8873).
13192 A few related buffer overrun fixes, too.
13194 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13196 * dispextern.h (struct face.stipple):
13197 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13198 (x_bitmap_mask, x_allocate_bitmap_record)
13199 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13200 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13201 (x_create_bitmap_from_xpm_data):
13202 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13203 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13205 * xfaces.c (load_pixmap):
13206 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13207 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13208 (.bitmaps_last, struct x_output.icon_bitmap):
13209 Use ptrdiff_t, not int, for bitmap indexes.
13210 (x_allocate_bitmap_record): Check for size overflow.
13211 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13213 Use ptrdiff_t, not int, for overlay counts.
13214 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13215 * editfns.c (overlays_around, get_pos_property):
13216 * textprop.c (get_char_property_and_overlay):
13217 * xdisp.c (next_overlay_change, note_mouse_highlight):
13218 * xfaces.c (face_at_buffer_position):
13219 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13220 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13221 (Fnext_overlay_change, Fprevious_overlay_change)
13222 (mouse_face_overlay_overlaps, Foverlays_in):
13223 Use ptrdiff_t, not int, for sizes.
13224 (overlays_at, overlays_in): Check for size-calculation overflow.
13226 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13228 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13229 (x_session_initialize): Do not assume string length fits in int.
13231 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13232 This is unlikely, but can occur if DPI is outlandish.
13234 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13235 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13237 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13238 * xrdb.c (magic_file_p, search_magic_path):
13239 Omit last arg SUFFIX; it was always 0. All callers changed.
13240 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13242 * xfont.c (xfont_match): Avoid need for strlen.
13244 * xfns.c: Don't assume strlen fits in int.
13245 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13247 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13248 not unsigned long, as we prefer signed integers. All callers changed.
13249 Detect integer overflow in repeat count.
13250 (message_dolog): Don't assume print length fits in 39 bytes.
13251 (display_mode_element): Don't assume strlen fits in int.
13253 * termcap.c: Don't assume sizes fit in int and never overflow.
13254 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13255 (gobble_line): Check for size-calculation overflow.
13257 * minibuf.c (Fread_buffer):
13258 * lread.c (intern, intern_c_string):
13259 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13260 Don't assume string length fits in int.
13262 * keyboard.c (parse_tool_bar_item):
13263 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13265 * font.c: Don't assume string length fits in int.
13266 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13267 Use ptrdiff_t, not int.
13268 (font_intern_prop): Don't assume string length fits in int.
13269 Don't assume integer property fits in fixnum.
13270 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13272 * filelock.c: Fix some buffer overrun and integer overflow issues.
13273 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13274 Reformulate so as not to need the command string.
13275 Invoke gzip -cd rather than gunzip, as it's more portable.
13276 (lock_info_type, lock_file_1, lock_file):
13277 Don't assume pid_t and time_t fit in unsigned long.
13278 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13279 (current_lock_owner): Prefer signed type for sizes.
13280 Use memcpy, not strncpy, where memcpy is what is really wanted.
13281 Don't assume (via atoi) that time_t and pid_t fit in int.
13282 Check for time_t and/or pid_t out of range, e.g., via a network share.
13283 Don't alloca where an auto var works fine.
13285 * fileio.c: Fix some integer overflow issues.
13286 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13287 Don't assume string length fits in int.
13288 (directory_file_name): Don't assume string length fits in long.
13289 (make_temp_name): Don't assume pid fits in int, or that its print
13290 length is less than 20.
13292 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13294 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13296 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13298 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13299 We prefer signed integers, even for size calculations.
13301 * emacs.c: Don't assume string length fits in 'int'.
13302 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13303 (main): Don't invoke strlen when not needed.
13305 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13306 (XD_DEBUG_MESSAGE): Don't waste a byte.
13308 * callproc.c (getenv_internal_1, getenv_internal)
13309 (Fgetenv_internal):
13310 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13312 * lread.c (invalid_syntax): Omit length argument.
13313 All uses changed. This doesn't fix a bug, but it simplifies the
13314 code away from its former Hollerith-constant appearance, and it's
13315 one less 'int' to worry about when looking at integer-overflow issues.
13316 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13318 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13319 This didn't break anything, but it didn't help either.
13320 It's confusing to put a bogus integer in a place where the actual
13321 value does not matter.
13322 (LIST_END_P): Remove unused macro and its bogus comment.
13323 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13325 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13326 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13328 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13329 We prefer signed types, and the value cannot exceed the EMACS_INT
13330 range anyway (because otherwise the length would not be representable).
13331 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13332 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13333 This avoids a GCC warning when WIDE_EMACS_INT.
13335 * indent.c (sane_tab_width): New function.
13336 (current_column, scan_for_column, Findent_to, position_indentation)
13337 (compute_motion): Use it. This is just for clarity.
13338 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13340 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13342 * lisp.h (lint_assume): New macro.
13343 * composite.c (composition_gstring_put_cache):
13344 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13346 * editfns.c, insdel.c:
13347 Omit unnecessary forward decls, to simplify future changes.
13349 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13351 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13353 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13354 Use much-faster test for byte-length change.
13355 Don't assume string byte-length fits in 'int'.
13356 Check that character arg fits in 'int'.
13357 (mapcar1): Declare byte as byte, for clarity.
13359 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13361 * fns.c (concat): Catch string overflow earlier.
13362 Do not rely on integer wraparound.
13364 * dispextern.h (struct it.overlay_strings_charpos)
13365 (struct it.selective): Now EMACS_INT, not int.
13366 * xdisp.c (forward_to_next_line_start)
13367 (back_to_previous_visible_line_start)
13368 (reseat_at_next_visible_line_start, next_element_from_buffer):
13369 Don't arbitrarily truncate the value of 'selective' to int.
13371 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13373 * composite.c: Don't truncate sizes to 'int'.
13374 (composition_gstring_p, composition_reseat_it)
13375 (composition_adjust_point): Use EMACS_INT, not int.
13376 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13377 not EMACS_UINT, for indexes.
13379 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13381 * buffer.c: Include <verify.h>.
13382 (struct sortvec.priority, struct sortstr.priority):
13383 Now EMACS_INT, not int.
13384 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13385 (struct sortstr.size, record_overlay_string)
13386 (struct sortstrlist.size, struct sortlist.used):
13387 Don't truncate size to int.
13388 (record_overlay_string): Check for size-calculation overflow.
13389 (init_buffer_once): Check at compile-time, not run-time.
13391 2011-06-22 Jim Meyering <meyering@redhat.com>
13393 Don't leak an XBM-image-sized buffer
13394 * image.c (xbm_load): Free the image buffer after using it.
13396 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13399 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13400 that Sun C diagnosed.
13401 * fns.c (secure_hash): Fix pointer signedness issue.
13402 * intervals.c (static_offset_intervals): New function.
13403 (offset_intervals): Use it.
13405 2011-06-21 Leo Liu <sdl.web@gmail.com>
13408 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13411 * fns.c (secure_hash): Rename from crypto_hash_function and change
13412 the first arg to accept symbols.
13413 (Fsecure_hash): New primitive.
13414 (syms_of_fns): New symbols.
13416 2011-06-20 Deniz Dogan <deniz@dogan.se>
13418 * process.c (Fset_process_buffer): Clarify return value in
13421 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
13423 * dispnew.c (add_window_display_history): Use BVAR.
13425 * xdisp.c (debug_method_add): Use BVAR.
13426 (check_window_end, dump_glyph_matrix, dump_glyph)
13427 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13429 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13432 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13433 check till after the cache is created in init_frame_faces.
13435 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13437 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13439 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13441 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13442 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13443 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13445 Improve buffer-overflow checking (Bug#8873).
13446 * fileio.c (Finsert_file_contents):
13447 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13448 Remove the old (too-loose) buffer overflow checks.
13449 They weren't needed, since make_gap checks for buffer overflow.
13450 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13451 The old code merely checked for Emacs fixnum overflow, and relied
13452 on undefined (wraparound) behavior. The new code avoids undefined
13453 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13455 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13456 Tune. Don't use wider integers than needed. Don't use alloca.
13457 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13459 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13461 * insdel.c, lisp.h (buffer_overflow): New function.
13462 (insert_from_buffer_1, replace_range, replace_range_2):
13463 * insdel.c (make_gap_larger):
13464 * editfns.c (Finsert_char):
13465 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13467 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13469 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13471 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13473 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13474 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13476 * fileio.c: Don't assume EMACS_INT fits in off_t.
13477 (emacs_lseek): New static function.
13478 (Finsert_file_contents, Fwrite_region): Use it.
13479 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13481 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13483 * fns.c: Don't overflow int when computing a list length.
13484 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13485 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13486 truncation on 64-bit hosts. Check for QUIT every
13487 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13488 faster and is responsive enough.
13489 (Flength): Report an error instead of overflowing an integer.
13490 (Fsafe_length): Return a float if the value is not representable
13491 as a fixnum. This shouldn't happen except in contrived situations.
13492 (Fnthcdr, Fsort): Don't assume list length fits in int.
13493 (Fcopy_sequence): Don't assume vector length fits in int.
13495 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13496 (header_size, word_size): New constants.
13497 (allocate_vectorlike): Don't check size overflow here.
13498 (allocate_vector): Check it here instead, since this is the only
13499 caller of allocate_vectorlike that could cause overflow.
13500 Check that the new vector's length is representable as a fixnum.
13502 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13503 The previous code was bogus. For example, next_almost_prime (32)
13504 returned 39, which is undesirable as it is a multiple of 3; and
13505 next_almost_prime (24) returned 25, which is a multiple of 5 so
13506 why was the code bothering to check for multiples of 7?
13508 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13510 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13512 Variadic C functions now count arguments with ptrdiff_t.
13513 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13514 Back then I didn't know that the Emacs coding style prefers signed int.
13515 Also, in the meantime I found a few more instances where arguments
13516 were being counted with int, which may truncate counts on 64-bit
13517 machines, or EMACS_INT, which may be unnecessarily wide.
13518 * lisp.h (struct Lisp_Subr.function.aMANY)
13519 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13520 Arg counts are now ptrdiff_t, not size_t.
13521 All variadic functions and their callers changed accordingly.
13522 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13523 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13524 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13525 * callint.c (Fcall_interactively): Check arg count for overflow,
13526 to avoid potential buffer overrun. Use signed char, not 'int',
13527 for 'varies' array, so that we needn't bother to check its size
13528 calculation for overflow.
13529 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13530 * eval.c (apply_lambda):
13531 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13532 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13533 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13535 * callint.c (Fcall_interactively): Don't use index var as event count.
13537 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13538 * mem-limits.h (SIZE): Remove; no longer used.
13540 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13542 Remove unnecessary casts.
13543 * xterm.c (x_term_init):
13544 * xfns.c (x_set_border_pixel):
13545 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13546 These aren't needed now that we assume ANSI C.
13548 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13549 It's more likely to cause problems (due to unsigned overflow)
13552 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13554 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13556 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13558 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13560 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13562 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13564 GLYPH_CODE_FACE returns EMACS_INT, not int.
13565 * dispextern.h (merge_faces):
13566 * xfaces.c (merge_faces):
13567 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13568 Don't assume EMACS_INT fits in int.
13570 * character.h (CHAR_VALID_P): Remove unused parameter.
13571 * fontset.c, lisp.h, xdisp.c: All uses changed.
13573 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13575 * fns.c (concat): Minor tuning based on overflow analysis.
13576 This doesn't fix any bugs. Use int to hold character, instead
13577 of constantly refetching from Emacs object. Use XFASTINT, not
13578 XINT, for value known to be a character. Don't bother comparing
13579 a single byte to 0400, as it's always less.
13581 * floatfns.c (Fexpt):
13582 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13584 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13587 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13589 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13590 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13591 incorrectly succeed when S was a string, because 4294967386 was
13592 truncated before it was used.
13594 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13595 Otherwise, an out-of-range integer could cause undefined behavior
13598 * composite.c: Use int, not EMACS_INT, for characters.
13599 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13600 EMACS_INT, for values that are known to be in character range.
13601 This doesn't fix any bugs but is the usual style inside Emacs and
13602 may generate better code on 32-bit machines.
13604 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13605 This is for reasons similar to the recent CHAR_STRING fix.
13606 * charset.c (Fencode_char): Check that character arg is actually
13607 a character. Pass an int to ENCODE_CHAR.
13608 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13609 wider than 'int', as a compile-time check to prevent future regressions
13612 * character.c (char_string): Remove unnecessary casts.
13614 Make sure a 64-bit char is never passed to CHAR_STRING.
13615 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13616 by silently ignoring the top 32 bits, allowing some values
13617 that were far too large to be valid characters.
13618 * character.h: Include <verify.h>.
13619 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13620 arguments are no wider than unsigned, as a compile-time check
13621 to prevent future regressions in this area.
13623 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13624 (Fsubst_char_in_region):
13626 * xdisp.c (decode_mode_spec_coding):
13627 Adjust to CHAR_STRING's new requirement.
13628 * editfns.c (Finsert_char, Fsubst_char_in_region):
13629 * fns.c (concat): Check that character args are actually
13630 characters. Without this test, these functions did the wrong
13631 thing with wildly out-of-range values on 64-bit hosts.
13633 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13634 These casts should not be needed on 32-bit hosts, either.
13635 * keyboard.c (read_char):
13636 * lread.c (Fload): Remove casts to unsigned.
13638 * lisp.h (UNSIGNED_CMP): New macro.
13639 This fixes comparison bugs on 64-bit hosts.
13640 (ASCII_CHAR_P): Use it.
13641 * casefiddle.c (casify_object):
13642 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13643 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13644 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13645 * dispextern.h (FACE_FROM_ID):
13646 * keyboard.c (read_char): Use UNSIGNED_CMP.
13648 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13649 not to EMACS_INT, to avoid GCC warning.
13651 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13653 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13654 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13655 isn't needed on 32-bit machines.
13657 * buffer.c (Fgenerate_new_buffer_name):
13658 Use EMACS_INT for count, not int.
13659 (advance_to_char_boundary): Return EMACS_INT, not int.
13661 * data.c (Qcompiled_function): Now static.
13663 * window.c (window_body_lines): Now static.
13665 * image.c (gif_load): Rename local to avoid shadowing.
13667 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13668 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13669 * alloc.c (make_save_value): Integer argument is now of type
13670 ptrdiff_t, not int.
13671 (mark_object): Use ptrdiff_t, not int.
13672 * lisp.h (pD): New macro.
13673 * print.c (print_object): Use it.
13675 * alloc.c: Use EMACS_INT, not int, to count objects.
13676 (total_conses, total_markers, total_symbols, total_vector_size)
13677 (total_free_conses, total_free_markers, total_free_symbols)
13678 (total_free_floats, total_floats, total_free_intervals)
13679 (total_intervals, total_strings, total_free_strings):
13680 Now EMACS_INT, not int. All uses changed.
13681 (Fgarbage_collect): Compute overall total using a double, so that
13682 integer overflow is less likely to be a problem. Check for overflow
13683 when converting back to an integer.
13684 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13685 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13686 These were 'int' variables that could overflow on 64-bit hosts;
13687 they were never used, so remove them instead of repairing them.
13688 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13689 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13690 Previously, this ceilinged at INT_MAX, but that doesn't work on
13692 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13694 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13695 (allocate_vectorlike): Check for ptrdiff_t overflow.
13696 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13697 when a (possibly-narrower) signed value would do just as well.
13698 We prefer using signed arithmetic, to avoid comparison confusion.
13700 * alloc.c: Catch some string size overflows that we were missing.
13701 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13702 for convenience in STRING_BYTES_MAX.
13703 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13704 The definition here is exact; the one in lisp.h was approximate.
13705 (allocate_string_data): Check for string overflow. This catches
13706 some instances we weren't catching before. Also, it catches
13707 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13708 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13709 and ptrdiff_t and EMACS_INT are both 64 bits.
13711 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13712 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13713 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13715 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13717 * alloc.c (Fmake_string): Check for out-of-range init.
13719 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13721 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13723 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13725 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13726 xg_get_default_scrollbar_width.
13728 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13729 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13730 (style_changed_cb): Call update_theme_scrollbar_width and call
13731 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13732 all frames (Bug#8505).
13733 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13734 Call gtk_window_set_resizable if HAVE_GTK3.
13735 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13736 and height if HAVE_GTK3 (Bug#8505).
13737 (scroll_bar_width_for_theme): New variable.
13738 (update_theme_scrollbar_width): New function.
13739 (xg_get_default_scrollbar_width): Move code to
13740 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13741 (xg_initialize): Call update_theme_scrollbar_width.
13743 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13745 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13747 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13749 * frame.c (make_frame): Call other_buffer_safely instead of
13752 * window.c (temp_output_buffer_show): Call display_buffer with
13753 second argument Vtemp_buffer_show_specifiers and reset latter
13754 immediately after the call.
13755 (Vtemp_buffer_show_specifiers): New variable.
13756 (auto_window_vscroll_p, next_screen_context_lines)
13757 (Vscroll_preserve_screen_position): Remove leading asterisks from
13760 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13762 Fix minor problems found by GCC 4.6.0 static checking.
13763 * buffer.c (Qclone_number): Remove for now, as it's unused.
13764 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13765 (record_buffer): Remove unused local.
13766 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13767 (set_frame_buffer_list): Remove; unused.
13768 * frame.h (other_visible_frames): Remove decl.
13769 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13770 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13771 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13773 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13774 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13775 Define only if HAVE_GPM.
13776 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13777 (update_hints_inhibit): Remove; never set. All uses removed.
13778 * widgetprv.h (emacsFrameClassRec): Remove decl.
13779 * window.c (delete_deletable_window): Now returns void, since it
13780 wasn't returning anything.
13781 (compare_window_configurations): Remove unused locals.
13782 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13783 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13784 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13785 the same widths as pointers. This follows up on the 2011-05-06 patch.
13786 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13787 * xterm.h: Likewise.
13788 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13790 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13792 * makefile.w32-in: Update dependencies.
13793 (LISP_H): Add lib/intprops.h.
13795 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13797 * image.c (gif_load): Add animation frame delay to the metadata.
13798 (syms_of_image): Use DEFSYM. New symbol `delay'.
13800 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13802 * window.c (delete_deletable_window): Re-add.
13803 (Fset_window_configuration): Rewrite to handle dead buffers and
13804 consequently deletable windows.
13805 (window_tree, Fwindow_tree): Remove. Supply functionality in
13807 (compare_window_configurations): Simplify code.
13809 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13811 * image.c (imagemagick_load_image): Fix type mismatch.
13812 (Fimagemagick_types): Likewise.
13814 * window.h (replace_buffer_in_windows): Declare.
13816 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13818 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13819 Qclone_number. Remove external declaration of Qdelete_window.
13820 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13822 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13823 Run Qbuffer_list_update_hook if allowed.
13824 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13825 buffer list implementation.
13826 (other_buffer_safely): New function.
13827 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13828 calls to replace_buffer_in_windows and
13829 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13831 (record_buffer): Inhibit quitting and rewrite using quittable
13832 functions. Run Qbuffer_list_update_hook if allowed.
13833 (Frecord_buffer, Funrecord_buffer): New functions.
13834 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13835 Move switch-to-buffer to window.el.
13836 (bury-buffer): Move to window.el.
13837 (Vbuffer_list_update_hook): New variable.
13839 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13842 * window.h (resize_frame_windows): Move up in code.
13843 (Fwindow_frame): Remove EXFUN.
13844 (replace_buffer_in_all_windows): Remove prototype.
13845 (replace_buffer_in_windows_safely): Add prototype.
13847 * window.c: Declare Qdelete_window static again. Move down
13848 declaration of select_count.
13849 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13850 (Fother_window): Move to window.el.
13851 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13852 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13853 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13855 (replace_buffer_in_windows): Implement by calling
13856 Qreplace_buffer_in_windows.
13857 (replace_buffer_in_all_windows): Remove with some functionality
13858 moved into replace_buffer_in_windows_safely.
13859 (replace_buffer_in_windows_safely): New function.
13860 (select_window_norecord, select_frame_norecord): Move in front
13861 of run_window_configuration_change_hook. Remove now obsolete
13863 (Fset_window_buffer): Rewrite doc-string.
13864 Call Qrecord_window_buffer.
13865 (keys_of_window): Move binding for other-window to window.el.
13867 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13869 * dispextern.h (struct image): Replace data member, whose int_val
13870 and ptr_val fields were not used by anything, with a single
13873 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13874 (gif_clear_image, gif_load, imagemagick_load_image)
13875 (gs_clear_image, gs_load): Callers changed.
13877 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13879 * buffer.h: Include <time.h>, for time_t.
13880 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13882 Fix minor problems found by static checking.
13884 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13886 Make identifiers static if they are not used in other modules.
13887 * data.c (Qcompiled_function, Qframe, Qvector):
13888 * image.c (QimageMagick, Qsvg):
13889 * minibuf.c (Qmetadata):
13890 * window.c (resize_window_check, resize_root_window): Now static.
13891 * window.h (resize_window_check, resize_root_window): Remove decls.
13893 * window.c (window_deletion_count, delete_deletable_window):
13895 (window_body_lines): Now static.
13896 (Fdelete_other_windows_internal): Mark vars as initialized.
13897 Make sure 'resize_failed' is initialized.
13898 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13899 (resize_window_apply): Remove unused local.
13900 * window.h (delete_deletable_window): Remove decl.
13902 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13903 (imagemagick_load_image): Fix pointer signedness problem by changing
13904 last arg from unsigned char * to char *. All uses changed.
13905 Also, fix a local for similar reasons.
13906 Remove unused locals. Remove locals to avoid shadowing.
13907 (fn_rsvg_handle_free): Remove; unused.
13908 (svg_load, svg_load_image): Fix pointer signedness problem.
13909 (imagemagick_load_image): Don't use garbage pointer image_wand.
13911 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13913 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13915 * image.c (gif_load): Fix omitted cast error introduced by
13918 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13920 * window.h (resize_proportionally, orig_total_lines)
13921 (orig_top_line): Remove from window structure.
13922 (set_window_height, set_window_width, change_window_heights)
13923 (Fdelete_window): Remove prototypes.
13924 (resize_frame_windows): Remove duplicate declaration.
13926 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13928 * window.h (resize_frame_windows, resize_window_check)
13929 (delete_deletable_window, resize_root_window)
13930 (resize_frame_windows): Declare prototypes.
13932 * window.c (resize_window_apply): Make definition be "static" to
13933 match the prototype.
13935 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13937 * window.c: Remove declarations of Qwindow_size_fixed,
13938 window_min_size_1, window_min_size_2, window_min_size,
13939 size_window, window_fixed_size_p, enlarge_window, delete_window.
13940 Remove static from declaration of Qdelete_window, it's
13941 temporarily needed by Fbury_buffer.
13942 (replace_window): Don't assign orig_top_line and
13944 (Fdelete_window, delete_window): Remove. Window deletion is
13945 handled by window.el.
13946 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13947 Replace Fdelete_window calls with calls to Qdelete_window.
13948 (Fdelete_other_windows): Remove. Deleting other windows is
13949 handled by window.el.
13950 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13951 handled in window.el.
13952 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13953 Window minimum sizes are handled in window.el.
13954 (shrink_windows, size_window, set_window_height)
13955 (set_window_width, change_window_heights, window_height)
13956 (window_width, CURBEG, CURSIZE, enlarge_window)
13957 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13958 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13959 handled in window.el.
13960 (make_dummy_parent): Rename to make_parent_window and give it a
13961 second argument horflag.
13962 (make_window): Don't set resize_proportionally any more.
13963 (Fsplit_window): Remove. Windows are split in window.el.
13964 (save_restore_action, save_restore_orig_size)
13965 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13966 Resize mini windows in window.el.
13967 (grow_mini_window, shrink_mini_window): Implement by calling
13968 Qresize_root_window_vertically, resize_window_check and
13969 resize_window_apply.
13970 (saved_window, Fset_window_configuration, save_window_save):
13971 Do not handle orig_top_line, orig_total_lines, and
13972 resize_proportionally.
13973 (window_min_height, window_min_width): Move to window.el.
13974 (keys_of_window): Move bindings for delete-other-windows,
13975 split-window, delete-window and enlarge-window to window.el.
13977 * buffer.c: Temporarily extern Qdelete_window.
13978 (Fbury_buffer): Temporarily call Qdelete_window instead of
13979 Fdelete_window (Fbury_buffer will move to window.el soon).
13981 * frame.c (set_menu_bar_lines_1): Remove code handling
13982 orig_top_line and orig_total_lines.
13984 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13985 set_window_height but set heights directly.
13986 (change_frame_size_1): Use resize_frame_windows.
13988 * xdisp.c (init_xdisp): Don't use set_window_height but set
13991 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13992 Use resize_frame_windows instead of change_window_heights and run
13993 run_window_configuration_change_hook.
13995 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13996 instead of change_window_heights and run
13997 run_window_configuration_change_hook.
13999 2011-06-09 Martin Rudalics <rudalics@gmx.at>
14001 * window.c (replace_window): Rename second argument REPLACEMENT to
14002 NEW. New third argument SETFLAG. Rewrite.
14003 (delete_window, make_dummy_parent): Call replace_window with
14005 (window_list_1): Move down in code.
14006 (run_window_configuration_change_hook): Move set_buffer part
14007 before select_frame_norecord part in order to unwind correctly.
14008 Rename count1 to count.
14009 (recombine_windows, delete_deletable_window, resize_root_window)
14010 (Fdelete_other_windows_internal)
14011 (Frun_window_configuration_change_hook, make_parent_window)
14012 (resize_window_check, resize_window_apply, Fresize_window_apply)
14013 (resize_frame_windows, Fsplit_window_internal)
14014 (Fdelete_window_internal, Fresize_mini_window_internal):
14016 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14018 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14020 * window.h (window): Add some new members to window structure -
14021 normal_lines, normal_cols, new_total, new_normal, clone_number,
14022 splits, nest, prev_buffers, next_buffers.
14023 (WINDOW_TOTAL_SIZE): Move here from window.c.
14024 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14026 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14028 (make_dummy_parent): Set new members of windows structure.
14029 (make_window): Move down in code. Handle new members of window
14031 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14032 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14033 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14034 (Fset_window_prev_buffers, Fwindow_next_buffers)
14035 (Fset_window_next_buffers, Fset_window_clone_number):
14037 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14038 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14040 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14041 Argument WINDOW can be now internal window too.
14042 (Fwindow_use_time): Move up in code.
14043 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14044 Rewrite doc-string.
14045 (Fset_window_configuration, saved_window)
14046 (Fcurrent_window_configuration, save_window_save): Handle new
14047 members of window structure.
14048 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14049 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14050 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14051 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14052 Qget_mru_window, Qresize_root_window,
14053 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14054 Qauto_buffer_name; staticpro them.
14056 2011-06-07 Martin Rudalics <rudalics@gmx.at>
14058 * window.c (Fwindow_total_size, Fwindow_left_column)
14059 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14060 (Fwindow_list_1): New functions.
14061 (window_box_text_cols): Replace with window_body_cols.
14062 (Fwindow_width, Fscroll_left, Fscroll_right):
14063 Use window_body_cols instead of window_box_text_cols.
14064 (delete_window, Fset_window_configuration):
14065 Call delete_all_subwindows with window as argument.
14066 (delete_all_subwindows): Take a window as argument and not a
14067 structure. Rewrite.
14068 (window_loop): Remove handling of GET_LRU_WINDOW and
14069 GET_LARGEST_WINDOW.
14070 (Fget_lru_window, Fget_largest_window): Move to window.el.
14072 * window.h: Extern window_body_cols instead of
14073 window_box_text_cols. delete_all_subwindows now takes a
14074 Lisp_Object as argument.
14076 * indent.c (compute_motion, Fcompute_motion):
14077 Use window_body_cols instead of window_box_text_cols.
14079 * frame.c (delete_frame): Call delete_all_subwindows with root
14080 window as argument.
14082 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14084 * fns.c (Fputhash): Document return value.
14086 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
14088 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14090 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14092 Cons<->int and similar integer overflow fixes (Bug#8794).
14094 Check for overflow when converting integer to cons and back.
14095 * charset.c (Fdefine_charset_internal, Fdecode_char):
14096 Use cons_to_unsigned to catch overflow.
14097 (Fencode_char): Use INTEGER_TO_CONS.
14098 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14099 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14100 * data.c (long_to_cons, cons_to_long): Remove.
14101 (cons_to_unsigned, cons_to_signed): New functions.
14102 These signal an error for invalid or out-of-range values.
14103 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14104 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14105 * font.c (Ffont_variation_glyphs):
14106 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14107 * lisp.h: Include <intprops.h>.
14108 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14109 (cons_to_signed, cons_to_unsigned): New decls.
14110 (long_to_cons, cons_to_long): Remove decls.
14111 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14112 (Fprimitive_undo): Use CONS_TO_INTEGER.
14113 * xfns.c (Fx_window_property): Likewise.
14114 * xselect.c: Include <limits.h>.
14115 (x_own_selection, selection_data_to_lisp_data):
14116 Use INTEGER_TO_CONS.
14117 (x_handle_selection_request, x_handle_selection_clear)
14118 (x_get_foreign_selection, Fx_disown_selection_internal)
14119 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14120 (lisp_data_to_selection_data): Use cons_to_unsigned.
14121 (x_fill_property_data): Use cons_to_signed.
14122 Report values out of range.
14124 Check for buffer and string overflow more precisely.
14125 * buffer.h (BUF_BYTES_MAX): New macro.
14126 * lisp.h (STRING_BYTES_MAX): New macro.
14127 * alloc.c (Fmake_string):
14128 * character.c (string_escape_byte8):
14129 * coding.c (coding_alloc_by_realloc):
14130 * doprnt.c (doprnt):
14131 * editfns.c (Fformat):
14133 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14134 since they may not be the same number.
14135 * editfns.c (Finsert_char):
14136 * fileio.c (Finsert_file_contents):
14137 Likewise for BUF_BYTES_MAX.
14139 * image.c: Use ptrdiff_t, not int, for sizes.
14140 (slurp_file): Switch from int to ptrdiff_t.
14142 (slurp_file): Check that file size fits in both size_t (for
14143 malloc) and ptrdiff_t (for sanity and safety).
14145 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14146 if b->modtime has its maximal value.
14148 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14150 Don't assume time_t can fit into int.
14151 * buffer.h (struct buffer.modtime): Now time_t, not int.
14152 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14153 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14155 Minor fixes for signed vs unsigned integers.
14156 * character.h (MAYBE_UNIFY_CHAR):
14157 * charset.c (maybe_unify_char):
14158 * keyboard.c (read_char, reorder_modifiers):
14159 XINT -> XFASTINT, since the integer must be nonnegative.
14160 * ftfont.c (ftfont_spec_pattern):
14161 * keymap.c (access_keymap, silly_event_symbol_error):
14162 XUINT -> XFASTINT, since the integer must be nonnegative.
14163 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14164 since it makes no difference and we prefer signed.
14165 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14166 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14169 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14171 * window.h (Fwindow_frame): Declare.
14173 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14175 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14176 (SPARE_MEMORY): Always define.
14177 (LARGE_REQUEST): Remove.
14178 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14180 2011-06-06 Martin Rudalics <rudalics@gmx.at>
14182 * lisp.h: Move EXFUNS for Fframe_root_window,
14183 Fframe_first_window and Fset_frame_selected_window to window.h.
14185 * window.h: Move EXFUNS for Fframe_root_window,
14186 Fframe_first_window and Fset_frame_selected_window here from
14189 * frame.c (Fwindow_frame, Fframe_first_window)
14190 (Fframe_root_window, Fframe_selected_window)
14191 (Fset_frame_selected_window): Move to window.c.
14192 (Factive_minibuffer_window): Move to minibuf.c.
14193 (Fother_visible_frames_p): New function.
14195 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14197 * window.c (decode_window, decode_any_window): Move up in code.
14198 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14199 (inhibit_frame_unsplittable): Remove unused variable.
14200 (Fwindow_buffer): Move up and rewrite doc-string.
14201 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14202 (Fwindow_prev): New functions.
14203 (Fwindow_frame): Move here from frame.c. Accept any window as
14205 (Fframe_root_window, Fframe_first_window)
14206 (Fframe_selected_window): Move here from frame.c. Accept frame
14207 or arbitrary window as argument. Update doc-strings.
14208 (Fminibuffer_window): Move up in code.
14209 (Fwindow_minibuffer_p): Move up in code and simplify.
14210 (Fset_frame_selected_window): Move here from frame.c.
14212 (Fselected_window, select_window, Fselect_window): Move up in
14213 code. Minor doc-string fixes.
14215 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14217 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14218 Do not assume that spare memory exists; that assumption is valid
14219 only if SYSTEM_MALLOC.
14220 (LARGE_REQUEST): New macro, so that the issue of large requests
14221 is separated from the issue of spare memory.
14223 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14225 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14228 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14230 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14233 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14235 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14237 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14239 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14240 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14242 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
14244 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14246 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
14248 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14249 (x_clipboard_manager_save): Add return value.
14250 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14251 New error handlers.
14252 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14253 Obey Vx_select_enable_clipboard_manager. Catch errors in
14254 x_clipboard_manager_save (Bug#8779).
14255 (Vx_select_enable_clipboard_manager): New variable.
14256 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14258 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
14260 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14262 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14264 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14265 in the current matrix if keep_current_p is non-zero.
14267 2011-06-04 Eli Zaretskii <eliz@gnu.org>
14269 * bidi.c (bidi_level_of_next_char): Fix last change.
14271 2011-06-03 Eli Zaretskii <eliz@gnu.org>
14273 Support bidi reordering of text covered by display properties.
14275 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14276 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14277 (bidi_cache_search, bidi_cache_iterator_state)
14278 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14279 (bidi_level_of_next_char, bidi_move_to_visually_next):
14280 Support character positions inside a run of characters covered by a
14282 (bidi_paragraph_init, bidi_resolve_explicit_1)
14283 (bidi_level_of_next_char): Call bidi_fetch_char and
14284 bidi_fetch_char_advance instead of FETCH_CHAR and
14285 FETCH_CHAR_ADVANCE.
14286 (bidi_init_it): Initialize new members.
14287 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14289 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14290 instead of using explicit *_CHAR codes.
14291 (bidi_resolve_explicit, bidi_resolve_weak):
14292 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14293 bidirectional text is supported only in multibyte buffers.
14294 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14295 it to initialize the frame_window_p member of struct bidi_it.
14296 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14297 (bidi_resolve_explicit, bidi_resolve_weak)
14298 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14299 bidi_it->nchars is non-positive.
14300 (bidi_level_of_next_char): Don't try to lookup the cache for the
14301 next/previous character if nothing is cached there yet, or if we
14302 were just reseat()'ed to a new position.
14304 * xdisp.c (set_cursor_from_row): Set start and stop points
14305 according to the row's direction when priming the loop that looks
14306 for the glyph on which to display cursor.
14307 (single_display_spec_intangible_p): Function deleted.
14308 (display_prop_intangible_p): Reimplement to call
14309 handle_display_spec instead of single_display_spec_intangible_p.
14310 Accept 3 additional arguments needed by handle_display_spec.
14311 This fixes incorrect cursor motion across display property with complex
14312 values: lists, `(when COND...)' forms, etc.
14313 (single_display_spec_string_p): Support property values that are
14314 lists with the argument STRING its top-level element.
14315 (display_prop_string_p): Fix the condition for processing a
14316 property that is a list to be consistent with handle_display_spec.
14317 (handle_display_spec): New function, refactored from the
14318 last portion of handle_display_prop.
14319 (compute_display_string_pos): Accept additional argument
14320 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14321 value of a `display' property is a "replacing spec".
14322 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14323 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14324 the display property, but just return a value indicating whether
14325 the display property will replace the characters it covers.
14326 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14327 frame_window_p members of struct bidi_it.
14328 (compute_display_string_pos, compute_display_string_end):
14330 (push_it): Accept second argument POSITION, where pop_it should
14331 jump to continue iteration.
14332 (reseat_1): Initialize bidi_it.disp_pos.
14334 * keyboard.c (adjust_point_for_property): Adjust the call to
14335 display_prop_intangible_p to its new signature.
14337 * dispextern.h (struct bidi_it): New member frame_window_p.
14338 (bidi_init_it): Update prototypes.
14339 (display_prop_intangible_p): Update prototype.
14340 (compute_display_string_pos, compute_display_string_end):
14341 Declare prototypes.
14342 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14345 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14347 Malloc failure behavior now depends on size of allocation.
14348 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14349 * lisp.h: Change signatures accordingly.
14350 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14351 All callers changed. (Bug#8762)
14353 * gnutls.c: Use Emacs's memory allocators.
14354 Without this change, the gnutls library would invoke malloc etc.
14355 directly, which causes problems on non-SYNC_INPUT hosts, and which
14356 runs afoul of improving memory_full behavior. (Bug#8761)
14357 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14358 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14359 xfree instead of the default malloc, realloc, free.
14360 (Fgnutls_boot): No need to check for memory allocation failure,
14361 since xmalloc does that for us.
14363 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14364 * category.c (hash_get_category_set):
14365 * ccl.c (ccl_driver):
14366 * charset.c (Fdefine_charset_internal):
14367 * charset.h (struct charset.hash_index):
14368 * composite.c (get_composition_id, gstring_lookup_cache)
14369 (composition_gstring_put_cache):
14370 * composite.h (struct composition.hash_index):
14371 * dispextern.h (struct image.hash):
14372 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14373 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14374 (hashfn_equal, hashfn_user_defined, make_hash_table)
14375 (maybe_resize_hash_table, hash_lookup, hash_put)
14376 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14377 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14378 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14379 * image.c (make_image, search_image_cache, lookup_image)
14380 (xpm_put_color_table_h):
14381 * lisp.h (struct Lisp_Hash_Table):
14382 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14383 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14384 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14385 * alloc.c (allocate_vectorlike):
14386 Check for overflow in vector size calculations.
14387 * ccl.c (ccl_driver):
14388 Check for overflow when converting EMACS_INT to int.
14389 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14390 need to be updated by these changes.
14391 * fns.c (make_hash_table, maybe_resize_hash_table):
14392 Check for integer overflow with large hash tables.
14393 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14394 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14395 (SXHASH_REDUCE): New macro.
14396 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14397 Use it instead of discarding useful hash info with large hash values.
14398 (sxhash_float): New function.
14399 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14400 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14401 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14402 Rewrite to use FIXNUM_BITS, as this simplifies things.
14403 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14404 Adjust signatures to match updated version of code.
14405 (consing_since_gc): Now EMACS_INT, since a single hash table can
14406 use more than INT_MAX bytes.
14408 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14410 Make it possible to build with GCC-4.6+ -O2 -flto.
14412 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14414 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14416 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14417 Call minibuffer-inactive-mode.
14419 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
14421 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14422 Update dependencies.
14424 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14426 * data.c (init_data): Remove code for UTS, this system is not
14429 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14431 Don't force ./temacs to start in terminal mode.
14433 * frame.c (make_initial_frame): Initialize faces in all cases, not
14434 only when CANNOT_DUMP is defined.
14435 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14437 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14439 * dispnew.c (add_window_display_history): Use const for the string
14440 pointer. Remove declaration, not needed.
14442 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14444 Use 'inline', not 'INLINE'.
14445 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14446 * alloc.c, fontset.c (INLINE): Remove.
14447 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14448 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14449 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14450 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14451 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14453 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14455 Make it possible to run ./temacs.
14457 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14458 syms_of_callproc does the same thing. Remove test for
14459 "initialized", do it in the caller.
14460 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14462 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14464 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14465 (read_minibuf): Use get_minibuffer.
14466 (syms_of_minibuf): Use DEFSYM.
14467 (Qmetadata): New var.
14468 * data.c (Qbuffer): Don't make it static.
14469 (syms_of_data): Use DEFSYM.
14471 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14473 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14474 (CCL_CODE_MIN): New macro.
14476 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14478 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14480 * eval.c (Qdebug): Now static.
14481 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14482 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14483 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14485 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14487 * image.c: Various fixes to ImageMagick code comments.
14488 (Fimagemagick_types): Doc fix.
14490 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14492 Minor fixes prompted by GCC 4.6.0 warnings.
14494 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14496 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14497 (x_clipboard_manager_save_all): Move extern decl to ...
14498 * xterm.h: ... here, so that it can be checked for consistency.
14500 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14502 * xselect.c (x_clipboard_manager_save_frame)
14503 (x_clipboard_manager_save_all): New functions.
14504 (Fx_clipboard_manager_save): Lisp function deleted.
14506 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14507 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14509 * xterm.h: Update prototype.
14511 2011-05-28 William Xu <william.xwl@gmail.com>
14513 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14514 exiting (Bug#8239).
14516 2011-05-28 Jim Meyering <meyering@redhat.com>
14518 Avoid a sign-extension bug in crypto_hash_function.
14519 * fns.c (to_uchar): Define.
14520 (crypto_hash_function): Use it to convert some newly-signed
14521 variables to unsigned, to avoid sign-extension bugs. For example,
14522 without this change, (md5 "truc") would evaluate to
14523 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14524 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14525 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14527 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14529 Integer overflow fixes.
14531 * dbusbind.c: Serial number integer overflow fixes.
14532 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14533 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14534 to hold a serial number that is too large for a fixnum.
14535 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14536 Check for serial numbers out of range. Decode any serial number
14537 that was so large that it became a float. (Bug#8722)
14539 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14540 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14541 Use XFASTINT rather than XUINT when numbers are nonnegative.
14542 (xd_append_arg, Fdbus_method_return_internal):
14543 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14544 arguments, check that Lisp number is nonnegative, rather than
14545 silently wrapping negative numbers around. (Bug#8722)
14546 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14549 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14551 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14553 ccl: Add integer overflow checks.
14554 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14555 (IN_INT_RANGE): New macros.
14556 (ccl_driver): Use them to check for integer overflow when
14557 decoding a CCL program. Many of the new checks are whether XINT (x)
14558 fits in int; it doesn't always, on 64-bit hosts. The new version
14559 doesn't catch all possible integer overflows, but it's an
14560 improvement. (Bug#8719)
14562 * alloc.c (make_event_array): Use XINT, not XUINT.
14563 There's no need for unsigned here.
14565 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14566 This follows up to the 2011-05-06 change that substituted uintptr_t
14567 for EMACS_INT. This case wasn't caught back then.
14569 Rework Fformat to avoid integer overflow issues.
14570 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14571 now (part of C89). Include <verify.h>.
14572 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14573 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14574 (Fformat): Avoid the prepass trying to compute sizes; it was only
14575 approximate and thus did not catch overflow reliably. Instead, walk
14576 through the format just once, formatting and computing sizes as we go,
14577 checking for integer overflow at every step, and allocating a larger
14578 buffer as needed. Keep track separately whether the format is
14579 multibyte. Keep only the most-recently calculated precision, rather
14580 than them all. Record whether each argument has been converted to
14581 string. Use EMACS_INT, not int, for byte and char and arg counts.
14582 Support field widths and precisions larger than INT_MAX. Avoid
14583 sprintf's undefined behavior with conversion specifications such as %#d
14584 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14585 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14586 formatting out-of-range floating point numbers with int
14587 formats. (Bug#8668)
14589 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14591 * data.c: Avoid integer truncation in expressions involving floats.
14592 * data.c: Include <intprops.h>.
14593 (arith_driver): When there's an integer overflow in an expression
14594 involving floating point, convert the integers to floating point
14595 so that the resulting value does not suffer from catastrophic
14596 integer truncation. For example, on a 64-bit host (* 4
14597 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14598 Do not rely on undefined behavior after integer overflow.
14600 merge count_size_as_multibyte, parse_str_to_multibyte
14601 * character.c, character.h (count_size_as_multibyte):
14602 Rename from parse_str_to_multibyte; all uses changed.
14603 Check for integer overflow.
14604 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14605 since it's now a duplicate of the other. This is more of
14606 a character than a buffer op, so better that it's in character.c.
14607 * fns.c, print.c: Adjust to above changes.
14609 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14611 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14613 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14615 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14616 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14617 (x_clipboard_manager_save): Now static.
14618 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14620 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14621 (crypto_hash_function): Now static.
14622 Fix pointer signedness problems. Avoid unnecessary initializations.
14624 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14626 * termhooks.h (Vselection_alist): Make it terminal-local.
14628 * terminal.c (create_terminal): Initialize it.
14630 * xselect.c: Support for clipboard managers.
14631 (Vselection_alist): Move to termhooks.h as terminal-local var.
14632 (LOCAL_SELECTION): New macro.
14633 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14634 (symbol_to_x_atom): Remove gratuitous arg.
14635 (x_handle_selection_request, lisp_data_to_selection_data)
14636 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14637 (x_own_selection, x_get_local_selection, x_convert_selection):
14638 New arg, specifying work frame. Use terminal-local Vselection_alist.
14639 (some_frame_on_display): Delete unused function.
14640 (Fx_own_selection_internal, Fx_get_selection_internal)
14641 (Fx_disown_selection_internal, Fx_selection_owner_p)
14642 (Fx_selection_exists_p): New optional frame arg.
14643 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14644 (x_handle_selection_clear): Don't treat other terminals with the
14645 same keyboard specially. Use the terminal-local Vselection_alist.
14646 (x_clear_frame_selections): Use Frun_hook_with_args.
14648 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14650 * xterm.h: Add support for those atoms.
14652 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14654 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14655 (converted_selections, conversion_fail_tag): New global variables.
14656 (x_selection_request_lisp_error): Free the above.
14657 (x_get_local_selection): Remove unnecessary code.
14658 (x_reply_selection_request): Args changed; handle arbitrary array
14659 of converted selections stored in converted_selections.
14660 Separate the XChangeProperty and SelectionNotify steps.
14661 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14662 (x_convert_selection): New function.
14663 (x_handle_selection_event): Simplify.
14664 (x_get_foreign_selection): Don't ignore incoming requests while
14665 waiting for an answer; this will fail when we implement
14666 SAVE_TARGETS, and seems unnecessary anyway.
14667 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14668 (Vx_sent_selection_functions): Doc fix.
14670 2011-05-26 Leo Liu <sdl.web@gmail.com>
14672 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14674 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14676 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14678 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14679 for fringe update if it has periodic bitmap.
14680 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14681 and fringe_bitmap_periodic_p.
14683 * fringe.c (get_fringe_bitmap_data): New function.
14684 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14685 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14686 row. Mark glyph row for fringe update if periodicity changed.
14688 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14689 for fringe update unless it has periodic bitmap.
14691 2011-05-25 Kenichi Handa <handa@m17n.org>
14693 * xdisp.c (get_next_display_element): Set correct it->face_id for
14694 a static composition.
14696 2011-05-24 Leo Liu <sdl.web@gmail.com>
14699 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14701 * fns.c (crypto_hash_function, Fsha1): New function.
14702 (Fmd5): Use crypto_hash_function.
14703 (syms_of_fns): Add Ssha1.
14705 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14707 * gnutls.c: Remove unused macros.
14708 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14709 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14710 Remove macros that are defined and never used.
14711 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14713 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14715 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14716 (Fx_get_selection_internal): Minor cleanup.
14717 (Fx_own_selection_internal): Rename arguments for consistency with
14720 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14722 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14724 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14726 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14728 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14730 * dispnew.c (scrolling_window): Don't exclude the case that the
14731 last enabled row in the desired matrix touches the bottom boundary.
14733 2011-05-21 Glenn Morris <rgm@gnu.org>
14735 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14736 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14737 and add some more files.
14739 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14741 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14742 report_file_error introduced by the change from 2011-05-07.
14744 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14746 * systime.h (Time): Define only if emacs is defined.
14747 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14748 where the include path doesn't have X11/X.h by default. See
14749 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14751 2011-05-20 Kenichi Handa <handa@m17n.org>
14753 * composite.c (find_automatic_composition): Fix previous change.
14755 2011-05-20 Glenn Morris <rgm@gnu.org>
14757 * lisp.mk: New file, split from Makefile.in.
14758 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14759 (shortlisp): Remove.
14760 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14762 2011-05-19 Glenn Morris <rgm@gnu.org>
14764 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14765 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14766 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14767 (lisp): Set the order to that of loadup.el.
14768 (shortlisp): Make it a copy of $lisp.
14769 (SOME_MACHINE_LISP): Remove.
14770 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14771 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14773 2011-05-18 Kenichi Handa <handa@m17n.org>
14775 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14776 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14777 (find_automatic_composition): Mostly rewrite for efficiency.
14779 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14781 * makefile.w32-in: Update dependencies.
14783 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14785 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14786 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14788 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14790 Fix some integer overflow issues, such as string length overflow.
14792 * insdel.c (count_size_as_multibyte): Check for string overflow.
14794 * character.c (lisp_string_width): Check for string overflow.
14795 Use EMACS_INT, not int, for string indexes and lengths; in
14796 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14797 the resulting string length overflows an EMACS_INT; instead,
14798 report a string overflow if no precision given. When checking for
14799 precision exhaustion, use a check that cannot possibly have
14800 integer overflow. (Bug#8675)
14801 * character.h (lisp_string_width): Adjust to new signature.
14803 * alloc.c (string_overflow): New function.
14804 (Fmake_string): Use it. This doesn't change behavior, but saves
14805 a few bytes and will simplify future changes.
14806 * character.c (string_escape_byte8): Likewise.
14807 * lisp.h (string_overflow): New decl.
14809 Fixups, following up to the user-interface timestamp change.
14810 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14811 for UI timestamps, instead of unsigned long.
14812 * msdos.c (mouse_get_pos): Likewise.
14813 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14814 * w32gui.h (Time): Define by including "systime.h" rather than by
14815 declaring it ourselves. (Bug#8664)
14817 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14818 * image.c (clear_image_cache): Likewise.
14820 * term.c (term_mouse_position): Don't assume time_t wraparound.
14822 Be more systematic about user-interface timestamps.
14823 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14824 and sometimes 'EMACS_UINT', to represent these timestamps.
14825 This change causes it to use 'Time' uniformly, as that's what X uses.
14826 This makes the code easier to follow, and makes it easier to catch
14827 integer overflow bugs such as Bug#8664.
14828 * frame.c (Fmouse_position, Fmouse_pixel_position):
14829 Use Time, not unsigned long, for user-interface timestamps.
14830 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14831 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14832 * keyboard.h (last_event_timestamp): Likewise.
14833 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14834 * menu.h (xmenu_show): Likewise.
14835 * term.c (term_mouse_position): Likewise.
14836 * termhooks.h (struct input_event.timestamp): Likewise.
14837 (struct terminal.mouse_position_hook): Likewise.
14838 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14839 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14840 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14841 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14842 what it was before.
14843 * menu.h, termhooks.h: Include "systime.h", for Time.
14845 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14846 Don't assume that the difference between two unsigned long values
14847 can fit into an integer. At this point, we know button_down_time
14848 <= event->timestamp, so the difference must be nonnegative, so
14849 there's no need to cast the result if double-click-time is
14850 nonnegative, as it should be; check that it's nonnegative, just in
14851 case. This bug is triggered when events are more than 2**31 ms
14852 apart (about 25 days). (Bug#8664)
14854 * xselect.c (last_event_timestamp): Remove duplicate decl.
14855 (x_own_selection): Remove needless cast to unsigned long.
14857 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14858 that always fit in int. Use a sentinel instead of a counter, to
14859 avoid a temp and to allay GCC's concerns about possible int overflow.
14860 * frame.h (struct frame): Use int for menu_bar_items_used
14861 instead of EMACS_INT, since it always fits in int.
14863 * menu.c (grow_menu_items): Check for int overflow.
14865 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14867 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14868 Before, the code was not consistent. These values cannot exceed
14869 2**31 - 1 so there's no need to make them unsigned.
14870 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14871 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14872 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14874 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14876 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14877 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14878 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14879 presumably because the widths might not match.
14881 * window.c (size_window): Avoid needless test at loop start.
14883 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14885 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14887 2011-05-12 Drew Adams <drew.adams@oracle.com>
14889 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14891 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14893 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14894 `width' to `bar_area_x' and `bar_area_width', respectively.
14895 (x_scroll_run): Take account of fringe background extension.
14897 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14898 Rename local vars `left' and `width' to `bar_area_x' and
14899 `bar_area_width', respectively.
14900 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14901 background extension.
14903 2011-05-10 Jim Meyering <meyering@redhat.com>
14905 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14907 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14909 * image.c (Finit_image_library): Return t for built-in image types,
14910 like pbm and xbm. (Bug#8640)
14912 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14914 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14916 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14918 * w32console.c (Fset_screen_color): Doc fix.
14919 (Fget_screen_color): New function.
14920 (syms_of_ntterm): Defsubr it.
14922 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14923 unlink the temporary file if Fcall_process didn't create it in the
14925 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14926 child process will be redirected to a file specified with `:file'.
14927 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14928 cue to call_process_cleanup not to close that handle.
14930 2011-05-07 Ben Key <bkey76@gmail.com>
14932 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14933 one of two shell specific rules, either bootstrap-temacs-CMD or
14934 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14935 to the previous implementation of the bootstrap-temacs rule.
14936 The bootstrap-temacs-CMD rule is similar to the previous
14937 implementation of the bootstrap-temacs rule except that it
14938 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14941 These changes, along with some changes to nt/configure.bat,
14942 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14943 earlier fix to add support for --cflags and --ldflags options
14944 that include quotes so that it works whether make uses cmd or
14947 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14949 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14950 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14952 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14953 a string. Handle both cases.
14954 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14955 (Fdbus_register_method): Use Qinvalid_function.
14957 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14959 * makefile.w32-in: Update dependencies.
14960 (LISP_H): Add inttypes.h and stdin.h.
14961 (PROCESS_H): Add unistd.h.
14963 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14965 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14966 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14968 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14970 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14972 * term.c (vfatal): Remove stray call to va_end.
14973 It's not needed and the C Standard doesn't allow it here anyway.
14975 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14976 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14978 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14981 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14983 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14985 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14987 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14989 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14991 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14992 * charset.c (Fdefine_charset_internal): Don't initialize
14993 charset.code_space[15]. The value was garbage, on hosts with
14994 32-bit int (Bug#8600).
14996 * lread.c (read_integer): Be more consistent with string-to-number.
14997 Use string_to_number to do the actual conversion; this avoids
14998 rounding errors and fixes some other screwups. Without this fix,
14999 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15000 (digit_to_number): Move earlier, for benefit of read_integer.
15001 Return -1 if the digit is out of range for the base, -2 if it is
15002 not a digit in any supported base. (Bug#8602)
15004 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15006 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15007 to match comment at start of function. This also removes a
15008 GCC warning about overflow in a 32+64-bit port.
15010 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15012 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15013 Reported by Stefan Monnier in
15014 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15015 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15016 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15018 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15019 (EMACS_UINTPTR): Likewise, with uintptr_t.
15021 * lisp.h: Prefer 64-bit EMACS_INT if available.
15022 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15023 on 32-bit hosts that have 64-bit int, so that they can access
15025 However, temporarily disable this change unless the temporary
15026 symbol WIDE_EMACS_INT is defined.
15028 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15030 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15031 This removes an assumption that EMACS_INT and long are the same
15032 width as pointers. The assumption is true for Emacs porting targets
15033 now, but we want to make other targets possible.
15034 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15035 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15036 In the rest of the code, change types of integers that hold casted
15037 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15038 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15039 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15040 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15041 No need to cast type when ORing.
15042 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15043 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15044 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15045 assume EMACS_INT is the same width as char *.
15046 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15047 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15048 Remove no-longer-needed casts.
15049 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15050 (xg_tool_bar_help_callback, xg_make_tool_item):
15051 Use EMACS_INTPTR to hold an integer
15052 that will be cast to void *; this can avoid a GCC warning
15053 if EMACS_INT is not the same width as void *.
15054 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15055 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15056 (current_message_1, set_message_1):
15057 Use a local to convert to proper width without a cast.
15058 * xmenu.c (dialog_selection_callback): Likewise.
15060 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15061 Also, don't assume VALBITS / RAND_BITS is less than 5,
15062 and don't rely on undefined behavior when shifting a 1 left into
15064 * lisp.h (get_random): Change signature to match.
15066 * lread.c (hash_string): Use size_t, not int, for hash computation.
15067 Normally we prefer signed values; but hashing is special, because
15068 it's better to use unsigned division on hash table sizes so that
15069 the remainder is nonnegative. Also, size_t is the natural width
15070 for hashing into memory. The previous code used 'int', which doesn't
15071 retain enough info to hash well into very large tables.
15072 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15074 * dbusbind.c: Don't possibly lose pointer info when converting.
15075 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15076 Use XPNTR rather than XHASH, so that the high-order bits of
15077 the pointer aren't lost when converting through void *.
15079 * eval.c (Fautoload): Don't double-shift a pointer.
15081 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15083 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15085 * gnutls.c (DEF_GNUTLS_FN):
15086 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15088 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15090 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15093 2011-05-05 Eli Zaretskii <eliz@gnu.org>
15095 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15096 New version that can reserve upto 2GB of heap space.
15098 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
15100 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15102 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15104 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15105 `gnutls_certificate_set_x509_key_file'.
15107 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
15109 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15110 Update dependencies.
15112 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15114 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15115 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15116 Remove unused parameter `fildes'.
15117 * process.c (read_process_output, send_process): Don't pass it.
15119 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15121 Fix previous change: the library cache is defined in w32.c.
15122 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15123 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15125 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15127 Implement dynamic loading of GnuTLS on Windows.
15129 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15130 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15131 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15134 * gnutls.c (Qgnutls_dll): Define.
15135 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15136 (gnutls_*): Declare function pointers.
15137 (init_gnutls_functions): New function to initialize function pointers.
15138 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15139 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15140 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15141 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15142 (emacs_gnutls_write, emacs_gnutls_read)
15143 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15144 (Fgnutls_available_p): New function.
15145 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15146 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15147 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15149 * image.c: Include w32.h.
15150 (Vimage_type_cache): Delete.
15151 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15152 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15153 (w32_delayed_load): Move to w32.c.
15155 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15157 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15158 (w32_delayed_load): Move from image.c. When loading a library, record
15159 its filename in the :loaded-from property of the library id.
15160 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15161 Initialize and staticpro them.
15162 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15164 * process.c: Include lisp.h before w32.h, not after.
15165 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15166 instead of gnutls_record_check_pending.
15168 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15170 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15172 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15173 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15176 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15178 * xterm.c (x_set_frame_alpha): Do not set property on anything
15179 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15181 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15183 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15185 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15187 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15188 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15189 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15190 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15191 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15192 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15193 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15194 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15195 (Qgnutls_bootprop_callbacks_verify): Make static.
15197 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15199 * callproc.c: Indentation fixup.
15201 * sysdep.c (wait_for_termination_1): Make static.
15202 (wait_for_termination, interruptible_wait_for_termination):
15203 Move after wait_for_termination_1.
15205 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15207 * sysdep.c (interruptible_wait_for_termination): New function
15208 which is like wait_for_termination, but allows keyboard
15211 * callproc.c (Fcall_process): Add (:file "file") as an option for
15213 (Fcall_process_region): Ditto.
15215 2011-04-30 Eli Zaretskii <eliz@gnu.org>
15217 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15218 rather than `XVECTOR (FOO)->size'.
15220 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15221 inttypes.h, as a gnulib replacement is used if it not available in
15224 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15226 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15227 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15228 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15230 * coding.c (coding_alloc_by_realloc): Error out if destination
15231 will grow beyond MOST_POSITIVE_FIXNUM.
15232 (decode_coding_emacs_mule): Abort if there isn't enough place in
15233 charbuf for the composition carryover bytes. Reserve an extra
15234 space for up to 2 characters produced in a loop.
15235 (decode_coding_iso_2022): Abort if there isn't enough place in
15236 charbuf for the composition carryover bytes.
15238 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15240 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15241 aborting when %lld or %lll format is passed.
15242 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15243 %llo or %llx format is passed. (Bug#8545)
15245 * window.c (window_scroll_line_based): Use a marker instead of
15246 simple variables to record original value of point. (Bug#7952)
15248 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15249 produced by %s or %c overflows available buffer space. (Bug#8545)
15251 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15253 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15254 (SIZE_MAX): Move defn after all includes, as they might #define it.
15256 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15258 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15260 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15262 * keyboard.c (Qdelayed_warnings_hook): Define.
15263 (command_loop_1): Run `delayed-warnings-hook'
15264 if Vdelayed_warnings_list is non-nil.
15265 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15266 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15268 2011-04-28 Eli Zaretskii <eliz@gnu.org>
15270 * doprnt.c (doprnt): Don't return value smaller than the buffer
15271 size if the message was truncated. (Bug#8545).
15273 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15275 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15276 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15278 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15280 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15282 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
15284 * makefile.w32-in: Update dependencies.
15286 2011-04-27 Eli Zaretskii <eliz@gnu.org>
15288 Improve `doprnt' and its usage. (Bug#8545)
15289 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15290 `format_end'. Remove support for %l as a conversion specifier.
15291 Don't use xrealloc. Improve diagnostics when the %l size modifier
15292 is used. Update the commentary.
15294 * eval.c (verror): Simplify calculation of size_t.
15296 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15299 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15301 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15304 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15306 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15307 This makes this file independent of the recent pseudovector change.
15309 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
15311 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15313 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15314 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15315 Remove unused local.
15316 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15318 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
15319 GCC 4.6.0 optimizes based on type-based alias analysis.
15320 For example, if b is of type struct buffer * and v of type struct
15321 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15322 != &v->size, and therefore "v->size = 1; b->size = 2; return
15323 v->size;" must therefore return 1. This assumption is incorrect
15324 for Emacs, since it type-puns struct Lisp_Vector * with many other
15325 types. To fix this problem, this patch adds a new type struct
15326 vectorlike_header that documents the constraints on layout of vectors
15327 and pseudovectors, and helps optimizing compilers not get fooled
15328 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15329 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15330 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15332 (XSETPVECTYPE): Rewrite in terms of new macro.
15333 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15334 This is a bit clearer, and further avoids the possibility of
15335 undesirable aliasing.
15336 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15337 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15338 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15339 since Lisp_Subr is a special case (no "next" field).
15340 (ASIZE): Now uses header.size rather than size.
15341 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15342 to avoid the hassle of writing XVECTOR (foo)->header.size.
15343 (struct vectorlike_header): New type.
15344 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15345 object, to help avoid aliasing.
15346 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15347 (SUBRP): Likewise, since Lisp_Subr is a special case.
15348 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15349 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15350 (struct Lisp_Hash_Table): Combine first two members into a single
15351 struct vectorlike_header member. All uses of "size" and "next" members
15352 changed to be "header.size" and "header.next".
15353 * buffer.h (struct buffer): Likewise.
15354 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15355 * frame.h (struct frame): Likewise.
15356 * process.h (struct Lisp_Process): Likewise.
15357 * termhooks.h (struct terminal): Likewise.
15358 * window.c (struct save_window_data, struct saved_window): Likewise.
15359 * window.h (struct window): Likewise.
15360 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15361 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15362 * buffer.c (init_buffer_once): Likewise.
15363 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15365 * process.c (Fformat_network_address): Use local var for size,
15368 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15370 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15371 * data.c (atof): Remove decl; no longer used or needed.
15372 (digit_to_number): Move to lread.c.
15373 (Fstring_to_number): Use new string_to_number function, to be
15374 consistent with how the Lisp reader treats infinities and NaNs.
15375 Do not assume that floating-point numbers represent EMACS_INT
15376 without losing information; this is not true on most 64-bit hosts.
15377 Avoid double-rounding errors, by insisting on integers when
15378 parsing non-base-10 numbers, as the documentation specifies.
15379 * lisp.h (string_to_number): New decl, replacing ...
15380 (isfloat_string): Remove.
15381 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15382 (read1): Do not accept +. and -. as integers; this
15383 appears to have been a coding error. Similarly, do not accept
15384 strings like +-1e0 as floating point numbers. Do not report
15385 overflow for integer overflows unless the base is not 10 which
15386 means we have no simple and reliable way to continue.
15387 Break out the floating-point parsing into a new
15388 function string_to_number, so that Fstring_to_number parses
15389 floating point numbers consistently with the Lisp reader.
15390 (digit_to_number): Move here from data.c. Make it static inline.
15391 (E_CHAR, EXP_INT): Remove, replacing with ...
15392 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15393 (string_to_number): New function, replacing isfloat_string.
15394 This function checks for valid syntax and produces the resulting
15395 Lisp float number too. Rework it so that string-to-number
15396 no longer mishandles examples like "1.0e+". Use strtoumax,
15397 so that overflow for non-base-10 numbers is reported only when
15398 there's no portable and simple way to convert to floating point.
15400 * textprop.c (set_text_properties_1): Rewrite for clarity,
15401 and to avoid GCC warning about integer overflow.
15403 * intervals.h (struct interval): Use EMACS_INT for members
15404 where EMACS_UINT might cause problems. See
15405 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15406 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15407 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15409 (offset_intervals): Tell GCC not to worry about length overflow
15410 when negating a negative length.
15412 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15413 (overrun_check_free): Likewise.
15415 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15416 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15419 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15420 (gnutls_make_error): Rename local to avoid shadowing.
15421 (gnutls_emacs_global_deinit): ifdef out; not used.
15422 (Fgnutls_boot): Use const for pointer to readonly storage.
15423 Comment out unused local. Fix pointer signedness problems.
15425 * lread.c (openp): Don't stuff size_t into an 'int'.
15426 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15427 about possible signed overflow.
15429 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15430 (GDK_KEY_g): Don't define if already defined.
15431 (xg_prepare_tooltip): Avoid pointer signedness problem.
15432 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15434 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15435 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15437 * xfns.c (Fx_window_property): Simplify a bit,
15438 to make a bit faster and to avoid GCC 4.6.0 warning.
15439 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15441 * fns.c (internal_equal): Don't assume size_t fits in int.
15443 * alloc.c (compact_small_strings): Tighten assertion a little.
15445 Replace pEd with more-general pI, and fix some printf arg casts.
15446 * lisp.h (pI): New macro, generalizing old pEd macro to other
15447 conversion specifiers. For example, use "...%"pI"d..." rather
15448 than "...%"pEd"...".
15449 (pEd): Remove. All uses replaced with similar uses of pI.
15450 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15451 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15452 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15453 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15454 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15455 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15456 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15458 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15459 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15460 * print.c (safe_debug_print, print_object): Likewise.
15461 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15463 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15464 avoiding the 0 flag, which is not portable.
15465 * process.c (Fmake_network_process): Use pI to avoid cast.
15466 * region-cache.c (pp_cache): Likewise.
15467 * xdisp.c (decode_mode_spec): Likewise.
15468 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15469 behavior on 64-bit hosts with printf arg.
15470 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15471 (x_stop_queuing_selection_requests): Likewise.
15472 (x_get_window_property): Don't truncate byte count to an 'int'
15475 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15476 here, since it parses constructs like leading '-' and spaces,
15477 which are not wanted; and it overflows with large numbers.
15478 Instead, simply match F[0-9]+, which is what is wanted anyway.
15480 * alloc.c: Remove unportable assumptions about struct layout.
15481 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15482 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15483 (allocate_vectorlike, make_pure_vector): Use the new macros,
15484 plus offsetof, to remove unportable assumptions about struct layout.
15485 These assumptions hold on all porting targets that I know of, but
15486 they are not guaranteed, they're easy to remove, and removing them
15487 makes further changes easier.
15489 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15490 This doesn't fix a bug but makes the code clearer.
15491 (string_overrun_cookie): Now const. Use initializers that
15492 don't formally overflow signed char, to avoid warnings.
15493 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15494 can cause Emacs to crash when string overrun checking is enabled.
15495 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15496 multiple of sizeof (EMACS_INT); it need not be, if
15497 alignof(EMACS_INT) < sizeof (EMACS_INT).
15498 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15500 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
15502 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15504 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15506 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15507 supposed to be handshaking. (Bug#8556)
15508 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15510 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15512 * lisp.h (Qdebug): List symbol.
15513 * eval.c (Qdebug): Restore global linkage.
15514 * keyboard.c (debug-on-event): New variable.
15515 (handle_user_signal): Break into debugger when debug-on-event
15516 matches the current signal symbol.
15518 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15520 * alloc.c (check_sblock, check_string_bytes)
15521 (check_string_free_list): Convert to standard C.
15523 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15525 * w32.c (emacs_gnutls_push): Fix typo.
15527 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15529 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15530 "cast to pointer from integer of different size".
15532 Improve doprnt and its use in verror. (Bug#8545)
15533 * doprnt.c (doprnt): Document the set of format control sequences
15534 supported by the function. Use SAFE_ALLOCA instead of always
15537 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15538 is one byte too soon. Don't use xrealloc; instead xfree and
15541 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15543 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15546 * gnutls.c: Renamed global_initialized to
15547 gnutls_global_initialized. Added internals for the
15548 :verify-hostname-error, :verify-error, and :verify-flags
15549 parameters of `gnutls-boot' and documented those parameters in the
15550 docstring. Start callback support.
15551 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15552 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15553 on error. Return error code.
15554 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15555 (emacs_gnutls_read): Likewise.
15556 (Fgnutls_boot): Return handshake error code.
15557 (emacs_gnutls_handle_error): New function.
15558 (wsaerror_to_errno): Likewise.
15560 * w32.h (emacs_gnutls_pull): Add prototype.
15561 (emacs_gnutls_push): Likewise.
15563 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15564 (emacs_gnutls_push): Likewise.
15566 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15568 * process.c (wait_reading_process_output): Check if GnuTLS
15569 buffered some data internally if no FDs are set for TLS
15572 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15573 (LIBS): Link to USER_LIBS.
15574 ($(BLD)/gnutls.$(0)): New target.
15576 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15578 * xdisp.c (handle_single_display_spec): Rename the
15579 display_replaced_before_p argument into display_replaced_p, to
15580 make it consistent with the commentary. Fix typos in the
15583 * textprop.c (syms_of_textprop): Remove dead code.
15584 (copy_text_properties): Delete obsolete commentary about an
15585 interface that was deleted long ago. Fix typos in the description
15588 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15589 to changes in oldXMenu/XMenu.h from 2011-04-16.
15590 <menu_help_message, prev_menu_help_message>: Constify.
15591 (IT_menu_make_room): menu->help_text is now `const char **';
15594 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15595 to changes in oldXMenu/XMenu.h from 2011-04-16.
15596 (struct XMenu): Declare `help_text' `const char **'.
15598 * xfaces.c <Qunspecified>: Make extern again.
15600 * syntax.c: Include sys/types.h before including regex.h, as
15603 * doc.c (get_doc_string): Improve the format passed to `error'.
15605 * doprnt.c (doprnt): Improve commentary.
15607 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15609 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15612 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15613 changes in globals.h immediately force recompilation.
15614 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15615 $(CURDIR)/s/ms-w32.h.
15616 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15618 * character.c (Fchar_direction): Function deleted.
15619 (syms_of_character): Don't defsubr it.
15620 <char-direction-table>: Deleted.
15622 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15624 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15625 * doprnt.c: Include limits.h.
15626 (SIZE_MAX): New macro.
15627 (doprnt): Return a size_t value. 2nd arg is now size_t.
15628 Many local variables are now size_t instead of int or unsigned.
15629 Improve overflow protection. Support `l' modifier for integer
15630 conversions. Support %l conversion. Don't assume an EMACS_INT
15631 argument for integer conversions and for %c.
15633 * lisp.h (doprnt): Restore prototype.
15635 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15636 $(SRC)/character.h.
15638 * Makefile.in (base_obj): Add back doprnt.o.
15640 * deps.mk (doprnt.o): Add back prerequisites.
15641 (callint.o): Depend on character.h.
15643 * eval.c (internal_lisp_condition_case): Include the handler
15644 representation in the error message.
15645 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15646 when breaking from the loop.
15648 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15650 * callint.c (Fcall_interactively): When displaying error message
15651 about invalid control letter, pass the character's codepoint, not
15652 a pointer to its multibyte form. Improve display of the character
15653 in octal and display also its hex code.
15655 * character.c (char_string): Use %x to display the (unsigned)
15656 codepoint of an invalid character, to avoid displaying a bogus
15659 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15660 `error', not SYMBOL_NAME itself.
15662 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15663 character arguments to `error'.
15665 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15666 to `error' in error message about FINAL_CHAR argument. Make sure
15667 FINAL_CHAR is a character, and use %c when it is passed as
15668 argument to `error'.
15670 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15672 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15674 * w32.c: Include <time.h>.
15675 (sys_localtime): New function.
15677 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15679 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15681 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15683 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15685 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15686 zombies (Bug#8467).
15688 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15690 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15691 gl_state.e_property when gl_state.object is Qt.
15693 * insdel.c (make_gap_larger): Remove limitation of buffer size
15696 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15698 * xdisp.c (lookup_glyphless_char_display)
15699 (produce_glyphless_glyph): Handle cons cell entry in
15700 glyphless-char-display.
15701 (Vglyphless_char_display): Document it.
15703 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15704 glyphless-char-display.
15706 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15708 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15710 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15712 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15713 definition for no-X builds.
15715 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15717 Static checks with GCC 4.6.0 and non-default toolkits.
15719 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15721 * process.c (keyboard_bit_set): Define only if SIGIO.
15722 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15723 (send_process): Repair possible setjmp clobbering.
15725 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15727 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15729 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15731 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15732 Define only if needed.
15734 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15735 by pacifying GCC about it. Maybe it's time to retire it?
15736 * xfaces.c (USG, __TIMEVAL__): Likewise.
15738 * dispextern.h (struct redisplay_interface): Rename param
15739 to avoid shadowing.
15740 * termhooks.h (struct terminal): Likewise.
15741 * xterm.c (xembed_send_message): Likewise.
15743 * insdel.c (make_gap_smaller): Define only if
15744 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15746 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15749 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15750 so that we aren't warned about unused symbols.
15752 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15754 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15756 * xfns.c (x_real_positions): Mark locals as initialized.
15758 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15760 * xterm.c: Fix problems found by static analysis with other toolkits.
15761 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15762 (x_dispatch_event): Declare static if USE_GTK, and
15763 define if USE_GTK || USE_X_TOOLKIT.
15764 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15765 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15766 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15767 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15769 * xmenu.c (menu_help_callback): Pointer type fixes.
15770 Use const pointers when pointing at readonly data. Avoid pointer
15771 signedness clashes.
15772 (FALSE): Remove unused macro.
15773 (update_frame_menubar): Remove unused decl.
15775 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15777 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15778 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15779 (single_menu_item): Rename local to avoid shadowing.
15781 * keyboard.c (make_lispy_event): Remove unused local var.
15783 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15784 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15786 * bitmaps: Change bitmaps from unsigned char back to the X11
15787 compatible char. Avoid the old compiler warnings about
15788 out-of-range initializers by using, for example, '\xab' rather
15791 * xgselect.c (xgselect_initialize): Check vs interface
15792 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15794 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15796 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15797 to read-only memory.
15799 * fns.c (vector): Remove; this old hack is no longer needed.
15801 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15803 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15805 * xrdb.c (x_load_resources): Omit unused local.
15807 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15808 (x_window): Rename locals to avoid shadowing.
15809 (USG): Use the kludged USG macro, to pacify gcc.
15811 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15812 (x_term_init): Remove local to avoid shadowing.
15814 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15816 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15817 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15819 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15821 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15823 Fix regex.c, syntax.c and friends for buffers > 2GB.
15824 * syntax.h (struct gl_state_s): Declare character position members
15827 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15829 * textprop.c (verify_interval_modification, interval_of):
15830 Declare arguments EMACS_INT.
15832 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15835 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15837 * indent.c (Fvertical_motion): Local variable it_start is now
15840 * regex.c (re_match, re_match_2, re_match_2_internal)
15841 (bcmp_translate, regcomp, regexec, print_double_string)
15842 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15843 (re_compile_pattern, re_exec): Declare arguments and local
15844 variables `size_t' and `ssize_t' and return values `regoff_t', as
15846 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15847 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15848 <compile_stack_type>: `size' and `avail' are now `size_t'.
15850 * regex.h <regoff_t>: Use ssize_t, not int.
15851 (re_search, re_search_2, re_match, re_match_2): Arguments that
15852 specify buffer/string position and length are now ssize_t and
15853 size_t. Return type is regoff_t.
15855 2011-04-16 Ben Key <bkey76@gmail.com>
15857 * nsfont.m: Fixed bugs in ns_get_family and
15858 ns_descriptor_to_entity that were caused by using free to
15859 deallocate memory blocks that were allocated by xmalloc (via
15860 xstrdup). This caused Emacs to crash when compiled with
15861 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15862 --enable-checking=xmallocoverrun). xfree is now used to
15863 deallocate these memory blocks.
15865 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15867 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15869 emacs_write: Accept and return EMACS_INT for sizes.
15870 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15872 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15873 Accept and return EMACS_INT.
15874 (emacs_gnutls_write): Return the number of bytes written on
15876 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15877 (emacs_read, emacs_write): Remove check for negative size, as the
15878 Emacs source code has been audited now.
15879 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15880 (emacs_read, emacs_write): Use it.
15881 * process.c (send_process): Adjust to the new signatures of
15882 emacs_write and emacs_gnutls_write. Do not attempt to store
15883 a byte offset into an 'int'; it might overflow.
15884 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15886 * sound.c: Don't assume sizes fit in 'int'.
15887 (struct sound_device.period_size, alsa_period_size):
15888 Return EMACS_INT, not int.
15889 (struct sound_device.write, vox_write, alsa_write):
15890 Accept EMACS_INT, not int.
15891 (wav_play, au_play): Use EMACS_INT to store sizes and to
15892 record read return values.
15894 2011-04-15 Ben Key <bkey76@gmail.com>
15896 * keyboard.c (Qundefined): Don't declare static since it is used
15898 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15899 static since they are used in nsfont.m.
15901 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15903 * process.c (Qprocessp): Don't declare static.
15904 * lisp.h (Qprocessp): Declare again.
15906 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15908 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15910 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15912 Improve C-level modularity by making more things 'static'.
15914 Don't publish debugger-only interfaces to other modules.
15915 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15916 (verify_bytepos, count_markers): Move decls to the only modules
15918 * region-cache.h (pp_cache): Likewise.
15919 * window.h (check_all_windows): Likewise.
15920 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15922 * sysdep.c (croak): Now static, if
15923 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15924 * syssignal.h (croak): Declare only if not static.
15926 * alloc.c (refill_memory_reserve): Now static if
15927 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15928 * lisp.h (refill_memory_reserve): Declare only if not static.
15930 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15931 Define only if USE_LUCID.
15933 * xrdb.c (x_customization_string, x_rm_string): Now static.
15935 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15936 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15938 * xdisp.c (draw_row_with_mouse_face): Now static.
15939 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15941 * window.h (check_all_windows): Mark externally visible.
15943 * window.c (window_deletion_count): Now static.
15945 * undo.c: Make symbols static if they're not exported.
15946 (last_undo_buffer, last_boundary_position, pending_boundary):
15949 * textprop.c (interval_insert_behind_hooks): Now static.
15950 (interval_insert_in_front_hooks): Likewise.
15952 * term.c: Make symbols static if they're not exported.
15953 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15954 (max_frame_lines, tty_set_terminal_modes):
15955 (tty_reset_terminal_modes, tty_turn_off_highlight):
15956 (get_tty_terminal): Now static.
15957 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15958 * termhooks.h (term_mouse_moveto): Do not declare if
15959 HAVE_WINDOW_SYSTEM.
15960 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15961 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15963 * sysdep.c: Make symbols static if they're not exported.
15964 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15966 (sigprocmask_set, full_mask): Remove; unused.
15967 (wait_debugging): Mark as visible.
15968 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15969 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15971 * syntax.c (syntax_temp): Define only if !__GNUC__.
15973 * sound.c (current_sound_device, current_sound): Now static.
15975 * search.c (searchbufs, searchbuf_head): Now static.
15977 * scroll.c (scroll_cost): Remove; unused.
15978 * dispextern.h (scroll_cost): Remove decl.
15980 * region-cache.h (pp_cache): Mark as externally visible.
15982 * process.c: Make symbols static if they're not exported.
15983 (process_tick, update_tick, create_process, chan_process):
15984 (Vprocess_alist, proc_buffered_char, datagram_access):
15985 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15986 (deactivate_process): Mark defn as static, as well as decl.
15987 * lisp.h (create_process): Remove decl.
15988 * process.h (chan_process, Vprocess_alist): Remove decls.
15990 * print.c: Make symbols static if they're not exported.
15991 (print_depth, new_backquote_output, being_printed, print_buffer):
15992 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15993 (print_interval, print_number_index, initial_stderr_stream):
15995 * lisp.h (Fprinc): Remove decl.
15996 (debug_output_compilation_hack): Mark as externally visible.
15998 * sysdep.c (croak): Move decl from here to syssignal.h.
15999 * syssignal.h (croak): Put it here, so the API can be checked when
16000 'croak' is called from dissociate_if_controlling_tty.
16002 * minibuf.c: Make symbols static if they're not exported.
16003 (minibuf_save_list, choose_minibuf_frame): Now static.
16004 * lisp.h (choose_minibuf_frame): Remove decl.
16006 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16008 * lread.c: Make symbols static if they're not exported.
16009 (read_objects, initial_obarray, oblookup_last_bucket_number):
16011 (make_symbol): Remove; unused.
16012 * lisp.h (initial_obarray, make_symbol): Remove decls.
16014 * keyboard.c: Make symbols static if they're not exported.
16015 (single_kboard, recent_keys_index, total_keys, recent_keys):
16016 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16017 (this_single_command_key_start, echoing, last_auto_save):
16018 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16019 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16020 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16021 (Vlispy_mouse_stem, double_click_count):
16023 (force_auto_save_soon): Define only if SIGDANGER.
16024 (ignore_mouse_drag_p): Now static if
16025 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16026 (print_help): Remove; unused.
16027 (stop_character, last_timer_event): Mark as externally visible.
16028 * keyboard.h (ignore_mouse_drag_p): Declare only if
16029 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16030 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16031 * lisp.h (echoing): Remove decl.
16032 (force_auto_save_soon): Declare only if SIGDANGER.
16033 * xdisp.c (redisplay_window): Simplify code, to make it more
16034 obvious that ignore_mouse_drag_p is not accessed if !defined
16035 USE_GTK && !defined HAVE_NS.
16037 * intervals.c: Make symbols static if they're not exported.
16038 (merge_properties_sticky, merge_interval_right, delete_interval):
16040 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16042 * insdel.c: Make symbols static if they're not exported.
16043 However, leave prepare_to_modify_buffer alone. It's never
16044 called from outside this function, but that appears to be a bug.
16045 (combine_after_change_list, combine_after_change_buffer):
16046 (adjust_after_replace, signal_before_change): Now static.
16047 (adjust_after_replace_noundo): Remove; unused.
16048 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16049 (signal_before_change): Remove decls.
16051 * indent.c (val_compute_motion, val_vmotion): Now static.
16053 * image.c: Make symbols static if they're not exported.
16054 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16056 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16057 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16059 * fringe.c (standard_bitmaps): Now static.
16060 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16062 * frame.c: Make symbols static if they're not exported.
16063 (x_report_frame_params, make_terminal_frame): Now static.
16064 (get_frame_param): Now static, unless HAVE_NS.
16065 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16066 (x_get_resource_string): Remove; not used.
16067 * frame.h (make_terminal_frame, x_report_frame_params):
16068 (x_get_resource_string); Remove decls.
16069 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16070 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16072 * font.c, fontset.c: Make symbols static if they're not exported.
16073 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16074 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16075 * font.c (font_close_object): Now static.
16076 * font.h (font_close_object): Remove.
16077 * fontset.c (FONTSET_OBJLIST): Remove.
16078 (free_realized_fontset) #if-0 the body, which does nothing.
16079 (face_suitable_for_char_p): #if-0, as it's never called.
16080 * fontset.h (face_suitable_for_char_p): Remove decl.
16081 * xfaces.c (face_at_string_position):
16082 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16083 since 0 is always ASCII.
16085 * fns.c (weak_hash_tables): Now static.
16087 * fileio.c: Make symbols static if they're not exported.
16088 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16089 (Vwrite_region_annotation_buffers): Now static.
16091 * eval.c: Make symbols static if they're not exported.
16092 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16093 * lisp.h (backtrace_list): Remove decl.
16095 * emacs.c: Make symbols static if they're not exported.
16096 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16097 (fatal_error_code, fatal_error_signal_hook, standard_args):
16099 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16100 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16101 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16102 * lisp.h (fatal_error_signal_hook): Remove decl.
16103 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16105 * editfns.c: Move a (normally-unused) function to its only use.
16106 * editfns.c, lisp.h (get_operating_system_release): Remove.
16107 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16108 worth the hassle of breaking this out.
16110 * xterm.c: Make symbols static if they're not exported.
16111 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16112 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16113 (x_destroy_window, x_delete_display):
16115 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16116 (x_mouse_leave): Remove; unused.
16117 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16118 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16119 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16121 (x_mouse_leave): Declare only if WINDOWSNT.
16122 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16123 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16126 * ftxfont.c: Make symbols static if they're not exported.
16127 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16129 * font.h (ftxfont_driver): Likewise.
16131 * xfns.c: Make symbols static if they're not exported.
16132 (x_last_font_name, x_display_info_for_name):
16133 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16134 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16135 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16136 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16137 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16138 (last_show_tip_args): Now static.
16139 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16140 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16141 (x_screen_planes): Remove; unused.
16142 * dispextern.h (x_screen_planes): Remove decl.
16144 * dispnew.c: Make symbols static if they're not exported.
16145 * dispextern.h (redraw_garbaged_frames, scrolling):
16146 (increment_row_positions): Remove.
16147 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16148 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16150 (redraw_garbaged_frames): Remove; unused.
16152 * xfaces.c: Make symbols static if they're not exported.
16153 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16155 * xterm.h (defined_color): Remove decls.
16156 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16157 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16158 (menu_face_changed_default, defined_color, free_realized_face):
16159 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16160 (ascii_face_of_lisp_face): Remove; unused.
16162 * xdisp.c: Make symbols static if they're not exported.
16163 * dispextern.h (scratch_glyph_row, window_box_edges):
16164 (glyph_to_pixel_coords, set_cursor_from_row):
16165 (get_next_display_element, set_iterator_to_next):
16166 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16167 (show_mouse_face): Remove decls
16168 * frame.h (message_buf_print): Likewise.
16169 * lisp.h (pop_message, set_message, check_point_in_composition):
16171 * xterm.h (set_vertical_scroll_bar): Likewise.
16172 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16173 (message_buf_print, scratch_glyph_row, displayed_buffer):
16174 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16175 (get_next_display_element, show_mouse_face, window_box_edges):
16176 (frame_to_window_pixel_xy, check_point_in_composition):
16177 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16178 (glyph_to_pixel_coords): Remove; unused.
16180 * dired.c (file_name_completion): Now static.
16182 * dbusbind.c (xd_in_read_queued_messages): Now static.
16184 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16185 * data.c (circular_list_error): Remove.
16187 * commands.h (last_point_position, last_point_position_buffer):
16188 (last_point_position_window): Remove decls.
16189 * keyboard.c: Make these variables static.
16191 * coding.h (coding, code_convert_region, encode_coding_gap):
16193 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16194 (iso_code_class, detect_coding, code_convert_region): Now static.
16195 (encode_coding_gap): Remove; unused.
16197 * chartab.c (chartab_chars, chartab_bits): Now static.
16199 * charset.h (charset_iso_8859_1): Remove decl.
16200 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16203 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16204 * ccl.c (Vccl_program_table): Now static.
16205 (check_ccl_update): Remove; unused.
16207 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16208 * category.h: ... from here.
16209 * category.c (check_category_table, set_category_set): Now static.
16211 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16212 * lisp.h: Remove these decls.
16214 * buffer.c (buffer_count): Remove unused var.
16216 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16217 so that it's not optimized away.
16218 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16219 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16220 exported only to the debugger.
16222 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16223 * atimer.h (run_all_atimers): Remove; not exported.
16225 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16226 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16227 was inaccessible from Lisp.
16228 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16229 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16231 alloc.c: Import and export fewer symbols, and remove unused items.
16232 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16234 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16235 it's not optimized away by whole-program optimization.
16236 (message_enable_multibyte, free_misc): Remove.
16237 (catchlist, handlerlist, mark_backtrace):
16238 Declare only if BYTE_MARK_STACK.
16239 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16240 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16241 (message_enable_multibyte): Remove decl.
16242 (free_misc, interval_free_list, float_block, float_block_index):
16243 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16244 (cons_free_list, last_marked_index):
16246 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16247 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16248 (mark_backtrace): Define only if BYTE_MARK_STACK.
16249 * xdisp.c (message_enable_multibyte): Now static.
16251 Declare Lisp_Object Q* variables to be 'static' if not exported.
16252 This makes it easier for human readers (and static analyzers)
16253 to see whether these variables are used from other modules.
16254 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16255 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16256 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16257 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16258 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16259 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16260 * xmenu.c, xselect.c:
16261 Declare Q* vars static if they are not used in other modules.
16262 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16263 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16264 Remove decls of unexported vars.
16265 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16267 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16269 Make Emacs functions such as Fatom 'static' by default.
16270 This makes it easier for human readers (and static analyzers)
16271 to see whether these functions can be called from other modules.
16272 DEFUN now defines a static function. To make the function external
16273 so that it can be used in other C modules, use the new macro DEFUE.
16274 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16275 (Finit_image_library):
16276 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16277 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16278 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16279 Remove decls, since these functions are now static.
16280 (Funintern, Fget_internal_run_time): New decls, since these functions
16281 were already external.
16283 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16284 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16285 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16286 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16287 * keyboard.c, keymap.c, lread.c:
16288 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16289 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16290 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16291 Mark functions with DEFUE instead of DEFUN,
16292 if they are used in other modules.
16293 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16294 decls for now-static functions.
16295 * buffer.h (Fdelete_overlay): Remove decl.
16296 * callproc.c (Fgetenv_internal): Mark as internal.
16297 * composite.c (Fremove_list_of_text_properties): Remove decl.
16298 (Fcomposition_get_gstring): New forward static decl.
16299 * composite.h (Fcomposite_get_gstring): Remove decl.
16300 * dired.c (Ffile_attributes): New forward static decl.
16301 * doc.c (Fdocumntation_property): New forward static decl.
16302 * eval.c (Ffetch_bytecode): New forward static decl.
16303 (Funintern): Remove extern decl; now in .h file where it belongs.
16304 * fileio.c (Fmake_symbolic_link): New forward static decl.
16305 * image.c (Finit_image_library): New forward static decl.
16306 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16307 * intervals.h (Fprevious_property_change):
16308 (Fremove_list_of_text_properties): Remove decls.
16309 * keyboard.c (Fthis_command_keys): Remove decl.
16310 (Fcommand_execute): New forward static decl.
16311 * keymap.c (Flookup_key): New forward static decl.
16312 (Fcopy_keymap): Now static.
16313 * keymap.h (Flookup_key): Remove decl.
16314 * process.c (Fget_process): New forward static decl.
16315 (Fprocess_datagram_address): Mark as internal.
16316 * syntax.c (Fsyntax_table_p): New forward static decl.
16317 (skip_chars): Remove duplicate decl.
16318 * textprop.c (Fprevious_property_change): New forward static decl.
16319 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16321 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16322 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16324 * editfns.c (Fformat): Remove unreachable code.
16326 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16328 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16331 2011-04-13 Eli Zaretskii <eliz@gnu.org>
16333 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16334 when at ZV. (Bug#8487)
16336 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16338 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16340 * keyboard.c (parse_tool_bar_item): Likewise.
16341 * sound.c (sound_cleanup, alsa_close): Likewise.
16342 * termcap.c (tgetent): Likewise.
16343 * xfns.c (x_default_font_parameter): Likewise.
16344 * xsettings.c (read_and_apply_settings): Likewise.
16346 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16347 (overrun_check_free): Protoize.
16349 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16351 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16352 since callers should never pass a negative size.
16353 Change the signature to match that of plain 'read' and 'write'; see
16354 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16355 * lisp.h: Update prototypes of emacs_write and emacs_read.
16357 2011-04-11 Eli Zaretskii <eliz@gnu.org>
16359 * xdisp.c (redisplay_window): Don't try to determine the character
16360 position of the scroll margin if the window start point w->startp
16361 is outside the buffer's accessible region. (Bug#8468)
16363 2011-04-10 Eli Zaretskii <eliz@gnu.org>
16365 Fix write-region and its subroutines for buffers > 2GB.
16366 * fileio.c (a_write, e_write): Modify declaration of arguments and
16367 local variables to support buffers larger than 2GB.
16368 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16370 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16371 argument, local variables, and return value.
16373 * lisp.h: Update prototypes of emacs_write and emacs_read.
16375 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16377 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16379 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16381 Fix more problems found by GCC 4.6.0's static checks.
16383 * xdisp.c (vmessage): Use a better test for character truncation.
16385 * charset.c (load_charset_map): <, not <=, for optimization,
16386 and to avoid potential problems with integer overflow.
16387 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16388 * casetab.c (set_identity, shuffle): Likewise.
16389 * editfns.c (Fformat): Likewise.
16390 * syntax.c (skip_chars): Likewise.
16392 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16393 This also lets GCC 4.6.0 generate slightly better loop code.
16395 * callint.c (Fcall_interactively): <, not <=, for optimization.
16396 (Fcall_interactively): Count the number of arguments produced,
16397 not the number of arguments given. This is simpler and lets GCC
16398 4.6.0 generate slightly better code.
16400 * ftfont.c: Distingish more carefully between FcChar8 and char.
16401 The previous code passed unsigned char * to a functions like
16402 strlen and xstrcasecmp that expect char *, which does not
16403 conform to the C standard.
16404 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16405 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16406 char * when the C standard requires it.
16408 * keyboard.c (read_char): Remove unused var.
16410 * eval.c: Port to Windows vsnprintf (Bug#8435).
16411 Include <limits.h>.
16412 (SIZE_MAX): Define if the headers do not.
16413 (verror): Do not give up if vsnprintf returns a negative count.
16414 Instead, grow the buffer. This ports to Windows vsnprintf, which
16415 does not conform to C99. Problem reported by Eli Zaretskii.
16416 Also, simplify the allocation scheme, by avoiding the need for
16417 calling realloc, and removing the ALLOCATED variable.
16419 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16421 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16422 But keep the doprint source code for now, as we might revamp it
16423 and use it again (Bug#8435).
16424 * lisp.h (doprnt): Remove.
16425 * Makefile.in (base_obj): Remove doprnt.o.
16426 * deps.mk (doprnt.o): Remove.
16428 error: Print 32- and 64-bit integers portably (Bug#8435).
16429 Without this change, on typical 64-bit hosts error ("...%d...", N)
16430 was used to print both 32- and 64-bit integers N, which relied on
16431 undefined behavior.
16432 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16433 * lisp.h (error, verror): Mark as printf-like functions.
16434 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16435 Report overflow in size calculations when allocating printf buffer.
16436 Do not truncate output string at its first null byte.
16437 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16438 Truncate the output at a character boundary, since vsnprintf does not
16440 * charset.c (check_iso_charset_parameter): Convert internal
16441 character to string before calling 'error', since %c now has the
16443 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16444 overflow when computing char to be passed to 'error'. Do not
16445 pass Lisp_Object to 'error'; pass the integer instead.
16446 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16447 formatted with plain %d.
16449 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16451 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16453 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16455 * xterm.c (x_catch_errors): Remove duplicate declaration.
16457 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16459 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16461 2011-04-10 Jim Meyering <meyering@redhat.com>
16463 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16464 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16465 return ssize_t not "int", and use size_t as the buffer length.
16466 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16467 * gnutls.h: Update declarations.
16468 * process.c (read_process_output): Use ssize_t, to match.
16469 (send_process): Likewise.
16471 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16473 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16475 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16477 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16478 Use unsigned char, to match FcChar8 type definition.
16480 * xterm.c (handle_one_xevent):
16481 * xmenu.c (create_and_show_popup_menu):
16482 * xselect.c (x_decline_selection_request)
16483 (x_reply_selection_request): Avoid type-punned deref of X events.
16485 2011-04-09 Eli Zaretskii <eliz@gnu.org>
16487 Fix some uses of `int' instead of EMACS_INT.
16488 * search.c (string_match_1, fast_string_match)
16489 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16490 (scan_buffer, find_next_newline_no_quit)
16491 (find_before_next_newline, search_command, Freplace_match)
16492 (Fmatch_data): Make some `int' variables be EMACS_INT.
16494 * xdisp.c (display_count_lines): 3rd argument and return value now
16495 EMACS_INT. All callers changed.
16496 (pint2hrstr): Last argument is now EMACS_INT.
16498 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16499 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16500 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16501 (decode_coding_utf_16, decode_coding_emacs_mule)
16502 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16503 (decode_coding_ccl, decode_coding_charset)
16504 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16505 (decode_coding_iso_2022, decode_coding_emacs_mule)
16506 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16507 <char_offset, last_offset>: Declare EMACS_INT.
16508 (encode_coding_utf_8, encode_coding_utf_16)
16509 (encode_coding_emacs_mule, encode_invocation_designation)
16510 (encode_designation_at_bol, encode_coding_iso_2022)
16511 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16512 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16514 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16515 (encode_invocation_designation): Last argument P_NCHARS is now
16517 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16518 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16520 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16523 * ccl.c (Fccl_execute_on_string): Declare some variables
16526 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16528 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16530 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16532 * process.c (Fformat_network_address): Doc fix.
16534 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16536 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16538 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16540 * keyboard.c (read_char): Call Lisp function help-form-show,
16541 instead of using internal_with_output_to_temp_buffer.
16542 (Qhelp_form_show): New var.
16543 (syms_of_keyboard): Use DEFSYM macro.
16545 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16547 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16549 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16551 * process.c (Flist_processes): Remove to Lisp.
16552 (list_processes_1): Delete.
16554 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16556 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16558 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16560 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16562 Fix more problems found by GCC 4.6.0's static checks.
16564 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16566 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16568 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16570 * xdisp.c (vmessage): Mark as a printf-like function.
16572 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16574 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16576 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16577 printf-like functions.
16578 (tiff_load): Add casts to remove these marks before passing them
16579 to system-supplied API.
16581 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16583 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16584 This avoids several warnings with gcc -Wstrict-overflow.
16585 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16586 directly, rather than having caller test rule sign. This avoids
16587 some unnecessary tests.
16588 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16589 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16590 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16592 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16593 (xfont_open): Avoid unnecessary tests.
16595 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16597 * composite.h, composite.c (composition_gstring_put_cache):
16598 Use EMACS_INT, not int, for length.
16600 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16601 breaking out part of COMPOSITION_DECODE_RULE.
16602 (COMPOSITION_DECODE_RULE): Use it.
16603 * composite.c (get_composition_id): Remove unused local vars,
16604 by using the new macro.
16606 * textprop.c (set_text_properties_1): Change while to do-while,
16607 since the condition is always true at first.
16609 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16610 (interval_deletion_adjustment): Return unsigned value.
16613 * process.c (list_processes_1, create_pty, read_process_output):
16614 (exec_sentinel): Remove vars that were set but not used.
16615 (create_pty): Remove unnecessary "volatile"s.
16616 (Fnetwork_interface_info): Avoid possibility of int overflow.
16617 (read_process_output): Do adaptive read buffering even if carryover.
16618 (read_process_output): Simplify nbytes computation if buffered.
16620 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16622 * syntax.c (scan_words): Remove var that was set but not used.
16623 (update_syntax_table): Use unsigned instead of int.
16625 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16626 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16627 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16629 * print.c (print_error_message): Avoid int overflow.
16631 * font.c (font_list_entities): Redo for clarity,
16632 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16634 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16635 (font_score): Avoid potential overflow in diff calculation.
16637 * fns.c (substring_both): Remove var that is set but not used.
16638 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16640 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16642 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16643 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16644 can always succeed if overflow has undefined behavior.
16646 * search.c (boyer_moore, wordify): Remove vars set but not used.
16647 (wordify): Omit three unnecessary tests.
16649 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16650 All callers changed. This avoids the need for an unused var.
16652 * casefiddle.c (casify_region): Remove var that is set but not used.
16654 * dired.c (file_name_completion): Remove var that is set but not used.
16656 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16658 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16659 (Finsert_file_contents): Remove unnecessary code checking fd.
16661 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16662 Check for integer overflow on size calculations.
16664 * buffer.c (Fprevious_overlay_change): Remove var that is set
16667 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16668 Remove vars that are set but not used.
16669 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16670 (timer_check_2): Mark vars as initialized.
16672 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16674 * image.c (lookup_image): Remove var that is set but not used.
16675 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16677 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16678 that are set but not used.
16680 * xfns.c (make_invisible_cursor): Don't return garbage
16681 if XCreateBitmapFromData fails (Bug#8410).
16683 * xselect.c (x_get_local_selection, x_handle_property_notify):
16684 Remove vars that are set but not used.
16686 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16687 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16689 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16690 Remove var that is set but not used.
16691 (scroll_bar_windows_size): Now size_t, not int.
16692 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16693 Check for overflow.
16695 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16696 (map_tty_color) [!defined MSDOS]: Likewise.
16698 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16700 * coding.c: Remove vars that are set but not used.
16701 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16702 All callers changed.
16703 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16704 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16705 (decode_coding_charset): Remove vars that are set but not used.
16707 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16708 that is set but not used.
16710 * print.c (print_object): Remove var that is set but not used.
16712 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16713 The gnulib version avoids calling malloc in the usual case,
16714 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16715 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16716 * filelock.c (current_lock_owner): Likewise.
16717 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16718 * sysdep.c: Include allocator.h, careadlinkat.h.
16719 (emacs_no_realloc_allocator): New static constant.
16720 (emacs_readlink): New function.
16721 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16722 ../lib/careadlinkat.h.
16724 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16726 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16727 first non-nil return value).
16729 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16731 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16732 if not defined (Bug#8403).
16734 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16736 * xdisp.c (display_count_lines): Remove parameter `start',
16737 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16738 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16739 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16740 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16741 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16742 and thereabouts. All callers changed.
16743 (get_per_char_metric): Remove parameter `f', unused since
16744 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16746 2011-04-02 Jim Meyering <meyering@redhat.com>
16748 do not dereference NULL upon failed strdup
16749 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16750 (ns_get_family): Likewise.
16752 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16754 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16756 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16758 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16761 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16763 Add lexical binding.
16765 * window.c (Ftemp_output_buffer_show): New fun.
16766 (Fsave_window_excursion):
16767 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16769 * lread.c (lisp_file_lexically_bound_p): New function.
16770 (Fload): Bind Qlexical_binding.
16771 (readevalloop): Remove `evalfun' arg.
16772 Bind Qinternal_interpreter_environment.
16773 (Feval_buffer): Bind Qlexical_binding.
16774 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16776 (syms_of_lread): Declare `lexical-binding'.
16778 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16780 * keyboard.c (eval_dyn): New fun.
16781 (menu_item_eval_property): Use it.
16783 * image.c (parse_image_spec): Use Ffunctionp.
16785 * fns.c (concat, mapcar1): Accept byte-code-functions.
16787 * eval.c (Fsetq): Handle lexical vars.
16788 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16789 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16790 (FletX, Flet): Obey lexical binding.
16791 (Fcommandp): Handle closures.
16792 (Feval): New `lexical' arg.
16793 (eval_sub): New function extracted from Feval. Use it almost
16794 everywhere where Feval was used. Look up vars in lexical env.
16796 (Ffunctionp): Move from subr.el.
16797 (Ffuncall): Handle closures.
16798 (apply_lambda): Remove `eval_flags'.
16799 (funcall_lambda): Handle closures and new byte-code-functions.
16800 (Fspecial_variable_p): New function.
16801 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16802 but without exporting it to Lisp.
16804 * doc.c (Fdocumentation, store_function_docstring):
16805 * data.c (Finteractive_form): Handle closures.
16807 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16810 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16812 (exec_byte_code): New function extracted from Fbyte_code to handle new
16813 calling convention for byte-code-functions. Add new byte-codes.
16815 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16817 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16819 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16821 * xdisp.c (redisplay_internal): Fix prototype.
16823 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16825 * xdisp.c (SCROLL_LIMIT): New macro.
16826 (try_scrolling): Use it when setting scroll_limit.
16827 Limit scrolling to 100 screen lines.
16828 (redisplay_window): Even when falling back on "recentering",
16829 position point in the window according to scroll-conservatively,
16830 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16832 (try_scrolling): When point is above the window, allow searching
16833 as far as scroll_max, or one screenful, to compute vertical
16834 distance from PT to the scroll margin position. This prevents
16835 try_scrolling from unnecessarily failing when
16836 scroll-conservatively is set to a value slightly larger than the
16837 window height. Clean up the case of PT below the margin at bottom
16838 of window: scroll_max can no longer be INT_MAX. When aggressive
16839 scrolling is in use, don't let point enter the opposite scroll
16840 margin as result of the scroll.
16841 (syms_of_xdisp) <scroll-conservatively>: Document the
16842 threshold of 100 lines for never-recentering scrolling.
16844 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16846 * dispextern.h (move_it_by_lines):
16847 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16848 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16849 (message_log_check_duplicate): Remove parameters `prev_bol' and
16850 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16851 (redisplay_internal): Remove parameter `preserve_echo_area',
16852 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16854 * indent.c (Fvertical_motion):
16855 * window.c (window_scroll_pixel_based, Frecenter):
16856 Don't pass `need_y_p' to `move_it_by_lines'.
16858 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16860 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16861 steal a few bits to be more compact.
16862 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16863 Remove unneeded casts.
16865 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16867 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16869 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16870 binding" message (bug#7967).
16872 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16874 Fix more problems found by GCC 4.6.0's static checks.
16876 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16877 Remove unused local var.
16879 * editfns.c (Fmessage_box): Remove unused local var.
16881 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16882 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16883 Omit unused local vars.
16884 * window.c (shrink_windows): Omit unused local var.
16885 * menu.c (digest_single_submenu): Omit unused local var.
16886 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16887 Omit unused local var.
16889 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16890 Don't assume string length fits in int.
16891 (keyremap_step, read_key_sequence): Use size_t for sizes.
16892 (read_key_sequence): Don't check last_real_key_start redundantly.
16894 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16895 instead of alloca (Bug#8344).
16897 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16898 (Fbacktrace_frame): Don't assume nframes fits in int.
16900 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16902 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16905 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16907 * cm.c (calccost): Turn while-do into do-while, for clarity.
16909 * keyboard.c (syms_of_keyboard): Use the same style as later
16910 in this function when indexing through an array. This also
16911 works around GCC bug 48267.
16913 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16915 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16917 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16918 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16920 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16921 This avoids undefined behavior on integer overflow, and is a bit
16922 more convenient anyway since it is compared to a size_t variable.
16924 Variadic C functions now count arguments with size_t, not int.
16925 This avoids an unnecessary limitation on 64-bit machines, which
16926 caused (substring ...) to crash on large vectors (Bug#8344).
16927 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16928 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16929 All variadic functions and their callers changed accordingly.
16930 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16931 * data.c (arith_driver, float_arith_driver): Likewise.
16932 * editfns.c (general_insert_function): Likewise.
16933 * eval.c (struct backtrace.nargs, interactive_p)
16934 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16935 (funcall_lambda, mark_backtrace): Likewise.
16936 * fns.c (concat): Likewise.
16937 * frame.c (x_set_frame_parameters): Likewise.
16938 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16939 0 if not found, not -1. All callers changed.
16941 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16942 (stack_copy_size): Now size_t, not int.
16943 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16945 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16947 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16948 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16949 All callers changed.
16951 * lisp.h (multibyte_char_to_unibyte):
16952 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16953 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16954 * character.h (CHAR_TO_BYTE8):
16955 * cmds.c (internal_self_insert):
16956 * editfns.c (general_insert_function):
16957 * keymap.c (push_key_description):
16958 * search.c (Freplace_match):
16959 * xdisp.c (message_dolog, set_message_1): All callers changed.
16961 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16963 * keyboard.c (safe_run_hook_funcall): New function.
16964 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16965 don't set the hook to nil, but remove the offending function instead.
16966 (Qcommand_hook_internal): Remove, unused.
16967 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16968 Vcommand_hook_internal.
16970 * eval.c (enum run_hooks_condition): Remove.
16971 (funcall_nil, funcall_not): New functions.
16972 (run_hook_with_args): Call each function through a `funcall' argument.
16973 Remove `cond' argument, now redundant.
16974 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16975 (Frun_hook_with_args_until_failure): Adjust accordingly.
16976 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16978 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16980 * dispextern.h (string_buffer_position): Remove declaration.
16982 * print.c (strout): Remove parameter `multibyte', unused since
16983 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16985 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16986 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16987 All callers changed.
16989 * w32.c (_wsa_errlist): Use braces for struct initializers.
16991 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16992 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16993 All callers changed.
16994 (string_buffer_position): Likewise. Also, make static (it's never
16995 used outside xdisp.c).
16996 (cursor_row_p): Remove parameter `w', unused since
16997 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16998 (decode_mode_spec): Remove parameter `precision', introduced during
16999 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17000 All callers changed.
17002 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17004 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17006 2011-03-27 Anders Lindgren <andlind@gmail.com>
17008 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17009 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17010 (ns_update_auto_hide_menu_bar): New functions.
17011 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17012 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17013 ns_constrain_all_frames.
17014 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17015 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17017 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17019 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17021 2011-03-27 Glenn Morris <rgm@gnu.org>
17023 * syssignal.h: Replace RETSIGTYPE with void.
17024 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17025 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17026 Replace SIGTYPE with void everywhere.
17027 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17028 * s/template.h (SIGTYPE): Remove commented out definition.
17030 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17032 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17033 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17035 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17037 * w32.c (read_unc_volume): Use parameter `henum', instead of
17038 global variable `wget_enum_handle'.
17040 * keymap.c (describe_vector): Remove parameters `indices' and
17041 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17042 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17044 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17046 * keyboard.c (timer_check): Remove parameter `do_it_now',
17047 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17048 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17049 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17051 * keyboard.c (read_char):
17052 * w32menu.c (w32_menu_display_help):
17053 * xmenu.c (show_help_event, menu_help_callback):
17054 Adjust calls to `show_help_echo'.
17056 * gtkutil.c (xg_maybe_add_timer):
17057 * keyboard.c (readable_events):
17058 * process.c (wait_reading_process_output):
17059 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17061 * insdel.c (adjust_markers_gap_motion):
17062 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17063 (gap_left, gap_right): Don't call it.
17065 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17067 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17068 incurred during fontification.
17070 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17072 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17073 (DEFVAR_PER_BUFFER): Don't pass it.
17075 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17076 (scrolling_window): Don't pass it.
17078 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17080 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17082 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17084 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17085 of variables specific to SELinux and computation of `encoded_absname'.
17087 * image.c (XPutPixel): Remove unused variable `height'.
17089 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17091 * unexw32.c (get_section_info): Remove unused variable `section'.
17093 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17094 (system_process_attributes): Remove unused variable `sess'.
17095 (sys_read): Remove unused variable `err'.
17097 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17098 (w32_wnd_proc): Remove unused variable `isdead'.
17099 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17100 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17101 (x_create_tip_frame): Remove unused variable `tem'.
17103 * w32inevt.c (w32_console_read_socket):
17104 Remove unused variable `no_events'.
17106 * w32term.c (x_draw_composite_glyph_string_foreground):
17107 Remove unused variable `width'.
17109 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17111 * w32term.c (x_set_glyph_string_clipping):
17112 Don't pass uninitialized region to CombineRgn.
17114 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17116 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17117 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17118 (Fx_close_connection): Remove unused variable `i'.
17120 * w32font.c (w32font_draw): Return number of glyphs.
17121 (w32font_open_internal): Remove unused variable `i'.
17122 (w32font_driver): Add missing initializer.
17124 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17125 (fill_in_menu): Remove unused variable `items_added'.
17127 * w32term.c (last_mouse_press_frame): Remove static global variable.
17128 (w32_clip_to_row): Remove unused variable `f'.
17129 (x_delete_terminal): Remove unused variable `i'.
17131 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17132 (NOTHING): Remove unused static global variable.
17133 (uniscribe_check_otf): Remove unused variable `table'.
17134 (uniscribe_font_driver): Add missing initializers.
17136 2011-03-23 Julien Danjou <julien@danjou.info>
17138 * term.c (Fsuspend_tty, Fresume_tty):
17139 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17140 * window.c (temp_output_buffer_show):
17141 * insdel.c (signal_before_change):
17142 * frame.c (Fhandle_switch_frame):
17143 * fileio.c (Fdo_auto_save):
17144 * emacs.c (Fkill_emacs):
17145 * editfns.c (save_excursion_restore):
17146 * cmds.c (internal_self_insert):
17147 * callint.c (Fcall_interactively):
17148 * buffer.c (Fkill_all_local_variables):
17149 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17151 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17152 unconditionally since it does the check itself.
17154 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17156 Fix more problems found by GCC 4.5.2's static checks.
17158 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17159 the first time through the loop, since we know p0 < p1 then.
17160 This also avoids a gcc -Wstrict-overflow warning.
17162 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17163 leading to a memory leak, possible in functions like
17164 load_charset_map_from_file that can allocate an unbounded number
17165 of objects (Bug#8318).
17167 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17168 that could (at least in theory) be that large.
17170 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17171 This is less likely to overflow, and avoids undefined behavior if
17172 overflow does occur. All callers changed. Use strtoul to scan
17173 for the unsigned long integer.
17174 (pint2hrstr): Simplify and tune code slightly.
17175 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17177 * scroll.c (do_scrolling): Work around GCC bug 48228.
17178 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17180 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17181 This also avoids a warning with gcc -Wstrict-overflow.
17182 (validate_x_resource_name): Simplify count usage.
17183 This also avoids a warning with gcc -Wstrict-overflow.
17185 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17188 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17190 * process.c (Fmake_network_process): Use socklen_t, not int,
17191 where POSIX says socklen_t is required in portable programs.
17192 This fixes a porting bug on hosts like 64-bit HP-UX, where
17193 socklen_t is wider than int (Bug#8277).
17194 (Fmake_network_process, server_accept_connection):
17195 (wait_reading_process_output, read_process_output):
17198 * process.c: Rename or move locals to avoid shadowing.
17199 (list_processes_1, Fmake_network_process):
17200 (read_process_output_error_handler, exec_sentinel_error_handler):
17201 Rename or move locals.
17202 (Fmake_network_process): Define label "retry_connect" only if needed.
17203 (Fnetwork_interface_info): Fix pointer signedness.
17204 (process_send_signal): Add cast to avoid pointer signedness problem.
17205 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17206 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17208 Make tparam.h and terminfo.c consistent.
17209 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17210 Include tparam.h instead, since it declares them.
17211 * cm.h (PC): Remove extern decl; tparam.h now does this.
17212 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17213 * terminfo.c: Include tparam.h, to check interfaces.
17214 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17215 (tparam): Adjust signature to match interface in tparam.h;
17216 this removes some undefined behavior. Check that outstring and len
17217 are zero, which they always are with Emacs.
17218 * tparam.h (PC, BC, UP): New extern decls.
17220 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17221 (xftfont_open): Rename locals to avoid shadowing.
17223 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17224 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17225 (OTF_TAG_SYM): Omit macro if not needed.
17226 (ftfont_list): Remove unused local.
17227 (get_adstyle_property, ftfont_pattern_entity):
17228 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17229 Rename locals to avoid shadowing.
17231 * xfont.c (xfont_list_family): Mark var as initialized.
17233 * xml.c (make_dom): Now static.
17235 * composite.c (composition_compute_stop_pos): Rename local to
17237 (composition_reseat_it): Remove unused locals.
17238 (find_automatic_composition, composition_adjust_point): Likewise.
17239 (composition_update_it): Mark var as initialized.
17240 (find_automatic_composition): Mark vars as initialized,
17241 with a FIXME (Bug#8290).
17243 character.h: Rename locals to avoid shadowing.
17244 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17245 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17246 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17247 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17248 to avoid shadowing.
17250 * textprop.c (property_change_between_p): Remove; unused.
17252 * intervals.c (interval_start_pos): Now static.
17254 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17256 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17257 Rename locals to avoid shadowing.
17259 * sound.c (wav_play, au_play, Fplay_sound_internal):
17260 Fix pointer signedness.
17261 (alsa_choose_format): Remove unused local var.
17262 (wav_play): Initialize a variable to 0, to prevent undefined
17263 behavior (Bug#8278).
17265 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17267 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17269 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17270 clobbering (Bug#8298).
17271 * sysdep.c (sys_subshell): Likewise.
17272 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17274 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17275 This should get cleaned up, so that child_setup has the
17276 same signature on all platforms.
17278 * callproc.c (call_process_cleanup): Now static.
17279 (relocate_fd): Rename locals to avoid shadowing.
17281 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
17283 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17284 not to be necessary, and produces flickering.
17286 2011-03-20 Glenn Morris <rgm@gnu.org>
17288 * config.in: Remove file.
17290 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
17292 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17293 are now in src/globals.h.
17294 (syms_of_minibuf): Remove spurious & from previous change.
17296 2011-03-20 Leo Liu <sdl.web@gmail.com>
17298 * minibuf.c (completing-read-function): New variable.
17299 (completing-read-default): Rename from completing-read.
17300 (completing-read): Call completing-read-function.
17302 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17304 * xfaces.c (Fx_load_color_file):
17305 Read color file from absolute filename (bug#8250).
17307 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17309 * makefile.w32-in: Update dependencies.
17311 2011-03-17 Eli Zaretskii <eliz@gnu.org>
17313 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17315 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17317 Fix more problems found by GCC 4.5.2's static checks.
17319 * process.c (make_serial_process_unwind, send_process_trap):
17320 (sigchld_handler): Now static.
17322 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17323 That way, the code declares only the vars that it needs.
17324 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17325 * s/cygwin.h (PTY_ITERATION): Likewise.
17326 * s/darwin.h (PTY_ITERATION): Likewise.
17327 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17329 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17330 * process.c (allocate_pty): Don't declare stb unless it's needed.
17332 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17333 (CONSTANTLIM): Remove; unused.
17334 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17335 Define only if needed.
17337 * unexelf.c (unexec): Name an expression,
17338 to avoid gcc -Wbad-function-cast warning.
17339 Use a different way to cause a compilation error if anyone uses
17340 n rather than nn, a way that does not involve shadowing.
17341 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17343 * deps.mk (unexalpha.o): Remove; unused.
17345 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17346 * unexec.h: New file.
17347 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17348 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17349 Depend on unexec.h.
17350 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17351 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17352 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17353 Change as necessary to match prototype in unexec.h.
17355 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17357 (back_comment, skip_chars): Mark vars as initialized.
17359 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17360 Rename locals to avoid shadowing.
17362 * lread.c (read1): Rewrite so as not to use empty "else".
17363 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17365 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17367 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17368 warning when compiling print.c.
17370 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17371 instead of using an uninitialized var.
17372 (font_sort_entities): Mark var as initialized.
17374 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17376 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17377 pointers to constants.
17378 (font_parse_fcname): Remove unused vars.
17379 (font_delete_unmatched): Now static.
17380 (font_get_spec): Remove; unused.
17381 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17382 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17383 Rename or move locals to avoid shadowing.
17385 * fns.c (require_nesting_list, require_unwind): Now static.
17386 (Ffillarray): Rename locals to avoid shadowing.
17388 * floatfns.c (domain_error2): Define only if needed.
17389 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17391 * alloc.c (mark_backtrace): Move decl from here ...
17392 * lisp.h: ... to here, so that it can be checked.
17394 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17395 (Fdefvar): Rewrite so as not to use empty "else".
17396 (lisp_indirect_variable): Name an expression,
17397 to avoid gcc -Wbad-function-cast warning.
17398 (Fdefvar): Rename locals to avoid shadowing.
17400 * callint.c (quotify_arg, quotify_args): Now static.
17401 (Fcall_interactively): Rename locals to avoid shadowing.
17402 Use const pointer when appropriate.
17404 * lisp.h (get_system_name, get_operating_system_release):
17405 Move decls here, to check interfaces.
17406 * process.c (get_operating_system_release): Move decl to lisp.h.
17407 * xrdb.c (get_system_name): Likewise.
17408 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17409 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17410 some of which prompt warnings from gcc -Wbad-function-cast.
17411 (Fformat_time_string, Fencode_time, Finsert_char):
17412 (Ftranslate_region_internal, Fformat):
17413 Rename or remove local vars to avoid shadowing.
17414 (Ftranslate_region_internal): Mark var as initialized.
17416 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17419 * lisp.h (eassert): Check that the argument compiles, even if
17420 ENABLE_CHECKING is not defined.
17422 * data.c (Findirect_variable): Name an expression, to avoid
17423 gcc -Wbad-function-cast warning.
17424 (default_value, arithcompare, arith_driver, arith_error): Now static.
17425 (store_symval_forwarding): Rename local to avoid shadowing.
17426 (Fmake_variable_buffer_local, Fmake_local_variable):
17427 Mark variables as initialized.
17428 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17430 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17431 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17432 Rename locals to avoid shadowing.
17433 (mark_stack): Move local variables into the #ifdef region where
17435 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17436 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17438 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17439 (GC_STRING_CHARS): Remove; not used.
17440 (Fmemory_limit): Cast sbrk's returned value to char *.
17442 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17443 avoids undefined behavior in theory.
17445 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17447 Use functions, not macros, for up- and down-casing (Bug#8254).
17448 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17449 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17450 to use the following functions instead of these macros.
17451 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17452 EMACS_INT, since callers assume the returned value fits in int.
17453 (upcase1): Likewise, for UPCASE_TABLE.
17454 (uppercasep, lowercasep, upcase): New static inline functions.
17455 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17456 the race-condition problem in the old DOWNCASE.
17458 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17459 Rename locals to avoid shadowing.
17460 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17461 (regex_compile, re_search_2, re_match_2_internal):
17462 Remove unused local vars.
17463 (FREE_VAR): Rewrite so as not to use empty "else",
17464 which gcc can warn about.
17465 (regex_compile, re_match_2_internal): Mark locals as initialized.
17466 (RETALLOC_IF): Define only if needed.
17467 (WORDCHAR_P): Likewise. This one is never needed, but is used
17468 only in a comment talking about a compiler bug, so put inside
17469 the #if 0 of that comment.
17470 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17471 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17474 * search.c (boyer_moore): Rename locals to avoid shadowing.
17475 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17476 (PREV_CHAR_BOUNDARY): Likewise.
17478 * search.c (simple_search): Remove unused var.
17480 * dired.c (compile_pattern): Move decl from here ...
17481 * lisp.h: ... to here, so that it can be checked.
17482 (struct re_registers): New forward decl.
17484 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17486 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17488 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17489 Rename locals to avoid shadowing.
17490 (Fvertical_motion): Mark locals as initialized.
17492 * casefiddle.c (casify_object, casify_region): Now static.
17493 (casify_region): Mark local as initialized.
17495 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17497 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17498 New macros, so that the caller can use some names other than
17499 gcpro1, gcpro2, etc.
17500 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17502 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17503 argument, for consistency with GCPRO2_VAR, etc: it is now the
17504 prefix of the variable, not the variable itself. All uses
17506 * dired.c (directory_files_internal, file_name_completion):
17507 Rename locals to avoid shadowing.
17509 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17510 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17511 dired.c's scmp function, had undefined behavior.
17512 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17513 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17514 * buffer.h: ... to here, because these macros use current_buffer,
17515 and the new implementation with inline functions needs to have
17516 current_buffer in scope now, rather than later when the macros
17518 (downcase, upcase1): New static inline functions.
17519 (DOWNCASE, UPCASE1): Reimplement using these functions.
17520 This avoids undefined behavior in expressions like
17521 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17522 from race conditions in accessing the global variables
17523 case_temp1 and case_temp2.
17524 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17525 * lisp.h (case_temp1, case_temp2): Remove their decls.
17526 * character.h (ASCII_CHAR_P): Move from here ...
17527 * lisp.h: ... to here, so that the inline functions mentioned
17528 above can use them.
17530 * dired.c (directory_files_internal_unwind): Now static.
17532 * fileio.c (file_name_as_directory, directory_file_name):
17533 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17535 (file_name_as_directory): Use const pointers when appropriate.
17536 (Fexpand_file_name): Likewise. In particular, newdir might
17537 point at constant storage, so make it a const pointer.
17538 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17539 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17541 (Fset_file_times, Finsert_file_contents, auto_save_error):
17542 Rename locals to avoid shadowing.
17544 * minibuf.c (choose_minibuf_frame_1): Now static.
17545 (Ftry_completion, Fall_completions): Rename or remove locals
17546 to avoid shadowing.
17548 * marker.c (bytepos_to_charpos): Remove; unused.
17550 * lisp.h (verify_bytepos, count_markers): New decls,
17551 so that gcc does not warn that these functions aren't declared.
17553 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17554 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17555 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17556 (copy_text): Remove unused local var.
17558 * filelock.c (within_one_second): Now static.
17559 (lock_file_1): Rename local to avoid shadowing.
17561 * buffer.c (fix_overlays_before): Mark locals as initialized.
17562 (fix_start_end_in_overlays): Likewise. This function should be
17563 simplified by using pointers-to-pointers, but that's a different
17565 (switch_to_buffer_1): Now static.
17566 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17567 (report_overlay_modification): Rename locals to avoid shadowing.
17569 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17570 Fix pointer signedness issue.
17571 (sys_subshell): Mark local as volatile if checking for lint,
17572 to suppress a gcc -Wclobbered warning that does not seem to be right.
17573 (MAXPATHLEN): Define only if needed.
17575 * process.c (serial_open, serial_configure): Move decls from here ...
17576 * systty.h: ... to here, so that they can be checked.
17578 * fns.c (get_random, seed_random): Move extern decls from here ...
17579 * lisp.h: ... to here, so that they can be checked.
17581 * sysdep.c (reset_io): Now static.
17582 (wait_for_termination_signal): Remove; unused.
17584 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17585 (copy_keymap_item, append_key, push_text_char_description):
17587 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17588 (DENSE_TABLE_SIZE): Remove; unused.
17589 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17590 (describe_map_tree):
17591 Rename locals to avoid shadowing.
17593 * keyboard.c: Declare functions static if they are not used elsewhere.
17594 (echo_char, echo_dash, cmd_error, top_level_2):
17595 (poll_for_input, handle_async_input): Now static.
17596 (read_char, kbd_buffer_get_event, make_lispy_position):
17597 (make_lispy_event, make_lispy_movement, apply_modifiers):
17598 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17599 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17600 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17601 (read_key_sequence, read_char): Mark locals as initialized.
17602 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17604 * keyboard.h (make_ctrl_char): New decl.
17605 (mark_kboards): Move decl here ...
17606 * alloc.c (mark_kboards): ... from here.
17608 * lisp.h (force_auto_save_soon): New decl.
17610 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17611 (DEFINE_DUMMY_FUNCTION): New macro.
17612 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17614 (main): Add casts to avoid warnings
17615 if GCC considers string literals to be constants.
17617 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17619 * dbusbind.c: Pointer signedness fixes.
17620 (xd_signature, xd_append_arg, xd_initialize):
17621 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17622 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17623 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17624 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17626 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17627 if GCC considers string literals to be constants.
17628 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17630 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17632 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17633 (print_preprocess, print_object): New macro to fix last change.
17635 * print.c (print_preprocess): Don't forget font objects.
17637 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17639 * emacs.c (USAGE3): Doc fixes.
17641 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17643 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17646 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17648 * lisp.h (VWindow_system, Qfile_name_history):
17649 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17650 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17651 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17653 * w32select.c: Don't #include "keyboard.h".
17654 (run_protected): Add extern declaration for waiting_for_input.
17656 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17657 * w32console.c (detect_input_pending, read_input_pending)
17658 (encode_terminal_code):
17659 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17660 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17661 (w32_system_caret_y, Qfile_name_history):
17662 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17663 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17664 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17665 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17666 * w32proc.c (Qlocal, report_file_error):
17667 * w32term.c (Vwindow_system, updating_frame):
17668 * w32uniscribe.c (initialized, uniscribe_font_driver):
17669 Remove unneeded extern declarations.
17671 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17673 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17675 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17677 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17678 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17679 These macros can no longer be used for assignment.
17681 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17682 Assign struct members directly, instead of using BUF_BEGV etc.
17683 (record_buffer_markers, fetch_buffer_markers): New functions for
17684 recording and fetching special buffer markers.
17685 (set_buffer_internal_1, set_buffer_temp): Use them.
17687 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17689 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17691 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17692 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17694 * xdisp.c (hscroll_window_tree):
17695 (reconsider_clip_changes): Use PT instead of BUF_PT.
17697 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17699 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17700 $(EMACS_ROOT)/lib/intprops.h.
17702 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17704 Fix more problems found by GCC 4.5.2's static checks.
17706 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17707 to unsigned char * to avoid compiler diagnostic.
17708 (xg_free_frame_widgets): Make it clear that a local variable is
17709 needed only if USE_GTK_TOOLTIP.
17710 (gdk_window_get_screen): Make it clear that this macro is needed
17711 only if USE_GTK_TOOLTIP.
17712 (int_gtk_range_get_value): New function, which avoids a diagnostic
17713 from gcc -Wbad-function-cast.
17714 (xg_set_toolkit_scroll_bar_thumb): Use it.
17715 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17716 diagnostic from gcc -Wbad-function-cast.
17717 (get_utf8_string, xg_get_file_with_chooser):
17718 Rename locals to avoid shadowing.
17719 (create_dialog): Move locals to avoid shadowing.
17721 * xgselect.c (xg_select): Remove unused var.
17723 * image.c (four_corners_best): Mark locals as initialized.
17724 (gif_load): Initialize transparent_p to zero (Bug#8238).
17725 Mark another local as initialized.
17726 (my_png_error, my_error_exit): Mark with NO_RETURN.
17728 * image.c (clear_image_cache): Now static.
17729 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17730 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17731 (x_edge_detection): Remove unnecessary cast that
17732 gcc -Wbad-function-cast diagnoses.
17733 (gif_load): Fix pointer signedness.
17734 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17735 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17737 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17739 Improve quality of tests for time stamp overflow.
17740 For example, without this patch (encode-time 0 0 0 1 1
17741 1152921504606846976) returns the obviously-bogus value (-948597
17742 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17743 reports time overflow. See
17744 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17745 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17746 * editfns.c: Include limits.h and intprops.h.
17747 (TIME_T_MIN, TIME_T_MAX): New macros.
17748 (time_overflow): Move earlier, to before first use.
17749 (hi_time, lo_time): New functions, for an accurate test for
17750 out-of-range times.
17751 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17752 (Fget_internal_run_time): Don't assume time_t fits in int.
17753 (make_time): Use list2 instead of Fcons twice.
17754 (Fdecode_time): More accurate test for out-of-range times.
17755 (check_tm_member): New function.
17756 (Fencode_time): Use it, to test for out-of-range times.
17757 (lisp_time_argument): Don't rely on undefined left-shift and
17758 right-shift behavior when checking for time stamp overflow.
17760 * editfns.c (time_overflow): New function, refactoring common code.
17761 (Fformat_time_string, Fdecode_time, Fencode_time):
17762 (Fcurrent_time_string): Use it.
17764 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17765 * dired.c (make_time): Move to ...
17766 * editfns.c (make_time): ... here.
17767 * systime.h: Note the move.
17769 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17771 * fringe.c (update_window_fringes): Remove unused variables.
17773 * unexmacosx.c (copy_data_segment): Also copy __got section.
17776 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17778 * termcap.c [MSDOS]: Include "msdos.h".
17779 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17780 Constify `char *' arguments and their references according to
17781 prototypes in tparam.h.
17783 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17785 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17786 Adapt all references accordingly.
17788 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17790 2011-03-11 Tom Tromey <tromey@redhat.com>
17792 * buffer.c (syms_of_buffer): Remove obsolete comment.
17794 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17796 * termhooks.h (encode_terminal_code): Declare prototype.
17798 * msdos.c (encode_terminal_code): Don't declare prototype.
17800 * term.c (encode_terminal_code): Now external again, used by
17801 w32console.c and msdos.c.
17803 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17804 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17806 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17808 Fix some minor problems found by GCC 4.5.2's static checks.
17810 * fringe.c (update_window_fringes): Mark locals as initialized
17812 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17814 * alloc.c (mark_fringe_data): Move decl from here ...
17815 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17816 to check its interface.
17817 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17819 * fontset.c (free_realized_fontset): Now static.
17820 (Fset_fontset_font): Rename local to avoid shadowing.
17821 (fontset_font): Mark local as initialized.
17822 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17824 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17826 * xselect.c (x_disown_buffer_selections): Remove; not used.
17827 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17828 (x_own_selection, Fx_disown_selection_internal): Rename locals
17829 to avoid shadowing.
17830 (x_handle_dnd_message): Remove local to avoid shadowing.
17832 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17833 so that the caller can use some name other than gcpro1.
17834 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17835 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17836 (Fx_backspace_delete_keys_p):
17837 Use them to avoid shadowing, and rename vars to avoid shadowing.
17838 (x_decode_color, x_set_name, x_window): Now static.
17839 (Fx_create_frame): Add braces to silence GCC warning.
17840 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17841 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17842 Remove unused locals.
17843 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17844 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17845 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17848 * xterm.h (x_mouse_leave): New decl.
17850 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17851 Remove unused functions.
17852 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17853 (x_calc_absolute_position): Now static.
17854 (XTread_socket): Don't define label "out" unless it's used.
17855 Don't declare local "event" unless it's used.
17856 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17857 unless they are used.
17858 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17859 (x_fatal_error_signal): Remove; not used.
17860 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17861 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17862 (x_error_catcher, x_connection_closed, x_error_handler):
17863 (x_error_quitter, xembed_send_message, x_iconify_frame):
17864 (my_log_handler): Rename locals to avoid shadowing.
17865 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17866 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17868 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17869 Rename or move locals to avoid shadowing.
17870 (tty_defined_color, merge_face_heights): Now static.
17871 (free_realized_faces_for_fontset): Remove; not used.
17872 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17873 does not deduce is never used uninitialized.
17874 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17875 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17877 * terminal.c (store_terminal_param): Now static.
17879 * xmenu.c (menu_highlight_callback): Now static.
17880 (set_frame_menubar): Remove unused local.
17881 (xmenu_show): Rename parameter to avoid shadowing.
17882 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17883 since they might point to immutable storage.
17884 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17885 since it's unused otherwise.
17887 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17888 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17889 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17890 avoids a gcc -Wuninitialized diagnostic.
17891 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17892 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17893 does not deduce are never used uninitialized.
17895 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17897 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17898 * window.c (window_loop, size_window):
17899 (run_window_configuration_change_hook, enlarge_window): Likewise.
17901 * window.c (display_buffer): Now static.
17902 (size_window): Mark variables that gcc -Wuninitialized
17903 does not deduce are never used uninitialized.
17904 * window.h (check_all_windows): New decl, to forestall
17905 gcc -Wmissing-prototypes diagnostic.
17906 * dispextern.h (bidi_dump_cached_states): Likewise.
17908 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17910 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17911 Include <limits.h>.
17912 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17913 and to avoid gcc -Wuninitialized warning.
17914 (load_charset_map): Mark variables that gcc -Wuninitialized
17915 does not deduce are never used uninitialized.
17916 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17918 * coding.c (coding_set_source, coding_set_destination):
17919 Use "else { /* comment */ }" rather than "else /* comment */;"
17920 for clarity, and to avoid gcc -Wempty-body warning.
17921 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17922 a block, when the outer 'i' will do.
17923 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17924 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17925 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17926 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17927 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17928 Rename locals to avoid shadowing.
17929 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17930 * coding.c (emacs_mule_char, encode_invocation_designation):
17931 Now static, since they're not used elsewhere.
17932 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17933 (decode_coding_object, encode_coding_object, detect_coding_system):
17934 (decode_coding_emacs_mule): Mark variables that gcc
17935 -Wuninitialized does not deduce are never used uninitialized.
17936 (detect_coding_iso_2022): Initialize a local variable that might
17937 be used uninitialized. Leave a FIXME because it's not clear that
17938 this initialization is needed. (Bug#8211)
17939 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17940 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17941 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17942 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17943 Remove unused macros.
17945 * category.c (hash_get_category_set): Remove unused local var.
17946 (copy_category_table): Now static, since it's not used elsewhere.
17947 * character.c (string_count_byte8): Likewise.
17949 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17950 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17952 * chartab.c (copy_sub_char_table): Now static, since it's not used
17954 (sub_char_table_ref_and_range, char_table_ref_and_range):
17955 Rename locals to avoid shadowing.
17956 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17958 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17959 (BIDI_BOB): Remove unused macro.
17961 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17962 deduce are never used uninitialized.
17963 * term.c (encode_terminal_code): Likewise.
17965 * term.c (encode_terminal_code): Now static. Remove unused local.
17967 * tparam.h: New file.
17968 * term.c, tparam.h: Include it.
17969 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17970 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17971 Move these decls to tparam.h, and make them agree with what
17972 is actually in tparam.c. The previous trick of using incompatible
17973 decls in different modules does not conform to the C standard.
17974 All callers of tparam changed to use tparam's actual API.
17975 * tparam.c (tparam1, tparam, tgoto):
17976 Use const pointers where appropriate.
17978 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17979 * cm.h (struct cm): Likewise.
17980 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17981 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17982 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17983 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17984 (turn_on_face, init_tty): Likewise.
17985 * termchar.h (struct tty_display_info): Likewise.
17987 * term.c (term_mouse_position): Rename local to avoid shadowing.
17989 * alloc.c (mark_ttys): Move decl from here ...
17990 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17992 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17994 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17996 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17998 * search.c (compile_pattern_1): Remove argument regp, unused since
17999 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18000 (compile_pattern): Don't pass it.
18002 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18004 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18005 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18007 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18009 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18011 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18012 gdk_window_get_screen, gdk_window_get_geometry,
18013 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18014 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18015 (xg_get_pixbuf_from_pixmap): New function.
18016 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18017 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18018 Call xg_get_pixbuf_from_pixmap instead of
18019 gdk_pixbuf_get_from_drawable.
18020 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18021 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18022 (xg_check_special_colors): Use GtkStyleContext and its functions
18024 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18025 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18026 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18027 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18028 Call gtk_widget_get_preferred_size.
18029 (xg_frame_resized): gdk_window_get_geometry only takes 5
18031 (xg_win_to_widget, xg_event_is_for_menubar):
18032 Call gdk_x11_window_lookup_for_display.
18033 (xg_set_widget_bg): New function.
18034 (delete_cb): New function.
18035 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18036 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18037 (xg_set_background_color): Call xg_set_widget_bg.
18038 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18039 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18040 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18041 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18043 (update_frame_tool_bar): Call gtk_widget_hide.
18044 (xg_initialize): Use GDK_KEY_g.
18046 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18048 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18050 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18051 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18052 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18054 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18056 * w32xfns.c (select_palette): Check success of RealizePalette against
18057 GDI_ERROR, not zero.
18059 See ChangeLog.11 for earlier changes.
18061 ;; Local Variables:
18065 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18067 This file is part of GNU Emacs.
18069 GNU Emacs is free software: you can redistribute it and/or modify
18070 it under the terms of the GNU General Public License as published by
18071 the Free Software Foundation, either version 3 of the License, or
18072 (at your option) any later version.
18074 GNU Emacs is distributed in the hope that it will be useful,
18075 but WITHOUT ANY WARRANTY; without even the implied warranty of
18076 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18077 GNU General Public License for more details.
18079 You should have received a copy of the GNU General Public License
18080 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.