]> code.delx.au - gnu-emacs/blob - src/ChangeLog
e07f7e131cb9d9c37f0ffe5eae2ab3711def1519
[gnu-emacs] / src / ChangeLog
1 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2
3 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
4 Suggested by Eli Zaretskii in
5 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6
7 2012-09-30 Eli Zaretskii <eliz@gnu.org>
8
9 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
10 HAVE_TIMER_SETTIME is defined.
11
12 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
13
14 Profiler improvements: more-accurate timers, overflow checks.
15 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
16 signal.h, setjmp.h. Include systime.h instead.
17 (saturated_add): New function.
18 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
19 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
20 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
21 New static vars.
22 (enum profiler_cpu_running): New enum.
23 (profiler_cpu_running): Now of that enum type, not bool.
24 All uses changed to store the new value.
25 (handle_profiler_signal): Rename from sigprof_handler_1,
26 for consistency with other handlers. Do not check whether
27 cpu_log is a hash-table if garbage collecting, since it
28 doesn't matter in that case.
29 (deliver_profiler_signal): Rename from sigprof_handler,
30 for consistency with other handlers.
31 (setup_cpu_timer): New function, with much of what used to be in
32 Fprofiler_cpu_start. Check for out-of-range argument.
33 Prefer timer_settime if available, and prefer
34 thread cputime clocks, then process cputime clocks, then
35 monotonic clocks, to the old realtime clock. Use make_timeval
36 to round more-correctly when falling back to setitimer.
37 (Fprofiler_cpu_start): Use it.
38 (Fprofiler_cpu_stop): Prefer timer_settime if available.
39 Don't assume that passing NULL as the 2nd argument of setitimer
40 is the same as passing a pointer to all-zero storage.
41 Ignore SIGPROF afterwards.
42 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
43 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
44 non-fatal signal handlers. Ignore SIGPROF on startup.
45 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
46 in profiler.c, since sysdep.c now uses it.
47
48 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
49 Suggested by Eli Zaretskii in
50 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
51
52 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
53
54 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
55
56 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
57
58 * lisp.h (struct backtrace): Remove indirection for `function' field.
59 * xdisp.c (redisplay_internal):
60 * profiler.c (record_backtrace, sigprof_handler_1):
61 * alloc.c (Fgarbage_collect):
62 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
63 (Fbacktrace_frame): Adjust accordingly.
64
65 2012-09-28 Glenn Morris <rgm@gnu.org>
66
67 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
68 (Frun_hook_with_args_until_failure): Doc fixes.
69
70 2012-09-28 Eli Zaretskii <eliz@gnu.org>
71
72 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
73 Qautomatic_redisplay and change the symbol name. All users changed.
74
75 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
76
77 * profiler.c (sigprof_handler): Fix race condition.
78
79 2012-09-28 Glenn Morris <rgm@gnu.org>
80
81 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
82
83 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
84
85 Check more robustly for timer_settime.
86 * Makefile.in (LIB_TIMER_TIME): New macro.
87 (LIBES): Add it.
88 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
89 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
90 call timer_settime.
91
92 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
93
94 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
95
96 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
97
98 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
99
100 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
101
102 * character.h (MAYBE_UNIFY_CHAR): Remove.
103 * charset.c, charset.h (maybe_unify_char): Now static.
104 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
105 Since this stuff is now private to charset.c, there's no need for
106 a public macro and no need to inline by hand.
107
108 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
109 Stefan Monnier <monnier@iro.umontreal.ca>
110 Juanma Barranquero <lekktu@gmail.com>
111
112 * profiler.c: New file.
113 * Makefile.in (base_obj): Add profiler.o.
114 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
115 ($(BLD)/profiler.$(O)): New target.
116 * emacs.c (main): Call syms_of_profiler.
117 * alloc.c (Qautomatic_gc): New constant.
118 (MALLOC_PROBE): New macro.
119 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
120 (total_bytes_of_live_objects): New function.
121 (Fgarbage_collect): Use it. Record itself in backtrace_list.
122 Call malloc_probe for the memory profiler.
123 (syms_of_alloc): Define Qautomatic_gc.
124 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
125 race condition.
126 (struct backtrace): Move definition...
127 * lisp.h (struct backtrace): ..here.
128 (Qautomatic_gc, profiler_memory_running): Declare vars.
129 (malloc_probe, syms_of_profiler): Declare functions.
130 * xdisp.c (Qautomatic_redisplay): New constant.
131 (redisplay_internal): Record itself in backtrace_list.
132 (syms_of_xdisp): Define Qautomatic_redisplay.
133
134 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
135
136 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
137
138 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
139
140 Prefer POSIX timers if available.
141 They avoid a race if the timer is too close to the current time.
142 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
143 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
144 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
145
146 2012-09-25 Eli Zaretskii <eliz@gnu.org>
147
148 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
149 CHAR_STRING_ADVANCE.
150 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
151 STRING_CHAR_ADVANCE.
152
153 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
154
155 Move Vlibrary_cache to emacs.c and reset before dumping.
156
157 * lisp.h (reset_image_types): Declare.
158 [WINDOWSNT] (Vlibrary_cache): Declare.
159
160 * image.c (reset_image_types): New function.
161
162 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
163 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
164 (Fdump_emacs): Reset Vlibrary_cache and image_types.
165
166 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
167 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
168
169 * w32.h (Vlibrary_cache): Do not declare.
170
171 2012-09-25 Eli Zaretskii <eliz@gnu.org>
172
173 * w32proc.c (sys_signal): Handle all signals defined by the
174 MS-Windows runtime, not just SIGCHLD. Actually install the signal
175 handlers for signals supported by Windows. Don't override
176 term_ntproc as the handler for SIGABRT.
177 (sigaction): Rewrite to call sys_signal instead of duplicating its
178 code.
179 (sys_kill): Improve commentary.
180
181 * w32.c (term_ntproc): Accept (and ignore) one argument, for
182 consistency with a signature of a signal handler. All callers
183 changed.
184 (init_ntproc): Accept an argument DUMPING. If dumping, don't
185 install term_ntproc as a signal handler for SIGABRT, as that
186 should be done by the dumped Emacs.
187
188 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
189
190 * w32select.c (term_w32select): Protect against repeated
191 invocation by setting clipboard_owner to NULL after calling
192 DestroyWindow.
193
194 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
195 and term_ntproc to their modified signatures.
196
197 * character.c (char_string, string_char): Remove calls to
198 MAYBE_UNIFY_CHAR. See the discussion starting at
199 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
200 for the details.
201
202 2012-09-25 Chong Yidong <cyd@gnu.org>
203
204 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
205
206 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
207
208 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
209 when encountering an unknown bytecode.
210
211 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
212
213 image.c, indent.c: Use bool for booleans.
214 * dispextern.h (struct image_type): Members valid_p, load, init
215 now return bool, not int. All uses changed.
216 * image.c: Omit unnecessary static decls.
217 (x_create_bitmap_mask, x_build_heuristic_mask):
218 Return void, not int, since callers don't care about the return value.
219 (x_create_bitmap_mask, define_image_type, valid_image_p)
220 (struct image_keyword, parse_image_spec, image_spec_value)
221 (check_image_size, image_background)
222 (image_background_transparent, x_clear_image_1)
223 (postprocess_image, lookup_image, x_check_image_size)
224 (x_create_x_image_and_pixmap, xbm_image_p)
225 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
226 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
227 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
228 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
229 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
230 (png_image_p, init_png_functions, png_load_body, png_load)
231 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
232 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
233 (init_gif_functions, gif_load, imagemagick_image_p)
234 (imagemagick_load_image, imagemagick_load, svg_image_p)
235 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
236 (gs_load):
237 * nsimage.m (ns_load_image):
238 * nsterm.m (ns_defined_color):
239 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
240 * xfns.c (x_defined_color):
241 * xterm.c (x_alloc_lighter_color_for_widget)
242 (x_alloc_nearest_color_1, x_alloc_nearest_color)
243 (x_alloc_lighter_color):
244 * indent.c (disptab_matches_widthtab, current_column)
245 (scan_for_column, string_display_width, indented_beyond_p)
246 (compute_motion, vmotion, Fvertical_motion):
247 Use bool for booleans.
248
249 2012-09-24 Chong Yidong <cyd@gnu.org>
250
251 * chartab.c (Fset_char_table_default): Obsolete function removed.
252
253 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
254
255 Move pid_t related decls out of lisp.h.
256 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
257 (interruptible_wait_for_termination):
258 Move these decls from lisp.h to syswait.h, since they use pid_t.
259 Needed on FreeBSD; see Herbert J. Skuhra in
260 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
261 * callproc.c: Include syswait.h.
262
263 gnutls.c, gtkutil.c: Use bool for boolean.
264 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
265 (emacs_gnutls_handle_error):
266 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
267 (xg_hide_tooltip, xg_create_frame_widgets)
268 (create_dialog, xg_uses_old_file_dialog)
269 (xg_get_file_with_chooser, xg_get_file_with_selection)
270 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
271 (xg_item_label_same_p, xg_update_menubar)
272 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
273 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
274 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
275 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
276 (update_frame_tool_bar, free_frame_tool_bar):
277 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
278 * nsmenu.m (ns_update_menubar):
279 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
280 * xfns.c (Fx_show_tip) [USE_GTK]:
281 Use bool for boolean.
282 * gtkutil.c (xg_update_frame_menubar):
283 * xmenu.c (update_frame_menubar):
284 Return void, not int, since caller ignores return value.
285 * gtkutil.c (xg_change_toolbar_position):
286 Return void, not 1.
287
288 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
289
290 * makefile.w32-in (BLOCKINPUT_H): Remove.
291 (SYSSIGNAL_H): New macro.
292 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
293 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
294 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
295 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
296 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
297 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
298 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
299 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
300 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
301 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
302 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
303 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
304 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
305 ($(BLD)/w32xfns.$(O)): Update dependencies.
306
307 2012-09-23 Eli Zaretskii <eliz@gnu.org>
308
309 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
310 fatal_error_backtrace.
311
312 * w32proc.c (sys_kill): Undo last change: don't do anything when
313 invoked to deliver SIGABRT to our own process. This is now
314 handled by emacs_raise.
315
316 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
317
318 * w32term.c (w32_read_socket): Remove leftover reference to
319 interrupt_input_pending.
320
321 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
322
323 Do not use SA_NODEFER.
324 Problem reported by Dani Moncayo in
325 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
326 * alloc.c (die):
327 * sysdep.c (emacs_abort): Do not reset signal handler.
328 * emacs.c (terminate_due_to_signal): Reset signal handler here.
329 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
330 wanted even on POSIXish hosts, and it doesn't work on Windows.
331
332 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
333
334 * xterm.c (x_term_init): Call fixup_locale before and after calling
335 gtk_init (Bug#12392).
336
337 2012-09-23 Chong Yidong <cyd@gnu.org>
338
339 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
340 Vdynamic_library_alist.
341
342 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
343 (Fgnutls_available_p): Caller changed.
344
345 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
346 (Flibxml_parse_xml_region): Likewise.
347
348 * dispextern.h (struct image_type): Remove arg from init function.
349
350 * image.c (Finit_image_library, lookup_image_type)
351 (define_image_type): Remove now-unneeded second arg.
352 (init_xpm_functions, init_png_functions, init_jpeg_functions)
353 (init_tiff_functions, init_gif_functions, init_svg_functions):
354 Arglist and w32_delayed_load calling convention changed.
355 (gs_type): Remove init_gs_functions; there is no such function.
356 (valid_image_p, make_image): Fix caller to lookup_image_type.
357
358 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
359
360 Simplify and avoid signal-handling races (Bug#12471).
361 * alloc.c (die):
362 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
363 Avoid recursive loop if there's a fatal error in the function itself.
364 * atimer.c (pending_atimers):
365 * blockinput.h: Don't include "atimer.h"; no longer needed.
366 (interrupt_input_pending): Remove. All uses removed.
367 pending_signals now counts both atimers and ordinary interrupts.
368 This is less racy than having three separate pending-signal flags.
369 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
370 (input_blocked_p):
371 Rename from their upper-case counterparts BLOCK_INPUT,
372 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
373 INPUT_BLOCKED_P, and turn into functions. All uses changed.
374 This makes it easier to access volatile variables more accurately.
375 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
376 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
377 that's more reliable if the code is buggy and sets
378 interrupt_input_blocked to a negative value. All uses changed.
379 * atimer.c (deliver_alarm_signal):
380 Remove. No need to deliver this to the parent; any thread can
381 handle this signal now. All uses replaced by underlying handler.
382 * atimer.c (turn_on_atimers):
383 * dispnew.c (handle_window_change_signal):
384 * emacs.c (handle_danger_signal):
385 * keyboard.c (kbd_buffer_get_event):
386 Don't reestablish signal handler; not needed with sigaction.
387 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
388 (UNBLOCK_INPUT_TO):
389 Rework to avoid unnecessary accesses to volatile variables.
390 (UNBLOCK_INPUT_TO): Now a function.
391 (totally_unblock_input, unblock_input): New decls.
392 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
393 (init_data): Remove. Necessary stuff now done in init_signal.
394 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
395 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
396 (fatal_error_code): Remove; no longer needed.
397 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
398 it doesn't always backtrace. All uses changed. No need to reset
399 signal to default, since sigaction and/or die does that for us now.
400 Use emacs_raise (FOO), not kill (getpid (), FOO).
401 (main): Check more-accurately whether we're dumping.
402 Move fatal-error setup to sysdep.c
403 * floatfns.c: Do not include "syssignal.h"; no longer needed.
404 * gtkutil.c (xg_get_file_name, xg_get_font):
405 Remove no-longer-needed signal-mask manipulation.
406 * keyboard.c, process.c (POLL_FOR_INPUT):
407 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
408 * keyboard.c (read_avail_input): Remove.
409 All uses replaced by gobble_input.
410 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
411 (kbd_buffer_store_event_hold, gobble_input):
412 (record_asynch_buffer_change) [USABLE_SIGIO]:
413 (store_user_signal_events):
414 No need to mess with signal mask.
415 (gobble_input): If blocking input and there are terminals, simply
416 set pending_signals to 1 and return. All hooks changed to not
417 worry about whether input is blocked.
418 (process_pending_signals): Clear pending_signals before processing
419 them, in case a signal comes in while we're processing.
420 By convention callers now test pending_signals before calling us.
421 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
422 New functions, to support changes to blockinput.h.
423 (handle_input_available_signal): Now extern.
424 (reinvoke_input_signal): Remove. All uses replaced by
425 handle_async_input.
426 (quit_count): Now volatile, since a signal handler uses it.
427 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
428 All callers changed. Block SIGINT only if not already blocked.
429 Clear sigmask reliably, even if Fsignal returns, which it can.
430 Omit unnecessary accesses to volatile var.
431 (quit_throw_to_read_char): No need to restore sigmask.
432 * keyboard.c (gobble_input, handle_user_signal):
433 * process.c (wait_reading_process_output):
434 Call signal-handling code rather than killing ourselves.
435 * lisp.h: Include <float.h>, for...
436 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
437 (pending_signals): Now volatile.
438 (syms_of_data): Now const if IEEE floating point.
439 (handle_input_available_signal) [USABLE_SIGIO]:
440 (terminate_due_to_signal, record_child_status_change): New decls.
441 * process.c (create_process): Avoid disaster if memory is exhausted
442 while we're processing a vfork, by tightening the critical section
443 around the vfork.
444 (send_process_frame, process_sent_to, handle_pipe_signal)
445 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
446 ignores SIGPIPE.
447 (send_process): No need for setjmp/longjmp any more, since the
448 SIGPIPE stuff is now gone. Instead, report an error if errno
449 is EPIPE.
450 (record_child_status_change): Now extern. PID and W are now args.
451 Return void, not bool. All callers changed.
452 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
453 Remove. All uses removed. This bug should be fixed now in a
454 different way.
455 (wait_for_termination_1): Use waitpid rather than sigsuspend,
456 and record the child status change directly. This avoids the
457 need to futz with the signal mask.
458 (process_fatal_action): Move here from emacs.c.
459 (emacs_sigaction_flags): New function, containing
460 much of what used to be in emacs_sigaction_init.
461 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
462 caught by emacs, to make races less likely.
463 (deliver_process_signal): Rename from handle_on_main_thread.
464 All uses changed.
465 (BACKTRACE_LIMIT_MAX): Now at top level.
466 (thread_backtrace_buffer, threadback_backtrace_pointers):
467 New static vars.
468 (deliver_thread_signal, deliver_fatal_thread_signal):
469 New functions, for more-accurate delivery of thread-specific signals.
470 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
471 (deliver_arith_signal): Handle in this thread, not
472 in the main thread, since it's triggered by this thread.
473 (maybe_fatal_sig): New function.
474 (init_signals): New arg DUMPING so that we can be more accurate
475 about whether we're dumping. Caller changed.
476 Treat thread-specific signals differently from process-general signals.
477 Block all signals while handling fatal error; that's safer.
478 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
479 on IEEE hosts.
480 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
481 Ignore SIGPIPE unless batch.
482 (emacs_backtrace): Output backtrace for the appropriate thread,
483 which is not necessarily the main thread.
484 * syssignal.h: Include <stdbool.h>.
485 (emacs_raise): New macro.
486 * xterm.c (x_connection_signal): Remove; no longer needed
487 now that we use sigaction.
488 (x_connection_closed): No need to mess with sigmask now.
489 (x_initialize): No need to reset SIGPIPE handler here, since
490 init_signals does this for us now.
491
492 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
493
494 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
495 background rect may be larger (Bug#12245).
496
497 2012-09-23 Chong Yidong <cyd@gnu.org>
498
499 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
500
501 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
502
503 * .gdbinit: Just stop at fatal_error_backtrace.
504 See Stefan Monnier's request in
505 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
506 Remove no-longer-used query of system type.
507
508 2012-09-22 Chong Yidong <cyd@gnu.org>
509
510 * search.c (Freplace_match): Doc fix (Bug#12325).
511
512 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
513
514 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
515 (Fline_end_position): Doc fix.
516
517 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
518
519 2012-09-22 Chong Yidong <cyd@gnu.org>
520
521 * dispextern.h (struct image_type): Add new slot, storing a type
522 initialization function.
523
524 * image.c (define_image_type): Call the image initializer function
525 if it is defined. Arguments and return value changed.
526 (valid_image_p, make_image): Callers changed.
527 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
528 (gif_type, imagemagick_type, svg_type, gs_type):
529 Add initialization functions.
530 (Finit_image_library): Call lookup_image_type.
531 (CHECK_LIB_AVAILABLE): Macro deleted.
532 (lookup_image_type): Call define_image_type here, rather than via
533 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
534 (syms_of_image): Move define_image_type calls for xbm_type and
535 pbm_type to lookup_image_type.
536
537 2012-09-22 Eli Zaretskii <eliz@gnu.org>
538
539 * keyboard.c (timer_check_2): Move calculation of 'timers' and
540 'idle_timers' from here ...
541 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
542 lists, to avoid infloops when the timer does something stupid,
543 like reinvoke itself with the same or smaller time-out.
544 (Bug#12447)
545
546 2012-09-22 Martin Rudalics <rudalics@gmx.at>
547
548 * window.c (Fsplit_window_internal): Handle only Qt value of
549 Vwindow_combination_limit separately.
550 (Qtemp_buffer_resize): New symbol.
551 (Vwindow_combination_limit): New default value.
552 Rewrite doc-string.
553
554 2012-09-22 Eli Zaretskii <eliz@gnu.org>
555
556 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
557 the new overlay string. (Bug#10159)
558
559 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
560
561 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
562 or that fprintf is async-signal-safe. POSIX doesn't require
563 either assumption.
564
565 2012-09-22 Chong Yidong <cyd@gnu.org>
566
567 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
568 (Bug#8207).
569
570 2012-09-22 Kenichi Handa <handa@gnu.org>
571
572 * composite.c (composition_reseat_it): Handle the case that a
573 grapheme cluster is not covered by a single font (Bug#12352).
574
575 2012-09-21 Chong Yidong <cyd@gnu.org>
576
577 * image.c (define_image_type): Avoid adding duplicate types to
578 image_types (Bug#12463). Suggested by Jörg Walter.
579
580 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
581
582 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
583 (print_load_command_name): Add case LC_DATA_IN_CODE.
584 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
585
586 2012-09-21 Glenn Morris <rgm@gnu.org>
587
588 * eval.c (Frun_hook_with_args_until_success)
589 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
590
591 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
592
593 * fileio.c (Ffile_selinux_context): Only call freecon when
594 lgetfilecon succeeded.
595 (Fset_file_selinux_context): Likewise. (Bug#12444)
596
597 2012-09-21 Eli Zaretskii <eliz@gnu.org>
598
599 * xdisp.c (try_window_reusing_current_matrix): Under bidi
600 reordering, locate the cursor by calling set_cursor_from_row; if
601 that fails, clear the desired glyph matrix before returning a
602 failure indication to the caller. Fixes leaving garbled display
603 when fast scrolling with a down-key. (Bug#12403)
604 (compute_stop_pos_backwards): Fix a typo that caused crashes while
605 scrolling through multibyte text.
606
607 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
608
609 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
610 calling mark_vectorlike since that's the one that marks the window.
611 (mark_discard_killed_buffers): Mark the final cdr.
612 * window.h (struct window): Move prev/next_buffers to the
613 non-standard fields.
614 * window.c (make_window): Initialize prev/next_buffers manually.
615
616 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
617
618 Omit unused arg EXPECTED from socket hooks.
619 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
620 * nsterm.m (ns_term_init):
621 * termhooks.h (struct terminal.read_socket_hook):
622 * w32inevt.c (w32_console_read_socket):
623 * w32term.c (w32_read_socket):
624 * xterm.c (XTread_socket):
625 Omit unused arg EXPECTED. All callers changed.
626 (store_user_signal_events): Return void, not int, since callers no
627 longer care about the return value. All uses changed.
628
629 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
630
631 * w32gui.h (XParseGeometry): Do not declare.
632
633 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
634
635 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
636 Ignore 'expected'. See Eli Zaretskii in
637 <http://bugs.gnu.org/12471#8> (last line).
638
639 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
640 (XParseGeometry): Now static. Substitute extremal values for
641 values that are out of range.
642
643 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
644
645 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
646
647 * nsfns.m (XParseGeometry): Remove.
648 (Fx_create_frame): Call x_set_offset to correctly interpret
649 top_pos in geometry.
650
651 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
652 (Fx_parse_geometry): If there is a space in string, call
653 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
654
655 2012-09-17 Eli Zaretskii <eliz@gnu.org>
656
657 * search.c (scan_buffer): Use character positions in calls to
658 region_cache_forward and region_cache_backward, not byte
659 positions. (Bug#12196)
660
661 * w32term.c (w32_read_socket): Set pending_signals to 1, like
662 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
663
664 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
665 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
666 emacs_blocked_malloc, now deleted.
667
668 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
669
670 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
671 The workaround was for improving performance on Solaris 2.4, but
672 is getting in the way now. Emacs will still work if someone is
673 still running Solaris 2.4 in a museum somewhere; Sun dropped
674 support for Solaris 2.4 in 2003.
675 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
676 * process.c (create_process) [HAVE_WORKING_VFORK]:
677 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
678 since Emacs no longer uses vfork on that platform.
679
680 2012-09-17 Glenn Morris <rgm@gnu.org>
681
682 * emacs.c: Use COPYRIGHT.
683
684 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
685
686 Remove configure's --without-sync-input option (Bug#12450).
687 When auditing signal-handling in preparation for cleaning it up,
688 I found that SYNC_INPUT has race conditions and would be a real
689 pain to fix. Since it's an undocumented and deprecated
690 configure-time option, now seems like a good time to remove it.
691 Also see <http://bugs.gnu.org/11080#16>.
692 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
693 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
694 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
695 (malloc_hysteresis):
696 (check_depth) [XMALLOC_OVERRUN_CHECK]:
697 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
698 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
699 (dont_register_blocks, bytes_used_when_reconsidered)
700 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
701 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
702 [!SYSTEM_MALLOC && !SYNC_INPUT]:
703 Remove. All uses removed.
704 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
705 implementation, one that depends on whether the new macro
706 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
707 is defined.
708 * atimer.c (run_timers, handle_alarm_signal):
709 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
710 (handle_async_input, process_pending_signals)
711 (handle_input_available_signal, init_keyboard):
712 * nsterm.m (ns_read_socket):
713 * process.c (wait_reading_process_output):
714 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
715 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
716 (emacs_write):
717 * xterm.c (XTread_socket):
718 Assume SYNC_INPUT.
719 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
720 * eval.c (handling_signal): Remove. All uses removed.
721 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
722 All uses replaced with the SYNC_INPUT version.
723 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
724 Remove decls.
725 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
726 Now static.
727
728 * font.c (Ffont_shape_gstring): Remove unused local.
729
730 2012-09-16 Glenn Morris <rgm@gnu.org>
731
732 * Makefile.in (clean): No longer run nextstep's clean.
733
734 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
735 (ns_frag): Remove.
736 (ns-app): Move here from ns.mk, and simplify.
737 (clean): Simplify nextstep entry.
738 * ns.mk: Remove file.
739
740 2012-09-17 Kenichi Handa <handa@gnu.org>
741
742 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
743 not covert the last few charactes.
744
745 2012-09-16 Kenichi Handa <handa@gnu.org>
746
747 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
748 here, but just check the validity of glyphs in the glyph-string.
749
750 2012-09-16 Martin Rudalics <rudalics@gmx.at>
751
752 * window.c (Fwindow_parameter, Fset_window_parameter):
753 Accept any window as argument (Bug#12452).
754
755 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
756
757 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
758 to ns_term_init to avoid memory leak.
759
760 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
761 explicit retain/release.
762 (ns_term_init): Only allow one display. Initialize outerpool and
763 ns_*_types.
764
765 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
766
767 Port _setjmp fix to POSIXish hosts as well as Microsoft.
768 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
769 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
770 the Microsoft problem in a different way, by altering ../nt/config.nt.
771
772 2012-09-15 Eli Zaretskii <eliz@gnu.org>
773
774 * w32xfns.c:
775 * w32uniscribe.c:
776 * w32term.c:
777 * w32select.c:
778 * w32reg.c:
779 * w32proc.c:
780 * w32menu.c:
781 * w32inevt.c:
782 * w32heap.c:
783 * w32font.c:
784 * w32fns.c:
785 * w32console.c:
786 * w32.c:
787 * w16select.c: Remove inclusion of setjmp.h, as it is now included
788 by lisp.h. This completes removal of setjmp.h inclusion
789 erroneously announced in the previous commit. (Bug#12446)
790
791 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
792 more accurate.
793
794 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
795 not defined as a macro. The latter happens on MS-Windows.
796 (Bug#12446)
797
798 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
799
800 Port better to POSIX hosts lacking _setjmp (Bug#12446).
801 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
802 Some instances of '#include <setjmp.h>' removed, if the
803 only reason for the instance was because "lisp.h" was included.
804 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
805 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
806 and _longjmp with the new symbols. Emacs already uses _setjmp if
807 available, so this change affects only POSIXish hosts that have
808 sigsetjmp but not _setjmp, such as some versions of Solaris and
809 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
810 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
811 (png_load_body) [HAVE_PNG]:
812 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
813 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
814 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
815 since PNG requires jmp_buf. This is the only exception to the
816 general rule that we now use sys_setjmp and sys_longjmp.
817 This exception is OK since this code does not change the signal
818 mask or longjmp out of a signal handler.
819
820 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
821
822 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
823 Include "syssignal.h", for 'main_thread'.
824
825 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
826
827 Avoid out-of-range marker position (Bug#12426).
828 * insdel.c (replace_range, replace_range_2):
829 Adjust markers before overlays, as suggested by comments.
830 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
831 Remove redundant check before calling offset_intervals.
832
833 2012-09-14 Martin Rudalics <rudalics@gmx.at>
834
835 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
836 current buffer (Bug#12387).
837
838 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
839
840 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
841
842 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
843
844 Use a more backwards-compatible timer format (Bug#12430).
845 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
846 vector element, not from the 4th, since PSECS is now at the end.
847 (Fcurrent_idle_time): Doc fix.
848
849 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
850
851 Function to mark objects and remove killed buffers at once.
852 * alloc.c (discard_killed_buffers): Rename to ...
853 (mark_discard_killed buffers) ... new name. Add marking
854 of remaining objects. Fix comment. Adjust users.
855 (mark_object): Do not touch frame buffer lists here.
856 * frame.c (delete_frame): Reset frame buffer lists here.
857
858 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
859
860 Better workaround for GNOME bug when --enable-gcc-warnings.
861 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
862 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
863 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
864
865 Simplify SIGIO usage (Bug#12408).
866 The code that dealt with SIGIO was crufty and confusing, e.g., it
867 played tricks like "#undef SIGIO" but these tricks were not used
868 consistently. Simplify mostly by not #undeffing standard symbols,
869 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
870 or not as we please) rather than "defined SIGIO" (standard symbol
871 that we probably shouldn't #undef).
872 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
873 Modules that need it can include it.
874 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
875 * dispextern.h (ignore_sigio): New decl.
876 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
877 unconditionally, since it's now a no-op if !USABLE_SIGIO.
878 * emacs.c (shut_down_emacs):
879 * keyboard.c (kbd_buffer_store_event_hold):
880 Use ignore_sigio rather than invoking 'signal' directly.
881 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
882 for FIONREAD.
883 (FIONREAD, SIGIO): Do not #undef.
884 (tty_read_avail_input): Use #error rather than a syntax error.
885 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
886 for I_PIPE, used by SETUP_SLAVE_PTY.
887 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
888 * sysdep.c (croak): Remove; no longer needed. This bit of
889 temporary code, with Fred N. Fish's comment that it's temporary,
890 has been in Emacs since at least 1992!
891 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
892 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
893 * syssignal.h (croak): Remove decl.
894 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
895 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
896 now that we're termios-only.
897 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
898 * term.c (dissociate_if_controlling_tty): Use #error rather than
899 a run-time error.
900
901 Work around GCC and GNOME bugs when --enable-gcc-warnings.
902 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
903 to work around GNOME bug 683906.
904 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
905 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
906 This works around GCC bug 54561.
907
908 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
909
910 More fixes for 'volatile' and setjmp/longjmp.
911 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
912 * image.c (struct png_load_context) [HAVE_PNG]: New type.
913 (png_load_body) [HAVE_PNG]:
914 (jpeg_load_body) [HAVE_JPEG]:
915 New function, with most of the old parent function's body.
916 (png_load) [HAVE_PNG]:
917 (jpeg_load) [HAVE_JPEG]:
918 Invoke the new function, to avoid longjmp munging our locals.
919 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
920 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
921 longjmp is passed 2, as the C standard doesn't guarantee this.
922 Instead, store the failure code into mgr->failure_code.
923
924 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
925
926 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
927 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
928 (syms_of_keyboard): Remove support for unread-command-char.
929
930 2012-09-12 Eli Zaretskii <eliz@gnu.org>
931
932 * w32proc.c (sys_kill): If PID is our process ID and the signal is
933 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
934 violation. (Bug#12426)
935
936 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
937
938 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
939
940 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
941
942 * eval.c: Add `inhibit-debugger'.
943 (Qinhibit_debugger): New symbol.
944 (call_debugger): Bind it instead of Qdebug_on_error.
945 (maybe_call_debugger): Test Vinhibit_debugger.
946 (syms_of_eval): Define inhibit-debugger.
947 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
948 (syms_of_xdisp): Remove inhibit-debug-on-message.
949
950 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
951
952 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
953 If a nonvolatile local variable is written before a _longjmp to
954 the frame containing the variable, and is read after the _longjmp,
955 the value read is indeterminate. Some local variables of type
956 'struct handler' and 'struct catchtag' are used in this way, so
957 mark each of their slots as volatile if the slot can be set before
958 _longjmp and read afterwards.
959 * lisp.h (struct handler): var and chosen_clause are now volatile.
960 (struct catchtag): val, next, and pdlcount are now volatile.
961
962 * bidi.c (bidi_push_it, bidi_pop_it):
963 * fns.c (copy_hash_table):
964 * image.c (define_image_type):
965 * keyboard.c (kbd_buffer_store_event_hold):
966 * process.c (Fprocess_send_eof):
967 * xfaces.c (x_create_gc) [HAVE_NS]:
968 * xgselect.c (xg_select):
969 Prefer assignment to memcpy when either will do.
970
971 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
972 Use pointer-to-a-pointer to simplify and avoid a NILP check each
973 time an item is removed. No need to mark this function 'inline';
974 the compiler knows better than we do.
975
976 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
977
978 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
979 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
980 to change_frame_size (Bug#12388).
981 (windowDidResize:): Pass YES to updateFrameSize.
982
983 * nsterm.h: Add delay parameter to updateFrameSize.
984
985 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
986
987 Discard killed buffers from deleted window and frame objects.
988 This reduces an amount of references to killed buffers and
989 helps GC to reclaim them faster.
990 * alloc.c (discard_killed_buffers): New function.
991 (mark_object): Use it for deleted windows and frames.
992 (mark_object): If symbol's value is set up for a killed buffer
993 or deleted frame, restore it's global binding.
994 * data.c (swap_in_global_binding): Add GC notice.
995 (swap_in_symval_forwarding): Use convenient set_blv_where.
996 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
997 * window.h: ... to here.
998
999 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1000
1001 Convenient macro to check whether the buffer is live.
1002 * buffer.h (BUFFER_LIVE_P): New macro.
1003 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1004 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1005
1006 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1007
1008 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1009 composition cases (Bug#12364).
1010
1011 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1012 overhang of succeeding glyphs overlapping box cursor.
1013
1014 * w32term.c (x_draw_glyph_string): Likewise.
1015
1016 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1017
1018 Simplify, document, and port floating-point (Bug#12381).
1019 The porting part of this patch fixes bugs on non-IEEE platforms
1020 with frexp, ldexp, logb.
1021 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1022 Now static.
1023 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1024 support, by removing commented-out code and briefly listing the
1025 C89 functions excluded. The commented-out stuff was confusing
1026 maintenance, e.g., we thought we needed cbrt but it was commented out.
1027 (logb): Remove decl; no longer needed.
1028 (isfinite): New macro, if not already supplied.
1029 (isnan): Don't replace any existing macro.
1030 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1031 are present on all C89 platforms.
1032 (Ffrexp): Do not special-case zero, as frexp does the right thing
1033 for that case.
1034 (Flogb): Do not use logb, as it doesn't have the desired meaning
1035 on hosts that use non-base-2 floating point. Instead, stick with
1036 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1037 frexp, to avoid getting an unspecified result.
1038
1039 * xdisp.c (Qinhibit_debug_on_message): Now static.
1040
1041 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1042
1043 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1044 NSBezierPath (Bug#12131).
1045
1046 2012-09-10 Chong Yidong <cyd@gnu.org>
1047
1048 * fns.c (Fdelq, Fdelete): Doc fix.
1049
1050 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1051
1052 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1053 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1054
1055 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1056
1057 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1058 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1059 Use it.
1060
1061 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1062
1063 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1064 left fringe if the window has a left margin. This avoids leaving
1065 traces of the cursor because its leftmost pixel is not drawn over.
1066
1067 * dispnew.c (update_window_line): When the left margin area of a
1068 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1069 that screen line. (Bug#12277)
1070
1071 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1072
1073 Assume C89 or later for math functions (Bug#12381).
1074 This simplifies the code, and makes it a bit smaller and faster,
1075 and (most important) makes it easier to clean up signal handling
1076 since we can stop worring about floating-point exceptions in
1077 library code. That was a problem before C89, but the problem
1078 went away many years ago on all practical Emacs targets.
1079 * data.c, image.c, lread.c, print.c:
1080 Don't include <math.h>; no longer needed.
1081 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1082 might be autoconfigured, as that never happens.
1083 * data.c (fmod):
1084 * doprnt.c (DBL_MAX_10_EXP):
1085 * print.c (DBL_DIG):
1086 Remove. C89 or later always defines these.
1087 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1088 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1089 (arith_error, domain_error, domain_error2):
1090 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1091 no longer needed -- we simply return what C returns. All uses removed.
1092 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1093 the wrapped code.
1094 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1095 Remove. All uses expanded, as these macros are no longer used
1096 more than once and are now more trouble than they're worth.
1097 (Ftan): Use tan, not sin / cos.
1098 (Flogb): Assume C89 frexp.
1099 (fmod_float): Assume C89 fmod.
1100 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1101 (init_floatfns): Remove. All uses removed.
1102
1103 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1104
1105 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1106 compositeToPoint for OSX < 10.6 (Bug#12390).
1107
1108 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1109
1110 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1111 This produces more-accurate results.
1112
1113 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1114
1115 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1116 changes (Bug#12088).
1117
1118 2012-09-08 Chong Yidong <cyd@gnu.org>
1119
1120 * syntax.c (Fstring_to_syntax): Doc fix.
1121
1122 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1123
1124 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1125 in the internal border.
1126 (x_set_window_size): Remove static variables and their usage.
1127 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1128 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1129 Remove fringe/internal border adjustment (Bug#11052).
1130 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1131 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1132 (ns_fix_rect_ibw): Remove.
1133 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1134 (ns_dumpglyphs_box_or_relief): Ditto.
1135 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1136 adjustment.
1137 (ns_dumpglyphs_image): Ditto.
1138 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1139 border adjustment.
1140 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1141 their usage. Add fringe_extended_p and its use as in other terms.
1142 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1143 scroll bar was removed.
1144 (updateFrameSize): New function.
1145 (windowDidResize): Move code to updateFrameSize and call it.
1146
1147 * nsterm.h (EmacsView): Add updateFrameSize.
1148
1149 2012-09-07 Chong Yidong <cyd@gnu.org>
1150
1151 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1152
1153 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1154
1155 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1156
1157 More signal-handler cleanup (Bug#12327).
1158 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1159 Problem introduced when merging patches. Noted by Eli Zaretskii in
1160 <http://bugs.gnu.org/12327#67>.
1161 * floatfns.c: Comment fix.
1162 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1163 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1164 and anyway the declaration is harmless even if SIGDANGER is not defined.
1165 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1166 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1167 source files not surprisingly expected syssignal.h to define, or
1168 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1169 Include <sys/ioctl.h>, for FIONREAD.
1170 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1171 This eliminates a problem whereby other files mysteriously had
1172 to include "syssignal.h" before including "systty.h" if they
1173 wanted to use "#ifdef SIGIO".
1174
1175 2012-09-07 Eli Zaretskii <eliz@gnu.org>
1176
1177 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1178
1179 * w32.c (sigemptyset): Empty the set.
1180 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1181
1182 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1183
1184 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1185
1186 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1187 (mark_object): Likewise for frame objects.
1188
1189 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1190
1191 * syssignal.h (handle_on_main_thread): Always declare,
1192 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1193 This ports to platforms without HAVE_PTHREAD.
1194
1195 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1196
1197 Signal-handler cleanup (Bug#12327).
1198 Emacs's signal handlers were written in the old 4.2BSD style with
1199 sigblock and sigmask and so forth, and this led to some
1200 inefficiencies and confusion. Rewrite these to use
1201 pthread_sigmask etc. without copying signal sets around. Also,
1202 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1203 'signal', and instead use functions that do not attempt to take
1204 over the system name space. This patch causes Emacs's text
1205 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1206 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1207 Do not include <signal.h> or "syssignal.h", as these
1208 modules do not use signals.
1209 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1210 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1211 Do not include <signal.h>, as "syssignal.h" does that for us now.
1212 * atimer.c (sigmask_atimers): New function.
1213 (block_atimers, unblock_atimers): New functions,
1214 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1215 All uses replaced.
1216 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1217 no longer needed here.
1218 * emacs.c (main): Inspect existing signal handler with sigaction,
1219 so that there's no need to block and unblock SIGHUP.
1220 * sysdep.c (struct save_signal): New member 'action', replacing
1221 old member 'handler'.
1222 (save_signal_handlers, restore_signal_handlers):
1223 Use sigaction instead of 'signal' to save and restore.
1224 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1225 New function. All users of 'signal' modified to use set_sighandler
1226 if they're writeonly, and to use sys_signal if they're read+write.
1227 (emacs_sigaction_init, forwarded_signal): New functions.
1228 (sys_signal): Remove. All uses replaced by calls to sigaction
1229 and emacs_sigaction_init, or by direct calls to 'signal'.
1230 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1231 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1232 all uses replaced by pthread_sigmask etc. calls.
1233 * syssignal.h: Include <signal.h>.
1234 (emacs_sigaction_init, forwarded_signal): New decls.
1235 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1236 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1237 (sigmask, sys_sigmask): Remove; no longer needed.
1238 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1239 (sigblock, sigunblock, sigfree):
1240 (sigsetmask) [!defined sigsetmask]:
1241 Remove. All uses replaced by pthread_sigmask.
1242 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1243 no longer need to be replaced, and its typical old uses
1244 are now done via emacs_sigaction_init and sigaction.
1245 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1246 (sys_sigdel): Remove; unused.
1247 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1248
1249 2012-09-06 Eli Zaretskii <eliz@gnu.org>
1250
1251 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1252 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1253
1254 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1255
1256 Explicitly mark buffer_defaults and buffer_local_symbols.
1257 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1258 mark_local_symbols here.
1259 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1260 since special buffers aren't marked here any more.
1261 (allocate_buffer): Chain new buffer with all_buffers here...
1262 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1263 not here.
1264 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1265 (syms_of_buffer): Remove staticpro of the above.
1266 (init_buffer_once): Set names for buffer_defaults and
1267 buffer_local_symbols.
1268
1269 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1270
1271 Use bool for booleans in font-related modules.
1272 * font.c (font_intern_prop, font_style_to_value)
1273 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1274 (generate_otf_features, font_check_otf_features, font_check_otf)
1275 (font_match_p, font_list_entities, font_at):
1276 * fontset.c (fontset_id_valid_p, reorder_font_vector
1277 (fontset_find_font, Fset_fontset_font)
1278 (face_suitable_for_char_p) [0]:
1279 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1280 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1281 (m17n_flt_initialized, ftfont_shape_by_flt):
1282 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1283 * nsfont.m (nsfont_draw):
1284 * w32font.c (w32font_draw):
1285 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1286 Use bool for booleans.
1287 * font.h: Adjust to above API changes.
1288 (struct font, struct font_driver, struct font_driver_list):
1289 Use bool for booleans.
1290 (struct font): Remove useless member encoding_type.
1291 All users removed.
1292 * fontset.c, xftfont.c: Omit unnecessary static decls.
1293
1294 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1295
1296 * alloc.c (mark_object): Revert window marking code
1297 since it's unsafe for the Fset_window_configuration.
1298
1299 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1300
1301 Fix race conditions with signal handlers and errno (Bug#12327).
1302 Be more systematic about preserving errno whenever a signal
1303 handler returns, even if it's not in the main thread. Do this by
1304 renaming signal handlers to distinguish between signal delivery
1305 and signal handling. All uses changed.
1306 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1307 * data.c (deliver_arith_signal): Rename from arith_error.
1308 * dispnew.c (deliver_window_change_signal): Rename from
1309 window_change_signal.
1310 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1311 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1312 * keyboard.c (deliver_input_available_signal): Rename from
1313 input_available_signal.
1314 (deliver_user_signal): Rename from handle_user_signal.
1315 (deliver_interrupt_signal): Rename from interrupt_signal.
1316 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1317 (deliver_child_signal): Rename from sigchld_handler.
1318 * atimer.c (handle_alarm_signal):
1319 * data.c (handle_arith_signal):
1320 * dispnew.c (handle_window_change_signal):
1321 * emacs.c (handle_fatal_signal, handle_danger_signal):
1322 * keyboard.c (handle_input_available_signal):
1323 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1324 * process.c (handle_pipe_signal, handle_child_signal):
1325 New functions, with the actual signal-handling code taken from the
1326 original respective signal handlers, sans the sporadic attempts to
1327 preserve errno, since that's now done by handle_on_main_thread.
1328 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1329 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1330 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1331 Move to sysdep.c.
1332 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1333 Move initialization of main_thread to sysdep.c's init_signals.
1334 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1335 our usage, and simplifies the mainline code.
1336 (record_child_status_change): New static function, as a helper
1337 for handle_child_signal, and with most of the old child handler's
1338 contents.
1339 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1340 (handle_child_signal): Use the above.
1341 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1342 Moved here from emacs.c.
1343 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1344 code moved here from emacs.c's main function.
1345 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1346 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1347 This lets callers save and restore errno properly.
1348
1349 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1350
1351 Remove redundant or unused things here and there.
1352 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1353 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1354 * editfns.c (Fcompare_buffer_substrings): Likewise.
1355 * frame.h (struct terminal, struct font_driver_list):
1356 Remove redundant declarations.
1357 * window.h (Qleft, Qright): Likewise.
1358
1359 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1360
1361 Do not mark objects from deleted buffers, windows and frames.
1362 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1363 (mark_object): Likewise for windows and frames.
1364
1365 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1366
1367 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1368 buffer_defaults and buffer_local_symbols as valid objects.
1369 Return special value to denote them.
1370
1371 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1372
1373 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1374 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1375 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1376 (file_name_absolute_p, Fsubstitute_in_file_name):
1377 (check_executable, check_writable, Ffile_accessible_directory_p)
1378 (Fset_file_selinux_context, Fdefault_file_modes)
1379 (Finsert_file_contents, choose_write_coding_system)
1380 (Fwrite_region, build_annotations, a_write, e_write)
1381 (Fdo_auto_save):
1382 * filelock.c (boot_time_initialized, get_boot_time)
1383 (get_boot_time_1, lock_file_1, within_one_second):
1384 * floatfns.c (in_float):
1385 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1386 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1387 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1388 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1389 * window.c (compare_window_configurations):
1390 Use bool for booleans.
1391 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1392 (Fdefault_file_modes): Now mode_t, not int, for modes.
1393 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1394 (internal_delete_file): Now returns void, not a (boolean) int,
1395 since nobody was looking at the return value.
1396 * lisp.h, window.h: Adjust to above API changes.
1397
1398 * xdisp.c (set_message): Simplify and reindent last change.
1399
1400 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
1401
1402 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1403
1404 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1405
1406 * eval.c (call_debugger): Make the function non-static so that we
1407 can call it from set_message.
1408
1409 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1410 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1411
1412 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1413
1414 Give more-useful info on a fatal error (Bug#12328).
1415 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1416 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1417 of doing the work ourselves.
1418 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1419 do most of the work.
1420 (fatal_error_backtrace): New function, taken from the guts
1421 of the old fatal_error_signal, but with a new option to output
1422 a backtrace.
1423 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1424 info about the signal than just its number.
1425 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1426 * sysdep.c: Include <execinfo.h>
1427 (emacs_backtrace): New function, taken partly from the previous
1428 code of the 'die' function.
1429 (emacs_abort): Call fatal_error_backtrace rather than abort.
1430
1431 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1432
1433 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1434 eager (load-time) macro-expansion.
1435 * lisp.mk (lisp): Add macroexp.
1436
1437 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1438
1439 Simplify redefinition of 'abort' (Bug#12316).
1440 Do not try to redefine the 'abort' function. Instead, redo
1441 the code so that it calls 'emacs_abort' rather than 'abort'.
1442 This removes the need for the NO_ABORT configure-time macro
1443 and makes it easier to change the abort code to do a backtrace.
1444 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1445 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1446 Remove; sysdep.c's emacs_abort now takes its place.
1447 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1448 'abort' changed to use 'emacs_abort'.
1449 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1450 (abort) [!defined abort]: Rename to ...
1451 (emacs_abort): ... new name.
1452 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1453 the place of the old 'abort' in emacs.c.
1454 * w32.c, w32fns.c (abort): Do not #undef.
1455 * w32.c (emacs_abort): Rename from w32_abort.
1456
1457 2012-09-04 Eli Zaretskii <eliz@gnu.org>
1458
1459 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1460 offsets[j].dv, since the y axis of the screen coordinates points
1461 down, while the y axis of the font definition coordinates points
1462 up. This fixes display of Arabic diacritics such as KASRA and
1463 KASRATAN. (Bug#11860)
1464
1465 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1466
1467 Be more systematic about _setjmp vs setjmp.
1468 * alloc.c (test_setjmp, mark_stack):
1469 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1470 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1471 (png_load, my_error_exit, jpeg_load):
1472 * process.c (send_process_trap, send_process):
1473 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1474 The underscored versions are up to 30x faster on some hosts.
1475 Formerly, the code used setjmp+longjmp sometimes and
1476 _setjmp+_longjmp at other times, with no particular reason to
1477 prefer setjmp+longjmp.
1478
1479 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1480
1481 Fix minor problem found by static checking.
1482 * buffer.c (Fdelete_all_overlays): Return nil.
1483
1484 2012-09-03 Martin Rudalics <rudalics@gmx.at>
1485
1486 * buffer.c (Fdelete_all_overlays): New function.
1487
1488 2012-09-03 Chong Yidong <cyd@gnu.org>
1489
1490 * gtkutil.c: Add extern decl for Qxft.
1491
1492 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1493
1494 * emacs.c, eval.c: Use bool for boolean.
1495 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1496 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1497 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1498 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1499 (main, decode_env_path, Fdaemon_initialized):
1500 * eval.c (call_debugger, Finteractive_p, interactive_p):
1501 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1502 (maybe_call_debugger, Fbacktrace):
1503 * process.c (read_process_output, exec_sentinel):
1504 Use bool for booleans.
1505 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1506 All callers changed.
1507 * eval.c (interactive_p): Omit always-true boolean argument
1508 EXCLUDE_SUBRS_P. All callers changed.
1509 * dispextern.h, lisp.h: Reflect above API changes.
1510 * firstfile.c (dummy): Use the address of 'main', whose signature
1511 won't change, instead of the address of 'initialize', whose
1512 signature just changed from int to bool.
1513 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1514 * msdos.c (fatal_error_in_progress): ... from here.
1515 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1516 of incrementing it.
1517 (redisplay_internal, unwind_redisplay): Simply clear
1518 REDISPLAYING_P when unwinding, instead of saving its previous,
1519 always-false value and then restoring it.
1520
1521 Clean up some extern decls.
1522 Mostly, this hoists extern decls out of .c files and into .h files.
1523 That way, we're more likely to catch errors if the interfaces change.
1524 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1525 declare xg_mark_data.
1526 * dispextern.h (x_frame_parm_handlers):
1527 * font.h (Qxft):
1528 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1529 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1530 (Qultra_bold, Qoblique, Qitalic):
1531 Move extern decl here from .c file.
1532 * alloc.c (xg_mark_data) [USE_GTK]:
1533 * doc.c (Qclosure):
1534 * eval.c (Qlexical_binding):
1535 * fns.c (time) [!HAVE_UNISTD_H]:
1536 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1537 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1538 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1539 * lread.c (Qinternal_interpreter_environment):
1540 * minibuf.c (Qbuffer):
1541 * process.c (QCfamily, QCfilter):
1542 * widget.c (free_frame_faces):
1543 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1544 * xfont.c (x_clear_errors):
1545 * xterm.c (x_frame_parm_handlers):
1546 Remove now-redundant extern decls.
1547 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1548 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1549 Now static.
1550 * xfaces.c: Remove unnecessary static decls.
1551 * xterm.c (updating_frame): Remove decl of nonexistent object.
1552
1553 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1554 when building globals.h, as the objects that are not built on
1555 this host are not needed to compile C files on this host.
1556
1557 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1558
1559 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1560
1561 * frame.h: Add missing prototype for x_wm_set_size_hint.
1562
1563 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1564
1565 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1566 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1567 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1568 (Fsubstitute_command_keys):
1569 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1570 (save_excursion_save, save_excursion_restore)
1571 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1572 (format_time_string, general_insert_function)
1573 (make_buffer_string, make_buffer_string_both)
1574 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1575 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1576 (copy_text, insert_1, insert_1_both, insert_from_string)
1577 (insert_from_string_before_markers, insert_from_string_1)
1578 (insert_from_buffer, insert_from_buffer_1, replace_range)
1579 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1580 (del_range_2, modify_region):
1581 * intervals.c (intervals_equal, balance_possible_root_interval)
1582 (adjust_intervals_for_insertion, merge_properties_sticky)
1583 (graft_intervals_into_buffer, lookup_char_property)
1584 (adjust_for_invis_intang, set_point_both)
1585 (get_property_and_range, compare_string_intervals)
1586 (set_intervals_multibyte_1, set_intervals_multibyte):
1587 * keyboard.c (decode_timer):
1588 Use bool for boolean.
1589 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1590 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1591
1592 2012-09-02 Chong Yidong <cyd@gnu.org>
1593
1594 * keymap.c (push_key_description): Print M-TAB as C-M-i
1595 (Bug#11758).
1596
1597 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1598
1599 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1600 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1601 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1602 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1603 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1604 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1605 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1606
1607 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1608
1609 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1610 more than one grapheme cluster passed to the shaper: compute the
1611 offset adjustment values separately for each cluster. (Bug#11860)
1612
1613 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1614 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1615 about implicit conversions from integer to pointer.
1616
1617 2012-09-01 Daniel Colascione <dancol@dancol.org>
1618
1619 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1620 system used too early.
1621
1622 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1623
1624 Better seed support for (random).
1625 * emacs.c (main): Call init_random.
1626 * fns.c (Frandom): Set the seed from a string argument, if given.
1627 Remove long-obsolete Gentzel cruft.
1628 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1629 (init_random): New function.
1630
1631 2012-09-01 Daniel Colascione <dancol@dancol.org>
1632
1633 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1634 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1635 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1636 x_wm_set_size_hint, x_query_colors, x_real_positions,
1637 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1638 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1639 all of which have been moved to common code.
1640
1641 * xfaces.c: Include TERM_HEADER instead of listing all possible
1642 window-system headers.
1643
1644 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1645 to match header.
1646
1647 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1648 directly accessing frame internals.
1649
1650 * w32font.h: Include font.h. Define syms_of_w32font and
1651 globals_of_w32font.
1652
1653 * process.c: Include TERM_HEADER instead of listing all possible
1654 window-system headers.
1655
1656 * nsterm.h: Remove declarations now in frame.h.
1657 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
1658
1659 * menu.c: Include TERM_HEADER instead of listing all possible
1660 window-system headers.
1661
1662 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1663 window system.
1664
1665 * keyboard.c: Include TERM_HEADER instead of listing all possible
1666 window-system headers.
1667
1668 * image.c: Include TERM_HEADER instead of listing all possible
1669 window-system headers. Declare Vlibrary_cache when compiling for
1670 Windows.
1671
1672 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1673 window system declarations.
1674
1675 * frame.h: Move common functions here: set_frame_menubar,
1676 x_set_window_size, x_sync, x_get_focus_frame,
1677 x_set_mouse_position, x_set_mouse_pixel_position,
1678 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1679 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1680 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1681 x_activate_menubar, x_real_positions, x_bitmap_icon,
1682 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1683 and x_query_colors.
1684
1685 * frame.c: Include TERM_HEADER instead of listing all possible
1686 window-system headers.
1687
1688 * font.c: Include TERM_HEADER instead of listing all possible
1689 window-system headers.
1690
1691 * emacs.c: Include TERM_HEADER.
1692
1693 * dispnew.c: Include TERM_HEADER instead of listing all possible
1694 window-system headers.
1695
1696 * ccl.h: Include character.h.
1697
1698 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1699 the current window system; include in list of objects to link into
1700 Emacs.
1701
1702 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1703
1704 Remove mark_ttys function and fix tty_display_info initialization.
1705 * lisp.h (mark_ttys): Remove prototype.
1706 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1707 to mark_ttys because all possible values of 'top_frame' slot are
1708 the frames which are reachable from Vframe_list.
1709 * term.c (mark_ttys): Remove.
1710 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1711
1712 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1713
1714 Change struct frame bitfields from unsigned char to unsigned.
1715 * frame.h (struct frame): Change type of 'display_preempted',
1716 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1717 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1718 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1719 bitfields from unsigned char to unsigned.
1720
1721 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1722
1723 Remove unused member of struct x_output and struct w32_output.
1724 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1725 * w32term.h (struct w32_output): Likewise.
1726
1727 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1728
1729 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1730 does not become zero (Bug#12234).
1731
1732 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1733
1734 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1735 for GCC 4.7.1 x86-64.
1736
1737 2012-08-30 Glenn Morris <rgm@gnu.org>
1738
1739 * lread.c (init_lread): For out-of-tree builds, only add the
1740 source directory's site-lisp dir to the load-path if it exists,
1741 consistent with in-tree builds. (Bug#12302)
1742
1743 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1744
1745 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1746 button_values to NULL. Call setStykeMask so dialogs get a close button.
1747 (windowShouldClose:): Set window_closed.
1748 (dealloc): New member, free button_values.
1749 (process_dialog:): Make member function. Remove window argument,
1750 replace window with self. Count buttons and allocate and store values
1751 in button_values.
1752 (addButton:value:row:): value is int with the name tag. Call setTag
1753 with tag. Remove return self, declare return value as void.
1754 (addString:row:): Remove return self, declare return value as void.
1755 (addSplit): Remove return self, declare return value as void.
1756 (clicked:): Remove return self, declare return value as void.
1757 Set dialog_return to button_values[seltag]. Code formatting change.
1758 (initFromContents:isQuestion:): Adjust call to process_dialog.
1759 Code formatting change.
1760 (timeout_handler:): Set timer_fired to YES.
1761 (runDialogAt:): Set timer_fired to NO.
1762 Handle click on close button as quit.
1763
1764 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1765 Add window_closed and button_values. Add void as return value for
1766 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1767 Add process_dialog as new member.
1768
1769 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1770
1771 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1772 is not one of the heaps we manage. (Bug#12242)
1773
1774 2012-08-28 Glenn Morris <rgm@gnu.org>
1775
1776 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1777
1778 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1779
1780 * window.c (Fset_window_configuration): Remove handling of
1781 auto-buffer-name window parameter. Install revision of reverted
1782 fix.
1783
1784 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1785
1786 Do not allow to set major mode for a dead buffer.
1787 * buffer.c (Fset_buffer_major_mode): Signal an error
1788 if the buffer is dead.
1789 (Fother_buffer, other_buffer_safely): Remove redundant
1790 nested declaration.
1791
1792 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1793
1794 Always use set_buffer_if_live to restore original buffer at unwind.
1795 * buffer.h (record_unwind_current_buffer): New function.
1796 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1797 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1798 * undo.c, window.c: Adjust users.
1799 * buffer.c (set_buffer_if_live): Fix comment.
1800
1801 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1802
1803 Fix usage of set_buffer_internal.
1804 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1805 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1806 * coding.c (decode_coding): Omit redundant test.
1807 * fileio.c (decide_coding_unwind): Likewise.
1808 * fns.c (secure_hash): Likewise.
1809 * insdel.c (modify_region): Likewise.
1810 * keyboard.c (command_loop_1): Likewise.
1811 * print.c (PRINTFINISH): Likewise.
1812 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1813
1814 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1815
1816 * dispnew.c: Use bool for boolean.
1817 (frame_garbaged, display_completed, delayed_size_change)
1818 (fonts_changed_p, add_window_display_history)
1819 (add_frame_display_history, verify_row_hash)
1820 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1821 (row_equal_p, realloc_glyph_pool)
1822 (allocate_matrices_for_frame_redisplay)
1823 (showing_window_margins_p)
1824 (adjust_frame_glyphs_for_frame_redisplay)
1825 (build_frame_matrix_from_leaf_window, make_current)
1826 (mirrored_line_dance, mirror_line_dance, update_frame)
1827 (update_window_tree, update_single_window)
1828 (check_current_matrix_flags, update_window, update_text_area)
1829 (update_window_line, set_window_update_flags, scrolling_window)
1830 (update_frame_1, scrolling, buffer_posn_from_coords)
1831 (do_pending_window_change, change_frame_size)
1832 (change_frame_size_1, sit_for):
1833 Use bool for boolean.
1834 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1835 and remove last int (actually boolean) argument, which was always 0.
1836 All callers changed.
1837 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1838 * dispextern.h (struct composition_it): Use bool for boolean.
1839 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1840 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1841 * dired.c (file_name_completion):
1842 Use bool for boolean. (This was missed in an earlier change.)
1843
1844 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1845
1846 * window.c (Fset_window_configuration): Revert first part of
1847 last change.
1848
1849 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1850
1851 * nsterm.h (NSPanel): New class variable dialog_return.
1852
1853 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
1854 Initialize dialog_return.
1855 (windowShouldClose:): Use stop instead of stopModalWithCode.
1856 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1857 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1858 event.
1859 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1860 modal loop returns.
1861
1862 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1863
1864 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1865 * composite.c (find_composition, composition_gstring_p)
1866 (composition_reseat_it, find_automatic_composition):
1867 * data.c (let_shadows_buffer_binding_p)
1868 (let_shadows_global_binding_p, set_internal, make_blv)
1869 (Fmake_variable_buffer_local, Fmake_local_variable)
1870 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1871 (cons_to_signed, arith_driver):
1872 * dbusbind.c (xd_in_read_queued_messages):
1873 * dired.c (directory_files_internal, file_name_completion):
1874 Use bool for booleans.
1875 * dired.c (file_name_completion):
1876 * process.h (fd_callback):
1877 Omit int (actually boolean) argument. It wasn't being used.
1878 All uses changed.
1879 * composite.h, lisp.h: Reflect above API changes.
1880
1881 * cmds.c, coding.c: Use bool for booleans.
1882 * cmds.c (move_point, Fself_insert_command):
1883 * coding.h (struct composition status, struct coding_system):
1884 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1885 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1886 (emacs_mule_char, decode_coding_emacs_mule)
1887 (encode_coding_emacs_mule, detect_coding_iso_2022)
1888 (decode_coding_iso_2022, encode_invocation_designation)
1889 (encode_designation_at_bol, encode_coding_iso_2022)
1890 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1891 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1892 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1893 (encode_coding_raw_text, detect_coding_charset)
1894 (decode_coding_charset, encode_coding_charset, detect_eol)
1895 (detect_coding, get_translation_table, produce_chars)
1896 (consume_chars, reused_workbuf_in_use)
1897 (make_conversion_work_buffer, code_conversion_save)
1898 (decode_coding_object, encode_coding_object)
1899 (detect_coding_system, char_encodable_p)
1900 (Funencodable_char_position, code_convert_region)
1901 (code_convert_string, code_convert_string_norecord)
1902 (Fset_coding_system_priority):
1903 * fileio.c (Finsert_file_contents):
1904 Use bool for booleans.
1905 * coding.h, lisp.h: Reflect above API changes.
1906 * coding.c: Remove unnecessary static function decls.
1907 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1908 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1909 not a boolean 'int', since callers never look at the return value.
1910 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1911 * coding.h (decoding_buffer_size, encoding_buffer_size)
1912 (emacs_mule_string_char): Remove unused extern decls.
1913 (struct iso_2022_spec, struct coding_system):
1914 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1915 (struct emacs_mule_spec): Remove unused field 'full_support'.
1916 All initializations removed.
1917 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1918
1919 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1920
1921 Fix spare memory change (Bug#12286).
1922 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1923 (valid_lisp_object_p): Likewise.
1924
1925 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1926
1927 * window.c (Fset_window_configuration): Record any window's old
1928 buffer if it's replaced (see Bug#8789). If the new current
1929 buffer doesn't appear in the selected window, go to its old
1930 point (Bug#12208).
1931
1932 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1933
1934 Special MEM_TYPE_SPARE to denote reserved memory.
1935 * alloc.c (enum mem_type): New memory type.
1936 (refill_memory_reserve): Use new type for spare memory.
1937 This prevents live_cons_p and live_string_p from incorrect
1938 detection of uninitialized objects from spare memory as live.
1939
1940 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1941
1942 Spelling fixes.
1943 * Makefile.in (.PHONY): versioclean -> versionclean.
1944
1945 Remove unused external symbols.
1946 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1947 * window.c (Qwindow_valid_p, decode_valid_window):
1948 Now static, not extern.
1949 * data.c (Qinterval): Remove; unused.
1950 (syms_of_data): Do not define 'interval'.
1951 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1952 * window.h (decode_valid_window):
1953 Remove decls.
1954
1955 * character.c, charset.c, chartab.c: Use bool for booleans.
1956 * character.c (lisp_string_width, string_count_byte8)
1957 (string_escape_byte8):
1958 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1959 (load_charset_map_from_file, map_charset_chars)
1960 (Fdefine_charset_internal, define_charset_internal)
1961 (Fdeclare_equiv_charset, find_charsets_in_text)
1962 (Ffind_charset_region, char_charset, Fiso_charset):
1963 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1964 (sub_char_table_set, sub_char_table_set_range)
1965 (char_table_set_range, optimize_sub_char_table)
1966 (map_sub_char_table):
1967 Use bool for boolean.
1968 * character.c (str_to_unibyte): Omit last boolean argument; it was
1969 always 0. All callers changed.
1970 * character.h, charset.h: Adjust to match previous changes.
1971 * character.h (char_printable_p): Remove decl of nonexistent function.
1972 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1973 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1974 are all boolean, so make them single-bit bitfields.
1975
1976 * lisp.h (ASET): Remove attempt to detect side effects.
1977 It was meant to be temporary and it often doesn't work,
1978 because when IDX has side effects the behavior of IDX==IDX
1979 is undefined. See Stefan Monnier in
1980 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1981
1982 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1983
1984 * lisp.h (functionp): New function (extracted from Ffunctionp).
1985 (FUNCTIONP): Use it.
1986 * eval.c (Ffunctionp): Use it.
1987
1988 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1989
1990 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1991 as that's faster and simpler than static storage. Don't bother
1992 with the g_main_context_query overhead if g_main_context_pending
1993 says no events are pending.
1994 (gfds, gfds_size): Remove these static vars.
1995 (xgselect_initialize): Remove; no longer needed.
1996 All uses and decls removed.
1997
1998 * emacs.c (fatal_error_signal_hook): Remove.
1999 All uses removed. This leftover from old code was always 0.
2000
2001 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2002 * casefiddle.c (casify_object, casify_region):
2003 * casetab.c (set_case_table):
2004 * category.c, category.h (word_boundary_p):
2005 * category.h (CHAR_HAS_CATEGORY):
2006 Use bool for booleans, instead of int.
2007
2008 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2009
2010 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2011
2012 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2013
2014 On assertion failure, print backtrace if available.
2015 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2016 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2017 * Makefile.in (LIB_EXECINFO): New macro.
2018 (LIBES): Use it.
2019
2020 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2021 * bytecode.c (exec_byte_code):
2022 * callint.c (check_mark, Fcall_interactively):
2023 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2024 (getenv_internal, sync_process_alive, call_process_exited):
2025 * lisp.h (USE_SAFE_ALLOCA):
2026 Use bool for booleans, instead of int.
2027 * lisp.h, process.h: Adjust prototypes to match above changes.
2028 * callint.c (Fcall_interactively): Don't assume the mark's
2029 offset fits in 'int'.
2030
2031 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2032
2033 * buffer.c, buffer.h: Use bool for boolean.
2034 * buffer.c (reset_buffer_local_variables)
2035 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2036 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2037 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2038 (overlay_touches_p, overlay_strings, Foverlay_put)
2039 (report_overlay_modification, call_overlay_mod_hooks):
2040 (mmap_enlarge, mmap_set_vars):
2041 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2042 Use bool for booleans, instead of int.
2043 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2044 since the 1-or-0 return value is always ignored anyway.
2045 (mmap_initialized_p):
2046 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2047 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2048
2049 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2050
2051 * bidi.c: Use bool for boolean.
2052 This is a bit more readable, and makes the text segment of bidi.o
2053 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2054 Presumably it's faster too.
2055 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2056 Now bool.
2057 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2058 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2059 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2060 (bidi_explicit_dir_char, bidi_level_of_next_char)
2061 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2062 Use bool for booleans, instead of int.
2063 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2064 (bidi_unshelve_cache): Adjust decls to match code.
2065
2066 2012-08-23 Martin Rudalics <rudalics@gmx.at>
2067
2068 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2069 argument.
2070
2071 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2072
2073 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2074 * atimer.h: Include <stdbool.h>.
2075
2076 2012-08-22 Dan Nicolaescu <dann@gnu.org>
2077
2078 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2079 compile time tests instead of run time tests on systems that do
2080 not use them.
2081 (FRAME_MAC_P): Remove leftover from deleted code.
2082 * frame.c (syms_of_frame): Remove leftover from deleted code.
2083
2084 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2085
2086 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2087
2088 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2089
2090 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2091 Otherwise, the compiler complains about (A?B:C) where B is void
2092 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2093 (fontset_add): Return void, for FONTSET_ADD.
2094
2095 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2096
2097 * alloc.c: Use bool for booleans.
2098 (gc_in_progress, abort_on_gc)
2099 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2100 (dont_register_blocks) [GC_MALLOC_CHECK]:
2101 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2102 (check_string_bytes, make_specified_string, memory_full)
2103 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2104 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2105 (mark_stack, valid_pointer_p, make_pure_string)
2106 (Fgarbage_collect, survives_gc_p, gc_sweep):
2107 Use bool for booleans, instead of int.
2108 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2109 Remove unused local.
2110 * alloc.c (PURE_POINTER_P):
2111 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2112 * editfns.c (Fformat):
2113 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2114 (Fdo_auto_save):
2115 * fns.c (sweep_weak_table):
2116 * lisp.h (suppress_checking, push_message, survives_gc_p)
2117 (make_pure_string, gc_in_progress, abort_on_gc):
2118 * lread.c (readchar, read1):
2119 * print.c (Fprin1_to_string):
2120 * xdisp.c (push_message):
2121 Use bool for booleans affected directly or indirectly by
2122 alloc.c's changes.
2123
2124 Make recently-introduced setters macros.
2125 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2126 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2127 (set_fontset_default, set_fontset_fallback): Rename from their
2128 upper-case counterparts, and make them functions rather than macros.
2129 This is more consistent with the other recently-introduced setters.
2130 These don't need to be inline, since they're local.
2131
2132 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2133
2134 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2135 the loop (Bug#12247).
2136
2137 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2138
2139 * lisp.h (vcopy): Use memcpy rather than our own loop.
2140 This fixes a performance regression introduced by the recent
2141 addition of vcopy. This means 'vcopy' will need to be modified
2142 for a copying collector, but that's OK. Also, tighten the
2143 checking in the assertion.
2144
2145 2012-08-21 Eli Zaretskii <eliz@gnu.org>
2146
2147 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2148 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2149 non-base glyph for the width of the base character, according to
2150 what x_draw_composite_glyph_string_foreground expects.
2151 Generate WADJUST value according to composition_gstring_width's
2152 expectations, to produce correct width of the composed character.
2153 Reverse the sign of the DU offset produced by ScriptPlace.
2154
2155 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2156
2157 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2158
2159 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2160
2161 Avoid direct writes to contents member of struct Lisp_Vector.
2162 * lisp.h (vcopy): New function to copy data into vector.
2163 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2164 * fns.c (Ffillarray): Use ASET.
2165 * keyboard.c (timer_check_2): Use AREF and ASET.
2166 (append_tool_bar_item, Frecent_keys): Use vcopy.
2167 * lread.c (read_vector): Use ASET.
2168 * msdos.c (Frecent_doskeys): Use vcopy.
2169 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2170 (Finternal_merge_in_global_face): Use ASET and vcopy.
2171 * xfont.c (xfont_list_pattern): Likewise.
2172
2173 2012-08-21 Martin Rudalics <rudalics@gmx.at>
2174
2175 * window.c (Fwindow_point): For the selected window always return
2176 the position of its buffer's point.
2177 (Fset_window_point): For the selected window always go in its
2178 buffer to the specified position.
2179
2180 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2181
2182 Setter macros for fontsets.
2183 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2184 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2185 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2186 Adjust users.
2187
2188 2012-08-20 Glenn Morris <rgm@gnu.org>
2189
2190 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2191 Don't assume that `ln -f' works.
2192
2193 2012-08-20 Eli Zaretskii <eliz@gnu.org>
2194
2195 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2196 and later about non-assignments with no effect. See discussion at
2197 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2198 details.
2199
2200 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2201
2202 Inline setter functions for Lisp_Objects slots of struct specbinding.
2203 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2204 Adjust users.
2205
2206 2012-08-20 Martin Rudalics <rudalics@gmx.at>
2207
2208 * window.c (select_window): Always make selected window's buffer
2209 current.
2210
2211 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2212
2213 Use AREF and ASET for docstrings of category tables.
2214 * category.h (CATEGORY_DOCSTRING): Use AREF.
2215 (SET_CATEGORY_DOCSTRING): Use ASET.
2216 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2217
2218 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2219
2220 Inline setter functions for hash table members.
2221 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2222 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2223 (set_hash_key_and_value, set_hash_index, set_hash_next)
2224 (set_hash_hash): New functions.
2225 * charset.c, fns.c: Adjust users.
2226
2227 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2228
2229 Inline getter and setter functions for per-buffer values.
2230 * buffer.h (per_buffer_default, set_per_buffer_default)
2231 (per_buffer_value, set_per_buffer_value): New functions.
2232 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2233 * buffer.c, data.c: Adjust users.
2234
2235 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
2236
2237 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2238
2239 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2240
2241 Rely on <config.h> + <unistd.h> to declare 'environ',
2242 as gnulib does this if the system doesn't.
2243 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2244 Remove declaration. MS-Windows declares it on stdlib.h which is
2245 included by conf_post.h.
2246 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2247 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2248 * vm-limit.c: Include <unistd.h>, for 'environ'.
2249
2250 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2251 (start_of_data): Remove decl; mem-limits.h provides it.
2252
2253 * xdisp.c (handle_invisible_prop): Make it a bit faster
2254 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2255
2256 2012-08-19 Chong Yidong <cyd@gnu.org>
2257
2258 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2259 ends (Bug#3874).
2260
2261 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2262
2263 * .gdbinit: Use call instead of set when calling a function in the
2264 inferior.
2265
2266 * data.c (set_internal): Don't use set_blv_found.
2267 (Fkill_local_variable): Likewise.
2268
2269 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2270
2271 * nsfont.m (ns_ascii_average_width): Ensure the string
2272 ascii_printable is initialized with a null-terminated character
2273 array. Otherwise, it can contain undesired extra characters.
2274
2275 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2276
2277 port new setting code to Sun C 5.8 2005/10/13
2278 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2279 Return void, not Lisp_Object. Otherwise, the compiler
2280 complains about (A?B:C) where B is void and C is Lisp_Object
2281 when compiling CHAR_TABLE_SET, due to the recent change to
2282 the API of sub_char_table_set_contents.
2283
2284 2012-08-18 Chong Yidong <cyd@gnu.org>
2285
2286 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2287 for the string case (Bug#3874).
2288
2289 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2290
2291 * buffer.h (BSET): Remove (Bug#12215).
2292 Replace all uses with calls to new setter functions.
2293 (bset_bidi_paragraph_direction, bset_case_canon_table)
2294 (bset_case_eqv_table, bset_directory, bset_display_count)
2295 (bset_display_time, bset_downcase_table)
2296 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2297 (bset_last_selected_window, bset_local_var_alist)
2298 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2299 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2300 (bset_width_table):
2301 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2302 (bset_auto_fill_function, bset_auto_save_file_format)
2303 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2304 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2305 (bset_cache_long_line_scans, bset_case_fold_search)
2306 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2307 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2308 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2309 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2310 (bset_header_line_format, bset_indicate_buffer_boundaries)
2311 (bset_indicate_empty_lines, bset_invisibility_spec)
2312 (bset_left_fringe_width, bset_major_mode, bset_mark)
2313 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2314 (bset_name, bset_overwrite_mode, bset_pt_marker)
2315 (bset_right_fringe_width, bset_save_length)
2316 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2317 (bset_scroll_up_aggressively, bset_selective_display)
2318 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2319 (bset_word_wrap, bset_zv_marker):
2320 * category.c (bset_category_table):
2321 * syntax.c (bset_syntax_table):
2322 New setter functions.
2323
2324 * process.h (PSET): Remove (Bug#12215).
2325 Replace all uses with calls to new setter functions.
2326 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2327 (PROCESS_INLINE): New macro.
2328 (pset_childp): New setter function.
2329 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2330 * process.c (PROCESS_INLINE):
2331 Define to EXTERN_INLINE, so that the corresponding functions
2332 are compiled into code.
2333 (pset_buffer, pset_command, pset_decode_coding_system)
2334 (pset_decoding_buf, pset_encode_coding_system)
2335 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2336 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2337 (pset_type, pset_write_queue): New setter functions.
2338
2339 * window.h (WSET): Remove (Bug#12215).
2340 Replace all uses with calls to new setter functions.
2341 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2342 (WINDOW_INLINE): New macro.
2343 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2344 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2345 (wset_total_lines, wset_vertical_scroll_bar)
2346 (wset_window_end_pos, wset_window_end_valid)
2347 (wset_window_end_vpos): New setter functions.
2348 * window.c (WINDOW_INLINE):
2349 Define to EXTERN_INLINE, so that the corresponding functions
2350 are compiled into code.
2351 (wset_combination_limit, wset_dedicated, wset_display_table)
2352 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2353 (wset_new_normal, wset_new_total, wset_next_buffers)
2354 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2355 (wset_prev_buffers, wset_right_fringe_width)
2356 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2357 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2358 (wset_window_parameters):
2359 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2360 (wset_column_number_displayed, wset_region_showing):
2361 New setter functions.
2362
2363 * termhooks.h (TSET): Remove (Bug#12215).
2364 Replace all uses with calls to new setter functions.
2365 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2366 (TERMHOOKS_INLINE): New macro.
2367 (tset_charset_list, tset_selection_alist): New setter functions.
2368 * terminal.c (TERMHOOKS_INLINE):
2369 Define to EXTERN_INLINE, so that the corresponding functions
2370 are compiled into code.
2371 (tset_param_alist): New setter function.
2372
2373 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2374
2375 * keyboard.h (KSET): Remove (Bug#12215).
2376 Replace all uses with calls to new setter functions.
2377 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2378 (KEYBOARD_INLINE): New macro.
2379 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2380 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2381 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2382 New setter functions.
2383 * keyboard.c (KEYBOARD_INLINE):
2384 Define to EXTERN_INLINE, so that the corresponding functions
2385 are compiled into code.
2386 (kset_echo_string, kset_kbd_queue)
2387 (kset_keyboard_translate_table, kset_last_prefix_arg)
2388 (kset_last_repeatable_command, kset_local_function_key_map)
2389 (kset_overriding_terminal_local_map, kset_real_last_command)
2390 (kset_system_key_syms): New setter functions.
2391
2392 * frame.h (FSET): Remove (Bug#12215).
2393 Replace all uses with calls to new setter functions.
2394 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2395 (FRAME_INLINE): New macro.
2396 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2397 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2398 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2399 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2400 (fset_param_alist, fset_root_window, fset_scroll_bars)
2401 (fset_selected_window, fset_title, fset_tool_bar_items)
2402 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2403 * frame.c (FRAME_INLINE):
2404 Define to EXTERN_INLINE, so that the corresponding functions
2405 are compiled into code.
2406 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2407
2408 A few more naming-convention fixes for getters and setters.
2409 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2410 and rename from buffer_overlays_set_before.
2411 (set_buffer_overlays_after): Move here from buffer.h, and rename
2412 from buffer_overlays_set_after.
2413 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2414 All uses changed.
2415 (set_buffer_intervals): Rename from buffer_set_intervals.
2416 * intervals.c (set_interval_object): Move here from intervals.h,
2417 and rename from interval_set_object.
2418 (set_interval_left): Move here from intervals.h, and rename from
2419 interval_set_left.
2420 (set_interval_right): Move here from intervals.h, and rename from
2421 interval_set_right.
2422 (copy_interval_parent): Move here from intervals.h, and rename from
2423 interval_copy_parent.
2424 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2425 (set_interval_plist): Rename from interval_set_plist.
2426 Return void, not Lisp_Object, since no caller uses the result.
2427 * lisp.h (string_intervals): Rename from string_get_intervals.
2428 (set_string_intervals): Rename from string_set_intervals.
2429
2430 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2431 (set_char_table_contents): Rename from char_table_set_contents.
2432 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2433 All uses changed. See the end of
2434 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2435
2436 * lisp.h (CSET): Remove (Bug#12215).
2437 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2438 (set_char_table_purpose): New functions,
2439 replacing CSET. All uses changed. For example, replace
2440 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2441 "set_char_table_parent (char_table, parent);".
2442 The old version was confusing because it used the same name
2443 'parent' for two different things.
2444
2445 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2446
2447 Functions to get and set Lisp_Object fields of buffer-local variables.
2448 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2449 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2450 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2451 * data.c, eval.c, frame.c: Adjust users.
2452
2453 2012-08-17 Chong Yidong <cyd@gnu.org>
2454
2455 * xfaces.c (merge_face_vectors): If the target font specfies a
2456 font spec, make the font's attributes take precedence over
2457 directly-specified attributes.
2458 (merge_face_ref): Recognize :font.
2459
2460 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2461
2462 Do not use memcpy for copying intervals.
2463 * intervals.c (reproduce_interval): New function.
2464 (reproduce_tree, reproduce_tree_obj): Use it.
2465 (reproduce_tree_obj): Remove prototype.
2466
2467 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2468
2469 * lisp.h (duration_to_sec_usec): Remove unused decl.
2470
2471 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2472
2473 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2474 to an allocated instance of NSString, not to the class itself.
2475
2476 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
2477
2478 * makefile.w32-in (C_CTYPE_H): New macro.
2479 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2480 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2481 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2482
2483 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2484
2485 Use ASCII tests for character types.
2486 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2487 * xfns.c, xterm.c:
2488 Don't include <ctype.h>; was not needed.
2489 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2490 * sysdep.c, xfaces.c:
2491 Include <c-ctype.h> instead of <ctype.h>.
2492 * nsterm.m: Include <c-ctype.h>.
2493 * charset.c (read_hex):
2494 * doc.c (Fsnarf_documentation):
2495 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2496 (DRIVE_LETTER) [DOS_NT]:
2497 (Ffile_name_directory, Fexpand_file_name)
2498 (Fsubstitute_in_file_name):
2499 * font.c (font_parse_xlfd, font_parse_fcname):
2500 * frame.c (x_set_font_backend):
2501 * gtkutil.c (xg_get_font):
2502 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2503 * nsimage.m (hexchar):
2504 * nsterm.m (ns_xlfd_to_fontname):
2505 * sysdep.c (system_process_attributes):
2506 * xfaces.c (hash_string_case_insensitive):
2507 Use C-locale tests instead of locale-specific tests for character
2508 types, since we want the ASCII interpretation here, not the
2509 interpretation suitable for whatever happens to be the current locale.
2510
2511 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2512
2513 Consistently check windows for validity/liveness
2514 (Bug#11984, Bug#12025, Bug#12026).
2515 * lisp.h (CHECK_VALID_WINDOW): New macro.
2516 * window.c (decode_window): Rename to decode_live_window.
2517 (decode_valid_window, Fwindow_valid_p): New functions.
2518 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2519 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2520 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2521 (Fwindow_prev_sibling, Fwindow_combination_limit)
2522 (Fset_window_combination_limit, Fwindow_use_time)
2523 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2524 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2525 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2526 (Fwindow_hscroll, Fset_window_hscroll)
2527 (Fwindow_redisplay_end_trigger)
2528 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2529 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2530 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2531 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2532 (Fwindow_end, Fset_window_point, Fset_window_start)
2533 (Fpos_visible_in_window_p, Fwindow_line_height)
2534 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2535 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2536 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2537 (Fset_window_parameter, Fwindow_display_table)
2538 (Fset_window_display_table, Fdelete_other_windows_internal)
2539 (Fset_window_buffer, Fset_window_new_total)
2540 (Fset_window_new_normal, Fdelete_window_internal)
2541 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2542 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2543 (Fwindow_scroll_bars): Check whether argument window is a valid or
2544 live window. Update doc-strings.
2545 (syms_of_window): New symbol Qwindow_valid_p.
2546 * keyboard.c (Fposn_at_x_y): Check whether argument
2547 frame_or_window denotes a valid window.
2548
2549 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2550
2551 Fix previous char table change.
2552 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2553 * chartab.c (optimize_sub_char_table): Likewise.
2554
2555 2012-08-16 Chong Yidong <cyd@gnu.org>
2556
2557 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2558
2559 * xfont.c (xfont_open):
2560 * xftfont.c (xftfont_open): Set the font's max_width field.
2561
2562 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2563 min_width to space_width and average_width to the average over
2564 printable ASCII characters.
2565 (ns_char_width): Code cleanup.
2566 (ns_ascii_average_width): New utility function.
2567
2568 * font.h (struct font): Update comments.
2569
2570 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2571
2572 Simple interface to set Lisp_Object fields of character tables.
2573 * lisp.h (CSET): New macro.
2574 (char_table_set_extras, char_table_set_contents)
2575 (sub_char_table_set_contents): New function.
2576 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2577 * syntax.c: Adjust users.
2578
2579 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2580
2581 * eval.c (eval_sub): Bind lexical-binding.
2582 * lread.c (Qlexical_binding): Make non-static.
2583
2584 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2585
2586 * nsmenu.m (popupSession): Remove.
2587 (pop_down_menu): Remove endModalSession.
2588 (timeout_handler:): New method.
2589 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2590 Call runModalForWindow. Check timer_fired when it returns.
2591 If not set, cancel timer and break out of loop.
2592 Otherwise loop again, with a new timeout.
2593
2594 * nsterm.m: Include fcntl.h if present.
2595 (fd_entry, t_readfds, inNsSelect): Remove.
2596 (select_writefds, select_valid, select_timeout, selfds)
2597 (select_mutex, apploopnr): Add.
2598 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2599 Otherwise call kbd_buffer_store_event.
2600 (ns_send_appdefined): Remove release of fd_entry.
2601 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2602 Increment and decrement apploopnr.
2603 (ns_select): If no file descriptors, just do a NSTimer.
2604 Otherwise copy read/write masks and start select thread (fd_handler).
2605 Start main loop and wait for application defined event.
2606 Inform select thread to stop selecting after main loop is exited.
2607 (ns_term_init): Create selfds pipe and set non-blocking.
2608 Initialize select_mutex. Start the select thread (fd_handler).
2609 (fd_handler:): Loop forever, wait for info from the main thread
2610 to either start or stop selecting. When select returns, send
2611 and appdefined event.
2612 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2613 If not call kbd_buffer_store_event.
2614
2615 * nsterm.h (EmacsApp): fd_handler takes id argument.
2616 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2617
2618 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2619
2620 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2621
2622 * region-cache.c (move_cache_gap): Update gap_len using the actual
2623 growth of the boundaries array. Do not change cache_len.
2624 (Bug#12196)
2625
2626 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2627
2628 Generalize and cleanup font subsystem checks.
2629 * font.h (FONT_DEBUG, font_assert): Remove.
2630 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2631 Change font_assert to eassert. Use eassert where appropriate.
2632
2633 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2634
2635 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2636
2637 2012-08-15 Chong Yidong <cyd@gnu.org>
2638
2639 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2640 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2641 extract the font descriptor instead of just the font name.
2642 In that case, return a font spec instead of a string.
2643 (x_last_font_name): Move to this file from xfns.c.
2644
2645 * xfns.c (Fx_select_font): The return value can also be a font
2646 spec. Move x_last_font_name management to gtkutil.c.
2647
2648 * xfaces.c: Make font weight and style symbols non-static.
2649
2650 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2651
2652 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2653 (bug#12117).
2654
2655 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2656
2657 * alloc.c (Fgarbage_collect): Use plural form consistently.
2658
2659 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2660
2661 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2662 iteration through the command loop. Fixes a problem whereby mouse
2663 movements are ignored until the first mouse click.
2664
2665 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2666
2667 Use bool, not int, for Lisp booleans.
2668 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2669 makes Emacs a bit smaller and presumably a bit faster.
2670 * lisp.h: Include <stdbool.h>.
2671 (struct Lisp_Boolfwd, defvar_bool):
2672 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2673 * regex.c [!emacs]: Include <stdbool.h>.
2674 (false, true): Remove; <stdbool.h> does this for us now.
2675
2676 2012-08-14 Chong Yidong <cyd@gnu.org>
2677
2678 * character.c (Fcharacterp): Doc fix (Bug#12076).
2679
2680 * data.c (Findirect_variable): Doc fix (Bug#11040).
2681
2682 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2683
2684 * editfns.c (Fformat): Doc fix (Bug#12059).
2685 (Fsave_current_buffer): Doc fix (Bug#11542).
2686
2687 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2688
2689 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2690 (bug#12022).
2691
2692 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2693
2694 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2695 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2696 * minibuf.c (choose_minibuf_frame, read_minibuf):
2697 * w32fns.c (x_create_tip_frame):
2698 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2699 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2700
2701 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2702
2703 * intervals.c (offset_intervals): Remove obsolete comment.
2704
2705 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2706
2707 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2708
2709 2012-08-14 Gergely Risko <gergely@risko.hu>
2710
2711 * coding.c (decode_coding): Record buffer modification before
2712 disabling undo_list (Bug#11773).
2713
2714 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2715
2716 Revert and cleanup some recent overlay changes.
2717 * buffer.h (enum overlay_type): Remove.
2718 (buffer_get_overlays, buffer_set_overlays): Likewise.
2719 (buffer_set_overlays_before, buffer_set_overlays_after):
2720 New function. Adjust users.
2721 (unchain_both): Add eassert.
2722
2723 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2724
2725 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2726
2727 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2728
2729 * gtkutil.c (xg_mark_data): Don't assume C99.
2730
2731 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2732
2733 * gtkutil.c (xg_frame_tb_info): New struct.
2734 (TB_INFO_KEY): New define.
2735 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2736 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2737 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2738 if not present.
2739 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2740 is up to date. Otherwise store new data.
2741 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2742
2743 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2744
2745 Use KSET for write access to Lisp_Object members of struct kboard.
2746 * keyboard.h (KSET): New macro.
2747 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2748 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2749 * xterm.c: Adjust users.
2750
2751 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2752
2753 Use BSET for write access to Lisp_Object members of struct buffer.
2754 * buffer.h (BSET): New macro.
2755 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2756 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2757 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2758 * window.c, xdisp.c, xfns.c: Adjust users.
2759
2760 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2761
2762 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2763
2764 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2765
2766 * nsterm.m (not_in_argv): New function.
2767 (application:openFile, application:openTempFile:):
2768 (application:openFileWithoutUI:, application:openFiles:): Open file
2769 if not_in_argv returns non-zero (bug#12171).
2770
2771 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2772 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2773 Define for Gtk+ versions less than 3.2.
2774 (xg_get_font_name): Use those functions/macros here.
2775 Reported by Frans Oilinki <moilinki@gmail.com>.
2776
2777 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2778
2779 * unexmacosx.c (copy_data_segment): Copy initialized data in
2780 statically linked libraries from input file rather than memory.
2781
2782 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2783 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2784 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2785
2786 2012-08-10 Glenn Morris <rgm@gnu.org>
2787
2788 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2789 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2790
2791 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2792
2793 Fix last change to allow compilation with low optimization levels.
2794 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2795 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2796
2797 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2798
2799 Use common inline syntax in intervals.h.
2800 * intervals.h (INTERVALS_INLINE): New macro.
2801 Change all users from LISP_INLINE.
2802
2803 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2804
2805 Define Qnone once for all platforms.
2806 * frame.c (Qnone): Define here.
2807 (syms_of_frame): DEFSYM it.
2808 * lisp.h (Qnone): New declaration.
2809 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2810 * xfns.c: Remove duplication. Adjust users.
2811
2812 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2813
2814 Remove unused macros from intervals.h.
2815 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2816 * intervals.c: Adjust comment.
2817
2818 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2819
2820 * w32fns.c <w32_unicode_gui>: New static variable.
2821 (globals_of_w32fns): Initialize it according to os_subtype.
2822 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2823 testing os_subtype.
2824
2825 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2826 Eli Zaretskii <eliz@gnu.org>
2827
2828 Fix bug #10299 with Unicode characters sent by customized
2829 keyboards created by MSKLC.
2830 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2831 (w32_init_class): Use it to initialize the Emacs class with either
2832 ANSI or Unicode API calls.
2833 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2834 later.
2835 (w32_wnd_proc): If the character code sent by WM_CHAR or
2836 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2837 original message. Call DefWindowProcW on NT and later.
2838
2839 2012-08-10 Glenn Morris <rgm@gnu.org>
2840
2841 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2842
2843 * lisp.h (DIRECTORY_SEP): Let configure set it.
2844
2845 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2846
2847 Use TSET for write access to Lisp_Object slots of struct terminal.
2848 * termhooks.h (TSET): New macro.
2849 * coding.c, terminal.c, xselect.c: Adjust users.
2850
2851 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2852
2853 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2854 the failing expression, include them in the error message.
2855 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2856 * lisp.h (internal_condition_case_n): Update declaration.
2857
2858 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2859
2860 Inline functions to examine and change buffer overlays.
2861 * buffer.c (unchain_both): New function.
2862 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2863 (buffer_has_overlays): New function.
2864 (enum overlay_type): New enum.
2865 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2866 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2867
2868 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2869
2870 Inline functions to examine and change buffer intervals.
2871 * alloc.c (mark_interval_tree): Remove.
2872 (MARK_INTERVAL_TREE): Simplify.
2873 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2874 * intervals.c (buffer_balance_intervals): New function.
2875 (graft_intervals_into_buffer): Adjust indentation.
2876 (set_intervals_multibyte): Simplify.
2877 * buffer.h (BUF_INTERVALS): Remove.
2878 (buffer_get_intervals, buffer_set_intervals): New function.
2879 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2880 * intervals.c, textprop.c: Adjust users.
2881
2882 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2883
2884 Inline functions to examine and change string intervals.
2885 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2886 (string_get_intervals, string_set_intervals): New function.
2887 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2888 * lread.c, print.c, textprop.c: Adjust users.
2889
2890 2012-08-08 Glenn Morris <rgm@gnu.org>
2891
2892 * lisp.mk (lisp): Remove language/persian.elc.
2893
2894 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2895
2896 Cleanup intervals.
2897 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2898 (NULL_INTERVAL_P): Likewise. Adjust users.
2899 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2900 Adjust comment. Move under #if 0.
2901 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2902 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2903
2904 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2905
2906 Check total length of intervals with eassert.
2907 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2908 * intervals.c: Change all users to eassert.
2909
2910 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2911
2912 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2913 Rename fields to match removal of FGET and WGET and disuse of
2914 INTERNAL_FIELD in Lisp_Cons.
2915
2916 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2917
2918 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2919 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2920 name since all xname users are fixed long time ago. Do not
2921 use INTERNAL_FIELD.
2922 (set_symbol_name, set_symbol_function, set_symbol_plist):
2923 (set_symbol_next, set_overlay_plist): New function.
2924 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2925 (struct Lisp_Overlay): Likewise.
2926 (CVAR, MVAR, SVAR): Remove.
2927 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2928 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2929 * xterm.c: Adjust users.
2930 * .gdbinit: Change to use name field of struct Lisp_Symbol
2931 where appropriate.
2932
2933 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2934
2935 Basic functions to set Lisp_Object and pointer slots of intervals.
2936 * intervals.h (interval_set_parent, interval_set_object):
2937 (interval_set_left, interval_set_right, interval_set_plist):
2938 (interval_copy_parent): New function.
2939 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2940 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2941 Adjust indentation.
2942 (INTERVAL_SIZE): Remove. Adjust users.
2943 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2944
2945 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2946
2947 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2948 * process.h (PGET): Remove.
2949 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2950 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2951
2952 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2953
2954 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2955 * window.h (WGET): Remove.
2956 (struct window): Do not use INTERNAL_FIELD.
2957 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2958 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2959 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2960 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2961 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2962 Adjust users.
2963
2964 2012-08-07 Chong Yidong <cyd@gnu.org>
2965
2966 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2967 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2968 (Fdelete_window_internal): Signal an error if the window is not on
2969 a live frame (Bug#12025).
2970
2971 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2972
2973 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2974 * frame.h (FGET): Remove.
2975 (struct frame): Do not use INTERNAL_FIELD.
2976 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2977 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2978 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2979 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2980
2981 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2982
2983 * w32.c: Silence compiler warnings.
2984 (map_w32_filename): Remove unused variable `is_fat'.
2985 (chase_symlinks): Add parentheses around expression.
2986
2987 2012-08-06 Glenn Morris <rgm@gnu.org>
2988
2989 * sysdep.c: Respect BROKEN_GETWD.
2990
2991 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2992 Let configure handle it.
2993 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2994
2995 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2996
2997 Use GCALIGNMENT where appropriate.
2998 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2999 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3000 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3001
3002 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3003
3004 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3005 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3006
3007 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3008
3009 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3010 that should be sufficient for everyone.
3011
3012 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3013
3014 * keyboard.c (timer_check_2): Add break so timer_check returns next
3015 timeout.
3016
3017 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3018
3019 Fix Windows build errors introduced after converting to WGET and WSET.
3020 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3021 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3022
3023 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3024
3025 * nsterm.m (ns_frame_rehighlight): Use FSET.
3026
3027 * nsmenu.m (ns_update_menubar): Use FSET.
3028
3029 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3030
3031 Separate read and write access to Lisp_Object slots of Lisp_Process.
3032 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3033 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3034
3035 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3036
3037 Separate read and write access to Lisp_Object slots of struct window.
3038 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3039 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3040 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3041 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3042 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3043 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3044 Adjust users.
3045
3046 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3047
3048 Fix Windows build errors introduced after converting to FGET and FSET.
3049 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3050 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3051 (w32_judge_scroll_bars): Change to use FSET.
3052 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3053
3054 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3055
3056 Fix replacement typo.
3057 * window.c (replace_window): Set root_window instead of
3058 selected_window. This fixes a total window subsystem
3059 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3060
3061 2012-08-06 Glenn Morris <rgm@gnu.org>
3062
3063 * lisp.mk (lisp): Add language/persian.elc.
3064
3065 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3066
3067 Separate read and write access to Lisp_Object slots of struct frame.
3068 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3069 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3070 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3071 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3072 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3073
3074 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3075
3076 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3077
3078 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3079
3080 Generalize common compile-time constants.
3081 * lisp.h (header_size, bool_header_size, word_size): Now here.
3082 (struct Lisp_Vector): Add comment.
3083 (struct Lisp_Bool_Vector): Move up to define handy constants.
3084 (VECSIZE, PSEUDOVECSIZE): Simplify.
3085 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3086 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3087 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3088 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3089 * xfont.c, xmenu.c: Use word_size where appropriate.
3090
3091 2012-08-05 Lawrence Mitchell <wence@gmx.li>
3092
3093 * search.c (Freplace_match): Treat \? in the replacement text
3094 literally (Bug#8161).
3095
3096 2012-08-05 Chong Yidong <cyd@gnu.org>
3097
3098 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3099 * frame.c (Vdelete_frame_functions):
3100 * emacs.c (Vkill_emacs_hook): Doc fix.
3101
3102 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3103
3104 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3105 --with-x-toolkit=no builds.
3106 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3107
3108 2012-08-04 Chong Yidong <cyd@gnu.org>
3109
3110 * syntax.c (Fmodify_syntax_entry): Doc fix.
3111
3112 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3113
3114 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3115 * w32.c (init_environment): Change the default values of many
3116 environment variables in dflt_envvars[] to NULL, to avoid pushing
3117 them into environment when they were not already defined.
3118 Remove the code that deletes site-lisp subdirectories from the default
3119 value of EMACSLOADPATH, as it is no longer needed.
3120 (check_windows_init_file): Now external, not static.
3121 Use Vload_path as is, without adding anything, as this function is now
3122 called when Vload_path is already set up.
3123
3124 * w32.h (check_windows_init_file): Add prototype.
3125
3126 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3127 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3128 compatibility with Posix platforms.
3129 (main): Move the call to check_windows_init_file to here from
3130 w32.c.
3131 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3132 any, in the DEFALT argument into the root of the Emacs build or
3133 installation tree, as appropriate.
3134
3135 * callproc.c (init_callproc_1): Call decode_env_path instead of
3136 doing its equivalent by hand.
3137 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3138 the code that sets Vexec_path run on MS-Windows.
3139
3140 * lread.c (init_lread): Add comments to #ifdef's.
3141
3142 * msdos.c (dos_set_window_size, IT_update_begin)
3143 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3144 instead of direct references.
3145
3146 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3147
3148 Export DEFAULT_REHASH_* to GDB.
3149 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3150 Now constants, not macros.
3151
3152 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3153
3154 Remove unnecessary casts involving pointers.
3155 These casts are no longer needed now that we assume C89 or later,
3156 since they involve casting to or from void *.
3157 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3158 (make_pure_float, make_pure_vector):
3159 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3160 * macros.c (Fstart_kbd_macro):
3161 * menu.c (find_and_return_menu_selection):
3162 * minibuf.c (read_minibuf_noninteractive):
3163 * sysdep.c (closedir):
3164 * xdisp.c (x_produce_glyphs):
3165 * xfaces.c (compare_fonts_by_sort_order):
3166 * xfns.c (x_real_positions, select_visual):
3167 * xselect.c (x_stop_queuing_selection_requests)
3168 (x_get_window_property, x_get_window_property_as_lisp_data):
3169 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3170 Remove unnecessary pointer casts.
3171 * alloc.c (record_xmalloc): New function.
3172 * lisp.h (record_xmalloc): New decl.
3173 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3174 more like a function. This is because the pointer cast is not
3175 needed. All uses changed.
3176 * print.c (print_string, print_error_message): Avoid length recalc.
3177
3178 Improve fix for macroexp crash with debugging (Bug#12118).
3179 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3180 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3181 not supposed to be invoked from the garbage collector.
3182 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3183 (gc_aset): New function, which is like ASET but can be
3184 used in the garbage collector.
3185 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3186 (set_hash_index): Use it instead of ASET.
3187
3188 2012-08-03 Eli Zaretskii <eliz@gnu.org>
3189
3190 Support symlinks on latest versions of MS-Windows.
3191 * w32.c: Include winioctl.h and aclapi.h.
3192 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3193 (revert_to_self): Forward declarations of static functions.
3194 <static BOOL g_b_init_get_security_info>:
3195 <g_b_init_create_symbolic_link>: New static flags.
3196 (globals_of_w32): Initialize them to zero.
3197 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3198 (map_w32_filename): Improve commentary. Simplify switch.
3199 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3200 headers (most versions of MinGW w32api don't).
3201 (get_security_info, create_symbolic_link)
3202 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3203 New functions.
3204 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3205 in the argument file name.
3206 (sys_access): Call unc_volume_file_attributes only if
3207 GetFileAttributes fails with network-related error codes.
3208 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3209 have the required privileges.
3210 (get_file_security_desc_by_name): Rename from
3211 get_file_security_desc.
3212 (stat_worker): New function, with most of the guts of 'stat', and
3213 with addition of handling of symlinks and support for 'lstat'.
3214 If possible, get file's attributes and security information by
3215 handle, not by name. Produce S_IFLNK bit for symlinks, when
3216 called from 'lstat'.
3217 (stat, lstat): New functions, call 'stat_worker'.
3218 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3219 symlinks when the underlying filesystem supports them.
3220
3221 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3222
3223 Fix macroexp crash on Windows with debugging (Bug#12118).
3224 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3225 checking subscripts; problem introduced with the recent
3226 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3227 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3228 since it's used in non-static inline functions now.
3229
3230 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3231 Don't assume buffer size fits in 'int'. Remove unused local.
3232
3233 Use C99-style 'extern inline' if available.
3234 * buffer.h (BUFFER_INLINE):
3235 * category.h (CATEGORY_INLINE):
3236 * character.h (CHARACTER_INLINE):
3237 * charset.h (CHARSET_INLINE):
3238 * composite.h (COMPOSITE_INLINE):
3239 * dispextern.h (DISPEXTERN_INLINE):
3240 * lisp.h (LISP_INLINE):
3241 * systime.h (SYSTIME_INLINE):
3242 New macro, replacing 'static inline' in this header.
3243 * buffer.h, category.h, character.h, charset.h, composite.h:
3244 * dispextern.h, lisp.h, systime.h:
3245 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3246 * alloc.c (LISP_INLINE):
3247 * buffer.c (BUFFER_INLINE):
3248 * category.c (CATEGORY_INLINE):
3249 * character.c (CHARACTER_INLINE):
3250 * charset.c (CHARSET_INLINE):
3251 * composite.c (COMPOSITE_INLINE):
3252 * dispnew.c (DISPEXTERN_INLINE):
3253 * sysdep.c (SYSTIME_INLINE):
3254 Define to EXTERN_INLINE, so that the corresponding functions
3255 are compiled into code.
3256 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3257 (INLINE_HEADER_END): New macros.
3258 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3259 since it's used in non-static inline functions now.
3260 (VALMASK) [!USE_LSB_TAG]: Likewise.
3261
3262 2012-08-02 Glenn Morris <rgm@gnu.org>
3263
3264 * s/: Remove empty directory.
3265
3266 * s/ms-w32.h: Move to ../nt/inc.
3267 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3268 Update for new ms-w32.h location.
3269
3270 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3271
3272 Port to Solaris 8.
3273 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3274
3275 2012-08-02 Glenn Morris <rgm@gnu.org>
3276
3277 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3278 hard-coding the path separator.
3279
3280 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3281
3282 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3283 This how ASET and AREF are supposed to work, and makes
3284 it easier to think about future improvements. See
3285 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3286 * charset.h (set_charset_attr): New function.
3287 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3288 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3289 (aref_addr): New function. All uses of &AREF(...) changed.
3290 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3291 (set_hash_index): New functions. All lvalue-style uses of
3292 HASH_KEY etc. changed.
3293 * keyboard.c (set_prop): New function. All lvalue-style uses
3294 of PROP changed.
3295
3296 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3297
3298 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3299 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3300 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3301 * nsfns.m (ns_set_name_as_filename): Likewise.
3302 * nsmenu.m (ns_update_menubar): Likewise.
3303 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3304
3305 2012-08-01 Eli Zaretskii <eliz@gnu.org>
3306
3307 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3308 Adapt to latest changes in field names of the corresponding Lisp
3309 objects.
3310
3311 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3312
3313 2012-08-01 Glenn Morris <rgm@gnu.org>
3314
3315 * s/msdos.h: Remove file.
3316 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3317 * Makefile.in (S_FILE): Remove.
3318 (config_h): Remove S_FILE.
3319
3320 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3321
3322 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3323 Remove; moved to nt/config.nt.
3324
3325 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3326
3327 Use INTERNAL_FIELD for conses and overlays.
3328 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3329 Remove obsolete comment.
3330 (MVAR): New macro.
3331 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3332 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3333
3334 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3335
3336 Use INTERNAL_FIELD for symbols.
3337 * lisp.h (SVAR): New macro. Adjust users.
3338 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3339 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3340
3341 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3342
3343 Use INTERNAL_FIELD for processes.
3344 * process.h (PVAR): New macro. Adjust style.
3345 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3346 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3347
3348 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3349
3350 Use INTERNAL_FIELD for windows.
3351 * window.h (WVAR): New macro.
3352 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3353 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3354 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3355 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3356 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3357 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3358
3359 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3360
3361 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3362
3363 2012-08-01 Glenn Morris <rgm@gnu.org>
3364
3365 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3366 Move to configure.ac.
3367
3368 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3369
3370 * makefile.w32-in (CONFIG_H): Update dependencies.
3371 (CONF_POST_H): New macro.
3372
3373 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3374
3375 2012-07-31 Glenn Morris <rgm@gnu.org>
3376
3377 * Makefile.in (S_FILE): No longer set by configure.
3378
3379 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3380 is available.
3381 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3382
3383 * process.h (NULL_DEVICE):
3384 * emacs.c (SEPCHAR):
3385 * editfns.c (USER_FULL_NAME): Let configure set them.
3386
3387 * s/README, s/template.h: Remove files.
3388
3389 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3390
3391 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3392 Move to configure.ac.
3393
3394 2012-07-31 Eli Zaretskii <eliz@gnu.org>
3395
3396 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3397 resulting renaming of 'struct frame' members.
3398
3399 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3400
3401 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3402 after introduction of FVAR.
3403
3404 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3405
3406 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3407
3408 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3409 instead of compositeToPoint.
3410 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3411
3412 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3413
3414 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3415
3416 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3417 * lisp.h (INTERNAL_FIELD): New macro.
3418 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3419 (BVAR): Change to use INTERNAL_FIELD.
3420 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3421 (KVAR): Change to use INTERNAL_FIELD.
3422 * frame.h (FVAR): New macro.
3423 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3424 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3425 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3426 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3427 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3428
3429 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3430
3431 Miscellaneous fixes for non-default X toolkits.
3432 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3433 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3434 Move under #ifdef USE_LUCID.
3435 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3436 definition and usage to avoid warnings.
3437
3438 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3439
3440 * nsterm.m (openFiles): Fix previous checkin.
3441
3442 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3443
3444 * indent.c (compute_motion): Remove unused local.
3445
3446 2012-07-31 Glenn Morris <rgm@gnu.org>
3447
3448 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3449
3450 * conf_post.h [USG5_4]:
3451 Move remaining contents of s/usg5-4-common.h here.
3452 * s/usg5-4-common.h: Remove file.
3453
3454 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3455 * s/irix6-5.h: Remove file.
3456
3457 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3458 * s/darwin.h: Remove file.
3459
3460 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3461 * s/hpux10-20.h: Remove file, which is now empty.
3462
3463 2012-07-30 Glenn Morris <rgm@gnu.org>
3464
3465 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3466 * Makefile.in (config_h): Add conf_post.h.
3467 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3468
3469 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3470
3471 * nsterm.m (ns_do_open_file): New variable.
3472 (ns_term_init): Set ns_do_open_file to YES after run returns.
3473 (openFile, openTempFile, openFileWithoutUI, openFiles):
3474 Open files only if ns_do_open_file.
3475
3476 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3477
3478 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3479 This no-op macro hasn't been needed for many years.
3480 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3481
3482 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3483 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3484 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3485 gdb_make_enums_visible.
3486 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3487 (DIRECTORY_SEP): Now a constant, not a macro.
3488
3489 2012-07-30 Eli Zaretskii <eliz@gnu.org>
3490
3491 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3492 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3493
3494 * w32term.c <w32_keyboard_codepage>: Renamed from
3495 keyboard_codepage and now external. All users changed.
3496
3497 * w32term.h: Add declaration of w32_keyboard_codepage.
3498
3499 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3500 the codepage to translate keys to Unicode. If this argument is
3501 -1, use the value returned by GetConsoleCP. All callers changed.
3502
3503 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3504
3505 Update .PHONY listings in makefiles.
3506 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3507 bootstrap-clean, distclean, maintainer-clean, versioclean,
3508 extraclean, frc.
3509
3510 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3511 This is a bit clearer. Fix some commentary typos.
3512
3513 2012-07-30 Glenn Morris <rgm@gnu.org>
3514
3515 * s/netbsd.h: Let configure include signal.h if needed.
3516 Remove file, which is now empty.
3517
3518 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3519 Let configure set them.
3520 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3521 No more need to undefine.
3522
3523 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3524
3525 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3526 non-single-byte char when adding meta modifier. (Bug#12090)
3527
3528 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3529
3530 Convert safe_call to use variable number of arguments.
3531 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3532 (safe_call2): Fix comment.
3533 * lisp.h (safe_call): Adjust prototype.
3534 * coding.c (encode_coding_object): Change to use safe_call2.
3535 * xfaces.c (merge_face_heights): Change to use safe_call1.
3536
3537 2012-07-30 Glenn Morris <rgm@gnu.org>
3538
3539 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3540 does that unconditionally. Remove file, which is now empty.
3541
3542 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3543 Remove empty files.
3544
3545 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3546
3547 Export to GDB most of lisp.h's remaining object-like macros.
3548 * lisp.h (min, max): Move earlier, because they're used earlier now.
3549 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3550 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3551 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3552 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3553 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3554 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3555 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3556 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3557 Now constants, for GDB. They need not be macros.
3558 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3559 Now constants, for GDB, as well as macros, for static initializers.
3560 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3561 Move to after the definition of struct Lisp_Char_Table,
3562 since the former now needs that type defined.
3563 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3564 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3565 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3566 New enums, for gdb_make_enums_visible.
3567 (GLYPH_MODE_LINE_FACE): Remove; unused.
3568 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3569 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3570 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3571 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3572 enum maxargs, enum MAX_ALLOCA.
3573 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3574 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3575 no longer needed, now that they are done in lisp.h.
3576
3577 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3578
3579 Cleanup string bytes checking.
3580 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3581 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3582 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3583 (check_sblock, compact_small_strings): Simplify.
3584
3585 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3588 These macros are confusing and no longer need to be defined, as
3589 the enum values now suffice. All uses replaced with definiens.
3590 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3591
3592 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3593
3594 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3595 ($(BLD)/w32console.$(O)): Update dependencies.
3596
3597 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3598
3599 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3600 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3601 time. Adjust users.
3602 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3603
3604 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3605
3606 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3607 setting sitelisp (Bug#12010).
3608
3609 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3610
3611 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3612
3613 * w32heap.c (cache_system_info):
3614 * w32.c (sys_rename):
3615 * w32proc.c (find_child_console, sys_kill): All users changed.
3616
3617 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3618
3619 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3620
3621 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3622
3623 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3624
3625 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3626
3627 Cleanup statistics calculation in Fgarbage_collect.
3628 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3629 Fix zombies percentage calculation. Simplify elapsed time calculation.
3630
3631 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3632
3633 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3634 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3635 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3636 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3637 (replace_range, replace_range_2, del_range_2): Change to eassert.
3638 * marker.c (byte_char_debug_check): Adjust style.
3639
3640 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3641
3642 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3643 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3644 long-ago-commented-out code that talks about "WIN32".
3645 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3646 All uses changed.
3647
3648 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3649
3650 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3651 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3652 Simplify by using alignof.
3653 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3654 * lisp.h: Include <stdalign.h>.
3655 (GCALIGNMENT): New macro and constant.
3656 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3657 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3658 (stdalign): New macro, if not already defined.
3659
3660 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3661
3662 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3663 * w32inevt.c: Include w32inevt.h.
3664 (w32_read_console_input): New inline function, calls either
3665 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3666 w32_console_unicode_input.
3667 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3668 (w32_kbd_patch_key, key_event): Use the codepage returned by
3669 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3670 (key_event): use uChar.UnicodeChar only if
3671 w32_console_unicode_input is non-zero.
3672
3673 * w32console.c: Include w32heap.h.
3674 <w32_console_unicode_input>: New global variable.
3675 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3676 family of Windows, zero otherwise.
3677
3678 * w32inevt.h: Declare w32_console_unicode_input.
3679
3680 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3681 --without-x. (Bug#11742)
3682
3683 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3684
3685 Adjust GDB to reflect pvec_type changes (Bug#12036).
3686 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3687 2012-07-04 changes to pseudovector representation.
3688 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3689
3690 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3691
3692 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3693 bus address.
3694 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3695
3696 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3697
3698 * alloc.c (listn): Fix the order the arguments are consed onto the
3699 list.
3700
3701 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3702 enumeration constants, as PURE and HEAP are too general, and clash
3703 with other headers and sources, such as gmalloc.c and the
3704 MS-Windows system headers. All users changed.
3705
3706 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3707
3708 Revert last save_excursion_save and save_excursion_restore changes.
3709 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3710 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3711
3712 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3713
3714 Fix recently-introduced typos in Windows port.
3715 Reported by Martin Rudalics <rudalics@gmx.at>.
3716 * w32.c (init_environment): Replace comma with semicolon.
3717 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3718
3719 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3720
3721 Improve GDB symbol export (Bug#12036).
3722 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3723 arms of an 'if', not using conditional expressions; otherwise GDB
3724 complains about the types in the unevaluated arm when the argument
3725 is an integer literal.
3726 (xgetint): Simplify expression.
3727 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3728 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3729 Zaretskii in <http://bugs.gnu.org/12036#13>.
3730 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3731 needed now that we have gdb_make_enums_visible.
3732 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3733 (enum enum_USE_LSB_TAG):
3734 New enum types, packaging up enums that need to be exported to GDB.
3735
3736 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3737
3738 Utility function to make a list from specified amount of objects.
3739 * lisp.h (enum constype): New datatype.
3740 (listn): New prototype.
3741 * alloc.c (listn): New function.
3742 (Fmemory_use_count, syms_of_alloc): Use it.
3743 * buffer.c (syms_of_buffer): Likewise.
3744 * callint.c (syms_of_callint): Likewise.
3745 * charset.c (define_charset_internal): Likewise.
3746 * coding.c (syms_of_coding): Likewise.
3747 * keymap.c (syms_of_keymap): Likewise.
3748 * search.c (syms_of_search): Likewise.
3749 * syntax.c (syms_of_syntax): Likewise.
3750 * w32.c (init_environment): Likewise.
3751 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3752 * xdisp.c (syms_of_xdisp): Likewise.
3753 * xfns.c (syms_of_xfns): Likewise.
3754
3755 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3756
3757 Fast save_excursion_save and save_excursion_restore.
3758 * lisp.h (struct Lisp_Excursion): New data type.
3759 (PVEC_EXCURSION): New pseudovector type.
3760 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3761 to deal with it. Adjust comments.
3762 (init_marker, attach_marker): New prototype.
3763 (unchain_marker): Adjust prototype.
3764 * marker.c (attach_marker): Change to global.
3765 (init_marker): New function.
3766 * alloc.c (Fmake_marker, build_marker): Use it.
3767 (build_marker): More easserts.
3768 (mark_object): Handle struct Lisp_Excursion.
3769 * editfns.c (save_excursion_save, save_excursion_restore):
3770 Reimplement to use struct Lisp_Excursion. Add comments.
3771
3772 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3773
3774 Fix export of symbols to GDB (Bug#12036).
3775 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3776 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3777 emacs.c, as this is a more-suitable home. Had this been done earlier
3778 the fix for 12036 would have avoided some of the problems noted in
3779 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3780 would have been more obvious.
3781 * emacs.c: Do not include <verify.h>; no longer needed.
3782 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3783 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3784 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3785 Remove; now done in lisp.h.
3786 * lisp.h (PUBLISH_TO_GDB): New macro.
3787 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3788 (DATA_SEG_BITS): Use it.
3789 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3790 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3791 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3792 not be usable in #if. This simplifies things.
3793
3794 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3795
3796 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3797
3798 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3799
3800 Simplify export of symbols to GDB (Bug#12036).
3801 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3802 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3803 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3804 Adjust to changes in lisp.h and emacs.c, by using
3805 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3806 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3807 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3808 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3809 instead of gdb_valbits.
3810 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3811 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3812 instead of gdb_array_mark_flag.
3813 (xboolvector): Get size from $->size, not $->header.size.
3814 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3815 (xreload, hook-run, hookpost-run): Remove.
3816 * emacs.c: Include <verify.h>.
3817 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3818 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3819 Remove.
3820 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3821 (gdb_USE_LSB_TAG): New enum constants.
3822 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3823 Also define these as enum constants, so they're visible to GDB.
3824 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3825 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3826 as constants, so they're visible to GDB.
3827 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3828 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3829 Now enum constants, not macros, so they're visible to GDB.
3830 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3831 more convenient now. All uses changed.
3832 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3833 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3834
3835 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3836
3837 Explicitly free restriction data that are not needed anymore.
3838 * editfns.c (save_restriction_restore): Free restriction data.
3839
3840 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3841
3842 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3843 add argument, tune behavior, and adjust all callers.
3844
3845 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3846
3847 Use typedef for EMACS_INT, EMACS_UINT.
3848 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3849 than macros. This simplifies debugging in the usual case, since
3850 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3851 and it allows expressions involving EMACS_INT casts.
3852 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3853
3854 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3855
3856 * nsterm.m (ns_read_socket): Return early if there is a modal
3857 window (Bug#12043).
3858
3859 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3860
3861 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3862 that FOCUS-FRAME can be omitted.
3863
3864 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3865
3866 Adjust buffer text indirection counters at the end of Fkill_buffer.
3867 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3868 buffer is definitely dead. This should really fix an issue reported
3869 by Christoph Scholtes again. (Bug#12007).
3870 (init_buffer_once): Initialize indirection counters of
3871 buffer_defaults and buffer_local_symbols (for sanity and safety).
3872
3873 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3874
3875 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3876 and continuation glyphs on tooltip frames, leave them at zero.
3877 Avoids continued lines in tooltips. (Bug#11832)
3878
3879 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3880
3881 Simplify copy_overlay.
3882 * buffer.c (copy_overlay): Simplify. Use build_marker.
3883 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3884
3885 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3886
3887 * print.c (print_object): Don't crash when a frame's name is nil
3888 or invalid. (Bug#12025)
3889
3890 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3891 it signals an error when a tooltip frame is being created.
3892
3893 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3894
3895 Cleanup miscellaneous objects allocation and initialization.
3896 * alloc.c (allocate_misc): Change to static. Add argument to
3897 specify the subtype. Adjust comment and users.
3898 (build_overlay): New function.
3899 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3900 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3901 (allocate_misc): Remove prototype.
3902 (build_overlay): Add prototype.
3903
3904 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3905
3906 Swap buffer text indirection counters in Fbuffer_swap_text.
3907 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3908 This avoids crash reported by Christoph Scholtes at
3909 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3910
3911 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3912
3913 * nsmenu.m (Popdown_data): New struct.
3914 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3915 free Popdown_data.
3916 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3917 (initWithContentRect): Make imgView and contentView non-static
3918 and autorelease them. Also autorelease img and matrix (Bug#12005).
3919 (dealloc): Remove (Bug#12005).
3920
3921 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3922
3923 Adjust consing_since_gc when objects are explicitly freed.
3924 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3925 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3926 (free_cons, free_misc): Subtract object size from consing_since_gc.
3927
3928 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3929
3930 Simplify and cleanup markers positioning code.
3931 * marker.c (attach_marker): More useful eassert.
3932 (live_buffer, set_marker_internal): New function.
3933 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3934 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3935
3936 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3937
3938 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3939 as it's limited by the amount of memory, not by INT_MAX.
3940
3941 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3942
3943 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3944 in special-event-map. See the discussion at
3945 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3946 for the reasons.
3947
3948 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3949 info.dwItemData. Fixes crashes on 64-bit Windows.
3950 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3951
3952 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3953
3954 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3955 (conversationIdentifier): Return value is NSInteger.
3956 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3957
3958 2012-07-21 Chong Yidong <cyd@gnu.org>
3959
3960 * window.c (decode_any_window): Signal an error if the window is
3961 on a dead frame (Bug#11984).
3962
3963 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3964
3965 Add indirection counting to speed up Fkill_buffer.
3966 * buffer.h (struct buffer): New member.
3967 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3968 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3969 base buffer indirection counter.
3970 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3971 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3972 through buffer list if indirection counter is 0.
3973
3974 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3975
3976 Extend the value returned by Fgarbage_collect with heap statistics.
3977 * alloc.c (Qheap): New symbol.
3978 (syms_of_alloc): DEFSYM it.
3979 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3980 (Fmemory_free): Remove.
3981 (syms_of_alloc): Don't defsubr it.
3982 * buffer.c (Fcompact_buffer): Remove.
3983 (syms_of_buffer): Don't defsubr it.
3984
3985 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3986
3987 Make maybe_gc inline.
3988 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3989 * lisp.h (consing_since_gc, gc_relative_threshold)
3990 (memory_full_cons_threshold): Revert declaration.
3991 (maybe_gc): Remove prototype, define as inline.
3992 * alloc.c: Remove old commented-out code.
3993 (consing_since_gc, gc_relative_threshold)
3994 (memory_full_cons_threshold): Revert to global.
3995 (maybe_gc): Remove.
3996
3997 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3998
3999 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4000 * lisp.h (build_unibyte_string): New function.
4001 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4002 * sysdep.c, w32fns.c, xfns.c: Use it.
4003 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4004 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4005 Adjust users accordingly.
4006 * font.h (font_open_by_name): Adjust prototype.
4007
4008 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4009
4010 Cleanup calls to Fgarbage_collect.
4011 * lisp.h (maybe_gc): New prototype.
4012 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4013 Remove declarations.
4014 * alloc.c (maybe_gc): New function.
4015 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4016 Make them static.
4017 * bytecode.c (MAYBE_GC): Use maybe_gc.
4018 * eval.c (eval_sub, Ffuncall): Likewise.
4019 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4020 to avoid dependency from auto-save feature.
4021
4022 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4023
4024 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4025 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4026 'for_each_per_buffer_object_at'.
4027 All uses changed. It's better to use upper-case for macros that
4028 cannot be implemented as functions, to give the reader a clue
4029 that they're special.
4030
4031 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4032
4033 * alloc.c (Fgarbage_collect): Tweak docstring.
4034
4035 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4036
4037 Tweak the value returned from Fgarbage_collect again.
4038 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4039 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4040 Adjust documentation.
4041 (total_vector_bytes): Rename to total_vector_slots, adjust
4042 accounting.
4043 (total_free_vector_bytes): Rename to total_free_vector_slots,
4044 adjust accounting.
4045 (Qstring_bytes, Qvector_slots): New symbols.
4046 (syms_of_alloc): DEFSYM them.
4047
4048 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4049
4050 Buffer compaction primitive which may be used from Lisp.
4051 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4052 (syms_of_buffer): Register Fcompact_buffer.
4053 * alloc.c (Fgarbage_collect): Use compact_buffer.
4054 * buffer.h (compact_buffer): New prototype.
4055 (struct buffer_text): New member.
4056
4057 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4058
4059 New macro to iterate over all buffers, miscellaneous cleanups.
4060 * lisp.h (all_buffers): Remove declaration.
4061 * buffer.h (all_buffers): Add declaration, with comment.
4062 (for_each_buffer): New macro.
4063 * alloc.c (Fgarbage_collect, mark_object): Use it.
4064 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4065 (init_buffer): Likewise.
4066 * data.c (Fset_default): Likewise.
4067 * coding.c (code_conversion_restore): Remove redundant check
4068 for dead buffer.
4069 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4070
4071 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4072
4073 Fix bug that created negative-length intervals.
4074 * intervals.c (merge_interval_right, merge_interval_left):
4075 Do not zero out this interval if it is absorbed by its children,
4076 as this interval's total length doesn't change in that case. See
4077 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4078
4079 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4080
4081 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4082 when invoking (make-bool-vector N t) and N is a positive
4083 multiple of 8 -- the last 8 bits were mistakenly cleared.
4084
4085 Remove some struct layout assumptions in bool vectors.
4086 * alloc.c (bool_header_size): New constant.
4087 (header_size, word_size): Move earlier, as they're now used earlier.
4088 Use 'word_size' in a few more places, where it's appropriate.
4089 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4090 padding before the data member of a bool vector.
4091 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4092 than doing the check by hand with an abort ().
4093
4094 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4095
4096 * eval.c (Fdefvar): Don't check constants since we only set the var if
4097 it's not yet defined anyway (bug#11904).
4098
4099 * lisp.h (last_undo_boundary): Declare new var.
4100 * keyboard.c (command_loop_1): Set it.
4101 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4102 were auto-added by the command loop (bug#11774).
4103
4104 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4105
4106 * w32font.c (Qsymbol): Remove local definition.
4107 (syms_of_w32font): Don't DEFSYM it.
4108
4109 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4110
4111 Fix sweep_vectors to handle large bool vectors correctly.
4112 * alloc.c (sweep_vectors): Account total_vector_bytes for
4113 bool vectors larger than VBLOCK_BYTES_MAX.
4114
4115 2012-07-18 Chong Yidong <cyd@gnu.org>
4116
4117 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4118 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4119
4120 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4121
4122 Return more descriptive data from Fgarbage_collect.
4123 Suggested by Stefan Monnier in
4124 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4125 * alloc.c (bounded_number): New function.
4126 (total_buffers, total_vectors): New variable.
4127 (total_string_size): Rename to total_string_bytes, adjust users.
4128 (total_vector_size): Rename to total_vector_bytes, adjust users.
4129 (sweep_vectors): Account total_vectors and total_vector_bytes.
4130 (Fgarbage_collect): New return value. Adjust documentation.
4131 (gc_sweep): Account total_buffers.
4132 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4133 (VECTOR_SIZE): Remove.
4134 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4135 (Qinterval, Qmisc): New symbols.
4136 (syms_of_data): Initialize them.
4137 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4138 (Qcons, Qbuffer): New declarations.
4139
4140 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4141
4142 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4143 Round up, not down. Improve doc.
4144
4145 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4146
4147 Restore old code in allocate_string_data to avoid Faset breakage.
4148 Reported by Julien Danjou <julien@danjou.info> in
4149 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4150 * alloc.c (allocate_string_data): Restore old code with minor
4151 adjustments, fix comment to explain this subtle issue.
4152
4153 2012-07-17 Eli Zaretskii <eliz@gnu.org>
4154
4155 Remove FILE_SYSTEM_CASE.
4156 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4157
4158 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4159 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4160 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4161 call-process-region passes it through expand-file-name.
4162
4163 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4164
4165 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4166
4167 Fix crash when creating indirect buffer (Bug#11917)
4168 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4169 Don't handle unbound variables specially if non-zero.
4170 (Fbuffer_local_variables): Pass zero.
4171 (clone_per_buffer_values): Pass non-zero.
4172
4173 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4174
4175 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4176 to make the loop interruptible.
4177
4178 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4179
4180 * gnutls.c (emacs_gnutls_handshake): Only retry if
4181 GNUTLS_E_INTERRUPTED.
4182
4183 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4184
4185 Cleanup and convert miscellaneous checks to eassert.
4186 * alloc.c (mark_interval): Fix comment, partially rephrase
4187 old comment from intervals.h (see below).
4188 * intervals.c (find_interval, adjust_intervals_for_insertion)
4189 (delete_interval, adjust_intervals_for_deletion)
4190 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4191 Convert to eassert.
4192 (adjust_intervals_for_insertion, make_new_interval):
4193 Remove obsolete and unused code.
4194 * intervals.h (struct interval): Remove obsolete comment.
4195 * textprotp.c (erase_properties): Remove unused code.
4196 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4197 (Fremove_list_of_text_properties): Convert to eassert.
4198
4199 2012-07-17 Chong Yidong <cyd@gnu.org>
4200
4201 * editfns.c (Finsert_char): Doc fix.
4202
4203 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4204
4205 Fix previous change to make Fmemory_free always accurate.
4206 * alloc.c (make_interval): Update total_free_intervals.
4207 (make_float): Likewise for total_free_floats.
4208 (free_cons, Fcons): Likewise for total_free_conses.
4209 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4210 Likewise for total_free_vector_bytes.
4211 (Fmake_symbol): Likewise for total_free_symbols.
4212 (bytes_free): Remove.
4213
4214 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4215
4216 Simple free memory accounting feature.
4217 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4218 (sweep_vectors): Accumulate size of free vectors.
4219 (Fgarbage_collect): Setup bytes_free.
4220 (Fmemory_free): New function.
4221 (syms_of_alloc): Register it.
4222
4223 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4224
4225 Cleanup overlays checking.
4226 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4227 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4228 eassert and OVERLAYP.
4229 (sort_overlays): Change to use OVERLAYP.
4230
4231 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4232
4233 * editfns.c (Finsert_char): Make it interactive, and make the
4234 second arg optional. Copy interactive spec and docstring from
4235 ucs-insert.
4236
4237 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4238
4239 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4240 Unlike the other wrapped functions, fabs has an unspecified
4241 effect on errno.
4242
4243 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4244
4245 * nsterm.m (keyDown): Interpret flags without left/right bits
4246 as the left key (Bug#11670).
4247
4248 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4249
4250 Remove empty and useless init functions.
4251 * lisp.h (init_character_once, init_fns, init_image)
4252 (init_filelock, init_sound): Remove prototype.
4253 * character.c (init_character_once): Remove.
4254 * filelock.c (init_filelock): Likewise.
4255 * fns.c (init_fns): Likewise.
4256 * image.c (init_image): Likewise.
4257 * sound.c (init_sound): Likewise.
4258 * emacs.c (main): Adjust accordingly.
4259
4260 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4261
4262 * gtkutil.h: Tiny cleanups.
4263 (use_old_gtk_file_dialog): Remove useless declaration.
4264 (xg_uses_old_file_dialog): Add suggested const attribute.
4265
4266 2012-07-15 Eli Zaretskii <eliz@gnu.org>
4267
4268 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4269 (bidi_paragraph_init): Use it to limit search forward for a strong
4270 directional character in abnormally large paragraphs full of
4271 neutral or weak characters. (Bug#11943)
4272
4273 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4274
4275 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4276 the toolbar (Bug#9451).
4277 (xg_make_tool_item): Give the widget event box a transparent
4278 background.
4279
4280 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4281
4282 Cleanup basic allocation variables and functions.
4283 * alloc.c (ignore_warnings, init_intervals, init_float)
4284 (init_cons, init_symbol, init_marker): Remove.
4285 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4286 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4287 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4288 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4289 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4290 (staticidx, init_alloc_once, init_strings, free_ablock):
4291 Remove redundant initialization.
4292 * fns.c (init_weak_hash_tables): Remove.
4293 * lisp.h (init_weak_hash_tables): Remove prototype.
4294
4295 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4296
4297 Use zero_vector where appropriate.
4298 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4299 accordingly.
4300 * lisp.h (zero_vector): New declaration.
4301 * font.c (null_vector): Remove.
4302 (syms_of_font): Remove initialization and staticpro.
4303 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4304 * keymap.c (Faccessible_keymaps): Likewise.
4305
4306 2012-07-15 Leo Liu <sdl.web@gmail.com>
4307
4308 * fringe.c: Fix typo in comments.
4309
4310 2012-07-14 Leo Liu <sdl.web@gmail.com>
4311
4312 * fringe.c: Add a new bitmap exclamation-mark.
4313
4314 2012-07-14 Eli Zaretskii <eliz@gnu.org>
4315
4316 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4317
4318 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4319 (HAVE_MENUS): Don't define, defined by editing config.in with
4320 msdos/sed2v2.inp.
4321 (GMALLOC_INHIBIT_VALLOC): Don't define.
4322 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4323
4324 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
4325
4326 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4327
4328 2012-07-14 Glenn Morris <rgm@gnu.org>
4329
4330 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4331 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4332 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4333
4334 2012-07-13 Glenn Morris <rgm@gnu.org>
4335
4336 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4337
4338 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4339 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4340
4341 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4342
4343 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4344 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4345 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4346 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4347 where appropriate.
4348 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4349 as boolean expression.
4350 (x_set_window_size): Remove unused variable toolbar.
4351 (ns_get_color_default, ns_mod_to_lisp): Remove.
4352 (ns_mouse_position): Remove unused variables xchar and ychar.
4353 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4354 (ns_set_vertical_scroll_bar): Remove unused variable count.
4355 (ns_delete_terminal): Remove unused variable i.
4356 (ns_term_init): Remove unused variables r, g and b.
4357 (mouseDown): Remove unused variable window.
4358 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4359 (initFrameFromEmacs): Remove unused variable vbextra.
4360 (mouseEntered): Remove unused variables p and dpyinfo.
4361 (mouseExited): Remove unused variables p and r.
4362 (ns_define_frame_cursor, ns_clear_frame_area)
4363 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4364 (menuDown): Assign [sender tag] to variable and cast the variable.
4365
4366 * nsterm.h (menuDown): Add id as type to argument sender.
4367 (ns_display_info_for_name): Add Lisp_Object argument.
4368 (ns_term_init): Add Lisp_Object argument.
4369 (ns_map_event_to_object): Add void argument.
4370 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4371 prototype with arguments and only declare if __OBJC__.
4372 (nxatoms_of_nsselect): Add void argument.
4373 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4374 (ns_alloc_autorelease_pool): Add void argument.
4375 (ns_release_autorelease_pool): Add void* argument.
4376 (ns_get_defaults_value): Add const char* argument.
4377
4378 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4379 (initFromContents): Use SSDATA where appropriate.
4380 (ns_update_menubar): Add braces to ambigous if-else.
4381 (initWithTitle): Put () around assignment in if statement.
4382 (ns_menu_show): Remove unused variables window and keymap.
4383 (update_frame_tool_bar): Remove unused variable selected_p.
4384 (initWithContentRect): Remove unused variable this_cmd_name.
4385
4386 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4387 appropriate.
4388 (setXBMColor): Remove unused variable len.
4389 (setPixmapData): Put () around assignment in loop statement.
4390
4391 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4392 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4393 where appropriate.
4394 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4395 around assignment in loop statement.
4396 (nsfont_open): Remove unused variable i.
4397 (nsfont_open): Remove unused variable len.
4398 (nsfont_draw): Remove unused variable cs.
4399
4400 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4401 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4402 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4403 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4404 (Fns_font_name, Fns_perform_service)
4405 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4406 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4407 (ns_set_name): Remove unused variable view.
4408 (x_set_menu_bar_lines): Remove unused variable olines.
4409 (x_set_tool_bar_lines): Remove unused variable root_window.
4410 (Fns_list_colors): Put () around assignment in while statement.
4411 (Fns_perform_service): Remove unused variable len.
4412 (Fns_display_usable_bounds): Remove unused variable top.
4413 (syms_of_nsfns): Remove unused variable i.
4414
4415 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4416 memcpy (Bug#11907).
4417
4418 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4419
4420 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4421 and free it with DestroyExceptionInfo (Bug#11558).
4422
4423 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
4424
4425 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4426 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4427 Set here, not in nt/config.nt.
4428
4429 2012-07-13 Eli Zaretskii <eliz@gnu.org>
4430
4431 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4432 cursor overflow into the last glyph on display line when the right
4433 fringe is off. (Bug#11832)
4434
4435 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4436
4437 * xdisp.c (produce_special_glyphs): Now static.
4438 * dispextern.h (produce_special_glyphs): Remove decl.
4439
4440 2012-07-13 Glenn Morris <rgm@gnu.org>
4441
4442 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4443 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4444
4445 * s/usg5-4-common.h (USG, USG5):
4446 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4447 * s/sol2-6.h (SOLARIS2):
4448 * s/irix6-5.h (IRIX6_5):
4449 * s/hpux10-20.h (USG, USG5, HPUX):
4450 * s/gnu-linux.h (USG, GNU_LINUX):
4451 * s/freebsd.h (BSD_SYSTEM):
4452 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4453 * s/cygwin.h (CYGWIN):
4454 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4455 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4456
4457 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4458
4459 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4460
4461 2012-07-13 Glenn Morris <rgm@gnu.org>
4462
4463 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4464
4465 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4466
4467 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4468 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4469
4470 2012-07-12 Glenn Morris <rgm@gnu.org>
4471
4472 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4473
4474 * process.c (init_process_emacs): Rename from init_process.
4475 The old name is also the name of a Mach system call.
4476 * lisp.h, emacs.c: Update for this name change.
4477 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4478 longer needed.
4479
4480 2012-07-12 Eli Zaretskii <eliz@gnu.org>
4481
4482 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4483 memmove call that removes glyphs covered by the left truncation
4484 glyph. Improve commentary.
4485 (display_line): Fix display of continuation glyphs on GUI frames
4486 when the right fringe is turned off and variable-size fonts are
4487 used in the window. Move the code that appends a stretch glyph to
4488 produce_special_glyphs, so that it could be used for truncation
4489 and continuation glyphs alike.
4490 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4491 glyph of a suitably computed width, to align the special glyphs at
4492 the window margin. Code moved from display_line. (Bug#11832)
4493
4494 2012-07-12 Glenn Morris <rgm@gnu.org>
4495
4496 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4497
4498 * s/gnu-linux.h, s/hpux10-20.h:
4499 Do not unconditionally define HAVE_XRMSETDATABASE.
4500
4501 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4502
4503 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4504
4505 Fix typos that broke OS X build.
4506 Reported by Randal L. Schwartz in
4507 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4508 * nsterm.m (ns_timeout): Add missing local decl.
4509 (ns_get_color): snprintf -> sprintf, to fix typo.
4510
4511 2012-07-12 Glenn Morris <rgm@gnu.org>
4512
4513 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4514 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4515 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4516 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4517
4518 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4519 Move PTY_OPEN to configure.
4520
4521 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4522 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4523 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4524
4525 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4526
4527 Use empty_unibyte_string where applicable.
4528 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4529 * lread.c (read1): Likewise.
4530 * xsettings.c (syms_of_xsettings): Likewise.
4531
4532 2012-07-12 Glenn Morris <rgm@gnu.org>
4533
4534 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4535 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4536 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4537 * s/hpux10-20.h (RUN_TIME_REMAP):
4538 * s/bsd-common.h (TABDLY): Move to configure.
4539
4540 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4541
4542 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4543
4544 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4545 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4546
4547 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4548
4549 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4550 * s/template.h: Move NARROWPROTO to configure.
4551
4552 2012-07-11 Glenn Morris <rgm@gnu.org>
4553
4554 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4555 unused since 2011-01-17 change to systty.h.
4556
4557 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4558 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4559 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4560
4561 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4562
4563 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4564
4565 2012-07-11 Glenn Morris <rgm@gnu.org>
4566
4567 * s/darwin.h, s/gnu-linux.h, s/template.h:
4568 Move INTERRUPT_INPUT to configure.
4569
4570 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4571
4572 Minor adjustments to interning code.
4573 * lisp.h (intern, intern_c_string): Redefine as static inline
4574 wrappers for intern_1 and intern_c_string_1, respectively.
4575 (intern_1, intern_c_string_1): Rename prototypes.
4576 * lread.c (intern_1, intern_c_string_1, oblookup):
4577 Simplify Vobarray checking.
4578 * font.c (font_intern_prop): Likewise. Adjust comment.
4579 * w32font.c (intern_font_name): Likewise.
4580
4581 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4582
4583 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4584
4585 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4586 of Fcar/Fcdr if possible.
4587 * font.c (check_otf_features): Likewise.
4588 * fontset.c (Fnew_fontset): Likewise.
4589 * gnutls.c (Fgnutls_boot): Likewise.
4590 * minibuf.c (read_minibuf): Likewise.
4591 * msdos.c (IT_set_frame_parameters): Likewise.
4592 * xmenu.c (Fx_popup_dialog): Likewise.
4593 * w32menu.c (Fx_popup_dialog): Likewise.
4594
4595 2012-07-11 Glenn Morris <rgm@gnu.org>
4596
4597 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4598 since nothing has defined it on these platforms.
4599
4600 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4601 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4602
4603 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4604 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4605 Move CLASH_DETECTION to configure.
4606
4607 * s/gnu.h: Remove file, which is now empty.
4608
4609 * s/gnu.h, s/gnu-linux.h:
4610 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4611
4612 2012-07-11 John Wiegley <johnw@newartisans.com>
4613
4614 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4615 function attribute, so we only use it if it exists in the
4616 compiler.
4617
4618 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4619
4620 Avoid call to strlen in fast_c_string_match_ignore_case.
4621 * search.c (fast_c_string_match_ignore_case): Change to use
4622 length argument. Adjust users accordingly.
4623 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4624
4625 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4626
4627 Assume mkdir, rmdir.
4628 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4629 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4630
4631 Assume rename.
4632 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4633
4634 Assume perror.
4635 * s/hpux10-20.h (HAVE_PERROR): Remove.
4636 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4637 Remove dummy definition, as this problem was obsolete long ago.
4638
4639 Assume strerror.
4640 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4641
4642 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4643
4644 Avoid calls to strlen in font processing functions.
4645 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4646 (font_open_by_name): Change to use length argument.
4647 Adjust users accordingly.
4648 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4649 Adjust prototypes.
4650 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4651 Change to return ptrdiff_t.
4652 (xfont_list_pattern, xfont_match): Use length returned by
4653 xfont_decode_coding_xlfd.
4654 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4655
4656 2012-07-11 Glenn Morris <rgm@gnu.org>
4657
4658 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4659 Move DONT_REOPEN_PTY to configure.
4660
4661 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4662 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4663
4664 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4665
4666 Remove "#define unix" that is no longer needed (Bug#11905).
4667 * s/aix4-2.h (unix): Remove; no longer needed.
4668
4669 EMACS_TIME simplification (Bug#11875).
4670 This replaces macros (which typically do not work in GDB)
4671 with functions, typedefs and enums, making the code easier to debug.
4672 The functional style also makes code easier to read and maintain.
4673 * systime.h: Include <sys/time.h> on all hosts, not just if
4674 WINDOWSNT, since 'struct timeval' is needed in general.
4675 (EMACS_TIME): Now a typedef, not a macro.
4676 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4677 not macros.
4678 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4679 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4680 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4681 (EMACS_TIME_LE): Now functions, not macros.
4682 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4683 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4684 which are not functions. All uses rewritten to use:
4685 (make_emacs_time): New function.
4686 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4687 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4688 not functions. All uses rewritten to use the following, respectively:
4689 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4690 (add_emacs_time, sub_emacs_time): New functions.
4691 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4692 * fileio.c (Fcopy_file):
4693 * xterm.c (XTflash): Get the current time closer to when it's used.
4694 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4695
4696 * bytecode.c (targets): Suppress -Woverride-init warnings.
4697
4698 Simplify by avoiding confusing use of strncpy etc.
4699 * doc.c (Fsnarf_documentation):
4700 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4701 * frame.c (Fmake_terminal_frame):
4702 * gtkutil.c (get_utf8_string):
4703 * lread.c (openp):
4704 * nsmenu.m (ns_update_menubar):
4705 * regex.c (regerror):
4706 Prefer memcpy to strncpy and strncat when either will do.
4707 * fileio.c (Fsubstitute_in_file_name):
4708 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4709 (menu_separator_name_p):
4710 * nsmenu.m (ns_update_menubar):
4711 Prefer memcmp to strncmp when either will do.
4712 * nsterm.m: Include <ftoastr.h>.
4713 (ns_get_color):
4714 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4715 Prefer snprintf to strncpy.
4716 * nsterm.m (ns_term_init):
4717 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4718 * nsterm.m (ns_term_init):
4719 Avoid the need for strncpy, by using build_string or
4720 make_unibyte_string directly. Use dtoastr, not snprintf.
4721 * process.c (Fmake_network_process): Diagnose service names that
4722 are too long, rather than silently truncating them or creating
4723 non-null-terminated names.
4724 (Fnetwork_interface_info): Likewise, for interface names.
4725 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4726 Prefer sprintf to strncat.
4727 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4728 Prefer vsnprintf to vsprintf + strncpy.
4729
4730 2012-07-10 Glenn Morris <rgm@gnu.org>
4731
4732 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4733 Clarify fallback case.
4734
4735 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4736
4737 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4738 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4739 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4740 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4741 where argument type is known to be a Lisp_Cons.
4742
4743 2012-07-10 Tom Tromey <tromey@redhat.com>
4744
4745 * bytecode.c (BYTE_CODE_THREADED): New macro.
4746 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4747 (enum byte_code_op): New type.
4748 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4749 (exec_byte_code): Use them. Use token threading when applicable.
4750
4751 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4752
4753 Optimize pure C strings initialization.
4754 * lisp.h (make_pure_string): Fix prototype.
4755 (build_pure_c_string): New function, defined as static inline. This
4756 provides a better opportunity to optimize away calls to strlen when
4757 the function is called with compile-time constant argument.
4758 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4759 argument, adjust users accordingly. Use build_pure_c_string where
4760 appropriate.
4761 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4762 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4763 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4764
4765 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4766
4767 Avoid calls to strlen in miscellaneous functions.
4768 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4769 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4770 * lread.c (openp): Likewise.
4771
4772 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4773
4774 Avoid calls to strlen in path processing functions.
4775 * fileio.c (file_name_as_directory): Add comment. Change to add
4776 srclen argument and return the length of result. Adjust users
4777 accordingly.
4778 (directory_file_name): Fix comment. Change to add srclen argument,
4779 swap 1st and 2nd arguments to obey the common convention.
4780 Adjust users accordingly.
4781 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4782
4783 2012-07-10 Glenn Morris <rgm@gnu.org>
4784
4785 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4786 Move PENDING_OUTPUT_COUNT definition to configure.
4787
4788 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4789 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4790 * s/gnu.h (DATA_START): Move definitions to configure.
4791
4792 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4793 We include usg5-4-common.h, which defines them both.
4794
4795 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4796 O_RDONLY already includes it).
4797
4798 Stop ns builds setting the EMACSLOADPATH environment variable.
4799 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4800 Now it does not set EMACSLOADPATH, just returns the load-path string.
4801 * nsterm.h: Update accordingly.
4802 * lread.c [HAVE_NS]: Include nsterm.h.
4803 (init_lread) [HAVE_NS]: Use ns_load_path.
4804 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4805
4806 2012-07-09 Glenn Morris <rgm@gnu.org>
4807
4808 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4809 since the included bsd-common.h does so.
4810
4811 Stop ns builds setting the EMACSPATH environment variable.
4812 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4813 (ns_init_paths): Do not set EMACSPATH.
4814 * nsterm.h (ns_exec_path): Add it.
4815 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4816 Use ns_exec_path.
4817
4818 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4819
4820 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4821
4822 * process.c (wait_reading_process_output): 'waitchannels' was unset
4823 when read_kbd || !NILP (wait_for_cell); fix this.
4824
4825 Add GCC-style 'const' attribute to functions that can use it.
4826 * character.h (char_resolve_modifier_mask):
4827 * keyboard.h (make_ctrl_char):
4828 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4829 (init_character_once, next_almost_prime, init_fns, init_image)
4830 (flush_pending_output, init_sound):
4831 * mem-limits.h (start_of_data):
4832 * menu.h (finish_menu_items):
4833 Add ATTRIBUTE_CONST.
4834 * emacs.c (DEFINE_DUMMY_FUNCTION):
4835 Declare the dummy function with ATTRIBUTE_CONST.
4836 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4837 Add decls with ATTRIBUTE_CONST.
4838
4839 Minor improvements to make_formatted_string.
4840 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4841 where int is good enough, as vsprintf returns an int.
4842 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4843
4844 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4845
4846 Use make_formatted_string to avoid double length calculation.
4847 * lisp.h (make_formatted_string): New prototype.
4848 * alloc.c (make_formatted_string): New function.
4849 * buffer.c (Fgenerate_new_buffer_name): Use it.
4850 * dbus.c (syms_of_dbusbind): Likewise.
4851 * editfns.c (Fcurrent_time_zone): Likewise.
4852 * filelock.c (get_boot_time): Likewise.
4853 * frame.c (make_terminal_frame, set_term_frame_name)
4854 (x_report_frame_params): Likewise.
4855 * image.c (gs_load): Likewise.
4856 * minibuf.c (get_minibuffer): Likewise.
4857 * msdos.c (dos_set_window_size): Likewise.
4858 * process.c (make_process): Likewise.
4859 * xdisp.c (ensure_echo_area_buffers): Likewise.
4860 * xsettings.c (apply_xft_settings): Likewise.
4861
4862 2012-07-09 Glenn Morris <rgm@gnu.org>
4863
4864 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4865 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4866 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4867 * nsterm.h (ns_etc_directory): Add it.
4868 * callproc.c [HAVE_NS]: Include nsterm.h.
4869 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4870
4871 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4872
4873 Move marker debugging code under MARKER_DEBUG.
4874 * marker.c (MARKER_DEBUG): Move marker debugging code under
4875 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4876 for bootstrap with --enable-checking (~3x slowdown reported
4877 by Juanma Barranquero <lekktu@gmail.com>).
4878 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4879
4880 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4881
4882 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4883 See <http://bugs.gnu.org/11825#29>.
4884
4885 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4886
4887 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4888 has no font, use the frame's font. (Bug#11813)
4889 (display_line): Add commentary about displaying truncation glyphs
4890 on GUI frames.
4891 (produce_special_glyphs): Move here from term.c.
4892
4893 * term.c (produce_special_glyphs): Move to xdisp.c.
4894
4895 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4896 section.
4897
4898 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4899
4900 * xdisp.c (display_line): Avoid warning about implicit declaration
4901 of FRAME_FONT.
4902
4903 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4904
4905 * lisp.h: Remove empty conditional.
4906
4907 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4908
4909 * lread.c (load_path_check): Now static.
4910
4911 Fix some minor --with-ns problems found by static checking.
4912 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4913 (x_set_font) [!HAVE_X_WINDOWS]:
4914 * image.c (xpm_load_image) [HAVE_NS]:
4915 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4916 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4917 Remove unused local.
4918 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4919 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4920 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4921 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4922 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4923 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4924 Fix pointer signedness problem.
4925 * xfaces.c (FRAME_X_FONT_TABLE):
4926 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4927
4928 2012-07-07 Glenn Morris <rgm@gnu.org>
4929
4930 * lread.c (load_path_check): New function, split from init_lread.
4931 (init_lread): Reorganize. Motivation:
4932 If EMACSLOADPATH is set, check/warn about that rather than the
4933 defaults, which we are not going to use. Hence we can remove
4934 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4935 Don't warn if site-lisp directories are missing.
4936 If not installed, start from a blank load-path, since
4937 PATH_LOADSEARCH refers to the eventual installation directories.
4938
4939 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4940
4941 Support truncation and continuation glyphs on GUI frames, when
4942 fringes are disabled. (Bug#11832)
4943 * xdisp.c (init_iterator): Get dimensions of truncation and
4944 continuation glyphs even if on GUI frames.
4945 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4946 or both, are absent.
4947 (start_display, move_it_in_display_line_to): Handle the case of a
4948 GUI frame without a fringe to display continuation or truncation
4949 glyphs.
4950 (insert_left_trunc_glyphs): Support GUI frames: make sure
4951 truncation glyphs overwrite enough glyphs from the current line to
4952 have sufficient space in pixels.
4953 (display_line): Support truncation and continuation glyphs on GUI
4954 frames. If some spare pixels are left on the line after inserting
4955 the truncation glyphs, fill that space with a stretch glyph of a
4956 suitably computed width.
4957
4958 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4959 produce_glyphs, to support GUI sessions.
4960
4961 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4962
4963 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4964
4965 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4966
4967 Do not require float-time's arg to fit in time_t (Bug#11825).
4968 This works better on hosts where time_t is unsigned, and where
4969 float-time is applied to the (negative) difference between two times.
4970 * editfns.c (decode_time_components): Last arg is now double *,
4971 not int *, and means to store all the result as a double, without
4972 worrying about whether the seconds part fits in time_t.
4973 All callers changed.
4974 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4975 All callers changed.
4976 (Ffloat_time): Do not fail merely because the specified time falls
4977 outside of time_t range.
4978
4979 2012-07-07 Glenn Morris <rgm@gnu.org>
4980
4981 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4982 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4983 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4984
4985 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4986
4987 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4988 Update dependencies.
4989
4990 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4991
4992 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4993
4994 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4995 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4996 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4997 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4998 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4999 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5000
5001 * xfont.c (compare_font_names): Redo to omit the need for casts.
5002
5003 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5004
5005 * xfns.c (Fx_change_window_property): Doc fix.
5006 * w32fns.c (Fx_change_window_property): Doc fix.
5007
5008 * w32fns.c (Fx_window_property): Accept the same arguments as the
5009 X Windows version. Doc fix.
5010 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5011
5012 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5013 Eli Zaretskii <eliz@gnu.org>
5014
5015 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5016 Windows-specific code from nt/config.nt moved here.
5017 Obsolete settings removed.
5018
5019 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5020
5021 * process.c: Avoid unnecessary calls to gettime.
5022 (wait_reading_process_output): Don't get the time of day
5023 when gobbling data immediately and not waiting, as there's no need
5024 for it in that case. This removes a FIXME.
5025
5026 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5027
5028 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5029 is defined (Bug#11768).
5030
5031 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5032
5033 Fix marker debugging code.
5034 * marker.c (byte_char_debug_check): Do not perform the check
5035 if buffer is not multibyte.
5036 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5037 Call byte_char_debug_check with correct arguments.
5038
5039 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5040
5041 Compile marker debugging code only if ENABLE_CHECKING is defined.
5042 * marker.c (byte_char_debug_check, count_markers):
5043 Use only if ENABLE_CHECKING is defined.
5044 (byte_debug_flag): Remove.
5045 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5046 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5047
5048 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5049
5050 Avoid code repetition in marker-related functions.
5051 * marker.c (attach_marker): New function.
5052 (Fset_marker, set_marker_restricted, set_marker_both)
5053 (set_marker_restricted_both): Use it.
5054 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5055 Consistently rename charno to charpos.
5056 (marker_position): Add eassert.
5057 (marker_byte_position): Convert to eassert.
5058
5059 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5060
5061 Simplify list operations in unchain_overlay and unchain_marker.
5062 * buffer.c (unchain_overlay): Simplify. Add comment.
5063 * marker.c (unchain_marker): Simplify. Fix comments.
5064
5065 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5066
5067 Introduce fast path for the widely used marker operation.
5068 * alloc.c (build_marker): New function.
5069 * lisp.h (build_marker): New prototype.
5070 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5071 * composite.c (autocmp_chars): Likewise.
5072 * editfns.c (buildmark): Remove.
5073 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5074 (save_restriction_save): Use build_marker.
5075 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5076 * window.c (save_window_save): Likewise.
5077
5078 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5079
5080 Do not use Fdelete_overlay in delete_all_overlays
5081 to avoid redundant calls to unchain_overlay.
5082 * buffer.c (drop_overlay): New function.
5083 (delete_all_overlays, Fdelete_overlay): Use it.
5084 * minibuf.c (get_minibuffer): Fix comment.
5085
5086 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5087
5088 Port to OpenBSD 5.1 amd64.
5089 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5090 This is needed for OpenBSD, and should be harmless on all BSD systems.
5091 Also, include <sys/sysctl.h>, as it should be available on all
5092 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5093 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5094 use p_pid member, not kp_proc.pid.
5095
5096 2012-07-06 Glenn Morris <rgm@gnu.org>
5097
5098 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5099
5100 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5101
5102 More xmalloc and related cleanup.
5103 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5104 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5105 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5106 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5107 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5108 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5109 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5110 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5111 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5112 * xterm.c:
5113 Omit needless casts involving void * pointers and allocation.
5114 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5115 as the former is more robust if P's type is changed.
5116 Prefer xzalloc to xmalloc + memset 0.
5117 Simplify malloc-or-realloc to realloc.
5118 Don't worry about xmalloc returning a null pointer.
5119 Prefer xstrdup to xmalloc + strcpy.
5120 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5121 growing it.
5122 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5123 alloca of a constant.
5124
5125 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5126
5127 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5128 hscroll is larger than the line width. Fixes long and futile
5129 looping inside extend_face_to_end_of_line (on a TTY) producing
5130 glyphs that are not needed and thrown away.
5131
5132 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5133
5134 * marker.c (set_marker_restricted_both): Simplify by using
5135 clip_to_bounds.
5136
5137 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5138
5139 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5140
5141 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5142
5143 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5144 not defined (Bug#11768).
5145 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5146 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5147 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5148 followed by gtk_box_set_homogeneous (Bug#11768).
5149 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5150 (update_theme_scrollbar_width, xg_create_scroll_bar):
5151 Use gtk_scrollbar_new (Bug#11768).
5152 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5153 (is_box_type): New function (Bug#11768).
5154 (xg_tool_item_stale_p): Call is_box_type.
5155 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5156 with default display (Bug#11768).
5157
5158 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5159
5160 * xdisp.c (window_hscroll_limited): New function.
5161 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5162 coordinates when window's hscroll is set to insanely large
5163 values. (Bug#11857)
5164
5165 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
5166
5167 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5168 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5169
5170 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5171
5172 Cleanup xmalloc.
5173 * lisp.h (xzalloc): New prototype. Omit needless casts.
5174 * alloc.c (xzalloc): New function. Omit needless casts.
5175 * charset.c: Omit needless casts. Convert all calls to
5176 xmalloc with following memset to xzalloc.
5177 * dispnew.c: Likewise.
5178 * fringe.c: Likewise.
5179 * image.c: Likewise.
5180 * sound.c: Likewise.
5181 * term.c: Likewise.
5182 * w32fns.c: Likewise.
5183 * w32font.c: Likewise.
5184 * w32term.c: Likewise.
5185 * xfaces.c: Likewise.
5186 * xfns.c: Likewise.
5187 * xterm.c: Likewise.
5188 * atimer.c: Omit needless casts.
5189 * buffer.c: Likewise.
5190 * callproc.c: Likewise.
5191 * ccl.c: Likewise.
5192 * coding.c: Likewise.
5193 * composite.c: Likewise.
5194 * doc.c: Likewise.
5195 * doprnt.c: Likewise.
5196 * editfns.c: Likewise.
5197 * emacs.c: Likewise.
5198 * eval.c: Likewise.
5199 * filelock.c: Likewise.
5200 * fns.c: Likewise.
5201 * gtkutil.c: Likewise.
5202 * keyboard.c: Likewise.
5203 * lisp.h: Likewise.
5204 * lread.c: Likewise.
5205 * minibuf.c: Likewise.
5206 * msdos.c: Likewise.
5207 * print.c: Likewise.
5208 * process.c: Likewise.
5209 * region-cache.c: Likewise.
5210 * search.c: Likewise.
5211 * sysdep.c: Likewise.
5212 * termcap.c: Likewise.
5213 * terminal.c: Likewise.
5214 * tparam.c: Likewise.
5215 * w16select.c: Likewise.
5216 * w32.c: Likewise.
5217 * w32reg.c: Likewise.
5218 * w32select.c: Likewise.
5219 * w32uniscribe.c: Likewise.
5220 * widget.c: Likewise.
5221 * xdisp.c: Likewise.
5222 * xmenu.c: Likewise.
5223 * xrdb.c: Likewise.
5224 * xselect.c: Likewise.
5225
5226 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5227
5228 * fileio.c (time_error_value): Check the right error number.
5229 Problem reported by Troels Nielsen in
5230 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5231
5232 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5233
5234 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5235 This should be fixed in a better way; see Eli Zaretskii in
5236 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5237 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5238
5239 * fileio.c (time_error_value): Rename from special_mtime.
5240 The old name's problems were noted by Eli Zaretskii in
5241 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5242
5243 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5244 This variable's comment says Emacs needs at least one GDB-visible
5245 symbol of type enum pvec_type, to work around GDB problems.
5246 The symbol's value doesn't matter.
5247
5248 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5249 that causes compilation to fail on pre-C99 compilers.
5250
5251 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
5252
5253 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5254 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5255
5256 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5257
5258 * buffer.c (init_buffer_once): Fix initialization of
5259 headers for buffer_defaults and buffer_local_symbols.
5260 Reported by Juanma Barranquero <lekktu@gmail.com>.
5261
5262 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5263
5264 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5265 * lisp.h (enum pvec_type): Use fewer bits.
5266 (PSEUDOVECTOR_SIZE_BITS): New constant.
5267 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5268 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5269 change in pvec_type.
5270 (PSEUDOVECTOR_TYPEP): New macro.
5271 (TYPED_PSEUDOVECTORP): Use it.
5272 * fns.c (internal_equal): Adapt code to extract pvectype.
5273 * emacs.c (gdb_pvec_type): Update type.
5274 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5275 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5276 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5277 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5278 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5279 abusing vector->header.next.nbytes.
5280 (live_vector_p): Use PVEC_TYPE.
5281 (mark_object): Adapt code to extract pvectype. Use switch.
5282
5283 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5284
5285 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5286 Tighten new eassert a bit.
5287
5288 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5289
5290 Fix compilation with --enable-gcc-warnings and -O1
5291 optimization level.
5292 * doprnt.c (doprnt): Change type of tem to int, initialize
5293 to avoid compiler warning. Add eassert.
5294 * search.c (simple_search): Initialize match_byte to avoid
5295 compiler warning. Add eassert.
5296
5297 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5298
5299 Avoid weird behavior with large horizontal scrolls.
5300 Without this change, for example, large hscroll values would
5301 mess up Emacs's display on Fedora 15 x86, presumably due to
5302 overflows in int calculations in the display code.
5303 Also, if buffers had long lines, Emacs would freeze.
5304 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5305 (set_window_hscroll): New function, containing the old guts of
5306 Fset_window_hscroll. Return the clipped value.
5307 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5308 This avoids the need to check against PTRDIFF_MAX.
5309
5310 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5311
5312 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5313
5314 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5315
5316 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5317
5318 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5319 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5320 since GCC 4.4.6 issues a bogus warning for them.
5321
5322 Fix bugs in file timestamp newness comparisons.
5323 * fileio.c (Ffile_newer_than_file_p):
5324 * lread.c (Fload): Use full timestamp resolution of files,
5325 not just the 1-second resolution, so that files that are only
5326 slightly newer still count as newer.
5327 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5328 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5329
5330 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5331
5332 * fileio.c: Improve handling of file time marker. (Bug#11852)
5333 (special_mtime): New function.
5334 (Finsert_file_contents, Fverify_visited_file_modtime):
5335 Use it to set special mtime values consistently.
5336
5337 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5338
5339 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5340 marker for non-existing file. (Bug#11852)
5341
5342 2012-07-03 Glenn Morris <rgm@gnu.org>
5343
5344 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5345 and did not make it into globals.h).
5346
5347 2012-07-03 Tom Tromey <tromey@redhat.com>
5348
5349 * window.c (Fset_window_margins, Fset_window_fringes)
5350 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5351 * textprop.c (Fprevious_property_change): No longer static.
5352 * syntax.c (Fsyntax_table_p): No longer static.
5353 * process.c (Fget_process, Fprocess_datagram_address): No longer
5354 static.
5355 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5356 * keyboard.c (Fcommand_execute): No longer static.
5357 Remove EXFUN.
5358 * insdel.c (Fcombine_after_change_execute): No longer static.
5359 * image.c (Finit_image_library): No longer static.
5360 * fileio.c (Fmake_symbolic_link): No longer static.
5361 * eval.c (Ffetch_bytecode): No longer static.
5362 * editfns.c (Fuser_full_name): No longer static.
5363 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5364 No longer static.
5365 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5366 static.
5367 * dired.c (Ffile_attributes): No longer static.
5368 * composite.c (Fcomposition_get_gstring): No longer static.
5369 * callproc.c (Fgetenv_internal): No longer static.
5370
5371 * ccl.h: Remove EXFUNs.
5372 * buffer.h: Remove EXFUNs.
5373 * dispextern.h: Remove EXFUNs.
5374 * intervals.h: Remove EXFUNs.
5375 * fontset.h: Remove EXFUN.
5376 * font.h: Remove EXFUNs.
5377 * dosfns.c (system_process_attributes): Remove EXFUN.
5378 * keymap.h: Remove EXFUNs.
5379 * lisp.h: Remove EXFUNs.
5380 * w32term.h: Remove EXFUNs.
5381 * window.h: Remove EXFUNs.
5382 * xsettings.h: Remove EXFUN.
5383 * xterm.h: Remove EXFUN.
5384
5385 2012-07-03 Glenn Morris <rgm@gnu.org>
5386
5387 * lisp.h (Frandom): Make it visible to C.
5388 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5389 buffer for invisible buffers. (Bug#1229)
5390
5391 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5392
5393 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5394 values which aren't power of 2.
5395 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5396 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5397 accordingly.
5398
5399 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5400
5401 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5402
5403 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5404
5405 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5406
5407 * alloc.c (allocate_vector_block): Remove redundant
5408 calls to mallopt if DOUG_LEA_MALLOC is defined.
5409 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5410 avoid calls to mallopt if zero_vector is returned.
5411
5412 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5413
5414 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5415 is enabled, avoid dereferencing NULL current_sblock if
5416 running undumped.
5417
5418 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5419
5420 Cleanup basic buffer management.
5421 * buffer.h (struct buffer): Change layout to use generic vector
5422 marking code. Fix some comments. Change type of 'clip_changed'
5423 to bitfield. Remove unused #ifndef old.
5424 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5425 (GET_OVERLAYS_AT): Fix indentation.
5426 (for_each_per_buffer_object_at): New macro.
5427 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5428 (Fbuffer_local_variables): Use it.
5429 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5430 * alloc.c (allocate_buffer): Adjust to match new layout of
5431 struct buffer. Fix comment.
5432 (mark_overlay): New function.
5433 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5434 Lisp area of struct buffer.
5435 (mark_object): Use it. Adjust marking of misc objects
5436 and related comments.
5437
5438 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5439
5440 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5441 wrapper that is not needed because the wrapped code is a no-op (zero
5442 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5443 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5444
5445 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5446
5447 * alloc.c (mark_buffer): Simplify. Remove prototype.
5448 (mark_object): Add comment. Reorganize marking of vector-like
5449 objects. Use CHECK_LIVE for all vector-like objects except buffers
5450 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5451 Avoid redundant calls to mark_vectorlike for bool vectors.
5452
5453 2012-06-30 Glenn Morris <rgm@gnu.org>
5454
5455 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5456
5457 * epaths.in (PATH_SITELOADSEARCH): New.
5458 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5459 This is rather than relying on --enable-locallisppath elements
5460 having "site-lisp" in their names. (Bug#10208#25, 11658)
5461
5462 2012-06-30 Eli Zaretskii <eliz@gnu.org>
5463
5464 * w32proc.c (sys_select): Accept and ignore one more argument.
5465
5466 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5467
5468 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5469 (pselect) [!MS_DOS]: Redirect to sys_select.
5470
5471 * sysdep.c: Don't include dos.h and dosfns.h.
5472
5473 * process.c (sys_select):
5474 * msdos.c (sys_select): Accept one more argument and ignore it.
5475
5476 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5477 adapt data types and code to that.
5478
5479 * dosfns.c:
5480 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5481 which clashes with the gnulib function of the same name.
5482
5483 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5484
5485 * font.c (font_style_to_value, font_style_symbolic)
5486 (font_prop_validate_style): Add type checks for values in
5487 font_style_table.
5488
5489 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5490 argument.
5491 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5492 uses.
5493
5494 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5495
5496 * xdisp.c (try_window_id): Undo last change.
5497
5498 * w32.c (getwd): Adjust commentary about startup_dir.
5499 (init_environment): Always call sys_access, even in non-MSVC
5500 builds. Don't chdir to the directory of the Emacs executable.
5501 This undoes code from 1997 which was justified by the need to
5502 "avoid conflicts when removing and renaming directories". But its
5503 downside was that every relative file name was being interpreted
5504 relative to the directory of the Emacs executable, which can never
5505 be TRT. In particular, it broke sys_access when called with
5506 relative file names.
5507 (sys_access): Map GetLastError to errno.
5508
5509 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5510
5511 * window.h (struct window): Change type of 'fringes_outside_margins'
5512 to bitfield. Fix comment. Adjust users accordingly.
5513 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5514 Adjust comment.
5515 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5516 to ptrdiff_t.
5517
5518 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5519
5520 * gnutls.c (emacs_gnutls_handshake):
5521 Add QUIT to make the loop interruptible.
5522
5523 2012-06-29 Glenn Morris <rgm@gnu.org>
5524
5525 * charset.c (init_charset): Make lack of etc/charsets fatal.
5526
5527 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5528
5529 * editfns.c (region_limit): Fix type mismatch.
5530
5531 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5532
5533 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5534 undefined. Convert from xassert to eassert.
5535 * nsmenu.m: Convert from xassert to eassert.
5536 * nsterm.m: Likewise.
5537
5538 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5539
5540 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5541
5542 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5543
5544 Avoid integer overflow on scroll-left and scroll-right.
5545 * window.c (HSCROLL_MAX): New macro.
5546 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5547 overflow when requested scroll falls outside ptrdiff_t range.
5548
5549 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5550
5551 * window.h (struct window): Change type of 'hscroll',
5552 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5553 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5554 Adjust users accordingly.
5555 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5556 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5557 from EMACS_INT to ptrdiff_t.
5558 (make_window): Omit redundant initialization.
5559
5560 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5561
5562 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5563
5564 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5565
5566 * window.h (struct window): Change type of 'use_time' and
5567 'sequence_number' from Lisp_Object to int.
5568 * frame.c (make_frame): Adjust users accordingly.
5569 * print.c (print_object): Likewise.
5570 * window.c (select_window, Fwindow_use_time, make_parent_window)
5571 (make_window): Likewise.
5572
5573 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5574
5575 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5576 enabled with --enable-checking=[all,glyphs] configure option.
5577 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5578 adjust comments accordingly.
5579 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5580 undefined, adjust comments accordingly.
5581 * image.c: Likewise.
5582 * scroll.c: Likewise.
5583 * w32fns.c: Likewise.
5584 * w32term.c: Likewise.
5585 * xdisp.c: Likewise.
5586 * xfaces.c: Likewise.
5587 * xfns.c: Likewise.
5588 * xterm.c: Likewise.
5589
5590 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5591
5592 Generalize run-time debugging checks.
5593 * dispextern.h (XASSERTS): Remove.
5594 * fontset.c (xassert): Remove.
5595 Convert from xassert to eassert.
5596 * alloc.c: Convert from xassert to eassert.
5597 * bidi.c: Likewise.
5598 * dispnew.c: Likewise.
5599 * fns.c: Likewise.
5600 * fringe.c: Likewise.
5601 * ftfont.c: Likewise.
5602 * gtkutil.c: Likewise.
5603 * image.c: Likewise.
5604 * keyboard.c: Likewise.
5605 * menu.c: Likewise.
5606 * process.c: Likewise.
5607 * scroll.c: Likewise.
5608 * sound.c: Likewise.
5609 * term.c: Likewise.
5610 * w32console.c: Likewise.
5611 * w32fns.c: Likewise.
5612 * w32term.c: Likewise.
5613 * window.c: Likewise.
5614 * xdisp.c: Likewise.
5615 * xfaces.c: Likewise.
5616 * xfns.c: Likewise.
5617 * xselect.c: Likewise.
5618 * xterm.c: Likewise.
5619
5620 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5621
5622 * fns.c (maybe_resize_hash_table): Output message when growing the
5623 purify-hashtable.
5624
5625 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5626
5627 * alloc.c (allocate_string_data): Remove dead code.
5628 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5629 avoid GCC warning about unused macro.
5630
5631 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5632
5633 * alloc.c (allocate_string): Omit intervals initialization.
5634 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5635 as in make_pure_string and make_pure_c_string.
5636
5637 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5638
5639 * alloc.c (allocate_string): Fix last change.
5640
5641 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5642
5643 * alloc.c (allocate_string): Remove two redundant calls
5644 to memset, add explicit initialization where appropriate.
5645
5646 2012-06-27 Glenn Morris <rgm@gnu.org>
5647
5648 * lisp.mk (lisp): Remove paths.elc.
5649
5650 2012-06-27 Chong Yidong <cyd@gnu.org>
5651
5652 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5653
5654 2012-06-26 John Wiegley <johnw@newartisans.com>
5655
5656 * unexmacosx.c (copy_data_segment): Add two section names used
5657 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5658
5659 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5660 when building with Clang.
5661
5662 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5663
5664 * eval.c (Fapply): Allow calling it with a single argument.
5665
5666 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5667
5668 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5669 _stricmp and _strnicmp.
5670 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5671
5672 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5673
5674 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5675 allocated window.
5676 (allocate_process): Likewise for new process.
5677 (allocate_terminal): Change to use offsetof.
5678 (allocate_frame): Likewise.
5679 * frame.c (make_frame): Omit redundant initialization.
5680 * window.c (make_parent_window): Use memset.
5681 (make_window): Omit redundant initialization.
5682 * process.c (make_process): Omit redundant initialization.
5683 * terminal.c (create_terminal): Likewise.
5684
5685 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5686
5687 * term.c (delete_tty): Remove redundant call to memset.
5688
5689 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5690
5691 * alloc.c: Remove build_string.
5692 * lisp.h: Define build_string as static inline. This provides
5693 a better opportunity to optimize away calls to strlen when the
5694 function is called with compile-time constant argument.
5695 * image.c (imagemagick_error): Convert to build_string.
5696 * w32proc.c (sys_spawnve): Likewise.
5697 * xterm.c (x_term_init): Likewise.
5698
5699 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5700
5701 Use sprintf return value instead of invoking strlen on result.
5702 In the old days this wasn't portable, since some sprintf
5703 implementations returned char *. But they died out years ago and
5704 Emacs already assumes sprintf returns int.
5705 Similarly for float_to_string.
5706 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5707 * ccl.c (ccl_driver):
5708 * character.c (string_escape_byte8):
5709 * data.c (Fnumber_to_string):
5710 * doprnt.c (doprnt):
5711 * print.c (print_object):
5712 * xdisp.c (message_dolog):
5713 * xfns.c (syms_of_xfns):
5714 Use sprintf or float_to_string result to avoid need to call strlen.
5715 * data.c (Fnumber_to_string):
5716 Use make_unibyte_string, since the string must be ASCII.
5717 * lisp.h, print.c (float_to_string): Now returns int length.
5718 * term.c (produce_glyphless_glyph):
5719 Use sprintf result rather than recomputing it.
5720
5721 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5722 * Makefile.in (ALL_CFLAGS):
5723 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5724 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5725
5726 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5727
5728 * dispextern.h (xstrcasecmp): Define to library function
5729 strcasecmp if available.
5730 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5731
5732 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5733
5734 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5735 Avoid comma operator.
5736 * menu.c (push_submenu_start, push_submenu_end)
5737 (push_left_right_boundary, push_menu_pane): Likewise.
5738 * msdos.c (dos_rawgetc): Likewise.
5739
5740 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5741
5742 * xfns.c (xic_create_fontsetname): Remove redundant calls
5743 to memset.
5744
5745 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5746
5747 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5748 sprintf already null-terminates its output.
5749
5750 * xfns.c (x_window): Remove redundant cast.
5751
5752 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5753
5754 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5755 `const char *' to `char *' to avoid compiler warning.
5756
5757 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5758
5759 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5760 instead of truncating it to 63 (admittedly a generous limit).
5761
5762 * process.c: Fix spelling and caps in comments.
5763
5764 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5765
5766 * emacs.c (setpgrp): Remove definition, unused.
5767 * sysdep.c (setpgrp): Remove definition, not used in this file.
5768
5769 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5770
5771 * makefile.w32-in: Update dependencies.
5772
5773 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5774
5775 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5776 (SYSTIME_H): Add nt/inc/sys/time.h.
5777
5778 * systime.h [WINDOWSNT]: Include sys/time.h.
5779
5780 * s/ms-w32.h (struct timespec): Definition moved from
5781 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5782
5783 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5784
5785 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5786 * buffer.h (buffer_slot_type_mismatch):
5787 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5788 * eval.c (unwind_to_catch):
5789 * image.c (my_png_error, my_error_exit):
5790 * keyboard.c (quit_throw_to_read_char, user_error)
5791 (Fexit_recursive_edit, Fabort_recursive_edit):
5792 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5793 (wrong_type_argument, buffer_overflow, __executable_start)
5794 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5795 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5796 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5797 (fatal):
5798 (child_setup) [!DOS_NT]:
5799 * lread.c (end_of_file_error, invalid_syntax):
5800 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5801 * puresize.h (pure_write_error):
5802 * search.c (matcher_overflow):
5803 * sound.c (sound_perror, alsa_sound_perror):
5804 * sysdep.c, syssignal.h (croak):
5805 * term.c (maybe_fatal, vfatal):
5806 * textprop.c (text_read_only):
5807 * undo.c (user_error):
5808 * unexmacosx.c (unexec_error):
5809 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5810 Use _Noreturn rather than NO_RETURN.
5811 No need for separate decl merely because of _Noreturn.
5812 * sound.c (sound_warning, parse_sound):
5813 Remove unnecessary forward decls.
5814
5815 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5816
5817 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5818 * lisp.h (WAIT_READING_MAX): New macro.
5819 * dispnew.c (Fsleep_for, sit_for):
5820 * keyboard.c (kbd_buffer_get_event):
5821 * process.c (Faccept_process_output):
5822 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5823 This improves on the previous patch, which introduced a bug
5824 when time_t is unsigned and as wide as intmax_t.
5825 See <http://bugs.gnu.org/9000#51>.
5826
5827 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5828
5829 * dispnew.c (sit_for, Fsleep_for):
5830 * keyboard.c (kbd_buffer_get_event):
5831 * process.c (Faccept_process_output): Avoid compiler warnings when
5832 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5833
5834 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5835
5836 * makefile.w32-in: Update dependencies.
5837
5838 * w32.c (ltime): Add return type and declare static.
5839 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5840
5841 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5842
5843 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5844 Privately reported by Herbert J. Skuhra.
5845 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5846 All uses changed.
5847 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5848 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5849
5850 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5851
5852 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5853 last argument of make_unibyte_string.
5854
5855 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5856 language ID in the event parameters.
5857
5858 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5859 event.code, not the obscure "character set ID".
5860
5861 2012-06-23 Chong Yidong <cyd@gnu.org>
5862
5863 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5864
5865 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5866
5867 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5868 * w32.c (fdutimens): New function.
5869
5870 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5871
5872 * s/ms-w32.h (pselect): Redirect to sys_select.
5873
5874 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5875
5876 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5877 in the logic of incrementing and decrementing the value of
5878 use_relocatable_buffers.
5879
5880 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5881
5882 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5883 Privately reported by Herbert J. Skuhra.
5884 [__FreeBSD__]: Remove "*/" typo after "#include".
5885 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5886 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5887 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5888 Don't assume EMACS_TIME and struct timeval are the same type.
5889
5890 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5891
5892 Support higher-resolution time stamps (Bug#9000).
5893 The time stamps are only nanosecond-resolution at the C level,
5894 since that's the best that any real-world system supports now.
5895 But they are picosecond-resolution at the Lisp level, as that's
5896 easy, and leaves room for future OS improvements.
5897
5898 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5899 (LIBES): Use it.
5900
5901 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5902 Don't get current time unless it's needed.
5903
5904 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5905 now provides it if it's absent.
5906 (start_atimer): Port to higher-res time stamps.
5907 Check for time stamp overflow. Don't get current time more
5908 often than is needed.
5909
5910 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5911 Include systime.h, not time.h.
5912 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5913
5914 * dired.c: Include stat-time.h.
5915 (Ffile-attributes): File times now have higher resolution.
5916
5917 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5918 (struct image): Timestamp now has higher resolution.
5919
5920 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5921 has at least microseconds now. All uses removed.
5922 (update_frame, update_single_window, update_window, update_frame_1)
5923 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5924 (duration_to_sec_usec): Remove; no longer needed.
5925
5926 * editfns.c (time_overflow): Now extern.
5927 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5928 (float-time, Fformat_time_string, Fcurrent_time_string)
5929 (Fcurrent_time_zone): Accept and generate higher-resolution
5930 time stamps.
5931 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5932 (decode_time_components, lisp_seconds_argument): New functions.
5933 (make_time): Now static.
5934 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5935 Report an error if the time is invalid, rather than having the caller
5936 do that.
5937
5938 * fileio.c: Include <stat-time.h>
5939 (Fcopy_file): Copy higher-resolution time stamps.
5940 Prefer to set the time stamp via a file descriptor if that works.
5941 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5942 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5943 (Fvisited_file_modtime, Fset_visited_file_modtime):
5944 Support higher-resolution time stamps.
5945
5946 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5947
5948 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5949
5950 * image.c (prepare_image_for_display, clear_image_cache)
5951 (lookup_image): Port to higer-resolution time stamps.
5952
5953 * keyboard.c (start_polling, bind_polling_period):
5954 Check for time stamp overflow.
5955 (read_char, kbd_buffer_get_event, timer_start_idle)
5956 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5957 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5958 Port to higher-resolution time stamps. Do not assume time_t is signed.
5959 (decode_timer): New function. Timers are now vectors of length 9,
5960 not 8, to accommodate the picosecond component.
5961 (timer_check_2): Use it.
5962
5963 * nsterm.m (select_timeout, timeval_subtract): Remove.
5964 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5965 as they're a bit more accurate and handle overflow better.
5966 (ns_select): Change prototype to be compatible with pselect.
5967 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5968 * nsterm.h (ns_select): Adjust prototype.
5969
5970 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5971 us-resolution time stamps.
5972 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5973
5974 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5975
5976 * lisp.h (time_overflow): New decl.
5977 (wait_reading_process_output): First arg is now intmax_t, not int,
5978 to accommodate larger waits.
5979
5980 * process.h (struct Lisp_Process.read_output_delay):
5981 Now counts nanoseconds, not microseconds.
5982 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5983 EMACS_HAS_USECS.
5984 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5985 (wait_reading_process_output):
5986 Port to ns-resolution time stamps.
5987 (Faccept_process_output, wait_reading_process_output):
5988 Check for time stamp overflow. Do not assume time_t is signed.
5989 (select_wrapper): Remove; we now use pselect.
5990 (Fprocess_attributes): Now generates ns-resolution time stamps.
5991
5992 * sysdep.c: Include utimens.h. Don't include utime.h
5993 or worry about struct utimbuf; gnulib does that for us now.
5994 (gettimeofday): Remove; gnulib provides a substitute.
5995 (make_timeval): New function.
5996 (set_file_times): Now sets ns-resolution time stamps.
5997 New arg FD; all uses changed.
5998 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5999 (system_process_attributes):
6000 Now returns ns-resolution time stamp. All uses changed.
6001 Check for time stamp overflow.
6002
6003 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6004 provides a substitute now.
6005
6006 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6007 since it guarantees struct timespec.
6008 (EMACS_TIME): Now struct timespec, so that we can support
6009 ns-resolution time stamps.
6010 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6011 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6012 (EMACS_USECS): Remove.
6013 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6014 so multiply the arg by 1000 before storing it.
6015 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6016 New macros.
6017 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6018 Port to ns-resolution time stamps.
6019 (EMACS_TIME_NEG_P): Remove; replaced by....
6020 (EMACS_TIME_SIGN): New macro.
6021 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6022 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6023 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6024 (make_timeval, make_lisp_time, decode_time_components): New decls.
6025 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6026 that it mishandled time_t overflow. You can't compare by subtracting!
6027 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6028 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6029
6030 * term.c: Include <sys/time.h>.
6031 (timeval_to_Time): New function, for proper overflow wraparound.
6032 (term_mouse_position, term_mouse_click): Use it.
6033
6034 * undo.c (record_first_change): Support higher-resolution time stamps
6035 in the undo buffer.
6036 (Fprimitive_undo): Use them when restoring time stamps.
6037
6038 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6039 (w32_get_internal_run_time):
6040 Port to higher-resolution Emacs time stamps.
6041 (ltime): Now accepts single 64-bit integer, as that's more convenient
6042 for callers.
6043
6044 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6045
6046 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6047 for compatibility with pselect. Support ns-resolution time stamps.
6048
6049 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6050
6051 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6052 Check for time stamp overflow, and support ns-resolution time stamps.
6053
6054 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6055 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6056 (timeval_subtract): Remove; no longer needed.
6057 (XTflash, XTring_bell, x_wait_for_event):
6058 Port to ns-resolution time stamps. Don't assume time_t is signed.
6059
6060 2012-06-22 Chong Yidong <cyd@gnu.org>
6061
6062 * xdisp.c (x_consider_frame_title): Revert last change.
6063
6064 2012-06-22 Eli Zaretskii <eliz@gnu.org>
6065
6066 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6067 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6068 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6069 staticidx goes up to 1597 out of 1600 = 0x640.)
6070
6071 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6072
6073 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6074 Otherwise, the umask might be mistakenly 0 while handling input signals.
6075
6076 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6077
6078 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6079
6080 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6081
6082 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6083 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6084 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6085 access to `contents' member of Lisp_Vector objects with AREF and ASET
6086 where appropriate.
6087
6088 2012-06-19 Chong Yidong <cyd@gnu.org>
6089
6090 * frame.c (delete_frame): When selecting a frame on a different
6091 text terminal, do not alter the terminal's top-frame.
6092
6093 * xdisp.c (format_mode_line_unwind_data): Record the target
6094 frame's selected window and its terminal's top-frame.
6095 (unwind_format_mode_line): Restore them.
6096 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6097 Callers changed.
6098 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6099 since tty frames can be explicitly named.
6100 (prepare_menu_bars): Likewise.
6101
6102 * term.c (Ftty_top_frame): New function.
6103
6104 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6105
6106 Port byte-code-meter to modern targets.
6107 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6108 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6109 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6110 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6111 (METER_1, METER_2): Simplify.
6112
6113 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6114
6115 * data.c (Fdefalias): Return `symbol' (bug#11686).
6116
6117 2012-06-18 Martin Rudalics <rudalics@gmx.at>
6118
6119 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6120 gets killed during executing of this function (Bug#11665).
6121 Try to always return Qt when the buffer has been actually killed.
6122 (Vkill_buffer_query_functions): In doc-string say that functions
6123 run by this hook should not change the current buffer.
6124
6125 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6126
6127 Fix recently-introduced process.c problems found by static checking.
6128 * process.c (write_queue_push, write_queue_pop, send_process):
6129 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6130 (write_queue_pop): Fix pointer signedness problem.
6131 (send_process): Remove unused local.
6132
6133 2012-06-17 Chong Yidong <cyd@gnu.org>
6134
6135 * xdisp.c (redisplay_internal): No need to redisplay terminal
6136 frames that are not on top.
6137
6138 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
6139
6140 * process.c (make_process): Initialize write_queue.
6141 (write_queue_push, write_queue_pop): New functions.
6142 (send_process): Use them to maintain correct ordering of process
6143 writes (Bug#10815).
6144
6145 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6146
6147 * lisp.h (eassert): Assume C89 or later.
6148 This removes the need for CHECK.
6149 (CHECK): Remove. Its comments about always evaluating its
6150 argument were confusing, as 'eassert' typically does not evaluate
6151 its argument.
6152
6153 * coding.c (produce_chars): Use ptrdiff_t, not int.
6154
6155 * xterm.c (x_draw_underwave): Check for integer overflow.
6156 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6157
6158 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
6159
6160 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6161 referenced (Bug#11583).
6162
6163 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6164
6165 Implement wave-style variant of underlining.
6166 * dispextern.h (face_underline_type): New enum.
6167 (face): Add field for underline type.
6168 * nsterm.m (ns_draw_underwave): New function.
6169 (ns_draw_text_decoration): Use it.
6170 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6171 New functions.
6172 (x_draw_glyph_string): Use them.
6173 * xfaces.c (Qline, Qwave): New Lisp objects.
6174 (check_lface_attrs, merge_face_ref)
6175 (Finternal_set_lisp_face_attribute, realize_x_face):
6176 Handle wave-style underline face attributes.
6177 * xterm.c (x_draw_underwave): New function.
6178 (x_draw_glyph_string): Use it.
6179
6180 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
6181
6182 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6183 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6184 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6185 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6186 ($(BLD)/w32select.$(O)): Update dependencies.
6187
6188 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6189
6190 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6191 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6192 * character.c (_fetch_multibyte_char_p): Remove.
6193 * alloc.c: Include "character.h" before "buffer.h".
6194 * bidi.c: Likewise.
6195 * buffer.c: Likewise.
6196 * bytecode.c: Likewise.
6197 * callint.c: Likewise.
6198 * callproc.c: Likewise.
6199 * casefiddle.c: Likewise.
6200 * casetab.c: Likewise.
6201 * category.c: Likewise.
6202 * cmds.c: Likewise.
6203 * coding.c: Likewise.
6204 * composite.c: Likewise.
6205 * dired.c: Likewise.
6206 * dispnew.c: Likewise.
6207 * doc.c: Likewise.
6208 * dosfns.c: Likewise.
6209 * editfns.c: Likewise.
6210 * emacs.c: Likewise.
6211 * fileio.c: Likewise.
6212 * filelock.c: Likewise.
6213 * font.c: Likewise.
6214 * fontset.c: Likewise.
6215 * fringe.c: Likewise.
6216 * indent.c: Likewise.
6217 * insdel.c: Likewise.
6218 * intervals.c: Likewise.
6219 * keyboard.c: Likewise.
6220 * keymap.c: Likewise.
6221 * lread.c: Likewise.
6222 * macros.c: Likewise.
6223 * marker.c: Likewise.
6224 * minibuf.c: Likewise.
6225 * nsfns.m: Likewise.
6226 * nsmenu.m: Likewise.
6227 * print.c: Likewise.
6228 * process.c: Likewise.
6229 * regex.c: Likewise.
6230 * region-cache.c: Likewise.
6231 * search.c: Likewise.
6232 * syntax.c: Likewise.
6233 * term.c: Likewise.
6234 * textprop.c: Likewise.
6235 * undo.c: Likewise.
6236 * unexsol.c: Likewise.
6237 * w16select.c: Likewise.
6238 * w32fns.c: Likewise.
6239 * w32menu.c: Likewise.
6240 * window.c: Likewise.
6241 * xdisp.c: Likewise.
6242 * xfns.c: Likewise.
6243 * xmenu.c: Likewise.
6244 * xml.c: Likewise.
6245 * xselect.c: Likewise.
6246
6247 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6248
6249 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6250 If all the glyphs of the glyph row came from strings, and we have no
6251 cursor positioning clues, put the cursor on the first glyph of the
6252 row.
6253 (handle_face_prop): Use chunk-relative overlay string index when
6254 indexing into it->string_overlays array. (Bug#11653)
6255 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6256 the rightmost. (Bug#11720)
6257
6258 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6259
6260 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6261 (CATEGORY_MEMBER): Enforce 1/0 value.
6262 * category.c (_temp_category_set): Remove.
6263
6264 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6265
6266 * window.c (Fdelete_other_windows_internal)
6267 (Fdelete_window_internal): Don't access frame's mouse highlight
6268 info of the initial frame. (Bug#11677)
6269
6270 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6271
6272 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6273 Assume USE_2_TAGS_FOR_INTS.
6274 (xreload): Adjust $tagmask width to match recent lisp.h change.
6275
6276 Simplify lisp.h in minor ways that should not affect code.
6277 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6278 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6279 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6280 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6281 (INTTYPEBITS): New macro, for clarity.
6282 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6283 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6284 Simplify now that USE_LSB_TAG is always defined.
6285 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6286 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6287
6288 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
6289
6290 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6291
6292 2012-06-13 Glenn Morris <rgm@gnu.org>
6293
6294 * s/bsd-common.h (BSD4_3):
6295 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6296
6297 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6298
6299 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6300 instead of union.
6301 (XLI, XIL): Define.
6302 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6303 Use them.
6304 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6305 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6306 * alloc.c (widen_to_Lisp_Object): Remove.
6307 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6308 * frame.c (delete_frame): Remove outdated comment.
6309 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6310 USE_LISP_UNION_TYPE.
6311 (Fw32_unregister_hot_key): Likewise.
6312 (Fw32_toggle_lock_key): Likewise.
6313 * w32menu.c (add_menu_item): Likewise.
6314 (w32_menu_display_help): Use XIL instead of checking
6315 USE_LISP_UNION_TYPE.
6316 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6317 (init_heap): Likewise.
6318 * w32term.c (w32_read_socket): Update comment.
6319
6320 2012-06-13 Glenn Morris <rgm@gnu.org>
6321
6322 * s/usg5-4-common.h, src/s/unixware.h:
6323 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6324
6325 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6326
6327 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6328
6329 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6330 * alloc.c (make_number) [!defined make_number]:
6331 Remove, as lisp.h always defines this now.
6332 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6333 (roundup_size): Verify that it is a power of 2.
6334 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6335 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6336 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6337 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6338 USE_LSB_TAG now is always defined to be either 0 or 1.
6339 All uses changed.
6340 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6341 code works fine either way, and efficiency is not a concern here,
6342 as the union type is for debugging, not for production.
6343 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6344 Use an inline function on all platforms when using the union type,
6345 since this is simpler and 'static inline' can be used portably
6346 within Emacs now.
6347 (LISP_INITIALLY_ZERO): New macro.
6348 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6349 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6350
6351 2012-06-12 Glenn Morris <rgm@gnu.org>
6352
6353 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6354
6355 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6356
6357 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6358 Move BROKEN_SIGIO to configure.
6359
6360 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6361 Move NO_TERMIO to configure.
6362
6363 2012-06-12 Chong Yidong <cyd@gnu.org>
6364
6365 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6366 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6367 MagickExportImagePixels is undefined.
6368
6369 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6370
6371 * image.c (imagemagick_load_image): Remove unused label.
6372
6373 2012-06-11 Glenn Morris <rgm@gnu.org>
6374
6375 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6376 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6377 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6378 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6379
6380 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6381
6382 * alloc.c (make_byte_code): New function.
6383 (Fmake_byte_code): Use it. Don't purify here.
6384 * lread.c (read1): Use it as well to avoid extra allocation.
6385
6386 2012-06-11 Chong Yidong <cyd@gnu.org>
6387
6388 * image.c (imagemagick_load_image): Implement transparency.
6389
6390 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6391
6392 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6393 account for preceding backslashes. (Bug#11663)
6394
6395 2012-06-09 Chong Yidong <cyd@gnu.org>
6396
6397 * term.c: Support italics in capable terminals (Bug#9652).
6398 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6399 (turn_on_face): Output using TS_enter_italic_mode if available.
6400 Don't handle unused blinking and alt-charset cases.
6401 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6402 and tty_alt_charset_p cases.
6403 (tty_capable_p, init_tty): Support italics.
6404
6405 * termchar.h (struct tty_display_info): Add field for italics.
6406 Remove unused blink field.
6407
6408 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6409 Handle slant.
6410
6411 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6412 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6413 tty_alt_charset_p. Add tty_italic_p.
6414
6415 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
6416
6417 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6418 dbus_type_is_basic if available.
6419 (xd_extract_signed, xd_extract_unsigned): Rename from
6420 extract_signed and extract_unsigned, respectively. Adapt callers.
6421
6422 2012-06-09 Chong Yidong <cyd@gnu.org>
6423
6424 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6425
6426 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6427 case (Bug#9752).
6428
6429 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6430
6431 * xdisp.c (vmessage): Treat frame message as multibyte.
6432 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6433 would generate the diagnostic "Making \302\247 buffer-local while
6434 let-bound!".
6435
6436 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6437
6438 * dispnew.c (showing_window_margins_p): Undo last change, which
6439 was done due to an inadvertent commit.
6440 (adjust_frame_glyphs_for_frame_redisplay): Do call
6441 showing_window_margins_p.
6442
6443 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6444
6445 * eval.c (Fmake_var_non_special): New primitive.
6446 (syms_of_eval): Defsubr it.
6447 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6448
6449 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
6450
6451 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6452 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6453
6454 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6455
6456 * alloc.c (allocate_vectorlike): Fix last change.
6457
6458 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6459
6460 Block-based vector allocation of small vectors.
6461 * lisp.h (struct vectorlike_header): New field `nbytes',
6462 adjust comment accordingly.
6463 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6464 to denote vector blocks. Adjust users (live_vector_p,
6465 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6466 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6467 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6468 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6469 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6470 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6471 (roundup_size): New constant.
6472 (struct vector_block): New data type.
6473 (vector_blocks, vector_free_lists, zero_vector): New variables.
6474 (all_vectors): Rename to `large_vectors'.
6475 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6476 (sweep_vectors): New functions.
6477 (allocate_vectorlike): Return `zero_vector' as the only vector of
6478 0 items. Allocate new vector from block if vector size is less than
6479 or equal to VBLOCK_BYTES_MAX.
6480 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6481 (init_alloc_once): Add call to init_vectors.
6482
6483 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6484
6485 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6486
6487 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6488
6489 * doprnt.c (doprnt): Truncate multibyte char correctly.
6490 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6491 would mishandle a string argument "Xc" if X was a multibyte
6492 character of length 2: it would truncate after X's first byte
6493 rather than including all of X.
6494
6495 2012-06-06 Chong Yidong <cyd@gnu.org>
6496
6497 * buffer.c (word_wrap): Doc fix.
6498
6499 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6500
6501 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6502
6503 2012-06-03 Glenn Morris <rgm@gnu.org>
6504
6505 * xdisp.c (tool-bar-style): Doc fix.
6506
6507 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6508
6509 * Makefile.in (PAXCTL): Define.
6510 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6511 binary via PaX flags if the paxctl utility is available.
6512 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6513 Restore PaX flags to their default. (Bug#11398)
6514
6515 2012-06-03 Chong Yidong <cyd@gnu.org>
6516
6517 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6518 buffer (Bug#11226).
6519
6520 2012-06-03 Chong Yidong <cyd@gnu.org>
6521
6522 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6523 (note_mode_line_or_margin_highlight): If there is no help echo,
6524 use mode-line-default-help-echo. Handle the case where the mouse
6525 position is past the end of the mode line string.
6526
6527 * buffer.c (buffer_local_value_1): New function, split from
6528 Fbuffer_local_value; can return Qunbound.
6529 (Fbuffer_local_value): Use it.
6530 (Vmode_line_format): Docstring tweaks.
6531
6532 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6533
6534 * sysdep.c (system_process_attributes): Improve comment.
6535
6536 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6537
6538 * keyboard.c: Export real-this-command to Elisp.
6539 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6540 and DEFVAR it. Update all users.
6541
6542 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6543
6544 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6545
6546 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6547 Convert pctcpu and pctmem to Lisp float properly.
6548 Let the compiler fold better, as 100.0/0x8000 is exact.
6549
6550 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6551
6552 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6553 cons_block.
6554
6555 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6556
6557 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6558
6559 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6560
6561 For a 'struct window', replace some Lisp_Object fields to
6562 bitfields where appropriate, remove unused fields.
6563 * window.h (struct window): Remove unused 'last_mark_x' and
6564 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6565 change it's type from Lisp_Object to bitfield.
6566 Change type of 'force_start', 'optional_new_start',
6567 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6568 fields from Lisp_Object to bitfield. Adjust users accordingly.
6569
6570 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6571
6572 Pacify gcc -Wdouble-precision when using Xaw.
6573 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6574 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6575 Use 'float' consistently, rather than 'float' in most places
6576 and 'double' in a couple of places.
6577
6578 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6579
6580 * xdisp.c (handle_stop): Detect whether we have overlay strings
6581 loaded by testing it->current.overlay_string_index to be
6582 non-negative, instead of checking whether n_overlay_strings is
6583 positive. (Bug#11587)
6584
6585 2012-05-31 Chong Yidong <cyd@gnu.org>
6586
6587 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6588
6589 * doc.c (Fsubstitute_command_keys): Doc fix.
6590
6591 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6592
6593 * search.c (search_buffer): Remove calls to
6594 r_alloc_inhibit_buffer_relocation, as it is now called by
6595 maybe_unify_char, which was the cause of relocation of buffer text
6596 in bug#11519.
6597
6598 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6599
6600 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6601 for the duration of call to load_charset, to avoid problems with
6602 callers of maybe_unify_char that access buffer text through C
6603 pointers.
6604
6605 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6606 decrement the inhibition flag, instead of just setting or
6607 resetting it.
6608
6609 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6610
6611 Remove obsolete '#define static' cruft.
6612 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6613 This #undef was "temporary" in 2000; it is no longer needed
6614 now that '#define static' has gone away.
6615 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6616 (gray_bitmap_bits): Remove; no longer needed.
6617 All uses replaced with definiens.
6618 * xterm.c: Include "bitmaps/gray.xbm".
6619
6620 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6621
6622 Clean up __executable_start, monstartup when --enable-profiling.
6623 The following changes affect the code only when profiling.
6624 * dispnew.c (__executable_start): Rename from safe_bcopy.
6625 Define only on platforms that need it.
6626 * emacs.c: Include <sys/gmon.h> when profiling.
6627 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6628 (__executable_start): Remove decl, since lisp.h does it now.
6629 (safe_bcopy): Remove decl; no longer has that name.
6630 (main): Coalesce #if into single bit of code, for simplicity.
6631 Cast pointers to uintptr_t, since standard libraries want integers
6632 and not pointers.
6633 * lisp.h (__executable_start): New decl.
6634
6635 2012-05-31 Glenn Morris <rgm@gnu.org>
6636
6637 * image.c (Fimagemagick_types): Doc fix.
6638
6639 2012-05-30 Jim Meyering <meyering@redhat.com>
6640
6641 * callproc.c (Fcall_process_region): Include directory component
6642 in mkstemp error message (Bug#11586).
6643
6644 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6645
6646 * alloc.c, lisp.h (make_pure_vector): Now static.
6647
6648 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6649
6650 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6651 Move to byte-run.el.
6652 (Fautoload): Do the hash-doc more carefully.
6653 * data.c (Fdefalias): Purify definition, except for keymaps.
6654 (Qdefun): Move from eval.c.
6655 * lisp.h (Qdefun): Remove.
6656 * lread.c (read1): Tiny simplification.
6657
6658 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6659
6660 Do not create empty overlays with the evaporate property (Bug#9642).
6661 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6662 Bug#9642, but explicitly check that the buffer the overlay would
6663 be moved to is live and rearrange lines to make sure that errors
6664 will not put the overlay in an inconsistent state.
6665 (Fdelete_overlay): Cosmetics.
6666
6667 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6668
6669 * w32term.c (my_bring_window_to_top): New function.
6670 (x_raise_frame): Use handle returned by DeferWindowPos, which
6671 could be different from the original one.
6672 Call my_bring_window_to_top instead of my_set_foreground_window.
6673 (Bug#11513)
6674
6675 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6676 by calling BringWindowToTop.
6677
6678 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6679 (WM_EMACS_END): Increase by one.
6680
6681 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6682
6683 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6684 This avoids undefined behavior that might cause the eassert
6685 to not catch an out-of-range value.
6686
6687 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6688
6689 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6690 Update dependencies.
6691
6692 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6693
6694 * bidi.c (bidi_mirror_char): Fix last change.
6695
6696 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6697
6698 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6699 when referring to sectname field in printf format.
6700
6701 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6702
6703 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6704 Only r_alloc_inhibit_buffer_relocation needed to be added;
6705 the others were already declared.
6706
6707 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6708 before checking whether it's out of range. Put the check inside
6709 eassert. See
6710 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6711
6712 2012-05-27 Ken Brown <kbrown@cornell.edu>
6713
6714 * callproc.c (Fcall_process): Restore a line that was accidentally
6715 commented out in the 2011-02-13 change (bug#11547).
6716
6717 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6718
6719 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6720 defined on ralloc.c.
6721
6722 * buffer.c [REL_ALLOC]: Remove prototypes of
6723 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6724 they are now on lisp.h.
6725
6726 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6727
6728 * search.c (search_buffer): Use it to inhibit relocation of buffer
6729 text while re_search_2 is doing its job, because re_search_2 is
6730 passed C pointers to buffer text. (Bug#11519)
6731
6732 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6733 Update value to 24.
6734
6735 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6736 state after an additional call to move_it_in_display_line_to, keep
6737 the values of it->max_ascent and it->max_descent found for the
6738 entire line.
6739 (pos_visible_p): Revert the comparison against bottom_y to what it
6740 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6741 (Bug#11464)
6742
6743 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6744
6745 Fix coding-related core dumps with gcc -ftrapv.
6746 The code was computing A - B, where A and B are pointers, and B is
6747 random garbage. This can lead to core dumps on platforms that
6748 have special pointer registers, and it also leads to core dumps on
6749 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6750 A - B only when B is initialized properly.
6751 * coding.c (coding_set_source, coding_set_destination): Return void.
6752 (coding_change_source, coding_change_destinations): New functions,
6753 with the old behaviors of coding_set_source and coding_set_destination.
6754 All callers that need an offset changed to use these new functions.
6755
6756 2012-05-26 Glenn Morris <rgm@gnu.org>
6757
6758 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6759
6760 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6761
6762 Extend mouse support on W32 text-mode console.
6763 * xdisp.c (draw_row_with_mouse_face):
6764 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6765
6766 * w32console.c: Include window.h.
6767 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6768 New functions.
6769 (initialize_w32_display): Initialize mouse-highlight data.
6770
6771 * w32inevt.c: Include termchar.h and window.h.
6772 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6773 moves, call note_mouse_highlight. If help_echo changed, call
6774 gen_help_event to produce help-echo message in the echo area.
6775 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6776 highlight info.
6777
6778 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6779
6780 * lread.c (read1): Simplify slightly to avoid an overflow warning
6781 with GCC 4.7.0 on x86-64.
6782
6783 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6784
6785 * bidi.c (bidi_mirror_char): Revert last change: an int is
6786 definitely wide enough here.
6787
6788 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6789
6790 Fix integer width and related bugs (Bug#9874).
6791 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6792 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6793 (string_bytes, check_sblock, allocate_string_data):
6794 (compact_small_strings, Fmake_bool_vector, make_string)
6795 (make_unibyte_string, make_multibyte_string)
6796 (make_string_from_bytes, make_specified_string)
6797 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6798 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6799 (mark_vectorlike):
6800 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6801 (allocate_pseudovector):
6802 Use int, not EMACS_INT, where int is wide enough.
6803 (inhibit_garbage_collection, Fgarbage_collect):
6804 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6805 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6806 int might not be wide enough.
6807 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6808 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6809 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6810 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6811 (bidi_level_of_next_char, bidi_move_to_visually_next):
6812 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6813 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6814 (Fkill_buffer, Fset_buffer_major_mode)
6815 (advance_to_char_boundary, Fbuffer_swap_text)
6816 (Fset_buffer_multibyte, overlays_at, overlays_in)
6817 (overlay_touches_p, struct sortvec, record_overlay_string)
6818 (overlay_strings, recenter_overlay_lists)
6819 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6820 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6821 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6822 (Foverlay_recenter, last_overlay_modification_hooks_used)
6823 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6824 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6825 (validate_region): Omit unnecessary test for b <= e,
6826 since that's guaranteed by the previous test.
6827 (adjust_overlays_for_delete): Avoid pos + length overflow.
6828 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6829 (report_overlay_modification):
6830 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6831 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6832 Omit pointer cast, which isn't needed anyway, and doesn't work
6833 after the EMACS_INT -> ptrdiff_t change.
6834 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6835 * buffer.h: Adjust decls to match defn changes elsewhere.
6836 (struct buffer_text, struct buffer):
6837 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6838 Use EMACS_INT, not int, where int might not be wide enough.
6839 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6840 not int, to avoid needless 32-bit limit on 64-bit hosts.
6841 (exec_byte_code): Use tighter memory-full test, one that checks
6842 for alloca overflow. Don't compute the address of the object just
6843 before an array, as that's not portable. Use EMACS_INT, not
6844 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6845 * callint.c (Fcall_interactively):
6846 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6847 * callproc.c (call_process_kill, Fcall_process):
6848 Don't assume pid_t fits into an Emacs fixnum.
6849 (call_process_cleanup, Fcall_process, child_setup):
6850 Don't assume pid_t fits into int.
6851 (call_process_cleanup, Fcall_process, delete_temp_file)
6852 (Fcall_process_region):
6853 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6854 (Fcall_process): Simplify handling of volatile integers.
6855 Use int, not EMACS_INT, where int will do.
6856 * casefiddle.c (casify_object, casify_region, operate_on_word)
6857 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6858 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6859 (casify_object): Avoid integer overflow when overallocating buffer.
6860 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6861 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6862 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6863 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6864 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6865 integers are now checked earlier. All uses replaced with XINT.
6866 (ccl_driver):
6867 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6868 For CCL_MapSingle, check that content and value are in int range.
6869 (ccl_driver, Fregister_code_conversion_map):
6870 Check that Vcode_version_map_vector is a vector.
6871 (resolve_symbol_ccl_program): Check that vector header is in range.
6872 Always copy the vector, so that we can check its contents reliably
6873 now rather than having to recheck each instruction as it's being
6874 executed. Check that vector words fit in 'int'.
6875 (ccl_get_compiled_code, Fregister_ccl_program)
6876 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6877 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6878 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6879 contents are in range.
6880 (Fccl_execute_on_string): Check that status is in range.
6881 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6882 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6883 Accept and return EMACS_INT, not int, because callers can pass values
6884 out of 'int' range.
6885 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6886 (multibyte_chars_in_text, parse_str_as_multibyte)
6887 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6888 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6889 (string_escape_byte8, Fget_byte):
6890 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6891 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6892 avoid mishandling large integers.
6893 * character.h: Adjust decls to match defn changes elsewhere.
6894 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6895 (Ffind_charset_region):
6896 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6897 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6898 (load_charset_map_from_vector, Fdefine_charset_internal):
6899 Don't assume fixnum fits in int.
6900 (load_charset_map_from_vector, Fmap_charset_chars):
6901 Remove now-unnecessary CHECK_NATNUMs.
6902 (Fdefine_charset_internal): Check ranges here, more carefully.
6903 Don't rely on undefined behavior with signed left shift overflow.
6904 Don't assume unsigned int fits into fixnum, or that fixnum fits
6905 into unsigned int. Don't require max_code to be a valid fixnum;
6906 that's not true for gb10830 4-byte on a 32-bit host. Allow
6907 invalid_code to be a cons, for the same reason. Require code_offset
6908 to be a character. Avoid int overflow if max_char is close
6909 to INT_MAX.
6910 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6911 this is intended anyway and avoids some undefined behavior.
6912 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6913 INDEX_TO_CODE_POINT, as that's what it expects.
6914 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6915 * charset.h (DECODE_CHAR): Return int, not unsigned;
6916 this is what was intended anyway, and it avoids undefined behavior.
6917 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6918 integer-overflow issues.
6919 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6920 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6921 where the argument is EMACS_INT, and this behavior is not intended.
6922 * chartab.c (Fmake_char_table, Fset_char_table_range)
6923 (uniprop_get_decoder, uniprop_get_encoder):
6924 Don't assume fixnum fits in int.
6925 * cmds.c (move_point): New function, that does the gist of
6926 Fforward_char and Fbackward_char, but does so while checking
6927 for integer overflow more accurately.
6928 (Fforward_char, Fbackward_char): Use it.
6929 (Fforward_line, Fend_of_line, internal_self_insert)
6930 (internal_self_insert):
6931 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6932 Fix a FIXME, by checking for integer overflow when calculating
6933 target_clm and actual_clm.
6934 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6935 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6936 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6937 (coding_alloc_by_making_gap, alloc_destination)
6938 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6939 (encode_coding_utf_16, detect_coding_emacs_mule)
6940 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6941 (detect_coding_iso_2022, decode_coding_iso_2022)
6942 (encode_invocation_designation, encode_designation_at_bol)
6943 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6944 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6945 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6946 (encode_coding_ccl, encode_coding_raw_text)
6947 (detect_coding_charset, decode_coding_charset)
6948 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6949 (produce_composition, produce_charset, produce_annotation)
6950 (decode_coding, handle_composition_annotation)
6951 (handle_charset_annotation, consume_chars, decode_coding_gap)
6952 (decode_coding_object, encode_coding_object, detect_coding_system)
6953 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6954 (code_convert_region, code_convert_string)
6955 (Fdefine_coding_system_internal)
6956 (coding_set_source, coding_set_destination):
6957 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6958 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6959 (Fdefine_coding_system_internal):
6960 Don't assume fixnums fit in int.
6961 (decode_coding_gap, decode_coding_object, encode_coding_object)
6962 (Fread_coding_system, Fdetect_coding_region)
6963 (Funencodable_char_position, Fcheck_coding_systems_region)
6964 (get_translation, handle_composition_annotation, consume_chars):
6965 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6966 (consume_chars): Rewrite to not calculate an address outside buffer.
6967 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6968 Don't access memory outside of the args array.
6969 (Fdefine_coding_system_internal): Check for charset-id overflow.
6970 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6971 result of ENCODE_CHAR.
6972 * coding.h: Adjust decls to match defn changes elsewhere.
6973 (struct coding_system):
6974 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6975 * composite.c (get_composition_id, find_composition)
6976 (run_composition_function, update_compositions)
6977 (compose_text, composition_gstring_put_cache)
6978 (composition_gstring_p, composition_gstring_width)
6979 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6980 (composition_compute_stop_pos, composition_reseat_it)
6981 (composition_update_it, struct position_record)
6982 (find_automatic_composition, composition_adjust_point)
6983 (Fcomposition_get_gstring, Ffind_composition_internal):
6984 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6985 (update_compositions):
6986 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6987 * composite.h: Adjust decls to match defn changes elsewhere.
6988 (struct composition):
6989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6990 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6991 Do not attempt to compute the address of the object just before a
6992 buffer; this is not portable.
6993 (Faref, Faset):
6994 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6995 (Faset): Use int, not EMACS_INT, where int is wide enough.
6996 (Fstring_to_number): Don't assume fixnums fit in int.
6997 (Frem): Don't assume arg is nonnegative.
6998 * dbusbind.c (xd_append_arg): Check for integers out of range.
6999 (Fdbus_call_method): Don't overflow the timeout int.
7000 (extract_signed, extract_unsigned): New functions.
7001 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7002 (xd_get_connection_references): Return ptrdiff_t, not int.
7003 All uses changed.
7004 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7005 (xd_read_message_1):
7006 Use int, not unsigned, where the dbus API uses int.
7007 (Fdbus_message_internal): Don't overflow mtype.
7008 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7009 * dired.c (directory_files_internal, file_name_completion, scmp)
7010 (file_name_completion_stat):
7011 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7012 (file_name_completion): Don't overflow matchcount.
7013 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7014 * dispextern.h: Adjust decls to match defn changes elsewhere.
7015 (struct text_pos, struct glyph, struct bidi_saved_info)
7016 (struct bidi_string_data, struct bidi_it, struct composition_it)
7017 (struct it):
7018 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7019 (struct display_pos, struct composition_it, struct it):
7020 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7021 * dispnew.c (increment_matrix_positions)
7022 (increment_row_positions, mode_line_string)
7023 (marginal_area_string):
7024 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7025 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7026 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7027 (duration_to_sec_usec): New function, to check for overflow better.
7028 (Fsleep_for, sit_for): Use it.
7029 * doc.c (get_doc_string, store_function_docstring):
7030 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7031 (get_doc_string, Fsnarf_documentation):
7032 Use int, not EMACS_INT, where int is wide enough.
7033 (get_doc_string):
7034 Use SAFE_ALLOCA, not alloca.
7035 Check for overflow when converting EMACS_INT to off_t.
7036 * doprnt.c (doprnt):
7037 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7038 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7039 Don't assume uid_t fits into fixnum.
7040 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7041 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7042 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7043 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7044 (general_insert_function)
7045 (Finsert_char, make_buffer_string, make_buffer_string_both)
7046 (update_buffer_properties, Fbuffer_substring)
7047 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7048 (Fsubst_char_in_region, check_translation)
7049 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7050 (transpose_markers, Ftranspose_regions):
7051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7052 (clip_to_bounds): Move to lisp.h as an inline function).
7053 (Fconstrain_to_field): Don't assume integers are nonnegative.
7054 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7055 (Fsubst_char_in_region, Fsave_restriction):
7056 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7057 (Femacs_pid): Don't assume pid_t fits into fixnum.
7058 (lo_time): Use int, not EMACS_INT, when int suffices.
7059 (lisp_time_argument): Check for usec out of range.
7060 (Fencode_time): Don't assume fixnum fits in int.
7061 (Fuser_login_name, Fuser_full_name): Signal an error
7062 if a uid argument is out of range, rather than relying on
7063 undefined behavior.
7064 (Fformat_time_string): Remove now-unnecessary check.
7065 lisp_time_argument checks for out-of-range usec now.
7066 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7067 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7068 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7069 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7070 (init_cmdargs, Fdump_emacs):
7071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7072 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7073 the bottom (typically) 32 bits of the fixnum.
7074 * eval.c (specpdl_size, call_debugger):
7075 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7076 (when_entered_debugger, Fbacktrace_debug):
7077 Don't assume fixnum can fit in int.
7078 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7079 the object just before a buffer; this is not portable.
7080 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7081 (grow_specpdl, unbind_to):
7082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7083 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7084 (grow_specpdl): Simplify allocation by using xpalloc.
7085 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7086 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7087 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7088 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7089 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7090 (a_write, e_write):
7091 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7092 (Fcopy_file, non_regular_nbytes, read_non_regular)
7093 (Finsert_file_contents):
7094 Use int, not EMACS_INT, where int is wide enough.
7095 (READ_BUF_SIZE): Verify that it fits in int.
7096 (Finsert_file_contents): Check that counts are in proper range,
7097 rather than assuming fixnums fit into ptrdiff_t etc.
7098 Don't assume fixnums fit into int.
7099 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7100 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7101 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7102 (string_char_to_byte, string_byte_to_char)
7103 (string_make_multibyte, string_to_multibyte)
7104 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7105 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7106 (substring_both, Fdelete, internal_equal, Ffillarray)
7107 (Fclear_string, mapcar1)
7108 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7109 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7110 (larger_vector, make_hash_table, maybe_resize_hash_table)
7111 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7112 (Fmaphash, secure_hash):
7113 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7114 (concat): Check for string index and length overflow.
7115 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7116 (Frequire):
7117 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7118 (larger_vector): New API (vec, incr_min, size_max) replaces old
7119 one (vec, new_size, init). This catches size overflow.
7120 INIT was removed because it was always Qnil.
7121 All callers changed.
7122 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7123 the upper bound on a hash table index size.
7124 (make_hash_table, maybe_resize_hash_table): Use it.
7125 (secure_hash): Computer start_byte and end_byte only after
7126 they're known to be in ptrdiff_t range.
7127 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7128 (Ffont_get_glyphs, Ffont_at):
7129 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7130 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7131 (Flist_fonts, Fopen_font):
7132 Don't assume fixnum can fit in int.
7133 (check_gstring): Don't assume index can fit in int.
7134 (font_match_p): Check that fixnum is a character, not a nonnegative
7135 fixnum, since the later code needs to stuff it into an int.
7136 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7137 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7138 conversion overflow issues.
7139 (Fopen_font): Check for integer out of range.
7140 (Ffont_get_glyphs): Don't assume index can fit in int.
7141 * font.h: Adjust decls to match defn changes elsewhere.
7142 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7143 integer overflow.
7144 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7145 printmax_t, where ptrdiff_t is wide enough.
7146 (Finternal_char_font):
7147 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7148 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7149 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7150 (Fset_frame_position, x_set_frame_parameters)
7151 (x_set_line_spacing, x_set_border_width)
7152 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7153 Check that fixnums are in proper range for system types.
7154 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7155 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7156 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7157 Use SAFE_ALLOCA_LISP, not alloca.
7158 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7159 intptr_t is wide enough.
7160 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7161 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7162 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7163 Check for fixnum out of range.
7164 * ftfont.c (ftfont_list): Don't assume index fits in int.
7165 Check that fixnums are in proper range for system types.
7166 (ftfont_shape_by_flt):
7167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7168 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7169 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7170 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7171 Check that fixnums are in proper range for system types.
7172 * gnutls.h: Adjust decls to match defn changes elsewhere.
7173 * gtkutil.c (xg_dialog_run):
7174 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7175 (update_frame_tool_bar):
7176 Check that fixnums are in proper range for system types.
7177 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7178 (lookup_image): Check that fixnums are in range for system types.
7179 * indent.c (last_known_column, last_known_column_point):
7180 (current_column_bol_cache):
7181 (skip_invisible, current_column, check_display_width):
7182 (check_display_width, scan_for_column, current_column_1)
7183 (Findent_to, Fcurrent_indentation, position_indentation)
7184 (indented_beyond_p, Fmove_to_column, compute_motion):
7185 (Fcompute_motion, Fvertical_motion):
7186 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7187 (last_known_column_modified): Use EMACS_INT, not int.
7188 (check_display_width):
7189 (Fcompute_motion):
7190 Check that fixnums and floats are in proper range for system types.
7191 (compute_motion): Don't assume index or fixnum fits in int.
7192 (compute_motion, Fcompute_motion):
7193 Use int, not EMACS_INT, when it is wide enough.
7194 (vmotion): Omit local var start_hpos that is always 0; that way
7195 we don't need to worry about overflow in expressions involving it.
7196 * indent.h: Adjust decls to match defn changes elsewhere.
7197 (struct position):
7198 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7199 Use int, not EMACS_INT, where int is wide enough.
7200 Remove unused members ovstring_chars_done and tab_offset;
7201 all uses removed.
7202 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7203 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7204 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7205 (make_gap, copy_text, insert, insert_and_inherit)
7206 (insert_before_markers, insert_before_markers_and_inherit)
7207 (insert_1, count_combining_before, count_combining_after)
7208 (insert_1_both, insert_from_string)
7209 (insert_from_string_before_markers, insert_from_string_1)
7210 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7211 (adjust_after_replace, adjust_after_insert, replace_range)
7212 (replace_range_2, del_range, del_range_1, del_range_byte)
7213 (del_range_both, del_range_2, modify_region)
7214 (prepare_to_modify_buffer, signal_before_change)
7215 (signal_after_change, Fcombine_after_change_execute):
7216 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7217 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7218 (balance_an_interval, split_interval_right, split_interval_left)
7219 (find_interval, next_interval, update_interval)
7220 (adjust_intervals_for_insertion, delete_node, delete_interval)
7221 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7222 (static_offset_intervals, offset_intervals)
7223 (merge_interval_right, merge_interval_left, make_new_interval)
7224 (graft_intervals_into_buffer, temp_set_point_both)
7225 (temp_set_point, set_point, adjust_for_invis_intang)
7226 (set_point_both, move_if_not_intangible, get_property_and_range)
7227 (get_local_map, copy_intervals, copy_intervals_to_string)
7228 (compare_string_intervals, set_intervals_multibyte_1):
7229 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7230 * intervals.h: Adjust decls to match defn changes elsewhere.
7231 (struct interval):
7232 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7233 * keyboard.c (this_command_key_count, this_single_command_key_start)
7234 (before_command_key_count, before_command_echo_length, echo_now)
7235 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7236 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7237 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7238 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7239 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7240 (last_non_minibuf_size, last_point_position, echo_truncate)
7241 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7242 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7243 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7244 (stuff_buffered_input):
7245 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7246 (last_auto_save, command_loop_1, read_char):
7247 Use EMACS_INT, not int, to avoid integer overflow.
7248 (record_char): Avoid overflow in total_keys computation.
7249 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7250 * keyboard.h: Adjust decls to match defn changes elsewhere.
7251 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7252 (Fkey_description, Fdescribe_vector, Flookup_key):
7253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7254 (click_position): New function, to check that positions are in range.
7255 (Fcurrent_active_maps):
7256 (describe_command):
7257 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7258 (Faccessible_keymaps, Fkey_description):
7259 (preferred_sequence_p):
7260 Don't assume fixnum can fit into int.
7261 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7262 Check for integer overflow in size calculations.
7263 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7264 avoid mishandling large integers.
7265 * lisp.h: Adjust decls to match defn changes elsewhere.
7266 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7267 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7268 (struct Lisp_Marker):
7269 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7270 (clip_to_bounds): Now an inline function, moved here from editfns.c.
7271 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7272 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7273 All callers changed.
7274 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7275 Assume the arg has valid form, since it always does.
7276 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7277 unsigned integer system type.
7278 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7279 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7280 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7281 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7282 (duration_to_sec_usec): New decl.
7283 * lread.c (read_from_string_index, read_from_string_index_byte)
7284 (read_from_string_limit, readchar, unreadchar, openp)
7285 (read_internal_start, read1, oblookup):
7286 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7287 (Fload, readevalloop, Feval_buffer, Feval_region):
7288 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7289 (openp): Check for out-of-range argument to 'access'.
7290 (read1): Use int, not EMACS_INT, where int is wide enough.
7291 Don't assume fixnum fits into int.
7292 Fix off-by-one error that can read outside a buffer.
7293 (read_filtered_event): Use duration_to_sec_usec
7294 to do proper overflow checking on durations.
7295 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7296 in size calculation.
7297 (Fexecute_kbd_macro):
7298 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7299 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7300 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7301 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7302 (set_marker_both, set_marker_restricted_both, marker_position)
7303 (marker_byte_position, Fbuffer_has_markers_at):
7304 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7305 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7306 * menu.c (ensure_menu_items): Rename from grow_menu_items.
7307 It now merely ensures that the menu is large enough, without
7308 necessarily growing it, as this avoids some integer overflow issues.
7309 All callers changed.
7310 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7311 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7312 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7313 Use SAFE_ALLOCA_LISP, not alloca.
7314 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7315 to EMACS_INT. Check that fixnums are in proper range for system types.
7316 * minibuf.c (minibuf_prompt_width, string_to_object)
7317 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7318 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7319 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7320 (get_minibuffer, read_minibuf_unwind):
7321 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7322 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7323 this simplifies overflow checking. All callers changed.
7324 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7325 (Ftest_completion):
7326 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7327 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7328 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7329 Check that fixnums are in proper range for system types.
7330 (Fx_create_frame, Fx_show_tip):
7331 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7332 * nsfont.m (ns_findfonts, nsfont_list_family):
7333 Don't assume fixnum fits in long.
7334 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7336 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7337 wide enough.
7338 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7339 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7340 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7341 (PRINTDECLARE, PRINTPREPARE):
7342 (strout, print_string):
7343 (print, print_preprocess, print_check_string_charset_prop)
7344 (print_object):
7345 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7346 (PRINTDECLARE):
7347 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7348 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7349 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7350 (printchar, strout): Use xpalloc to catch size calculation overflow.
7351 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7352 (print_error_message): Use SAFE_ALLOCA, not alloca.
7353 (print_object): Use int, not EMACS_INT, where int is wide enough.
7354 (print_depth, new_backquote_output, print_number_index):
7355 Use ptrdiff_t, not int, where int might not be wide enough.
7356 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7357 (Fset_process_window_size, Fformat_network_address)
7358 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7359 (sigchld_handler):
7360 Check that fixnums are in proper range for system types.
7361 (Fsignal_process): Simplify by avoiding a goto.
7362 Check for process-ids out of pid_t range rather than relying on
7363 undefined behavior.
7364 (process_tick, update_tick): Use EMACS_INT, not int.
7365 (Fformat_network_address, read_process_output, send_process)
7366 (Fprocess_send_region, status_notify):
7367 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7368 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7369 (wait_reading_process_output, read_process_output, exec_sentinel):
7370 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7371 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7372 (Faccept_process_output): Use duration_to_sec_usec to do proper
7373 overflow checking on durations.
7374 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7375 Don't assume pid_t fits in int.
7376 * process.h (struct Lisp_Process): Members tick and update_tick
7377 are now of type EMACS_INT, not int.
7378 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7379 configured --with-wide-int.
7380 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7381 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7382 * search.c (looking_at_1, string_match_1):
7383 (fast_string_match, fast_c_string_match_ignore_case)
7384 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7385 (scan_newline, find_before_next_newline, search_command)
7386 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7387 (set_search_regs, wordify):
7388 (Freplace_match):
7389 (Fmatch_data):
7390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7391 (string_match_1, search_buffer, set_search_regs):
7392 (Fmatch_data):
7393 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7394 (wordify): Check for overflow in size calculation.
7395 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7396 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7397 Check that fixnums are in proper range for system types.
7398 * sound.c (struct sound_device)
7399 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7400 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7401 (Fplay_sound_internal):
7402 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7403 * syntax.c (struct lisp_parse_state, find_start_modiff)
7404 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7405 (Fparse_partial_sexp):
7406 Don't assume fixnums can fit in int.
7407 (struct lisp_parse_state, find_start_pos, find_start_value)
7408 (find_start_value_byte, find_start_begv)
7409 (update_syntax_table, char_quoted, dec_bytepos)
7410 (find_defun_start, prev_char_comend_first, back_comment):
7411 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7412 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7413 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7414 (Finternal_describe_syntax_value): Check that match_lisp is a
7415 character, not an integer, since the code stuffs it into int.
7416 (scan_words, scan_sexps_forward):
7417 Check that fixnums are in proper range for system types.
7418 (Fforward_word):
7419 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7420 (scan_sexps_forward):
7421 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7422 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7423 * syntax.h: Adjust decls to match defn changes elsewhere.
7424 (struct gl_state_s):
7425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7426 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7427 MOST_POSITIVE_FIXNUM.
7428 * sysdep.c (wait_for_termination_1, wait_for_termination)
7429 (interruptible_wait_for_termination, mkdir):
7430 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7431 (emacs_read, emacs_write):
7432 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7433 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7434 and double all fit in int.
7435 * term.c (set_tty_color_mode):
7436 Check that fixnums are in proper range for system types.
7437 * termhooks.h (struct input_event):
7438 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7439 * textprop.c (validate_interval_range, interval_of)
7440 (Fadd_text_properties, set_text_properties_1)
7441 (Fremove_text_properties, Fremove_list_of_text_properties)
7442 (Ftext_property_any, Ftext_property_not_all)
7443 (copy_text_properties, text_property_list, extend_property_ranges)
7444 (verify_interval_modification):
7445 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7446 (Fnext_single_char_property_change)
7447 (Fprevious_single_char_property_change):
7448 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7449 (copy_text_properties):
7450 Check for integer overflow in index calculation.
7451 * undo.c (last_boundary_position, record_point, record_insert)
7452 (record_delete, record_marker_adjustment, record_change)
7453 (record_property_change):
7454 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7455 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7456 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7457 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7458 (Fx_hide_tip, Fx_file_dialog):
7459 * w32menu.c (set_frame_menubar):
7460 Use ptrdiff_t, not int, for consistency with rest of code.
7461 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7462 (select_window, Fdelete_other_windows_internal)
7463 (window_scroll_pixel_based, window_scroll_line_based)
7464 (Frecenter, Fset_window_configuration):
7465 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7466 (Fset_window_hscroll, run_window_configuration_change_hook)
7467 (set_window_buffer, temp_output_buffer_show, scroll_command)
7468 (Fscroll_other_window, Frecenter):
7469 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7470 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7471 Don't assume fixnum fits in int.
7472 (Fset_window_scroll_bars):
7473 Check that fixnums are in proper range for system types.
7474 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7475 (string_pos, c_string_pos, number_of_chars, init_iterator)
7476 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7477 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7478 (compute_display_string_end, handle_face_prop)
7479 (face_before_or_after_it_pos, handle_invisible_prop)
7480 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7481 (display_prop_intangible_p, string_buffer_position_lim)
7482 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7483 (get_overlay_strings_1, get_overlay_strings)
7484 (iterate_out_of_display_property, forward_to_next_line_start)
7485 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7486 (get_next_display_element, set_iterator_to_next)
7487 (get_visually_first_element, compute_stop_pos_backwards)
7488 (handle_stop_backwards, next_element_from_buffer)
7489 (move_it_in_display_line_to, move_it_in_display_line)
7490 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7491 (add_to_log, message_dolog, message_log_check_duplicate)
7492 (message2, message2_nolog, message3, message3_nolog
7493 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7494 (current_message_1, truncate_echo_area, truncate_message_1)
7495 (set_message, set_message_1, store_mode_line_noprop)
7496 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7497 (text_outside_line_unchanged_p, check_point_in_composition)
7498 (reconsider_clip_changes)
7499 (redisplay_internal, set_cursor_from_row, try_scrolling)
7500 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7501 (redisplay_window, find_last_unchanged_at_beg_row)
7502 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7503 (trailing_whitespace_p, find_row_edges, display_line)
7504 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7505 (display_mode_element, store_mode_line_string)
7506 (pint2str, pint2hrstr, decode_mode_spec)
7507 (display_count_lines, display_string, draw_glyphs)
7508 (x_produce_glyphs, x_insert_glyphs)
7509 (rows_from_pos_range, mouse_face_from_buffer_pos)
7510 (fast_find_string_pos, mouse_face_from_string_pos)
7511 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7513 (safe_call, init_from_display_pos, handle_fontified_prop)
7514 (handle_single_display_spec, load_overlay_strings)
7515 (with_echo_area_buffer, setup_echo_area_for_printing)
7516 (display_echo_area, echo_area_display)
7517 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7518 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7519 (redisplay_window, dump_glyph_row, display_mode_line)
7520 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7521 (handle_display_spec, display_prop_string_p):
7522 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7523 (handle_single_display_spec, build_desired_tool_bar_string)
7524 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7525 (get_specified_cursor_type):
7526 Check that fixnums are in proper range for system types.
7527 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7528 (Flookup_image_map):
7529 Don't assume fixnums fit in int.
7530 (compare_overlay_entries):
7531 Avoid mishandling comparisons due to subtraction overflow.
7532 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7533 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7534 (handle_tool_bar_click):
7535 Use int, not unsigned, since we prefer signed and the signedness
7536 doesn't matter here.
7537 (get_next_display_element, next_element_from_display_vector):
7538 Use int, not EMACS_INT, when int is wide enough.
7539 (start_hourglass): Use duration_to_sec_usec to do proper
7540 overflow checking on durations.
7541 * xfaces.c (Fbitmap_spec_p):
7542 Check that fixnums are in proper range for system types.
7543 (compare_fonts_by_sort_order):
7544 Avoid mishandling comparisons due to subtraction overflow.
7545 (Fx_family_fonts, realize_basic_faces):
7546 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7547 (Fx_family_fonts):
7548 Don't assume fixnum fits in int.
7549 Use SAFE_ALLOCA_LISP, not alloca.
7550 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7551 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7552 (face_at_buffer_position, face_for_overlay_string)
7553 (face_at_string_position):
7554 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7555 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7556 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7557 (Fx_show_tip):
7558 Check that fixnums are in proper range for system types.
7559 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7560 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7561 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7562 (Fx_change_window_property): Don't assume fixnums fit in int.
7563 * xfont.c (xfont_chars_supported):
7564 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7565 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7566 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7567 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7568 * xml.c (parse_region):
7569 * xrdb.c (magic_file_p):
7570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7571 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7572 (x_get_local_selection, x_reply_selection_request)
7573 (x_handle_selection_request, wait_for_property_change):
7574 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7575 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7576 short is wide enough.
7577 (x_send_client_event): Don't assume fixnum fits in int.
7578 * xterm.c (x_x_to_emacs_modifiers):
7579 Don't assume EMACS_INT overflows nicely into int.
7580 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7581 may come from Lisp.
7582 (handle_one_xevent): NATNUMP can eval its arg twice.
7583 (x_connection_closed):
7584 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7585 * xterm.h: Adjust decls to match defn changes elsewhere.
7586 (struct scroll_bar): Use struct vectorlike_header
7587 rather than rolling our own approximation.
7588 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7589
7590 2012-05-25 Glenn Morris <rgm@gnu.org>
7591
7592 * lisp.mk (lisp): Update for more files being compiled now.
7593
7594 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7595
7596 * lread.c: Remove `read_pure' which makes no difference.
7597 (read_pure): Remove var.
7598 (unreadpure): Remove function.
7599 (readevalloop): Don't call read_list with -1 flag.
7600 (read1, read_vector): Don't test read_pure any more.
7601 (read_list): Simplify.
7602
7603 * fileio.c, character.h: Minor style tweaks.
7604
7605 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7606
7607 * window.h (clip_changed): Remove useless declaration.
7608
7609 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7610
7611 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7612 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7613
7614 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7615
7616 Remove src/m/*.
7617 This directory predates autoconf and is no longer needed nowadays.
7618 Move its few remaining bits of functionality to where they're needed.
7619 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7620 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7621 * m/template.h: Remove.
7622 * Makefile.in (M_FILE): Remove. All uses removed.
7623 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7624 * lisp.h (USE_LSB_TAG):
7625 * mem-limits.h (EXCEEDS_LISP_PTR):
7626 Use VAL_MAX, not VALBITS, in #if.
7627 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7628 (EMACS_UINT): Define unconditionally now.
7629 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7630 (BITS_PER_EMACS_INT): New constants, replacing
7631 what used to be in config.h, but not useful in #if.
7632 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7633 define them any more.
7634 (VAL_MAX): New macro.
7635 (VALMASK): Use it.
7636 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7637 BITS_PER_EMACS_INT, in #if.
7638 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7639 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7640 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7641 * s/ms-w32.h (DATA_START):
7642 Move here from removed file m/intel386.h.
7643 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7644 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7645
7646 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7647
7648 Assume C89 or later.
7649 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7650 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7651 (xrealloc):
7652 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7653 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7654 * textprop.c, tparam.c (NULL): Remove.
7655 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7656 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7657 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7658 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7659 * xterm.c (input_signal_count): Assume volatile works.
7660
7661 2012-05-21 Ken Brown <kbrown@cornell.edu>
7662
7663 * xgselect.c (xg_select): Fix first argument in call to 'select'
7664 (bug#11508).
7665
7666 2012-05-20 Ken Brown <kbrown@cornell.edu>
7667
7668 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7669 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7670
7671 2012-05-19 Ken Brown <kbrown@cornell.edu>
7672
7673 * xfns.c (x_in_use): Remove `static' qualifier.
7674 * xterm.h (x_in_use): Declare.
7675 * xgselect.c: Include xterm.h.
7676 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7677 and `display_arg' (bug#9754).
7678
7679 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7680
7681 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7682
7683 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7684 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7685
7686 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7687
7688 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7689
7690 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7691 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7692
7693 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7694 reference to image_cache->refcount.
7695 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7696
7697 2012-05-17 Juri Linkov <juri@jurta.org>
7698
7699 * search.c (Fword_search_regexp, Fword_search_backward)
7700 (Fword_search_forward, Fword_search_backward_lax)
7701 (Fword_search_forward_lax): Move functions to isearch.el
7702 (bug#10145, bug#11381).
7703
7704 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7705
7706 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7707
7708 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7709
7710 * lread.c (init_obarray): Declare Qt and Qnil as special.
7711
7712 2012-05-14 Glenn Morris <rgm@gnu.org>
7713
7714 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7715 Put "libexec" before "bin", for the sake of init_callproc_1.
7716
7717 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7718
7719 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7720
7721 * unexaix.c: Port to more-recent AIX compilers.
7722 (report_error, report_error_1, make_hdr, copy_sym)
7723 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7724 Make arguments const char *, not char *, to avoid violations of C
7725 standard and to fix some AIX warnings reported by Gilles Pion.
7726
7727 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7728
7729 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7730 already have overlays loaded.
7731 (handle_single_display_spec): Before returning without displaying
7732 fringe bitmap, synchronize the bidi iterator with the main display
7733 iterator, by calling iterate_out_of_display_property.
7734 (iterate_out_of_display_property): Detect buffer iteration by
7735 testing that it->string is a Lisp string.
7736 (get_next_display_element): When the current object is exhausted,
7737 and there's something on it->stack, call set_iterator_to_next to
7738 proceed with what's on the stack, instead of returning zero.
7739 (set_iterator_to_next): If called at the end of a Lisp string,
7740 proceed to consider_string_end without incrementing string
7741 position. Don't increment display vector index past the end of
7742 the display vector. (Bug#11417)
7743 (pos_visible_p): Don't report a position visible when move_it_to
7744 stopped at the last line of window, which happens to be scanned
7745 backwards by the bidi iteration. (Bug#11464)
7746
7747 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7748
7749 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7750 and right-margin display specs even if the spec is invalid or we
7751 are on a TTY, and thus unable to display on the fringes.
7752 That's because the text with the property will not be displayed anyway,
7753 so we need to signal to the caller that this is a "replacing"
7754 display spec. This fixes display when the spec is invalid or we
7755 are on a TTY.
7756
7757 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7758
7759 * unexaix.c (make_hdr): Fix typo in prototype.
7760 This bug broke the build on AIX. Problem reported by Gilles Pion.
7761
7762 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7763
7764 * keyboard.c (kbd_buffer_get_event): Read special events also in
7765 batch mode. (Bug#11415)
7766
7767 2012-05-12 Glenn Morris <rgm@gnu.org>
7768
7769 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7770
7771 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7772
7773 * lisp.mk (lisp): Add newcomment.elc.
7774
7775 2012-05-12 Glenn Morris <rgm@gnu.org>
7776
7777 * Makefile.in (MKDIR_P): New, set by configure.
7778 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7779
7780 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7781
7782 Remove unused function hourglass_started.
7783 * dispextern.h (hourglass_started):
7784 * w32fns.c (hourglass_started):
7785 * xdisp.c (hourglass_started): Remove.
7786
7787 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7788
7789 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7790 Update dependencies.
7791
7792 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7793
7794 * xgselect.c (xg_select): Put maxfds+1 into a var.
7795 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7796
7797 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7798
7799 2012-05-10 Dave Abrahams <dave@boostpro.com>
7800
7801 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7802 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7803
7804 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7805
7806 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7807 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7808 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7809 Initialize xd_registered_buses.
7810
7811 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7812
7813 Untag more efficiently if USE_LSB_TAG.
7814 This is based on a proposal by YAMAMOTO Mitsuharu in
7815 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7816 For an admittedly artificial (nth 8000 longlist) benchmark on
7817 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7818 Emacs's overall text size by 1%.
7819 * lisp.h (XUNTAG): New macro.
7820 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7821 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7822 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7823 * eval.c (Fautoload):
7824 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7825 * frame.h (XFRAME): Use XUNTAG.
7826
7827 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7828 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7829 Remove unportable assumptions about print widths of types like
7830 dbus_uint32_t.
7831 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7832 intptr_t when converting between pointer and integer, to avoid GCC
7833 warnings about wrong width.
7834
7835 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7836
7837 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7838 stack for each reader_thread, instead of defaulting to 8MB
7839 determined by the linker. This avoids failures in creating
7840 subprocesses on Windows 7, see the discussion in this thread:
7841 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7842
7843 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7844
7845 Fix up display of the *Minibuf-0* buffer in the mini window.
7846 * keyboard.c (read_char): Don't clear the echo area if there's no
7847 message to clear.
7848 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7849 contents of *Minibuf-0*) if there's no message displayed in its stead.
7850
7851 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7852
7853 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7854 batch mode.
7855
7856 2012-05-06 Chong Yidong <cyd@gnu.org>
7857
7858 * lisp.mk (lisp): Update.
7859
7860 2012-05-05 Jim Meyering <meyering@redhat.com>
7861
7862 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7863
7864 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7865
7866 * data.c (PUT_ERROR): New macro.
7867 (syms_of_data): Use it. Add new error type `user-error'.
7868 * undo.c (user_error): New function.
7869 (Fprimitive_undo): Use it.
7870 * print.c (print_error_message): Adjust print style for `user-error'.
7871 * keyboard.c (user_error): New function.
7872 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7873
7874 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7875
7876 Do not limit current-time-string to years 1000..9999.
7877 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7878 (Fcurrent_time_string): Support any year that is supported by the
7879 underlying localtime representation. Don't use asctime, as it
7880 has undefined behavior for years outside the range -999..9999.
7881
7882 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7883
7884 Fix race conditions involving setenv, gmtime, localtime, asctime.
7885 Without this fix, interrupts could mess up code that uses these
7886 nonreentrant functions, since setting TZ invalidates existing
7887 tm_zone or tzname values, and since most of these functions return
7888 pointers to static storage.
7889 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7890 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7891 Grow the critical sections to include not just invoking
7892 localtime/gmtime, but also accessing these functions' results
7893 including their tm_zone values if any, and any related TZ setting.
7894 (format_time_string): Last arg is now struct tm *, not struct tm **,
7895 so that the struct tm is saved in the critical section.
7896 All callers changed. Simplify allocation of initial buffer, partly
7897 motivated by the fact that memory allocation needs to be outside
7898 the critical section.
7899
7900 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7901
7902 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7903 with RESET_INTERVAL.
7904
7905 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7906 Remove duplicated buffer name initialization.
7907
7908 2012-05-02 Jim Meyering <jim@meyering.net>
7909
7910 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7911
7912 * xfns.c (x_window): Use xstrdup (Bug#11375).
7913
7914 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7915
7916 * xdisp.c (pos_visible_p): If already at a newline from the
7917 display string before the 'while' loop, don't walk back the glyphs
7918 from it3.glyph_row. Solves assertion violation when the display
7919 string begins with a newline (egg.el). (Bug#11367)
7920
7921 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7922
7923 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7924 Move to simple.el.
7925
7926 2012-05-01 Glenn Morris <rgm@gnu.org>
7927
7928 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7929 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7930 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7931 All were removed before 23.1.
7932
7933 * dispnew.c: Remove HAVE_LIBNCURSES test;
7934 it is always true on relevant platforms.
7935
7936 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7937 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7938
7939 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7940
7941 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7942
7943 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7944 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7945 Remove.
7946
7947 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7948
7949 Do not avoid creating empty evaporating overlays (Bug#9642).
7950 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7951 That is, do not delete an evaporating overlay if it becomes
7952 empty after its bounds are adjusted to fit within its buffer.
7953 This fix caused other problems, and I'm reverting it until we get
7954 to the bottom of them.
7955
7956 2012-04-27 Chong Yidong <cyd@gnu.org>
7957
7958 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7959
7960 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7961
7962 * xdisp.c (pos_visible_p): If the window start position is beyond
7963 ZV, start the display from buffer beginning. Prevents assertion
7964 violation in init_iterator when the minibuffer window is scrolled
7965 via the scroll bar.
7966
7967 * window.c (window_scroll_pixel_based): Likewise.
7968
7969 2012-04-27 Chong Yidong <cyd@gnu.org>
7970
7971 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7972
7973 2012-04-27 Glenn Morris <rgm@gnu.org>
7974
7975 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7976 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7977
7978 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7979
7980 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7981 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7982
7983 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7984
7985 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7986 display element, check also the underlying string or buffer
7987 character. (Bug#11341)
7988
7989 * w32menu.c: Include w32heap.h.
7990 (add_menu_item): If the call to AppendMenuW (via
7991 unicode_append_menu) fails, disable Unicode menus only if we are
7992 running on Windows 9X/Me.
7993
7994 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7995
7996 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7997 (xgetint): Add missing shift for LSB tags.
7998
7999 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8000
8001 * keyboard.c (read_char): Don't wipe echo area for select window
8002 events: These might get delayed via `mouse-autoselect-window'
8003 (Bug#11304).
8004
8005 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8006
8007 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8008 manipulation of :loaded-from data.
8009
8010 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8011
8012 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8013 now a cons (bug#11311).
8014
8015 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8016
8017 Do not create empty overlays with the evaporate property (Bug#9642).
8018 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8019 if it becomes empty after its bounds are adjusted to fit within
8020 its buffer. Without this fix, in a nonempty buffer (let ((o
8021 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8022 yields an empty overlay that has the evaporate property, which is
8023 not supposed to happen.
8024
8025 Fix minor GTK3 problems found by static checking.
8026 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8027 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8028 (struct _EmacsFixedClass, emacs_fixed_get_type):
8029 Move decls here from emacsgtkfixed.h, since they needn't be public.
8030 (emacs_fixed_get_type): Now static.
8031 (emacs_fixed_class_init): Omit unused local.
8032 (emacs_fixed_child_type): Remove; unused.
8033 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8034 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8035 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8036 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8037 (EMACS_FIXED_GET_CLASS): Remove; unused.
8038 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8039
8040 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8041 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8042
8043 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8044
8045 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8046 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8047 (__malloc_size_t, __malloc_ptrdiff_t):
8048 Remove. All uses removed, replaced by the definiens if needed,
8049 since we can assume C89 or better now.
8050 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8051 (protect_malloc_state, align, get_contiguous_space)
8052 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8053 (malloc_atfork_handler_child, malloc_enable_thread)
8054 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8055 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8056 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8057 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8058 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8059 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8060 Define using prototypes, not old style.
8061 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8062 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8063 (align): Don't assume that signed integer overflow wraps around.
8064 Omit unused local var.
8065 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8066 (_free_internal_nolock, memalign, mallochook, reallochook):
8067 Omit no-longer-needed casts.
8068 (valloc): Use getpagesize, not __getpagesize.
8069 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8070 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8071
8072 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8073
8074 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
8075
8076 Move functions from C to Lisp. Make non-blocking method calls
8077 the default. Implement further D-Bus standard interfaces.
8078
8079 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8080 (QCdbus_request_name_allow_replacement)
8081 (QCdbus_request_name_replace_existing)
8082 (QCdbus_request_name_do_not_queue)
8083 (QCdbus_request_name_reply_primary_owner)
8084 (QCdbus_request_name_reply_in_queue)
8085 (QCdbus_request_name_reply_exists)
8086 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8087 (QCdbus_registered_serial, QCdbus_registered_method)
8088 (QCdbus_registered_signal): New Lisp objects.
8089 (XD_DEBUG_MESSAGE): Use sizeof.
8090 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8091 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8092 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8093 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8094 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8095 (xd_signature, xd_append_arg): Allow float for integer types.
8096 (xd_get_connection_references): New function.
8097 (xd_get_connection_address): Rename from xd_initialize.
8098 Return cached address.
8099 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8100 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8101 level.
8102 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8103 Return number of refcounts.
8104 (Fdbus_get_unique_name): Make stronger parameter check.
8105 (Fdbus_message_internal): New defun.
8106 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8107 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8108 (Fdbus_send_signal, Fdbus_register_service)
8109 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8110 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8111 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8112 (Vdbus_compiled_version, Vdbus_runtime_version)
8113 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8114 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8115 (Vdbus_message_type_signal): New defvars.
8116 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8117 Adapt docstring.
8118
8119 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8120
8121 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8122 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8123 Do not assume ptrdiff_t is the same width as 'int'.
8124
8125 * alloc.c: Handle unusual debugging option combinations.
8126 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8127 since the two debugging options are incompatible.
8128 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8129 is defined.
8130 (mem_init, mem_insert, mem_insert_fixup):
8131 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8132 (NEED_MEM_INSERT): Remove; no longer needed.
8133
8134 2012-04-22 Leo Liu <sdl.web@gmail.com>
8135
8136 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8137
8138 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8139
8140 * sysdep.c [__FreeBSD__]: Minor cleanups.
8141 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8142 Use Emacs indenting style more consistently. Avoid some casts.
8143 Use 'double' consistently rather than mixing 'float' and 'double'.
8144
8145 2012-04-21 Eduard Wiebe <usenet@pusto.de>
8146
8147 * sysdep.c (list_system_processes, system_process_attributes):
8148 Add implementation for FreeBSD (Bug#5243).
8149
8150 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8151
8152 * lisp.mk (lisp): Update.
8153
8154 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8155
8156 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8157 It is never used otherwise.
8158
8159 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8160
8161 * print.c (print_preprocess): Only check print_depth if print-circle
8162 is nil.
8163 (print_object): Check for cycles even when print-circle is nil and
8164 print-gensym is t, but only check print_depth if print-circle is nil.
8165
8166 2012-04-20 Chong Yidong <cyd@gnu.org>
8167
8168 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8169 set the status to "failed" and ensure that sentinel is run.
8170
8171 2012-04-20 Glenn Morris <rgm@gnu.org>
8172
8173 * process.c (Fset_process_inherit_coding_system_flag)
8174 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8175 (Fmake_network_process, Fmake_serial_process): Doc fix.
8176
8177 2012-04-20 Eli Zaretskii <eliz@gnu.org>
8178
8179 * xdisp.c (string_buffer_position_lim): Limit starting position to
8180 BEGV.
8181 (set_cursor_from_row): If called for a mode-line or header-line
8182 row, return zero immediately.
8183 (try_cursor_movement): If inside continuation line, don't back up
8184 farther than the first row after the header line, if any.
8185 Don't consider the header-line row as "partially visible", even if
8186 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8187
8188 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8189
8190 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8191 (bug#11238).
8192
8193 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
8194 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
8195
8196 configure: new option --enable-gcc-warnings (Bug#11207)
8197 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8198 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8199 (ALL_CFLAGS): Use new macros rather than old.
8200 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8201 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8202 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8203 -Wunused-result, -Wunused-variable. This should go away once
8204 the Emacs and Gnulib regex code is merged.
8205 (xmalloc, xrealloc): Now static.
8206
8207 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8208
8209 * dired.c (Fsystem_groups): Remove unused local.
8210
8211 2012-04-17 Glenn Morris <rgm@gnu.org>
8212
8213 * dired.c (Fsystem_users): Doc fix.
8214
8215 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8216
8217 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8218 (syms_of_dired): Add them.
8219
8220 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8221
8222 Fix minor alloc.c problems found by static checking.
8223 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8224 New extern decls, to avoid calling undeclared functions.
8225 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8226 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8227 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8228 (NEED_MEM_INSERT): New macro.
8229 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8230 Remove one incorrect comment and fix another.
8231
8232 Fix minor ralloc.c problems found by static checking.
8233 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8234 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8235 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8236 (r_alloc_sbrk): Now static.
8237
8238 Improve ralloc.c interface checking.
8239 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8240 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8241 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8242 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8243 [REL_ALLOC]: ... to here, to check interface.
8244 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8245 Remove decls. This fixes an "It stinks!".
8246
8247 * alloc.c (which_symbols): Fix alignment issue / type clash.
8248
8249 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8250
8251 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8252 (struct Lisp_Misc_Any): Likewise.
8253 (struct Lisp_Free): Likewise.
8254 * alloc.c (union aligned_Lisp_Symbol): Define.
8255 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8256 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8257 (union aligned_Lisp_Misc): Define.
8258 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8259 aligned_Lisp_Misc instead of union Lisp_Misc.
8260 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8261
8262 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8263
8264 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8265 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8266 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8267 * s/netbsd.h, s/sol2-6.h:
8268 Remove definition of GC_MARK_STACK, since the default now works.
8269 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8270 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8271 no longer the default.
8272 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8273
8274 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8275
8276 * lread.c (lisp_file_lexically_bound_p):
8277 Fix hang at ";-*-\n" (bug#11238).
8278
8279 2012-04-14 Eli Zaretskii <eliz@gnu.org>
8280
8281 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8282 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8283
8284 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8285
8286 * nsterm.m (constrainFrameRect): Always constrain when there is only
8287 one screen (Bug#10962).
8288
8289 2012-04-13 Ken Brown <kbrown@cornell.edu>
8290
8291 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8292
8293 2012-04-13 Reuben Thomas <rrt@sc3d.org>
8294
8295 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8296
8297 2012-04-11 Daniel Colascione <dancol@dancol.org>
8298
8299 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8300 against is gone. It's better to use vfork now so that when Cygwin
8301 gains a new, working vfork, we use it automatically (bug#10398).
8302
8303 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8304
8305 * window.c (save_window_save): Obey window-point-insertion-type.
8306
8307 2012-04-11 Glenn Morris <rgm@gnu.org>
8308
8309 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8310
8311 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8312
8313 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8314
8315 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
8316
8317 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8318 (force_quit_count): New var.
8319 (handle_interrupt): Use it.
8320
8321 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
8322
8323 * w32.c (w32_delayed_load): Record the full path of the library
8324 being loaded (bug#10424).
8325
8326 2012-04-09 Glenn Morris <rgm@gnu.org>
8327
8328 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8329 not just in the obarray, before snarfing them. (Bug#11036)
8330
8331 * Makefile.in ($(leimdir)/leim-list.el):
8332 Pass EMACS rather than BUILT_EMACS.
8333
8334 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8335
8336 * process.c (make_process):
8337 * process.h: Add integer `gnutls_handshakes_tried' member to
8338 process struct.
8339
8340 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8341 Add convenience `GNUTLS_LOG2i' macro.
8342
8343 * gnutls.c (gnutls_log_function2i): Convenience log function.
8344 (emacs_gnutls_read): Use new log functions,
8345 `gnutls_handshakes_tried' process member, and
8346 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8347 attempts per process (connection).
8348
8349 2012-04-09 Chong Yidong <cyd@gnu.org>
8350
8351 * eval.c (Fuser_variable_p, user_variable_p_eh)
8352 (lisp_indirect_variable): Functions deleted.
8353 (Fdefvar): Caller changed.
8354
8355 * callint.c (Finteractive, Fcall_interactively):
8356 * minibuf.c (Fread_variable): Callers changed.
8357
8358 2012-04-09 Eli Zaretskii <eliz@gnu.org>
8359
8360 * xdisp.c (set_cursor_from_row): If the display string appears in
8361 the buffer at position that is closer to point than the position
8362 after the display string, display the cursor on the first glyph of
8363 the display string. Fixes cursor display when a 'display' text
8364 property immediately follows invisible text. (Bug#11094)
8365
8366 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8367
8368 composite.c: use 'double' consistently
8369 * composite.c (get_composition_id): Use 'double' consistently
8370 instead of converting 'float' to 'double' and vice versa; this is
8371 easier to understand and avoids a GCC warning.
8372
8373 2012-04-09 Glenn Morris <rgm@gnu.org>
8374
8375 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8376 preparation for dumping it with emacs. (Bug#4789)
8377 (leimdir): New variable.
8378 ($(leimdir)/leim-list.el): New rule.
8379 (emacs$(EXEEXT)): Depend on leim-list.el.
8380
8381 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8382 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8383 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8384
8385 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8386
8387 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8388 proper alignment.
8389
8390 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
8391
8392 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8393 Remove unused local variable.
8394
8395 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8396
8397 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8398 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8399 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8400 objects, as mark_maybe_pointer will catch them otherwise.
8401 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8402 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8403
8404 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8405
8406 Fix typo that broke non-Windows builds.
8407 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8408
8409 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8410
8411 Support building on MS-Windows with libxml2.
8412
8413 * makefile.w32-in (OBJ2): Add xml.$(O).
8414 (GLOBAL_SOURCES): Add xml.c.
8415 ($(BLD)/xml.$(O)): New dependency list.
8416
8417 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8418 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8419 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8420 [!WINDOWSNT]: New macros.
8421 (init_libxml2_functions, libxml2_loaded_p): New functions.
8422 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8423 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8424 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8425 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8426 linked in).
8427 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8428 Call init_libxml2_functions before calling libxml2 functions.
8429 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8430
8431 * emacs.c: Don't include libxml/parser.h.
8432 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8433 xmlCleanupParser directly.
8434
8435 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8436
8437 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8438
8439 * indent.c (Fvertical_motion): If there is a display string at
8440 point, use it.vpos to compute how many lines to backtrack after
8441 move_it_to point. (Bug#11133)
8442
8443 2012-04-06 Eli Zaretskii <eliz@gnu.org>
8444
8445 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8446 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8447 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8448 macros related to unification of CJK characters. For the details,
8449 see the discussion following the message here:
8450 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8451
8452 2012-04-04 Chong Yidong <cyd@gnu.org>
8453
8454 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8455
8456 2012-04-01 Eli Zaretskii <eliz@gnu.org>
8457
8458 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8459 instead of alloca. (Bug#11138)
8460
8461 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8462
8463 * w32menu.c (is_simple_dialog): Properly check lisp types.
8464 (Bug#11141)
8465
8466 2012-03-31 Eli Zaretskii <eliz@gnu.org>
8467
8468 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8469 position we get to after a call to move_it_to fails the
8470 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8471 only if we wind up in a string from display property. (Bug#11063)
8472
8473 * window.c (Fdelete_other_windows_internal): Invalidate the row
8474 and column information about mouse highlight, so that redisplay
8475 restores it after reallocating the glyph matrices. (Bug#7464)
8476
8477 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8478 string comes from a `display' text property, use the buffer
8479 position of that property as if we actually saw that position in
8480 the row's glyphs.
8481 (move_it_by_lines): Remove the assertion that
8482 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8483 violated when there's a before-string at the beginning of a line.
8484 (Bug#11063)
8485
8486 2012-03-30 Eli Zaretskii <eliz@gnu.org>
8487
8488 * xdisp.c (append_space_for_newline): If the default face was
8489 remapped, use the remapped face for the appended newline.
8490 (extend_face_to_end_of_line): Use the remapped default face for
8491 extending the face to the end of the line.
8492 (display_line): Call extend_face_to_end_of_line when the default
8493 face was remapped. (Bug#11068)
8494
8495 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8496
8497 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8498
8499 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8500
8501 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8502
8503 2012-03-27 Glenn Morris <rgm@gnu.org>
8504
8505 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8506 Doc fixes.
8507
8508 2012-03-26 Kenichi Handa <handa@m17n.org>
8509
8510 * dispextern.h (struct glyph): Fix previous change. Change the
8511 bit length of glyphless.ch to 25 (Bug#11082).
8512
8513 2012-03-26 Chong Yidong <cyd@gnu.org>
8514
8515 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8516 (command_loop_1): Use it; inhibit selection update for
8517 handle-select-window too (Bug#8996).
8518
8519 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8520
8521 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8522
8523 2012-03-25 Kenichi Handa <handa@m17n.org>
8524
8525 * dispextern.h (struct glyph): Change the bit length of
8526 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8527
8528 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8529
8530 * s/ms-w32.h (tzname): Include time.h before redirecting to
8531 _tzname. Fixes the MSVC build. (Bug#9960)
8532
8533 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8534
8535 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8536 characters.
8537
8538 * xterm.c (XTread_socket): Only modify handling_signal if
8539 !SYNC_INPUT. (Bug#11080)
8540
8541 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8542
8543 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8544 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8545 when fetching a multibyte character consumes more bytes than
8546 CHAR_BYTES returns, due to unification of CJK characters in
8547 string_char. (Bug#11073)
8548
8549 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8550
8551 * process.c (wait_reading_process_output): Handle pty disconnect
8552 by refraining from sending oneself a SIGCHLD (bug#10933).
8553
8554 2012-03-22 Chong Yidong <cyd@gnu.org>
8555
8556 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8557
8558 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8559 Mark string as coming from a prefix property.
8560 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8561 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8562
8563 2012-03-21 Chong Yidong <cyd@gnu.org>
8564
8565 * xfaces.c (Vface_remapping_alist): Doc fix.
8566
8567 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8568
8569 * w32proc.c (Fw32_set_console_codepage)
8570 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8571 Doc fixes.
8572
8573 2012-03-20 Chong Yidong <cyd@gnu.org>
8574
8575 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8576 to reflect default non-nil value of redisplay-dont-pause.
8577
8578 2012-03-19 Kenichi Handa <handa@m17n.org>
8579
8580 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8581 it fit in a valid range (Bug#11003).
8582
8583 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8584
8585 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8586 that is not from display property, accept the row as a "cursor
8587 row" if one of the string's character has a non-nil `cursor'
8588 property. Fixes cursor positioning when there are newlines in
8589 overlay strings, e.g. in icomplete.el. (Bug#11035)
8590
8591 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8592
8593 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8594
8595 2012-03-12 Chong Yidong <cyd@gnu.org>
8596
8597 * eval.c (inhibit_lisp_code): Rename from
8598 inhibit_window_configuration_change_hook; move from window.c.
8599
8600 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8601 * window.c (run_window_configuration_change_hook)
8602 (syms_of_window): Callers changed.
8603
8604 2012-03-11 Chong Yidong <cyd@gnu.org>
8605
8606 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8607
8608 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8609
8610 2012-03-10 Chong Yidong <cyd@gnu.org>
8611
8612 * frame.c (other_visible_frames): Don't assume the selected frame
8613 is visible (Bug#10955).
8614
8615 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8616
8617 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8618
8619 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8620
8621 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8622 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8623 zero (Bug#10954).
8624
8625 2012-03-03 Glenn Morris <rgm@gnu.org>
8626
8627 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8628
8629 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8630
8631 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8632 position past the first glyph_row that ends at ZV. (Bug#10902)
8633 (redisplay_window, next_element_from_string): Fix typos in
8634 comments.
8635 (redisplay_window): Pass to move_it_vertically the margin in
8636 pixels, not in screen lines.
8637
8638 2012-03-02 Glenn Morris <rgm@gnu.org>
8639
8640 * buffer.c (buffer-list-update-hook): Doc fix.
8641
8642 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8643
8644 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8645 push_it before setting up the iterator for the first overlay
8646 string, even if we have an empty string loaded.
8647 (next_overlay_string): If there's an empty string on the iterator
8648 stack, pop the stack. (Bug#10903)
8649
8650 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8651
8652 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8653 Suggested by Stefan Monnier in
8654 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8655 * alloc.c (widen_to_Lisp_Object): New static function.
8656 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8657 and widening them to Lisp_Objects. This would work even if
8658 USE_LSB_TAG is defined and wide integers are used, which might
8659 happen in a future version of Emacs.
8660
8661 2012-02-25 Chong Yidong <cyd@gnu.org>
8662
8663 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8664 Doc fix.
8665
8666 * xselect.c (Fx_selection_exists_p): Doc fix.
8667 (x_clipboard_manager_save_all): Print an informative message
8668 before saving to clipboard manager.
8669
8670 2012-02-24 Chong Yidong <cyd@gnu.org>
8671
8672 * keyboard.c (process_special_events): Handle all X selection
8673 requests in kbd_buffer, not just the next one (Bug#8869).
8674
8675 2012-02-23 Chong Yidong <cyd@gnu.org>
8676
8677 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8678 call when setting menu-bar-lines and tool-bar-lines parameters.
8679 (unwind_create_frame_1): New helper function.
8680
8681 * window.c (inhibit_window_configuration_change_hook): New var.
8682 (run_window_configuration_change_hook): Obey it.
8683 (syms_of_window): Initialize it.
8684
8685 2012-02-22 Chong Yidong <cyd@gnu.org>
8686
8687 * xterm.c (x_draw_image_relief): Add missing type check for
8688 Vtool_bar_button_margin (Bug#10743).
8689
8690 2012-02-21 Chong Yidong <cyd@gnu.org>
8691
8692 * fileio.c (Vfile_name_handler_alist): Doc fix.
8693
8694 * buffer.c (Fget_file_buffer): Protect against invalid file
8695 handler return value.
8696
8697 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8698
8699 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8700 when computing $valmask.
8701
8702 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8703 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8704 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8705 It's useless in that case, and it can cause problems on hosts
8706 that allocate halves of EMACS_INT values separately.
8707 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8708 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8709 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8710 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8711 it avoids undefined behavior on hosts where shifting right by more
8712 than the word width has undefined behavior.
8713
8714 2012-02-19 Chong Yidong <cyd@gnu.org>
8715
8716 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8717 (Funhandled_file_name_directory, Ffile_name_as_directory)
8718 (Fdirectory_file_name, Fexpand_file_name)
8719 (Fsubstitute_in_file_name): Protect against invalid file handler
8720 return values (Bug#10845).
8721
8722 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8723
8724 * .gdbinit (pitx): Fix incorrect references to fields of the
8725 iterator stack.
8726
8727 2012-02-17 Chong Yidong <cyd@gnu.org>
8728
8729 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8730
8731 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8732
8733 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8734 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8735
8736 2012-02-15 Chong Yidong <cyd@gnu.org>
8737
8738 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8739 marked as special. Also, starting docstrings with * is obsolete.
8740
8741 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8742
8743 * gnutls.c (emacs_gnutls_write): Fix last change.
8744
8745 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8746
8747 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8748 send_process.
8749
8750 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8751
8752 * keymap.c (Fsingle_key_description): Handle char ranges.
8753
8754 2012-02-12 Chong Yidong <cyd@gnu.org>
8755
8756 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8757 as that creates a dangerous corner case.
8758
8759 * window.c (Fdelete_window_internal): Invalidate the mouse
8760 highlight (Bug#9904).
8761
8762 2012-02-12 Glenn Morris <rgm@gnu.org>
8763
8764 * xselect.c (Fx_own_selection_internal)
8765 (Fx_get_selection_internal, Fx_disown_selection_internal)
8766 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8767 * nsselect.m (Fx_own_selection_internal)
8768 (Fx_disown_selection_internal, Fx_selection_exists_p)
8769 (Fx_selection_owner_p, Fx_get_selection_internal):
8770 Sync docs and argument specs with the xselect.c versions.
8771
8772 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8773
8774 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8775
8776 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8777
8778 * w32select.c (Fx_selection_exists_p): Sync doc string and
8779 argument list with xselect.c. (Bug#10783)
8780
8781 * w16select.c (Fx_selection_exists_p): Sync doc string and
8782 argument list with xselect.c. (Bug#10783)
8783
8784 2012-02-10 Glenn Morris <rgm@gnu.org>
8785
8786 * fns.c (Fsecure_hash): Doc fix.
8787
8788 2012-02-09 Kenichi Handa <handa@m17n.org>
8789
8790 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8791
8792 2012-02-07 Chong Yidong <cyd@gnu.org>
8793
8794 * buffer.c (Fbuffer_local_variables)
8795 (buffer_lisp_local_variables): Handle unbound vars correctly;
8796 don't let Qunbound leak into Lisp.
8797
8798 2012-02-07 Glenn Morris <rgm@gnu.org>
8799
8800 * image.c (Fimagemagick_types): Doc fix.
8801
8802 * image.c (imagemagick-render-type): Change it from a lisp object
8803 to an integer. Move the doc here from the lisp manual.
8804 Treat all values not equal to 0 the same.
8805
8806 2012-02-06 Chong Yidong <cyd@gnu.org>
8807
8808 * doc.c (store_function_docstring): Avoid applying docstring of
8809 alias to base function (Bug#2603).
8810
8811 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8812
8813 * .gdbinit (pp1, pv1): Remove redundant defines.
8814 (pr): Use pp.
8815
8816 2012-02-04 Chong Yidong <cyd@gnu.org>
8817
8818 * nsterm.m: Declare a global (Bug#10694).
8819
8820 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8821
8822 * w32.c (get_emacs_configuration_options):
8823 Include --enable-checking, if specified, in the return value.
8824
8825 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8826
8827 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8828 after rounding frame sizes. (Bug#9723)
8829
8830 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8831
8832 * keyboard.c (adjust_point_for_property): Don't position point
8833 before BEGV. (Bug#10696)
8834
8835 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8836
8837 Handle overflow when computing char display width (Bug#9496).
8838 * character.c (char_width): Return EMACS_INT, not int.
8839 (char_width, c_string_width): Check for overflow when
8840 computing the width; this is possible now that individual
8841 characters can have unbounded width. Problem introduced
8842 by merge from Emacs 23 on 2012-01-19.
8843
8844 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8845
8846 * dbusbind.c (Fdbus_register_method): Mention the return value
8847 :ignore in the docstring.
8848
8849 2012-02-02 Glenn Morris <rgm@gnu.org>
8850
8851 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8852
8853 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8854 Unconditionally set to t. (Bug#10673)
8855 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8856 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8857 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8858
8859 2012-02-02 Kenichi Handa <handa@m17n.org>
8860
8861 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8862 0, do not call append_composite_glyph.
8863
8864 2012-02-02 Kenichi Handa <handa@m17n.org>
8865
8866 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8867 NULL (Bug#6988).
8868 (x_produce_glyphs): If the component of a composition is a null
8869 string, set it->pixel_width to 1 to avoid zero-width glyph.
8870
8871 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8872
8873 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8874 first 2 arguments are identical. This makes inserting large
8875 output from a subprocess an order of magnitude faster on
8876 MS-Windows, where all sbrk'ed memory is always contiguous.
8877
8878 2012-01-31 Glenn Morris <rgm@gnu.org>
8879
8880 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8881 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8882 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8883
8884 2012-01-29 Glenn Morris <rgm@gnu.org>
8885
8886 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8887
8888 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8889
8890 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8891
8892 2012-01-28 Chong Yidong <cyd@gnu.org>
8893
8894 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8895
8896 2012-01-26 Chong Yidong <cyd@gnu.org>
8897
8898 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8899
8900 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8901 repeat counts (Bug#10507).
8902
8903 2012-01-26 Glenn Morris <rgm@gnu.org>
8904
8905 * lread.c (syms_of_lread): Doc fix.
8906
8907 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8908
8909 * coding.c (encode_designation_at_bol): Change return value to
8910 EMACS_INT.
8911
8912 2012-01-25 Chong Yidong <cyd@gnu.org>
8913
8914 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8915
8916 2012-01-21 Chong Yidong <cyd@gnu.org>
8917
8918 * floatfns.c (Fcopysign): Make the second argument non-optional,
8919 since nil is not allowed anyway.
8920
8921 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8922
8923 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8924 (send_process): Likewise.
8925
8926 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8927
8928 * window.c (save_window_save, Fcurrent_window_configuration)
8929 (Vwindow_persistent_parameters): Do not use Qstate.
8930 Rewrite doc-strings.
8931
8932 2012-01-19 Kenichi Handa <handa@m17n.org>
8933
8934 * character.c (char_width): New function.
8935 (Fchar_width, c_string_width, lisp_string_width):
8936 Use char_width (Bug#9496).
8937
8938 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8939
8940 * window.c (Vwindow_persistent_parameters): New variable.
8941 (Fset_window_configuration, save_window_save): Handle persistent
8942 window parameters.
8943
8944 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8945
8946 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8947 thrashing the stack of the thread. (Bug#9087)
8948
8949 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8950
8951 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8952
8953 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8954
8955 * xdisp.c (rows_from_pos_range): Handle the case where the
8956 highlight ends on a newline. (Bug#10464)
8957 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8958 he end column for display of highlight that ends on a newline
8959 before a R2L line.
8960
8961 2012-01-11 Glenn Morris <rgm@gnu.org>
8962
8963 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8964 from load-path also when installation-directory is nil. (Bug#10208)
8965
8966 2012-01-10 Glenn Morris <rgm@gnu.org>
8967
8968 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8969
8970 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8971 Update template values to be closer to their typical values these days.
8972
8973 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8974
8975 * xdisp.c (rows_from_pos_range): Accept additional argument
8976 DISP_STRING, and accept any glyph in a row whose object is that
8977 string as eligible for mouse highlight. Fixes mouse highlight of
8978 display strings from overlays. (Bug#10464)
8979
8980 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8981
8982 emacs: fix an auto-save permissions race condition (Bug#10400)
8983 * fileio.c (auto_saving_dir_umask): New static var.
8984 (Fmake_directory_internal): Use it.
8985 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8986 creating the directory. The old code temporarily assigns
8987 too-generous permissions to the directory.
8988 (do_auto_save_eh): Clear it.
8989 (Fdo_auto_save): Catch all errors, not just file errors, so
8990 that the var is always cleared.
8991
8992 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8993
8994 * search.c (scan_buffer): Pass character positions to
8995 know_region_cache, not byte positions. (Bug#6540)
8996
8997 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8998
8999 * w32.c (sys_rename): Report EXDEV when rename of a directory
9000 fails because the target is on another logical disk. (Bug#10284)
9001
9002 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9003
9004 * xterm.c (x_embed_request_focus): New function.
9005
9006 * xterm.h: Add prototype.
9007
9008 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9009
9010 2012-01-05 Glenn Morris <rgm@gnu.org>
9011
9012 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9013
9014 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9015
9016 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9017 Load gnutls_transport_set_lowat only if GnuTLS version is below
9018 2.11.1.
9019 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9020 GnuTLS versions below 2.11.1.
9021
9022 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9023
9024 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9025 to the doc string advising against its use for altering the way
9026 windows are scrolled.
9027
9028 2011-12-28 Kenichi Handa <handa@m17n.org>
9029
9030 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9031 coding-system ASCII compatible only when it does not produce BOM
9032 on encoding (Bug#10383).
9033
9034 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9035
9036 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9037 can scroll.
9038 (create_and_show_popup_menu): Always use menu_position_func for
9039 Gtk3 (Bug#10361).
9040
9041 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9042
9043 * callint.c (Fcall_interactively): Don't truncate prompt string.
9044
9045 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9046
9047 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9048 property that ends at ZV, so that the bidi iteration could be
9049 resumed from there (after widening). (Bug#10360)
9050
9051 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9052
9053 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9054
9055 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9056
9057 * nsterm.m (x_free_frame_resources):
9058 Release f->output_data.ns->miniimage.
9059 (ns_index_color): Fix indentation. Do not retain
9060 color_table->colors[i].
9061
9062 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9063 before returning.
9064
9065 * nsfns.m (x_set_background_color): Assign return value from
9066 ns_index_color to face-background instead of NSColor*.
9067 (ns_implicitly_set_icon_type): Fix indentation.
9068 Change assignment in for loop to comparison.
9069
9070 * emacs.c (ns_pool): New variable.
9071 (main): Assign ns_pool.
9072 (Fkill_emacs): Call ns_release_autorelease_pool.
9073
9074 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9075 autorelease fdesc, release fdAttrs and tdict.
9076 (ns_get_covering_families): Release charset.
9077 (ns_findfonts): Release NSFontDescriptor created with new.
9078 (ns_uni_to_glyphs): Fix indentation.
9079 (setString): Release attrStr before assigning new value.
9080
9081 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9082
9083 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9084 and NS_IMPL_COCOA.
9085 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9086 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9087
9088 2011-12-18 David Reitter <reitter@cmu.edu>
9089
9090 * nsterm.m (ns_term_init): Subscribe for notifications
9091 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9092 to method trackingNotification in EmacsMenu.
9093
9094 * nsmenu.m (trackingMenu): New variable.
9095 (trackingNotification): New method (from Aquamacs).
9096 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9097 from Aquamacs (Bug#7030).
9098
9099 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9100
9101 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9102 (symbol_to_nsstring): Fix indentation.
9103 (ns_symbol_to_pb): New function.
9104 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9105 (Fns_rotate_cut_buffers_internal): Remove.
9106 (Fns_store_selection_internal): Rename from
9107 Fns_store_cut_buffer_internal.
9108 (ns_get_foreign_selection, Fx_own_selection_internal)
9109 (Fx_disown_selection_internal, Fx_selection_exists_p)
9110 (Fns_get_selection_internal, Fns_store_selection_internal):
9111 Use ns_symbol_to_pb and check if return value is nil.
9112 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9113 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9114 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9115 renamed to Sns_store_selection_internal.
9116 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9117 and remove this function.
9118 (ns_handle_selection_clear): Remove, never used.
9119 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9120 here.
9121
9122 2011-12-17 Ken Brown <kbrown@cornell.edu>
9123
9124 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9125 GID is unknown (Bug#10257).
9126
9127 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9128
9129 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9130 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9131 which caused a build failure on GNU/Linux IA-64. This problem was
9132 introduced by my 2011-10-07 patch.
9133
9134 2011-12-15 Juri Linkov <juri@jurta.org>
9135
9136 * image.c (imagemagick_error): New function. (Bug#10112)
9137 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9138 Use `imagemagick_error' where ImageMagick functions return
9139 `MagickFalse'.
9140 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9141 proper order.
9142
9143 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9144
9145 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9146 fill background (Bug#8992).
9147
9148 2011-12-13 Martin Rudalics <rudalics@gmx.at>
9149
9150 * window.c (Vwindow_combination_resize)
9151 (Vwindow_combination_limit): Use t instead of non-nil in
9152 doc-strings.
9153 (Vrecenter_redisplay): Add first sentence of doc-string on
9154 separate line.
9155 (Frecenter): Fix doc-string typo.
9156
9157 2011-12-11 Kenichi Handa <handa@m17n.org>
9158
9159 * coding.c (Funencodable_char_position): Pay attention to the
9160 buffer text relocation (Bug#9389).
9161
9162 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9163
9164 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9165 gtk_init (Bug#10100).
9166
9167 2011-12-10 Eli Zaretskii <eliz@gnu.org>
9168
9169 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9170 IT->string is nil. (Bug#10263)
9171
9172 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9173
9174 * nsterm.h (x_free_frame_resources): Declare.
9175
9176 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9177 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9178
9179 * nsterm.h (ns_get_defaults_value): Declare.
9180
9181 * nsterm.m (ns_default): Call ns_get_defaults_value.
9182
9183 2011-12-09 Eli Zaretskii <eliz@gnu.org>
9184
9185 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9186 (Bug#10170)
9187
9188 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9189
9190 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9191 that where the value of an _OBJC_* symbol points to is in the .bss
9192 section (Bug#10240).
9193
9194 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9195
9196 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9197 after the loop to call ccl_driver at least once (Bug#8619).
9198
9199 2011-12-08 Kenichi Handa <handa@m17n.org>
9200
9201 * ftfont.c (get_adstyle_property): Fix previous change
9202 (Bug#10233).
9203
9204 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
9205
9206 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9207 dirs from the default value of EMACSLOADPATH (bug#10208).
9208
9209 2011-12-07 Glenn Morris <rgm@gnu.org>
9210
9211 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9212 installation and source directories as well. (Bug#10208)
9213
9214 2011-12-06 Chong Yidong <cyd@gnu.org>
9215
9216 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9217
9218 2011-12-06 Glenn Morris <rgm@gnu.org>
9219
9220 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9221 as an error, not just -1. (Bug#10217)
9222
9223 2011-12-05 Chong Yidong <cyd@gnu.org>
9224
9225 * keyboard.c (process_special_events): New function.
9226 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9227
9228 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9229
9230 * coding.c (encode_designation_at_bol): Don't use uninitialized
9231 local variable (Bug#9318).
9232
9233 2011-12-05 Kenichi Handa <handa@m17n.org>
9234
9235 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9236 return Qnil (Bug#8046, Bug#10193).
9237
9238 2011-12-05 Kenichi Handa <handa@m17n.org>
9239
9240 * coding.c (encode_designation_at_bol): New args charbuf_end and
9241 dst. Return the number of produced bytes. Callers changed.
9242 (coding_set_source): Return how many bytes coding->source was
9243 relocated.
9244 (coding_set_destination): Return how many bytes
9245 coding->destination was relocated.
9246 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9247 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9248
9249 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9250
9251 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9252 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9253 macro (Bug#9318).
9254
9255 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9256
9257 The following changes are to fix Bug#9318.
9258
9259 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9260 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9261 (encode_coding_iso_2022, encode_coding_sjis)
9262 (encode_coding_big5, encode_coding_charset): Use the above macros.
9263
9264 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
9265
9266 * lisp.h (process_quit_flag): Fix external declaration.
9267
9268 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9269
9270 Don't macro-inline non-performance-critical code.
9271 * eval.c (process_quit_flag): New function.
9272 * lisp.h (QUIT): Use it.
9273
9274 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9275
9276 * nsfns.m (get_geometry_from_preferences): New function.
9277 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9278
9279 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9280
9281 * emacs.c (Qkill_emacs): Define.
9282 (syms_of_emacs): Initialize it.
9283 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9284 Qquit_flag to `kill-emacs' instead.
9285 (quit_throw_to_read_char): Add parameter `from_signal'.
9286 All callers changed. Call Fkill_emacs if requested and safe.
9287 * lisp.h (QUIT): Call Fkill_emacs if requested.
9288
9289 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9290
9291 * widget.c (update_wm_hints): Return if wmshell is null.
9292 (widget_update_wm_size_hints): New function.
9293
9294 * widget.h (widget_update_wm_size_hints): Declare.
9295
9296 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9297 widget_update_wm_size_hints (Bug#10104).
9298
9299 2011-12-03 Eli Zaretskii <eliz@gnu.org>
9300
9301 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9302 before a newline, prepare the bidi iterator for consuming the
9303 newline, and keep the current paragraph direction. (Bug#10183)
9304 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9305
9306 2011-12-02 Juri Linkov <juri@jurta.org>
9307
9308 * search.c (Fword_search_regexp): New Lisp function created from
9309 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9310 (Fword_search_backward, Fword_search_forward)
9311 (Fword_search_backward_lax, Fword_search_forward_lax):
9312 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9313 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9314
9315 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9316
9317 * fileio.c (Finsert_file_contents): Move after-change-function call
9318 to before the "handled:" label, since all "goto handled" appear in
9319 cases where the *-change-functions have already been properly called
9320 (bug#10117).
9321
9322 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9323
9324 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9325 waiting for input. (Bug#10169)
9326
9327 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9328
9329 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9330 verifies glyph row's hash code--we have just reallocated the
9331 glyphs, so their contents can be complete garbage. (Bug#10164)
9332
9333 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
9334
9335 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9336
9337 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9338
9339 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9340 attributes are tested _before_ calling verify_row_hash, to protect
9341 against GCC re-ordering of the tests. (Bug#10164)
9342
9343 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9344
9345 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9346
9347 * xterm.c (handle_one_xevent): Only set async_visible and friends
9348 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9349 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9350 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9351
9352 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9353
9354 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9355 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9356 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9357 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9358 All uses changed to use GCPRO1 etc.
9359 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9360 Revert to old implementation (i.e., before 2011-03-11).
9361
9362 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9363
9364 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9365 of scroll runs so as to avoid assigning disabled bogus rows and
9366 unnecessary graphics copy operations.
9367
9368 2011-11-27 Eli Zaretskii <eliz@gnu.org>
9369
9370 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9371 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9372 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9373 (malloc, free, realloc, calloc): Redirect to e_* only when
9374 compiling Emacs.
9375
9376 * lisp.h (GCTYPEBITS): Move before first use.
9377 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9378 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9379 this macro definition.
9380
9381 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9382 _MSC_VER.
9383
9384 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9385
9386 * gtkutil.c (xg_create_frame_widgets):
9387 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9388 present with Gtk+ 2.0.
9389
9390 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9391
9392 * fileio.c (Finsert_file_contents): Undo previous change; see
9393 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9394
9395 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9396
9397 Rename locals to avoid shadowing.
9398 * fileio.c (Finsert_file_contents):
9399 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9400 * process.c (wait_reading_process_output):
9401 Rename inner 'proc' to 'p' to avoid shadowing.
9402 Indent for consistency with usual Emacs style.
9403
9404 2011-11-25 Eli Zaretskii <eliz@gnu.org>
9405
9406 * xdisp.c (redisplay_window): If cursor row is not fully visible
9407 after recentering, and scroll-conservatively is set to a large
9408 number, scroll window by a few more lines to make the cursor fully
9409 visible and out of scroll-margin. (Bug#10105)
9410 (start_display): Don't move to the next line if the display should
9411 start at a newline that is part of a display vector or an overlay
9412 string. (Bug#10119)
9413
9414 2011-11-24 Juri Linkov <juri@jurta.org>
9415
9416 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9417 after the `MagickPingImage' call. (Bug#10112)
9418
9419 2011-11-23 Chong Yidong <cyd@gnu.org>
9420
9421 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9422
9423 2011-11-23 Martin Rudalics <rudalics@gmx.at>
9424
9425 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9426 making another buffer current. (Bug#10114)
9427
9428 2011-11-23 Glenn Morris <rgm@gnu.org>
9429
9430 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9431
9432 2011-11-23 Chong Yidong <cyd@gnu.org>
9433
9434 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9435 using it (Bug#5984).
9436
9437 2011-11-22 Eli Zaretskii <eliz@gnu.org>
9438
9439 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9440 and header-lines, as they don't have one computed for them.
9441 (Bug#10098)
9442
9443 * .gdbinit (prow): Make displayed values more self-explaining.
9444 Add row's hash code.
9445
9446 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9447
9448 * process.c (wait_reading_process_output): Fix asynchrounous
9449 GnuTLS socket handling on some versions of the GnuTLS library.
9450 (wait_reading_process_output): Add comment and URL.
9451
9452 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9453
9454 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9455
9456 2011-11-21 Chong Yidong <cyd@gnu.org>
9457
9458 * window.c (Fnext_window, Fprevious_window): Doc fix.
9459
9460 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9461
9462 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9463
9464 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9465
9466 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9467
9468 2011-11-20 Martin Rudalics <rudalics@gmx.at>
9469
9470 * window.c (Fset_window_combination_limit): Rename argument
9471 STATUS to LIMIT.
9472 (Vwindow_combination_limit): Remove "status" from doc-string.
9473
9474 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9475
9476 * m/ibms390.h: Remove.
9477 * m/ibms390x.h: Don't include "ibms390.h".
9478
9479 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9480
9481 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9482 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9483
9484 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9485
9486 * casetab.c (Fset_case_table):
9487 * charset.c (Fcharset_after): Fix typos.
9488
9489 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9490
9491 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9492 Otherwise, valgrind does not work on some platforms.
9493 Problem reported by Andreas Schwab in
9494 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9495 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9496 is set, removing the need for VIRT_ADDRESS_VARIES.
9497 (PURE_P): Use a more-efficient implementation that needs just one
9498 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9499 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9500 to 4 (xorl, subq, cmpq, setbe).
9501 * alloc.c (pure): Always extern now, since that's the
9502 VIRT_ADDR_VARIES behavior.
9503 (PURE_POINTER_P): Use a single comparison, not two, for
9504 consistency with the new puresize.h.
9505 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9506 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9507 Remove VIRT_ADDR_VARIES no longer needed.
9508
9509 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9510
9511 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9512 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9513 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9514 behave as if the cursor position were at the window margin.
9515
9516 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9517 and the cursor position is out of bounds, behave as if the cursor
9518 position were at the window margin. (Bug#10075)
9519
9520 2011-11-18 Chong Yidong <cyd@gnu.org>
9521
9522 * window.c (Fwindow_combination_limit): Make first argument
9523 non-optional, since it is meaningless for live windows like the
9524 selected window.
9525
9526 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9527
9528 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9529
9530 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9531
9532 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9533 (graft_intervals_into_buffer): Simplify.
9534
9535 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9536
9537 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9538 hash values of the two rows.
9539 (copy_row_except_pointers): Preserve the used[] arrays and the
9540 hash values of the two rows. (Bug#10035)
9541 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9542
9543 * xdisp.c (row_hash): New function, body extracted from
9544 compute_line_metrics.
9545 (compute_line_metrics): Call row_hash, instead of computing the
9546 hash code inline.
9547
9548 * dispnew.c (verify_row_hash): Call row_hash for computing the
9549 hash code of a row, instead of duplicating code from xdisp.c.
9550
9551 * dispextern.h (row_hash): Add prototype.
9552
9553 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9554
9555 * frame.c (delete_frame): Don't delete the terminal when the last
9556 X frame is closed if emacs is built with GTK toolkit.
9557
9558 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9559
9560 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9561
9562 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9563
9564 * window.c (Vwindow_splits): Rename to
9565 Vwindow_combination_resize. Suggested by Juri Linkov.
9566 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9567 of Vwindow_splits.
9568
9569 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9570
9571 * nsfns.m (Fns_font_name):
9572 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9573
9574 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9575
9576 * window.h (window): Rename slot "nest" to "combination_limit".
9577 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9578 (Fset_window_nest): Rename to Fset_window_combination_limit.
9579 (Vwindow_nest): Rename to Vwindow_combination_limit.
9580 (recombine_windows, make_parent_window, make_window)
9581 (Fsplit_window_internal, saved_window)
9582 (Fset_window_configuration, save_window_save): Rename all
9583 occurrences of window_nest to window_combination_limit.
9584
9585 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9586
9587 * image.c (imagemagick_load_image): Fix typo.
9588
9589 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9590
9591 * xdisp.c (display_line): Move the call to
9592 highlight_trailing_whitespace before the call to
9593 compute_line_metrics, since the latter needs to see the final
9594 faces of all the glyphs to compute ROW's hash value.
9595 Fixes assertion violations in row_equal_p. (Bug#10035)
9596
9597 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9598
9599 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9600 just return (bug#10044).
9601
9602 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9603
9604 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9605 with user-defined heap size. Bump the default size of the temacs
9606 heap to 27MB, to avoid memory warning when running temacs.
9607 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9608
9609 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9610 current_matrix and desired_matrix. (Bug#9990)
9611 (verify_row_hash) [XASSERTS]: New function.
9612 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9613 that the hash value of glyph rows is correct.
9614
9615 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9616
9617 * window.h (window): Remove splits slot.
9618 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9619 (Fdelete_other_windows_internal, make_parent_window)
9620 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9621 (Fset_window_configuration, save_window_save): Don't deal with
9622 split status of windows.
9623 (saved_window): Remove splits slot.
9624 (Vwindow_splits): Rewrite doc-string.
9625
9626 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9627
9628 * xfns.c (unwind_create_frame):
9629 * nsfns.m (unwind_create_frame):
9630 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9631 Vframe_list (Bug#9999).
9632
9633 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9634
9635 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9636
9637 2011-11-11 Kenichi Handa <handa@m17n.org>
9638
9639 * callproc.c (Fcall_process): Set the member dst_multibyte of
9640 process_coding.
9641
9642 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9643
9644 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9645 avoid a crash (bug#9496).
9646
9647 2011-11-09 Chong Yidong <cyd@gnu.org>
9648
9649 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9650 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9651
9652 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9653
9654 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9655
9656 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9657
9658 Avoid some portability problems by eschewing 'extern inline' functions.
9659 The trivial performance wins aren't worth the portability hassles; see
9660 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9661 et seq.
9662 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9663 (window_box_width, window_box_left, window_box_left_offset)
9664 (window_box_right, window_box_right_offset): Undo previous change,
9665 by removing the "extern"s.
9666 * intervals.c (adjust_intervals_for_insertion)
9667 (adjust_intervals_for_deletion): Undo previous change,
9668 making these static again.
9669 (offset_intervals, temp_set_point_both, temp_set_point)
9670 (copy_intervals_to_string): No longer inline.
9671 * xdisp.c (window_text_bottom_y, window_box_width)
9672 (window_box_height, window_box_left_offset)
9673 (window_box_right_offset, window_box_left, window_box_right)
9674 (window_box): No longer inline.
9675
9676 2011-11-08 Chong Yidong <cyd@gnu.org>
9677
9678 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9679 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9680 Signal an error if not a live window.
9681 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9682 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9683
9684 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9685
9686 * lisp.h (syms_of_abbrev): Remove declaration.
9687 Reported by CHENG Gao <chenggao@royau.me>.
9688
9689 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9690
9691 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9692 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9693 of temacs in GUI mode.
9694
9695 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9696
9697 * window.h: Declare delete_all_child_windows instead of
9698 delete_all_subwindows.
9699 * window.c (Fwindow_nest, Fset_window_nest)
9700 (Fset_window_new_total, Fset_window_new_normal)
9701 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9702 (delete_all_subwindows): Rename to delete_all_child_windows.
9703 (Fdelete_other_windows_internal, Fset_window_configuration):
9704 Call delete_all_child_windows instead of delete_all_subwindows.
9705 * frame.c (delete_frame): Call delete_all_child_windows instead
9706 of delete_all_subwindows.
9707
9708 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9709
9710 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9711 This is also needed for porting to any host where GC_MARK_STACK is
9712 not GC_MAKE_GCPROS_NOOPS.
9713 (which_symbols): Use it.
9714
9715 2011-11-07 Kenichi Handa <handa@m17n.org>
9716
9717 * coding.c (coding_set_destination): Check coding->src_pos only
9718 when coding->src_object is a buffer (bug#9910).
9719
9720 * process.c (send_process): Set the member src_multibyte of coding
9721 to 0 (bug#9911) when sending a unibyte text.
9722
9723 * callproc.c (Fcall_process): Set the member src_multibyte of
9724 process_coding to 0 (bug#9912).
9725
9726 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9727
9728 * xmenu.c (cleanup_widget_value_tree): New function.
9729 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9730 calling free_menubar_widget_value_tree directly (Bug#9830).
9731
9732 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9733
9734 Fix some portability problems with 'inline'.
9735 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9736 (window_box_width, window_box_left, window_box_left_offset)
9737 (window_box_right, window_box_right_offset): Declare extern.
9738 Otherwise, these inline functions do not conform to C99 and
9739 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9740 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9741 * intervals.c (adjust_intervals_for_insertion)
9742 (adjust_intervals_for_deletion): Now extern, because otherwise the
9743 extern inline functions 'offset_intervals' couldn't refer to it.
9744 (static_offset_intervals): Remove.
9745 (offset_intervals): Rewrite using the old contents of
9746 static_offset_intervals. The old version didn't conform to C99
9747 because an extern inline function contained a reference to an
9748 identifier with static linkage.
9749
9750 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9751
9752 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9753 GC.
9754
9755 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9756
9757 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9758 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9759 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9760 return Qleft_to_right.
9761
9762 2011-11-06 Chong Yidong <cyd@gnu.org>
9763
9764 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9765 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9766 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9767 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9768 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9769 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9770 (Fwindow_vscroll): Doc fix.
9771 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9772 argument, since it makes no sense to pass a live window and for
9773 consistency with window-child.
9774
9775 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9776
9777 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9778 support MSVC.
9779
9780 2011-11-05 Jason Rumney <jasonr@gnu.org>
9781
9782 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9783 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9784 fonts (Bug#6029).
9785 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9786 bitwise arithmetic preventing use of unicode-sip and non-truetype
9787 opentype fonts.
9788
9789 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9790
9791 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9792 "emacs"-only part.
9793
9794 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9795 initialization code to keep similarity to xfns.c after changes
9796 from 2011-11-05.
9797
9798 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9799
9800 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9801 (unwind_create_frame): New function (Bug#9943).
9802 (Fx_create_frame): Restructure code to be more similar to the one in
9803 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9804 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9805 Move terminal->reference_count++ just before making the frame official
9806 (Bug#9943).
9807
9808 * nsterm.m (x_free_frame_resources): New function.
9809 (x_destroy_window): Move code to x_free_frame_resources.
9810
9811 * xfns.c (unwind_create_frame): Fix comment.
9812 (Fx_create_frame, x_create_tip_frame):
9813 Move terminal->reference_count++ just before making the frame
9814 official. Move initialization of image_cache_refcount and
9815 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9816
9817 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9818
9819 Support MSVC build with newer versions of Visual Studio.
9820 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9821 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9822 nt/gmake.defs.
9823
9824 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9825 which are not supported by MSVC.
9826 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9827 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9828 bitfields.
9829 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9830 types in bitfields.
9831 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9832
9833 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9834
9835 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9836
9837 Support MSVC build with newer versions of Visual Studio.
9838 * w32.c: Don't include w32api.h for MSVC.
9839 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9840
9841 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9842 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9843 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9844 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9845 e_* cousins.
9846 (alloca) [_MSC_VER]: Define to _alloca.
9847
9848 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9849
9850 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9851
9852 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9853
9854 * xdisp.c (note_mouse_highlight): If either of
9855 previous/next-single-property-change returns nil, treat that as
9856 the beginning or the end of the buffer. (Bug#9955)
9857
9858 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9859
9860 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9861 label is not null (Bug#9951).
9862 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9863 may be NULL.
9864
9865 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9866
9867 * window.c (Fwindow_body_size): Mention in the doc string that the
9868 return value is in frame's canonical units. (Bug#9949)
9869
9870 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9871
9872 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9873
9874 * w32fns.c (unwind_create_frame): If needed, free the glyph
9875 matrices of the partially constructed frame. (Bug#9943)
9876 * xfns.c (unwind_create_frame): Likewise.
9877
9878 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9879
9880 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9881 Don't stop backward scan on the continuation glyph, even though
9882 its CHARPOS is positive.
9883 (mouse_face_from_buffer_pos, note_mouse_highlight):
9884 Rename cover_string to disp_string.
9885
9886 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9887
9888 * window.c (temp_output_buffer_show): Don't use
9889 Vtemp_buffer_show_specifiers.
9890 (Vtemp_buffer_show_specifiers): Remove unused variable.
9891
9892 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9893
9894 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9895 past the beginning of the current glyph matrix.
9896
9897 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9898
9899 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9900 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9901 HAVE_GTK3 (Bug#9869).
9902
9903 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9904 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9905
9906 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9907
9908 * xterm.c: Declare x_handle_net_wm_state to return int.
9909 (handle_one_xevent): Check if we are iconified but don't have
9910 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9911 (get_current_wm_state): Return non-zero if not hidden,
9912 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9913 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9914 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9915 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9916
9917 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9918
9919 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9920 so that this new function doesn't get optimized away by a
9921 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9922
9923 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9924
9925 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9926
9927 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9928
9929 Fix the `xbytecode' command.
9930 * .gdbinit (xprintbytestr): New command.
9931 (xwhichsymbols): Rename from `which'; all callers changed.
9932 (xbytecode): Print the byte-code string as well.
9933
9934 2011-10-29 Kim Storm <storm@cua.dk>
9935
9936 * alloc.c (which_symbols): New function.
9937
9938 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9939
9940 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9941 line. (Bug#9903)
9942
9943 2011-10-29 Glenn Morris <rgm@gnu.org>
9944
9945 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9946 Not clear what it was for, and it causes various bugs. (Bug#9839)
9947
9948 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9949
9950 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9951 possible random value that matches one of those tested as
9952 condition to clear the mouse face.
9953
9954 2011-10-28 Chong Yidong <cyd@gnu.org>
9955
9956 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9957
9958 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9959
9960 * window.c (make_window): Initialize phys_cursor_on_p.
9961
9962 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9963
9964 * lisp.h (struct Lisp_Symbol): Update comments.
9965
9966 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9967
9968 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9969
9970 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9971
9972 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9973 <oslsachem@gmail.com> for helping to debug this.
9974
9975 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9976 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9977 (g_b_init_get_glyph_outline_w): New static variables.
9978 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9979 (GetGlyphOutlineW_Proc): New typedefs.
9980 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9981 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9982 New functions.
9983 (w32font_open_internal, compute_metrics):
9984 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9985 instead of calling the "wide" APIs directly.
9986
9987 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9988
9989 * w32.h (syms_of_w32font): Add prototype.
9990
9991 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9992
9993 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9994 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9995 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9996 (Fmove_to_window_line): Doc fix.
9997
9998 2011-10-27 Chong Yidong <cyd@gnu.org>
9999
10000 * process.c (make_process): Set gnutls_state to NULL.
10001
10002 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10003 non-NULL, regardless of GNUTLS_INITSTAGE.
10004 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10005 an error. Set process slots as soon as we allocate them.
10006
10007 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10008
10009 2011-10-27 Chong Yidong <cyd@gnu.org>
10010
10011 * gnutls.c (emacs_gnutls_deinit): New function.
10012 Deallocate credentials structures as well as calling gnutls_deinit.
10013 (Fgnutls_deinit, Fgnutls_boot): Use it.
10014
10015 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10016 (deactivate_process): Call emacs_gnutls_deinit.
10017
10018 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10019
10020 * image.c (x_create_x_image_and_pixmap):
10021 * w32.c (sys_rename, w32_delayed_load):
10022 * w32font.c (fill_in_logfont):
10023 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10024
10025 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10026
10027 * w32fns.c (w32_default_color_map): New function,
10028 extracted from Fw32_default_color_map.
10029 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10030
10031 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10032
10033 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10034
10035 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10036
10037 * keyboard.c (test_undefined): New function (bug#9751).
10038 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10039
10040 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10041
10042 * sysdep.c (init_sys_modes): Fix the check for the controlling
10043 terminal (Bug#6649).
10044
10045 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10046
10047 * dispextern.h (struct bidi_it): New member next_en_type.
10048
10049 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10050 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10051 current character, check also for next_en_type being WEAK_EN.
10052 (bidi_resolve_weak): Don't enter the expensive loop if the current
10053 position is before next_en_pos. Record the bidi type of the first
10054 non-ET, non-BN character we find, in addition to its position.
10055 (bidi_level_of_next_char): Invalidate next_en_type when
10056 next_en_pos is over-stepped.
10057
10058 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10059
10060 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10061 * editfns.c: Rewrite current-time-zone so that it invokes
10062 the equivalent of (format-time-string "%Z") to get the time zone name.
10063 This fixes a bug when the time zone name contains characters that
10064 need converting from the system time locale to Emacs internal format.
10065 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10066 that patch fixed format-time-string to do the conversion, but
10067 I forgot to fix current-time-zone.
10068 (format_time_string): New function, containing most of
10069 what Fformat_time_string used to contain.
10070 (Fformat_time_string): Rewrite in terms of format_time_string.
10071 This doesn't change this function's behavior.
10072 (current-time-zone): Rewrite to use format_time_string.
10073 This fixes the bug reported by Michael Schierl in
10074 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10075 Jason Rumney's 2007-06-07 change worked around this bug, but
10076 didn't fix it.
10077 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10078
10079 2011-10-19 Eli Zaretskii <eliz@gnu.org>
10080
10081 * xdisp.c (start_display): If the character at POS is displayed
10082 via a display vector, reset IT->current.dpvec_index to zero.
10083 (try_window_reusing_current_matrix): If a line ends in a display
10084 vector or the next line starts in a display vector, continue
10085 redrawing the window even though the character position of
10086 start_row was reached.
10087 (Bug#9771, part 2)
10088
10089 2011-10-18 Chong Yidong <cyd@gnu.org>
10090
10091 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10092 with nobreak-char-display too.
10093
10094 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10095
10096 Fix part 3 of bug#9771.
10097 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10098 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10099 non-neutral characters if the current character is a paragraph
10100 separator (a.k.a. Newline). This avoids running the same
10101 expensive loop twice, once when we consume the preceding newline
10102 and the other time when the line actually needs to be displayed.
10103 Avoid the loop when we see neutrals on the base embedding level
10104 following a character whose directionality is the same as the
10105 paragraph's. This avoids running the expensive loop when a line
10106 ends in a long sequence of neutrals, like control characters.
10107 Add assertion against STRONG_AL type. Slightly rearrange code
10108 that determines the type of a neutral given the first non-neutral
10109 that follows it.
10110 (bidi_level_of_next_char): Set next_en_pos to zero when
10111 invalidating its info.
10112
10113 2011-10-17 Eli Zaretskii <eliz@gnu.org>
10114
10115 * xdisp.c (push_display_prop): Determine whether to record string
10116 or buffer position by IT->string, not by IT->method. Allow
10117 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10118 (move_it_vertically_backward): Don't look for character position
10119 immediately after the newline when in a continuation line.
10120 (Bug#9771, part 1)
10121
10122 2011-10-15 Martin Rudalics <rudalics@gmx.at>
10123
10124 * window.c (coordinates_in_window): Rewrite and delabelize
10125 vertical border check. (Bug#5357) (Bug#9618)
10126
10127 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10128
10129 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10130 errors in XSetWindowBorder (bug#9310).
10131
10132 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10133
10134 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10135 avoid crash when xmalloc overrun checking is enabled.
10136
10137 2011-10-13 Eli Zaretskii <eliz@gnu.org>
10138
10139 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10140 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10141 cursor motion with <left> and <right> arrow keys.
10142
10143 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10144 some callers set that themselves.
10145
10146 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10147
10148 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10149 display string and the previous row comes from the same string and
10150 is empty. (Bug#9739) (Bug#9738)
10151
10152 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10153
10154 * doc.c (get_doc_string): Encode file name (bug#9735).
10155
10156 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10157
10158 * bidi.c (bidi_level_of_next_char):
10159 * xdisp.c (get_visually_first_element): Remove old incorrect
10160 comments regarding the Unicode Line Separator character.
10161
10162 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10163
10164 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10165
10166 * alloc.c (Fgc_status): Do not access beyond zombies array
10167 boundary if nzombies > MAX_ZOMBIES.
10168 * alloc.c (dump_zombies): Add missing format specifier.
10169
10170 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10171
10172 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10173 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10174
10175 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10176 Some packages use them to denote characters with modifiers.
10177
10178 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10179
10180 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10181 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10182 matching a pp-number. Rename parameter var to var1.
10183
10184 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10185
10186 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10187
10188 2011-10-08 Glenn Morris <rgm@gnu.org>
10189
10190 * callint.c (Fcall_interactively): Give a more explicit error for the
10191 'c' case with a non-character input. (Bug#8479)
10192
10193 2011-10-08 Eli Zaretskii <eliz@gnu.org>
10194
10195 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10196 lines.
10197 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10198 lines that are hscrolled on the left.
10199
10200 * dispnew.c (buffer_posn_from_coords): Account for a possible
10201 presence of header-line. (Bug#4426)
10202
10203 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10204
10205 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10206 Don't advertise functionality which we discourage or doesn't work.
10207
10208 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10209
10210 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10211 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10212 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10213 this makes Emacs dump core during garbage collection on rare
10214 occasions. sizeof is obviously inferior to offsetof here, so
10215 stick with offsetof.
10216 (GC_POINTER_ALIGNMENT): New macro.
10217 (mark_memory): Omit 3rd (offset) arg; caller changed.
10218 Don't assume EMACS_INT alignment is the same as pointer alignment.
10219
10220 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10221
10222 * keyboard.c (read_key_sequence_remapped): New var.
10223 (read_key_sequence): Compute remapping in the right buffer.
10224 (command_loop_1): Use read_key_sequence's remapping directly.
10225
10226 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10227
10228 * dired.c (file_name_completion): Don't expand file name.
10229 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10230 before checking file name handler.
10231
10232 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10233 they've been requested explicitly (bug#9591).
10234
10235 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
10236
10237 * keymap.c (Fsingle_key_description): Use make_specified_string
10238 instead of build_string to build string from push_key_description.
10239 (Bug#5193)
10240
10241 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10242
10243 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10244 This fixes a Y2038 bug on 64-bit hosts.
10245 * buffer.c (reset_buffer):
10246 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10247 (Fclear_buffer_auto_save_failure):
10248 Use 0, not -1, to represent an unset failure time, since time_t
10249 might not be signed.
10250
10251 Remove dependency on glibc malloc internals.
10252 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10253 Move back here from lisp.h, but with their new implementations.
10254 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10255 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10256 * charset.c (charset_table_init): New static var.
10257 (syms_of_charset): Use it instead of xmalloc. This removes a
10258 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10259 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10260 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10261 Move back to alloc.c.
10262 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10263 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10264
10265 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10266
10267 * nsterm.m (windowDidResize): Call x_set_window_size only when
10268 ns_in_resize is true. Otherwise set pixelwidth/height and
10269 call change_frame_size (Bug#9628).
10270
10271 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10272
10273 Port --enable-checking=all to Fedora 14 x86-64.
10274 * charset.c (syms_of_charset): Also account for glibc malloc's
10275 internal overhead when calculating the initial malloc maximum.
10276
10277 Port --enable-checking=all to Fedora 14 x86.
10278 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10279 Move to lisp.h.
10280 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10281 (overrun_check_realloc, overrun_check_free):
10282 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10283 That way, xmalloc returns a properly-aligned pointer even if
10284 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10285 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10286 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10287 into account when calculating the initial malloc maximum.
10288 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10289 Move here from alloc.c, so that charset.c can use it too.
10290 Properly align; the old code wasn't right for common 32-bit hosts
10291 when configured with --enable-checking=all.
10292 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10293 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10294
10295 2011-09-29 Eli Zaretskii <eliz@gnu.org>
10296
10297 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10298 use EDOM.
10299
10300 2011-09-28 Eli Zaretskii <eliz@gnu.org>
10301
10302 * xdisp.c (compute_display_string_end): If there's no display
10303 string at CHARPOS, return -1.
10304
10305 * bidi.c (bidi_fetch_char): When compute_display_string_end
10306 returns a negative value, treat the character as a normal
10307 character not covered by a display string. (Bug#9624)
10308
10309 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
10310
10311 * lread.c (Fread_from_string): Fix typo in docstring.
10312
10313 2011-09-27 Eli Zaretskii <eliz@gnu.org>
10314
10315 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10316 newline, reseat the iterator instead of bidi-iterating there one
10317 character at a time. (Bug#9610)
10318 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10319 TO_CHARPOS if the bidi iterator is at base embedding level.
10320
10321 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10322
10323 * lread.c (readevalloop): Use correct code for NBSP.
10324 (read1): Likewise. (Bug#9608)
10325
10326 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
10327
10328 * dbusbind.c (Fdbus_register_signal): When service is not
10329 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10330
10331 2011-09-25 Glenn Morris <rgm@gnu.org>
10332
10333 * buffer.c (truncate-lines): Doc fix.
10334
10335 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
10336
10337 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10338 (Fset_window_next_buffers): Doc fix.
10339
10340 2011-09-24 Glenn Morris <rgm@gnu.org>
10341
10342 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10343
10344 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10345
10346 Fix minor problems found by static checking.
10347 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10348 * indent.c (Fvertical_motion): Fix == vs = typo.
10349
10350 2011-09-24 Eli Zaretskii <eliz@gnu.org>
10351
10352 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10353 Default value is now t. Doc fix.
10354
10355 * indent.c (Fvertical_motion): Compute and apply the overshoot
10356 logic when moving up, not only when moving down. Fix the
10357 confusing name and values of the it_overshoot_expected variable;
10358 logic changes accordingly. (Bug#9254) (Bug#9549)
10359
10360 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10361 CHARPOS is covered by a display string which includes newlines.
10362 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10363 is covered by a display string with embedded newlines.
10364
10365 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
10366
10367 * dbusbind.c (Fdbus_register_signal): Add match rule to
10368 Vdbus_registered_objects_table. (Bug#9581)
10369 (Fdbus_register_method, Vdbus_registered_objects_table):
10370 Fix docstring.
10371
10372 2011-09-24 Jim Meyering <meyering@redhat.com>
10373
10374 do not ignore write error for any output size
10375 The previous change was incomplete.
10376 While it makes emacs --batch detect the vast majority of stdout
10377 write failures, errors were still ignored whenever the output size is
10378 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10379 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10380 && echo FAIL: ignored write error
10381 FAIL: ignored write error
10382 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10383 && echo FAIL: ignored write error
10384 FAIL: ignored write error
10385 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10386
10387 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10388
10389 * emacs.c (Fkill_emacs): In noninteractive mode exit
10390 non-successfully if a write error occurred on stdout. (Bug#9574)
10391
10392 2011-09-21 Eli Zaretskii <eliz@gnu.org>
10393
10394 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10395 the xassert test.
10396
10397 * dispextern.h (struct it): Update the comment documenting what
10398 can it->OBJECT be.
10399
10400 2011-09-20 Eli Zaretskii <eliz@gnu.org>
10401
10402 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10403 a display string, extend search for cursor position to end of row.
10404 (find_row_edges): If the row ends in a newline from a display
10405 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10406 Handle the case of a display string with multiple newlines.
10407 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10408 non-empty line. Fixes confusing cursor motion with arrow keys at
10409 the beginning of a line that starts with whitespace.
10410
10411 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10412
10413 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10414 (bug#9493).
10415
10416 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
10417
10418 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10419 boolean (Bug#9154).
10420
10421 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10422
10423 * xdisp.c (display_line): Record maximum and minimum buffer
10424 positions even if no glyphs were produced (e.g., by a zero-width
10425 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10426 buffer positions that will be removed from the glyph row because
10427 they don't fit.
10428 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10429 column is beyond frame width: don't subtract 1 "pixel" when
10430 computing width of the stretch.
10431 (reseat_at_next_visible_line_start): Undo the change made on
10432 2011-09-17 that saved paragraph information and restored it after
10433 the call to `reseat'. (Bug#9545)
10434
10435 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10436
10437 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10438 and turn window cursor on if cleared (Bug#9415).
10439
10440 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10441
10442 * search.c (boyer_moore): Take unibyte characters from pattern
10443 literally. (Bug#9458)
10444
10445 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10446
10447 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10448
10449 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10450
10451 Fix minor problem found by static checking.
10452 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10453 initialized, to pacify gcc -Wuninitialized.
10454
10455 * fileio.c: Report proper errno when syscall falls.
10456 (Finsert_file_contents): Save and restore errno,
10457 so that report_file_error outputs the correct diagnostic.
10458 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10459
10460 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10461
10462 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10463
10464 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10465
10466 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10467 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10468
10469 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10470
10471 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10472 about the current paragraph and restore it after the call to reseat.
10473
10474 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10475 (bidi_find_paragraph_start): Search back for paragraph beginning
10476 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10477 (bidi_move_to_visually_next): Only trigger paragraph-related
10478 computations when the last character is a newline or at EOB, not
10479 just any NEUTRAL_B. (Bug#9470)
10480
10481 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10482 truncated lines if point is covered by a display string. (Bug#9524)
10483
10484 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10485
10486 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10487 (cons_to_x_long): New function.
10488 (lisp_data_to_selection_data): Use it. Correct the test for
10489 short-versus-long data; it was negated. Break out of vector
10490 loop, for efficiency, when a long datum is discovered.
10491
10492 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10493
10494 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10495
10496 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10497
10498 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10499 GCC PR/17406) by declaring this function with external scope.
10500
10501 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10502
10503 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10504 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10505
10506 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10507
10508 * editfns.c (Fformat): Correctly handle text properties on "%%".
10509
10510 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10511
10512 * xterm.c (x_draw_composite_glyph_string_foreground):
10513 * w32term.c (x_draw_composite_glyph_string_foreground):
10514 * term.c (encode_terminal_code):
10515 * composite.c (composition_update_it, get_composition_id):
10516 * xdisp.c (get_next_display_element)
10517 (fill_composite_glyph_string): Add comments about special meaning
10518 of TAB characters in a composition.
10519
10520 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10521
10522 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10523 This occurs when processing a multibyte format.
10524 Problem reported by Wolfgang Jenker.
10525
10526 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10527
10528 * xdisp.c (try_cursor_movement): Only check for exact match if
10529 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10530
10531 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10532
10533 Remove unused external symbols.
10534 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10535 * xdisp.c (calc_pixel_width_or_height): Now static.
10536 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10537 * indent.c (check_display_width):
10538 * w32term.c: Fix comment to match code.
10539 * xterm.c, xterm.h (x_catching_errors): Remove.
10540
10541 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10542
10543 * xselect.c: Use signed conversions more consistently (Bug#9498).
10544 (selection_data_to_lisp_data): Assume incoming selection data are
10545 signed integers, not unsigned. This is to be consistent with
10546 outgoing selection data, which was modified to use signed integers
10547 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10548 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10549 expects long, not unsigned long.
10550
10551 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10552
10553 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10554 computation of loop end. Reported by Johan Bockgård
10555 <bojohan@gnu.org>.
10556
10557 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10558
10559 * frame.c (Fother_visible_frames_p): Function deleted.
10560
10561 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10562
10563 * indent.c (compute_motion): Process display vector front to back
10564 rather than the other way around. (Bug#2496)
10565
10566 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10567
10568 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10569
10570 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10571
10572 * minibuf.c (Fread_from_minibuffer): Doc fix.
10573
10574 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10575
10576 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10577 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10578
10579 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10580
10581 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10582 value for non-existent files.
10583
10584 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10585
10586 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10587 set its "size" to -1. This will set the modtime_size field of
10588 the corresponding buffer to -1, which is what
10589 verify-visited-file-modtime expects for files that do not exist.
10590 (Bug#9139)
10591
10592 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10593
10594 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10595 here ...
10596 * lisp.h: ... from here. push_key_description is no longer
10597 defined in keyboard.c, so its declaration should not be in
10598 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10599 logically belongs with push_key_description.
10600
10601 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10602
10603 * buffer.h: Include <sys/types.h> instead of <time.h>.
10604 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10605 Problem reported by Herbert J. Skuhra.
10606
10607 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10608
10609 * xml.c (parse_region): Make the parsing work for
10610 non-comment-starting XML files again (bug#9144).
10611
10612 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10613
10614 * image.c (gif_load): Fix calculation of bottom and right corner.
10615 (Bug#9468)
10616
10617 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10618
10619 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10620 redisplay in small windows.
10621
10622 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10623
10624 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10625
10626 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10627
10628 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10629 Operate on live windows only.
10630
10631 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10632
10633 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10634
10635 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10636
10637 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10638 only under bidi iteration.
10639
10640 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10641
10642 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10643
10644 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10645
10646 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10647 Without this fix, the command to link temacs failed due to an
10648 undefined symbol __builtin_isnan. This is because
10649 /usr/include/iso/math_c99.h #defines isnan(x) to
10650 __builtin_isnan(x), but the bundled gcc, which identifies itself
10651 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10652 a __builtin_isnan.
10653 * floatfns.c (isnan): #undef, and then #define to a clone of
10654 what's in data.c.
10655 (Fisnan): Always define, since it's always available now.
10656 (syms_of_floatfns): Always define isnan at the Lisp level.
10657
10658 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10659
10660 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10661
10662 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10663
10664 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10665 The previous code assumed that file offsets (off_t values) fit in
10666 EMACS_INT variables, which is not true on typical 32-bit hosts.
10667 The code messed up by falsely reporting buffer overflow in cases
10668 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10669 when "big" contains more than 2**29 bytes, even though this
10670 inserts just one byte and does not overflow the buffer.
10671 (Finsert_file_contents): Store file offsets as off_t
10672 values, not as EMACS_INT values. Check for overflow when
10673 converting between EMACS_INT and off_t. When checking for
10674 buffer overflow or for overlap, take the offsets into account.
10675 Don't use EMACS_INT for small values where int suffices.
10676 When checking for overlap, fix a typo: ZV was used where
10677 ZV_BYTE was intended.
10678 (Fwrite_region): Don't assume off_t fits into 'long'.
10679 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10680
10681 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10682
10683 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10684
10685 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10686
10687 sprintf-related integer and memory overflow issues (Bug#9412).
10688
10689 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10690 (esprintf, exprintf, evxprintf): New functions.
10691 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10692 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10693 (modify_event_symbol): Do not assume that the length of
10694 name_alist_or_stem is safe to alloca and fits in int.
10695 (Fexecute_extended_command): Likewise for function name and binding.
10696 (Frecursion_depth): Wrap around reliably on integer overflow.
10697 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10698 since some callers pass EMACS_INT values.
10699 (Fsingle_key_description): Don't crash if symbol name contains more
10700 than MAX_ALLOCA bytes.
10701 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10702 (get_minibuffer): Arg is now EMACS_INT, not int.
10703 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10704 (esprintf, exprintf, evxprintf): New decls.
10705 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10706
10707 * dbusbind.c (signature_cat): New function.
10708 (xd_signature, Fdbus_register_signal):
10709 Do not overrun buffer; instead, report string overflow.
10710
10711 * dispnew.c (add_window_display_history): Don't overrun buffer.
10712 Truncate instead; this is OK since it's just a log.
10713
10714 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10715 even if the time zone offset is outlandishly large.
10716 Don't mishandle offset == INT_MIN.
10717
10718 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10719 when creating daemon; the previous buffer-overflow check was incorrect.
10720
10721 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10722 which has the guts of the old verror function.
10723
10724 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10725 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10726
10727 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10728 (font_unparse_xlfd): Don't blindly alloca long strings.
10729 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10730 fits in int, when using sprintf. Use single snprintf to count
10731 length of string rather than counting it via multiple sprintfs;
10732 that's simpler and more reliable.
10733 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10734 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10735 sprintf, in case result does not fit in int.
10736
10737 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10738 (fontset_from_font): Print it.
10739
10740 * frame.c (tty_frame_count): Now printmax_t, not int.
10741 (make_terminal_frame, set_term_frame_name): Print it.
10742 (x_report_frame_params): In X, window IDs are unsigned long,
10743 not signed long, so print them as unsigned.
10744 (validate_x_resource_name): Check for implausibly long names,
10745 and don't assume name length fits in 'int'.
10746 (x_get_resource_string): Don't blindly alloca invocation name;
10747 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10748 not fit in int.
10749
10750 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10751 (xg_check_special_colors, xg_set_geometry):
10752 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10753
10754 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10755 Use esprintf, not sprintf, in case result does not fit in int.
10756
10757 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10758 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10759 it as a large positive number.
10760 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10761 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10762
10763 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10764 in case result does not fit in int.
10765
10766 * print.c (float_to_string): Detect width overflow more reliably.
10767 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10768 buffer overrun. Don't assume list length fits in 'int'. Treat
10769 print length of 0 as 0, not as infinity; to be consistent with other
10770 uses of print length in this function. Don't overflow print length
10771 index. Don't assume hash table size fits in 'long', or that
10772 vectorlike size fits in 'unsigned long'.
10773
10774 * process.c (make_process): Use printmax_t, not int, to format
10775 process-name gensyms.
10776
10777 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10778
10779 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10780 to avoid potential buffer overrun.
10781
10782 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10783 if X resource line is longer than 512 bytes.
10784
10785 * xfns.c (x_window): Make sprintf buffer a bit bigger
10786 to avoid potential buffer overrun.
10787
10788 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10789
10790 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10791
10792 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10793
10794 Integer overflow fixes for scrolling, etc.
10795 Without these, Emacs silently mishandles large integers sometimes.
10796 For example, "C-u 4294967297 M-x recenter" was treated as if
10797 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10798
10799 * xdisp.c (try_window_id): Check Emacs fixnum range before
10800 converting to 'int'.
10801
10802 * window.c (window_scroll_line_based, Frecenter):
10803 Check that an Emacs fixnum is in range before assigning it to 'int'.
10804 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10805 values converted from Emacs fixnums.
10806 (Frecenter): Don't wrap around a line count if it is out of 'int'
10807 range; instead, treat it as an extreme value.
10808 (Fset_window_configuration, compare_window_configurations):
10809 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10810
10811 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10812 that can exceed INT_MAX. Check that EMACS_INT value is in range
10813 before assigning it to the (possibly-narrower) index.
10814 (match_limit): Don't assume that a fixnum can fit in 'int'.
10815
10816 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10817 exceed INT_MAX.
10818
10819 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10820 (Fvertical_motion): Don't wrap around LINES values that don't fit
10821 in 'int'. Instead, treat them as extreme values. This is good
10822 enough for windows, which can't have more than INT_MAX lines anyway.
10823
10824 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10825
10826 * Require libxml/parser.h to avoid compilation warning.
10827
10828 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10829
10830 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10831 since this reportedly can destroy thread storage.
10832
10833 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10834
10835 * syntax.c (find_defun_start): Update all cache variables if
10836 exiting early (Bug#9401).
10837
10838 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10839
10840 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10841
10842 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10843 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10844 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10845
10846 * term.c (tty_append_glyph): New function.
10847 (produce_stretch_glyph): Static function and its prototype deleted.
10848
10849 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10850 Add prototypes.
10851
10852 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10853
10854 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10855 when checking :margin (Bug#9390).
10856 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10857 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10858 so that the name doesn't mislead. All uses changed.
10859
10860 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10861
10862 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10863 set_tty_hooks.
10864
10865 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10866
10867 * xdisp.c (move_it_to): Don't bail out early when reaching
10868 position beyond to_charpos, if we are scanning backwards.
10869 (move_it_vertically_backward): When DY == 0, make sure we get to
10870 the first character in the line after the newline.
10871
10872 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10873
10874 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10875 (ccl_driver): Do not generate an out-of-range pointer.
10876 (Fccl_execute_on_string): Remove unnecessary check for
10877 integer overflow, noted by Stefan Monnier in
10878 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10879 Remove a FIXME that didn't need fixing.
10880 Simplify the newly-introduced buffer reallocation code.
10881
10882 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10883
10884 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10885
10886 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10887
10888 Integer and memory overflow issues (Bug#9196).
10889
10890 * doc.c (get_doc_string): Rework so that
10891 get_doc_string_buffer_size is the actual buffer size, rather than
10892 being 1 less than the actual buffer size; this makes xpalloc more
10893 convenient.
10894
10895 * image.c (x_allocate_bitmap_record, cache_image):
10896 * xselect.c (Fx_register_dnd_atom):
10897 Simplify previous changes by using xpalloc.
10898
10899 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10900 since either will do and ptrdiff_t is convenient with xpalloc.
10901
10902 * charset.c (charset_table_size)
10903 (struct charset_sort_data.priority): Now ptrdiff_t.
10904 (charset_compare): Don't overflow if priorities differ greatly.
10905 (Fsort_charsets): Don't assume list length fits in int.
10906 Check for size-calculation overflow when allocating sort data.
10907 (syms_of_charset): Allocate an initial charset table that is
10908 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10909
10910 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10911
10912 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10913 The actual value is always <= INT_MAX, and leaving it unsigned made
10914 overflow checking harder.
10915
10916 * dispextern.h (struct glyph_matrix.rows_allocated)
10917 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10918 with xpalloc. The values are still always <= INT_MAX.
10919
10920 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10921
10922 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10923 (SAFE_NALLOCA): New macro.
10924
10925 * region-cache.c (struct boundary.pos, find_cache_boundary)
10926 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10927 (set_cache_region, invalidate_region_cache)
10928 (revalidate_region_cache, know_region_cache, region_cache_forward)
10929 (region_cache_backward, pp_cache):
10930 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10931 so that ptrdiff_t * can be passed to xpalloc.
10932 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10933 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10934 (pp_cache): Don't assume cache_len fits in int.
10935 * region-cache.h: Adjust extern decls to match.
10936
10937 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10938 EMACS_INT, since either will do, for xpalloc.
10939
10940 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10941 (xnmalloc, xnrealloc, xpalloc): New functions.
10942
10943 * bidi.c (bidi_shelve_header_size): New constant.
10944 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10945 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10946
10947 * bidi.c (bidi_cache_shrink):
10948 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10949 (overlay_strings):
10950 Don't update size of array until after memory allocation succeeds,
10951 because xmalloc/xrealloc may not return.
10952 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10953 now that we have proper integer overflow checking.
10954 (record_overlay_string, overlay_strings): Catch overflows when
10955 calculating size of overlay_str_buf.
10956
10957 * callproc.c (Fcall_process): Check for size overflow when
10958 calculating size of args2.
10959 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10960 Normally we prefer signed values, but sticking with ptrdiff_t would
10961 require adding more-complicated checks.
10962
10963 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10964 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10965 Redo buffer-overflow calculations to avoid integer overflow.
10966 Add a FIXME comment where memory seems to be over-allocated.
10967
10968 * character.c (Fstring): Check for size-calculation overflow.
10969
10970 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10971 unnecessary integer overflow. Check for size overflow.
10972 (encode_coding_object): Don't update size until xmalloc succeeds.
10973
10974 * composite.c (get_composition_id): Check for overflow in glyph
10975 length calculations.
10976
10977 Integer and memory overflow fixes for display code.
10978 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10979 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10980 (scrolling_window): Check for overflow in size calculations.
10981 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10982 Don't assume glyph table len fits in int.
10983 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10984 (row_table_size): Now ptrdiff_t, not int.
10985 (scrolling_window): Avoid overflow in size calculations.
10986 Don't update size until allocation succeeds.
10987 * fns.c (concat): Check for overflow in size calculations.
10988 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10989 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10990 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10991
10992 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10993 (get_doc_string): Check for size calculation overflow.
10994 Don't update size until allocation succeeds.
10995 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10996 EMACS_INT, where ptrdiff_t will do.
10997 (Fsubstitute_command_keys): Check for string overflow.
10998
10999 * editfns.c (set_time_zone_rule): Don't assume environment length
11000 fits in int.
11001 (message_length): Now ptrdiff_t, not int.
11002 (Fmessage_box): Don't update size until allocation succeeds.
11003 Don't assume message length fits in int.
11004 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11005
11006 * emacs.c (main): Do not reallocate argv, since there is a null at
11007 the end that can be overwritten, and this way there's no need to
11008 worry about size-calculation overflow.
11009 (sort_args): Check for size-calculation overflow.
11010
11011 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11012 alloc succeeds.
11013 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11014
11015 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11016 (x_set_scroll_bar_width, x_figure_window_size):
11017 Check for integer overflow.
11018 (x_set_alpha): Do not assume XINT fits in int.
11019
11020 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11021 This is for the members text_lines, text_cols, total_lines, total_cols,
11022 where the system imposes an 'int' limit.
11023
11024 * fringe.c (Fdefine_fringe_bitmap):
11025 Don't update size until alloc works.
11026
11027 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11028 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11029
11030 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11031 Check for size-calculation overflow.
11032 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11033 do, as we prefer signed integers.
11034 (id_to_widget.max_size, id_to_widget.used)
11035 (xg_store_widget_in_map, xg_remove_widget_from_map)
11036 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11037 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11038 Use and return ptrdiff_t, not int.
11039 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11040 * gtkutil.h: Change prototypes to match the above.
11041
11042 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11043 are duplicate now that they've been promoted to lisp.h.
11044 (x_allocate_bitmap_record, x_alloc_image_color)
11045 (make_image_cache, cache_image, xpm_load):
11046 Don't update size until alloc is done.
11047 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11048 (x_detect_edges):
11049 Check for size calculation overflow.
11050 (ct_colors_allocated_max): New constant.
11051 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11052 overflow.
11053
11054 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11055 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11056 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11057 Use ptrdiff_t, not int, to count maps.
11058 (read_char_minibuf_menu_prompt): Check for overflow in size
11059 calculations. Don't update size until allocation succeeds.
11060 Redo calculations to avoid overflow.
11061 * keyboard.h: Change prototypes to match the above.
11062
11063 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11064 to count maps.
11065 (current_minor_maps): Check for size calculation overflow.
11066 * keymap.h: Change prototypes to match the above.
11067
11068 * lread.c (read1, init_obarray): Don't update size until alloc done.
11069
11070 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11071 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11072
11073 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11074 Now ptrdiff_t, not int.
11075 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11076 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11077
11078 * process.c (Fnetwork_interface_list): Check for overflow
11079 in size calculation.
11080
11081 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11082
11083 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11084 overflow. Don't bother calling xmalloc when xrealloc will do.
11085
11086 * search.c (Freplace_match): Check for size calculation overflow.
11087 (Fset_match_data): Don't assume list lengths fit in 'int'.
11088
11089 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11090 for command line length. Do not attempt to address one before the
11091 beginning of an array, as that's not portable.
11092
11093 * term.c (max_frame_lines): Remove; unused.
11094 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11095 not int.
11096 (encode_terminal_code, calculate_costs): Check for size
11097 calculation overflow.
11098 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11099 table lengths and related sizes. Don't update size until alloc
11100 done. Redo calculations to avoid overflow.
11101 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11102
11103 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11104 subtracting pointers.
11105 (gobble_line): Check for overflow more carefully. Don't update size
11106 until alloc done.
11107
11108 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11109 Don't update size until alloc done.
11110 Redo size calculations to avoid overflow.
11111 Check for size calculation overflow.
11112 (main) [DEBUG]: Fix typo in invoking tparam1.
11113
11114 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11115 Use ptrdiff_t, not int, for sizes.
11116 (store_mode_line_noprop_char): Don't update size until alloc done.
11117
11118 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11119 Use ptrdiff_t, not int, for sizes.
11120 (Finternal_make_lisp_face, cache_face):
11121 Check for size calculation overflow.
11122 (cache_face): Treat size calculation overflows as if they were
11123 memory exhaustion (the usual treatment), rather than aborting.
11124
11125 * xfns.c (x_encode_text, x_set_name_internal)
11126 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11127 sizes, since they can exceed INT_MAX in size. Check for size
11128 calculation overflow.
11129
11130 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11131 (xg_select): Check for size calculation overflow.
11132 Don't update size until alloc done.
11133
11134 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11135 as sprintf is limited to int lengths.
11136
11137 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11138 (X_LONG_MIN): New macros.
11139 Use them to make the following changes clearer.
11140 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11141 This change doesn't affect the value now, but it may help remind
11142 future maintainers not to raise the value too much later.
11143 (SELECTION_QUANTUM): Remove, replacing with ...
11144 (selection_quantum): ... new function, which avoids overflow.
11145 All uses changed.
11146 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11147 assumption that selection length fits in 'int'.
11148 (x_reply_selection_request, x_handle_selection_request)
11149 (x_get_window_property, receive_incremental_selection)
11150 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11151 (lisp_data_to_selection_data, clean_local_selection_data):
11152 Use ptrdiff_t, not int, to record length of selection.
11153 (x_reply_selection_request, x_get_window_property)
11154 (receive_incremental_selection, x_property_data_to_lisp):
11155 Redo calculations to avoid overflow.
11156 (x_reply_selection_request): When sending hint, ceiling it at
11157 X_LONG_MAX rather than relying on wraparound overflow to send
11158 something.
11159 (x_get_window_property, receive_incremental_selection)
11160 (lisp_data_to_selection_data, x_property_data_to_lisp):
11161 Check for size-calculation overflow.
11162 (x_get_window_property, receive_incremental_selection)
11163 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11164 Don't store size until memory allocation succeeds.
11165 (x_get_window_property): Plug memory leak on memory exhaustion.
11166 Don't double-block input; malloc is safe here. Don't assume 2**34
11167 - 4 fits in unsigned long. Add an xassert to check
11168 XGetWindowProperty overflow. Be more careful about overflow
11169 calculations, and distinguish size from memory overflow better.
11170 (receive_incremental_selection): When tracing, don't assume
11171 unsigned int is less than INT_MAX.
11172 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11173 harmful) conversions of unsigned short to int.
11174 (lisp_data_to_selection_data): Don't assume that integers
11175 in the range -65535 through -1 fit in an X unsigned short.
11176 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11177 result parameters unless successful. Rely on cons_to_unsigned
11178 to report problems with elements; the old code wasn't right anyway.
11179 (x_check_property_data): Check for int overflow; we cannot use
11180 a wider type due to X limits.
11181 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11182
11183 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11184
11185 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11186 (x_term_init): Check for size calculation overflow.
11187 (x_color_cells): Don't store size until memory allocation succeeds.
11188 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11189 Don't assume alloca size is less than MAX_ALLOCA.
11190 (x_term_init): Don't assume length fits in int (sprintf is limited
11191 to int size).
11192
11193 Use ptrdiff_t for composition IDs.
11194 * character.c (lisp_string_width):
11195 * composite.c (composition_table_size, n_compositions)
11196 (get_composition_id, composition_gstring_from_id):
11197 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11198 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11199 * window.c (Frecenter):
11200 Use ptrdiff_t, not int, for composition IDs.
11201 * composite.c (get_composition_id): Check for integer overflow.
11202 * composite.h: Adjust prototypes to match the above changes.
11203
11204 Use ptrdiff_t for hash table indexes.
11205 * category.c (hash_get_category_set):
11206 * ccl.c (ccl_driver):
11207 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11208 * coding.c (coding_system_charset_list, detect_coding_system):
11209 * coding.h (struct coding_system.id):
11210 * composite.c (get_composition_id, gstring_lookup_cache):
11211 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11212 * image.c (xpm_get_color_table_h):
11213 * lisp.h (hash_lookup, hash_put):
11214 * minibuf.c (Ftest_completion):
11215 Use ptrdiff_t for hash table indexes, not int (which is too
11216 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11217 32-bit --with-wide-int hosts).
11218
11219 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11220 Add a FIXME comment about memory leaks.
11221 (syms_of_charset): Don't assume xmalloc returns.
11222
11223 Don't assume that stated character widths fit in int.
11224 * character.c (Fchar_width, c_string_width, lisp_string_width):
11225 * character.h (CHAR_WIDTH):
11226 * indent.c (MULTIBYTE_BYTES_WIDTH):
11227 Use sanitize_char_width to avoid undefined and/or bad behavior
11228 with outlandish widths.
11229 * character.h (sanitize_tab_width): Rename from sanitize_width,
11230 now that we have two such functions. All uses changed.
11231 (sanitize_char_width): New inline function.
11232
11233 Don't assume that tab-width fits in int.
11234 * character.h (sanitize_width): New inline function.
11235 (SANE_TAB_WIDTH): New macro.
11236 (ASCII_CHAR_WIDTH): Use it.
11237 * indent.c (sane_tab_width): Remove. All uses replaced by
11238 SANE_TAB_WIDTH (current_buffer).
11239 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11240
11241 * fileio.c: Integer overflow issues with file modes.
11242 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11243
11244 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11245 Remove unreachable code.
11246 (read_hex, load_charset_map_from_file): Check for integer overflow.
11247
11248 * xterm.c: Don't go over XClientMessageEvent limit.
11249 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11250 (x_send_scroll_bar_event): Likewise. Check that the size does not
11251 exceed limits imposed by XClientMessageEvent, as well as the usual
11252 ptrdiff_t and size_t limits.
11253
11254 * keyboard.c: Overflow, signedness and related fixes.
11255 (make_lispy_movement): Use same integer type in forward decl
11256 that is used in the definition.
11257 (read_key_sequence, keyremap_step):
11258 Change bufsize argument back to int, undoing my 2011-03-30 change.
11259 We prefer signed types, and int is wide enough here.
11260 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11261 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11262 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11263 length, not size_t. Use ptrdiff_t for index, not int.
11264 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11265 possibility of integer overflow.
11266
11267 Overflow, signedness and related fixes for images.
11268
11269 * dispextern.h (struct it.stack[0].u.image.image_id)
11270 (struct_it.image_id, struct image.id, struct image_cache.size)
11271 (struct image_cache.used, struct image_cache.ref_count):
11272 * gtkutil.c (update_frame_tool_bar):
11273 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11274 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11275 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11276 * nsmenu.m (update_frame_tool_bar):
11277 * xdisp.c (calc_pixel_width_or_height):
11278 * xfns.c (image_cache_refcount):
11279 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11280 on typical 64-bit hosts.
11281
11282 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11283 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11284 Omit unnecessary casts to int.
11285 (parse_image_spec): Check that integers fall into 'int' range
11286 when the callers expect that.
11287 (image_ascent): Redo ascent calculation to avoid int overflow.
11288 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11289 (lookup_image): Remove unnecessary tests.
11290 (xbm_image_p): Locals are now of int, not EMACS_INT,
11291 since parse_image_check makes sure they fit into int.
11292 (png_load, gif_load, svg_load_image):
11293 Prefer int to unsigned where either will do.
11294 (tiff_handler): New function, combining the cores of the
11295 old tiff_error_handler and tiff_warning_handler.
11296 This function is rewritten to use vsnprintf and thereby avoid
11297 stack buffer overflows. It uses only the features of vsnprintf
11298 that are common to both POSIX and native Microsoft.
11299 (tiff_error_handler, tiff_warning_handler): Use it.
11300 (tiff_load, gif_load, imagemagick_load_image):
11301 Don't assume :index value fits in 'int'.
11302 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11303 (imagemagick_load_image): Check that crop parameters fit into
11304 the integer types that MagickCropImage accepts. Don't assume
11305 Vimagemagick_render_type has a nonnegative value. Don't assume
11306 size_t fits in 'long'.
11307 (gs_load): Use printmax_t to print the widest integers possible.
11308 Check for integer overflow when computing image height and width.
11309
11310 2011-08-26 Eli Zaretskii <eliz@gnu.org>
11311
11312 * xdisp.c (redisplay_window): Don't force window start if point
11313 will be invisible in the resulting window. (Bug#9324)
11314
11315 2011-08-25 Eli Zaretskii <eliz@gnu.org>
11316
11317 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11318 the display spec is of the form `(space ...)'.
11319 (handle_display_spec): Return the value returned by
11320 handle_single_display_spec, not just 1 or zero.
11321 (handle_single_display_spec): If the display spec is of the form
11322 `(space ...)', and specifies display in the text area, return 2
11323 rather than 1.
11324 (try_cursor_movement): Check for the need to scroll more
11325 accurately, and prefer exact match for point under bidi.
11326 Don't advance `row' beyond the last row of the window.
11327
11328 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11329 into disp_prop; all users changed.
11330
11331 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11332 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11333 for the text covered by the display property.
11334
11335 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
11336
11337 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11338 Change return value to nil.
11339 (Frecord_buffer): Delete unused function.
11340
11341 2011-08-24 Eli Zaretskii <eliz@gnu.org>
11342
11343 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11344 buffers, return left-to-right.
11345 (set_cursor_from_row): Consider candidate row a win if its glyph
11346 represents a newline and point is on that newline. Fixes cursor
11347 positioning on the newline at EOL of R2L text within L2R
11348 paragraph, and vice versa.
11349 (try_cursor_movement): Check continued rows, in addition to
11350 continuation rows. Fixes unwarranted scroll when point enters a
11351 continued line of R2L text within an L2R paragraph, or vice versa.
11352 (cursor_row_p): Consider the case of point being equal to
11353 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11354 from the end of a short line to the beginning of a continued line
11355 of R2L text within L2R paragraph.
11356 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11357 composed characters.
11358
11359 * bidi.c (bidi_check_type): Use xassert.
11360 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11361 members.
11362
11363 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11364
11365 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11366 a character.
11367
11368 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
11369
11370 * nsfont.m (ns_otf_to_script): Fix typo.
11371
11372 2011-08-22 Kenichi Handa <handa@m17n.org>
11373
11374 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11375 extra slot even if the purpose is char-code-property-table.
11376
11377 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11378
11379 * xdisp.c (redisplay_window): When computing centering_position,
11380 account for the height of the header line. (Bug#8874)
11381
11382 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11383 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11384 candidate is selected by the mouse, and that candidate has a
11385 composed character under the mouse.
11386
11387 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11388 coordinates reported by pos-visible-in-window-p for a composed
11389 character in column zero.
11390
11391 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11392
11393 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11394
11395 2011-08-22 Eli Zaretskii <eliz@gnu.org>
11396
11397 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11398 consider it a hit if to_charpos is anywhere in the range of the
11399 composed buffer positions.
11400
11401 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
11402
11403 * image.c (gif_load): Don't assume that each subimage has the same
11404 dimensions as the base image. Handle disposal method that is
11405 "undefined" by the gif spec (Bug#9335).
11406
11407 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
11408
11409 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11410 (Fcondition_case): Document `debug' symbol in error handler.
11411
11412 2011-08-19 Eli Zaretskii <eliz@gnu.org>
11413
11414 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11415 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11416 from an Org mode buffer to a Speedbar frame.
11417
11418 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11419 a composition, take its buffer position from IT->cmp_it.charpos.
11420 Fixes cursor positioning at the beginning of a line that begins
11421 with a composed character.
11422
11423 2011-08-18 Eli Zaretskii <eliz@gnu.org>
11424
11425 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11426 character bidirectional type, use STRONG_L instead. Fixes crashes
11427 in a buffer produced by `describe-categories'.
11428
11429 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11430 members before the level stack, so they would be saved and
11431 restored when copying iterator state. Fixes incorrect reordering
11432 around TABs covered by display properties.
11433
11434 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11435
11436 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11437
11438 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
11439
11440 * eval.c (internal_condition_case, internal_condition_case_1)
11441 (internal_condition_case_2, internal_condition_case_n):
11442 Remove unnecessary aborts (Bug#9081).
11443
11444 2011-08-17 Eli Zaretskii <eliz@gnu.org>
11445
11446 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11447 has no `load' handler, try opening the file locally. (Bug#9311)
11448
11449 2011-08-16 Ken Brown <kbrown@cornell.edu>
11450
11451 * gmalloc.c: Expand comment.
11452
11453 2011-08-16 Eli Zaretskii <eliz@gnu.org>
11454
11455 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11456 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11457
11458 2011-08-16 Ken Brown <kbrown@cornell.edu>
11459
11460 Fix memory allocation problems in Cygwin build (Bug#9273).
11461
11462 * unexcw.c ( __malloc_initialized): Declare external variable.
11463 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11464
11465 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11466 New variables.
11467 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11468 dumped emacs.
11469 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11470 in the static heap.
11471 [CYGWIN] (special_realloc): New function.
11472 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11473 requests to realloc storage in the static heap.
11474
11475 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11476
11477 * bidi.c (bidi_initialize): Remove unused local.
11478
11479 2011-08-15 Eli Zaretskii <eliz@gnu.org>
11480
11481 * bidimirror.h:
11482 * biditype.h: Remove file.
11483 * makefile.w32-in ($(BLD)/bidi.$(O)):
11484 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11485
11486 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11487
11488 * chartab.c: Improve commentary for the uniprop_table API.
11489
11490 * bidi.c (bidi_paragraph_init): Support zero value of
11491 bidi_ignore_explicit_marks_for_paragraph_level.
11492 (bidi_initialize): Use uniprop_table instead of including
11493 biditype.h and bidimirror.h.
11494
11495 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11496 coordinates of the iterator when restoring from ppos_it.
11497 (Bug#9296)
11498
11499 2011-08-14 Kenichi Handa <handa@m17n.org>
11500
11501 * process.c (create_process): Call setup_process_coding_systems
11502 after the pid of the process is set to -1 (Bug#8162).
11503
11504 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11505
11506 * xdisp.c (move_it_in_display_line_to): Don't invoke
11507 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11508 ppos_it. Fixes vertical cursor motion when line beginning is
11509 covered by an image. (Bug#9296)
11510
11511 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11512
11513 * nsterm.h (ns_run_ascript): Declare.
11514 (NSAPP_DATA2_RUNASSCRIPT): Define.
11515
11516 * nsfns.m (as_script, as_result, as_status): New static variables.
11517 (ns_run_ascript): New function.
11518 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11519 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11520 the event loop. Get status from as_status (Bug#7276).
11521
11522 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11523 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11524 the event loop (Bug#7276).
11525
11526 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11527
11528 * gnutls.c (QCgnutls_bootprop_priority)
11529 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11530 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11531 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11532 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11533 (QCgnutls_bootprop_verify_hostname_error)
11534 (QCgnutls_bootprop_callbacks_verify): Rename from
11535 Qgnutls_bootprop_..., all uses changed.
11536
11537 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11538 uses changed.
11539
11540 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11541
11542 * xfaces.c (Qframe_set_background_mode): Now static.
11543 * dispextern.h (Qframe_set_background_mode): Remove decl.
11544
11545 * process.c (Fnetwork_interface_info): Declare local only if needed.
11546
11547 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11548
11549 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11550 (Fnetwork_interface_list): Allocate in increments of bytes instead
11551 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11552 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11553 sockaddr.
11554 (struct ifflag_def): notrailers is smart on OSX.
11555 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11556 Get hardware address with getifaddrs if available.
11557
11558 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11559
11560 * xdisp.c (iterate_out_of_display_property): xassert that
11561 IT->position is set to within IT->object's boundaries. Break from
11562 the loop as soon as EOB is reached; avoids infloops in redisplay
11563 when IT->position is set up wrongly due to some bug.
11564 Set IT->current to match the bidi iterator unconditionally.
11565 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11566 entry. Force push_it to save on the stack the current
11567 buffer/string position, to be restored by pop_it. Fix flags in
11568 the iterator structure wrt the object coming from a display
11569 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11570 properties. (Bug#9284)
11571
11572 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11573
11574 * fontset.c (fontset_get_font_group): Add proper type checks.
11575 (Bug#9172)
11576
11577 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11578
11579 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11580 and LC_VERSION_MIN_MACOSX.
11581 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11582 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11583
11584 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11585
11586 * xdisp.c (forward_to_next_line_start): Allow to use the
11587 no-display-properties-and-no-overlays under bidi display.
11588 Set disp_pos in the bidi iterator to avoid searches for display
11589 properties and overlays.
11590
11591 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11592
11593 * editfns.c (Fset_time_zone_rule): Document relationship with the
11594 setenv function.
11595
11596 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11597 the font entity extracted from the cache (Bug#8109).
11598
11599 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11600
11601 * composite.c (autocmp_chars): Don't reset point. That is done by
11602 restore_point_unwind (Bug#5984).
11603
11604 2011-08-07 Juri Linkov <juri@jurta.org>
11605
11606 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11607 to show the arg `TIME' instead of `TIMEVAL'.
11608
11609 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11610
11611 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11612 display property strides EOL and includes a newline, as in
11613 longlines-mode. (Bug#9254)
11614 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11615 word-wrap under bidirectional display. (Bug#9224)
11616
11617 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11618 is non-zero, even if the data buffer is NULL. Fixes a crash in
11619 vertical-motion with longlines-mode. (Bug#9254)
11620
11621 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11622
11623 * bidi.c <bidi_cache_total_alloc>: Now static.
11624 (bidi_initialize): Initialize bidi_cache_total_alloc.
11625
11626 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11627 cache. (Bug#9221)
11628
11629 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11630 amount allocated this far in `bidi_cache_total_alloc'.
11631 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11632 non-zero, only free the data buffer without restoring the cache
11633 contents. All callers changed.
11634
11635 * dispextern.h (bidi_unshelve_cache): Update prototype.
11636
11637 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11638 (move_it_in_display_line, move_it_to)
11639 (move_it_vertically_backward, move_it_by_lines): Replace the call
11640 to xfree to an equivalent call to bidi_unshelve_cache.
11641 (move_it_in_display_line_to): Fix logic of returning
11642 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11643
11644 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11645
11646 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11647 came from a string character with a `cursor' property. (Bug#9229)
11648
11649 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11650
11651 * Makefile.in (LIB_PTHREAD): New variable.
11652 (LIBES): Add LIB_PTHREAD (Bug#9216).
11653
11654 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11655 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11656
11657 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11658
11659 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11660
11661 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11662
11663 * xterm.c (x_find_topmost_parent): New function.
11664 (x_set_frame_alpha): Find topmost parent window with
11665 x_find_topmost_parent and set the property there also (bug#9181).
11666 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11667
11668 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11669
11670 * callproc.c (Fcall_process): Avoid vfork clobbering
11671 the local vars buffer, coding_systems, current_dir.
11672
11673 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11674
11675 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11676
11677 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11678
11679 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11680 so that it is not optimized away.
11681
11682 * xdisp.c (compute_display_string_pos): Remove unused local.
11683
11684 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11685
11686 Fix slow cursor motion and scrolling in large buffers with
11687 selective display, like Org Mode buffers. (Bug#9218)
11688
11689 * dispextern.h (struct bidi_it): New member disp_prop_p.
11690
11691 * xdisp.c: Remove one-slot cache of display string positions.
11692 (compute_display_string_pos): Accept an additional argument
11693 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11694 for a display string or property. If found, set DISP_PROP_P
11695 non-zero.
11696
11697 * bidi.c (bidi_fetch_char): Accept an additional argument
11698 DISP_PROP_P, and pass it to compute_display_string_pos.
11699 Only handle text covered by a display string if DISP_PROP_P is returned
11700 non-zero. All callers of bidi_fetch_char changed.
11701
11702 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11703
11704 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11705
11706 2010-12-03 Don March <don@ohspite.net>
11707
11708 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11709 last character M-[char] is translated to ESC [char] (bug#7541).
11710
11711 2011-08-02 Kenichi Handa <handa@m17n.org>
11712
11713 * lisp.h (uniprop_table): Extern it.
11714
11715 * chartab.c (uniprop_table): Make it non-static.
11716
11717 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11718
11719 * xdisp.c (forward_to_next_line_start): Accept additional argument
11720 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11721 on the newline.
11722 (reseat_at_next_visible_line_start): Use the bidi iterator state
11723 returned by forward_to_next_line_start to restore the state of
11724 it->bidi_it after backing up to previous newline. (Bug#9212)
11725
11726 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11727
11728 * regex.c (re_comp): Protoize.
11729 (re_exec): Fix return type.
11730 (regexec): Fix type of `ret'. (Bug#9203)
11731
11732 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11733
11734 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11735 This is needed if max-image-size is a floating-point number.
11736
11737 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11738
11739 * print.c (print_object): Print empty symbol as ##.
11740
11741 * lread.c (read1): Read ## as empty symbol.
11742
11743 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11744
11745 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11746 setting frame foreground color (Bug#9175).
11747 (x_set_background_color): Likewise.
11748
11749 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11750 contents (Bug#9176).
11751 (EmacsTooltip -init): Remove bezels and add shadows to
11752 tooltip windows.
11753
11754 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11755 or scroll bar (Bug#8470).
11756
11757 * nsfont.m (nsfont_open): Remove assignment to voffset and
11758 unnecessary vars hshink, expand, hd, full_height, min_height.
11759 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11760
11761 * nsterm.h (nsfont_info): Remove voffset field.
11762
11763 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11764
11765 Implement strike-through and overline on NextStep (Bug#8863).
11766
11767 * nsfont.m (nsfont_open): Use underline position provided by font,
11768 instead of hard-coded value of 2.
11769 (nsfont_draw): Call ns_draw_text_decoration instead.
11770
11771 * nsterm.h: Add declaration for ns_draw_text_decoration.
11772
11773 * nsterm.m (ns_draw_text_decoration): New function for drawing
11774 underline, overline, and strike-through.
11775 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11776 ns_draw_text_decoration. Change treatment of cursor drawing to
11777 accommodate underlining, etc.
11778
11779 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11780
11781 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11782 default.
11783
11784 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11785
11786 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11787 Without this fix, if a signal arrives just after memory fills up,
11788 'malloc' might be invoked reentrantly.
11789
11790 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11791 In other words, assume that every image size is allowed, on non-X
11792 hosts. This assumption is probably wrong, but it lets Emacs compile.
11793
11794 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11795
11796 * regex.c (re_iswctype): Convert return values to boolean.
11797
11798 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11799
11800 * xdisp.c (compute_display_string_pos): Don't use cached display
11801 string position if the buffer had its restriction changed.
11802 (Bug#9184)
11803
11804 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11805
11806 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11807
11808 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11809
11810 Integer signedness and overflow and related fixes. (Bug#9079)
11811
11812 * bidi.c: Integer size and overflow fixes.
11813 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11814 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11815 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11816 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11817 (bidi_find_other_level_edge):
11818 Use ptrdiff_t instead of EMACS_INT where either will do.
11819 This works better on 32-bit hosts configured --with-wide-int.
11820 (bidi_cache_ensure_space): Check for size-calculation overflow.
11821 Use % rather than repeated addition, for better worst-case speed.
11822 Don't set bidi_cache_size until after xrealloc returns, because it
11823 might not return.
11824 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11825 (bidi_cache_ensure_space): Also check that the bidi cache size
11826 does not exceed that of the largest Lisp string or buffer. See Eli
11827 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11828
11829 * alloc.c (__malloc_size_t): Remove.
11830 All uses replaced by size_t. See Andreas Schwab's note
11831 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11832
11833 * image.c: Improve checking for integer overflow.
11834 (check_image_size): Assume that f is nonnull, since
11835 it is always nonnull in practice. This is one less thing to
11836 worry about when checking for integer overflow later.
11837 (x_check_image_size): New function, which checks for integer
11838 overflow issues inside X.
11839 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11840 This removes the need for a memory_full check.
11841 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11842 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11843 (xbm_read_bitmap_data): Change locals back to 'int', since
11844 their values must fit in 'int'.
11845 (xpm_load_image, png_load, tiff_load):
11846 Invoke x_create_x_image_and_pixmap earlier,
11847 to avoid much needless work if the image is too large.
11848 (tiff_load): Treat overly large images as if
11849 x_create_x_image_and_pixmap failed, not as malloc failures.
11850 (gs_load): Use x_check_image_size.
11851
11852 * gtkutil.c: Omit integer casts.
11853 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11854 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11855
11856 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11857
11858 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11859 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11860 would wrongly return t on a 64-bit host.
11861
11862 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11863 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11864 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11865 and therefore cause GCC to emit a bogus diagnostic in some cases.
11866
11867 * image.c: Integer signedness and overflow and related fixes.
11868 This is not an exhaustive set of fixes, but it's time to
11869 record what I've got.
11870 (lookup_pixel_color, check_image_size): Remove redundant decls.
11871 (check_image_size): Don't assume that arbitrary EMACS_INT values
11872 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11873 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11874 (tiff_load, imagemagick_load_image):
11875 Check for overflow in size calculations.
11876 (x_create_x_image_and_pixmap): Remove unnecessary test for
11877 xmalloc returning NULL; that can't happen.
11878 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11879 (xpm_color_bucket): Use better integer hashing function.
11880 (xpm_cache_color): Don't possibly over-allocate memory.
11881 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11882 (gif_memory_source):
11883 Use ptrdiff_t, not int or size_t, to record sizes.
11884 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11885 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11886 either works, as we prefer signed integers.
11887 (tiff_read_from_memory, tiff_write_from_memory):
11888 Return tsize_t, not size_t, since that's what the TIFF API wants.
11889 (tiff_read_from_memory): Don't fail simply because the read would
11890 go past EOF; instead, return a short read.
11891 (tiff_load): Omit no-longer-needed casts.
11892 (Fimagemagick_types): Don't assume size fits into 'int'.
11893
11894 Improve hashing quality when configured --with-wide-int.
11895 * fns.c (hash_string): New function, taken from sxhash_string.
11896 Do not discard information about ASCII character case; this
11897 discarding is no longer needed.
11898 (sxhash-string): Use it. Change sig to match it. Caller changed.
11899 * lisp.h: Declare it.
11900 * lread.c (hash_string): Remove, since we now use fns.c's version.
11901 The fns.c version returns a wider integer if --with-wide-int is
11902 specified, so this should help the quality of the hashing a bit.
11903
11904 * emacs.c: Integer overflow minor fix.
11905 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11906 Define only if GNU_LINUX.
11907 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11908
11909 * dispnew.c: Integer signedness and overflow fixes.
11910 Remove unnecessary forward decls, that were a maintenance hassle.
11911 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11912 All uses changed.
11913 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11914 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11915 (prepare_desired_row, line_draw_cost):
11916 Use int, not unsigned, where either works.
11917 (save_current_matrix, restore_current_matrix):
11918 Use ptrdiff_t, not size_t, where either works.
11919 (init_display): Check for overflow more accurately, and without
11920 relying on undefined behavior.
11921
11922 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11923 Remove, replacing with the new symbols in lisp.h. All uses changed.
11924 * fileio.c (make_temp_name):
11925 * filelock.c (lock_file_1, lock_file):
11926 * xdisp.c (message_dolog):
11927 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11928 Use pMd etc. instead.
11929 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11930 replacing the pWIDE etc. symbols removed from editfns.c.
11931
11932 * keyboard.h (num_input_events): Now uintmax_t.
11933 This is (very slightly) less likely to mess up due to wraparound.
11934 All uses changed.
11935
11936 * buffer.c: Integer signedness fixes.
11937 (alloc_buffer_text, enlarge_buffer_text):
11938 Use ptrdiff_t rather than size_t when either will do, as we prefer
11939 signed integers.
11940
11941 * alloc.c: Integer signedness and overflow fixes.
11942 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11943 (__malloc_size_t): Default to size_t, not to int.
11944 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11945 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11946 Prefer ptrdiff_t to size_t when either would do, as we prefer
11947 signed integers.
11948 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11949 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11950 Now const. Initialize with values that are in range even if char
11951 is signed.
11952 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11953 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11954 These functions do the right thing with sizes > 2**32.
11955 (check_depth): Now ptrdiff_t, not int.
11956 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11957 Adjust to new way of storing sizes. Check for size overflow bugs
11958 in rest of code.
11959 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11960 slightly wrong anyway, as it missed one instance of
11961 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11962 (refill_memory_reserve): Omit needless cast to size_t.
11963 (mark_object_loop_halt): Mark as externally visible.
11964
11965 * xselect.c: Integer signedness and overflow fixes.
11966 (Fx_register_dnd_atom, x_handle_dnd_message):
11967 Use ptrdiff_t, not size_t, since we prefer signed.
11968 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11969 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11970 x_dnd_atoms_size and x_dnd_atoms_length.
11971
11972 * doprnt.c: Prefer signed to unsigned when either works.
11973 * eval.c (verror):
11974 * doprnt.c (doprnt):
11975 * lisp.h (doprnt):
11976 * xdisp.c (vmessage):
11977 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11978 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11979 prefer signed arithmetic to avoid comparison confusion.
11980 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11981 but is a bit tricky.
11982
11983 Assume freestanding C89 headers, string.h, stdlib.h.
11984 * data.c, doprnt.c, floatfns.c, print.c:
11985 Include float.h unconditionally.
11986 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11987 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11988 * regex.c: Likewise for stddef.h, string.h.
11989 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11990 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11991 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11992 (STDC_HEADERS): Remove obsolete defines.
11993 * sysdep.c: Include limits.h unconditionally.
11994
11995 Assume support for memcmp, memcpy, memmove, memset.
11996 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11997 * regex.c (memcmp, memcpy):
11998 Remove; we assume C89 now.
11999
12000 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12001 (__malloc_safe_bcopy): Remove; no longer needed.
12002
12003 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12004 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12005 well either way, and we prefer signed to unsigned.
12006
12007 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12008
12009 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12010 closes the connection while we're reading (bug#9182).
12011
12012 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12013
12014 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12015 are specified (Bug#9168).
12016
12017 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12018
12019 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12020 Found by GCC static checking and --with-wide-int on a 32-bit host.
12021
12022 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12023
12024 * xdisp.c (compute_display_string_pos): Fix logic of caching
12025 previous display string position. Initialize cached_prev_pos to
12026 -1. Fixes slow-down at the beginning of a buffer.
12027
12028 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12029
12030 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12031 for attrs[LFACE_FONTSET_INDEX].
12032
12033 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12034
12035 * xml.c (parse_region): Remove unused local
12036 that was recently introduced.
12037
12038 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12039
12040 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12041 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12042
12043 * xdisp.c (move_it_in_display_line_to): Record the best matching
12044 position for TO_CHARPOS while scanning the line, and restore it on
12045 exit if none of the characters scanned was an exact match.
12046 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12047 when exact match is impossible due to invisible text, and the
12048 lines are truncated.
12049
12050 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12051
12052 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12053 for OSX >= 10.7.
12054
12055 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12056
12057 Fix a significant slow-down of cursor motion with C-n, C-p,
12058 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12059 auto-repeat under bidi redisplay in fontified buffers.
12060 * xdisp.c (compute_stop_pos_backwards): New function.
12061 (next_element_from_buffer): Call compute_stop_pos_backwards to
12062 find a suitable prev_stop when we find ourselves before
12063 base_level_stop.
12064 (reseat): Don't look for prev_stop, as that could mean a very long
12065 run.
12066 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12067 <cached_disp_overlay_modiff>: Cache for last found display string
12068 position.
12069 (compute_display_string_pos): Return the cached position if asked
12070 about the same buffer in the same area of character positions, and
12071 the buffer wasn't changed since the time the display string
12072 position was cached.
12073
12074 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12075
12076 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12077 is an integer, which is important for empty lines. (Bug#9149)
12078
12079 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
12080
12081 * frame.c (Fmodify_frame_parameters): In tty case, update the
12082 default face if necessary (Bug#4238).
12083
12084 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
12085
12086 * editfns.c (Fstring_to_char): No need to explain what a character
12087 is in the docstring (Bug#6576).
12088
12089 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12090
12091 * xml.c (parse_region): Make sure we always return a tree.
12092
12093 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12094
12095 * xml.c (parse_region): If a document contains only comments,
12096 return that, too.
12097
12098 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12099
12100 * xml.c (make_dom): Return comments, too.
12101
12102 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12103
12104 Port to OpenBSD.
12105 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12106 and the surrounding thread.
12107 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12108 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12109 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12110 timer goes off.
12111 * s/openbsd.h (BROKEN_SIGIO): Define.
12112 * unexelf.c (unexec) [__OpenBSD__]:
12113 Don't update the .mdebug section of the Alpha COFF symbol table.
12114
12115 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12116
12117 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12118 (bug#8460).
12119
12120 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12121
12122 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12123 This fixes some race conditions on the permissions of any newly
12124 created file.
12125
12126 * alloc.c (valid_pointer_p): Use pipe, not open.
12127 This fixes some permissions issues when debugging.
12128
12129 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12130 If fchown fails to set both uid and gid, try to set just gid,
12131 as that is sometimes allowed. Adjust the file's mode to eliminate
12132 setuid or setgid bits that are inappropriate if fchown fails.
12133
12134 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12135
12136 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12137 to compare Lisp_Objects.
12138 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12139 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12140 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12141
12142 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12143
12144 * lread.c (read_integer): Unread even EOF character.
12145 (read1): Likewise. Properly record start position of symbol.
12146
12147 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12148 symbol character follows.
12149
12150 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12151
12152 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12153 This works around a problem with the previous change to Fcopy_file.
12154 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12155 and without this change, GCC might complain about discarding
12156 fchown's return value.
12157
12158 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
12159
12160 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12161
12162 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12163
12164 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12165
12166 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12167
12168 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12169 it's used from the C level.
12170
12171 * process.c: Use the same condition for POLL_FOR_INPUT in both
12172 keyboard.c and process.c (bug#1858).
12173
12174 2011-07-09 Lawrence Mitchell <wence@gmx.li>
12175
12176 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12177 (Fgnutls_boot): Use it.
12178
12179 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12180
12181 * doc.c (Fsubstitute_command_keys): Revert last change.
12182
12183 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12184
12185 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12186 quotes the next character, and doesn't affect other longer
12187 sequences (bug#8935).
12188
12189 * lread.c (syms_of_lread): Clarify that is isn't only
12190 `eval-buffer' and `eval-defun' that's affected by
12191 `lexical-binding' (bug#8460).
12192
12193 2011-07-15 Eli Zaretskii <eliz@gnu.org>
12194
12195 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12196 bidi redisplay when a line includes both an image and is truncated.
12197
12198 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12199
12200 Fix minor problems found by static checking.
12201 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12202 (elsz): Now a signed constant, not a size_t var. We prefer signed
12203 types to unsigned, to avoid integer comparison confusion. Without
12204 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12205 "cannot optimize loop, the loop counter may overflow", a symptom
12206 of the confusion.
12207 * indent.c (Fvertical_motion): Mark locals as initialized.
12208 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12209
12210 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12211
12212 * search.c (Fre_search_backward): Mention `case-fold-search' in
12213 all the re_search_* functions (bug#8138).
12214
12215 * keyboard.c (Fopen_dribble_file): Document when the file is
12216 closed (bug#8056).
12217
12218 2011-07-14 Eli Zaretskii <eliz@gnu.org>
12219
12220 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12221 bidi_cache_idx.
12222
12223 Support bidi reordering of display and overlay strings.
12224 * xdisp.c (compute_display_string_pos)
12225 (compute_display_string_end): Accept additional argument STRING.
12226 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12227 (reseat_to_string): Initialize bidi_it->string.s and
12228 bidi_it->string.schars.
12229 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12230 NULL (avoids a crash in bidi_paragraph_init).
12231 Initialize itb.string.lstring.
12232 (init_iterator): Call bidi_init_it only of a valid
12233 buffer position was specified. Initialize paragraph_embedding to
12234 L2R.
12235 (reseat_to_string): Initialize the bidi iterator.
12236 (display_string): If we need to ignore text properties of
12237 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12238 original value of -1 will not work with bidi.)
12239 (compute_display_string_pos): First arg is now struct
12240 `text_pos *'; all callers changed. Support display properties on
12241 Lisp strings.
12242 (compute_display_string_end): Support display properties on Lisp
12243 strings.
12244 (init_iterator, reseat_1, reseat_to_string): Initialize the
12245 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12246 when iterating on a string not from display properties).
12247 (compute_display_string_pos, compute_display_string_end):
12248 Fix calculation of the object to scan. Fixes an error when using
12249 arrow keys.
12250 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12251 base_level_stop; instead, set base_level_stop to BEGV.
12252 Fixes crashes in vertical-motion.
12253 (next_element_from_buffer): Improve commentary for when
12254 the iterator is before prev_stop.
12255 (init_iterator): Initialize bidi_p from the default value of
12256 bidi-display-reordering, not from buffer-local value. Use the
12257 buffer-local value only if initializing for buffer iteration.
12258 (handle_invisible_prop): Support invisible properties on strings
12259 that are being bidi-reordered.
12260 (set_iterator_to_next): Support bidi reordering of C strings and
12261 Lisp strings.
12262 (next_element_from_string): Support bidi reordering of Lisp
12263 strings.
12264 (handle_stop_backwards): Support Lisp strings as well.
12265 (display_string): Support display of R2L glyph rows.
12266 Use IT_STRING_CHARPOS when displaying from a Lisp string.
12267 (init_iterator): Don't initialize it->bidi_p for strings
12268 here.
12269 (reseat_to_string): Initialize it->bidi_p for strings here.
12270 (next_element_from_string, next_element_from_c_string)
12271 (next_element_from_buffer): Add xassert's for correspondence
12272 between IT's object being iterated and it->bidi_it.string
12273 structure.
12274 (face_before_or_after_it_pos): Support bidi iteration.
12275 (next_element_from_c_string): Handle the case of the first string
12276 character that is not the first one in the visual order.
12277 (get_visually_first_element): New function, refactored from common
12278 parts of next_element_from_buffer, next_element_from_string, and
12279 next_element_from_c_string.
12280 (tool_bar_lines_needed, redisplay_tool_bar)
12281 (display_menu_bar): Force left-to-right direction. Add a FIXME
12282 comment for making that be controlled by a user option.
12283 (push_it, pop_it): Save and restore the state of the
12284 bidi iterator. Save and restore the bidi_p flag.
12285 (pop_it): Iterate out of display property for string iteration as
12286 well.
12287 (iterate_out_of_display_property): Support iteration over strings.
12288 (handle_single_display_spec): Set up it->bidi_it for iteration
12289 over a display string, and call bidi_init_it.
12290 (handle_single_display_spec, next_overlay_string)
12291 (get_overlay_strings_1, push_display_prop): Set up the bidi
12292 iterator for displaying display or overlay strings.
12293 (forward_to_next_line_start): Don't use the shortcut if
12294 bidi-iterating.
12295 (back_to_previous_visible_line_start): If handle_display_prop
12296 pushed the iterator stack, restore the internal state of the bidi
12297 iterator by calling bidi_pop_it same number of times.
12298 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12299 and we are bidi-iterating, don't decrement the iterator position;
12300 instead, set the first_elt flag in the bidi iterator, to produce
12301 the same effect.
12302 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12303 (push_display_prop): xassert that we are iterating a buffer.
12304 (push_it, pop_it): Save and restore paragraph_embedding member.
12305 (handle_single_display_spec, next_overlay_string)
12306 (get_overlay_strings_1, reseat_1, reseat_to_string)
12307 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12308 correctly. Don't assume unibyte strings are not bidi-reordered.
12309 (compute_display_string_pos)
12310 (compute_display_string_end): Fix handling the case of C string.
12311 (push_it, pop_it): Save and restore from_disp_prop_p.
12312 (handle_single_display_spec, push_display_prop): Set the
12313 from_disp_prop_p flag.
12314 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12315 (pop_it): Call iterate_out_of_display_property only if we are
12316 popping after iteration over a string that came from a display
12317 property. Fix a typo in popping stretch info. Add an assertion
12318 for verifying that the iterator position is in sync with the bidi
12319 iterator.
12320 (handle_single_display_spec, get_overlay_strings_1)
12321 (push_display_prop): Fix initialization of paragraph direction for
12322 string when that of the parent object is not yet determined.
12323 (reseat_1): Call bidi_init_it to resync the bidi
12324 iterator with IT's position. (Bug#7616)
12325 (find_row_edges): If ROW->start.pos gives position
12326 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12327 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12328 Reset the from_disp_prop_p flag.
12329 (SAVE_IT, RESTORE_IT): New macros.
12330 (pos_visible_p, face_before_or_after_it_pos)
12331 (back_to_previous_visible_line_start)
12332 (move_it_in_display_line_to, move_it_in_display_line)
12333 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12334 (try_scrolling, redisplay_window, display_line): Use them when
12335 saving a temporary copy of the iterator and restoring it back.
12336 (back_to_previous_visible_line_start, reseat_1)
12337 (init_iterator): Empty the bidi cache "stack".
12338 (move_it_in_display_line_to): If iterator ended up at
12339 EOL, but we never saw any buffer positions smaller than
12340 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12341 motion in bidi-reordered lines.
12342 (move_it_in_display_line_to): Record prev_method and prev_pos
12343 immediately before the call to set_iterator_to_next. Fixes cursor
12344 motion in bidi-reordered lines with stretch glyphs and strings
12345 displayed in margins. (Bug#8133) (Bug#8867)
12346 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12347 TO_CHARPOS.
12348 (pos_visible_p): Support positions in bidi-reordered lines.
12349 Save and restore bidi cache.
12350
12351 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12352 (bidi_paragraph_info): Delete unused struct.
12353 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12354 (bidi_cache_start): New variable.
12355 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12356 to zero.
12357 (bidi_cache_fetch_state, bidi_cache_search)
12358 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12359 (bidi_cache_find, bidi_peek_at_next_level)
12360 (bidi_level_of_next_char, bidi_find_other_level_edge)
12361 (bidi_move_to_visually_next): Compare cache index with
12362 bidi_cache_start rather than with zero.
12363 (bidi_fetch_char): Accept new argument STRING; all callers
12364 changed. Support iteration over a string. Support strings with
12365 display properties. Support unibyte strings. Fix the type of
12366 `len' according to what STRING_CHAR_AND_LENGTH expects.
12367 (bidi_paragraph_init, bidi_resolve_explicit_1)
12368 (bidi_resolve_explicit, bidi_resolve_weak)
12369 (bidi_level_of_next_char, bidi_move_to_visually_next):
12370 Support iteration over a string.
12371 (bidi_set_sor_type, bidi_resolve_explicit_1)
12372 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12373 can now be zero (for strings); special values 0 and -1 were
12374 changed to -1 and -2, respectively.
12375 (bidi_char_at_pos): New function.
12376 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12377 Call it instead of FETCH_MULTIBYTE_CHAR.
12378 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12379 initialized to valid values.
12380 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12381 values.
12382 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12383 the test for valid cached positions. Fix the logic for looking up
12384 the sentinel state in the cache. GCPRO the Lisp string we are
12385 iterating.
12386 (bidi_push_it, bidi_pop_it): New functions.
12387 (bidi_initialize): Initialize the bidi cache start stack pointer.
12388 (bidi_cache_ensure_space): New function, refactored from part of
12389 bidi_cache_iterator_state. Don't assume the required size is just
12390 one BIDI_CACHE_CHUNK away.
12391 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12392 (bidi_count_bytes, bidi_char_at_pos): New functions.
12393 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12394 always valid if bidi_cache_idx is valid.
12395 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12396 is valid if it's going to be used.
12397 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12398 (bidi_cache_fetch_state, bidi_cache_search)
12399 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12400 (bidi_cache_iterator_state, bidi_cache_find)
12401 (bidi_find_other_level_edge, bidi_cache_start_stack):
12402 All variables related to cache indices are now EMACS_INT.
12403
12404 * dispextern.h (struct bidi_string_data): New structure.
12405 (struct bidi_it): New member `string'. Make flag members be 1-bit
12406 fields, and put them last in the struct.
12407 (compute_display_string_pos, compute_display_string_end):
12408 Update prototypes.
12409 (bidi_push_it, bidi_pop_it): Add prototypes.
12410 (struct iterator_stack_entry): New members bidi_p,
12411 paragraph_embedding, and from_disp_prop_p.
12412 (struct it): Member bidi_p is now a bit field 1 bit wide.
12413 (bidi_shelve_cache, bidi_unshelve_cache):
12414 Declare prototypes.
12415
12416 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12417 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12418 and vector-like objects.
12419
12420 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12421 cache around display iteration.
12422
12423 * window.c (Fwindow_end, window_scroll_pixel_based)
12424 (displayed_window_lines, Frecenter): Save and restore the bidi
12425 cache around display iteration.
12426
12427 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12428
12429 * editfns.c (Fdelete_region): Clarify the use of the named
12430 parameters (bug#6788).
12431
12432 2011-07-14 Martin Rudalics <rudalics@gmx.at>
12433
12434 * indent.c (Fvertical_motion): Set and restore w->pointm when
12435 saving and restoring the window's buffer (Bug#9006).
12436
12437 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12438
12439 * editfns.c (Fstring_to_char): Clarify just what is returned
12440 (bug#6576). Text by Eli Zaretskii.
12441
12442 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
12443
12444 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12445
12446 2011-07-13 Eli Zaretskii <eliz@gnu.org>
12447
12448 * buffer.c (mmap_find): Fix a typo.
12449
12450 2011-07-13 Johan Bockgård <bojohan@gnu.org>
12451
12452 Fix execution of x selection hooks.
12453 * xselect.c (Qx_lost_selection_functions)
12454 (Qx_sent_selection_functions): New vars.
12455 (syms_of_xselect): DEFSYM them.
12456 (x_handle_selection_request): Pass Qx_sent_selection_functions
12457 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12458 (x_handle_selection_clear,x_clear_frame_selections):
12459 Pass Qx_lost_selection_functions rather than
12460 Vx_lost_selection_functions to Frun_hook_with_args.
12461
12462 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12463
12464 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12465 The old code sometimes used this field without initializing it.
12466
12467 * alloc.c (gc_sweep): Don't read past end of array.
12468 In theory, the old code could also have corrupted Emacs internals,
12469 though it'd be very unlikely.
12470
12471 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12472
12473 * character.c (Fcharacterp): Don't advertise optional ignored
12474 argument. (Bug#4026)
12475
12476 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12477
12478 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12479 key" (bug#4257).
12480
12481 * window.c (Fset_window_start): Doc fix (bug#4199).
12482 (Fset_window_hscroll): Ditto.
12483
12484 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12485
12486 Fix minor new problems caught by GCC 4.6.1.
12487 * term.c (init_tty): Remove unused local.
12488 * xsettings.c (store_monospaced_changed): Define this function only
12489 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12490 not used otherwise.
12491
12492 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
12493
12494 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12495
12496 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12497
12498 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12499 are the mini-buffer and the echo area (bug#3320).
12500
12501 * term.c (init_tty): Remove support for supdup, c10 and perq
12502 terminals, which are no longer supported (bug#1482).
12503
12504 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12505
12506 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12507
12508 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12509
12510 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12511 for non-popups (Bug#3642).
12512
12513 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12514
12515 * alloc.c (reset_malloc_hooks): Protoize.
12516 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12517 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12518 * cm.c (losecursor): Likewise.
12519 * data.c (fmod): Likewise.
12520 * dispnew.c (swap_glyphs_in_rows): Likewise.
12521 * emacs.c (memory_warning_signal): Likewise.
12522 * floatfns.c (float_error): Likewise.
12523 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12524 (otf_open, font_otf_capability, generate_otf_features)
12525 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12526 Likewise.
12527 * image.c (pbm_read_file): Likewise.
12528 * indent.c (string_display_width): Likewise.
12529 * intervals.c (check_for_interval, search_for_interval)
12530 (inc_interval_count, count_intervals, root_interval)
12531 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12532 * lread.c (defalias): Likewise.
12533 * ralloc.c (r_alloc_check): Likewise.
12534 * regex.c (set_image_of_range_1, set_image_of_range)
12535 (regex_grow_registers): Likewise.
12536 * sysdep.c (strerror): Likewise.
12537 * termcap.c (valid_filename_p, tprint, main): Likewise.
12538 * tparam.c (main): Likewise.
12539 * unexhp9k800.c (run_time_remap, save_data_space)
12540 (update_file_ptrs, read_header, write_header, calculate_checksum)
12541 (copy_file, copy_rest, display_header): Likewise.
12542 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12543 Likewise.
12544 * xdisp.c (check_it): Likewise.
12545 * xfaces.c (register_color, unregister_color, unregister_colors):
12546 Likewise.
12547 * xfns.c (print_fontset_result): Likewise.
12548 * xrdb.c (member, fatal, main): Likewise.
12549
12550 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12551
12552 Fix minor problems found by static checking (Bug#9031).
12553 * chartab.c (char_table_set_range, map_sub_char_table):
12554 Remove unused locals.
12555 (uniprop_table): Now static.
12556 * composite.c (_work_char): Remove unused static var.
12557
12558 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12559
12560 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12561
12562 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12563
12564 * gtkutil.c (qttip_cb): Remove code without function.
12565
12566 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12567
12568 * w32.c (pthread_sigmask): New stub.
12569
12570 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12571
12572 Use pthread_sigmask, not sigprocmask (Bug#9010).
12573 sigprocmask is portable only for single-threaded applications, and
12574 Emacs can be multi-threaded when it uses GTK.
12575 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12576 (LIBES): Use it.
12577 * callproc.c (Fcall_process):
12578 * process.c (create_process):
12579 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12580 Use pthread_sigmask, not sigprocmask.
12581
12582 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12583
12584 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12585 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12586 wrong (Bug#8591).
12587
12588 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12589
12590 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12591 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12592 (xg_hide_tooltip): Fix comment.
12593
12594 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12595 in registerServicesMenuSendTypes.
12596 (validRequestorForSendType): Don't check ns_return_types.
12597
12598 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12599 ns_return_type.
12600
12601 2011-07-08 Jason Rumney <jasonr@gnu.org>
12602
12603 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12604 SH_SHOW for hidden windows (Bug#5482).
12605
12606 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12607 frame struct members of non-existent frames (Bug#6284).
12608
12609 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12610
12611 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12612 variable firstTime not needed on OSX >= 10.6.
12613 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12614 >= 10.5. Use setKnobProportion, setDoubleValue.
12615
12616 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12617 (MAC_OS_X_VERSION_10_5): Define if not defined.
12618 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12619 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12620 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12621
12622 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12623 cString and lossyCString on OSX >= 10.4.
12624
12625 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12626 sizeToFit on OSX >= 10.2.
12627
12628 * nsimage.m (allocInitFromFile): Don't use deprecated method
12629 bestRepresentationForDevice on OSX >= 10.6.
12630
12631 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12632 to avoid warning.
12633
12634 * emacs.c: Declare unexec_init_emacs_zone.
12635
12636 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12637
12638 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12639
12640 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12641 on svcsMenu (Bug#8842).
12642
12643 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12644 ns_return_types.
12645 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12646
12647 * nsterm.m (QUTF8_STRING): Declare.
12648 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12649 (validRequestorForSendType): Return type is (id).
12650 Change indexOfObjectIdenticalTo to indexOfObject.
12651 Check if we have local selection before returning self (Bug#8842).
12652 (writeSelectionToPasteboard): Put local selection into paste board
12653 if we have a local selection (Bug#8842).
12654 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12655
12656 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12657 (ns_get_local_selection): Declare.
12658
12659 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12660
12661 * keymap.c (describe_map_tree): Don't insert a double newline at
12662 the end of the buffer (bug#1169) and return whether we inserted
12663 something.
12664
12665 * callint.c (Fcall_interactively): Change "reading args" to
12666 "providing args" to try to clarify what it does (bug#1010).
12667
12668 2011-07-07 Kenichi Handa <handa@m17n.org>
12669
12670 * composite.c (composition_compute_stop_pos): Ignore a static
12671 composition starting before CHARPOS (Bug#8915).
12672
12673 * xdisp.c (handle_composition_prop): Likewise.
12674
12675 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12676
12677 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12678 (Bug#9015)
12679
12680 2011-07-07 Kenichi Handa <handa@m17n.org>
12681
12682 * character.h (unicode_category_t): New enum type.
12683
12684 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12685 (Qchar_code_property_table): New variable.
12686 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12687 (UNIPROP_COMPRESSED_FORM_P): New macros.
12688 (char_table_ascii): Uncompress the compressed values.
12689 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12690 Uncompress the compressed values.
12691 (sub_char_table_ref_and_range): Likewise.
12692 (char_table_ref_and_range): Uncompress the compressed values.
12693 (sub_char_table_set): New arg is_uniprop. Callers changed.
12694 Uncompress the compressed values.
12695 (sub_char_table_set_range): Args changed. Callers changed.
12696 (char_table_set_range): Adjuted for the above change.
12697 (map_sub_char_table): Delete args default_val and parent. Add arg
12698 top. Give decoded values to a Lisp function.
12699 (map_char_table): Adjust for the above change. Give decoded
12700 values to a Lisp function. Gcpro more variables.
12701 (uniprop_table_uncompress)
12702 (uniprop_decode_value_run_length): New functions.
12703 (uniprop_decoder, uniprop_decoder_count): New variables.
12704 (uniprop_get_decoder, uniprop_encode_value_character)
12705 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12706 New functions.
12707 (uniprop_encoder, uniprop_encoder_count): New variables.
12708 (uniprop_get_encoder, uniprop_table)
12709 (Funicode_property_table_internal, Fget_unicode_property_internal)
12710 (Fput_unicode_property_internal): New functions.
12711 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12712 Sunicode_property_table_internal, Sget_unicode_property_internal,
12713 and Sput_unicode_property_internal. Defvar_lisp
12714 char-code-property-alist.
12715
12716 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12717 Vunicode_category_table.
12718
12719 * font.c (font_range): Adjust for the change of
12720 Vunicode_category_table.
12721
12722 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12723
12724 * m/iris4d.h: Remove file, move contents ...
12725 * s/irix6-5.h: ... here.
12726
12727 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12728
12729 Remove unportable assumption about struct layout (Bug#8884).
12730 * alloc.c (mark_buffer):
12731 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12732 (clone_per_buffer_values): Don't assume that
12733 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12734 This isn't true in general, and it's particularly not true
12735 if Emacs is configured with --with-wide-int.
12736 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12737 New macros, used in the buffer.c change.
12738
12739 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12740
12741 * xsettings.c: Use both GConf and GSettings if both are available.
12742 (store_config_changed_event): Add comment.
12743 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12744 (store_tool_bar_style_changed): New functions.
12745 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12746 (struct xsettings): Move font inside HAVE_XFT.
12747 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12748 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12749 Move inside HAVE_XFT.
12750 (something_changed_gsettingsCB): Rename from something_changedCB.
12751 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12752 also.
12753 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12754 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12755 (something_changed_gconfCB): Rename from something_changedCB.
12756 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12757 (parse_settings): Move check for font inside HAVE_XFT.
12758 (read_settings, apply_xft_settings): Add comment.
12759 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12760 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12761 call store_font_name_changed.
12762 (xft_settings_event): Add comment.
12763 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12764 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12765 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12766 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12767 (xsettings_initialize): Call init_gsettings last.
12768 (xsettings_get_system_font, xsettings_get_system_normal_font):
12769 Add comment.
12770
12771 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12772
12773 Random fixes. E.g., (random) never returned negative values.
12774 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12775 subseconds part to the entropy, as that's a bit more random.
12776 Prefer signed to unsigned, since the signedness doesn't matter and
12777 in general we prefer signed. When given a limit, use a
12778 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12779 latter isn't right if USE_2_TAGS_FOR_INTS.
12780 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12781 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12782
12783 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12784
12785 * textprop.c (text_property_stickiness):
12786 Obey Vtext_property_default_nonsticky.
12787 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12788 * w32fns.c (syms_of_w32fns):
12789 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12790
12791 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12792
12793 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12794 This is more efficient than Ffile_directory_p and avoids a minor race.
12795
12796 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12797
12798 * buffer.c (Foverlay_put): Say what the return value is
12799 (bug#7835).
12800
12801 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12802 is a directory before asking whether to use the file name
12803 (bug#7564).
12804 (barf_or_query_if_file_exists): Make the "File is a directory"
12805 error be more correct.
12806
12807 * fns.c (Frequire): Remove the mention of the .gz files, since
12808 that's installation-specific, but keep the mention of
12809 `get-load-suffixes'.
12810
12811 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12812
12813 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12814 Report string overflow if the output is too long.
12815
12816 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12817
12818 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12819 (syms_of_gnutls): Remove duplicate DEFSYM for
12820 Qgnutls_bootprop_verify_hostname_error, an error for
12821 Qgnutls_bootprop_verify_error (which is no longer used).
12822
12823 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12824 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12825 Also (re)move comments that are misplaced or no longer relevant.
12826
12827 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12828
12829 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12830
12831 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12832
12833 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12834 and background color parameters if they have been changed.
12835
12836 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12837
12838 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12839
12840 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12841
12842 * xsettings.c (SYSTEM_FONT): Define only when used.
12843 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12844
12845 * keymap.c (access_keymap_1): Now static.
12846
12847 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12848
12849 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12850 leave any prefix arg for the up event (Bug#1586).
12851
12852 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12853
12854 * lread.c (syms_of_lread): Mention single symbols defined by
12855 `defvar' or `defconst' (bug#7154).
12856
12857 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12858 (Frequire): Mention get-load-suffixes.
12859
12860 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12861
12862 * window.h (window): Remove clone_number slot.
12863 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12864 Remove.
12865 (make_parent_window, make_window, saved_window)
12866 (Fset_window_configuration, save_window_save): Don't deal with
12867 clone numbers.
12868 * buffer.c (Qclone_number): Remove declaration.
12869 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12870
12871 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12872
12873 Add multiple inheritance to keymaps.
12874 * keymap.c (Fmake_composed_keymap): New function.
12875 (Fset_keymap_parent): Simplify.
12876 (fix_submap_inheritance): Remove.
12877 (access_keymap_1): New function extracted from access_keymap to handle
12878 embedded parents and handle lists of maps.
12879 (access_keymap): Use it.
12880 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12881 (Fcopy_keymap): Handle embedded parents.
12882 (Fcommand_remapping, define_as_prefix): Simplify.
12883 (Fkey_binding): Simplify.
12884 (syms_of_keymap): Move minibuffer-local-completion-map,
12885 minibuffer-local-filename-completion-map,
12886 minibuffer-local-must-match-map, and
12887 minibuffer-local-filename-must-match-map to Elisp.
12888 (syms_of_keymap): Defsubr make-composed-keymap.
12889 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12890 (parse_menu_item): Trivial simplification.
12891
12892 2011-07-01 Glenn Morris <rgm@gnu.org>
12893
12894 * Makefile.in (SETTINGS_LIBS): Fix typo.
12895
12896 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12897
12898 * coding.c (Fencode_coding_string): Record the last coding system
12899 used, as the function doc string says (bug#8738).
12900
12901 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12902
12903 * xsettings.c (store_monospaced_changed): Take new font as arg and
12904 check for change against current_mono_font.
12905 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12906 (emacs_settings_constructor, emacs_settings_get_property)
12907 (emacs_settings_set_property, emacs_settings_class_init)
12908 (emacs_settings_init, gsettings_obj): Remove.
12909 (something_changedCB): New function for HAVE_GSETTINGS.
12910 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12911 with value as argument.
12912 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12913 g_settings_new (Bug#8967). Do not create gsettings_obj.
12914 Remove calls to g_settings_bind. Connect something_changedCB to
12915 "changed".
12916
12917 * xgselect.c: Add defined (HAVE_GSETTINGS).
12918 (xgselect_initialize): Ditto.
12919
12920 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12921 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12922 xg_select.
12923
12924 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12925
12926 * eval.c (struct backtrace): Simplify and port the data structure.
12927 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12928 signed bit field, as this assumption is not portable and it makes
12929 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12930 "char debug_on_exit : 1" as this is not portable either; instead,
12931 use the portable "unsigned int debug_on_exit : 1". Remove unused
12932 member evalargs. Remove obsolete comments about cc bombing out.
12933
12934 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12935
12936 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12937 Let HAVE_GSETTINGS override HAVE_GCONF.
12938 (store_monospaced_changed): New function.
12939 (EMACS_SETTINGS): A new type derived from GObject to handle
12940 GSettings notifications.
12941 (emacs_settings_constructor, emacs_settings_get_property)
12942 (emacs_settings_set_property, emacs_settings_class_init):
12943 New functions.
12944 (gsettings_client, gsettings_obj): New variables.
12945 (GSETTINGS_SCHEMA): New define.
12946 (something_changedCB): Call store_monospaced_changed.
12947 (init_gsettings): New function.
12948 (xsettings_initialize): Call init_gsettings.
12949 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12950 to NULL.
12951
12952 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12953 GCONF_CFLAGS/LIBS.
12954
12955 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12956
12957 * window.c (resize_root_window, grow_mini_window)
12958 (shrink_mini_window): Rename Qresize_root_window to
12959 Qwindow_resize_root_window and Qresize_root_window_vertically to
12960 Qwindow_resize_root_window_vertically.
12961
12962 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12963
12964 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12965
12966 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12967
12968 * makefile.w32-in: Redesign dependencies so they reflect more
12969 clearly which files are directly included by each source file,
12970 and not through other includes.
12971
12972 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12973
12974 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12975 (sort_overlays, overlay_strings): When an overlay's clone number
12976 matches the window's clone number process the overlay even if
12977 the overlay's window property doesn't match the current window.
12978
12979 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12980 (Fwindow_hchild): Rename to Fwindow_left_child.
12981 (Fwindow_next): Rename to Fwindow_next_sibling.
12982 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12983 (resize_window_check): Rename to window_resize_check.
12984 (resize_window_apply): Rename to window_resize_apply.
12985 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12986 (Fdelete_other_windows_internal, resize_frame_windows)
12987 (Fsplit_window_internal, Fdelete_window_internal)
12988 (grow_mini_window, shrink_mini_window)
12989 (Fresize_mini_window_internal): Fix callers accordingly.
12990
12991 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12992
12993 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12994 (emacs_fixed_set_min_size): Remove.
12995 (emacs_fixed_new): Take frame as argument.
12996
12997 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12998 (_EmacsFixedPrivate): Remove minwidth/height.
12999 Add struct frame *f.
13000 (emacs_fixed_init): Initialize priv->f.
13001 (get_parent_class, emacs_fixed_set_min_size): Remove.
13002 (emacs_fixed_new): Set priv->f to argument.
13003 (emacs_fixed_get_preferred_width)
13004 (emacs_fixed_get_preferred_height): Use min_width/height from
13005 frames size_hint to set minimum and natural (Bug#8919).
13006 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13007 and use min_width/height from frames size_hint to set
13008 min_width/height (Bug#8919).
13009
13010 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13011 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13012 Fix indentation.
13013
13014 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13015
13016 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13017 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13018 called at ZV.
13019
13020 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13021
13022 * process.c (wait_reading_process_output): Bypass select if
13023 waiting for a cell while ignoring keyboard input, and input is
13024 pending. Suggested by Jan Djärv (Bug#8869).
13025
13026 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13027
13028 Use gnulib's dup2 module instead of rolling our own.
13029 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13030
13031 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13032
13033 * dispnew.c (scrolling_window): Before scrolling, turn off a
13034 mouse-highlight in the window being scrolled.
13035
13036 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13037
13038 Move DEFSYM to lisp.h and use everywhere.
13039
13040 * character.h (DEFSYM): Move declaration...
13041 * lisp.h (DEFSYM): ...here.
13042
13043 * gnutls.c:
13044 * minibuf.c:
13045 * w32menu.c:
13046 * w32proc.c:
13047 * w32select.c: Don't include character.h.
13048
13049 * alloc.c (syms_of_alloc):
13050 * buffer.c (syms_of_buffer):
13051 * bytecode.c (syms_of_bytecode):
13052 * callint.c (syms_of_callint):
13053 * casefiddle.c (syms_of_casefiddle):
13054 * casetab.c (init_casetab_once):
13055 * category.c (init_category_once, syms_of_category):
13056 * ccl.c (syms_of_ccl):
13057 * cmds.c (syms_of_cmds):
13058 * composite.c (syms_of_composite):
13059 * dbusbind.c (syms_of_dbusbind):
13060 * dired.c (syms_of_dired):
13061 * dispnew.c (syms_of_display):
13062 * doc.c (syms_of_doc):
13063 * editfns.c (syms_of_editfns):
13064 * emacs.c (syms_of_emacs):
13065 * eval.c (syms_of_eval):
13066 * fileio.c (syms_of_fileio):
13067 * fns.c (syms_of_fns):
13068 * frame.c (syms_of_frame):
13069 * fringe.c (syms_of_fringe):
13070 * insdel.c (syms_of_insdel):
13071 * keymap.c (syms_of_keymap):
13072 * lread.c (init_obarray, syms_of_lread):
13073 * macros.c (syms_of_macros):
13074 * msdos.c (syms_of_msdos):
13075 * print.c (syms_of_print):
13076 * process.c (syms_of_process):
13077 * search.c (syms_of_search):
13078 * sound.c (syms_of_sound):
13079 * syntax.c (init_syntax_once, syms_of_syntax):
13080 * terminal.c (syms_of_terminal):
13081 * textprop.c (syms_of_textprop):
13082 * undo.c (syms_of_undo):
13083 * w32.c (globals_of_w32):
13084 * window.c (syms_of_window):
13085 * xdisp.c (syms_of_xdisp):
13086 * xfaces.c (syms_of_xfaces):
13087 * xfns.c (syms_of_xfns):
13088 * xmenu.c (syms_of_xmenu):
13089 * xsettings.c (syms_of_xsettings):
13090 * xterm.c (syms_of_xterm): Use DEFSYM.
13091
13092 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13093
13094 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13095
13096 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13097
13098 Integer and buffer overflow fixes (Bug#8873).
13099
13100 * print.c (printchar, strout): Check for string overflow.
13101 (PRINTPREPARE, printchar, strout):
13102 Don't set size unless allocation succeeds.
13103
13104 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13105 for sizes. Check for string overflow more accurately.
13106 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13107
13108 * macros.c: Integer and buffer overflow fixes.
13109 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13110 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13111 Use ptrdiff_t, not int, for sizes.
13112 Don't increment bufsize until after realloc succeeds.
13113 Check for size-calculation overflow.
13114 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13115
13116 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13117
13118 * lread.c: Integer overflow fixes.
13119 (read_integer): Radix is now EMACS_INT, not int,
13120 to improve quality of diagnostics for out-of-range radices.
13121 Calculate buffer size correctly for out-of-range radices.
13122 (read1): Check for integer overflow in radices, and in
13123 read-circle numbers.
13124 (read_escape): Avoid int overflow.
13125 (Fload, openp, read_buffer_size, read1)
13126 (substitute_object_recurse, read_vector, read_list, map_obarray):
13127 Use ptrdiff_t, not int, for sizes.
13128 (read1): Use EMACS_INT, not int, for sizes.
13129 Check for size overflow.
13130
13131 * image.c (cache_image): Check for size arithmetic overflow.
13132
13133 * lread.c: Integer overflow issues.
13134 (saved_doc_string_size, saved_doc_string_length)
13135 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13136 Now ptrdiff_t, not int.
13137 (read1): Don't assume doc string length fits in int. Check for
13138 out-of-range doc string lengths.
13139 (read_list): Don't assume file position fits in int.
13140 (read_escape): Check for hex character overflow.
13141
13142 2011-06-22 Leo Liu <sdl.web@gmail.com>
13143
13144 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13145 Move to minibuffer.el.
13146
13147 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13148
13149 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13150 The following patches are for when GLYPH_DEBUG && !XASSERT.
13151 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13152 * dispnew.c (flush_stdout):
13153 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13154 Mark as externally visible.
13155 * dispnew.c (check_window_matrix_pointers): Now static.
13156 * dispnew.c (window_to_frame_vpos):
13157 * xfns.c (unwind_create_frame):
13158 * xterm.c (x_check_font): Remove unused local.
13159 * scroll.c (CHECK_BOUNDS):
13160 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13161 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13162 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13163 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13164 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13165 Now static.
13166 (debug_method_add): Use va_list and vsprintf rather than relying
13167 on undefined behavior with wrong number of arguments.
13168 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13169 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13170 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13171 since we're not interested in debugging glyphs with old libraries.
13172 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13173 GCC 4.6.0's static checking.
13174
13175 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13176
13177 Integer overflow and signedness fixes (Bug#8873).
13178 A few related buffer overrun fixes, too.
13179
13180 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13181
13182 * dispextern.h (struct face.stipple):
13183 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13184 (x_bitmap_mask, x_allocate_bitmap_record)
13185 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13186 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13187 (x_create_bitmap_from_xpm_data):
13188 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13189 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13190 (.bitmaps_last):
13191 * xfaces.c (load_pixmap):
13192 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13193 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13194 (.bitmaps_last, struct x_output.icon_bitmap):
13195 Use ptrdiff_t, not int, for bitmap indexes.
13196 (x_allocate_bitmap_record): Check for size overflow.
13197 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13198
13199 Use ptrdiff_t, not int, for overlay counts.
13200 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13201 * editfns.c (overlays_around, get_pos_property):
13202 * textprop.c (get_char_property_and_overlay):
13203 * xdisp.c (next_overlay_change, note_mouse_highlight):
13204 * xfaces.c (face_at_buffer_position):
13205 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13206 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13207 (Fnext_overlay_change, Fprevious_overlay_change)
13208 (mouse_face_overlay_overlaps, Foverlays_in):
13209 Use ptrdiff_t, not int, for sizes.
13210 (overlays_at, overlays_in): Check for size-calculation overflow.
13211
13212 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13213
13214 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13215 (x_session_initialize): Do not assume string length fits in int.
13216
13217 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13218 This is unlikely, but can occur if DPI is outlandish.
13219
13220 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13221 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13222
13223 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13224 * xrdb.c (magic_file_p, search_magic_path):
13225 Omit last arg SUFFIX; it was always 0. All callers changed.
13226 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13227
13228 * xfont.c (xfont_match): Avoid need for strlen.
13229
13230 * xfns.c: Don't assume strlen fits in int.
13231 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13232
13233 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13234 not unsigned long, as we prefer signed integers. All callers changed.
13235 Detect integer overflow in repeat count.
13236 (message_dolog): Don't assume print length fits in 39 bytes.
13237 (display_mode_element): Don't assume strlen fits in int.
13238
13239 * termcap.c: Don't assume sizes fit in int and never overflow.
13240 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13241 (gobble_line): Check for size-calculation overflow.
13242
13243 * minibuf.c (Fread_buffer):
13244 * lread.c (intern, intern_c_string):
13245 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13246 Don't assume string length fits in int.
13247
13248 * keyboard.c (parse_tool_bar_item):
13249 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13250
13251 * font.c: Don't assume string length fits in int.
13252 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13253 Use ptrdiff_t, not int.
13254 (font_intern_prop): Don't assume string length fits in int.
13255 Don't assume integer property fits in fixnum.
13256 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13257
13258 * filelock.c: Fix some buffer overrun and integer overflow issues.
13259 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13260 Reformulate so as not to need the command string.
13261 Invoke gzip -cd rather than gunzip, as it's more portable.
13262 (lock_info_type, lock_file_1, lock_file):
13263 Don't assume pid_t and time_t fit in unsigned long.
13264 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13265 (current_lock_owner): Prefer signed type for sizes.
13266 Use memcpy, not strncpy, where memcpy is what is really wanted.
13267 Don't assume (via atoi) that time_t and pid_t fit in int.
13268 Check for time_t and/or pid_t out of range, e.g., via a network share.
13269 Don't alloca where an auto var works fine.
13270
13271 * fileio.c: Fix some integer overflow issues.
13272 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13273 Don't assume string length fits in int.
13274 (directory_file_name): Don't assume string length fits in long.
13275 (make_temp_name): Don't assume pid fits in int, or that its print
13276 length is less than 20.
13277
13278 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13279
13280 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13281
13282 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13283
13284 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13285 We prefer signed integers, even for size calculations.
13286
13287 * emacs.c: Don't assume string length fits in 'int'.
13288 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13289 (main): Don't invoke strlen when not needed.
13290
13291 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13292 (XD_DEBUG_MESSAGE): Don't waste a byte.
13293
13294 * callproc.c (getenv_internal_1, getenv_internal)
13295 (Fgetenv_internal):
13296 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13297
13298 * lread.c (invalid_syntax): Omit length argument.
13299 All uses changed. This doesn't fix a bug, but it simplifies the
13300 code away from its former Hollerith-constant appearance, and it's
13301 one less 'int' to worry about when looking at integer-overflow issues.
13302 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13303
13304 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13305 This didn't break anything, but it didn't help either.
13306 It's confusing to put a bogus integer in a place where the actual
13307 value does not matter.
13308 (LIST_END_P): Remove unused macro and its bogus comment.
13309 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13310
13311 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13312 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13313 implementation.
13314 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13315 We prefer signed types, and the value cannot exceed the EMACS_INT
13316 range anyway (because otherwise the length would not be representable).
13317 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13318 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13319 This avoids a GCC warning when WIDE_EMACS_INT.
13320
13321 * indent.c (sane_tab_width): New function.
13322 (current_column, scan_for_column, Findent_to, position_indentation)
13323 (compute_motion): Use it. This is just for clarity.
13324 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13325
13326 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13327
13328 * lisp.h (lint_assume): New macro.
13329 * composite.c (composition_gstring_put_cache):
13330 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13331
13332 * editfns.c, insdel.c:
13333 Omit unnecessary forward decls, to simplify future changes.
13334
13335 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13336
13337 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13338
13339 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13340 Use much-faster test for byte-length change.
13341 Don't assume string byte-length fits in 'int'.
13342 Check that character arg fits in 'int'.
13343 (mapcar1): Declare byte as byte, for clarity.
13344
13345 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13346
13347 * fns.c (concat): Catch string overflow earlier.
13348 Do not rely on integer wraparound.
13349
13350 * dispextern.h (struct it.overlay_strings_charpos)
13351 (struct it.selective): Now EMACS_INT, not int.
13352 * xdisp.c (forward_to_next_line_start)
13353 (back_to_previous_visible_line_start)
13354 (reseat_at_next_visible_line_start, next_element_from_buffer):
13355 Don't arbitrarily truncate the value of 'selective' to int.
13356
13357 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13358
13359 * composite.c: Don't truncate sizes to 'int'.
13360 (composition_gstring_p, composition_reseat_it)
13361 (composition_adjust_point): Use EMACS_INT, not int.
13362 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13363 not EMACS_UINT, for indexes.
13364
13365 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13366
13367 * buffer.c: Include <verify.h>.
13368 (struct sortvec.priority, struct sortstr.priority):
13369 Now EMACS_INT, not int.
13370 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13371 (struct sortstr.size, record_overlay_string)
13372 (struct sortstrlist.size, struct sortlist.used):
13373 Don't truncate size to int.
13374 (record_overlay_string): Check for size-calculation overflow.
13375 (init_buffer_once): Check at compile-time, not run-time.
13376
13377 2011-06-22 Jim Meyering <meyering@redhat.com>
13378
13379 Don't leak an XBM-image-sized buffer
13380 * image.c (xbm_load): Free the image buffer after using it.
13381
13382 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13383
13384 Port to Sun C.
13385 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13386 that Sun C diagnosed.
13387 * fns.c (secure_hash): Fix pointer signedness issue.
13388 * intervals.c (static_offset_intervals): New function.
13389 (offset_intervals): Use it.
13390
13391 2011-06-21 Leo Liu <sdl.web@gmail.com>
13392
13393 * deps.mk (fns.o):
13394 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13395 sha512.h.
13396
13397 * fns.c (secure_hash): Rename from crypto_hash_function and change
13398 the first arg to accept symbols.
13399 (Fsecure_hash): New primitive.
13400 (syms_of_fns): New symbols.
13401
13402 2011-06-20 Deniz Dogan <deniz@dogan.se>
13403
13404 * process.c (Fset_process_buffer): Clarify return value in
13405 docstring.
13406
13407 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
13408
13409 * dispnew.c (add_window_display_history): Use BVAR.
13410
13411 * xdisp.c (debug_method_add): Use BVAR.
13412 (check_window_end, dump_glyph_matrix, dump_glyph)
13413 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13414
13415 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13416 Likewise.
13417
13418 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13419 check till after the cache is created in init_frame_faces.
13420
13421 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13422
13423 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13424
13425 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13426
13427 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13428 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13429 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13430
13431 Improve buffer-overflow checking (Bug#8873).
13432 * fileio.c (Finsert_file_contents):
13433 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13434 Remove the old (too-loose) buffer overflow checks.
13435 They weren't needed, since make_gap checks for buffer overflow.
13436 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13437 The old code merely checked for Emacs fixnum overflow, and relied
13438 on undefined (wraparound) behavior. The new code avoids undefined
13439 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13440
13441 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13442 Tune. Don't use wider integers than needed. Don't use alloca.
13443 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13444
13445 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13446
13447 * insdel.c, lisp.h (buffer_overflow): New function.
13448 (insert_from_buffer_1, replace_range, replace_range_2):
13449 * insdel.c (make_gap_larger):
13450 * editfns.c (Finsert_char):
13451 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13452
13453 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13454
13455 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13456
13457 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13458
13459 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13460 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13461
13462 * fileio.c: Don't assume EMACS_INT fits in off_t.
13463 (emacs_lseek): New static function.
13464 (Finsert_file_contents, Fwrite_region): Use it.
13465 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13466
13467 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13468
13469 * fns.c: Don't overflow int when computing a list length.
13470 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13471 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13472 truncation on 64-bit hosts. Check for QUIT every
13473 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13474 faster and is responsive enough.
13475 (Flength): Report an error instead of overflowing an integer.
13476 (Fsafe_length): Return a float if the value is not representable
13477 as a fixnum. This shouldn't happen except in contrived situations.
13478 (Fnthcdr, Fsort): Don't assume list length fits in int.
13479 (Fcopy_sequence): Don't assume vector length fits in int.
13480
13481 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13482 (header_size, word_size): New constants.
13483 (allocate_vectorlike): Don't check size overflow here.
13484 (allocate_vector): Check it here instead, since this is the only
13485 caller of allocate_vectorlike that could cause overflow.
13486 Check that the new vector's length is representable as a fixnum.
13487
13488 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13489 The previous code was bogus. For example, next_almost_prime (32)
13490 returned 39, which is undesirable as it is a multiple of 3; and
13491 next_almost_prime (24) returned 25, which is a multiple of 5 so
13492 why was the code bothering to check for multiples of 7?
13493
13494 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13495
13496 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13497
13498 Variadic C functions now count arguments with ptrdiff_t.
13499 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13500 Back then I didn't know that the Emacs coding style prefers signed int.
13501 Also, in the meantime I found a few more instances where arguments
13502 were being counted with int, which may truncate counts on 64-bit
13503 machines, or EMACS_INT, which may be unnecessarily wide.
13504 * lisp.h (struct Lisp_Subr.function.aMANY)
13505 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13506 Arg counts are now ptrdiff_t, not size_t.
13507 All variadic functions and their callers changed accordingly.
13508 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13509 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13510 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13511 * callint.c (Fcall_interactively): Check arg count for overflow,
13512 to avoid potential buffer overrun. Use signed char, not 'int',
13513 for 'varies' array, so that we needn't bother to check its size
13514 calculation for overflow.
13515 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13516 * eval.c (apply_lambda):
13517 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13518 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13519 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13520
13521 * callint.c (Fcall_interactively): Don't use index var as event count.
13522
13523 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13524 * mem-limits.h (SIZE): Remove; no longer used.
13525
13526 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13527
13528 Remove unnecessary casts.
13529 * xterm.c (x_term_init):
13530 * xfns.c (x_set_border_pixel):
13531 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13532 These aren't needed now that we assume ANSI C.
13533
13534 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13535 It's more likely to cause problems (due to unsigned overflow)
13536 than to cure them.
13537
13538 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13539
13540 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13541
13542 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13543
13544 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13545
13546 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13547
13548 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13549
13550 GLYPH_CODE_FACE returns EMACS_INT, not int.
13551 * dispextern.h (merge_faces):
13552 * xfaces.c (merge_faces):
13553 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13554 Don't assume EMACS_INT fits in int.
13555
13556 * character.h (CHAR_VALID_P): Remove unused parameter.
13557 * fontset.c, lisp.h, xdisp.c: All uses changed.
13558
13559 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13560
13561 * fns.c (concat): Minor tuning based on overflow analysis.
13562 This doesn't fix any bugs. Use int to hold character, instead
13563 of constantly refetching from Emacs object. Use XFASTINT, not
13564 XINT, for value known to be a character. Don't bother comparing
13565 a single byte to 0400, as it's always less.
13566
13567 * floatfns.c (Fexpt):
13568 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13569
13570 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13571 for characters.
13572
13573 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13574
13575 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13576 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13577 incorrectly succeed when S was a string, because 4294967386 was
13578 truncated before it was used.
13579
13580 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13581 Otherwise, an out-of-range integer could cause undefined behavior
13582 on a 64-bit host.
13583
13584 * composite.c: Use int, not EMACS_INT, for characters.
13585 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13586 EMACS_INT, for values that are known to be in character range.
13587 This doesn't fix any bugs but is the usual style inside Emacs and
13588 may generate better code on 32-bit machines.
13589
13590 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13591 This is for reasons similar to the recent CHAR_STRING fix.
13592 * charset.c (Fencode_char): Check that character arg is actually
13593 a character. Pass an int to ENCODE_CHAR.
13594 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13595 wider than 'int', as a compile-time check to prevent future regressions
13596 in this area.
13597
13598 * character.c (char_string): Remove unnecessary casts.
13599
13600 Make sure a 64-bit char is never passed to CHAR_STRING.
13601 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13602 by silently ignoring the top 32 bits, allowing some values
13603 that were far too large to be valid characters.
13604 * character.h: Include <verify.h>.
13605 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13606 arguments are no wider than unsigned, as a compile-time check
13607 to prevent future regressions in this area.
13608 * data.c (Faset):
13609 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13610 (Fsubst_char_in_region):
13611 * fns.c (concat):
13612 * xdisp.c (decode_mode_spec_coding):
13613 Adjust to CHAR_STRING's new requirement.
13614 * editfns.c (Finsert_char, Fsubst_char_in_region):
13615 * fns.c (concat): Check that character args are actually
13616 characters. Without this test, these functions did the wrong
13617 thing with wildly out-of-range values on 64-bit hosts.
13618
13619 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13620 These casts should not be needed on 32-bit hosts, either.
13621 * keyboard.c (read_char):
13622 * lread.c (Fload): Remove casts to unsigned.
13623
13624 * lisp.h (UNSIGNED_CMP): New macro.
13625 This fixes comparison bugs on 64-bit hosts.
13626 (ASCII_CHAR_P): Use it.
13627 * casefiddle.c (casify_object):
13628 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13629 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13630 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13631 * dispextern.h (FACE_FROM_ID):
13632 * keyboard.c (read_char): Use UNSIGNED_CMP.
13633
13634 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13635 not to EMACS_INT, to avoid GCC warning.
13636
13637 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13638
13639 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13640 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13641 isn't needed on 32-bit machines.
13642
13643 * buffer.c (Fgenerate_new_buffer_name):
13644 Use EMACS_INT for count, not int.
13645 (advance_to_char_boundary): Return EMACS_INT, not int.
13646
13647 * data.c (Qcompiled_function): Now static.
13648
13649 * window.c (window_body_lines): Now static.
13650
13651 * image.c (gif_load): Rename local to avoid shadowing.
13652
13653 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13654 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13655 * alloc.c (make_save_value): Integer argument is now of type
13656 ptrdiff_t, not int.
13657 (mark_object): Use ptrdiff_t, not int.
13658 * lisp.h (pD): New macro.
13659 * print.c (print_object): Use it.
13660
13661 * alloc.c: Use EMACS_INT, not int, to count objects.
13662 (total_conses, total_markers, total_symbols, total_vector_size)
13663 (total_free_conses, total_free_markers, total_free_symbols)
13664 (total_free_floats, total_floats, total_free_intervals)
13665 (total_intervals, total_strings, total_free_strings):
13666 Now EMACS_INT, not int. All uses changed.
13667 (Fgarbage_collect): Compute overall total using a double, so that
13668 integer overflow is less likely to be a problem. Check for overflow
13669 when converting back to an integer.
13670 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13671 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13672 These were 'int' variables that could overflow on 64-bit hosts;
13673 they were never used, so remove them instead of repairing them.
13674 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13675 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13676 Previously, this ceilinged at INT_MAX, but that doesn't work on
13677 64-bit machines.
13678 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13679
13680 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13681 (allocate_vectorlike): Check for ptrdiff_t overflow.
13682 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13683 when a (possibly-narrower) signed value would do just as well.
13684 We prefer using signed arithmetic, to avoid comparison confusion.
13685
13686 * alloc.c: Catch some string size overflows that we were missing.
13687 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13688 for convenience in STRING_BYTES_MAX.
13689 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13690 The definition here is exact; the one in lisp.h was approximate.
13691 (allocate_string_data): Check for string overflow. This catches
13692 some instances we weren't catching before. Also, it catches
13693 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13694 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13695 and ptrdiff_t and EMACS_INT are both 64 bits.
13696
13697 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13698 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13699 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13700
13701 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13702
13703 * alloc.c (Fmake_string): Check for out-of-range init.
13704
13705 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13706
13707 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13708
13709 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13710
13711 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13712 xg_get_default_scrollbar_width.
13713
13714 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13715 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13716 (style_changed_cb): Call update_theme_scrollbar_width and call
13717 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13718 all frames (Bug#8505).
13719 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13720 Call gtk_window_set_resizable if HAVE_GTK3.
13721 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13722 and height if HAVE_GTK3 (Bug#8505).
13723 (scroll_bar_width_for_theme): New variable.
13724 (update_theme_scrollbar_width): New function.
13725 (xg_get_default_scrollbar_width): Move code to
13726 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13727 (xg_initialize): Call update_theme_scrollbar_width.
13728
13729 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13730
13731 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13732
13733 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13734
13735 * frame.c (make_frame): Call other_buffer_safely instead of
13736 other_buffer.
13737
13738 * window.c (temp_output_buffer_show): Call display_buffer with
13739 second argument Vtemp_buffer_show_specifiers and reset latter
13740 immediately after the call.
13741 (Vtemp_buffer_show_specifiers): New variable.
13742 (auto_window_vscroll_p, next_screen_context_lines)
13743 (Vscroll_preserve_screen_position): Remove leading asterisks from
13744 doc-strings.
13745
13746 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13747
13748 Fix minor problems found by GCC 4.6.0 static checking.
13749 * buffer.c (Qclone_number): Remove for now, as it's unused.
13750 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13751 (record_buffer): Remove unused local.
13752 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13753 (set_frame_buffer_list): Remove; unused.
13754 * frame.h (other_visible_frames): Remove decl.
13755 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13756 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13757 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13758 if HAVE_GPM.
13759 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13760 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13761 Define only if HAVE_GPM.
13762 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13763 (update_hints_inhibit): Remove; never set. All uses removed.
13764 * widgetprv.h (emacsFrameClassRec): Remove decl.
13765 * window.c (delete_deletable_window): Now returns void, since it
13766 wasn't returning anything.
13767 (compare_window_configurations): Remove unused locals.
13768 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13769 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13770 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13771 the same widths as pointers. This follows up on the 2011-05-06 patch.
13772 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13773 * xterm.h: Likewise.
13774 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13775
13776 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13777
13778 * makefile.w32-in: Update dependencies.
13779 (LISP_H): Add lib/intprops.h.
13780
13781 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13782
13783 * image.c (gif_load): Add animation frame delay to the metadata.
13784 (syms_of_image): Use DEFSYM. New symbol `delay'.
13785
13786 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13787
13788 * window.c (delete_deletable_window): Re-add.
13789 (Fset_window_configuration): Rewrite to handle dead buffers and
13790 consequently deletable windows.
13791 (window_tree, Fwindow_tree): Remove. Supply functionality in
13792 window.el.
13793 (compare_window_configurations): Simplify code.
13794
13795 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13796
13797 * image.c (imagemagick_load_image): Fix type mismatch.
13798 (Fimagemagick_types): Likewise.
13799
13800 * window.h (replace_buffer_in_windows): Declare.
13801
13802 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13803
13804 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13805 Qclone_number. Remove external declaration of Qdelete_window.
13806 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13807 code.
13808 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13809 Run Qbuffer_list_update_hook if allowed.
13810 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13811 buffer list implementation.
13812 (other_buffer_safely): New function.
13813 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13814 calls to replace_buffer_in_windows and
13815 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13816 if allowed.
13817 (record_buffer): Inhibit quitting and rewrite using quittable
13818 functions. Run Qbuffer_list_update_hook if allowed.
13819 (Frecord_buffer, Funrecord_buffer): New functions.
13820 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13821 Move switch-to-buffer to window.el.
13822 (bury-buffer): Move to window.el.
13823 (Vbuffer_list_update_hook): New variable.
13824
13825 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13826 section.
13827
13828 * window.h (resize_frame_windows): Move up in code.
13829 (Fwindow_frame): Remove EXFUN.
13830 (replace_buffer_in_all_windows): Remove prototype.
13831 (replace_buffer_in_windows_safely): Add prototype.
13832
13833 * window.c: Declare Qdelete_window static again. Move down
13834 declaration of select_count.
13835 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13836 (Fother_window): Move to window.el.
13837 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13838 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13839 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13840 window.el.
13841 (replace_buffer_in_windows): Implement by calling
13842 Qreplace_buffer_in_windows.
13843 (replace_buffer_in_all_windows): Remove with some functionality
13844 moved into replace_buffer_in_windows_safely.
13845 (replace_buffer_in_windows_safely): New function.
13846 (select_window_norecord, select_frame_norecord): Move in front
13847 of run_window_configuration_change_hook. Remove now obsolete
13848 declarations.
13849 (Fset_window_buffer): Rewrite doc-string.
13850 Call Qrecord_window_buffer.
13851 (keys_of_window): Move binding for other-window to window.el.
13852
13853 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13854
13855 * dispextern.h (struct image): Replace data member, whose int_val
13856 and ptr_val fields were not used by anything, with a single
13857 lisp_val object.
13858
13859 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13860 (gif_clear_image, gif_load, imagemagick_load_image)
13861 (gs_clear_image, gs_load): Callers changed.
13862
13863 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13864
13865 * buffer.h: Include <time.h>, for time_t.
13866 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13867
13868 Fix minor problems found by static checking.
13869
13870 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13871
13872 Make identifiers static if they are not used in other modules.
13873 * data.c (Qcompiled_function, Qframe, Qvector):
13874 * image.c (QimageMagick, Qsvg):
13875 * minibuf.c (Qmetadata):
13876 * window.c (resize_window_check, resize_root_window): Now static.
13877 * window.h (resize_window_check, resize_root_window): Remove decls.
13878
13879 * window.c (window_deletion_count, delete_deletable_window):
13880 Remove; unused.
13881 (window_body_lines): Now static.
13882 (Fdelete_other_windows_internal): Mark vars as initialized.
13883 Make sure 'resize_failed' is initialized.
13884 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13885 (resize_window_apply): Remove unused local.
13886 * window.h (delete_deletable_window): Remove decl.
13887
13888 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13889 (imagemagick_load_image): Fix pointer signedness problem by changing
13890 last arg from unsigned char * to char *. All uses changed.
13891 Also, fix a local for similar reasons.
13892 Remove unused locals. Remove locals to avoid shadowing.
13893 (fn_rsvg_handle_free): Remove; unused.
13894 (svg_load, svg_load_image): Fix pointer signedness problem.
13895 (imagemagick_load_image): Don't use garbage pointer image_wand.
13896
13897 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13898
13899 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13900
13901 * image.c (gif_load): Fix omitted cast error introduced by
13902 2011-06-06 change.
13903
13904 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13905
13906 * window.h (resize_proportionally, orig_total_lines)
13907 (orig_top_line): Remove from window structure.
13908 (set_window_height, set_window_width, change_window_heights)
13909 (Fdelete_window): Remove prototypes.
13910 (resize_frame_windows): Remove duplicate declaration.
13911
13912 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13913
13914 * window.h (resize_frame_windows, resize_window_check)
13915 (delete_deletable_window, resize_root_window)
13916 (resize_frame_windows): Declare prototypes.
13917
13918 * window.c (resize_window_apply): Make definition be "static" to
13919 match the prototype.
13920
13921 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13922
13923 * window.c: Remove declarations of Qwindow_size_fixed,
13924 window_min_size_1, window_min_size_2, window_min_size,
13925 size_window, window_fixed_size_p, enlarge_window, delete_window.
13926 Remove static from declaration of Qdelete_window, it's
13927 temporarily needed by Fbury_buffer.
13928 (replace_window): Don't assign orig_top_line and
13929 orig_total_lines.
13930 (Fdelete_window, delete_window): Remove. Window deletion is
13931 handled by window.el.
13932 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13933 Replace Fdelete_window calls with calls to Qdelete_window.
13934 (Fdelete_other_windows): Remove. Deleting other windows is
13935 handled by window.el.
13936 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13937 handled in window.el.
13938 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13939 Window minimum sizes are handled in window.el.
13940 (shrink_windows, size_window, set_window_height)
13941 (set_window_width, change_window_heights, window_height)
13942 (window_width, CURBEG, CURSIZE, enlarge_window)
13943 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13944 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13945 handled in window.el.
13946 (make_dummy_parent): Rename to make_parent_window and give it a
13947 second argument horflag.
13948 (make_window): Don't set resize_proportionally any more.
13949 (Fsplit_window): Remove. Windows are split in window.el.
13950 (save_restore_action, save_restore_orig_size)
13951 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13952 Resize mini windows in window.el.
13953 (grow_mini_window, shrink_mini_window): Implement by calling
13954 Qresize_root_window_vertically, resize_window_check and
13955 resize_window_apply.
13956 (saved_window, Fset_window_configuration, save_window_save):
13957 Do not handle orig_top_line, orig_total_lines, and
13958 resize_proportionally.
13959 (window_min_height, window_min_width): Move to window.el.
13960 (keys_of_window): Move bindings for delete-other-windows,
13961 split-window, delete-window and enlarge-window to window.el.
13962
13963 * buffer.c: Temporarily extern Qdelete_window.
13964 (Fbury_buffer): Temporarily call Qdelete_window instead of
13965 Fdelete_window (Fbury_buffer will move to window.el soon).
13966
13967 * frame.c (set_menu_bar_lines_1): Remove code handling
13968 orig_top_line and orig_total_lines.
13969
13970 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13971 set_window_height but set heights directly.
13972 (change_frame_size_1): Use resize_frame_windows.
13973
13974 * xdisp.c (init_xdisp): Don't use set_window_height but set
13975 heights directly.
13976
13977 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13978 Use resize_frame_windows instead of change_window_heights and run
13979 run_window_configuration_change_hook.
13980
13981 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13982 instead of change_window_heights and run
13983 run_window_configuration_change_hook.
13984
13985 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13986
13987 * window.c (replace_window): Rename second argument REPLACEMENT to
13988 NEW. New third argument SETFLAG. Rewrite.
13989 (delete_window, make_dummy_parent): Call replace_window with
13990 third argument 1.
13991 (window_list_1): Move down in code.
13992 (run_window_configuration_change_hook): Move set_buffer part
13993 before select_frame_norecord part in order to unwind correctly.
13994 Rename count1 to count.
13995 (recombine_windows, delete_deletable_window, resize_root_window)
13996 (Fdelete_other_windows_internal)
13997 (Frun_window_configuration_change_hook, make_parent_window)
13998 (resize_window_check, resize_window_apply, Fresize_window_apply)
13999 (resize_frame_windows, Fsplit_window_internal)
14000 (Fdelete_window_internal, Fresize_mini_window_internal):
14001 New functions.
14002 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14003
14004 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14005
14006 * window.h (window): Add some new members to window structure -
14007 normal_lines, normal_cols, new_total, new_normal, clone_number,
14008 splits, nest, prev_buffers, next_buffers.
14009 (WINDOW_TOTAL_SIZE): Move here from window.c.
14010 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14011
14012 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14013 Remove.
14014 (make_dummy_parent): Set new members of windows structure.
14015 (make_window): Move down in code. Handle new members of window
14016 structure.
14017 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14018 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14019 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14020 (Fset_window_prev_buffers, Fwindow_next_buffers)
14021 (Fset_window_next_buffers, Fset_window_clone_number):
14022 New functions.
14023 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14024 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14025 Doc-string fixes.
14026 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14027 Argument WINDOW can be now internal window too.
14028 (Fwindow_use_time): Move up in code.
14029 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14030 Rewrite doc-string.
14031 (Fset_window_configuration, saved_window)
14032 (Fcurrent_window_configuration, save_window_save): Handle new
14033 members of window structure.
14034 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14035 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14036 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14037 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14038 Qget_mru_window, Qresize_root_window,
14039 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14040 Qauto_buffer_name; staticpro them.
14041
14042 2011-06-07 Martin Rudalics <rudalics@gmx.at>
14043
14044 * window.c (Fwindow_total_size, Fwindow_left_column)
14045 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14046 (Fwindow_list_1): New functions.
14047 (window_box_text_cols): Replace with window_body_cols.
14048 (Fwindow_width, Fscroll_left, Fscroll_right):
14049 Use window_body_cols instead of window_box_text_cols.
14050 (delete_window, Fset_window_configuration):
14051 Call delete_all_subwindows with window as argument.
14052 (delete_all_subwindows): Take a window as argument and not a
14053 structure. Rewrite.
14054 (window_loop): Remove handling of GET_LRU_WINDOW and
14055 GET_LARGEST_WINDOW.
14056 (Fget_lru_window, Fget_largest_window): Move to window.el.
14057
14058 * window.h: Extern window_body_cols instead of
14059 window_box_text_cols. delete_all_subwindows now takes a
14060 Lisp_Object as argument.
14061
14062 * indent.c (compute_motion, Fcompute_motion):
14063 Use window_body_cols instead of window_box_text_cols.
14064
14065 * frame.c (delete_frame): Call delete_all_subwindows with root
14066 window as argument.
14067
14068 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14069
14070 * fns.c (Fputhash): Document return value.
14071
14072 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
14073
14074 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14075
14076 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14077
14078 Cons<->int and similar integer overflow fixes (Bug#8794).
14079
14080 Check for overflow when converting integer to cons and back.
14081 * charset.c (Fdefine_charset_internal, Fdecode_char):
14082 Use cons_to_unsigned to catch overflow.
14083 (Fencode_char): Use INTEGER_TO_CONS.
14084 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14085 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14086 * data.c (long_to_cons, cons_to_long): Remove.
14087 (cons_to_unsigned, cons_to_signed): New functions.
14088 These signal an error for invalid or out-of-range values.
14089 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14090 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14091 * font.c (Ffont_variation_glyphs):
14092 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14093 * lisp.h: Include <intprops.h>.
14094 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14095 (cons_to_signed, cons_to_unsigned): New decls.
14096 (long_to_cons, cons_to_long): Remove decls.
14097 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14098 (Fprimitive_undo): Use CONS_TO_INTEGER.
14099 * xfns.c (Fx_window_property): Likewise.
14100 * xselect.c: Include <limits.h>.
14101 (x_own_selection, selection_data_to_lisp_data):
14102 Use INTEGER_TO_CONS.
14103 (x_handle_selection_request, x_handle_selection_clear)
14104 (x_get_foreign_selection, Fx_disown_selection_internal)
14105 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14106 (lisp_data_to_selection_data): Use cons_to_unsigned.
14107 (x_fill_property_data): Use cons_to_signed.
14108 Report values out of range.
14109
14110 Check for buffer and string overflow more precisely.
14111 * buffer.h (BUF_BYTES_MAX): New macro.
14112 * lisp.h (STRING_BYTES_MAX): New macro.
14113 * alloc.c (Fmake_string):
14114 * character.c (string_escape_byte8):
14115 * coding.c (coding_alloc_by_realloc):
14116 * doprnt.c (doprnt):
14117 * editfns.c (Fformat):
14118 * eval.c (verror):
14119 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14120 since they may not be the same number.
14121 * editfns.c (Finsert_char):
14122 * fileio.c (Finsert_file_contents):
14123 Likewise for BUF_BYTES_MAX.
14124
14125 * image.c: Use ptrdiff_t, not int, for sizes.
14126 (slurp_file): Switch from int to ptrdiff_t.
14127 All uses changed.
14128 (slurp_file): Check that file size fits in both size_t (for
14129 malloc) and ptrdiff_t (for sanity and safety).
14130
14131 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14132 if b->modtime has its maximal value.
14133
14134 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14135
14136 Don't assume time_t can fit into int.
14137 * buffer.h (struct buffer.modtime): Now time_t, not int.
14138 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14139 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14140
14141 Minor fixes for signed vs unsigned integers.
14142 * character.h (MAYBE_UNIFY_CHAR):
14143 * charset.c (maybe_unify_char):
14144 * keyboard.c (read_char, reorder_modifiers):
14145 XINT -> XFASTINT, since the integer must be nonnegative.
14146 * ftfont.c (ftfont_spec_pattern):
14147 * keymap.c (access_keymap, silly_event_symbol_error):
14148 XUINT -> XFASTINT, since the integer must be nonnegative.
14149 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14150 since it makes no difference and we prefer signed.
14151 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14152 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14153 nonnegative.
14154
14155 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14156
14157 * window.h (Fwindow_frame): Declare.
14158
14159 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14160
14161 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14162 (SPARE_MEMORY): Always define.
14163 (LARGE_REQUEST): Remove.
14164 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14165
14166 2011-06-06 Martin Rudalics <rudalics@gmx.at>
14167
14168 * lisp.h: Move EXFUNS for Fframe_root_window,
14169 Fframe_first_window and Fset_frame_selected_window to window.h.
14170
14171 * window.h: Move EXFUNS for Fframe_root_window,
14172 Fframe_first_window and Fset_frame_selected_window here from
14173 lisp.h.
14174
14175 * frame.c (Fwindow_frame, Fframe_first_window)
14176 (Fframe_root_window, Fframe_selected_window)
14177 (Fset_frame_selected_window): Move to window.c.
14178 (Factive_minibuffer_window): Move to minibuf.c.
14179 (Fother_visible_frames_p): New function.
14180
14181 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14182
14183 * window.c (decode_window, decode_any_window): Move up in code.
14184 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14185 (inhibit_frame_unsplittable): Remove unused variable.
14186 (Fwindow_buffer): Move up and rewrite doc-string.
14187 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14188 (Fwindow_prev): New functions.
14189 (Fwindow_frame): Move here from frame.c. Accept any window as
14190 argument.
14191 (Fframe_root_window, Fframe_first_window)
14192 (Fframe_selected_window): Move here from frame.c. Accept frame
14193 or arbitrary window as argument. Update doc-strings.
14194 (Fminibuffer_window): Move up in code.
14195 (Fwindow_minibuffer_p): Move up in code and simplify.
14196 (Fset_frame_selected_window): Move here from frame.c.
14197 Marginal rewrite.
14198 (Fselected_window, select_window, Fselect_window): Move up in
14199 code. Minor doc-string fixes.
14200
14201 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14202
14203 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14204 Do not assume that spare memory exists; that assumption is valid
14205 only if SYSTEM_MALLOC.
14206 (LARGE_REQUEST): New macro, so that the issue of large requests
14207 is separated from the issue of spare memory.
14208
14209 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14210
14211 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14212 format. (Bug#8806)
14213
14214 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14215
14216 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14217 before statements.
14218
14219 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14220
14221 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14222
14223 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14224
14225 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14226 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14227
14228 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
14229
14230 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14231
14232 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
14233
14234 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14235 (x_clipboard_manager_save): Add return value.
14236 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14237 New error handlers.
14238 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14239 Obey Vx_select_enable_clipboard_manager. Catch errors in
14240 x_clipboard_manager_save (Bug#8779).
14241 (Vx_select_enable_clipboard_manager): New variable.
14242 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14243
14244 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
14245
14246 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14247
14248 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14249
14250 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14251 in the current matrix if keep_current_p is non-zero.
14252
14253 2011-06-04 Eli Zaretskii <eliz@gnu.org>
14254
14255 * bidi.c (bidi_level_of_next_char): Fix last change.
14256
14257 2011-06-03 Eli Zaretskii <eliz@gnu.org>
14258
14259 Support bidi reordering of text covered by display properties.
14260
14261 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14262 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14263 (bidi_cache_search, bidi_cache_iterator_state)
14264 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14265 (bidi_level_of_next_char, bidi_move_to_visually_next):
14266 Support character positions inside a run of characters covered by a
14267 display string.
14268 (bidi_paragraph_init, bidi_resolve_explicit_1)
14269 (bidi_level_of_next_char): Call bidi_fetch_char and
14270 bidi_fetch_char_advance instead of FETCH_CHAR and
14271 FETCH_CHAR_ADVANCE.
14272 (bidi_init_it): Initialize new members.
14273 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14274 definitions.
14275 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14276 instead of using explicit *_CHAR codes.
14277 (bidi_resolve_explicit, bidi_resolve_weak):
14278 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14279 bidirectional text is supported only in multibyte buffers.
14280 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14281 it to initialize the frame_window_p member of struct bidi_it.
14282 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14283 (bidi_resolve_explicit, bidi_resolve_weak)
14284 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14285 bidi_it->nchars is non-positive.
14286 (bidi_level_of_next_char): Don't try to lookup the cache for the
14287 next/previous character if nothing is cached there yet, or if we
14288 were just reseat()'ed to a new position.
14289
14290 * xdisp.c (set_cursor_from_row): Set start and stop points
14291 according to the row's direction when priming the loop that looks
14292 for the glyph on which to display cursor.
14293 (single_display_spec_intangible_p): Function deleted.
14294 (display_prop_intangible_p): Reimplement to call
14295 handle_display_spec instead of single_display_spec_intangible_p.
14296 Accept 3 additional arguments needed by handle_display_spec.
14297 This fixes incorrect cursor motion across display property with complex
14298 values: lists, `(when COND...)' forms, etc.
14299 (single_display_spec_string_p): Support property values that are
14300 lists with the argument STRING its top-level element.
14301 (display_prop_string_p): Fix the condition for processing a
14302 property that is a list to be consistent with handle_display_spec.
14303 (handle_display_spec): New function, refactored from the
14304 last portion of handle_display_prop.
14305 (compute_display_string_pos): Accept additional argument
14306 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14307 value of a `display' property is a "replacing spec".
14308 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14309 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14310 the display property, but just return a value indicating whether
14311 the display property will replace the characters it covers.
14312 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14313 frame_window_p members of struct bidi_it.
14314 (compute_display_string_pos, compute_display_string_end):
14315 New functions.
14316 (push_it): Accept second argument POSITION, where pop_it should
14317 jump to continue iteration.
14318 (reseat_1): Initialize bidi_it.disp_pos.
14319
14320 * keyboard.c (adjust_point_for_property): Adjust the call to
14321 display_prop_intangible_p to its new signature.
14322
14323 * dispextern.h (struct bidi_it): New member frame_window_p.
14324 (bidi_init_it): Update prototypes.
14325 (display_prop_intangible_p): Update prototype.
14326 (compute_display_string_pos, compute_display_string_end):
14327 Declare prototypes.
14328 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14329 EMACS_INT.
14330
14331 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14332
14333 Malloc failure behavior now depends on size of allocation.
14334 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14335 * lisp.h: Change signatures accordingly.
14336 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14337 All callers changed. (Bug#8762)
14338
14339 * gnutls.c: Use Emacs's memory allocators.
14340 Without this change, the gnutls library would invoke malloc etc.
14341 directly, which causes problems on non-SYNC_INPUT hosts, and which
14342 runs afoul of improving memory_full behavior. (Bug#8761)
14343 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14344 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14345 xfree instead of the default malloc, realloc, free.
14346 (Fgnutls_boot): No need to check for memory allocation failure,
14347 since xmalloc does that for us.
14348
14349 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14350 * category.c (hash_get_category_set):
14351 * ccl.c (ccl_driver):
14352 * charset.c (Fdefine_charset_internal):
14353 * charset.h (struct charset.hash_index):
14354 * composite.c (get_composition_id, gstring_lookup_cache)
14355 (composition_gstring_put_cache):
14356 * composite.h (struct composition.hash_index):
14357 * dispextern.h (struct image.hash):
14358 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14359 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14360 (hashfn_equal, hashfn_user_defined, make_hash_table)
14361 (maybe_resize_hash_table, hash_lookup, hash_put)
14362 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14363 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14364 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14365 * image.c (make_image, search_image_cache, lookup_image)
14366 (xpm_put_color_table_h):
14367 * lisp.h (struct Lisp_Hash_Table):
14368 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14369 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14370 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14371 * alloc.c (allocate_vectorlike):
14372 Check for overflow in vector size calculations.
14373 * ccl.c (ccl_driver):
14374 Check for overflow when converting EMACS_INT to int.
14375 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14376 need to be updated by these changes.
14377 * fns.c (make_hash_table, maybe_resize_hash_table):
14378 Check for integer overflow with large hash tables.
14379 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14380 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14381 (SXHASH_REDUCE): New macro.
14382 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14383 Use it instead of discarding useful hash info with large hash values.
14384 (sxhash_float): New function.
14385 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14386 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14387 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14388 Rewrite to use FIXNUM_BITS, as this simplifies things.
14389 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14390 Adjust signatures to match updated version of code.
14391 (consing_since_gc): Now EMACS_INT, since a single hash table can
14392 use more than INT_MAX bytes.
14393
14394 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14395
14396 Make it possible to build with GCC-4.6+ -O2 -flto.
14397
14398 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14399
14400 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14401
14402 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14403 Call minibuffer-inactive-mode.
14404
14405 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
14406
14407 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14408 Update dependencies.
14409
14410 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14411
14412 * data.c (init_data): Remove code for UTS, this system is not
14413 supported anymore.
14414
14415 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14416
14417 Don't force ./temacs to start in terminal mode.
14418
14419 * frame.c (make_initial_frame): Initialize faces in all cases, not
14420 only when CANNOT_DUMP is defined.
14421 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14422
14423 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14424
14425 * dispnew.c (add_window_display_history): Use const for the string
14426 pointer. Remove declaration, not needed.
14427
14428 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14429
14430 Use 'inline', not 'INLINE'.
14431 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14432 * alloc.c, fontset.c (INLINE): Remove.
14433 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14434 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14435 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14436 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14437 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14438
14439 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14440
14441 Make it possible to run ./temacs.
14442
14443 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14444 syms_of_callproc does the same thing. Remove test for
14445 "initialized", do it in the caller.
14446 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14447
14448 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14449
14450 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14451 (read_minibuf): Use get_minibuffer.
14452 (syms_of_minibuf): Use DEFSYM.
14453 (Qmetadata): New var.
14454 * data.c (Qbuffer): Don't make it static.
14455 (syms_of_data): Use DEFSYM.
14456
14457 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14458
14459 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14460 (CCL_CODE_MIN): New macro.
14461
14462 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14463
14464 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14465
14466 * eval.c (Qdebug): Now static.
14467 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14468 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14469 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14470
14471 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14472
14473 * image.c: Various fixes to ImageMagick code comments.
14474 (Fimagemagick_types): Doc fix.
14475
14476 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14477
14478 Minor fixes prompted by GCC 4.6.0 warnings.
14479
14480 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14481
14482 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14483 (x_clipboard_manager_save_all): Move extern decl to ...
14484 * xterm.h: ... here, so that it can be checked for consistency.
14485
14486 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14487
14488 * xselect.c (x_clipboard_manager_save_frame)
14489 (x_clipboard_manager_save_all): New functions.
14490 (Fx_clipboard_manager_save): Lisp function deleted.
14491
14492 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14493 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14494
14495 * xterm.h: Update prototype.
14496
14497 2011-05-28 William Xu <william.xwl@gmail.com>
14498
14499 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14500 exiting (Bug#8239).
14501
14502 2011-05-28 Jim Meyering <meyering@redhat.com>
14503
14504 Avoid a sign-extension bug in crypto_hash_function.
14505 * fns.c (to_uchar): Define.
14506 (crypto_hash_function): Use it to convert some newly-signed
14507 variables to unsigned, to avoid sign-extension bugs. For example,
14508 without this change, (md5 "truc") would evaluate to
14509 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14510 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14511 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14512
14513 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14514
14515 Integer overflow fixes.
14516
14517 * dbusbind.c: Serial number integer overflow fixes.
14518 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14519 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14520 to hold a serial number that is too large for a fixnum.
14521 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14522 Check for serial numbers out of range. Decode any serial number
14523 that was so large that it became a float. (Bug#8722)
14524
14525 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14526 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14527 Use XFASTINT rather than XUINT when numbers are nonnegative.
14528 (xd_append_arg, Fdbus_method_return_internal):
14529 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14530 arguments, check that Lisp number is nonnegative, rather than
14531 silently wrapping negative numbers around. (Bug#8722)
14532 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14533 (Bug#8722)
14534
14535 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14536
14537 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14538
14539 ccl: Add integer overflow checks.
14540 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14541 (IN_INT_RANGE): New macros.
14542 (ccl_driver): Use them to check for integer overflow when
14543 decoding a CCL program. Many of the new checks are whether XINT (x)
14544 fits in int; it doesn't always, on 64-bit hosts. The new version
14545 doesn't catch all possible integer overflows, but it's an
14546 improvement. (Bug#8719)
14547
14548 * alloc.c (make_event_array): Use XINT, not XUINT.
14549 There's no need for unsigned here.
14550
14551 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14552 This follows up to the 2011-05-06 change that substituted uintptr_t
14553 for EMACS_INT. This case wasn't caught back then.
14554
14555 Rework Fformat to avoid integer overflow issues.
14556 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14557 now (part of C89). Include <verify.h>.
14558 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14559 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14560 (Fformat): Avoid the prepass trying to compute sizes; it was only
14561 approximate and thus did not catch overflow reliably. Instead, walk
14562 through the format just once, formatting and computing sizes as we go,
14563 checking for integer overflow at every step, and allocating a larger
14564 buffer as needed. Keep track separately whether the format is
14565 multibyte. Keep only the most-recently calculated precision, rather
14566 than them all. Record whether each argument has been converted to
14567 string. Use EMACS_INT, not int, for byte and char and arg counts.
14568 Support field widths and precisions larger than INT_MAX. Avoid
14569 sprintf's undefined behavior with conversion specifications such as %#d
14570 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14571 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14572 formatting out-of-range floating point numbers with int
14573 formats. (Bug#8668)
14574
14575 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14576
14577 * data.c: Avoid integer truncation in expressions involving floats.
14578 * data.c: Include <intprops.h>.
14579 (arith_driver): When there's an integer overflow in an expression
14580 involving floating point, convert the integers to floating point
14581 so that the resulting value does not suffer from catastrophic
14582 integer truncation. For example, on a 64-bit host (* 4
14583 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14584 Do not rely on undefined behavior after integer overflow.
14585
14586 merge count_size_as_multibyte, parse_str_to_multibyte
14587 * character.c, character.h (count_size_as_multibyte):
14588 Rename from parse_str_to_multibyte; all uses changed.
14589 Check for integer overflow.
14590 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14591 since it's now a duplicate of the other. This is more of
14592 a character than a buffer op, so better that it's in character.c.
14593 * fns.c, print.c: Adjust to above changes.
14594
14595 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14596
14597 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14598
14599 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14600
14601 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14602 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14603 (x_clipboard_manager_save): Now static.
14604 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14605
14606 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14607 (crypto_hash_function): Now static.
14608 Fix pointer signedness problems. Avoid unnecessary initializations.
14609
14610 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14611
14612 * termhooks.h (Vselection_alist): Make it terminal-local.
14613
14614 * terminal.c (create_terminal): Initialize it.
14615
14616 * xselect.c: Support for clipboard managers.
14617 (Vselection_alist): Move to termhooks.h as terminal-local var.
14618 (LOCAL_SELECTION): New macro.
14619 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14620 (symbol_to_x_atom): Remove gratuitous arg.
14621 (x_handle_selection_request, lisp_data_to_selection_data)
14622 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14623 (x_own_selection, x_get_local_selection, x_convert_selection):
14624 New arg, specifying work frame. Use terminal-local Vselection_alist.
14625 (some_frame_on_display): Delete unused function.
14626 (Fx_own_selection_internal, Fx_get_selection_internal)
14627 (Fx_disown_selection_internal, Fx_selection_owner_p)
14628 (Fx_selection_exists_p): New optional frame arg.
14629 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14630 (x_handle_selection_clear): Don't treat other terminals with the
14631 same keyboard specially. Use the terminal-local Vselection_alist.
14632 (x_clear_frame_selections): Use Frun_hook_with_args.
14633
14634 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14635
14636 * xterm.h: Add support for those atoms.
14637
14638 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14639
14640 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14641 (converted_selections, conversion_fail_tag): New global variables.
14642 (x_selection_request_lisp_error): Free the above.
14643 (x_get_local_selection): Remove unnecessary code.
14644 (x_reply_selection_request): Args changed; handle arbitrary array
14645 of converted selections stored in converted_selections.
14646 Separate the XChangeProperty and SelectionNotify steps.
14647 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14648 (x_convert_selection): New function.
14649 (x_handle_selection_event): Simplify.
14650 (x_get_foreign_selection): Don't ignore incoming requests while
14651 waiting for an answer; this will fail when we implement
14652 SAVE_TARGETS, and seems unnecessary anyway.
14653 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14654 (Vx_sent_selection_functions): Doc fix.
14655
14656 2011-05-26 Leo Liu <sdl.web@gmail.com>
14657
14658 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14659
14660 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14661
14662 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14663
14664 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14665 for fringe update if it has periodic bitmap.
14666 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14667 and fringe_bitmap_periodic_p.
14668
14669 * fringe.c (get_fringe_bitmap_data): New function.
14670 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14671 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14672 row. Mark glyph row for fringe update if periodicity changed.
14673
14674 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14675 for fringe update unless it has periodic bitmap.
14676
14677 2011-05-25 Kenichi Handa <handa@m17n.org>
14678
14679 * xdisp.c (get_next_display_element): Set correct it->face_id for
14680 a static composition.
14681
14682 2011-05-24 Leo Liu <sdl.web@gmail.com>
14683
14684 * deps.mk (fns.o):
14685 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14686
14687 * fns.c (crypto_hash_function, Fsha1): New function.
14688 (Fmd5): Use crypto_hash_function.
14689 (syms_of_fns): Add Ssha1.
14690
14691 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14692
14693 * gnutls.c: Remove unused macros.
14694 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14695 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14696 Remove macros that are defined and never used.
14697 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14698
14699 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14700
14701 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14702 (Fx_get_selection_internal): Minor cleanup.
14703 (Fx_own_selection_internal): Rename arguments for consistency with
14704 select.el.
14705
14706 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14707
14708 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14709
14710 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14711
14712 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14713
14714 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14715
14716 * dispnew.c (scrolling_window): Don't exclude the case that the
14717 last enabled row in the desired matrix touches the bottom boundary.
14718
14719 2011-05-21 Glenn Morris <rgm@gnu.org>
14720
14721 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14722 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14723 and add some more files.
14724
14725 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14726
14727 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14728 report_file_error introduced by the change from 2011-05-07.
14729
14730 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14731
14732 * systime.h (Time): Define only if emacs is defined.
14733 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14734 where the include path doesn't have X11/X.h by default. See
14735 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14736
14737 2011-05-20 Kenichi Handa <handa@m17n.org>
14738
14739 * composite.c (find_automatic_composition): Fix previous change.
14740
14741 2011-05-20 Glenn Morris <rgm@gnu.org>
14742
14743 * lisp.mk: New file, split from Makefile.in.
14744 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14745 (shortlisp): Remove.
14746 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14747
14748 2011-05-19 Glenn Morris <rgm@gnu.org>
14749
14750 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14751 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14752 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14753 (lisp): Set the order to that of loadup.el.
14754 (shortlisp): Make it a copy of $lisp.
14755 (SOME_MACHINE_LISP): Remove.
14756 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14757 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14758
14759 2011-05-18 Kenichi Handa <handa@m17n.org>
14760
14761 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14762 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14763 (find_automatic_composition): Mostly rewrite for efficiency.
14764
14765 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14766
14767 * makefile.w32-in: Update dependencies.
14768
14769 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14770
14771 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14772 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14773
14774 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14775
14776 Fix some integer overflow issues, such as string length overflow.
14777
14778 * insdel.c (count_size_as_multibyte): Check for string overflow.
14779
14780 * character.c (lisp_string_width): Check for string overflow.
14781 Use EMACS_INT, not int, for string indexes and lengths; in
14782 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14783 the resulting string length overflows an EMACS_INT; instead,
14784 report a string overflow if no precision given. When checking for
14785 precision exhaustion, use a check that cannot possibly have
14786 integer overflow. (Bug#8675)
14787 * character.h (lisp_string_width): Adjust to new signature.
14788
14789 * alloc.c (string_overflow): New function.
14790 (Fmake_string): Use it. This doesn't change behavior, but saves
14791 a few bytes and will simplify future changes.
14792 * character.c (string_escape_byte8): Likewise.
14793 * lisp.h (string_overflow): New decl.
14794
14795 Fixups, following up to the user-interface timestamp change.
14796 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14797 for UI timestamps, instead of unsigned long.
14798 * msdos.c (mouse_get_pos): Likewise.
14799 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14800 * w32gui.h (Time): Define by including "systime.h" rather than by
14801 declaring it ourselves. (Bug#8664)
14802
14803 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14804 * image.c (clear_image_cache): Likewise.
14805
14806 * term.c (term_mouse_position): Don't assume time_t wraparound.
14807
14808 Be more systematic about user-interface timestamps.
14809 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14810 and sometimes 'EMACS_UINT', to represent these timestamps.
14811 This change causes it to use 'Time' uniformly, as that's what X uses.
14812 This makes the code easier to follow, and makes it easier to catch
14813 integer overflow bugs such as Bug#8664.
14814 * frame.c (Fmouse_position, Fmouse_pixel_position):
14815 Use Time, not unsigned long, for user-interface timestamps.
14816 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14817 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14818 * keyboard.h (last_event_timestamp): Likewise.
14819 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14820 * menu.h (xmenu_show): Likewise.
14821 * term.c (term_mouse_position): Likewise.
14822 * termhooks.h (struct input_event.timestamp): Likewise.
14823 (struct terminal.mouse_position_hook): Likewise.
14824 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14825 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14826 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14827 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14828 what it was before.
14829 * menu.h, termhooks.h: Include "systime.h", for Time.
14830
14831 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14832 Don't assume that the difference between two unsigned long values
14833 can fit into an integer. At this point, we know button_down_time
14834 <= event->timestamp, so the difference must be nonnegative, so
14835 there's no need to cast the result if double-click-time is
14836 nonnegative, as it should be; check that it's nonnegative, just in
14837 case. This bug is triggered when events are more than 2**31 ms
14838 apart (about 25 days). (Bug#8664)
14839
14840 * xselect.c (last_event_timestamp): Remove duplicate decl.
14841 (x_own_selection): Remove needless cast to unsigned long.
14842
14843 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14844 that always fit in int. Use a sentinel instead of a counter, to
14845 avoid a temp and to allay GCC's concerns about possible int overflow.
14846 * frame.h (struct frame): Use int for menu_bar_items_used
14847 instead of EMACS_INT, since it always fits in int.
14848
14849 * menu.c (grow_menu_items): Check for int overflow.
14850
14851 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14852
14853 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14854 Before, the code was not consistent. These values cannot exceed
14855 2**31 - 1 so there's no need to make them unsigned.
14856 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14857 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14858 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14859 as modifiers.
14860 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14861
14862 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14863 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14864 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14865 presumably because the widths might not match.
14866
14867 * window.c (size_window): Avoid needless test at loop start.
14868
14869 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14870
14871 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14872
14873 2011-05-12 Drew Adams <drew.adams@oracle.com>
14874
14875 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14876
14877 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14878
14879 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14880 `width' to `bar_area_x' and `bar_area_width', respectively.
14881 (x_scroll_run): Take account of fringe background extension.
14882
14883 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14884 Rename local vars `left' and `width' to `bar_area_x' and
14885 `bar_area_width', respectively.
14886 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14887 background extension.
14888
14889 2011-05-10 Jim Meyering <meyering@redhat.com>
14890
14891 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14892
14893 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14894
14895 * image.c (Finit_image_library): Return t for built-in image types,
14896 like pbm and xbm. (Bug#8640)
14897
14898 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14899
14900 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14901
14902 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14903
14904 * w32console.c (Fset_screen_color): Doc fix.
14905 (Fget_screen_color): New function.
14906 (syms_of_ntterm): Defsubr it.
14907
14908 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14909 unlink the temporary file if Fcall_process didn't create it in the
14910 first place.
14911 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14912 child process will be redirected to a file specified with `:file'.
14913 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14914 cue to call_process_cleanup not to close that handle.
14915
14916 2011-05-07 Ben Key <bkey76@gmail.com>
14917
14918 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14919 one of two shell specific rules, either bootstrap-temacs-CMD or
14920 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14921 to the previous implementation of the bootstrap-temacs rule.
14922 The bootstrap-temacs-CMD rule is similar to the previous
14923 implementation of the bootstrap-temacs rule except that it
14924 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14925 variable.
14926
14927 These changes, along with some changes to nt/configure.bat,
14928 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14929 earlier fix to add support for --cflags and --ldflags options
14930 that include quotes so that it works whether make uses cmd or
14931 sh as the shell.
14932
14933 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14934
14935 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14936 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14937 is a constant.
14938 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14939 a string. Handle both cases.
14940 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14941 (Fdbus_register_method): Use Qinvalid_function.
14942
14943 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14944
14945 * makefile.w32-in: Update dependencies.
14946 (LISP_H): Add inttypes.h and stdin.h.
14947 (PROCESS_H): Add unistd.h.
14948
14949 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14950
14951 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14952 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14953
14954 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14955
14956 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14957
14958 * term.c (vfatal): Remove stray call to va_end.
14959 It's not needed and the C Standard doesn't allow it here anyway.
14960
14961 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14962 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14963
14964 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14965 bytes.
14966
14967 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14968
14969 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14970
14971 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14972
14973 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14974
14975 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14976
14977 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14978 * charset.c (Fdefine_charset_internal): Don't initialize
14979 charset.code_space[15]. The value was garbage, on hosts with
14980 32-bit int (Bug#8600).
14981
14982 * lread.c (read_integer): Be more consistent with string-to-number.
14983 Use string_to_number to do the actual conversion; this avoids
14984 rounding errors and fixes some other screwups. Without this fix,
14985 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14986 (digit_to_number): Move earlier, for benefit of read_integer.
14987 Return -1 if the digit is out of range for the base, -2 if it is
14988 not a digit in any supported base. (Bug#8602)
14989
14990 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14991
14992 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14993 to match comment at start of function. This also removes a
14994 GCC warning about overflow in a 32+64-bit port.
14995
14996 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14997
14998 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14999 Reported by Stefan Monnier in
15000 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15001 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15002 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15003
15004 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15005 (EMACS_UINTPTR): Likewise, with uintptr_t.
15006
15007 * lisp.h: Prefer 64-bit EMACS_INT if available.
15008 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15009 on 32-bit hosts that have 64-bit int, so that they can access
15010 large files.
15011 However, temporarily disable this change unless the temporary
15012 symbol WIDE_EMACS_INT is defined.
15013
15014 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15015
15016 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15017 This removes an assumption that EMACS_INT and long are the same
15018 width as pointers. The assumption is true for Emacs porting targets
15019 now, but we want to make other targets possible.
15020 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15021 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15022 In the rest of the code, change types of integers that hold casted
15023 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15024 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15025 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15026 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15027 No need to cast type when ORing.
15028 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15029 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15030 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15031 assume EMACS_INT is the same width as char *.
15032 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15033 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15034 Remove no-longer-needed casts.
15035 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15036 (xg_tool_bar_help_callback, xg_make_tool_item):
15037 Use EMACS_INTPTR to hold an integer
15038 that will be cast to void *; this can avoid a GCC warning
15039 if EMACS_INT is not the same width as void *.
15040 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15041 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15042 (current_message_1, set_message_1):
15043 Use a local to convert to proper width without a cast.
15044 * xmenu.c (dialog_selection_callback): Likewise.
15045
15046 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15047 Also, don't assume VALBITS / RAND_BITS is less than 5,
15048 and don't rely on undefined behavior when shifting a 1 left into
15049 the sign bit.
15050 * lisp.h (get_random): Change signature to match.
15051
15052 * lread.c (hash_string): Use size_t, not int, for hash computation.
15053 Normally we prefer signed values; but hashing is special, because
15054 it's better to use unsigned division on hash table sizes so that
15055 the remainder is nonnegative. Also, size_t is the natural width
15056 for hashing into memory. The previous code used 'int', which doesn't
15057 retain enough info to hash well into very large tables.
15058 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15059
15060 * dbusbind.c: Don't possibly lose pointer info when converting.
15061 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15062 Use XPNTR rather than XHASH, so that the high-order bits of
15063 the pointer aren't lost when converting through void *.
15064
15065 * eval.c (Fautoload): Don't double-shift a pointer.
15066
15067 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15068
15069 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15070
15071 * gnutls.c (DEF_GNUTLS_FN):
15072 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15073
15074 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15075
15076 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15077 marker. (Bug#8610)
15078
15079 2011-05-05 Eli Zaretskii <eliz@gnu.org>
15080
15081 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15082 New version that can reserve upto 2GB of heap space.
15083
15084 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
15085
15086 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15087
15088 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15089
15090 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15091 `gnutls_certificate_set_x509_key_file'.
15092
15093 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
15094
15095 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15096 Update dependencies.
15097
15098 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15099
15100 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15101 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15102 Remove unused parameter `fildes'.
15103 * process.c (read_process_output, send_process): Don't pass it.
15104
15105 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15106
15107 Fix previous change: the library cache is defined in w32.c.
15108 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15109 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15110
15111 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15112
15113 Implement dynamic loading of GnuTLS on Windows.
15114
15115 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15116 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15117 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15118 Declare.
15119
15120 * gnutls.c (Qgnutls_dll): Define.
15121 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15122 (gnutls_*): Declare function pointers.
15123 (init_gnutls_functions): New function to initialize function pointers.
15124 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15125 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15126 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15127 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15128 (emacs_gnutls_write, emacs_gnutls_read)
15129 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15130 (Fgnutls_available_p): New function.
15131 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15132 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15133 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15134
15135 * image.c: Include w32.h.
15136 (Vimage_type_cache): Delete.
15137 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15138 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15139 (w32_delayed_load): Move to w32.c.
15140
15141 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15142
15143 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15144 (w32_delayed_load): Move from image.c. When loading a library, record
15145 its filename in the :loaded-from property of the library id.
15146 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15147 Initialize and staticpro them.
15148 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15149
15150 * process.c: Include lisp.h before w32.h, not after.
15151 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15152 instead of gnutls_record_check_pending.
15153
15154 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15155
15156 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15157
15158 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15159 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15160 as passed in.
15161
15162 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15163
15164 * xterm.c (x_set_frame_alpha): Do not set property on anything
15165 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15166
15167 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15168
15169 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15170
15171 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15172
15173 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15174 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15175 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15176 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15177 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15178 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15179 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15180 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15181 (Qgnutls_bootprop_callbacks_verify): Make static.
15182
15183 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15184
15185 * callproc.c: Indentation fixup.
15186
15187 * sysdep.c (wait_for_termination_1): Make static.
15188 (wait_for_termination, interruptible_wait_for_termination):
15189 Move after wait_for_termination_1.
15190
15191 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15192
15193 * sysdep.c (interruptible_wait_for_termination): New function
15194 which is like wait_for_termination, but allows keyboard
15195 interruptions.
15196
15197 * callproc.c (Fcall_process): Add (:file "file") as an option for
15198 the STDOUT buffer.
15199 (Fcall_process_region): Ditto.
15200
15201 2011-04-30 Eli Zaretskii <eliz@gnu.org>
15202
15203 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15204 rather than `XVECTOR (FOO)->size'.
15205
15206 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15207 inttypes.h, as a gnulib replacement is used if it not available in
15208 system headers.
15209
15210 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15211
15212 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15213 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15214 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15215
15216 * coding.c (coding_alloc_by_realloc): Error out if destination
15217 will grow beyond MOST_POSITIVE_FIXNUM.
15218 (decode_coding_emacs_mule): Abort if there isn't enough place in
15219 charbuf for the composition carryover bytes. Reserve an extra
15220 space for up to 2 characters produced in a loop.
15221 (decode_coding_iso_2022): Abort if there isn't enough place in
15222 charbuf for the composition carryover bytes.
15223
15224 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15225
15226 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15227 aborting when %lld or %lll format is passed.
15228 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15229 %llo or %llx format is passed. (Bug#8545)
15230
15231 * window.c (window_scroll_line_based): Use a marker instead of
15232 simple variables to record original value of point. (Bug#7952)
15233
15234 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15235 produced by %s or %c overflows available buffer space. (Bug#8545)
15236
15237 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15238
15239 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15240 (SIZE_MAX): Move defn after all includes, as they might #define it.
15241
15242 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15243
15244 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15245
15246 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15247
15248 * keyboard.c (Qdelayed_warnings_hook): Define.
15249 (command_loop_1): Run `delayed-warnings-hook'
15250 if Vdelayed_warnings_list is non-nil.
15251 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15252 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15253
15254 2011-04-28 Eli Zaretskii <eliz@gnu.org>
15255
15256 * doprnt.c (doprnt): Don't return value smaller than the buffer
15257 size if the message was truncated. (Bug#8545).
15258
15259 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15260
15261 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15262 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15263
15264 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15265
15266 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15267
15268 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
15269
15270 * makefile.w32-in: Update dependencies.
15271
15272 2011-04-27 Eli Zaretskii <eliz@gnu.org>
15273
15274 Improve `doprnt' and its usage. (Bug#8545)
15275 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15276 `format_end'. Remove support for %l as a conversion specifier.
15277 Don't use xrealloc. Improve diagnostics when the %l size modifier
15278 is used. Update the commentary.
15279
15280 * eval.c (verror): Simplify calculation of size_t.
15281
15282 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15283 messages.
15284
15285 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15286
15287 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15288 change.
15289
15290 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15291
15292 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15293 This makes this file independent of the recent pseudovector change.
15294
15295 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
15296
15297 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15298
15299 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15300 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15301 Remove unused local.
15302 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15303
15304 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
15305 GCC 4.6.0 optimizes based on type-based alias analysis.
15306 For example, if b is of type struct buffer * and v of type struct
15307 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15308 != &v->size, and therefore "v->size = 1; b->size = 2; return
15309 v->size;" must therefore return 1. This assumption is incorrect
15310 for Emacs, since it type-puns struct Lisp_Vector * with many other
15311 types. To fix this problem, this patch adds a new type struct
15312 vectorlike_header that documents the constraints on layout of vectors
15313 and pseudovectors, and helps optimizing compilers not get fooled
15314 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15315 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15316 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15317 the size member.
15318 (XSETPVECTYPE): Rewrite in terms of new macro.
15319 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15320 This is a bit clearer, and further avoids the possibility of
15321 undesirable aliasing.
15322 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15323 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15324 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15325 since Lisp_Subr is a special case (no "next" field).
15326 (ASIZE): Now uses header.size rather than size.
15327 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15328 to avoid the hassle of writing XVECTOR (foo)->header.size.
15329 (struct vectorlike_header): New type.
15330 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15331 object, to help avoid aliasing.
15332 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15333 (SUBRP): Likewise, since Lisp_Subr is a special case.
15334 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15335 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15336 (struct Lisp_Hash_Table): Combine first two members into a single
15337 struct vectorlike_header member. All uses of "size" and "next" members
15338 changed to be "header.size" and "header.next".
15339 * buffer.h (struct buffer): Likewise.
15340 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15341 * frame.h (struct frame): Likewise.
15342 * process.h (struct Lisp_Process): Likewise.
15343 * termhooks.h (struct terminal): Likewise.
15344 * window.c (struct save_window_data, struct saved_window): Likewise.
15345 * window.h (struct window): Likewise.
15346 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15347 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15348 * buffer.c (init_buffer_once): Likewise.
15349 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15350 special case.
15351 * process.c (Fformat_network_address): Use local var for size,
15352 for brevity.
15353
15354 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15355
15356 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15357 * data.c (atof): Remove decl; no longer used or needed.
15358 (digit_to_number): Move to lread.c.
15359 (Fstring_to_number): Use new string_to_number function, to be
15360 consistent with how the Lisp reader treats infinities and NaNs.
15361 Do not assume that floating-point numbers represent EMACS_INT
15362 without losing information; this is not true on most 64-bit hosts.
15363 Avoid double-rounding errors, by insisting on integers when
15364 parsing non-base-10 numbers, as the documentation specifies.
15365 * lisp.h (string_to_number): New decl, replacing ...
15366 (isfloat_string): Remove.
15367 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15368 (read1): Do not accept +. and -. as integers; this
15369 appears to have been a coding error. Similarly, do not accept
15370 strings like +-1e0 as floating point numbers. Do not report
15371 overflow for integer overflows unless the base is not 10 which
15372 means we have no simple and reliable way to continue.
15373 Break out the floating-point parsing into a new
15374 function string_to_number, so that Fstring_to_number parses
15375 floating point numbers consistently with the Lisp reader.
15376 (digit_to_number): Move here from data.c. Make it static inline.
15377 (E_CHAR, EXP_INT): Remove, replacing with ...
15378 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15379 (string_to_number): New function, replacing isfloat_string.
15380 This function checks for valid syntax and produces the resulting
15381 Lisp float number too. Rework it so that string-to-number
15382 no longer mishandles examples like "1.0e+". Use strtoumax,
15383 so that overflow for non-base-10 numbers is reported only when
15384 there's no portable and simple way to convert to floating point.
15385
15386 * textprop.c (set_text_properties_1): Rewrite for clarity,
15387 and to avoid GCC warning about integer overflow.
15388
15389 * intervals.h (struct interval): Use EMACS_INT for members
15390 where EMACS_UINT might cause problems. See
15391 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15392 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15393 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15394 All uses changed.
15395 (offset_intervals): Tell GCC not to worry about length overflow
15396 when negating a negative length.
15397
15398 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15399 (overrun_check_free): Likewise.
15400
15401 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15402 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15403 word size.
15404
15405 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15406 (gnutls_make_error): Rename local to avoid shadowing.
15407 (gnutls_emacs_global_deinit): ifdef out; not used.
15408 (Fgnutls_boot): Use const for pointer to readonly storage.
15409 Comment out unused local. Fix pointer signedness problems.
15410
15411 * lread.c (openp): Don't stuff size_t into an 'int'.
15412 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15413 about possible signed overflow.
15414
15415 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15416 (GDK_KEY_g): Don't define if already defined.
15417 (xg_prepare_tooltip): Avoid pointer signedness problem.
15418 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15419
15420 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15421 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15422
15423 * xfns.c (Fx_window_property): Simplify a bit,
15424 to make a bit faster and to avoid GCC 4.6.0 warning.
15425 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15426
15427 * fns.c (internal_equal): Don't assume size_t fits in int.
15428
15429 * alloc.c (compact_small_strings): Tighten assertion a little.
15430
15431 Replace pEd with more-general pI, and fix some printf arg casts.
15432 * lisp.h (pI): New macro, generalizing old pEd macro to other
15433 conversion specifiers. For example, use "...%"pI"d..." rather
15434 than "...%"pEd"...".
15435 (pEd): Remove. All uses replaced with similar uses of pI.
15436 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15437 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15438 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15439 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15440 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15441 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15442 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15443 64-bit hosts.
15444 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15445 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15446 * print.c (safe_debug_print, print_object): Likewise.
15447 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15448 to int.
15449 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15450 avoiding the 0 flag, which is not portable.
15451 * process.c (Fmake_network_process): Use pI to avoid cast.
15452 * region-cache.c (pp_cache): Likewise.
15453 * xdisp.c (decode_mode_spec): Likewise.
15454 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15455 behavior on 64-bit hosts with printf arg.
15456 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15457 (x_stop_queuing_selection_requests): Likewise.
15458 (x_get_window_property): Don't truncate byte count to an 'int'
15459 when tracing.
15460
15461 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15462 here, since it parses constructs like leading '-' and spaces,
15463 which are not wanted; and it overflows with large numbers.
15464 Instead, simply match F[0-9]+, which is what is wanted anyway.
15465
15466 * alloc.c: Remove unportable assumptions about struct layout.
15467 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15468 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15469 (allocate_vectorlike, make_pure_vector): Use the new macros,
15470 plus offsetof, to remove unportable assumptions about struct layout.
15471 These assumptions hold on all porting targets that I know of, but
15472 they are not guaranteed, they're easy to remove, and removing them
15473 makes further changes easier.
15474
15475 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15476 This doesn't fix a bug but makes the code clearer.
15477 (string_overrun_cookie): Now const. Use initializers that
15478 don't formally overflow signed char, to avoid warnings.
15479 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15480 can cause Emacs to crash when string overrun checking is enabled.
15481 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15482 multiple of sizeof (EMACS_INT); it need not be, if
15483 alignof(EMACS_INT) < sizeof (EMACS_INT).
15484 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15485
15486 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
15487
15488 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15489
15490 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15491
15492 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15493 supposed to be handshaking. (Bug#8556)
15494 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15495
15496 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15497
15498 * lisp.h (Qdebug): List symbol.
15499 * eval.c (Qdebug): Restore global linkage.
15500 * keyboard.c (debug-on-event): New variable.
15501 (handle_user_signal): Break into debugger when debug-on-event
15502 matches the current signal symbol.
15503
15504 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15505
15506 * alloc.c (check_sblock, check_string_bytes)
15507 (check_string_free_list): Convert to standard C.
15508
15509 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15510
15511 * w32.c (emacs_gnutls_push): Fix typo.
15512
15513 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15514
15515 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15516 "cast to pointer from integer of different size".
15517
15518 Improve doprnt and its use in verror. (Bug#8545)
15519 * doprnt.c (doprnt): Document the set of format control sequences
15520 supported by the function. Use SAFE_ALLOCA instead of always
15521 using `alloca'.
15522
15523 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15524 is one byte too soon. Don't use xrealloc; instead xfree and
15525 xmalloc anew.
15526
15527 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15528
15529 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15530 callbacks stage.
15531
15532 * gnutls.c: Renamed global_initialized to
15533 gnutls_global_initialized. Added internals for the
15534 :verify-hostname-error, :verify-error, and :verify-flags
15535 parameters of `gnutls-boot' and documented those parameters in the
15536 docstring. Start callback support.
15537 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15538 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15539 on error. Return error code.
15540 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15541 (emacs_gnutls_read): Likewise.
15542 (Fgnutls_boot): Return handshake error code.
15543 (emacs_gnutls_handle_error): New function.
15544 (wsaerror_to_errno): Likewise.
15545
15546 * w32.h (emacs_gnutls_pull): Add prototype.
15547 (emacs_gnutls_push): Likewise.
15548
15549 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15550 (emacs_gnutls_push): Likewise.
15551
15552 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15553
15554 * process.c (wait_reading_process_output): Check if GnuTLS
15555 buffered some data internally if no FDs are set for TLS
15556 connections.
15557
15558 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15559 (LIBS): Link to USER_LIBS.
15560 ($(BLD)/gnutls.$(0)): New target.
15561
15562 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15563
15564 * xdisp.c (handle_single_display_spec): Rename the
15565 display_replaced_before_p argument into display_replaced_p, to
15566 make it consistent with the commentary. Fix typos in the
15567 commentary.
15568
15569 * textprop.c (syms_of_textprop): Remove dead code.
15570 (copy_text_properties): Delete obsolete commentary about an
15571 interface that was deleted long ago. Fix typos in the description
15572 of arguments.
15573
15574 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15575 to changes in oldXMenu/XMenu.h from 2011-04-16.
15576 <menu_help_message, prev_menu_help_message>: Constify.
15577 (IT_menu_make_room): menu->help_text is now `const char **';
15578 adjust.
15579
15580 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15581 to changes in oldXMenu/XMenu.h from 2011-04-16.
15582 (struct XMenu): Declare `help_text' `const char **'.
15583
15584 * xfaces.c <Qunspecified>: Make extern again.
15585
15586 * syntax.c: Include sys/types.h before including regex.h, as
15587 required by POSIX.
15588
15589 * doc.c (get_doc_string): Improve the format passed to `error'.
15590
15591 * doprnt.c (doprnt): Improve commentary.
15592
15593 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15594
15595 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15596 them with etags.
15597
15598 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15599 changes in globals.h immediately force recompilation.
15600 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15601 $(CURDIR)/s/ms-w32.h.
15602 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15603
15604 * character.c (Fchar_direction): Function deleted.
15605 (syms_of_character): Don't defsubr it.
15606 <char-direction-table>: Deleted.
15607
15608 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15609
15610 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15611 * doprnt.c: Include limits.h.
15612 (SIZE_MAX): New macro.
15613 (doprnt): Return a size_t value. 2nd arg is now size_t.
15614 Many local variables are now size_t instead of int or unsigned.
15615 Improve overflow protection. Support `l' modifier for integer
15616 conversions. Support %l conversion. Don't assume an EMACS_INT
15617 argument for integer conversions and for %c.
15618
15619 * lisp.h (doprnt): Restore prototype.
15620
15621 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15622 $(SRC)/character.h.
15623
15624 * Makefile.in (base_obj): Add back doprnt.o.
15625
15626 * deps.mk (doprnt.o): Add back prerequisites.
15627 (callint.o): Depend on character.h.
15628
15629 * eval.c (internal_lisp_condition_case): Include the handler
15630 representation in the error message.
15631 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15632 when breaking from the loop.
15633
15634 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15635
15636 * callint.c (Fcall_interactively): When displaying error message
15637 about invalid control letter, pass the character's codepoint, not
15638 a pointer to its multibyte form. Improve display of the character
15639 in octal and display also its hex code.
15640
15641 * character.c (char_string): Use %x to display the (unsigned)
15642 codepoint of an invalid character, to avoid displaying a bogus
15643 negative value.
15644
15645 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15646 `error', not SYMBOL_NAME itself.
15647
15648 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15649 character arguments to `error'.
15650
15651 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15652 to `error' in error message about FINAL_CHAR argument. Make sure
15653 FINAL_CHAR is a character, and use %c when it is passed as
15654 argument to `error'.
15655
15656 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15657
15658 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15659
15660 * w32.c: Include <time.h>.
15661 (sys_localtime): New function.
15662
15663 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15664
15665 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15666
15667 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15668
15669 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15670
15671 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15672 zombies (Bug#8467).
15673
15674 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15675
15676 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15677 gl_state.e_property when gl_state.object is Qt.
15678
15679 * insdel.c (make_gap_larger): Remove limitation of buffer size
15680 to <= INT_MAX.
15681
15682 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15683
15684 * xdisp.c (lookup_glyphless_char_display)
15685 (produce_glyphless_glyph): Handle cons cell entry in
15686 glyphless-char-display.
15687 (Vglyphless_char_display): Document it.
15688
15689 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15690 glyphless-char-display.
15691
15692 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15693
15694 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15695
15696 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15697
15698 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15699 definition for no-X builds.
15700
15701 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15702
15703 Static checks with GCC 4.6.0 and non-default toolkits.
15704
15705 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15706
15707 * process.c (keyboard_bit_set): Define only if SIGIO.
15708 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15709 (send_process): Repair possible setjmp clobbering.
15710
15711 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15712
15713 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15714
15715 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15716
15717 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15718 Define only if needed.
15719
15720 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15721 by pacifying GCC about it. Maybe it's time to retire it?
15722 * xfaces.c (USG, __TIMEVAL__): Likewise.
15723
15724 * dispextern.h (struct redisplay_interface): Rename param
15725 to avoid shadowing.
15726 * termhooks.h (struct terminal): Likewise.
15727 * xterm.c (xembed_send_message): Likewise.
15728
15729 * insdel.c (make_gap_smaller): Define only if
15730 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15731
15732 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15733 it.
15734
15735 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15736 so that we aren't warned about unused symbols.
15737
15738 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15739
15740 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15741
15742 * xfns.c (x_real_positions): Mark locals as initialized.
15743
15744 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15745
15746 * xterm.c: Fix problems found by static analysis with other toolkits.
15747 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15748 (x_dispatch_event): Declare static if USE_GTK, and
15749 define if USE_GTK || USE_X_TOOLKIT.
15750 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15751 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15752 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15753 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15754
15755 * xmenu.c (menu_help_callback): Pointer type fixes.
15756 Use const pointers when pointing at readonly data. Avoid pointer
15757 signedness clashes.
15758 (FALSE): Remove unused macro.
15759 (update_frame_menubar): Remove unused decl.
15760
15761 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15762
15763 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15764 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15765 (single_menu_item): Rename local to avoid shadowing.
15766
15767 * keyboard.c (make_lispy_event): Remove unused local var.
15768
15769 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15770 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15771
15772 * bitmaps: Change bitmaps from unsigned char back to the X11
15773 compatible char. Avoid the old compiler warnings about
15774 out-of-range initializers by using, for example, '\xab' rather
15775 than 0xab.
15776
15777 * xgselect.c (xgselect_initialize): Check vs interface
15778 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15779
15780 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15781
15782 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15783 to read-only memory.
15784
15785 * fns.c (vector): Remove; this old hack is no longer needed.
15786
15787 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15788 Remove unused var.
15789 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15790
15791 * xrdb.c (x_load_resources): Omit unused local.
15792
15793 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15794 (x_window): Rename locals to avoid shadowing.
15795 (USG): Use the kludged USG macro, to pacify gcc.
15796
15797 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15798 (x_term_init): Remove local to avoid shadowing.
15799
15800 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15801
15802 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15803 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15804
15805 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15806
15807 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15808
15809 Fix regex.c, syntax.c and friends for buffers > 2GB.
15810 * syntax.h (struct gl_state_s): Declare character position members
15811 EMACS_INT.
15812
15813 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15814
15815 * textprop.c (verify_interval_modification, interval_of):
15816 Declare arguments EMACS_INT.
15817
15818 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15819 EMACS_INT.
15820
15821 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15822
15823 * indent.c (Fvertical_motion): Local variable it_start is now
15824 EMACS_INT.
15825
15826 * regex.c (re_match, re_match_2, re_match_2_internal)
15827 (bcmp_translate, regcomp, regexec, print_double_string)
15828 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15829 (re_compile_pattern, re_exec): Declare arguments and local
15830 variables `size_t' and `ssize_t' and return values `regoff_t', as
15831 appropriate.
15832 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15833 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15834 <compile_stack_type>: `size' and `avail' are now `size_t'.
15835
15836 * regex.h <regoff_t>: Use ssize_t, not int.
15837 (re_search, re_search_2, re_match, re_match_2): Arguments that
15838 specify buffer/string position and length are now ssize_t and
15839 size_t. Return type is regoff_t.
15840
15841 2011-04-16 Ben Key <bkey76@gmail.com>
15842
15843 * nsfont.m: Fixed bugs in ns_get_family and
15844 ns_descriptor_to_entity that were caused by using free to
15845 deallocate memory blocks that were allocated by xmalloc (via
15846 xstrdup). This caused Emacs to crash when compiled with
15847 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15848 --enable-checking=xmallocoverrun). xfree is now used to
15849 deallocate these memory blocks.
15850
15851 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15852
15853 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15854
15855 emacs_write: Accept and return EMACS_INT for sizes.
15856 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15857 et seq.
15858 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15859 Accept and return EMACS_INT.
15860 (emacs_gnutls_write): Return the number of bytes written on
15861 partial writes.
15862 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15863 (emacs_read, emacs_write): Remove check for negative size, as the
15864 Emacs source code has been audited now.
15865 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15866 (emacs_read, emacs_write): Use it.
15867 * process.c (send_process): Adjust to the new signatures of
15868 emacs_write and emacs_gnutls_write. Do not attempt to store
15869 a byte offset into an 'int'; it might overflow.
15870 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15871
15872 * sound.c: Don't assume sizes fit in 'int'.
15873 (struct sound_device.period_size, alsa_period_size):
15874 Return EMACS_INT, not int.
15875 (struct sound_device.write, vox_write, alsa_write):
15876 Accept EMACS_INT, not int.
15877 (wav_play, au_play): Use EMACS_INT to store sizes and to
15878 record read return values.
15879
15880 2011-04-15 Ben Key <bkey76@gmail.com>
15881
15882 * keyboard.c (Qundefined): Don't declare static since it is used
15883 in nsfns.m.
15884 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15885 static since they are used in nsfont.m.
15886
15887 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15888
15889 * process.c (Qprocessp): Don't declare static.
15890 * lisp.h (Qprocessp): Declare again.
15891
15892 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15893
15894 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15895
15896 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15897
15898 Improve C-level modularity by making more things 'static'.
15899
15900 Don't publish debugger-only interfaces to other modules.
15901 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15902 (verify_bytepos, count_markers): Move decls to the only modules
15903 that need them.
15904 * region-cache.h (pp_cache): Likewise.
15905 * window.h (check_all_windows): Likewise.
15906 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15907
15908 * sysdep.c (croak): Now static, if
15909 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15910 * syssignal.h (croak): Declare only if not static.
15911
15912 * alloc.c (refill_memory_reserve): Now static if
15913 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15914 * lisp.h (refill_memory_reserve): Declare only if not static.
15915
15916 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15917 Define only if USE_LUCID.
15918
15919 * xrdb.c (x_customization_string, x_rm_string): Now static.
15920
15921 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15922 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15923
15924 * xdisp.c (draw_row_with_mouse_face): Now static.
15925 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15926
15927 * window.h (check_all_windows): Mark externally visible.
15928
15929 * window.c (window_deletion_count): Now static.
15930
15931 * undo.c: Make symbols static if they're not exported.
15932 (last_undo_buffer, last_boundary_position, pending_boundary):
15933 Now static.
15934
15935 * textprop.c (interval_insert_behind_hooks): Now static.
15936 (interval_insert_in_front_hooks): Likewise.
15937
15938 * term.c: Make symbols static if they're not exported.
15939 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15940 (max_frame_lines, tty_set_terminal_modes):
15941 (tty_reset_terminal_modes, tty_turn_off_highlight):
15942 (get_tty_terminal): Now static.
15943 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15944 * termhooks.h (term_mouse_moveto): Do not declare if
15945 HAVE_WINDOW_SYSTEM.
15946 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15947 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15948
15949 * sysdep.c: Make symbols static if they're not exported.
15950 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15951 Now static.
15952 (sigprocmask_set, full_mask): Remove; unused.
15953 (wait_debugging): Mark as visible.
15954 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15955 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15956
15957 * syntax.c (syntax_temp): Define only if !__GNUC__.
15958
15959 * sound.c (current_sound_device, current_sound): Now static.
15960
15961 * search.c (searchbufs, searchbuf_head): Now static.
15962
15963 * scroll.c (scroll_cost): Remove; unused.
15964 * dispextern.h (scroll_cost): Remove decl.
15965
15966 * region-cache.h (pp_cache): Mark as externally visible.
15967
15968 * process.c: Make symbols static if they're not exported.
15969 (process_tick, update_tick, create_process, chan_process):
15970 (Vprocess_alist, proc_buffered_char, datagram_access):
15971 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15972 (deactivate_process): Mark defn as static, as well as decl.
15973 * lisp.h (create_process): Remove decl.
15974 * process.h (chan_process, Vprocess_alist): Remove decls.
15975
15976 * print.c: Make symbols static if they're not exported.
15977 (print_depth, new_backquote_output, being_printed, print_buffer):
15978 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15979 (print_interval, print_number_index, initial_stderr_stream):
15980 Now static.
15981 * lisp.h (Fprinc): Remove decl.
15982 (debug_output_compilation_hack): Mark as externally visible.
15983
15984 * sysdep.c (croak): Move decl from here to syssignal.h.
15985 * syssignal.h (croak): Put it here, so the API can be checked when
15986 'croak' is called from dissociate_if_controlling_tty.
15987
15988 * minibuf.c: Make symbols static if they're not exported.
15989 (minibuf_save_list, choose_minibuf_frame): Now static.
15990 * lisp.h (choose_minibuf_frame): Remove decl.
15991
15992 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15993
15994 * lread.c: Make symbols static if they're not exported.
15995 (read_objects, initial_obarray, oblookup_last_bucket_number):
15996 Now static.
15997 (make_symbol): Remove; unused.
15998 * lisp.h (initial_obarray, make_symbol): Remove decls.
15999
16000 * keyboard.c: Make symbols static if they're not exported.
16001 (single_kboard, recent_keys_index, total_keys, recent_keys):
16002 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16003 (this_single_command_key_start, echoing, last_auto_save):
16004 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16005 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16006 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16007 (Vlispy_mouse_stem, double_click_count):
16008 Now static.
16009 (force_auto_save_soon): Define only if SIGDANGER.
16010 (ignore_mouse_drag_p): Now static if
16011 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16012 (print_help): Remove; unused.
16013 (stop_character, last_timer_event): Mark as externally visible.
16014 * keyboard.h (ignore_mouse_drag_p): Declare only if
16015 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16016 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16017 * lisp.h (echoing): Remove decl.
16018 (force_auto_save_soon): Declare only if SIGDANGER.
16019 * xdisp.c (redisplay_window): Simplify code, to make it more
16020 obvious that ignore_mouse_drag_p is not accessed if !defined
16021 USE_GTK && !defined HAVE_NS.
16022
16023 * intervals.c: Make symbols static if they're not exported.
16024 (merge_properties_sticky, merge_interval_right, delete_interval):
16025 Now static.
16026 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16027
16028 * insdel.c: Make symbols static if they're not exported.
16029 However, leave prepare_to_modify_buffer alone. It's never
16030 called from outside this function, but that appears to be a bug.
16031 (combine_after_change_list, combine_after_change_buffer):
16032 (adjust_after_replace, signal_before_change): Now static.
16033 (adjust_after_replace_noundo): Remove; unused.
16034 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16035 (signal_before_change): Remove decls.
16036
16037 * indent.c (val_compute_motion, val_vmotion): Now static.
16038
16039 * image.c: Make symbols static if they're not exported.
16040 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16041 if USE_GTK.
16042 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16043 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16044
16045 * fringe.c (standard_bitmaps): Now static.
16046 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16047
16048 * frame.c: Make symbols static if they're not exported.
16049 (x_report_frame_params, make_terminal_frame): Now static.
16050 (get_frame_param): Now static, unless HAVE_NS.
16051 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16052 (x_get_resource_string): Remove; not used.
16053 * frame.h (make_terminal_frame, x_report_frame_params):
16054 (x_get_resource_string); Remove decls.
16055 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16056 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16057
16058 * font.c, fontset.c: Make symbols static if they're not exported.
16059 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16060 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16061 * font.c (font_close_object): Now static.
16062 * font.h (font_close_object): Remove.
16063 * fontset.c (FONTSET_OBJLIST): Remove.
16064 (free_realized_fontset) #if-0 the body, which does nothing.
16065 (face_suitable_for_char_p): #if-0, as it's never called.
16066 * fontset.h (face_suitable_for_char_p): Remove decl.
16067 * xfaces.c (face_at_string_position):
16068 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16069 since 0 is always ASCII.
16070
16071 * fns.c (weak_hash_tables): Now static.
16072
16073 * fileio.c: Make symbols static if they're not exported.
16074 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16075 (Vwrite_region_annotation_buffers): Now static.
16076
16077 * eval.c: Make symbols static if they're not exported.
16078 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16079 * lisp.h (backtrace_list): Remove decl.
16080
16081 * emacs.c: Make symbols static if they're not exported.
16082 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16083 (fatal_error_code, fatal_error_signal_hook, standard_args):
16084 Now static.
16085 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16086 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16087 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16088 * lisp.h (fatal_error_signal_hook): Remove decl.
16089 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16090
16091 * editfns.c: Move a (normally-unused) function to its only use.
16092 * editfns.c, lisp.h (get_operating_system_release): Remove.
16093 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16094 worth the hassle of breaking this out.
16095
16096 * xterm.c: Make symbols static if they're not exported.
16097 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16098 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16099 (x_destroy_window, x_delete_display):
16100 Now static.
16101 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16102 (x_mouse_leave): Remove; unused.
16103 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16104 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16105 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16106 Remove decls.
16107 (x_mouse_leave): Declare only if WINDOWSNT.
16108 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16109 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16110 USE_X_TOOLKIT.
16111
16112 * ftxfont.c: Make symbols static if they're not exported.
16113 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16114 HAVE_FREETYPE.
16115 * font.h (ftxfont_driver): Likewise.
16116
16117 * xfns.c: Make symbols static if they're not exported.
16118 (x_last_font_name, x_display_info_for_name):
16119 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16120 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16121 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16122 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16123 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16124 (last_show_tip_args): Now static.
16125 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16126 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16127 (x_screen_planes): Remove; unused.
16128 * dispextern.h (x_screen_planes): Remove decl.
16129
16130 * dispnew.c: Make symbols static if they're not exported.
16131 * dispextern.h (redraw_garbaged_frames, scrolling):
16132 (increment_row_positions): Remove.
16133 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16134 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16135 Now static.
16136 (redraw_garbaged_frames): Remove; unused.
16137
16138 * xfaces.c: Make symbols static if they're not exported.
16139 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16140 Remove decls.
16141 * xterm.h (defined_color): Remove decls.
16142 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16143 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16144 (menu_face_changed_default, defined_color, free_realized_face):
16145 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16146 (ascii_face_of_lisp_face): Remove; unused.
16147
16148 * xdisp.c: Make symbols static if they're not exported.
16149 * dispextern.h (scratch_glyph_row, window_box_edges):
16150 (glyph_to_pixel_coords, set_cursor_from_row):
16151 (get_next_display_element, set_iterator_to_next):
16152 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16153 (show_mouse_face): Remove decls
16154 * frame.h (message_buf_print): Likewise.
16155 * lisp.h (pop_message, set_message, check_point_in_composition):
16156 Likewise.
16157 * xterm.h (set_vertical_scroll_bar): Likewise.
16158 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16159 (message_buf_print, scratch_glyph_row, displayed_buffer):
16160 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16161 (get_next_display_element, show_mouse_face, window_box_edges):
16162 (frame_to_window_pixel_xy, check_point_in_composition):
16163 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16164 (glyph_to_pixel_coords): Remove; unused.
16165
16166 * dired.c (file_name_completion): Now static.
16167
16168 * dbusbind.c (xd_in_read_queued_messages): Now static.
16169
16170 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16171 * data.c (circular_list_error): Remove.
16172
16173 * commands.h (last_point_position, last_point_position_buffer):
16174 (last_point_position_window): Remove decls.
16175 * keyboard.c: Make these variables static.
16176
16177 * coding.h (coding, code_convert_region, encode_coding_gap):
16178 Remove decls.
16179 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16180 (iso_code_class, detect_coding, code_convert_region): Now static.
16181 (encode_coding_gap): Remove; unused.
16182
16183 * chartab.c (chartab_chars, chartab_bits): Now static.
16184
16185 * charset.h (charset_iso_8859_1): Remove decl.
16186 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16187 Now static.
16188
16189 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16190 * ccl.c (Vccl_program_table): Now static.
16191 (check_ccl_update): Remove; unused.
16192
16193 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16194 * category.h: ... from here.
16195 * category.c (check_category_table, set_category_set): Now static.
16196
16197 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16198 * lisp.h: Remove these decls.
16199
16200 * buffer.c (buffer_count): Remove unused var.
16201
16202 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16203 so that it's not optimized away.
16204 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16205 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16206 exported only to the debugger.
16207
16208 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16209 * atimer.h (run_all_atimers): Remove; not exported.
16210
16211 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16212 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16213 was inaccessible from Lisp.
16214 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16215 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16216
16217 alloc.c: Import and export fewer symbols, and remove unused items.
16218 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16219 is defined.
16220 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16221 it's not optimized away by whole-program optimization.
16222 (message_enable_multibyte, free_misc): Remove.
16223 (catchlist, handlerlist, mark_backtrace):
16224 Declare only if BYTE_MARK_STACK.
16225 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16226 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16227 (message_enable_multibyte): Remove decl.
16228 (free_misc, interval_free_list, float_block, float_block_index):
16229 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16230 (cons_free_list, last_marked_index):
16231 Now static.
16232 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16233 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16234 (mark_backtrace): Define only if BYTE_MARK_STACK.
16235 * xdisp.c (message_enable_multibyte): Now static.
16236
16237 Declare Lisp_Object Q* variables to be 'static' if not exported.
16238 This makes it easier for human readers (and static analyzers)
16239 to see whether these variables are used from other modules.
16240 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16241 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16242 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16243 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16244 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16245 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16246 * xmenu.c, xselect.c:
16247 Declare Q* vars static if they are not used in other modules.
16248 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16249 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16250 Remove decls of unexported vars.
16251 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16252
16253 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16254
16255 Make Emacs functions such as Fatom 'static' by default.
16256 This makes it easier for human readers (and static analyzers)
16257 to see whether these functions can be called from other modules.
16258 DEFUN now defines a static function. To make the function external
16259 so that it can be used in other C modules, use the new macro DEFUE.
16260 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16261 (Finit_image_library):
16262 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16263 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16264 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16265 Remove decls, since these functions are now static.
16266 (Funintern, Fget_internal_run_time): New decls, since these functions
16267 were already external.
16268
16269 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16270 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16271 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16272 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16273 * keyboard.c, keymap.c, lread.c:
16274 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16275 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16276 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16277 Mark functions with DEFUE instead of DEFUN,
16278 if they are used in other modules.
16279 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16280 decls for now-static functions.
16281 * buffer.h (Fdelete_overlay): Remove decl.
16282 * callproc.c (Fgetenv_internal): Mark as internal.
16283 * composite.c (Fremove_list_of_text_properties): Remove decl.
16284 (Fcomposition_get_gstring): New forward static decl.
16285 * composite.h (Fcomposite_get_gstring): Remove decl.
16286 * dired.c (Ffile_attributes): New forward static decl.
16287 * doc.c (Fdocumntation_property): New forward static decl.
16288 * eval.c (Ffetch_bytecode): New forward static decl.
16289 (Funintern): Remove extern decl; now in .h file where it belongs.
16290 * fileio.c (Fmake_symbolic_link): New forward static decl.
16291 * image.c (Finit_image_library): New forward static decl.
16292 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16293 * intervals.h (Fprevious_property_change):
16294 (Fremove_list_of_text_properties): Remove decls.
16295 * keyboard.c (Fthis_command_keys): Remove decl.
16296 (Fcommand_execute): New forward static decl.
16297 * keymap.c (Flookup_key): New forward static decl.
16298 (Fcopy_keymap): Now static.
16299 * keymap.h (Flookup_key): Remove decl.
16300 * process.c (Fget_process): New forward static decl.
16301 (Fprocess_datagram_address): Mark as internal.
16302 * syntax.c (Fsyntax_table_p): New forward static decl.
16303 (skip_chars): Remove duplicate decl.
16304 * textprop.c (Fprevious_property_change): New forward static decl.
16305 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16306 Now internal.
16307 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16308 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16309
16310 * editfns.c (Fformat): Remove unreachable code.
16311
16312 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16313
16314 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16315 change. (Bug#8496)
16316
16317 2011-04-13 Eli Zaretskii <eliz@gnu.org>
16318
16319 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16320 when at ZV. (Bug#8487)
16321
16322 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16323
16324 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16325 (Bug#8437)
16326 * keyboard.c (parse_tool_bar_item): Likewise.
16327 * sound.c (sound_cleanup, alsa_close): Likewise.
16328 * termcap.c (tgetent): Likewise.
16329 * xfns.c (x_default_font_parameter): Likewise.
16330 * xsettings.c (read_and_apply_settings): Likewise.
16331
16332 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16333 (overrun_check_free): Protoize.
16334
16335 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16336
16337 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16338 since callers should never pass a negative size.
16339 Change the signature to match that of plain 'read' and 'write'; see
16340 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16341 * lisp.h: Update prototypes of emacs_write and emacs_read.
16342
16343 2011-04-11 Eli Zaretskii <eliz@gnu.org>
16344
16345 * xdisp.c (redisplay_window): Don't try to determine the character
16346 position of the scroll margin if the window start point w->startp
16347 is outside the buffer's accessible region. (Bug#8468)
16348
16349 2011-04-10 Eli Zaretskii <eliz@gnu.org>
16350
16351 Fix write-region and its subroutines for buffers > 2GB.
16352 * fileio.c (a_write, e_write): Modify declaration of arguments and
16353 local variables to support buffers larger than 2GB.
16354 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16355
16356 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16357 argument, local variables, and return value.
16358
16359 * lisp.h: Update prototypes of emacs_write and emacs_read.
16360
16361 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16362
16363 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16364
16365 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16366
16367 Fix more problems found by GCC 4.6.0's static checks.
16368
16369 * xdisp.c (vmessage): Use a better test for character truncation.
16370
16371 * charset.c (load_charset_map): <, not <=, for optimization,
16372 and to avoid potential problems with integer overflow.
16373 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16374 * casetab.c (set_identity, shuffle): Likewise.
16375 * editfns.c (Fformat): Likewise.
16376 * syntax.c (skip_chars): Likewise.
16377
16378 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16379 This also lets GCC 4.6.0 generate slightly better loop code.
16380
16381 * callint.c (Fcall_interactively): <, not <=, for optimization.
16382 (Fcall_interactively): Count the number of arguments produced,
16383 not the number of arguments given. This is simpler and lets GCC
16384 4.6.0 generate slightly better code.
16385
16386 * ftfont.c: Distingish more carefully between FcChar8 and char.
16387 The previous code passed unsigned char * to a functions like
16388 strlen and xstrcasecmp that expect char *, which does not
16389 conform to the C standard.
16390 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16391 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16392 char * when the C standard requires it.
16393
16394 * keyboard.c (read_char): Remove unused var.
16395
16396 * eval.c: Port to Windows vsnprintf (Bug#8435).
16397 Include <limits.h>.
16398 (SIZE_MAX): Define if the headers do not.
16399 (verror): Do not give up if vsnprintf returns a negative count.
16400 Instead, grow the buffer. This ports to Windows vsnprintf, which
16401 does not conform to C99. Problem reported by Eli Zaretskii.
16402 Also, simplify the allocation scheme, by avoiding the need for
16403 calling realloc, and removing the ALLOCATED variable.
16404
16405 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16406
16407 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16408 But keep the doprint source code for now, as we might revamp it
16409 and use it again (Bug#8435).
16410 * lisp.h (doprnt): Remove.
16411 * Makefile.in (base_obj): Remove doprnt.o.
16412 * deps.mk (doprnt.o): Remove.
16413
16414 error: Print 32- and 64-bit integers portably (Bug#8435).
16415 Without this change, on typical 64-bit hosts error ("...%d...", N)
16416 was used to print both 32- and 64-bit integers N, which relied on
16417 undefined behavior.
16418 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16419 * lisp.h (error, verror): Mark as printf-like functions.
16420 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16421 Report overflow in size calculations when allocating printf buffer.
16422 Do not truncate output string at its first null byte.
16423 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16424 Truncate the output at a character boundary, since vsnprintf does not
16425 do that.
16426 * charset.c (check_iso_charset_parameter): Convert internal
16427 character to string before calling 'error', since %c now has the
16428 printf meaning.
16429 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16430 overflow when computing char to be passed to 'error'. Do not
16431 pass Lisp_Object to 'error'; pass the integer instead.
16432 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16433 formatted with plain %d.
16434
16435 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16436
16437 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16438
16439 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16440
16441 * xterm.c (x_catch_errors): Remove duplicate declaration.
16442
16443 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16444
16445 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16446
16447 2011-04-10 Jim Meyering <meyering@redhat.com>
16448
16449 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16450 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16451 return ssize_t not "int", and use size_t as the buffer length.
16452 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16453 * gnutls.h: Update declarations.
16454 * process.c (read_process_output): Use ssize_t, to match.
16455 (send_process): Likewise.
16456
16457 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16458
16459 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16460
16461 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16462
16463 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16464 Use unsigned char, to match FcChar8 type definition.
16465
16466 * xterm.c (handle_one_xevent):
16467 * xmenu.c (create_and_show_popup_menu):
16468 * xselect.c (x_decline_selection_request)
16469 (x_reply_selection_request): Avoid type-punned deref of X events.
16470
16471 2011-04-09 Eli Zaretskii <eliz@gnu.org>
16472
16473 Fix some uses of `int' instead of EMACS_INT.
16474 * search.c (string_match_1, fast_string_match)
16475 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16476 (scan_buffer, find_next_newline_no_quit)
16477 (find_before_next_newline, search_command, Freplace_match)
16478 (Fmatch_data): Make some `int' variables be EMACS_INT.
16479
16480 * xdisp.c (display_count_lines): 3rd argument and return value now
16481 EMACS_INT. All callers changed.
16482 (pint2hrstr): Last argument is now EMACS_INT.
16483
16484 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16485 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16486 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16487 (decode_coding_utf_16, decode_coding_emacs_mule)
16488 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16489 (decode_coding_ccl, decode_coding_charset)
16490 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16491 (decode_coding_iso_2022, decode_coding_emacs_mule)
16492 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16493 <char_offset, last_offset>: Declare EMACS_INT.
16494 (encode_coding_utf_8, encode_coding_utf_16)
16495 (encode_coding_emacs_mule, encode_invocation_designation)
16496 (encode_designation_at_bol, encode_coding_iso_2022)
16497 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16498 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16499 Declare EMACS_INT.
16500 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16501 (encode_invocation_designation): Last argument P_NCHARS is now
16502 EMACS_INT.
16503 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16504 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16505
16506 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16507 All users changed.
16508
16509 * ccl.c (Fccl_execute_on_string): Declare some variables
16510 EMACS_INT.
16511
16512 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16513
16514 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16515
16516 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16517
16518 * process.c (Fformat_network_address): Doc fix.
16519
16520 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16521
16522 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16523
16524 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16525
16526 * keyboard.c (read_char): Call Lisp function help-form-show,
16527 instead of using internal_with_output_to_temp_buffer.
16528 (Qhelp_form_show): New var.
16529 (syms_of_keyboard): Use DEFSYM macro.
16530
16531 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16532
16533 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16534
16535 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16536
16537 * process.c (Flist_processes): Remove to Lisp.
16538 (list_processes_1): Delete.
16539
16540 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16541
16542 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16543
16544 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16545
16546 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16547
16548 Fix more problems found by GCC 4.6.0's static checks.
16549
16550 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16551
16552 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16553
16554 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16555
16556 * xdisp.c (vmessage): Mark as a printf-like function.
16557
16558 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16559
16560 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16561
16562 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16563 printf-like functions.
16564 (tiff_load): Add casts to remove these marks before passing them
16565 to system-supplied API.
16566
16567 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16568
16569 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16570 This avoids several warnings with gcc -Wstrict-overflow.
16571 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16572 directly, rather than having caller test rule sign. This avoids
16573 some unnecessary tests.
16574 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16575 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16576 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16577
16578 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16579 (xfont_open): Avoid unnecessary tests.
16580
16581 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16582
16583 * composite.h, composite.c (composition_gstring_put_cache):
16584 Use EMACS_INT, not int, for length.
16585
16586 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16587 breaking out part of COMPOSITION_DECODE_RULE.
16588 (COMPOSITION_DECODE_RULE): Use it.
16589 * composite.c (get_composition_id): Remove unused local vars,
16590 by using the new macro.
16591
16592 * textprop.c (set_text_properties_1): Change while to do-while,
16593 since the condition is always true at first.
16594
16595 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16596 (interval_deletion_adjustment): Return unsigned value.
16597 All uses changed.
16598
16599 * process.c (list_processes_1, create_pty, read_process_output):
16600 (exec_sentinel): Remove vars that were set but not used.
16601 (create_pty): Remove unnecessary "volatile"s.
16602 (Fnetwork_interface_info): Avoid possibility of int overflow.
16603 (read_process_output): Do adaptive read buffering even if carryover.
16604 (read_process_output): Simplify nbytes computation if buffered.
16605
16606 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16607
16608 * syntax.c (scan_words): Remove var that was set but not used.
16609 (update_syntax_table): Use unsigned instead of int.
16610
16611 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16612 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16613 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16614
16615 * print.c (print_error_message): Avoid int overflow.
16616
16617 * font.c (font_list_entities): Redo for clarity,
16618 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16619
16620 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16621 (font_score): Avoid potential overflow in diff calculation.
16622
16623 * fns.c (substring_both): Remove var that is set but not used.
16624 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16625
16626 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16627
16628 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16629 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16630 can always succeed if overflow has undefined behavior.
16631
16632 * search.c (boyer_moore, wordify): Remove vars set but not used.
16633 (wordify): Omit three unnecessary tests.
16634
16635 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16636 All callers changed. This avoids the need for an unused var.
16637
16638 * casefiddle.c (casify_region): Remove var that is set but not used.
16639
16640 * dired.c (file_name_completion): Remove var that is set but not used.
16641
16642 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16643
16644 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16645 (Finsert_file_contents): Remove unnecessary code checking fd.
16646
16647 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16648 Check for integer overflow on size calculations.
16649
16650 * buffer.c (Fprevious_overlay_change): Remove var that is set
16651 but not used.
16652
16653 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16654 Remove vars that are set but not used.
16655 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16656 (timer_check_2): Mark vars as initialized.
16657
16658 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16659
16660 * image.c (lookup_image): Remove var that is set but not used.
16661 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16662
16663 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16664 that are set but not used.
16665
16666 * xfns.c (make_invisible_cursor): Don't return garbage
16667 if XCreateBitmapFromData fails (Bug#8410).
16668
16669 * xselect.c (x_get_local_selection, x_handle_property_notify):
16670 Remove vars that are set but not used.
16671
16672 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16673 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16674
16675 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16676 Remove var that is set but not used.
16677 (scroll_bar_windows_size): Now size_t, not int.
16678 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16679 Check for overflow.
16680
16681 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16682 (map_tty_color) [!defined MSDOS]: Likewise.
16683
16684 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16685
16686 * coding.c: Remove vars that are set but not used.
16687 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16688 All callers changed.
16689 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16690 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16691 (decode_coding_charset): Remove vars that are set but not used.
16692
16693 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16694 that is set but not used.
16695
16696 * print.c (print_object): Remove var that is set but not used.
16697
16698 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16699 The gnulib version avoids calling malloc in the usual case,
16700 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16701 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16702 * filelock.c (current_lock_owner): Likewise.
16703 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16704 * sysdep.c: Include allocator.h, careadlinkat.h.
16705 (emacs_no_realloc_allocator): New static constant.
16706 (emacs_readlink): New function.
16707 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16708 ../lib/careadlinkat.h.
16709
16710 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16711
16712 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16713 first non-nil return value).
16714
16715 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16716
16717 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16718 if not defined (Bug#8403).
16719
16720 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16721
16722 * xdisp.c (display_count_lines): Remove parameter `start',
16723 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16724 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16725 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16726 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16727 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16728 and thereabouts. All callers changed.
16729 (get_per_char_metric): Remove parameter `f', unused since
16730 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16731
16732 2011-04-02 Jim Meyering <meyering@redhat.com>
16733
16734 do not dereference NULL upon failed strdup
16735 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16736 (ns_get_family): Likewise.
16737
16738 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16739
16740 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16741
16742 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16743
16744 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16745 later (Bug#8403).
16746
16747 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16748
16749 Add lexical binding.
16750
16751 * window.c (Ftemp_output_buffer_show): New fun.
16752 (Fsave_window_excursion):
16753 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16754
16755 * lread.c (lisp_file_lexically_bound_p): New function.
16756 (Fload): Bind Qlexical_binding.
16757 (readevalloop): Remove `evalfun' arg.
16758 Bind Qinternal_interpreter_environment.
16759 (Feval_buffer): Bind Qlexical_binding.
16760 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16761 Mark as dynamic.
16762 (syms_of_lread): Declare `lexical-binding'.
16763
16764 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16765
16766 * keyboard.c (eval_dyn): New fun.
16767 (menu_item_eval_property): Use it.
16768
16769 * image.c (parse_image_spec): Use Ffunctionp.
16770
16771 * fns.c (concat, mapcar1): Accept byte-code-functions.
16772
16773 * eval.c (Fsetq): Handle lexical vars.
16774 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16775 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16776 (FletX, Flet): Obey lexical binding.
16777 (Fcommandp): Handle closures.
16778 (Feval): New `lexical' arg.
16779 (eval_sub): New function extracted from Feval. Use it almost
16780 everywhere where Feval was used. Look up vars in lexical env.
16781 Handle closures.
16782 (Ffunctionp): Move from subr.el.
16783 (Ffuncall): Handle closures.
16784 (apply_lambda): Remove `eval_flags'.
16785 (funcall_lambda): Handle closures and new byte-code-functions.
16786 (Fspecial_variable_p): New function.
16787 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16788 but without exporting it to Lisp.
16789
16790 * doc.c (Fdocumentation, store_function_docstring):
16791 * data.c (Finteractive_form): Handle closures.
16792
16793 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16794 interactive spec.
16795
16796 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16797 New byte-codes.
16798 (exec_byte_code): New function extracted from Fbyte_code to handle new
16799 calling convention for byte-code-functions. Add new byte-codes.
16800
16801 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16802
16803 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16804
16805 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16806
16807 * xdisp.c (redisplay_internal): Fix prototype.
16808
16809 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16810
16811 * xdisp.c (SCROLL_LIMIT): New macro.
16812 (try_scrolling): Use it when setting scroll_limit.
16813 Limit scrolling to 100 screen lines.
16814 (redisplay_window): Even when falling back on "recentering",
16815 position point in the window according to scroll-conservatively,
16816 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16817
16818 (try_scrolling): When point is above the window, allow searching
16819 as far as scroll_max, or one screenful, to compute vertical
16820 distance from PT to the scroll margin position. This prevents
16821 try_scrolling from unnecessarily failing when
16822 scroll-conservatively is set to a value slightly larger than the
16823 window height. Clean up the case of PT below the margin at bottom
16824 of window: scroll_max can no longer be INT_MAX. When aggressive
16825 scrolling is in use, don't let point enter the opposite scroll
16826 margin as result of the scroll.
16827 (syms_of_xdisp) <scroll-conservatively>: Document the
16828 threshold of 100 lines for never-recentering scrolling.
16829
16830 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16831
16832 * dispextern.h (move_it_by_lines):
16833 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16834 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16835 (message_log_check_duplicate): Remove parameters `prev_bol' and
16836 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16837 (redisplay_internal): Remove parameter `preserve_echo_area',
16838 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16839
16840 * indent.c (Fvertical_motion):
16841 * window.c (window_scroll_pixel_based, Frecenter):
16842 Don't pass `need_y_p' to `move_it_by_lines'.
16843
16844 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16845
16846 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16847 steal a few bits to be more compact.
16848 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16849 Remove unneeded casts.
16850
16851 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16852
16853 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16854
16855 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16856 binding" message (bug#7967).
16857
16858 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16859
16860 Fix more problems found by GCC 4.6.0's static checks.
16861
16862 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16863 Remove unused local var.
16864
16865 * editfns.c (Fmessage_box): Remove unused local var.
16866
16867 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16868 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16869 Omit unused local vars.
16870 * window.c (shrink_windows): Omit unused local var.
16871 * menu.c (digest_single_submenu): Omit unused local var.
16872 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16873 Omit unused local var.
16874
16875 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16876 Don't assume string length fits in int.
16877 (keyremap_step, read_key_sequence): Use size_t for sizes.
16878 (read_key_sequence): Don't check last_real_key_start redundantly.
16879
16880 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16881 instead of alloca (Bug#8344).
16882
16883 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16884 (Fbacktrace_frame): Don't assume nframes fits in int.
16885
16886 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16887
16888 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16889 concerns.
16890
16891 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16892
16893 * cm.c (calccost): Turn while-do into do-while, for clarity.
16894
16895 * keyboard.c (syms_of_keyboard): Use the same style as later
16896 in this function when indexing through an array. This also
16897 works around GCC bug 48267.
16898
16899 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16900
16901 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16902
16903 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16904 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16905
16906 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16907 This avoids undefined behavior on integer overflow, and is a bit
16908 more convenient anyway since it is compared to a size_t variable.
16909
16910 Variadic C functions now count arguments with size_t, not int.
16911 This avoids an unnecessary limitation on 64-bit machines, which
16912 caused (substring ...) to crash on large vectors (Bug#8344).
16913 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16914 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16915 All variadic functions and their callers changed accordingly.
16916 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16917 * data.c (arith_driver, float_arith_driver): Likewise.
16918 * editfns.c (general_insert_function): Likewise.
16919 * eval.c (struct backtrace.nargs, interactive_p)
16920 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16921 (funcall_lambda, mark_backtrace): Likewise.
16922 * fns.c (concat): Likewise.
16923 * frame.c (x_set_frame_parameters): Likewise.
16924 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16925 0 if not found, not -1. All callers changed.
16926
16927 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16928 (stack_copy_size): Now size_t, not int.
16929 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16930
16931 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16932
16933 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16934 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16935 All callers changed.
16936
16937 * lisp.h (multibyte_char_to_unibyte):
16938 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16939 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16940 * character.h (CHAR_TO_BYTE8):
16941 * cmds.c (internal_self_insert):
16942 * editfns.c (general_insert_function):
16943 * keymap.c (push_key_description):
16944 * search.c (Freplace_match):
16945 * xdisp.c (message_dolog, set_message_1): All callers changed.
16946
16947 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16948
16949 * keyboard.c (safe_run_hook_funcall): New function.
16950 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16951 don't set the hook to nil, but remove the offending function instead.
16952 (Qcommand_hook_internal): Remove, unused.
16953 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16954 Vcommand_hook_internal.
16955
16956 * eval.c (enum run_hooks_condition): Remove.
16957 (funcall_nil, funcall_not): New functions.
16958 (run_hook_with_args): Call each function through a `funcall' argument.
16959 Remove `cond' argument, now redundant.
16960 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16961 (Frun_hook_with_args_until_failure): Adjust accordingly.
16962 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16963
16964 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16965
16966 * dispextern.h (string_buffer_position): Remove declaration.
16967
16968 * print.c (strout): Remove parameter `multibyte', unused since
16969 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16970
16971 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16972 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16973 All callers changed.
16974
16975 * w32.c (_wsa_errlist): Use braces for struct initializers.
16976
16977 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16978 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16979 All callers changed.
16980 (string_buffer_position): Likewise. Also, make static (it's never
16981 used outside xdisp.c).
16982 (cursor_row_p): Remove parameter `w', unused since
16983 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16984 (decode_mode_spec): Remove parameter `precision', introduced during
16985 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16986 All callers changed.
16987
16988 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16989
16990 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16991
16992 2011-03-27 Anders Lindgren <andlind@gmail.com>
16993
16994 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16995 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16996 (ns_update_auto_hide_menu_bar): New functions.
16997 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16998 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16999 ns_constrain_all_frames.
17000 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17001 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17002
17003 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17004
17005 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17006
17007 2011-03-27 Glenn Morris <rgm@gnu.org>
17008
17009 * syssignal.h: Replace RETSIGTYPE with void.
17010 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17011 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17012 Replace SIGTYPE with void everywhere.
17013 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17014 * s/template.h (SIGTYPE): Remove commented out definition.
17015
17016 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17017
17018 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17019 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17020
17021 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17022
17023 * w32.c (read_unc_volume): Use parameter `henum', instead of
17024 global variable `wget_enum_handle'.
17025
17026 * keymap.c (describe_vector): Remove parameters `indices' and
17027 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17028 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17029
17030 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17031
17032 * keyboard.c (timer_check): Remove parameter `do_it_now',
17033 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17034 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17035 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17036
17037 * keyboard.c (read_char):
17038 * w32menu.c (w32_menu_display_help):
17039 * xmenu.c (show_help_event, menu_help_callback):
17040 Adjust calls to `show_help_echo'.
17041
17042 * gtkutil.c (xg_maybe_add_timer):
17043 * keyboard.c (readable_events):
17044 * process.c (wait_reading_process_output):
17045 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17046
17047 * insdel.c (adjust_markers_gap_motion):
17048 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17049 (gap_left, gap_right): Don't call it.
17050
17051 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17052
17053 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17054 incurred during fontification.
17055
17056 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17057
17058 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17059 (DEFVAR_PER_BUFFER): Don't pass it.
17060
17061 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17062 (scrolling_window): Don't pass it.
17063
17064 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17065
17066 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17067
17068 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17069 and `suffix'.
17070 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17071 of variables specific to SELinux and computation of `encoded_absname'.
17072
17073 * image.c (XPutPixel): Remove unused variable `height'.
17074
17075 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17076
17077 * unexw32.c (get_section_info): Remove unused variable `section'.
17078
17079 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17080 (system_process_attributes): Remove unused variable `sess'.
17081 (sys_read): Remove unused variable `err'.
17082
17083 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17084 (w32_wnd_proc): Remove unused variable `isdead'.
17085 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17086 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17087 (x_create_tip_frame): Remove unused variable `tem'.
17088
17089 * w32inevt.c (w32_console_read_socket):
17090 Remove unused variable `no_events'.
17091
17092 * w32term.c (x_draw_composite_glyph_string_foreground):
17093 Remove unused variable `width'.
17094
17095 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17096
17097 * w32term.c (x_set_glyph_string_clipping):
17098 Don't pass uninitialized region to CombineRgn.
17099
17100 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17101
17102 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17103 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17104 (Fx_close_connection): Remove unused variable `i'.
17105
17106 * w32font.c (w32font_draw): Return number of glyphs.
17107 (w32font_open_internal): Remove unused variable `i'.
17108 (w32font_driver): Add missing initializer.
17109
17110 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17111 (fill_in_menu): Remove unused variable `items_added'.
17112
17113 * w32term.c (last_mouse_press_frame): Remove static global variable.
17114 (w32_clip_to_row): Remove unused variable `f'.
17115 (x_delete_terminal): Remove unused variable `i'.
17116
17117 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17118 (NOTHING): Remove unused static global variable.
17119 (uniscribe_check_otf): Remove unused variable `table'.
17120 (uniscribe_font_driver): Add missing initializers.
17121
17122 2011-03-23 Julien Danjou <julien@danjou.info>
17123
17124 * term.c (Fsuspend_tty, Fresume_tty):
17125 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17126 * window.c (temp_output_buffer_show):
17127 * insdel.c (signal_before_change):
17128 * frame.c (Fhandle_switch_frame):
17129 * fileio.c (Fdo_auto_save):
17130 * emacs.c (Fkill_emacs):
17131 * editfns.c (save_excursion_restore):
17132 * cmds.c (internal_self_insert):
17133 * callint.c (Fcall_interactively):
17134 * buffer.c (Fkill_all_local_variables):
17135 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17136 Use Frun_hooks.
17137 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17138 unconditionally since it does the check itself.
17139
17140 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17141
17142 Fix more problems found by GCC 4.5.2's static checks.
17143
17144 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17145 the first time through the loop, since we know p0 < p1 then.
17146 This also avoids a gcc -Wstrict-overflow warning.
17147
17148 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17149 leading to a memory leak, possible in functions like
17150 load_charset_map_from_file that can allocate an unbounded number
17151 of objects (Bug#8318).
17152
17153 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17154 that could (at least in theory) be that large.
17155
17156 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17157 This is less likely to overflow, and avoids undefined behavior if
17158 overflow does occur. All callers changed. Use strtoul to scan
17159 for the unsigned long integer.
17160 (pint2hrstr): Simplify and tune code slightly.
17161 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17162
17163 * scroll.c (do_scrolling): Work around GCC bug 48228.
17164 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17165
17166 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17167 This also avoids a warning with gcc -Wstrict-overflow.
17168 (validate_x_resource_name): Simplify count usage.
17169 This also avoids a warning with gcc -Wstrict-overflow.
17170
17171 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17172 fail (Bug#8306).
17173
17174 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17175
17176 * process.c (Fmake_network_process): Use socklen_t, not int,
17177 where POSIX says socklen_t is required in portable programs.
17178 This fixes a porting bug on hosts like 64-bit HP-UX, where
17179 socklen_t is wider than int (Bug#8277).
17180 (Fmake_network_process, server_accept_connection):
17181 (wait_reading_process_output, read_process_output):
17182 Likewise.
17183
17184 * process.c: Rename or move locals to avoid shadowing.
17185 (list_processes_1, Fmake_network_process):
17186 (read_process_output_error_handler, exec_sentinel_error_handler):
17187 Rename or move locals.
17188 (Fmake_network_process): Define label "retry_connect" only if needed.
17189 (Fnetwork_interface_info): Fix pointer signedness.
17190 (process_send_signal): Add cast to avoid pointer signedness problem.
17191 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17192 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17193
17194 Make tparam.h and terminfo.c consistent.
17195 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17196 Include tparam.h instead, since it declares them.
17197 * cm.h (PC): Remove extern decl; tparam.h now does this.
17198 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17199 * terminfo.c: Include tparam.h, to check interfaces.
17200 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17201 (tparam): Adjust signature to match interface in tparam.h;
17202 this removes some undefined behavior. Check that outstring and len
17203 are zero, which they always are with Emacs.
17204 * tparam.h (PC, BC, UP): New extern decls.
17205
17206 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17207 (xftfont_open): Rename locals to avoid shadowing.
17208
17209 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17210 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17211 (OTF_TAG_SYM): Omit macro if not needed.
17212 (ftfont_list): Remove unused local.
17213 (get_adstyle_property, ftfont_pattern_entity):
17214 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17215 Rename locals to avoid shadowing.
17216
17217 * xfont.c (xfont_list_family): Mark var as initialized.
17218
17219 * xml.c (make_dom): Now static.
17220
17221 * composite.c (composition_compute_stop_pos): Rename local to
17222 avoid shadowing.
17223 (composition_reseat_it): Remove unused locals.
17224 (find_automatic_composition, composition_adjust_point): Likewise.
17225 (composition_update_it): Mark var as initialized.
17226 (find_automatic_composition): Mark vars as initialized,
17227 with a FIXME (Bug#8290).
17228
17229 character.h: Rename locals to avoid shadowing.
17230 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17231 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17232 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17233 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17234 to avoid shadowing.
17235
17236 * textprop.c (property_change_between_p): Remove; unused.
17237
17238 * intervals.c (interval_start_pos): Now static.
17239
17240 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17241
17242 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17243 Rename locals to avoid shadowing.
17244
17245 * sound.c (wav_play, au_play, Fplay_sound_internal):
17246 Fix pointer signedness.
17247 (alsa_choose_format): Remove unused local var.
17248 (wav_play): Initialize a variable to 0, to prevent undefined
17249 behavior (Bug#8278).
17250
17251 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17252
17253 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17254
17255 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17256 clobbering (Bug#8298).
17257 * sysdep.c (sys_subshell): Likewise.
17258 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17259
17260 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17261 This should get cleaned up, so that child_setup has the
17262 same signature on all platforms.
17263
17264 * callproc.c (call_process_cleanup): Now static.
17265 (relocate_fd): Rename locals to avoid shadowing.
17266
17267 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
17268
17269 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17270 not to be necessary, and produces flickering.
17271
17272 2011-03-20 Glenn Morris <rgm@gnu.org>
17273
17274 * config.in: Remove file.
17275
17276 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
17277
17278 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17279 are now in src/globals.h.
17280 (syms_of_minibuf): Remove spurious & from previous change.
17281
17282 2011-03-20 Leo Liu <sdl.web@gmail.com>
17283
17284 * minibuf.c (completing-read-function): New variable.
17285 (completing-read-default): Rename from completing-read.
17286 (completing-read): Call completing-read-function.
17287
17288 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17289
17290 * xfaces.c (Fx_load_color_file):
17291 Read color file from absolute filename (bug#8250).
17292
17293 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17294
17295 * makefile.w32-in: Update dependencies.
17296
17297 2011-03-17 Eli Zaretskii <eliz@gnu.org>
17298
17299 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17300
17301 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17302
17303 Fix more problems found by GCC 4.5.2's static checks.
17304
17305 * process.c (make_serial_process_unwind, send_process_trap):
17306 (sigchld_handler): Now static.
17307
17308 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17309 That way, the code declares only the vars that it needs.
17310 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17311 * s/cygwin.h (PTY_ITERATION): Likewise.
17312 * s/darwin.h (PTY_ITERATION): Likewise.
17313 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17314
17315 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17316 * process.c (allocate_pty): Don't declare stb unless it's needed.
17317
17318 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17319 (CONSTANTLIM): Remove; unused.
17320 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17321 Define only if needed.
17322
17323 * unexelf.c (unexec): Name an expression,
17324 to avoid gcc -Wbad-function-cast warning.
17325 Use a different way to cause a compilation error if anyone uses
17326 n rather than nn, a way that does not involve shadowing.
17327 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17328
17329 * deps.mk (unexalpha.o): Remove; unused.
17330
17331 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17332 * unexec.h: New file.
17333 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17334 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17335 Depend on unexec.h.
17336 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17337 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17338 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17339 Change as necessary to match prototype in unexec.h.
17340
17341 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17342 shadowing.
17343 (back_comment, skip_chars): Mark vars as initialized.
17344
17345 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17346 Rename locals to avoid shadowing.
17347
17348 * lread.c (read1): Rewrite so as not to use empty "else".
17349 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17350
17351 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17352
17353 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17354 warning when compiling print.c.
17355
17356 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17357 instead of using an uninitialized var.
17358 (font_sort_entities): Mark var as initialized.
17359
17360 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17361
17362 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17363 pointers to constants.
17364 (font_parse_fcname): Remove unused vars.
17365 (font_delete_unmatched): Now static.
17366 (font_get_spec): Remove; unused.
17367 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17368 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17369 Rename or move locals to avoid shadowing.
17370
17371 * fns.c (require_nesting_list, require_unwind): Now static.
17372 (Ffillarray): Rename locals to avoid shadowing.
17373
17374 * floatfns.c (domain_error2): Define only if needed.
17375 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17376
17377 * alloc.c (mark_backtrace): Move decl from here ...
17378 * lisp.h: ... to here, so that it can be checked.
17379
17380 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17381 (Fdefvar): Rewrite so as not to use empty "else".
17382 (lisp_indirect_variable): Name an expression,
17383 to avoid gcc -Wbad-function-cast warning.
17384 (Fdefvar): Rename locals to avoid shadowing.
17385
17386 * callint.c (quotify_arg, quotify_args): Now static.
17387 (Fcall_interactively): Rename locals to avoid shadowing.
17388 Use const pointer when appropriate.
17389
17390 * lisp.h (get_system_name, get_operating_system_release):
17391 Move decls here, to check interfaces.
17392 * process.c (get_operating_system_release): Move decl to lisp.h.
17393 * xrdb.c (get_system_name): Likewise.
17394 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17395 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17396 some of which prompt warnings from gcc -Wbad-function-cast.
17397 (Fformat_time_string, Fencode_time, Finsert_char):
17398 (Ftranslate_region_internal, Fformat):
17399 Rename or remove local vars to avoid shadowing.
17400 (Ftranslate_region_internal): Mark var as initialized.
17401
17402 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17403 avoid shadowing.
17404
17405 * lisp.h (eassert): Check that the argument compiles, even if
17406 ENABLE_CHECKING is not defined.
17407
17408 * data.c (Findirect_variable): Name an expression, to avoid
17409 gcc -Wbad-function-cast warning.
17410 (default_value, arithcompare, arith_driver, arith_error): Now static.
17411 (store_symval_forwarding): Rename local to avoid shadowing.
17412 (Fmake_variable_buffer_local, Fmake_local_variable):
17413 Mark variables as initialized.
17414 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17415
17416 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17417 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17418 Rename locals to avoid shadowing.
17419 (mark_stack): Move local variables into the #ifdef region where
17420 they're used.
17421 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17422 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17423 needed otherwise.
17424 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17425 (GC_STRING_CHARS): Remove; not used.
17426 (Fmemory_limit): Cast sbrk's returned value to char *.
17427
17428 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17429 avoids undefined behavior in theory.
17430
17431 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17432
17433 Use functions, not macros, for up- and down-casing (Bug#8254).
17434 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17435 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17436 to use the following functions instead of these macros.
17437 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17438 EMACS_INT, since callers assume the returned value fits in int.
17439 (upcase1): Likewise, for UPCASE_TABLE.
17440 (uppercasep, lowercasep, upcase): New static inline functions.
17441 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17442 the race-condition problem in the old DOWNCASE.
17443
17444 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17445 Rename locals to avoid shadowing.
17446 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17447 (regex_compile, re_search_2, re_match_2_internal):
17448 Remove unused local vars.
17449 (FREE_VAR): Rewrite so as not to use empty "else",
17450 which gcc can warn about.
17451 (regex_compile, re_match_2_internal): Mark locals as initialized.
17452 (RETALLOC_IF): Define only if needed.
17453 (WORDCHAR_P): Likewise. This one is never needed, but is used
17454 only in a comment talking about a compiler bug, so put inside
17455 the #if 0 of that comment.
17456 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17457 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17458 Remove; unused.
17459
17460 * search.c (boyer_moore): Rename locals to avoid shadowing.
17461 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17462 (PREV_CHAR_BOUNDARY): Likewise.
17463
17464 * search.c (simple_search): Remove unused var.
17465
17466 * dired.c (compile_pattern): Move decl from here ...
17467 * lisp.h: ... to here, so that it can be checked.
17468 (struct re_registers): New forward decl.
17469
17470 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17471
17472 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17473 All uses changed.
17474 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17475 Rename locals to avoid shadowing.
17476 (Fvertical_motion): Mark locals as initialized.
17477
17478 * casefiddle.c (casify_object, casify_region): Now static.
17479 (casify_region): Mark local as initialized.
17480
17481 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17482
17483 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17484 New macros, so that the caller can use some names other than
17485 gcpro1, gcpro2, etc.
17486 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17487 of the new macros.
17488 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17489 argument, for consistency with GCPRO2_VAR, etc: it is now the
17490 prefix of the variable, not the variable itself. All uses
17491 changed.
17492 * dired.c (directory_files_internal, file_name_completion):
17493 Rename locals to avoid shadowing.
17494
17495 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17496 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17497 dired.c's scmp function, had undefined behavior.
17498 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17499 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17500 * buffer.h: ... to here, because these macros use current_buffer,
17501 and the new implementation with inline functions needs to have
17502 current_buffer in scope now, rather than later when the macros
17503 are used.
17504 (downcase, upcase1): New static inline functions.
17505 (DOWNCASE, UPCASE1): Reimplement using these functions.
17506 This avoids undefined behavior in expressions like
17507 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17508 from race conditions in accessing the global variables
17509 case_temp1 and case_temp2.
17510 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17511 * lisp.h (case_temp1, case_temp2): Remove their decls.
17512 * character.h (ASCII_CHAR_P): Move from here ...
17513 * lisp.h: ... to here, so that the inline functions mentioned
17514 above can use them.
17515
17516 * dired.c (directory_files_internal_unwind): Now static.
17517
17518 * fileio.c (file_name_as_directory, directory_file_name):
17519 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17520 Now static.
17521 (file_name_as_directory): Use const pointers when appropriate.
17522 (Fexpand_file_name): Likewise. In particular, newdir might
17523 point at constant storage, so make it a const pointer.
17524 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17525 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17526 signedness issues.
17527 (Fset_file_times, Finsert_file_contents, auto_save_error):
17528 Rename locals to avoid shadowing.
17529
17530 * minibuf.c (choose_minibuf_frame_1): Now static.
17531 (Ftry_completion, Fall_completions): Rename or remove locals
17532 to avoid shadowing.
17533
17534 * marker.c (bytepos_to_charpos): Remove; unused.
17535
17536 * lisp.h (verify_bytepos, count_markers): New decls,
17537 so that gcc does not warn that these functions aren't declared.
17538
17539 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17540 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17541 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17542 (copy_text): Remove unused local var.
17543
17544 * filelock.c (within_one_second): Now static.
17545 (lock_file_1): Rename local to avoid shadowing.
17546
17547 * buffer.c (fix_overlays_before): Mark locals as initialized.
17548 (fix_start_end_in_overlays): Likewise. This function should be
17549 simplified by using pointers-to-pointers, but that's a different
17550 matter.
17551 (switch_to_buffer_1): Now static.
17552 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17553 (report_overlay_modification): Rename locals to avoid shadowing.
17554
17555 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17556 Fix pointer signedness issue.
17557 (sys_subshell): Mark local as volatile if checking for lint,
17558 to suppress a gcc -Wclobbered warning that does not seem to be right.
17559 (MAXPATHLEN): Define only if needed.
17560
17561 * process.c (serial_open, serial_configure): Move decls from here ...
17562 * systty.h: ... to here, so that they can be checked.
17563
17564 * fns.c (get_random, seed_random): Move extern decls from here ...
17565 * lisp.h: ... to here, so that they can be checked.
17566
17567 * sysdep.c (reset_io): Now static.
17568 (wait_for_termination_signal): Remove; unused.
17569
17570 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17571 (copy_keymap_item, append_key, push_text_char_description):
17572 Now static.
17573 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17574 (DENSE_TABLE_SIZE): Remove; unused.
17575 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17576 (describe_map_tree):
17577 Rename locals to avoid shadowing.
17578
17579 * keyboard.c: Declare functions static if they are not used elsewhere.
17580 (echo_char, echo_dash, cmd_error, top_level_2):
17581 (poll_for_input, handle_async_input): Now static.
17582 (read_char, kbd_buffer_get_event, make_lispy_position):
17583 (make_lispy_event, make_lispy_movement, apply_modifiers):
17584 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17585 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17586 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17587 (read_key_sequence, read_char): Mark locals as initialized.
17588 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17589
17590 * keyboard.h (make_ctrl_char): New decl.
17591 (mark_kboards): Move decl here ...
17592 * alloc.c (mark_kboards): ... from here.
17593
17594 * lisp.h (force_auto_save_soon): New decl.
17595
17596 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17597 (DEFINE_DUMMY_FUNCTION): New macro.
17598 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17599 Use it.
17600 (main): Add casts to avoid warnings
17601 if GCC considers string literals to be constants.
17602
17603 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17604
17605 * dbusbind.c: Pointer signedness fixes.
17606 (xd_signature, xd_append_arg, xd_initialize):
17607 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17608 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17609 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17610 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17611
17612 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17613 if GCC considers string literals to be constants.
17614 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17615
17616 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17617
17618 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17619 (print_preprocess, print_object): New macro to fix last change.
17620
17621 * print.c (print_preprocess): Don't forget font objects.
17622
17623 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17624
17625 * emacs.c (USAGE3): Doc fixes.
17626
17627 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17628
17629 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17630 structure.
17631
17632 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17633
17634 * lisp.h (VWindow_system, Qfile_name_history):
17635 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17636 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17637 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17638
17639 * w32select.c: Don't #include "keyboard.h".
17640 (run_protected): Add extern declaration for waiting_for_input.
17641
17642 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17643 * w32console.c (detect_input_pending, read_input_pending)
17644 (encode_terminal_code):
17645 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17646 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17647 (w32_system_caret_y, Qfile_name_history):
17648 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17649 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17650 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17651 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17652 * w32proc.c (Qlocal, report_file_error):
17653 * w32term.c (Vwindow_system, updating_frame):
17654 * w32uniscribe.c (initialized, uniscribe_font_driver):
17655 Remove unneeded extern declarations.
17656
17657 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17658
17659 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17660
17661 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17662
17663 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17664 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17665 These macros can no longer be used for assignment.
17666
17667 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17668 Assign struct members directly, instead of using BUF_BEGV etc.
17669 (record_buffer_markers, fetch_buffer_markers): New functions for
17670 recording and fetching special buffer markers.
17671 (set_buffer_internal_1, set_buffer_temp): Use them.
17672
17673 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17674
17675 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17676
17677 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17678 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17679
17680 * xdisp.c (hscroll_window_tree):
17681 (reconsider_clip_changes): Use PT instead of BUF_PT.
17682
17683 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17684
17685 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17686 $(EMACS_ROOT)/lib/intprops.h.
17687
17688 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17689
17690 Fix more problems found by GCC 4.5.2's static checks.
17691
17692 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17693 to unsigned char * to avoid compiler diagnostic.
17694 (xg_free_frame_widgets): Make it clear that a local variable is
17695 needed only if USE_GTK_TOOLTIP.
17696 (gdk_window_get_screen): Make it clear that this macro is needed
17697 only if USE_GTK_TOOLTIP.
17698 (int_gtk_range_get_value): New function, which avoids a diagnostic
17699 from gcc -Wbad-function-cast.
17700 (xg_set_toolkit_scroll_bar_thumb): Use it.
17701 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17702 diagnostic from gcc -Wbad-function-cast.
17703 (get_utf8_string, xg_get_file_with_chooser):
17704 Rename locals to avoid shadowing.
17705 (create_dialog): Move locals to avoid shadowing.
17706
17707 * xgselect.c (xg_select): Remove unused var.
17708
17709 * image.c (four_corners_best): Mark locals as initialized.
17710 (gif_load): Initialize transparent_p to zero (Bug#8238).
17711 Mark another local as initialized.
17712 (my_png_error, my_error_exit): Mark with NO_RETURN.
17713
17714 * image.c (clear_image_cache): Now static.
17715 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17716 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17717 (x_edge_detection): Remove unnecessary cast that
17718 gcc -Wbad-function-cast diagnoses.
17719 (gif_load): Fix pointer signedness.
17720 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17721 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17722
17723 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17724
17725 Improve quality of tests for time stamp overflow.
17726 For example, without this patch (encode-time 0 0 0 1 1
17727 1152921504606846976) returns the obviously-bogus value (-948597
17728 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17729 reports time overflow. See
17730 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17731 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17732 * editfns.c: Include limits.h and intprops.h.
17733 (TIME_T_MIN, TIME_T_MAX): New macros.
17734 (time_overflow): Move earlier, to before first use.
17735 (hi_time, lo_time): New functions, for an accurate test for
17736 out-of-range times.
17737 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17738 (Fget_internal_run_time): Don't assume time_t fits in int.
17739 (make_time): Use list2 instead of Fcons twice.
17740 (Fdecode_time): More accurate test for out-of-range times.
17741 (check_tm_member): New function.
17742 (Fencode_time): Use it, to test for out-of-range times.
17743 (lisp_time_argument): Don't rely on undefined left-shift and
17744 right-shift behavior when checking for time stamp overflow.
17745
17746 * editfns.c (time_overflow): New function, refactoring common code.
17747 (Fformat_time_string, Fdecode_time, Fencode_time):
17748 (Fcurrent_time_string): Use it.
17749
17750 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17751 * dired.c (make_time): Move to ...
17752 * editfns.c (make_time): ... here.
17753 * systime.h: Note the move.
17754
17755 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17756
17757 * fringe.c (update_window_fringes): Remove unused variables.
17758
17759 * unexmacosx.c (copy_data_segment): Also copy __got section.
17760 (Bug#8223)
17761
17762 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17763
17764 * termcap.c [MSDOS]: Include "msdos.h".
17765 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17766 Constify `char *' arguments and their references according to
17767 prototypes in tparam.h.
17768
17769 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17770
17771 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17772 Adapt all references accordingly.
17773
17774 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17775
17776 2011-03-11 Tom Tromey <tromey@redhat.com>
17777
17778 * buffer.c (syms_of_buffer): Remove obsolete comment.
17779
17780 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17781
17782 * termhooks.h (encode_terminal_code): Declare prototype.
17783
17784 * msdos.c (encode_terminal_code): Don't declare prototype.
17785
17786 * term.c (encode_terminal_code): Now external again, used by
17787 w32console.c and msdos.c.
17788
17789 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17790 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17791
17792 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17793
17794 Fix some minor problems found by GCC 4.5.2's static checks.
17795
17796 * fringe.c (update_window_fringes): Mark locals as initialized
17797 (Bug#8227).
17798 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17799
17800 * alloc.c (mark_fringe_data): Move decl from here ...
17801 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17802 to check its interface.
17803 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17804
17805 * fontset.c (free_realized_fontset): Now static.
17806 (Fset_fontset_font): Rename local to avoid shadowing.
17807 (fontset_font): Mark local as initialized.
17808 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17809
17810 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17811
17812 * xselect.c (x_disown_buffer_selections): Remove; not used.
17813 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17814 (x_own_selection, Fx_disown_selection_internal): Rename locals
17815 to avoid shadowing.
17816 (x_handle_dnd_message): Remove local to avoid shadowing.
17817
17818 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17819 so that the caller can use some name other than gcpro1.
17820 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17821 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17822 (Fx_backspace_delete_keys_p):
17823 Use them to avoid shadowing, and rename vars to avoid shadowing.
17824 (x_decode_color, x_set_name, x_window): Now static.
17825 (Fx_create_frame): Add braces to silence GCC warning.
17826 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17827 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17828 Remove unused locals.
17829 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17830 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17831 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17832 macros.
17833
17834 * xterm.h (x_mouse_leave): New decl.
17835
17836 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17837 Remove unused functions.
17838 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17839 (x_calc_absolute_position): Now static.
17840 (XTread_socket): Don't define label "out" unless it's used.
17841 Don't declare local "event" unless it's used.
17842 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17843 unless they are used.
17844 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17845 (x_fatal_error_signal): Remove; not used.
17846 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17847 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17848 (x_error_catcher, x_connection_closed, x_error_handler):
17849 (x_error_quitter, xembed_send_message, x_iconify_frame):
17850 (my_log_handler): Rename locals to avoid shadowing.
17851 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17852 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17853
17854 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17855 Rename or move locals to avoid shadowing.
17856 (tty_defined_color, merge_face_heights): Now static.
17857 (free_realized_faces_for_fontset): Remove; not used.
17858 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17859 does not deduce is never used uninitialized.
17860 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17861 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17862
17863 * terminal.c (store_terminal_param): Now static.
17864
17865 * xmenu.c (menu_highlight_callback): Now static.
17866 (set_frame_menubar): Remove unused local.
17867 (xmenu_show): Rename parameter to avoid shadowing.
17868 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17869 since they might point to immutable storage.
17870 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17871 since it's unused otherwise.
17872
17873 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17874 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17875 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17876 avoids a gcc -Wuninitialized diagnostic.
17877 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17878 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17879 does not deduce are never used uninitialized.
17880
17881 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17882
17883 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17884 * window.c (window_loop, size_window):
17885 (run_window_configuration_change_hook, enlarge_window): Likewise.
17886
17887 * window.c (display_buffer): Now static.
17888 (size_window): Mark variables that gcc -Wuninitialized
17889 does not deduce are never used uninitialized.
17890 * window.h (check_all_windows): New decl, to forestall
17891 gcc -Wmissing-prototypes diagnostic.
17892 * dispextern.h (bidi_dump_cached_states): Likewise.
17893
17894 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17895 shadowing.
17896 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17897 Include <limits.h>.
17898 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17899 and to avoid gcc -Wuninitialized warning.
17900 (load_charset_map): Mark variables that gcc -Wuninitialized
17901 does not deduce are never used uninitialized.
17902 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17903
17904 * coding.c (coding_set_source, coding_set_destination):
17905 Use "else { /* comment */ }" rather than "else /* comment */;"
17906 for clarity, and to avoid gcc -Wempty-body warning.
17907 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17908 a block, when the outer 'i' will do.
17909 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17910 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17911 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17912 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17913 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17914 Rename locals to avoid shadowing.
17915 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17916 * coding.c (emacs_mule_char, encode_invocation_designation):
17917 Now static, since they're not used elsewhere.
17918 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17919 (decode_coding_object, encode_coding_object, detect_coding_system):
17920 (decode_coding_emacs_mule): Mark variables that gcc
17921 -Wuninitialized does not deduce are never used uninitialized.
17922 (detect_coding_iso_2022): Initialize a local variable that might
17923 be used uninitialized. Leave a FIXME because it's not clear that
17924 this initialization is needed. (Bug#8211)
17925 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17926 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17927 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17928 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17929 Remove unused macros.
17930
17931 * category.c (hash_get_category_set): Remove unused local var.
17932 (copy_category_table): Now static, since it's not used elsewhere.
17933 * character.c (string_count_byte8): Likewise.
17934
17935 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17936 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17937
17938 * chartab.c (copy_sub_char_table): Now static, since it's not used
17939 elsewhere.
17940 (sub_char_table_ref_and_range, char_table_ref_and_range):
17941 Rename locals to avoid shadowing.
17942 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17943
17944 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17945 (BIDI_BOB): Remove unused macro.
17946
17947 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17948 deduce are never used uninitialized.
17949 * term.c (encode_terminal_code): Likewise.
17950
17951 * term.c (encode_terminal_code): Now static. Remove unused local.
17952
17953 * tparam.h: New file.
17954 * term.c, tparam.h: Include it.
17955 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17956 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17957 Move these decls to tparam.h, and make them agree with what
17958 is actually in tparam.c. The previous trick of using incompatible
17959 decls in different modules does not conform to the C standard.
17960 All callers of tparam changed to use tparam's actual API.
17961 * tparam.c (tparam1, tparam, tgoto):
17962 Use const pointers where appropriate.
17963
17964 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17965 * cm.h (struct cm): Likewise.
17966 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17967 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17968 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17969 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17970 (turn_on_face, init_tty): Likewise.
17971 * termchar.h (struct tty_display_info): Likewise.
17972
17973 * term.c (term_mouse_position): Rename local to avoid shadowing.
17974
17975 * alloc.c (mark_ttys): Move decl from here ...
17976 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17977
17978 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17979
17980 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17981
17982 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17983
17984 * search.c (compile_pattern_1): Remove argument regp, unused since
17985 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17986 (compile_pattern): Don't pass it.
17987
17988 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17989
17990 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17991 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17992 for ! HAVE_GTK3.
17993 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17994
17995 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17996
17997 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17998 gdk_window_get_screen, gdk_window_get_geometry,
17999 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18000 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18001 (xg_get_pixbuf_from_pixmap): New function.
18002 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18003 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18004 Call xg_get_pixbuf_from_pixmap instead of
18005 gdk_pixbuf_get_from_drawable.
18006 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18007 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18008 (xg_check_special_colors): Use GtkStyleContext and its functions
18009 for HAVE_GTK3.
18010 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18011 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18012 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18013 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18014 Call gtk_widget_get_preferred_size.
18015 (xg_frame_resized): gdk_window_get_geometry only takes 5
18016 parameters.
18017 (xg_win_to_widget, xg_event_is_for_menubar):
18018 Call gdk_x11_window_lookup_for_display.
18019 (xg_set_widget_bg): New function.
18020 (delete_cb): New function.
18021 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18022 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18023 (xg_set_background_color): Call xg_set_widget_bg.
18024 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18025 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18026 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18027 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18028 if ! HAVE_GTK3.
18029 (update_frame_tool_bar): Call gtk_widget_hide.
18030 (xg_initialize): Use GDK_KEY_g.
18031
18032 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18033 if ! HAVE_GTK3
18034 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18035
18036 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18037 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18038 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18039
18040 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18041
18042 * w32xfns.c (select_palette): Check success of RealizePalette against
18043 GDI_ERROR, not zero.
18044
18045 See ChangeLog.11 for earlier changes.
18046
18047 ;; Local Variables:
18048 ;; coding: utf-8
18049 ;; End:
18050
18051 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18052
18053 This file is part of GNU Emacs.
18054
18055 GNU Emacs is free software: you can redistribute it and/or modify
18056 it under the terms of the GNU General Public License as published by
18057 the Free Software Foundation, either version 3 of the License, or
18058 (at your option) any later version.
18059
18060 GNU Emacs is distributed in the hope that it will be useful,
18061 but WITHOUT ANY WARRANTY; without even the implied warranty of
18062 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18063 GNU General Public License for more details.
18064
18065 You should have received a copy of the GNU General Public License
18066 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.